Make possible to set (some) config options from a skin

pull/5838/head
Aleksander Machniak 8 years ago
parent 4ac7cf0fca
commit e2d80479d6

@ -297,6 +297,10 @@ EOF;
$this->load_skin('skins/' . $meta['extends']);
}
}
foreach ((array) $meta['config'] as $key => $value) {
$this->config->set($key, $value, true);
}
}
/**

@ -2594,10 +2594,9 @@ function rcube_webmail()
// load message list to target frame/window
if (mbox) {
this.set_busy(true, 'loading');
url._mbox = mbox;
if (page)
url._page = page;
this.set_busy(true, 'loading');
this.location_href(url, target);
}
};
@ -2618,8 +2617,9 @@ function rcube_webmail()
if (typeof url != 'object')
url = {};
url._layout = this.env.layout
url._mbox = mbox;
if (page)
url._page = page;
// disable double-click on the list when preview pane is on
@ -5251,9 +5251,6 @@ function rcube_webmail()
if (!search && this.gui_objects.qsearchbox)
search = this.gui_objects.qsearchbox.value;
if (filter)
url._filter = filter;
if (this.gui_objects.search_interval)
url._interval = $(this.gui_objects.search_interval).val();
@ -5270,8 +5267,10 @@ function rcube_webmail()
}
}
if (scope)
url._layout = this.env.layout;
url._filter = filter;
url._scope = scope;
if (mbox && scope != 'all')
url._mbox = mbox;

@ -31,6 +31,7 @@ class rcube_config
private $prop = array();
private $errors = array();
private $userprefs = array();
private $immutable = array();
/**
@ -417,10 +418,15 @@ class rcube_config
*
* @param string $name Parameter name
* @param mixed $value Parameter value
* @param bool $immutable Make the value immutable
*/
public function set($name, $value)
public function set($name, $value, $immutable = false)
{
$this->prop[$name] = $value;
if ($immutable) {
$this->immutable[$name] = $value;
}
}
/**
@ -431,7 +437,7 @@ class rcube_config
public function merge($prefs)
{
$prefs = $this->fix_legacy_props($prefs);
$this->prop = array_merge($this->prop, $prefs, $this->userprefs);
$this->prop = array_merge($this->prop, $prefs, $this->userprefs, $this->immutable);
}
/**

Loading…
Cancel
Save