/** * @see wcf\system\template\IPrefilterTemplatePlugin::execute() */ public function execute($templateName, $sourceContent, TemplateScriptingCompiler $compiler) { $ldq = preg_quote($compiler->getLeftDelimiter(), '~'); $rdq = preg_quote($compiler->getRightDelimiter(), '~'); $sourceContent = preg_replace_callback("~{$ldq}hascontent{$rdq}(.*){$ldq}content{$rdq}(.*){$ldq}\\/content{$rdq}(.*)({$ldq}hascontentelse{$rdq}(.*))?{$ldq}\\/hascontent{$rdq}~sU", array('self', 'replaceContentCallback'), $sourceContent); return $sourceContent; }
/** * @see wcf\system\template\ITemplatePluginPrefilter::execute() */ public function execute($templateName, $sourceContent, TemplateScriptingCompiler $compiler) { $ldq = preg_quote($compiler->getLeftDelimiter(), '~'); $rdq = preg_quote($compiler->getRightDelimiter(), '~'); $sourceContent = preg_replace("~{$ldq}icon size='?([SML])'?{$rdq}([\\w\\.]+){$ldq}/icon{$rdq}~", '{literal}<?php echo \\wcf\\system\\style\\StyleHandler::getInstance()->getStyle()->getIconPath(\'$2\', \'$1\'); ?>{/literal}', $sourceContent); return $sourceContent; }
/** * @see wcf\system\template\IPrefilterTemplatePlugin::execute() */ public function execute($templateName, $sourceContent, TemplateScriptingCompiler $compiler) { $ldq = preg_quote($compiler->getLeftDelimiter(), '~'); $rdq = preg_quote($compiler->getRightDelimiter(), '~'); $sourceContent = preg_replace_callback("~{$ldq}lang{$rdq}([\\w\\.]+){$ldq}/lang{$rdq}~", function ($match) { return WCF::getLanguage()->get($match[1]); }, $sourceContent); return $sourceContent; }
/** * @see \wcf\system\template\ICompilerTemplatePlugin::executeEnd() */ public function executeEnd(TemplateScriptingCompiler $compiler) { $compiler->popTag('implode'); $tagArgs = array_pop($this->tagStack); $phpCode = "<?php\n"; $phpCode .= "if (++\$_i" . $tagArgs['hash'] . " < \$_length" . $tagArgs['hash'] . ") { echo " . $tagArgs['glue'] . "; }\n"; $phpCode .= "} ?>"; return $phpCode; }
/** * @see wcf\system\template\IPrefilterTemplatePlugin::execute() */ public function execute($templateName, $sourceContent, TemplateScriptingCompiler $compiler) { $ldq = preg_quote($compiler->getLeftDelimiter(), '~'); $rdq = preg_quote($compiler->getRightDelimiter(), '~'); $sourceContent = preg_replace_callback("~{$ldq}event\\ name\\=\\'([\\w]+)\\'{$rdq}~", function ($match) use($templateName) { return WCF::getTPL()->getTemplateListenerCode($templateName, $match[1]); }, $sourceContent); return $sourceContent; }
/** * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd() */ public function executeEnd(TemplateScriptingCompiler $compiler) { $compiler->popTag('lang'); return "<?php echo wcf\system\WCF::getLanguage()->getDynamicVariable(ob_get_clean(), \$this->tagStack[count(\$this->tagStack) - 1][1], (isset(\$this->tagStack[count(\$this->tagStack) - 1][1]['__optional']) ? \$this->tagStack[count(\$this->tagStack) - 1][1]['__optional'] : false)); array_pop(\$this->tagStack); ?>"; }
/** * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd() */ public function executeEnd(TemplateScriptingCompiler $compiler) { throw new SystemException($compiler->formatSyntaxError("unknown tag {/append}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo())); }
/** * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd() */ public function executeEnd(TemplateScriptingCompiler $compiler) { $compiler->popTag('icon'); return "<?php echo wcf\\system\\style\\StyleHandler::getInstance()->getStyle()->getIconPath(ob_get_clean(), '" . $this->size . "'); ?>"; }
/** * @see wcf\system\template\ICompilerTemplatePlugin::executeEnd() */ public function executeEnd(TemplateScriptingCompiler $compiler) { $compiler->popTag('staticlang'); return "<?php echo \\wcf\\system\\WCF::getLanguage()->get(ob_get_clean()); ?>"; }