Index: branches/5.2.x/core/units/helpers/col_picker_helper.php =================================================================== diff -u -N -r14244 -r14585 --- branches/5.2.x/core/units/helpers/col_picker_helper.php (.../col_picker_helper.php) (revision 14244) +++ branches/5.2.x/core/units/helpers/col_picker_helper.php (.../col_picker_helper.php) (revision 14585) @@ -1,6 +1,6 @@ defaultColumnWidth; } $this->SetCRC($cols); } @@ -176,7 +183,7 @@ // we NEED to recall dummy here to apply fields changes imposed by formatters, // such as replacing multilingual field titles etc. - $dummy =& $this->Application->recallObject($prefix, null, array('skip_autoload'=>1)); + $dummy =& $this->Application->recallObject($prefix, null, Array ('skip_autoload' => 1)); $counter = 0; $hidden = array(); @@ -191,12 +198,13 @@ } $fields[$counter] = $name; - $titles[$name] = $options['title']; - $widths[$name] = array_key_exists('width', $options) ? $options['width'] : 100; // only once per grid ! - if (isset($options['hidden']) && $options['hidden']) - { + $titles[$name] = isset($options['title']) ? $options['title'] : 'column:la_fld_' . $name; + $widths[$name] = isset($options['width']) ? $options['width'] : $this->defaultColumnWidth; // only once per grid ! + + if (isset($options['hidden']) && $options['hidden']) { $hidden[$counter] = $name; } + $counter++; } $sorted_fields = $fields; @@ -258,13 +266,22 @@ function SaveWidths($prefix, $widths) { - if (!is_array($widths)) $widths = explode(':', $widths); - array_shift($widths); // removing first col (checkbox col) width + if (!is_array($widths)) { + $widths = explode(':', $widths); + } + $i = 0; + array_shift($widths); // removing first col (checkbox col) width + foreach ($this->PickerData['order'] as $ord => $field) { - if ($field == '__FREEZER__') continue; - $this->PickerData['widths'][$field] = $widths[$i++]; + if ($field == '__FREEZER__') { + continue; + } + + $this->PickerData['widths'][$field] = isset($widths[$i]) ? $widths[$i] : $this->defaultColumnWidth; + $i++; } + $this->StoreCols($prefix, $this->PickerData); }