Changeset View
Changeset View
Standalone View
Standalone View
core/kernel/nparser/nparser.php
Show First 20 Lines • Show All 320 Lines • ▼ Show 20 Line(s) | |||||
$tag = array_merge($tag, $splited); | $tag = array_merge($tag, $splited); | ||||
$tag['processed'] = false; | $tag['processed'] = false; | ||||
$tag['NP'] = $this->SplitParamsStr($tag['attrs']); | $tag['NP'] = $this->SplitParamsStr($tag['attrs']); | ||||
$o = ''; | $o = ''; | ||||
$tag['is_closing'] = $tag['opening'] == '</' || $tag['closing'] == '/>'; | $tag['is_closing'] = $tag['opening'] == '</' || $tag['closing'] == '/>'; | ||||
if (class_exists('_Tag_'.$tag['name'])) { // block tags should have special handling class | if (class_exists('_Tag_'.$tag['name'])) { // block tags should have special handling class | ||||
if ($tag['opening'] == '<') { | if ($tag['opening'] == '<') { | ||||
$class = '_Tag_'.$tag['name']; | $class = '_Tag_'.$tag['name']; | ||||
Lint: CodingStandard.Strings.ConcatenationSpacing.NoSpaceBefore: Expected 1 space before concat operator; 0 found | |||||
Expected 1 space after concat operator; 0 found Lint: CodingStandard.Strings.ConcatenationSpacing.NoSpaceAfter: Expected 1 space after concat operator; 0 found | |||||
/** @var _BlockTag $instance */ | |||||
$instance = new $class($tag); | $instance = new $class($tag); | ||||
$instance->Parser =& $this; | $instance->Parser =& $this; | ||||
/* @var $instance _BlockTag */ | |||||
$this->Stack[++$this->Level] =& $instance; | $this->Stack[++$this->Level] =& $instance; | ||||
$this->Buffers[$this->Level] = ''; | $this->Buffers[$this->Level] = ''; | ||||
$this->Cachable[$this->Level] = true; | $this->Cachable[$this->Level] = true; | ||||
$open_code = $instance->Open($tag); | $open_code = $instance->Open($tag); | ||||
if ($open_code === false) { | if ($open_code === false) { | ||||
return false; | return false; | ||||
} | } | ||||
$o .= $open_code; | $o .= $open_code; | ||||
▲ Show 20 Lines • Show All 171 Lines • ▼ Show 20 Line(s) | |||||
$this->TemplateName = $backup_template; | $this->TemplateName = $backup_template; | ||||
$this->TempalteFullPath = $backup_fullpath; | $this->TempalteFullPath = $backup_fullpath; | ||||
return $output; | return $output; | ||||
} | } | ||||
function &RunMainPage($pre_parsed) | function &RunMainPage($pre_parsed) | ||||
{ | { | ||||
/** @var kDBItem $page */ | |||||
$page = $this->Application->recallObject('st.-virtual'); | $page = $this->Application->recallObject('st.-virtual'); | ||||
/* @var $page kDBItem */ | |||||
if ($page->isLoaded()) { | if ($page->isLoaded()) { | ||||
// page found in database | // page found in database | ||||
$debug_mode = $this->Application->isDebugMode(); // don't cache debug output | $debug_mode = $this->Application->isDebugMode(); // don't cache debug output | ||||
$template_path = preg_replace('/^' . preg_quote(FULL_PATH, '/') . '/', '', $this->TempalteFullPath, 1); | $template_path = preg_replace('/^' . preg_quote(FULL_PATH, '/') . '/', '', $this->TempalteFullPath, 1); | ||||
$element = ($debug_mode ? 'DEBUG_MODE:' : '') . 'file=' . $template_path; | $element = ($debug_mode ? 'DEBUG_MODE:' : '') . 'file=' . $template_path; | ||||
$this->FullCachePage = $page->GetDBField('EnablePageCache'); | $this->FullCachePage = $page->GetDBField('EnablePageCache'); | ||||
▲ Show 20 Lines • Show All 222 Lines • ▼ Show 20 Line(s) | |||||
throw new ParserException($error_msg, 0, null, $error_tag); | throw new ParserException($error_msg, 0, null, $error_tag); | ||||
return false; | return false; | ||||
} | } | ||||
$m_processor =& $this->GetProcessor('m'); | $m_processor =& $this->GetProcessor('m'); | ||||
$flag_values = $m_processor->PreparePostProcess($params); | $flag_values = $m_processor->PreparePostProcess($params); | ||||
/** @var Closure $f_name */ | |||||
$f_name = $this->Elements[$params['name']]; | $f_name = $this->Elements[$params['name']]; | ||||
/* @var $f_name Closure */ | |||||
$ret = $f_name($this, $params); | $ret = $f_name($this, $params); | ||||
$ret = $m_processor->PostProcess($ret, $flag_values); | $ret = $m_processor->PostProcess($ret, $flag_values); | ||||
$block_params = $this->Params; // input parameters, but modified inside rendered block | $block_params = $this->Params; // input parameters, but modified inside rendered block | ||||
$this->PopParams(); | $this->PopParams(); | ||||
if (array_key_exists('result_to_var', $flag_values) && $flag_values['result_to_var']) { | if (array_key_exists('result_to_var', $flag_values) && $flag_values['result_to_var']) { | ||||
// when "result_to_var" used inside ParseBlock, then $$result_to_var parameter is set inside ParseBlock, | // when "result_to_var" used inside ParseBlock, then $$result_to_var parameter is set inside ParseBlock, | ||||
▲ Show 20 Lines • Show All 444 Lines • ▼ Show 20 Line(s) | |||||
* | * | ||||
* @param mixed $data | * @param mixed $data | ||||
* @param bool $raw_script | * @param bool $raw_script | ||||
* @param string $file_extension | * @param string $file_extension | ||||
* @return string | * @return string | ||||
*/ | */ | ||||
function CompressScript($data, $raw_script = false, $file_extension = '') | function CompressScript($data, $raw_script = false, $file_extension = '') | ||||
{ | { | ||||
/** @var MinifyHelper $minify_helper */ | |||||
$minify_helper = $this->Application->recallObject('MinifyHelper'); | $minify_helper = $this->Application->recallObject('MinifyHelper'); | ||||
/* @var $minify_helper MinifyHelper */ | |||||
if ($raw_script) { | if ($raw_script) { | ||||
$minify_helper->compressString($data, $file_extension); | $minify_helper->compressString($data, $file_extension); | ||||
return $data; | return $data; | ||||
} | } | ||||
return $minify_helper->CompressScriptTag($data); | return $minify_helper->CompressScriptTag($data); | ||||
Show All 15 Lines |
Expected 1 space before concat operator; 0 found