/** * @see TemplatePluginCompiler::executeStart() */ public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) { $compiler->pushTag('lang'); $newTagArgs = array(); foreach ($tagArgs as $key => $arg) { $newTagArgs[$key] = 'StringUtil::encodeHTML(' . $arg . ')'; } $tagArgs = $compiler->makeArgString($newTagArgs); return "<?php \$this->tagStack[] = array('lang', array({$tagArgs})); ob_start(); ?>"; }
/** * @see TemplatePluginCompiler::executeStart() */ public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) { $compiler->pushTag('implode'); if (!isset($tagArgs['from'])) { throw new SystemException($compiler->formatSyntaxError("missing 'from' argument in implode tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()), 12001); } if (!isset($tagArgs['item'])) { throw new SystemException($compiler->formatSyntaxError("missing 'item' argument in implode tag", $compiler->getCurrentIdentifier(), $compiler->getCurrentLineNo()), 12001); } $hash = StringUtil::getRandomID(); $glue = isset($tagArgs['glue']) ? $tagArgs['glue'] : "', '"; $this->tagStack[] = array('hash' => $hash, 'glue' => $glue); $phpCode = "<?php\n"; $phpCode .= "\$_length" . $hash . " = count(" . $tagArgs['from'] . ");\n"; $phpCode .= "\$_i" . $hash . " = 0;\n"; $phpCode .= "foreach (" . $tagArgs['from'] . " as " . (isset($tagArgs['key']) ? (StringUtil::substring($tagArgs['key'], 0, 1) != '$' ? "\$this->v[" . $tagArgs['key'] . "]" : $tagArgs['key']) . " => " : '') . (StringUtil::substring($tagArgs['item'], 0, 1) != '$' ? "\$this->v[" . $tagArgs['item'] . "]" : $tagArgs['item']) . ") { ?>"; return $phpCode; }
/** * @see TemplatePluginCompiler::executeStart() */ public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) { $compiler->pushTag('staticlang'); return "<?php ob_start(); ?>"; }
/** * @see TemplatePluginCompiler::executeStart() */ public function executeStart($tagArgs, TemplateScriptingCompiler $compiler) { $compiler->pushTag('icons'); return '<?php ob_start(); ?>'; }