Exemplo n.º 1
0
/* Process
/* ************************************************************************** */
$form = '';
if (!isset($_REQUEST['config_code'])) {
    $dialogBox->error(get_lang('Wrong parameters'));
} else {
    // 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
Exemplo n.º 2
0
                     $is_checked = "";
                 }
                 $out .= '<tr>' . "\n" . '<td>' . "\n" . '<input type="checkbox" name="displayDockList[]" value="' . $dockId . '" id="displayDock_' . $i . '" ' . $is_checked . ' />' . '<label for="displayDock_' . $i . '">' . $dockName . '</label>' . '</td>' . "\n" . '</tr>' . "\n";
                 $i++;
             }
             // display submit button
             $out .= '<tr>' . "\n" . '<td>' . get_lang('Save') . '&nbsp;:' . "\n" . '<input type="hidden" name="cmd" value="movedock" />' . "\n" . '<input type="submit" value="' . get_lang('Ok') . '" />&nbsp;' . "\n" . claro_html_button(claro_htmlspecialchars($_SERVER['HTTP_REFERER']), get_lang('Cancel')) . '</td>' . "\n" . '</tr>' . "\n" . '</tbody>' . "\n" . '</table>' . "\n" . '</dd>' . '</form>';
         }
     } else {
         // nothing to do at the moment
     }
     break;
 case 'LOCAL':
     $form = '';
     $url_params = '&module_id=' . $moduleId . '&item=' . claro_htmlspecialchars($item);
     $form = $config->display_section_menu($section_selected, $url_params);
     // init config name
     $config_name = $config->config_code;
     if (isset($_REQUEST['cmd']) && isset($_REQUEST['property'])) {
         if ('save' == $_REQUEST['cmd']) {
             if (!empty($_REQUEST['property'])) {
                 list($message, $error) = generate_conf($config, $_REQUEST['property']);
             }
         }
         // display form
         $form .= $config->display_form($_REQUEST['property'], $section_selected, $url_params);
     } else {
         // display form
         $form .= $config->display_form(null, $section_selected, $url_params);
     }
     $out .= '<div style="padding-left:1em;padding-right:1em;">';