Index: branches/5.2.x/units/products/products_tag_processor.php =================================================================== diff -u -N -r14702 -r14872 --- branches/5.2.x/units/products/products_tag_processor.php (.../products_tag_processor.php) (revision 14702) +++ branches/5.2.x/units/products/products_tag_processor.php (.../products_tag_processor.php) (revision 14872) @@ -1,6 +1,6 @@ GetList($params); - $sorting_field_selected = $this->Application->RecallVar($list->getPrefixSpecial().$params['sorting_select_name']); + $sorting_field_selected = $this->Application->RecallVar($list->getPrefixSpecial() . $params['sorting_select_name']); - if (!$sorting_field_selected){ + if ( !$sorting_field_selected ) { $sorting_field_selected = $this->Application->ConfigValue('product_OrderProductsBy'); } @@ -363,18 +363,16 @@ $field_list = explode(',', $field_list_plain); $o = ''; + $option_params = $this->prepareTagParams($params); - foreach ($field_list as $key=>$field){ + foreach ($field_list as $field) { list($fieldname, $fieldlabel) = explode('=', $field); - $option_params = $this->prepareTagParams($params); + $option_params['fieldname'] = $fieldname; $option_params['fieldlabel'] = $this->Application->Phrase($fieldlabel); $option_params['name'] = $params['block_options']; - if ($fieldname == $sorting_field_selected){ - $option_params['selected'] = 'selected'; - }else{ - $option_params['selected'] = ''; - } + $option_params['selected'] = $fieldname == $sorting_field_selected ? 'selected' : ''; + $o .= $this->Application->ParseBlock($option_params); } @@ -385,29 +383,24 @@ { $list =& $this->GetList($params); - $sorting_dir_selected = $this->Application->RecallVar($list->getPrefixSpecial().$params['sorting_select_name']); + $sorting_dir_selected = $this->Application->RecallVar($list->getPrefixSpecial() . $params['sorting_select_name']); - if (!$sorting_dir_selected){ + if ( !$sorting_dir_selected ) { $sorting_dir_selected = $this->Application->ConfigValue('product_OrderProductsByDir'); } $o = ''; - $field_list = array('asc' => 'lu_Ascending', 'desc' => 'lu_Descending'); + $field_list = array ('asc' => 'lu_Ascending', 'desc' => 'lu_Descending'); + $option_params = $this->prepareTagParams($params); - foreach ($field_list as $fieldname=>$fieldlabel){ - - $option_params = $this->prepareTagParams($params); + foreach ($field_list as $fieldname => $fieldlabel) { $option_params['fieldname'] = $fieldname; $option_params['fieldlabel'] = $this->Application->Phrase($fieldlabel); $option_params['name'] = $params['block_options']; - if ($fieldname == $sorting_dir_selected){ - $option_params['selected'] = 'selected'; - }else{ - $option_params['selected'] = ''; - } - $o .= $this->Application->ParseBlock($option_params); + $option_params['selected'] = $fieldname == $sorting_dir_selected ? 'selected' : ''; + $o .= $this->Application->ParseBlock($option_params); } return $o;