1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-06 14:46:56 +02:00

Admin-UI: Unchecking all the display columns options and saving now clears the user preference and restores the coded default value found in $fieldpref

This commit is contained in:
Cameron
2020-04-10 08:25:33 -07:00
parent 65322ee132
commit 9d383566fe

View File

@@ -3418,16 +3418,18 @@ class e_admin_controller_ui extends e_admin_controller
$posted = $this->getPosted('e-columns', array());
foreach ($this->getFields() as $field => $attr)
{
if((vartrue($attr['forced']) || in_array($field, $posted)) && !vartrue($attr['nolist']))
if((/*vartrue($attr['forced']) || */ in_array($field, $posted)) && !vartrue($attr['nolist']))
{
$cols[] = $field;
continue;
}
}
if($cols)
// Alow for an empty array to be saved also, to reset to default.
if($this->getPosted('etrigger_ecolumns', false)) // Column Save Button
{
$this->setUserPref($cols, $this->fieldPrefName);
e107::getMessage()->addDebug("User Field Preferences Saved: ".print_a($cols,true));
}
}