* Main script */ // Include core library require 'imscp-lib.php'; iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onClientScriptStart); check_login('user'); /** @var $cfg iMSCP_Config_Handler_File */ $cfg = iMSCP_Registry::get('config'); $tpl = new iMSCP_pTemplate(); $tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'client/layout.tpl', 'page_message' => 'layout', 'layout_colors_block' => 'page', 'layout_color_block' => 'layout_colors_block')); /** * Dispatches request */ if (isset($_POST['uaction'])) { if ($_POST['uaction'] == 'changeLayoutColor' && isset($_POST['layoutColor'])) { if (layout_setUserLayoutColor($_SESSION['user_id'], $_POST['layoutColor'])) { if (!isset($_SESSION['logged_from_id'])) { $_SESSION['user_theme_color'] = $_POST['layoutColor']; set_page_message(tr('Layout color successfully updated.'), 'success'); } else { set_page_message(tr("Customer's layout color successfully updated."), 'success'); } } else { set_page_message(tr('Unknown layout color.'), 'error'); } } elseif ($_POST['uaction'] == 'changeShowLabels') { layout_setMainMenuLabelsVisibility($_SESSION['user_id'], clean_input($_POST['mainMenuShowLabels'])); set_page_message(tr('Main menu labels visibility successfully updated.'), 'success'); } else { set_page_message(tr('Unknown action: %s', tohtml($_POST['uaction'])), 'error'); }
*/ if (isset($_POST['uaction'])) { if ($_POST['uaction'] == 'updateIspLogo') { if (layout_updateUserLogo()) { set_page_message(tr('Logo successfully updated.'), 'success'); } } elseif ($_POST['uaction'] == 'deleteIspLogo') { if (layout_deleteUserLogo()) { set_page_message(tr('Logo successfully removed.'), 'success'); } } elseif ($_POST['uaction'] == 'changeShowLabels') { layout_setMainMenuLabelsVisibility($_SESSION['user_id'], clean_input($_POST['mainMenuShowLabels'])); set_page_message(tr('Main menu labels visibility successfully updated.'), 'success'); } elseif ($_POST['uaction'] == 'changeLayoutColor' && isset($_POST['layoutColor'])) { $userId = isset($_SESSION['logged_from_id']) ? $_SESSION['logged_from_id'] : $_SESSION['user_id']; if (layout_setUserLayoutColor($userId, $_POST['layoutColor'])) { $_SESSION['user_theme_color'] = $_POST['layoutColor']; set_page_message(tr('Layout color successfully updated.'), 'success'); } else { set_page_message(tr('Unknown layout color.'), 'error'); } } else { set_page_message(tr('Unknown action: %s', tohtml($_POST['uaction'])), 'error'); } } $html_selected = $cfg->HTML_SELECTED; $userId = $_SESSION['user_id']; if ($_SESSION['show_main_menu_labels']) { $tpl->assign(array('MAIN_MENU_SHOW_LABELS_ON' => $html_selected, 'MAIN_MENU_SHOW_LABELS_OFF' => '')); } else { $tpl->assign(array('MAIN_MENU_SHOW_LABELS_ON' => '', 'MAIN_MENU_SHOW_LABELS_OFF' => $html_selected));