folder = $folder; } if (is_array($config)) { $this->config = $config; } $this->structs = &$structs; $this->content = &$content; $this->domains = &$domains; } function dispatch($string) { // find occorances of {| keyword |} $pattern = "/\{\|(.+?)\|\}/s"; $f = preg_match_all($pattern, $string,$matches,PREG_PATTERN_ORDER); for ($i=0;$i<$f;$i++) { $body = preg_split("/\R/",trim($matches[1][$i])); $request = explode(":", trim(array_shift($body))); $new = $this->content_element($request,$body); $string = str_replace($matches[0][$i],$new,$string); } return $string; } function content_element($request = [], $body = null) { $f3 = \Base::instance(); $md = new \freaParsedown(); $md->deactivate_ol(); $new = ""; switch($request[0]) { case 'test': $new="seems to work"; break; case ';': $new=""; break; case 'path': $new="/".$this->folder; break; case 'space': $new=sprintf("
", $request[1] ); break; case 'span': $new=sprintf("%s", $request[1], $request[2] ? : implode("\n",$body) ); break; case 'small-text': if(count($body)) { $new=sprintf("