Exemple #1
0
// edit form page starts here
$p = new PageGenerator($title);
$sidemenu->forceActiveItem($activeItem);
$p->setSideMenu($sidemenu);
$p->display();
// create the form
$f = new ValidatingForm(array('method' => 'POST', 'enctype' => 'multipart/form-data'));
// add submit button
$f->addValidateButton("buser");
// enable/disable buttons
if ($mode == 'edit') {
    $f->addButton("enableAccount", _("Enable account"), "btnSecondary");
    $f->addButton("disableAccount", _("Disable account"), "btnSecondary");
}
// add reset form button
$f->addCancelButton("breset");
// add all modules forms to the edit form
$modules = callPluginFunction("baseEdit", array($FH, $mode));
foreach ($modules as $module => $editForm) {
    $f->push($editForm);
    $f->pop();
}
// display the form
$f->display();
?>
<script type="text/javascript">
jQuery(function(){
    var $ = jQuery;
    $('input.btnPrimary').click(function () {
        $('select#secondary.list option').prop('selected', true);
    });
Exemple #2
0
            $f->add(new HiddenTpl("copy_mode"), array("value" => web_def_mode(), "hide" => True));
        } else {
            $rb = new RadioTpl("copy_mode");
            $rb->setChoices(array(_T('push', 'msc'), _T('push / pull', 'msc')));
            $rb->setvalues(array('push', 'push_pull'));
            $rb->setSelected($_GET['copy_mode']);
            $f->add(new TrFormElement(_T('Copy Mode', 'msc'), $rb));
        }
        /* Only display local proxy button on a group and if allowed */
        if (isset($_GET['gid']) && strlen($_GET['gid']) && web_allow_local_proxy()) {
            $f->add(new TrFormElement(_T('Deploy using a local proxy', 'msc'), new CheckboxTpl("local_proxy")), array("value" => ''));
        }
    }
    $f->pop();
    $f->addValidateButton("bconfirm");
    $f->addCancelButton("bback");
    $f->display();
}
### /Advanced actions handling ###
/* single target: form display */
if (!isset($_GET['badvanced']) && $_GET['uuid'] && !isset($_POST['launchAction'])) {
    $machine = new Machine(array('uuid' => $_GET['uuid'], 'hostname' => array('0' => $_GET['hostname']), 'displayName' => $_GET['hostname']));
    if (strlen(web_probe_order()) > 0) {
        $msc_host = new RenderedMSCHost($machine, web_probe_order());
        $msc_host->ajaxDisplay();
    } else {
        // nothing set : do not probe
        if (!isset($_POST["bprobe"])) {
            $fprobe = new ValidatingForm();
            $fprobe->addButton("bprobe", _T("Probe status", "msc"));
            $fprobe->display();