/** * @see TemplatePluginPrefilter::execute() */ public function execute($sourceContent, TemplateScriptingCompiler $compiler) { $ldq = preg_quote($compiler->getLeftDelimiter(), '~'); $rdq = preg_quote($compiler->getRightDelimiter(), '~'); $sourceContent = preg_replace("~{$ldq}icon{$rdq}([\\w\\.]+){$ldq}/icon{$rdq}~", '{literal}<?php echo StyleManager::getStyle()->getIconPath(\'$1\'); ?>{/literal}', $sourceContent); return $sourceContent; }
/** * @see TemplatePluginPrefilter::execute() */ public function execute($sourceContent, TemplateScriptingCompiler $compiler) { $ldq = preg_quote($compiler->getLeftDelimiter(), '~'); $rdq = preg_quote($compiler->getRightDelimiter(), '~'); $sourceContent = preg_replace("~{$ldq}lang{$rdq}([\\w\\.]+){$ldq}/lang{$rdq}~e", 'WCF::getLanguage()->get(\'$1\')', $sourceContent); return $sourceContent; }
/** * @see TemplatePluginPrefilter::execute() */ public function execute($sourceContent, TemplateScriptingCompiler $compiler) { $ldq = preg_quote($compiler->getLeftDelimiter(), '~'); $rdq = preg_quote($compiler->getRightDelimiter(), '~'); $sourceContent = preg_replace_callback("~{$ldq}lang{$rdq}([\\w\\.]+){$ldq}/lang{$rdq}~", array($this, 'executeCallback'), $sourceContent); return $sourceContent; }
/** * @see TemplatePluginCompiler::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 TemplatePluginCompiler::executeEnd() */ public function executeEnd(TemplateScriptingCompiler $compiler) { $compiler->popTag('staticlang'); $hash = StringUtil::getRandomID(); return "<?php \$_lang" . $hash . " = ob_get_contents(); ob_end_clean(); echo WCF::getLanguage()->get(\$_lang" . $hash . "); ?>"; }
/** * @see TemplatePluginCompiler::executeEnd() */ public function executeEnd(TemplateScriptingCompiler $compiler) { throw new SystemException($compiler->formatSyntaxError("unknown tag {/fetch}", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()), 12003); }
/** * @see TemplatePluginCompiler::executeEnd() */ public function executeEnd(TemplateScriptingCompiler $compiler) { $compiler->popTag('icons'); $hash = StringUtil::getRandomID(); return '<?php $_icons'.$hash.' = ob_get_contents(); ob_end_clean(); echo IconsUtil::getIconPath($_icons'.$hash.'); ?>'; }
/** * @see TemplatePluginCompiler::executeEnd() */ public function executeEnd(TemplateScriptingCompiler $compiler) { $compiler->popTag('icon'); $hash = StringUtil::getRandomID(); return "<?php \$_icon" . $hash . " = ob_get_contents(); ob_end_clean(); echo StyleManager::getStyle()->getIconPath(\$_icon" . $hash . "); ?>"; }
/** * @see TemplatePluginCompiler::executeEnd() */ public function executeEnd(TemplateScriptingCompiler $compiler) { $compiler->popTag('lang'); $hash = StringUtil::getRandomID(); return "<?php \$_lang" . $hash . " = ob_get_contents(); ob_end_clean(); echo WCF::getLanguage()->getDynamicVariable(\$_lang" . $hash . ", \$this->tagStack[count(\$this->tagStack) - 1][1]); array_pop(\$this->tagStack); ?>"; }