function updatecolorsprocess() { checktoken(); $colors = $_POST['colors']; $_GET['data'] = $_POST['theme']; require_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $_GET['data'] . DIRECTORY_SEPARATOR . $_GET['data'] . '.php'; foreach ($themeSettings as $field => $input) { $input = checkcolor($input); if (!empty($colors[strtoupper($input)])) { $themeSettings[$field] = strtoupper($colors[$input]); } } $data = '$themeSettings = array(' . "\r\n"; foreach ($themeSettings as $field => $input) { $data .= "'" . $field . "' => '" . $input . "'," . "\r\n"; } $data .= ");"; $_SESSION['cometchat']['error'] = 'Theme updated successfully'; configeditor('SETTINGS', $data, 0, dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'themes' . DIRECTORY_SEPARATOR . $_GET['data'] . DIRECTORY_SEPARATOR . $_GET['data'] . '.php'); echo 1; }
function updatecolorsprocess() { global $themeSettings; $colors = $_POST['colors']; $_GET['data'] = $_POST['theme']; $parent = getParentColor($_GET['data']); if (!empty($parent)) { if (file_exists(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'colors' . DIRECTORY_SEPARATOR . $parent . '.php')) { include_once dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'colors' . DIRECTORY_SEPARATOR . $parent . '.php'; } } $themeSettings = setNewColorValue($themeSettings, $_GET['data']); foreach ($themeSettings as $field => $input) { $input = checkcolor($input); if (!empty($colors[strtoupper($input)])) { $themeSettings[$field] = strtoupper($colors[$input]); } } $_SESSION['cometchat']['error'] = 'Color scheme updated successfully'; coloreditor($themeSettings, $_GET['data']); echo 1; }