示例#1
0
function _userquota_baseGroupEdit($ldapArr, $postArr)
{
    $FH = new FormHandler("editGroupQuota", $postArr);
    $FH->setArr($ldapArr);
    $components = getActiveComponents();
    if ($components["disk"]) {
        $f = new DivForModule(_T("Quota plugin - Filesystem", "userquota"), "#FDD");
        $f->push(new Table());
        $f = addDiskQuotas($f, $FH);
        $f->add(new TrCommentElement(_T("Quota's applied here affect all members of the group", "userquota")));
        $overwrite = new RadioTpl("diskoverwrite");
        $overwrite->setChoices(array(_T("Overwrite all existing quotas", "userquota"), _T("Current quota is smaller than the new quota, or does not exist", "userquota"), _T("Current quota is larger than the new quota, or does not exist", "userquota"), _T("Don't overwrite any existing quotas", "userquota")));
        $overwrite->setValues(array("all", "smaller", "larger", "none"));
        $overwrite->setSelected("none");
        $f->add(new TrFormElement(_T("Overwrite mode for existing quotas", "userquota"), $overwrite));
        $f->pop();
        $f->display();
    }
    if ($components["network"]) {
        $f = new DivForModule(_T("Quota plugin - Network", "userquota"), "#FFD");
        $f->push(new Table());
        $f = addNetworkQuotas($f, $FH);
        $f->add(new TrCommentElement(_T("Quota's applied here affect all members of the group", "userquota")));
        $overwrite = new RadioTpl("networkoverwrite");
        $overwrite->setChoices(array(_T("Overwrite all existing quotas", "userquota"), _T("Current quota is smaller than the new quota, or does not exist", "userquota"), _T("Current quota is larger than the new quota, or does not exist", "userquota"), _T("Don't overwrite any existing quotas", "userquota")));
        $overwrite->setValues(array("all", "smaller", "larger", "none"));
        $overwrite->setSelected("none");
        $f->add(new TrFormElement(_T("Overwrite mode for existing quotas", "userquota"), $overwrite));
        $f->pop();
        $f->display();
    }
}
示例#2
0
        if ($p['label']) {
            if ($p['label'] == $default_menu['protocol']) {
                $rest_selected = $p['imaging_uuid'];
            }
            if ($p['label'] == $default_protocol) {
                $p['label'] = _T($p['label'], 'imaging').' '._T('(default)', 'imaging');
            }
            $protocols_choices[$p['imaging_uuid']] = $p['label'];
            $protocols_values[$p['imaging_uuid']] = $p['imaging_uuid'];
        }
    }

    $rest_type = new RadioTpl("rest_type");

    $rest_type->setChoices($protocols_choices);
    $rest_type->setValues($protocols_values);
    $rest_type->setSelected($rest_selected);
    $f->add(
        new TrFormElement(_T("Restoration type", "imaging"), $rest_type)
    );
    $f->add(
        new TrFormElement(_T("Restoration: MTFTP maximum waiting (in sec)", "imaging"),
        new InputTpl("rest_wait")), array("value" => $default_menu['mtftp_restore_timeout'])
    );
    $f->pop();

    $f->add(new TitleElement(_T("Boot options", "imaging")));
    $f->push(new Table());
    $f->add(
        new TrFormElement(_T("Full path to the XPM displayed at boot", "imaging"),
        new InputTpl("boot_xpm")), array("value" => $default_menu['background_uri'])
示例#3
0
文件: configure.php 项目: psyray/mmc
function expertModeDisplay($f, $has_profile, $type, $menu, $opts, $target, $real_target)
{
    if (!$has_profile) {
        $f->add(new TitleElement(sprintf(_T("%s menu parameters", "imaging"), $type == '' ? _T('Computer', 'imaging') : _T('Profile', 'imaging'))));
        $f->push(new Table());
        $f->add(new TrFormElement(_T('Default menu label', 'imaging'), new InputTpl("default_m_label")), array("value" => $menu['default_name']));
        $f->add(new TrFormElement(_T('Menu timeout', 'imaging'), new InputTpl("default_m_timeout")), array("value" => $menu['timeout']));
        foreach ($opts as $key => $str) {
            if ($menu[$key]) {
                $value = 'CHECKED';
            } else {
                $value = '';
            }
            $f->add(new TrFormElement($str, new CheckBoxTpl($key)), array("value" => $value));
        }
        $f->pop();
        $f->add(new TitleElement(_T("Restoration options", "imaging")));
        $f->push(new Table());
        $possible_protocols = web_def_possible_protocols();
        $default_protocol = web_def_default_protocol();
        $protocols_choices = array();
        $protocols_values = array();
        /* translate possibles protocols */
        _T('nfs', 'imaging');
        _T('tftp', 'imaging');
        _T('mtftp', 'imaging');
        foreach ($possible_protocols as $p) {
            if ($p['label']) {
                if ($p['label'] == $menu['protocol']) {
                    $rest_selected = $p['imaging_uuid'];
                }
                if ($p['label'] == $default_protocol) {
                    $p['label'] = _T($p['label'], 'imaging') . ' ' . _T('(default)', 'imaging');
                }
                $protocols_choices[$p['imaging_uuid']] = $p['label'];
                $protocols_values[$p['imaging_uuid']] = $p['imaging_uuid'];
            }
        }
        $rest_type = new RadioTpl("rest_type");
        $rest_type->setChoices($protocols_choices);
        $rest_type->setValues($protocols_values);
        $rest_type->setSelected($rest_selected);
        $f->add(new TrFormElement(_T("Restoration type", "imaging"), $rest_type));
        $f->add(new TrFormElement(_T("Restoration: MTFTP maximum waiting (in sec)", "imaging"), new InputTpl("rest_wait")), array("value" => $menu['mtftp_restore_timeout']));
        $f->pop();
        $f->add(new TitleElement(_T("Boot options", "imaging")));
        $f->push(new Table());
        $f->add(new TrFormElement(_T("Full path to the XPM displayed at boot", "imaging"), new InputTpl("boot_xpm")), array("value" => $menu['background_uri']));
        $f->add(new TrFormElement(_T("Message displayed during backup/restoration", "imaging"), new TextareaTpl("boot_msg")), array("value" => $menu['message']));
        /* $f->add(
               new TrFormElement(_T("Keyboard mapping (empty/fr)", "imaging"),
               new InputTpl("boot_keyboard")), array("value" => "")
           ); */
        $f->pop();
    } else {
        $f->add(new HiddenTpl("default_m_label"), array("value" => $menu['default_name'], "hide" => True));
        $f->add(new HiddenTpl("default_m_timeout"), array("value" => $menu['timeout'], "hide" => True));
        $possible_protocols = web_def_possible_protocols();
        foreach ($possible_protocols as $p) {
            if ($p['label'] && $p['label'] == $menu['protocol']) {
                $rest_selected = $p['imaging_uuid'];
                continue;
            }
        }
        $f->add(new HiddenTpl("rest_type"), array("value" => $rest_selected, "hide" => True));
        $f->add(new HiddenTpl("rest_wait"), array("value" => $menu['timeout'], "hide" => True));
        $f->add(new HiddenTpl("boot_xpm"), array("value" => $menu['background_uri'], "hide" => True));
        $f->add(new HiddenTpl("boot_msg"), array("value" => $menu['message'], "hide" => True));
        foreach ($opts as $key => $str) {
            if ($menu[$key]) {
                $value = 'CHECKED';
            } else {
                $value = '';
            }
            $f->add(new HiddenTpl($str), array("value" => $value, "hide" => True));
        }
    }
    /* $f->add(new TitleElement(_T("Administration options", "imaging")));
       $f->push(new Table());
       $f->add(
           new TrFormElement(_T("Password for adding a new client", "imaging"),
           new InputTpl("misc_passwd")), array("value" => "")
       );
       $f->pop();*/
    if ($type == '') {
        $f->add(new TitleElement(_T("Target options", "imaging")));
        $f->push(new Table());
        $local_kernel_parameters = web_def_kernel_parameters();
        $local_image_parameters = web_def_image_parameters();
        if (isset($real_target)) {
            if ($real_target != null) {
                $local_kernel_parameters = $real_target['kernel_parameters'];
                $local_image_parameters = $real_target['image_parameters'];
            }
            /* Make checkbox to force raw backup mode */
            if ($real_target != null && !empty($real_target['raw_mode'])) {
                $rawmode = "CHECKED";
            } else {
                $rawmode = "";
            }
        } else {
            if ($target != null) {
                $local_kernel_parameters = $target['kernel_parameters'];
                $local_image_parameters = $target['image_parameters'];
            }
            /* Make checkbox to force raw backup mode */
            if ($target != null && !empty($target['raw_mode'])) {
                $rawmode = "CHECKED";
            } else {
                $rawmode = "";
            }
        }
        $f->add(new TrFormElement(_T("Kernel parameters", "imaging"), new InputTpl("target_opt_kernel")), array("value" => $local_kernel_parameters));
        $f->add(new TrFormElement(_T("Image parameters", "imaging"), new InputTpl("target_opt_image")), array("value" => $local_image_parameters));
        $f->add(new TrFormElement(_T("Force raw backup mode", "imaging"), new CheckboxTpl("target_opt_raw_mode")), array("value" => $rawmode));
    } else {
        $f->add(new HiddenTpl('target_opt_kernel'), array("value" => $target != null ? $target['kernel_parameters'] : web_def_kernel_parameters(), "hide" => True));
        $f->add(new HiddenTpl('target_opt_image'), array("value" => $target != null ? $target['image_parameters'] : web_def_image_parameters(), "hide" => True));
        $f->add(new HiddenTpl('target_opt_raw_mode'), array("value" => $target != null ? $target['raw_mode'] : '', "hide" => True));
    }
}
示例#4
0
        $list[$mirror['uuid']] = $mirror['mountpoint'];
        $_SESSION['PACKAGEAPI'][$mirror['uuid']] = $mirror;
    }
    $span = new SpanElement(_T("Choose package source", "pkgs"), "pkgs-title");
    $selectpapi = new SelectItem('p_api');
    $selectpapi->setElements($list);
    $selectpapi->setElementsVal($list_val);
    $_SESSION['pkgs_selected'] = array_values($list_val)[0];
    $f = new ValidatingForm();
    $f->push(new Table());
    // Step title
    $f->add(new TrFormElement("", $span), array());
    $r = new RadioTpl("package-method");
    $vals = array("package", "upload", "empty");
    $keys = array(_T("Already uploaded on the server", "pkgs"), _T("Upload from this web page", "pkgs"), _T("Make an empty package", "pkgs"));
    $r->setValues($vals);
    $r->setChoices($keys);
    // Package API
    $f->add(new TrFormElement("<div id=\"p_api_label\">" . _T("Package API", "pkgs") . "</div>", $selectpapi), array("value" => $p_api_id, "required" => True));
    $f->add(new TrFormElement(_T("Package source", "pkgs"), $r), array());
    $f->add(new TrFormElement("<div id='directory-label'>" . _T("Files directory", "pkgs") . "</div>", new Div(array("id" => "package-temp-directory"))), array());
    $f->add(new HiddenTpl("mode"), array("value" => "creation", "hide" => True));
    $span = new SpanElement(_T("Package Creation", "pkgs"), "pkgs-title");
    $f->add(new TrFormElement("", $span), array());
    // fields
    $fields = array(array("label", _T("Name", "pkgs"), array("required" => True, 'placeholder' => _T('<fill_package_name>', 'pkgs'))), array("version", _T("Version", "pkgs"), array("required" => True)), array('description', _T("Description", "pkgs"), array()));
    $command = _T('Command:', 'pkgs') . '<br /><br />';
    $commandHelper = '<span>' . _T('Pulse will try to figure out how to install the uploaded files.\\n\\n
If the detection fails, it doesn\'t mean that the application cannot be installed using Pulse but that you\'ll have to figure out the proper command.\\n\\n
Many vendors (Acrobat, Flash, Skype) provide a MSI version of their applications which can be processed automatically by Pulse.\\n
You may also ask Google for the silent installation switches. If you\'re feeling lucky, here is a Google search that may help:\\n\\n
示例#5
0
    $group->importMembers($elementare, $content);
    new NotifyWidgetSuccess(_T("Group successfully created", "dyngroup"));
    header("Location: " . urlStrRedirect("base/computers/display", array('gid' => $group->id)));
    exit;
} elseif (xmlrpc_group_name_exists($groupname)) {
    new NotifyWidgetFailure(sprintf(_T("A group already exists with name '%s'", "dyngroup"), $groupname));
}
$f = new ValidatingForm(array('enctype' => "multipart/form-data"));
$f->push(new Table());
$f->add(new TrFormElement(_T("Group name", "dyngroup"), new InputTpl("groupname")), array("required" => True, "value" => $groupname));
$r = new RadioTpl('visible');
$r->setChoices(array(_T('Yes', 'dyngroup'), _T('No', 'dyngroup')));
$r->setValues(array('visible', 'hidden'));
$r->setSelected($visibility);
$f->add(new TrFormElement(_T("Add shortcut", "dyngroup"), $r), array("required" => True));
$f->add(new TrFormElement(_T("Select the file you want to import", "dyngroup"), new FileTpl('importfile')), array("required" => True));
$a = getPossiblesCriterionsInMainModule();
$r = new RadioTpl('elementare');
$r->setChoices($a);
$r->setValues($a);
if (!isset($elementare) || $elementare == '') {
    $elementare = $a[0];
}
$r->setSelected($elementare);
$f->add(new TrFormElement(_T("Select what is inside the file", "dyngroup"), $r), array("required" => True));
$f->pop();
$f->addValidateButton("bimport");
$f->display();
?>