Index: branches/5.0.x/core/kernel/db/db_tag_processor.php =================================================================== diff -u -r12343 -r12382 --- branches/5.0.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 12343) +++ branches/5.0.x/core/kernel/db/db_tag_processor.php (.../db_tag_processor.php) (revision 12382) @@ -1,6 +1,6 @@ SelectParam($params, 'types'); - $except = $this->SelectParam($params, 'except'); - $list_name = $this->SelectParam($params, 'list_name'); + $types = array_key_exists('types', $params) ? $params['types'] : ''; + $except = array_key_exists('except', $params) ? $params['except'] : ''; + $list_name = array_key_exists('list_name', $params) ? $params['list_name'] : ''; + if (!$list_name) { $list_name = $this->Application->Parser->GetParam('list_name'); } - return $types.$except.$list_name; + return $types . $except . $list_name; } /** @@ -435,7 +436,11 @@ { $list =& $this->GetList($params); $ret = $list->getPrefixSpecial(); - if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/'); + + if (array_key_exists('as_preg', $params) && $params['as_preg']) { + $ret = preg_quote($ret, '/'); + } + return $ret; } @@ -730,68 +735,72 @@ $object =& $this->getObject($params); - if ( $this->HasParam($params, 'db') ) - { + if (array_key_exists('db', $params) && $params['db']) { $value = $object->GetDBField($field); } - else - { - if( $this->HasParam($params, 'currency') ) - { + else { + if (array_key_exists('currency', $params) && $params['currency']) { $iso = $this->GetISO($params['currency']); $original = $object->GetDBField($field); $value = $this->ConvertCurrency($original, $iso); $object->SetDBField($field, $value); $object->Fields[$field]['converted'] = true; } - $format = getArrayValue($params, 'format'); + $format = array_key_exists('format', $params) ? $params['format'] : false; if (!$format || $format == '$format') { $format = null; } $value = $object->GetField($field, $format); - if( $this->SelectParam($params, 'negative') ) - { - if(strpos($value, '-') === 0) - { + if (array_key_exists('negative', $params) && $params['negative']) { + if (strpos($value, '-') === 0) { $value = substr($value, 1); } - else - { - $value = '-'.$value; + else { + $value = '-' . $value; } } - if( $this->HasParam($params, 'currency') ) - { + if (array_key_exists('currency', $params) && $params['currency']) { $value = $this->AddCurrencySymbol($value, $iso); $params['no_special'] = 1; } } - if( !$this->HasParam($params, 'no_special') ) $value = htmlspecialchars($value); - if( getArrayValue($params,'checked' ) ) $value = ($value == ( isset($params['value']) ? $params['value'] : 1)) ? 'checked' : ''; - if( isset($params['plus_or_as_label']) ) { + if (!array_key_exists('no_special', $params) || !$params['no_special']) { + $value = htmlspecialchars($value); + } + + if (array_key_exists('checked', $params) && $params['checked']) { + $value = ($value == ( isset($params['value']) ? $params['value'] : 1)) ? 'checked' : ''; + } + + if (array_key_exists('plus_or_as_label', $params) && $params['plus_or_as_label']) { $value = substr($value, 0,1) == '+' ? substr($value, 1) : $this->Application->Phrase($value); } - elseif( isset($params['as_label']) && $params['as_label'] ) $value = $this->Application->Phrase($value); + elseif (array_key_exists('as_label', $params) && $params['as_label']) { + $value = $this->Application->Phrase($value); + } $first_chars = $this->SelectParam($params,'first_chars,cut_first'); - if($first_chars) - { + if ($first_chars) { $needs_cut = mb_strlen($value) > $first_chars; $value = mb_substr($value, 0, $first_chars); if ($needs_cut) $value .= ' ...'; } - if( getArrayValue($params,'nl2br' ) ) $value = nl2br($value); - if ($value != '') $this->Application->Parser->DataExists = true; + if (array_key_exists('nl2br', $params) && $params['nl2br']) { + $value = nl2br($value); + } - if( $this->HasParam($params, 'currency') ) - { - //restoring value in original currency, for other Field tags to work properly + if ($value != '') { + $this->Application->Parser->DataExists = true; + } + + if (array_key_exists('currency', $params) && $params['currency']) { + // restoring value in original currency, for other Field tags to work properly $object->SetDBField($field, $original); } @@ -810,26 +819,6 @@ $object->SetDBField($dst_field, $src_object->GetDBField($src_field)); } - /** - * Checks if parameter is passed - * Note: works like Tag and line simple method too - * - * @param Array $params - * @param string $param_name - * @return bool - */ - function HasParam($params, $param_name = null) - { - if ( !isset($param_name) ) { - $param_name = $this->SelectParam($params, 'name'); - $params = $this->Application->Parser->Params; - } - - $value = isset($params[$param_name]) ? $params[$param_name] : false; - - return $value && ($value != '$'.$param_name); - } - function PhraseField($params) { $field_label = $this->Field($params); @@ -851,7 +840,7 @@ { $object =& $this->getObject($params); - $skip_fields = getArrayValue($params, 'except'); + $skip_fields = array_key_exists('except', $params) ? $params['except'] : false; $skip_fields = $skip_fields ? explode(',', $skip_fields) : Array(); return $object->HasErrors($skip_fields); @@ -894,7 +883,8 @@ } $options = $object->GetFieldOptions($field); - return getArrayValue($options,'required'); + + return array_key_exists('required', $options) ? $options['required'] : false; } function FieldOption($params) @@ -920,7 +910,7 @@ $options = $field_options['options']; - if ($this->HasParam($params, 'has_empty')) { + if (array_key_exists('has_empty', $params) && $params['has_empty']) { $empty_value = array_key_exists('empty_value', $params) ? $params['empty_value'] : ''; $options = array_merge_recursive2(Array ($empty_value => ''), $options); // don't use other array merge function, because they will reset keys !!! } @@ -936,14 +926,14 @@ $block_params['field_name'] = $this->InputName($params); // depricated (produces warning when used as grid filter), but used in Front-End (submission create), admin (submission view) } - $selected_param_name = getArrayValue($params, 'selected_param'); + $selected_param_name = array_key_exists('selected_param', $params) ? $params['selected_param'] : false; if (!$selected_param_name) { $selected_param_name = $params['selected']; } $selected = $params['selected']; $o = ''; - if ($this->HasParam($params, 'no_empty') && !getArrayValue($options, '')) { + if (array_key_exists('no_empty', $params) && $params['no_empty'] && !getArrayValue($options, '')) { // removes empty option, when present (needed?) array_shift($options); } @@ -989,18 +979,17 @@ $format = $options[ $this->SelectParam($params, 'input_format') ? 'input_format' : 'format' ]; - $formatter_class = getArrayValue($options,'formatter'); + $formatter_class = array_key_exists('formatter', $options) ? $options['formatter'] : false; + if ($formatter_class) { $formatter =& $this->Application->recallObject($formatter_class); - $human_format = getArrayValue($params,'human'); - $edit_size = getArrayValue($params,'edit_size'); - $sample = getArrayValue($params,'sample'); - if($sample) - { + $human_format = array_key_exists('human', $params) ? $params['human'] : false; + $edit_size = array_key_exists('edit_size', $params) ? $params['edit_size'] : false; + $sample = array_key_exists('sample', $params) ? $params['sample'] : false; + if ($sample) { return $formatter->GetSample($field, $options, $object); } - elseif($human_format || $edit_size) - { + elseif ($human_format || $edit_size) { $format = $formatter->HumanFormat($format); return $edit_size ? strlen($format) : $format; } @@ -1209,7 +1198,7 @@ $id = $params['force_id']; } else { - $id_field = getArrayValue($params, 'IdField'); + $id_field = array_key_exists('IdField', $params) ? $params['IdField'] : false; $id = $id_field ? $object->GetDBField($id_field) : $object->GetID(); } @@ -1231,7 +1220,11 @@ list($id, $field) = $this->prepareInputName($params); $ret = $this->getPrefixSpecial().'['.$id.']['.$field.']'; - if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/'); + + if (array_key_exists('as_preg', $params) && $params['as_preg']) { + $ret = preg_quote($ret, '/'); + } + return $ret; } @@ -1248,8 +1241,11 @@ list($id, $field) = $this->prepareInputName($params); $ret = 'field_modifiers['.$this->getPrefixSpecial().']['.$field.']['.$params['type'].']'; - if( getArrayValue($params, 'as_preg') ) $ret = preg_quote($ret, '/'); + if (array_key_exists('as_preg', $params) && $params['as_preg']) { + $ret = preg_quote($ret, '/'); + } + if (isset($params['value'])) { $object =& $this->getObject($params); $field_modifiers[$field][$params['type']] = $params['value']; @@ -1485,9 +1481,8 @@ function FieldEquals($params) { $object =& $this->getObject($params); - $ret = $object->GetDBField($this->SelectParam($params, 'name,field')) == $params['value']; -// if( getArrayValue($params,'inverse') ) $ret = !$ret; - return $ret; + + return $object->GetDBField( $this->SelectParam($params, 'name,field') ) == $params['value']; } /** @@ -1566,7 +1561,8 @@ { $preset_name = replaceModuleSection($params['title_preset']); $title_presets = $this->Application->getUnitOption($this->Prefix,'TitlePresets'); - $title_info = getArrayValue($title_presets, $preset_name); + $title_info = array_key_exists($preset_name, $title_presets) ? $title_presets[$preset_name] : false; + 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']) { @@ -1575,7 +1571,7 @@ return $title; } - if (getArrayValue($title_presets,'default')) { + if (array_key_exists('default', $title_presets) && $title_presets['default']) { // use default labels + custom labels specified in preset used $title_info = array_merge_recursive2($title_presets['default'], $title_info); } @@ -1587,8 +1583,9 @@ $object_status = Array(); $status_labels = Array(); - $prefixes = getArrayValue($title_info,'prefixes'); - $all_tag_params = getArrayValue($title_info,'tag_params'); + $prefixes = array_key_exists('prefixes', $title_info) ? $title_info['prefixes'] : false; + $all_tag_params = array_key_exists('tag_params', $title_info) ? $title_info['tag_params'] : false; + if ($prefixes) { // extract tag_perams passed directly to SectionTitle tag for specific prefix foreach ($params as $tp_name => $tp_value) { @@ -1605,7 +1602,9 @@ 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); @@ -1659,7 +1658,8 @@ $title .= ' - '.$params['group_title']; } - $cut_first = getArrayValue($params, 'cut_first'); + $cut_first = array_key_exists('cut_first', $params) && $params['cut_first']; + if ($cut_first && mb_strlen($title) > $cut_first) { if (!preg_match('/(.*)<\/a>/',$title)) { $title = mb_substr($title, 0, $cut_first).' ...'; @@ -1829,8 +1829,8 @@ */ function SaveWarning($params) { - $main_prefix = getArrayValue($params, 'main_prefix'); - if ($main_prefix && $main_prefix != '$main_prefix') { + $main_prefix = array_key_exists('main_prefix', $params) ? $params['main_prefix'] : false; + if ($main_prefix) { $top_prefix = $main_prefix; } else { @@ -1902,35 +1902,55 @@ $ret = $ret[ $params['type'] ]; } - if( !$this->HasParam($params, 'no_special') ) $ret = htmlspecialchars($ret); + if (!array_key_exists('no_special', $params) || !$params['no_special']) { + $ret = htmlspecialchars($ret); + } + return $ret; } return ''; } + /** + * Tells, that at least one of search filters is used by now + * + * @param Array $params + * @return bool + */ + function SearchActive($params) + { + if ($this->Application->RecallVar($this->getPrefixSpecial() . '_search_keyword')) { + // simple search filter is used + return true; + } + + $view_name = $this->Application->RecallVar($this->getPrefixSpecial().'_current_view'); + $custom_filter = $this->Application->RecallPersistentVar($this->getPrefixSpecial().'_custom_filter.'.$view_name/*, ALLOW_DEFAULT_SETTINGS*/); + $custom_filter = $custom_filter ? unserialize($custom_filter) : Array(); + + return array_key_exists($params['grid'], $custom_filter); + } + function SearchFormat($params) { $field = $params['field']; $object =& $this->GetList($params); $options = $object->GetFieldOptions($field); - $format = $options[ $this->SelectParam($params, 'input_format') ? 'input_format' : 'format' ]; + $formatter_class = array_key_exists('formatter', $options) ? $options['formatter'] : false; - $formatter_class = getArrayValue($options,'formatter'); - if($formatter_class) - { + if ($formatter_class) { $formatter =& $this->Application->recallObject($formatter_class); - $human_format = getArrayValue($params,'human'); - $edit_size = getArrayValue($params,'edit_size'); - $sample = getArrayValue($params,'sample'); - if($sample) - { + $human_format = array_key_exists('human', $params) ? $params['human'] : false; + $edit_size = array_key_exists('edit_size', $params) ? $params['edit_size'] : false; + $sample = array_key_exists('sample', $params) ? $params['sample'] : false; + + if ($sample) { return $formatter->GetSample($field, $options, $object); } - elseif($human_format || $edit_size) - { + elseif ($human_format || $edit_size) { $format = $formatter->HumanFormat($format); return $edit_size ? strlen($format) : $format; } @@ -2081,8 +2101,7 @@ { $ret = EXPORT_PATH.'/'; - if( getArrayValue($params, 'as_url') ) - { + if (array_key_exists('as_url', $params) && $params['as_url']) { $ret = str_replace( FULL_PATH.'/', $this->Application->BaseURL(), $ret); } Index: branches/5.0.x/core/admin_templates/languages/email_message_list.tpl =================================================================== diff -u -r12244 -r12382 --- branches/5.0.x/core/admin_templates/languages/email_message_list.tpl (.../email_message_list.tpl) (revision 12244) +++ branches/5.0.x/core/admin_templates/languages/email_message_list.tpl (.../email_message_list.tpl) (revision 12382) @@ -63,6 +63,10 @@ tr.row-disabled td { background-color: #FFDFE0; } + + tr.grid-data-row-even.row-disabled td { + background-color: #F4D4D5; + } Index: branches/5.0.x/core/admin_templates/img/tab_back.jpg =================================================================== diff -u -r12117 -r12382 Binary files differ Index: branches/5.0.x/core/units/permissions/permissions_tag_processor.php =================================================================== diff -u -r12299 -r12382 --- branches/5.0.x/core/units/permissions/permissions_tag_processor.php (.../permissions_tag_processor.php) (revision 12299) +++ branches/5.0.x/core/units/permissions/permissions_tag_processor.php (.../permissions_tag_processor.php) (revision 12382) @@ -1,6 +1,6 @@ Application->ModuleInfo as $module_name => $module_data) { if (!$this->Application->prefixRegistred($module_data['Var']) || !$this->Application->getUnitOption($module_data['Var'], 'CatalogItem')) continue; $params['item_prefix'] = $module_data['Var']; - $ret .= $this->Application->ProcessParsedTag('m', 'MyInclude', $params); + $ret .= $this->Application->IncludeTemplate($params); } + return $ret; } Index: branches/5.0.x/themes/default2009/platform/elements/forms.elm.tpl =================================================================== diff -u -r12337 -r12382 --- branches/5.0.x/themes/default2009/platform/elements/forms.elm.tpl (.../forms.elm.tpl) (revision 12337) +++ branches/5.0.x/themes/default2009/platform/elements/forms.elm.tpl (.../forms.elm.tpl) (revision 12382) @@ -95,7 +95,7 @@
" value="" tabindex="" maxlength="" style=""> - + @@ -153,7 +153,7 @@ - + Index: branches/5.0.x/core/admin_templates/tree.tpl =================================================================== diff -u -r12117 -r12382 --- branches/5.0.x/core/admin_templates/tree.tpl (.../tree.tpl) (revision 12117) +++ branches/5.0.x/core/admin_templates/tree.tpl (.../tree.tpl) (revision 12382) @@ -91,16 +91,23 @@ } function setCatalogTab($prefix) { - var $ret = checkEditMode(); + var $ret = checkEditMode(false); if ($ret) { var $right_frame = getFrame('main'); var $catalog_type = (typeof $right_frame.$Catalog != 'undefined') ? $right_frame.$Catalog.type : ''; + // highlight "Structure & Data" node, when one of it's shortcut nodes are clicked + + var $structure_node = the_tree.locateItemByURL(''); + if ($catalog_type == 'AdvancedView') { $right_frame.$Catalog.switchTab($prefix); - return 1; // this opens folder, but disables click + return $structure_node; // this opens folder, but disables click } + + // this disabled click and causes other node to be highlighted + return $structure_node; } return $ret; Index: branches/5.0.x/core/admin_templates/groups/groups_edit_permissions.tpl =================================================================== diff -u -r12117 -r12382 --- branches/5.0.x/core/admin_templates/groups/groups_edit_permissions.tpl (.../groups_edit_permissions.tpl) (revision 12117) +++ branches/5.0.x/core/admin_templates/groups/groups_edit_permissions.tpl (.../groups_edit_permissions.tpl) (revision 12382) @@ -83,7 +83,7 @@
" alt="" border="0"/> - [, ] + [, ]
Index: branches/5.0.x/core/admin_templates/img/tab_back3.jpg =================================================================== diff -u -r12117 -r12382 Binary files differ Index: branches/5.0.x/core/admin_templates/incs/cms.css =================================================================== diff -u -r12375 -r12382 --- branches/5.0.x/core/admin_templates/incs/cms.css (.../cms.css) (revision 12375) +++ branches/5.0.x/core/admin_templates/incs/cms.css (.../cms.css) (revision 12382) @@ -33,12 +33,32 @@ margin-top: -10px; } +div.cms-edit-design-btn-container { + position: absolute; + margin-left: -10px; + margin-top: -10px; + display: none; +} + +div.cms-edit-design-btn-container div.cms-edit-block-btn, div.cms-edit-design-btn-container div.cms-edit-design-btn { + float: left; + display: block; + position: relative; + margin: 0px; +} + +div.cms-edit-design-btn-container div.cms-edit-design-btn { + margin-left: 4px; +} + /* === Styles for "Section Properties" button === */ div.cms-section-properties-btn { float: right; position: relative; border: 2px solid #A1D0A1; background-color: #CCFF00; + opacity: 0.5; + filter: alpha(opacity=50); } div.cms-section-properties-btn-container { @@ -70,8 +90,6 @@ margin-left: -10px; border: 2px solid #A1D0A1; background-color: #CCFF00; - /*opacity: 0.5; - filter: alpha(opacity=50);*/ display: none; } @@ -91,17 +109,21 @@ width: auto; color: black; cursor: pointer; + /*opacity: 0.5; + filter: alpha(opacity=50);*/ -moz-border-radius: 10px; } div.cms-save-layout-btn { - border: 2px solid #A1D0A1; - background-color: #CCFF00; + color: white; + border: 2px solid #1C960C; + background-color: #24B30D; } div.cms-cancel-layout-btn { - border: 2px solid #FF0000; - background-color: #FF6A5D; + color: white; + border: 2px solid #C81900; + background-color: #DE2A00; } div.cms-cancel-layout-btn { @@ -113,13 +135,13 @@ border: 1px dashed transparent; } -div.block-edit-block-btn-container-over { +div.block-edit-block-btn-container-over, div.block-edit-design-btn-container-over { border-color: #FF6E00; } -div.block-edit-design-btn-container-over { +/*div.block-edit-design-btn-container-over { border-color: #A1D0A1; -} +}*/ /* === Styles for element moving/sorting in theme === */ div.movable-area { @@ -150,5 +172,5 @@ span[name='cms-translate-phrase'] .cms-edit-btn { display: none; opacity: 1; - filter: alpha(opacity=0); + filter: alpha(opacity=100); } \ No newline at end of file Index: branches/5.0.x/core/admin_templates/mailing_lists/mailing_list_edit.tpl =================================================================== diff -u -r12117 -r12382 --- branches/5.0.x/core/admin_templates/mailing_lists/mailing_list_edit.tpl (.../mailing_list_edit.tpl) (revision 12117) +++ branches/5.0.x/core/admin_templates/mailing_lists/mailing_list_edit.tpl (.../mailing_list_edit.tpl) (revision 12382) @@ -86,19 +86,17 @@ ;
- + - + " type="text" name="" id="" value="" tabindex="" size="" maxlength=""> - - Index: branches/5.0.x/core/units/ban_rules/ban_rules_config.php =================================================================== diff -u -r12299 -r12382 --- branches/5.0.x/core/units/ban_rules/ban_rules_config.php (.../ban_rules_config.php) (revision 12299) +++ branches/5.0.x/core/units/ban_rules/ban_rules_config.php (.../ban_rules_config.php) (revision 12382) @@ -1,6 +1,6 @@ 'la_tab_BanList', 'url' => Array('t' => 'ban_rules/ban_rule_list', 'pass' => 'm'), 'permissions' => Array ('view', 'add', 'edit', 'delete'), - 'priority' => 6, + 'priority' => 4, 'type' => stTREE, ), ), Index: branches/5.0.x/core/admin_templates/incs/grid_blocks.tpl =================================================================== diff -u -r12375 -r12382 --- branches/5.0.x/core/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 12375) +++ branches/5.0.x/core/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 12382) @@ -58,13 +58,13 @@ _search_keyword" - name="_search_keyword" - value="" - PrefixSpecial="" - Grid="" - ajax="0" - style="border: 1px solid grey;"/> + id="_search_keyword" + class="filter filter-active" + name="_search_keyword" + value="" + PrefixSpecial="" + Grid="" + ajax="0"/>