* @author Froxlor team (2010-) * @license GPLv2 http://files.froxlor.org/misc/COPYING.txt * @package Functions * * @since 0.9.29.1 * */ /** * updates the setting for the default panel-theme * and also the user themes (customers and admins) if * the changing of themes is disallowed for them * * @param string $fieldname * @param array $fielddata * @param mixed $newfieldvalue * * @return boolean|array */ function storeSettingDefaultTheme($fieldname, $fielddata, $newfieldvalue) { // first save the setting itself $returnvalue = storeSettingField($fieldname, $fielddata, $newfieldvalue); if ($returnvalue !== false && is_array($fielddata) && isset($fielddata['settinggroup']) && $fielddata['settinggroup'] == 'panel' && isset($fielddata['varname']) && $fielddata['varname'] == 'default_theme' ) { global $db; // now, if changing themes is disabled we recursivly set // the new theme (customers and admin, depending on settings) if (getSetting('panel', 'allow_theme_change_customer') == '0') { $db->query("UPDATE `".TABLE_PANEL_CUSTOMERS."` SET `theme`='".$db->escape($newfieldvalue)."'"); } if (getSetting('panel', 'allow_theme_change_admin') == '0') { $db->query("UPDATE `".TABLE_PANEL_ADMINS."` SET `theme`='".$db->escape($newfieldvalue)."'"); } } return $returnvalue; }