• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP ValidatingForm类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中ValidatingForm的典型用法代码示例。如果您正苦于以下问题:PHP ValidatingForm类的具体用法?PHP ValidatingForm怎么用?PHP ValidatingForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了ValidatingForm类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: save_smbconf

    }
    return $ret;
}
if (isset($_POST["bsave"])) {
    $ret = save_smbconf();
    if (!isXMLRPCError()) {
        new NotifyWidgetSuccess(sprintf(_T("SAMBA configuration saved. You may need to reload or restart the SAMBA service.")));
    }
}
require "modules/samba/mainSidebar.php";
require "graph/navbar.inc.php";
$p = new PageGenerator(_T("General options"));
$p->setSideMenu($sidemenu);
$p->display();
$smb = get_smbconf();
$f = new ValidatingForm();
$f->push(new Table());
if ($smb["pdc"]) {
    $workgroupTpl = new HiddenTpl("workgroup");
} else {
    $workgroupTpl = new NetbiosUppercaseInputTpl("workgroup");
}
$f->add(new TrFormElement(_T("Domain name"), $workgroupTpl), array("value" => $smb["workgroup"], "required" => True));
$f->add(new TrFormElement(_T("Server name"), new NetbiosUppercaseInputTpl("netbios name")), array("value" => $smb["netbios name"], "required" => True));
$value = "";
if ($smb["pdc"]) {
    $value = "checked";
}
$f->add(new TrFormElement(_T("This server is a PDC"), new CheckboxTpl("pdc")), array("value" => $value));
$f->add(new TrFormElement(_T("This server is a WINS server"), new CheckboxTpl("wins support")), array("value" => getCheckedState($smb, "wins support")));
$value = "";
开发者ID:sebastiendu,项目名称:mmc,代码行数:31,代码来源:index.php


示例2: stripslashes

 *
 * You should have received a copy of the GNU General Public License
 * along with MMC; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */
require "modules/samba/includes/machines.inc.php";
require "modules/samba/includes/samba.inc.php";
require "modules/samba/mainSidebar.php";
require "graph/navbar.inc.php";
if (isset($_POST["baddmach"])) {
    $machine = $_POST["machine"];
    $comment = stripslashes($_POST["comment"]);
    add_machine($machine, $comment);
    if (!isXMLRPCError()) {
        new NotifyWidgetSuccess(sprintf(_T("Computer %s successfully added"), $machine));
        header("Location: " . urlStrRedirect("samba/machines/index"));
        exit;
    }
}
$p = new PageGenerator(_T("Add a computer"));
$p->setSideMenu($sidemenu);
$p->display();
$f = new ValidatingForm();
$f->addSummary(_T("The computer name can only contains letters lowercase and numbers, and must begin with a letter."));
$f->push(new Table());
$f->add(new TrFormElement(_T("Computer name"), new NetbiosInputTpl("machine")), array("value" => $machine, "required" => True));
$f->add(new TrFormElement(_T("Comment"), new InputTpl("comment")), array("value" => $comment));
$f->pop();
$f->pop();
$f->addValidateButton("baddmach");
$f->display();
开发者ID:pulse-project,项目名称:pulse,代码行数:31,代码来源:add.php


示例3: TitleElement

 * MMC is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MMC.  If not, see <http://www.gnu.org/licenses/>.
 */
/* common ajax includes */
require "../includes/ajaxcommon.inc.php";
$t = new TitleElement(_T("Imaging server configuration", "imaging"), 3);
$t->display();
$config = xmlrpc_getImagingServerConfig($location);
$imaging_server = $config[0];
$default_menu = $config[1];
$f = new ValidatingForm(array("action" => urlStrRedirect("imaging/manage/save_configuration")));
$f->add(new HiddenTpl("is_uuid"), array("value" => $imaging_server['imaging_uuid'], "hide" => True));
$lang = xmlrpc_getAllKnownLanguages();
$lang_choices = array();
$lang_values = array();
$lang_id2uuid = array();
foreach ($lang as $l) {
    $lang_choices[$l['imaging_uuid']] = $l['label'];
    $lang_values[$l['imaging_uuid']] = $l['imaging_uuid'];
    $lang_id2uuid[$l['id']] = $l['imaging_uuid'];
}
$language = new SelectItem("language");
$language->setElements($lang_choices);
$language->setElementsVal($lang_values);
if ($imaging_server['fk_language']) {
    $language->setSelected($lang_id2uuid[$imaging_server['fk_language']]);
开发者ID:pulse-project,项目名称:pulse,代码行数:31,代码来源:ajaxConfiguration.php


示例4: display_ordered

 function display_ordered($orders)
 {
     $f = new ValidatingForm();
     $f->push(new Table());
     foreach ($this->members as $pid => $plabel) {
         $select = new SelectItem($this->input_pre . base64_encode($pid));
         $select->setElements($this->c);
         $select->setElementsVal($this->c);
         $select->setSelected($orders[$pid]);
         $f->add(new TrFormElement($plabel, $select, array()));
     }
     foreach ($this->getHidden() as $w) {
         $f->add($w[0], $w[1]);
     }
     $this->display_options($f);
     $f->pop();
     foreach ($this->buttons as $b) {
         $f->addButton($b[0], $b[1], $b[2]);
     }
     $f->display();
 }
开发者ID:pulse-project,项目名称:pulse,代码行数:21,代码来源:bundle_widgets.php


示例5: getSubnetStatements

    $statements = getSubnetStatements($subnetInfos);
    if (isAuthoritative($subnetInfos)) {
        $authoritative = "CHECKED";
    } else {
        $authoritative = "";
    }
    $poolsRanges = getPoolsRanges($subnet);
    $hasSubnetPools = count($poolsRanges) ? "checked" : "";
}
if ($_GET["action"] == "subnetadd") {
    $formElt = new IPInputTpl("subnet");
    $authoritative = "";
} else {
    $formElt = new HiddenTpl("subnet");
}
$f = new ValidatingForm();
$f->push(new Table());
$f->add(new TrFormElement(_T("DHCP subnet address"), $formElt), array("value" => $subnet, "required" => True));
$f->add(new TrFormElement(_T("Netmask"), new NetmaskInputTpl("netmask")), array("value" => $netmask, "required" => True, "extra" => _T("(e.g. 24 for a /24 network)")));
$f->add(new TrFormElement(_T("Description"), new IA5InputTpl("description")), array("value" => $description));
$f->add(new TrFormElement(_T("Authoritative"), new CheckboxTpl("authoritative")), array("value" => $authoritative));
$f->pop();
$f->push(new Table());
$f->add(new TrFormElement(_T("DHCP options related to clients network parameters"), new HiddenTpl("")));
$f->add(new TrFormElement(_T("Broadcast address"), new IPInputTpl("broadcast-address")), array("value" => $options["broadcast-address"]));
$f->add(new TrFormElement(_T("Domain name"), new IA5InputTpl("domain-name"), array("tooltip" => _T("Domain name that will be appended to the client's hostname to form a fully-qualified domain-name (FQDN).") . "<br/>" . _T("If the domain name is a registered DNS domain, the subnet will be associated to the DNS domain.") . "<br/>" . _T("You can set more than one domain, separated by spaces. They will be added to the DHCP client DNS domain search path."))), array("value" => $options["domain-name"], "extra" => _T("Links the subnet to a DNS zone")));
$f->add(new TrFormElement(_T("Routers"), new HostIpListInputTpl("routers"), array("tooltip" => _T("List of routers (gateways) on client's subnet."))), array("value" => $options["routers"]));
$f->add(new TrFormElement(_T("Domain name servers"), new HostIpListInputTpl("domain-name-servers"), array("tooltip" => _T("DNS name servers available to the client. Separate servers addresses with ','."))), array("value" => $options["domain-name-servers"]));
$f->add(new TrFormElement(_T("NTP servers"), new HostIpListInputTpl("ntp-servers"), array("tooltip" => _T("Network Time Protocol servers available to the client. Separate servers addresses with ','."))), array("value" => $options["ntp-servers"]));
$f->add(new TrFormElement(_T("Proxy auto config URL"), new IA5InputTpl("local-pac-server"), array("tooltip" => _T("Automatic proxy configuration URL (PAC)."))), array("value" => $options["local-pac-server"]));
$f->add(new TrFormElement(_T("WINS servers"), new HostIpListInputTpl("netbios-name-servers"), array("tooltip" => _T("Netbios name servers available to Windows clients, listed in order of preference. Separate servers addresses with ','."))), array("value" => $options["netbios-name-servers"]));
开发者ID:sebastiendu,项目名称:mmc,代码行数:31,代码来源:subnetedit.php


示例6: require

 *
 * You should have received a copy of the GNU General Public License
 * along with MMC.  If not, see <http://www.gnu.org/licenses/>.
 */

/* common ajax includes */
require("../includes/ajaxcommon.inc.php");

    $t = new TitleElement(_T("Imaging server configuration", "imaging"), 3);
    $t->display();

    $config = xmlrpc_getImagingServerConfig($location);
    $imaging_server = $config[0];
    $default_menu = $config[1];

    $f = new ValidatingForm(array("action"=>urlStrRedirect("imaging/manage/save_configuration"),));

    $f->add(new HiddenTpl("is_uuid"),                       array("value" => $imaging_server['imaging_uuid'], "hide" => True));
    /* We dont have this information right now in the database schema

    $f->add(new TitleElement(_T("Traffic control", "imaging")));
    $f->push(new Table());
    $interfaces = array("eth0" => "eth0", "eth1" => "eth1");
    $ifaces = new SelectItem("net_int");
    $ifaces->setElements($interfaces);
    $ifaces->setElementsVal($interfaces);
    $f->add(
        new TrFormElement(_T("Network interface on which traffic shaping is done", "imaging"),
        $ifaces)
    );
    $f->add(
开发者ID:neoclust,项目名称:mmc,代码行数:31,代码来源:ajaxConfiguration.php


示例7: PageGenerator

        $is_wol_displayed = '';
    }
    $ro = False;
    if ($is_image) {
        $default_name = $item['image']['default_name'];
    } else {
        $default_name = $item['boot_service']['default_name'];
        if (!isset($item['is_local'])) {
            $ro = True;
        }
    }
    $p = new PageGenerator(sprintf(_T("Edit : %s", "imaging"), $label));
    $sidemenu->forceActiveItem("bootmenu");
    $p->setSideMenu($sidemenu);
    $p->display();
    $f = new ValidatingForm();
    $f->push(new Table());
    $f->add(new HiddenTpl("location"), array("value" => $location, "hide" => True));
    $input = new TrFormElement(_T('Default menu item label', 'imaging'), new InputTpl("default_name"));
    $f->add($input, array("value" => $default_name, "disabled" => $ro ? 'disabled' : ''));
    $f->add(new TrFormElement(_T("Selected by default", "imaging"), new CheckboxTpl("default")), array("value" => $is_selected));
    $f->add(new TrFormElement(_T("Displayed", "imaging"), new CheckboxTpl("displayed")), array("value" => $is_displayed));
    $f->add(new TrFormElement(_T("Selected by default on WOL", "imaging"), new CheckboxTpl("default_WOL")), array("value" => $is_wol_selected));
    $f->add(new TrFormElement(_T("Displayed on WOL", "imaging"), new CheckboxTpl("displayed_WOL")), array("value" => $is_wol_displayed));
    $f->pop();
    $f->addButton("bvalid", _T("Validate"));
    $f->pop();
    $f->display();
} else {
    $is_image = True;
    if ($item['boot_service']) {
开发者ID:sebastiendu,项目名称:mmc,代码行数:31,代码来源:bootmenu_edit.php


示例8: Machine

    $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();
            print "<br/>";
        } else {
            $msc_host = new RenderedMSCHost($machine, web_probe_order_on_demand());
            $msc_host->ajaxDisplay();
        }
    }
    $msc_actions = new RenderedMSCActions(msc_script_list_file(), $machine->hostname, array('uuid' => $_GET['uuid']));
    $msc_actions->display();
    $ajax = new AjaxFilter(urlStrRedirect("base/computers/ajaxPackageFilter"), "container", array("uuid" => $machine->uuid, "hostname" => $machine->hostname));
    $ajax->display();
    $ajax->displayDivToUpdate();
}
/* group display */
开发者ID:pulse-project,项目名称:pulse,代码行数:31,代码来源:launch.php


示例9: array

require "localSidebar.php";
require "graph/navbar.inc.php";
$services = array(array('Start computer', 'Boot on system hard drive', true), array('Create rescue image', 'Backup system hard drive', true), array('Create master', 'Backup system hard drive as a master', true), array('Memtest', 'Launch RAM checking utility', false));
$id = $_GET['itemid'];
if (count($_POST) == 0) {
    // get current values
    if ($services[$id][2] == true) {
        $in_bootmenu = 'CHECKED';
    }
    $label = $services[$id][0];
    $desc = $services[$id][1];
    $p = new PageGenerator(_T("Edit service : ", "imaging") . $label);
    $sidemenu->forceActiveItem("service");
    $p->setSideMenu($sidemenu);
    $p->display();
    $f = new ValidatingForm();
    $f->push(new Table());
    $f->add(new TrFormElement(_T("Label", "imaging"), new InputTpl("service_label")), array("value" => $label));
    $f->add(new TrFormElement(_T("Description", "imaging"), new InputTpl("service_desc")), array("value" => $desc));
    $f->add(new TrFormElement(_T("In default bootmenu", "imaging"), new CheckboxTpl("service_bootmenu")), array("value" => $in_bootmenu));
    $f->pop();
    $f->addButton("bvalid", _T("Validate"));
    $f->pop();
    $f->display();
} else {
    // set new values
    foreach ($_POST as $key => $value) {
    }
    $label = $_POST['service_label'];
    $str = sprintf(_T("Service <strong>%s</strong> modified with success", "imaging"), $label);
    new NotifyWidgetSuccess($str);
开发者ID:sebastiendu,项目名称:mmc,代码行数:31,代码来源:service_edit.php


示例10: NotifyWidgetSuccess

         new NotifyWidgetSuccess(sprintf(_T("The computer %s has correctly been unregistered from imaging", 'imaging'), $target_name));
         unset($_SESSION["imaging.isComputerRegistered_" . $target_uuid]);
         header("Location: " . urlStrRedirect("base/computers/register_target", $params));
         exit;
     } else {
         new NotifyWidgetFailure(sprintf(_T("Failed to unregister the computer %s", 'imaging'), $target_name));
     }
     $is_unregistering = True;
 } else {
     /*
      * type: 'group' for a profile, '' for a single computer
      */
     $type = $_GET["type"];
     $target_uuid = $_GET['target_uuid'];
     $target_name = $_GET['target_name'];
     $f = new ValidatingForm();
     // Set title
     if ($type == '') {
         // Computer
         if (!xmlrpc_isComputerRegistered($target_uuid) && !xmlrpc_isComputerInProfileRegistered($target_uuid)) {
             $f->add(new TitleElement(sprintf(_T("Register computer '%s'", "imaging"), $target_name)));
         }
     } else {
         // Profile
         if (!xmlrpc_isProfileRegistered($target_uuid)) {
             $f->add(new TitleElement(sprintf(_T("Imaging activation for group '%s'", "imaging"), $target_name)));
         }
     }
     // Get boot menu
     if ($type == '') {
         // Computer
开发者ID:pulse-project,项目名称:pulse,代码行数:31,代码来源:configure.php


示例11: ValidatingForm

<?php 
require "../../../includes/config.inc.php";
require "../../../includes/i18n.inc.php";
require "../../../includes/acl.inc.php";
require "../../../includes/session.inc.php";
require "../../../includes/PageGenerator.php";
require "../includes/data_Windows_Answer_File_Generator.inc.php";
?>
<!--Click on to validate disposed of the response file
.on smb: // ipPulse / postinst / sysprep /-->
<?php 
if (isset($_SESSION['parameters'])) {
    //If this session exists : editing file, else creating file
    $parameters = $_SESSION['parameters'];
}
$f = new ValidatingForm(array("id" => "formxml"));
$f->add(new HiddenTpl("codeToCopy"), array("value" => "", "hide" => True));
$f->add(new HiddenTpl("infobulexml"), array("value" => '', "hide" => True));
//==== NEW SECTION ====
// Installation Notes
//=====================
//Add section title
$f->add(new TitleElement(_T("Installation Notes", "imaging")));
$f->add(new TrFormElement("", new Iconereply('Installation_Notes', $InfoBule_Installation_Notes)));
$f->push(new Table());
//_____________
$f->add(new TrFormElement(_T('Title', 'imaging'), new InputTplTitle('Location', "name file xml")), array("required" => True, 'value' => isset($parameters) ? $parameters['Title'] : ''));
//_____________
$f->add(new TrFormElement("Notes" . ":", new OptTextareaTpl(array('name' => 'Comments', 'value' => isset($parameters) ? $parameters['Notes'] : 'Enter your comments here...'))));
$f->pop();
//Add empty line for separation
开发者ID:pulse-project,项目名称:pulse,代码行数:31,代码来源:ajaxFormWin7.php


示例12: array_map

        $list = array_map(format, $list);
    } else {
        $list = $group->members();
    }
    /* all computers of the group */
    $machines = array();
    foreach ($list as $machine) {
        $machines[$machine['hostname'] . "##" . $machine['uuid']] = $machine['hostname'];
    }
    $right = array();
}
reset($right);
ksort($machines);
$left = array_diff_assoc($machines, $right);
natcasesort($left);
$f = new ValidatingForm();
$f->push(new Table());
$trOptions = array('firstColWidth' => '200px');
$rb = new RadioTpl("proxy_mode");
$rb->setChoices(array(_T('Single with fallback', 'msc'), _T('Multiple', 'msc')));
$rb->setvalues(array('single', 'multiple'));
if (!empty($_POST["proxy_mode"])) {
    $proxy_mode = $_POST["proxy_mode"];
    unset($_POST["proxy_mode"]);
    // to prevent hidden field setting below
} else {
    $proxy_mode = web_local_proxy_mode();
}
$rb->setSelected($proxy_mode);
$f->add(new TrFormElement(_T('Local Proxy Mode', 'msc'), $rb, $trOptions));
if (!empty($_POST["max_clients_per_proxy"])) {
开发者ID:sebastiendu,项目名称:mmc,代码行数:31,代码来源:local_proxy.php


示例13: PageGenerator

//New page with side menu, create and show
$p = new PageGenerator($main_title);
$p->setSideMenu($sidemenu);
$p->display();
//Create a list of informations
$n = new ListInfos($arrB, $title_datagrid);
$n->first_elt_padding = 1;
$n->disableFirstColumnActionLink();
$n->setName(_T("List"));
//Add action on list and show list
$n->addActionItem(new ActionPopupItem(_T("Delete"), $del_page, "delete", "eltdata"));
$n->display();
//Create Title and show
$t = new TitleElement($sub_title, 2);
$t->display();
//Create Form to get informations
$f = new ValidatingForm();
//Create table inside Form
$f->push(new Table());
//Add element input in table
$f->add(new TrFormElement($elt_label, new InputTpl("eltdata"), array("tooltip" => $elt_help)), array("value" => "", "required" => true));
//Add Botton in Form and show
$f->pop();
$f->addButton("btAdd", _T("Add"));
$f->display();
if (!servicesModuleEnabled()) {
    echo '<br/>';
    $f = new ValidatingForm(array("id" => "service"));
    $f->addButton("btApply", _T("Apply configuration"));
    $f->display();
}
开发者ID:sebastiendu,项目名称:mmc,代码行数:31,代码来源:manager.php


示例14: NotifyWidgetSuccess

            new NotifyWidgetSuccess(_T("SSH public keys updated.", "sshlpk"));
        }
    } else {
        if (!$showSshkeys && hasSshKeyObjectClass($uid)) {
            delSSHKeyObjectClass($uid);
            if (!isXMLRPCError()) {
                new NotifyWidgetSuccess(_T("SSH public keys attributes deleted.", "sshlpk"));
            }
        }
    }
    redirectTo(urlStrRedirect('base/users/sshkeys'));
}
$p = new PageGenerator(_T("Change your SSH keys", "sshlpk"));
$p->setSideMenu($sidemenu);
$p->display();
$show = hasSshKeyObjectClass($uid);
$f = new ValidatingForm();
$f->push(new Table());
$f->add(new TrFormElement(_T("Enable SSH keys management", "sshlpk"), new CheckboxTpl("showusersshkey")), array("value" => $show ? "checked" : "", "extraArg" => 'onclick="toggleVisibility(\'sshkeydiv\');"'));
$f->pop();
$sshkeydiv = new Div(array("id" => "sshkeydiv"));
$sshkeydiv->setVisibility($show);
$f->push($sshkeydiv);
if ($show) {
    $sshkeys = getAllSshKey($uid);
} else {
    $sshkeys = array("0" => "");
}
$f->add(new TrFormElement('', new MultipleInputTpl("sshuserkeys", _T("Public SSH Key", "sshlpk"))), $sshkeys);
$f->addValidateButton("bssh");
$f->display();
开发者ID:psyray,项目名称:mmc,代码行数:31,代码来源:edit.php


示例15: intval

$ID = intval(@max($_GET['id'], $_POST['id']));
$NAME = $_GET['Label'];
$PARENTID = intval(@max($_GET['parentId'], $_POST['parentId']));
if (isset($_POST['bconfirm'])) {
    $cfg = array('name' => $_POST['name'], 'id' => $_POST['id'], 'parentId' => $_POST['parentId']);
    if ($ID && $ID != 1) {
        deleteEntities($cfg['id'], $cfg['name'], $cfg['parentId']);
        if (!isXMLRPCError()) {
            header('location: main.php?module=base&submod=computers&action=entityList');
        } else {
            new NotifyWidgetFailure(_T("The entity has not been deleted.", "inventory"));
        }
    }
}
$p = new PageGenerator(_T("Delete entity", "inventory"));
$p->setSideMenu($sidemenu);
$p->display();
if ($ID == 1) {
    header('location: main.php?module=base&submod=computers&action=entityList');
    exit(0);
}
$f = new ValidatingForm();
$f->push(new Table());
$f->add(new TrFormElement(_T('Name', 'inventory'), new InputTpl('name')), array("value" => $NAME, "required" => True));
if ($ID) {
    $f->add(new HiddenTpl("id"), array("value" => $ID, "hide" => True));
    $f->add(new HiddenTpl("parentId"), array("value" => $PARENTID, "hide" => True));
}
$f->pop();
$f->addValidateButton("bconfirm");
$f->display();
开发者ID:pulse-project,项目名称:pulse,代码行数:31,代码来源:deleteEntity.php


示例16: get_report_sections

<?php 
require "graph/navbar.inc.php";
require "localSidebar.php";
require_once "modules/report/includes/xmlrpc.inc.php";
require_once "modules/report/includes/html.inc.php";
require_once "modules/report/includes/report.inc.php";
require_once "modules/pulse2/includes/utilities.php";
$MMCApp =& MMCApp::getInstance();
$report = get_report_sections($_SESSION['lang']);
$p = new PageGenerator();
$p->setSideMenu($sidemenu);
$p->display();
$t = new TitleElement(_T("Report creation", 'report'));
$t->display();
$f = new ValidatingForm();
/*
 * $_SESSION['report_files']
 * Used to store datas for PDF/XLS reports
 * $_SESSION['report_files'][mmc_plugin_name][report_name]
 */
if (!isset($_SESSION['report_files'])) {
    $_SESSION['report_files'] = array();
}
// first step, display selectors
if (!array_intersect_key($_POST, array('generate_report' => '', 'get_xls' => '', 'get_pdf' => ''))) {
    $f->push(new Table());
    /* Period */
    $f->add(new TrFormElement(_T('Period', 'report'), new periodInputTpl(_T('from', 'report'), 'period_from', _T('to', 'report'), 'period_to')), array("value" => $values, "required" => True));
    /* Entities */
    $entities = new SelectMultiTpl('entities[]');
开发者ID:sebastiendu,项目名称:mmc,代码行数:30,代码来源:index.php


示例17: array

 $p_api_id = $res[0]['uuid'];
 $list_val = $list = array();
 if (!isset($_SESSION['PACKAGEAPI'])) {
     $_SESSION['PACKAGEAPI'] = array();
 }
 foreach ($res as $mirror) {
     $list_val[$mirror['uuid']] = $mirror['uuid'];
     $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());
开发者ID:pulse-project,项目名称:pulse,代码行数:31,代码来源:add.php


示例18: PageGenerator

        if ($ret['id'] == $SYNCHROSTATE_RUNNING) {
            $p = new PageGenerator(sprintf(_T("%s's profile imaging", 'imaging'), $group->getName()));
            $sidemenu->forceActiveItem("index");
            $p->setSideMenu($sidemenu);
            $p->display();
            $a_href_open = "<a href=''>";

            $msg = sprintf(_T("The synchro is currently running, please wait or reload the page %shere%s.<br/>", "imaging"), $a_href_open, '</a>');
            $t1 = new TitleElement($msg, 3);
            $t1->display();
            $msg = sprintf(_T("If the synchro runs since more than 5 minutes, please reset the synchro state of this computer's menu.", "imaging"));
            $t2 = new TitleElement($msg, 3);
            $t2->display();

            $f = new ValidatingForm();
            $f->add(new HiddenTpl("gid"),                    array("value" => $params['target_uuid'],            "hide" => True));
            $f->add(new HiddenTpl("groupname"),                    array("value" => $params['target_name'],            "hide" => True));
            $f->add(new HiddenTpl("type"),                           array("value" => $params['type'],                   "hide" => True));
            $f->addButton("bresetsynchrostate", _T("Reset Synchro state", "imaging"));
            $f->display();

        } else {
            # do nothing special if $SYNCHROSTATE_DONE
            $p = new TabbedPageGenerator();
            $sidemenu->forceActiveItem("list_profiles");
            $p->setSideMenu($sidemenu);
            global $stateid;
            $stateid = $ret['id'];

            $params['groupname'] = $group->getName();
开发者ID:neoclust,项目名称:mmc,代码行数:30,代码来源:tabs.php


示例19: array

            $exitrule = True;
        }
    }
} else {
    // add rule mode
    $rule[] = array("operand1" => "Network/IP", "operand2" => "/.*/", "entitie" => $entityroot, "aggregator" => "", "operator" => "match", "actif" => 1, "numRule" => $datarule['nb_regle'] + 1);
}
if (!isset($regle)) {
    $newnumRule = $datarule['nb_regle'] + 1;
} else {
    $newnumRule = $regle;
}
$p = new PageGenerator(_T("Add rule", 'inventory'));
$p->setSideMenu($sidemenu);
$p->display();
$f = new ValidatingForm();
$f->push(new Table());
$f->add(new TrFormElement(_T("Active", "inventory"), new CheckboxTpl('active')), array("value" => $rule[0]['actif'] == 1 ? 'checked' : ''));
$selectOperatorType = new SelectItemtitle("operator[]", _T('selection from this item', 'inventory') . "\n");
$selectOperatorType->setElements($operatorType);
$selectOperatorType->setElementsVal($operatorType);
$aggregator_select = new SelectItemtitle("aggregator", _T('aggregator a rule', 'inventory') . "\n" . _T('AND all rules TRUE select entitie', 'inventory') . "\n" . _T('OR one rule TRUE select entitie', 'inventory') . "\n" . _T('NONE rule TRUE select entitie', 'inventory'));
$aggregator_select->setElements(array('AND', 'OR', 'NONE'));
$aggregator_select->setElementsVal(array('AND', 'OR', ''));
$f->add(new TrFormElement(_T('Aggregator', 'inventory'), $aggregator_select), array("value" => $rule[0]['aggregator']));
// or sans aggregator
//$f->add(new HiddenTpl("aggregator"), array("value" => "", "hide" => True));
$operator_select = new SelectItemtitle("operators[]", _T('Match', 'inventory') . ":\n" . _T(' regular expression', 'inventory') . "\n" . _T(' special characters must be escaped in regular expressions', 'inventory') . "\n" . _T(' .^$*+?()[{\\|') . "\n" . _T(' not start with word   /^(?!my string).*$/', 'inventory') . "\n" . _T(' start with my string /^my string.*$/', 'inventory') . "\n" . _T(' does not contain /^((?!my string).)*$/', 'inventory') . "\n" . _T(' egal to or contains', 'inventory') . "/my string/" . "\n" . _T(' finishes by  /.*(my string)$/', 'inventory') . "\n\n" . _T('Equal or noequal', 'inventory') . ":\n" . _T(' strictly equal or inequality', 'inventory') . "\n\n" . _T('Contains or NoContains', 'inventory') . ":\n" . _T(' has value or not', 'inventory') . "\n\n" . _T('Starts by or Finishes', 'inventory') . ":\n" . _T(' begins or ends with value', 'inventory'));
$operators = array("match" => _T('matches (regex)', 'inventory'), "equal" => _T('equal', 'inventory'), "noequal" => _T('not equal', 'inventory'), "contains" => _T('contains', 'inventory'), "nocontains" => _T('not contains', 'inventory'), "starts" => _T('starts by', 'inventory'), "finishes" => _T('finishes by', 'inventory'));
$operator_select->setElements(array_values($operators));
$operator_select->setElementsVal(array_keys($operators));
开发者ID:pulse-project,项目名称:pulse,代码行数:31,代码来源:addEntityRule.php


示例20: header

    $resultPopup->add('<div class="alert alert-success">' . $result . '</div>');
}
// in case of modification/creation success, redirect to the edit page
if ($redirect) {
    header('Location: ' . urlStrRedirect("base/users/edit", array("user" => $uid)));
    exit;
}
// in case of failure, set errorStatus to 0 in order to display the edit form
$errorStatus = 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();
}
开发者ID:pulse-project,项目名称:pulse,代码行数:31,代码来源:edit.php



注:本文中的ValidatingForm类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Validation类代码示例发布时间:2022-05-23
下一篇:
PHP Validate类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap