* Mergeprint in all apps: fixed missing validation message for non-existing pathes and allow to unset default of "/templates/appname"

This commit is contained in:
Ralf Becker 2012-07-09 16:21:06 +00:00
parent 6a7b991fb7
commit dc184e2622
2 changed files with 8 additions and 4 deletions

View File

@ -125,7 +125,9 @@
if ($appname == 'preferences') $appname = 'common'; if ($appname == 'preferences') $appname = 'common';
foreach ($this->settings as $name => $data) foreach ($this->settings as $name => $data)
{ {
if ((string)$GLOBALS['egw']->preferences->default[$appname][$name] === '' && // only set not yet set default prefs, so user is able to unset it again with ""
// (only works with type vfs_*, other types delete empty values!)
if (!isset($GLOBALS['egw']->preferences->default[$appname][$name]) &&
((string)$data['default'] !== '' || (string)$data['forced'] !== '')) ((string)$data['default'] !== '' || (string)$data['forced'] !== ''))
{ {
$default = (string)$data['forced'] !== '' ? $data['forced'] : $data['default']; $default = (string)$data['forced'] !== '' ? $data['forced'] : $data['default'];
@ -169,7 +171,7 @@
} }
if($this->debug) if($this->debug)
{ {
echo 'Preferences array: ' . $app . "\n"; echo 'Preferences array: ' . $app . "/$type\n";
_debug_array($this->prefs); _debug_array($this->prefs);
} }
/* Ensure that a struct will be returned via xml-rpc (this might change) */ /* Ensure that a struct will be returned via xml-rpc (this might change) */

View File

@ -205,7 +205,7 @@ class uisettings
} }
// display verifcation errors also on entering preferences, not only after saving // display verifcation errors also on entering preferences, not only after saving
if (!isset($_POST['save']) || !isset($_POST['apply'])) if (!isset($_POST['save']) && !isset($_POST['apply']))
{ {
if (!$this->is_admin() || !in_array($GLOBALS['type'], array('user', 'default', 'forced'))) if (!$this->is_admin() || !in_array($GLOBALS['type'], array('user', 'default', 'forced')))
{ {
@ -275,6 +275,8 @@ class uisettings
$valarray['label'], $valarray['label'],
$valarray['name'], $valarray['name'],
$valarray['help'], $valarray['help'],
$valarray['default'],
$valarray['size'],
$valarray['run_lang'] $valarray['run_lang']
); );
break; break;
@ -436,7 +438,7 @@ class uisettings
{ {
return True; return True;
} }
//echo "<p>create_input_box('$label_name', '$preference_name][$type', '$help', '$default', '', '', '', $run_lang, '$def_text')</p>\n"; //echo "<p>create_input_box('$label_name', '$preference_name][$type', '$help', '$default', '$size', '', '', $run_lang, '$def_text')</p>\n";
$this->create_input_box($label_name,$preference_name.']['.$type, $this->create_input_box($label_name,$preference_name.']['.$type,
$help,$default,$size,'','',$run_lang,$def_text); $help,$default,$size,'','',$run_lang,$def_text);
} }