$lockdown_form = new HTML_QuickForm("lockdown_form", "post", basename($_SERVER['PHP_SELF']) . "?ctg=maintenance&tab=lock_down", "", null, true); //Build the form $lockdown_form->registerRule('checkParameter', 'callback', 'eF_checkParameter'); //Register our custom input check function $lockdown_form->addElement('textarea', 'lock_message', _LOCKDOWNMESSAGE, 'class = "inputContentTextarea mceEditor" style = "width:100%;height:20em;"'); $lockdown_form->addElement('checkbox', 'logout_users', null, null, 'class = "inputCheckBox"'); $lockdown_form->setDefaults(array("lock_message" => $GLOBALS['configuration']['lock_message'] ? $GLOBALS['configuration']['lock_message'] : _SYSTEMDOWNFORMAINTENANCE, "logout_users" => true)); $lockdown_form->addElement('submit', 'submit_lockdown', _LOCKDOWN, 'class = "flatButton"'); $lockdown_form->addElement('submit', 'submit_message', _SAVECHANGES, 'class = "flatButton"'); $lockdown_form->addElement('submit', 'submit_unlock', _UNLOCK, 'class = "flatButton"'); //Check here, whether the system is already locked, and present unlock button if ($lockdown_form->isSubmitted() && $lockdown_form->validate()) { //If the form is submitted and validated $values = $lockdown_form->exportValues(); if ($GLOBALS['configuration']['lock_down'] && isset($values['submit_unlock'])) { EfrontSystem::unlockSystem(); } elseif (isset($values['submit_lockdown'])) { EfrontSystem::lockSystem($values['lock_message'], $values['logout_users']); } elseif (isset($values['submit_message'])) { EfrontConfiguration::setValue('lock_message', $values['lock_message']); } eF_redirect(basename($_SERVER['PHP_SELF']) . "?ctg=maintenance&tab=lock_down"); } $renderer = new HTML_QuickForm_Renderer_ArraySmarty($smarty); //Create a smarty renderer $lockdown_form->accept($renderer); //Assign this form to the renderer, so that corresponding template code is created $smarty->assign('T_LOCKDOWN_FORM', $renderer->toArray()); //Assign the form to the template if ($_GET['check_cleanup'] || isset($_GET['cleanup'])) { //User check