Index: branches/RC/core/kernel/db/db_tag_processor.php
===================================================================
diff -u -r9033 -r9238
--- branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 9033)
+++ branches/RC/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 9238)
@@ -1287,10 +1287,15 @@
$preset_name = replaceModuleSection($params['title_preset']);
$title_presets = $this->Application->getUnitOption($this->Prefix,'TitlePresets');
$title_info = getArrayValue($title_presets, $preset_name);
- if($title_info === false) return str_replace('#preset_name#', $preset_name, $params['title']);
+ if ($title_info === false) {
+ $title = str_replace('#preset_name#', $preset_name, $params['title']);
+ if ($this->Application->ConfigValue('UseSmallHeader') && isset($params['group_title']) && $params['group_title']) {
+ $title .= ' - '.$params['group_title'];
+ }
+ return $title;
+ }
- if( getArrayValue($title_presets,'default') )
- {
+ if (getArrayValue($title_presets,'default')) {
// use default labels + custom labels specified in preset used
$title_info = array_merge_recursive2($title_presets['default'], $title_info);
}
@@ -1304,8 +1309,7 @@
$prefixes = getArrayValue($title_info,'prefixes');
$all_tag_params = getArrayValue($title_info,'tag_params');
- if($prefixes)
- {
+ if ($prefixes) {
// extract tag_perams passed directly to SectionTitle tag for specific prefix
foreach ($params as $tp_name => $tp_value) {
if (preg_match('/(.*)\[(.*)\]/', $tp_name, $regs)) {
@@ -1315,31 +1319,27 @@
}
$tag_params = Array();
- foreach($prefixes as $prefix_special)
- {
+ foreach ($prefixes as $prefix_special) {
$prefix_data = $this->Application->processPrefix($prefix_special);
$prefix_data['prefix_special'] = rtrim($prefix_data['prefix_special'],'.');
- if($all_tag_params)
- {
+ if ($all_tag_params) {
$tag_params = getArrayValue($all_tag_params, $prefix_data['prefix_special']);
- if(!$tag_params) $tag_params = Array();
+ if (!$tag_params) $tag_params = Array();
}
$tag_params = array_merge_recursive2($params, $tag_params);
$objects[ $prefix_data['prefix_special'] ] =& $this->Application->recallObject($prefix_data['prefix_special'], $prefix_data['prefix'], $tag_params);
$object_status[ $prefix_data['prefix_special'] ] = $objects[ $prefix_data['prefix_special'] ]->IsNewItem() ? 'new' : 'edit';
// a. set object's status field (adding item/editing item) for each object in title
- if( getArrayValue($title_info[ $object_status[ $prefix_data['prefix_special'] ].'_status_labels' ],$prefix_data['prefix_special']) )
- {
+ if (getArrayValue($title_info[ $object_status[ $prefix_data['prefix_special'] ].'_status_labels' ],$prefix_data['prefix_special'])) {
$status_labels[ $prefix_data['prefix_special'] ] = $title_info[ $object_status[ $prefix_data['prefix_special'] ].'_status_labels' ][ $prefix_data['prefix_special'] ];
$title = str_replace('#'.$prefix_data['prefix_special'].'_status#', $status_labels[ $prefix_data['prefix_special'] ], $title);
}
// b. setting object's titlefield value (in titlebar ONLY) to default in case if object beeing created with no titlefield filled in
- if( $object_status[ $prefix_data['prefix_special'] ] == 'new' )
- {
+ if ($object_status[ $prefix_data['prefix_special'] ] == 'new') {
$new_value = $this->getInfo( $objects[ $prefix_data['prefix_special'] ], 'titlefield' );
if(!$new_value && getArrayValue($title_info['new_titlefield'],$prefix_data['prefix_special']) ) $new_value = $this->Application->Phrase($title_info['new_titlefield'][ $prefix_data['prefix_special'] ]);
$title = str_replace('#'.$prefix_data['prefix_special'].'_titlefield#', $new_value, $title);
@@ -1365,9 +1365,17 @@
// replace trailing spaces inside title preset + '' occurences into single space
$title = preg_replace('/[ ]*\'\'[ ]*/', ' ', $title);
- $cut_first = getArrayValue($params,'cut_first');
- if( $cut_first && strlen($title) > $cut_first && !preg_match('/(.*)<\/a>/',$title) ) $title = substr($title, 0, $cut_first).' ...';
+ if ($this->Application->ConfigValue('UseSmallHeader') && isset($params['group_title']) && $params['group_title']) {
+ $title .= ' - '.$params['group_title'];
+ }
+ $cut_first = getArrayValue($params, 'cut_first');
+ if ($cut_first && strlen($title) > $cut_first) {
+ if (!preg_match('/(.*)<\/a>/',$title)) {
+ $title = substr($title, 0, $cut_first).' ...';
+ }
+ }
+
return $title;
}