$valid = true; } } if (!$valid) { $error = translate('Invalid theme'); } } } if (!empty($_POST) && empty($error)) { $my_theme = ''; $currenttab = getPostValue('currenttab'); save_pref($_POST, 'post'); if (!empty($my_theme)) { $theme = 'themes/' . $my_theme . '_pref.php'; include_once $theme; save_pref($webcal_theme, 'theme'); } // Reload preferences load_user_preferences(); } if ($user != $login) { $user = ($is_admin || $is_nonuser_admin) && $user ? $user : $login; } // Load categories only if editing our own calendar //if (!$user || $user == $login) load_user_categories (); load_user_categories(); // Reload preferences into $prefarray[]. // Get system settings first. $prefarray = array(); $res = dbi_execute('SELECT cal_setting, cal_value FROM webcal_config '); if ($res) {
$pref_id = $_GET['set_pref']; $pref_value = $_GET['v']; // save preferences if ($_GET['set_pref']) { //validate if (!ctype_digit($pref_id)) { unset($pref_id); } if (!ctype_digit($pref_value)) { unset($pref_value); } // what to set // view and language preferences are stored for now. if ($pref_id === "1" or $pref_id === "2") { if ($pref_value === "1" or $pref_value === "2") { save_pref($user_id, $pref_id, $pref_value); if ($pref_id === "1") { $sess->set('view_type', $pref_value); } if ($pref_id === "2") { if ($pref_value == "1") { $s_lang = "pol"; } else { $s_lang = "eng"; } $sess->set('language', $s_lang); } } } } // get preferences, if not set, fallback to standard view.