Index: branches/RC/core/kernel/application.php =================================================================== diff -u -N -r11520 -r11538 --- branches/RC/core/kernel/application.php (.../application.php) (revision 11520) +++ branches/RC/core/kernel/application.php (.../application.php) (revision 11538) @@ -23,9 +23,9 @@ var $InitDone = false; /** - * Holds internal TemplateParser object + * Holds internal NParser object * @access private - * @var TemplateParser + * @var NParser */ var $Parser; @@ -1266,7 +1266,15 @@ return $this->Conn; } - function ParseBlock($params,$pass_params=0,$as_template=false) + /** + * Allows to parse given block name or include template + * + * @param Array $params Parameters to pass to block/template. Reserved parameter "name" used to specify block/template name. + * @param Array $pass_params Forces to pass current parser params to this block/template. Use with cauntion, because you can accidently pass "block_no_data" parameter. + * @param bool $as_template + * @return string + */ + function ParseBlock($params, $pass_params = 0, $as_template = false) { if (substr($params['name'], 0, 5) == 'html:') return substr($params['name'], 6); return $this->Parser->ParseBlock($params, $pass_params, $as_template); @@ -1504,8 +1512,18 @@ } $pass_info = array_unique( explode(',', $pass) ); // array( prefix[.special], prefix[.special] ... + + // we need to keep that sorting despite the sorting below, because this sorts prefixes with same priority by name sort($pass_info, SORT_STRING); // to be prefix1,prefix1.special1,prefix1.special2,prefix3.specialX + foreach ($pass_info as $prefix) { + list($prefix_only) = explode('.', $prefix, 1); + $sorted[$prefix] = $this->getUnitOption($prefix_only, 'PassPriority', 0); + } + + arsort($sorted); + $pass_info = array_keys($sorted); + // ensure that "m" prefix is at the beginning $main_index = array_search('m', $pass_info); if ($main_index !== false) {