Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/kernel/db/db_tag_processor.php
Show First 20 Lines • Show All 1953 Lines • ▼ Show 20 Line(s) | |||||
$section_data =& $sections_helper->getSectionData($section); | $section_data =& $sections_helper->getSectionData($section); | ||||
$title = str_replace('#section_label#', '!' . $section_data['label'] . '!', $title); | $title = str_replace('#section_label#', '!' . $section_data['label'] . '!', $title); | ||||
} | } | ||||
// 2. replace phrases if any found in format string | // 2. replace phrases if any found in format string | ||||
$title = $this->Application->ReplaceLanguageTags($title, false); | $title = $this->Application->ReplaceLanguageTags($title, false); | ||||
// 3. find and replace any replacement vars | // 3. find and replace any replacement vars | ||||
preg_match_all('/#(.*_.*)#/Uis',$title,$rets); | preg_match_all('/#([a-z\d\-]+?_[a-z\d]+?)#/is', $title, $rets); | ||||
if ($rets[1]) { | if ($rets[1]) { | ||||
$replacement_vars = array_keys( array_flip($rets[1]) ); | $replacement_vars = array_keys( array_flip($rets[1]) ); | ||||
foreach ($replacement_vars as $replacement_var) { | foreach ($replacement_vars as $replacement_var) { | ||||
$var_info = explode('_',$replacement_var,2); | $var_info = explode('_',$replacement_var,2); | ||||
$object =& $objects[ $var_info[0] ]; | $object =& $objects[ $var_info[0] ]; | ||||
$new_value = $this->getInfo($object,$var_info[1]); | $new_value = $this->getInfo($object,$var_info[1]); | ||||
$title = str_replace('#'.$replacement_var.'#', $new_value, $title); | $title = str_replace('#'.$replacement_var.'#', $new_value, $title); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1133 Lines • Show Last 20 Lines |