Exemplo n.º 1
0
 // get config_code
 $config_code = trim($_REQUEST['config_code']);
 $newPropertyList = isset($_REQUEST['property']) ? $_REQUEST['property'] : array();
 // new config object
 $config = new ConfigHtml($config_code, 'config_list.php');
 // load configuration
 if ($config->load()) {
     $section = isset($_REQUEST['section']) ? $_REQUEST['section'] : null;
     // display section menu
     $form .= $config->display_section_menu($section);
     // init config name
     $config_name = $config->get_conf_name();
     if (isset($_REQUEST['cmd']) && !empty($newPropertyList)) {
         if ('save' == $_REQUEST['cmd']) {
             // validate config
             if ($config->validate($newPropertyList)) {
                 // save config file
                 if ($config->save()) {
                     $dialogBox->success(get_lang('Properties for %config_name, (%config_code) are now effective on server.', array('%config_name' => get_lang($config_name), '%config_code' => $config_code)));
                 } else {
                     $error = true;
                     $dialogBox->error($config->backlog->output());
                 }
             } else {
                 // not valid
                 $error = true;
                 $dialogBox->error($config->backlog->output());
             }
         }
         // display form
         $form .= $config->display_form($newPropertyList, $section);