. * * Copyright 2008 Aart-Jan Boor * Wemag Advisering */ require_once(KT_LIB_DIR . '/dispatcher.inc.php'); /** * Dispatches the the configuration page */ class ConfigureDashboardDispatcher extends KTAdminDispatcher { /** * Show the configuration page * * @return the template data */ function do_main(){ //set breadcrumbs $this->oPage->setBreadcrumbDetails(_kt('Dashboard settings')); if($_POST['saveSettings']){ //form submitted $this->form_submit(); } //load auto add new dashlets setting $autoAddNewDashlets=KTUtil::getSystemSetting("wemag-dashboard-management-plugin-auto-add-new-dashlets"); //render template $oTemplating =& KTTemplating::getSingleton(); $oTemplate = $oTemplating->loadTemplate("configureDashboard"); $aTemplateData = array(); if($autoAddNewDashlets == "true"){ $aTemplateData['autoAddNewDashlets']='checked="checked"'; } return $oTemplate->render($aTemplateData); } /** * Handle the form submit, and update settings * */ function form_submit(){ if($_POST['autoAddNewDashlets'] == "true"){ KTUtil::setSystemSetting("wemag-dashboard-management-plugin-auto-add-new-dashlets","true"); }else{ KTUtil::setSystemSetting("wemag-dashboard-management-plugin-auto-add-new-dashlets","false"); } $this->addInfoMessage(_kt("Settings saved")); } } ?>