当前位置: 首页>>代码示例>>PHP>>正文


PHP FormHandler::setArr方法代码示例

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


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

示例1: _userquota_baseGroupEdit

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();
    }
}
开发者ID:neoclust,项目名称:mmc,代码行数:32,代码来源:publicFunc.php

示例2: FormHandler

    $FH = new FormHandler("editUserFH", $_POST);
} else {
    $FH = new FormHandler("editUserFH", array());
}
switch ($_GET["action"]) {
    case "add":
        $mode = "add";
        $title = _("Add user");
        $activeItem = "add";
        break;
    case "edit":
        $mode = "edit";
        $title = _("Edit user");
        $activeItem = "index";
        $uid = $_GET["user"];
        $FH->setArr(getDetailedUser($uid));
        break;
    default:
        $mode = false;
        break;
}
$redirect = false;
// if data is sent
if ($_POST) {
    $uid = $FH->getPostValue('uid');
    /* Check sent data */
    $ret = callPluginFunction("verifInfo", array($FH, $mode));
    if (!$error && !isXMLRPCError()) {
        /* Add or edit user attributes */
        $ret = callPluginFunction("changeUser", array($FH, $mode));
        /* Primary group management */
开发者ID:pulse-project,项目名称:pulse,代码行数:31,代码来源:edit.php

示例3: FormHandler

$result = "";
// Class managing $_POST array
if ($_POST) {
    $FH = new FormHandler("editAliasFH", $_POST);
} else {
    $FH = new FormHandler("editAliasFH", array());
}
if ($_GET["action"] == "add") {
    $mode = "add";
    $title = _T("Add a virtual alias", "mail");
} else {
    $mode = "edit";
    $title = _T("Edit virtual alias", "mail");
    $sidemenu->forceActiveItem("index");
    $alias = $_GET['alias'];
    $FH->setArr(getVAlias($alias));
}
if ($_POST) {
    if ($mode == "add") {
        if ($FH->isUpdated("mailalias")) {
            addVAlias($FH->getValue("mailalias"));
            $alias = $FH->getValue("mailalias");
            $result .= _T("The virtual alias has been created.", "mail") . "<br />";
        } else {
            $error .= _T("The alias name is required.", "mail");
            setFormError("mailalias");
        }
    } else {
        if ($FH->isUpdated("mailalias")) {
            changeVAliasName($alias, $FH->getValue("mailalias"));
            $alias = $FH->getValue("mailalias");
开发者ID:sebastiendu,项目名称:mmc,代码行数:31,代码来源:edit.php

示例4: updateFailoverConfig

}
function updateFailoverConfig($FH)
{
    global $result;
    global $error;
    setFailoverConfig($FH->getPostValue("primaryIp"), $FH->getPostValue("secondaryIp"), $FH->getPostValue("primaryPort"), $FH->getPostValue("secondaryPort"), $FH->getPostValue("delay"), $FH->getPostValue("update"), $FH->getPostValue("balance"), $FH->getPostValue("mclt"), $FH->getPostValue("split"));
    if (!isXMLRPCError()) {
        $result .= _T("Failover configuration updated.") . "<br />";
        $result .= _T("You must restart DHCP services.") . "<br />";
    } else {
        $error .= _T("Failed to update the failover configuration.") . "<br />";
    }
}
// get current configuration
$failoverConfig = getFailoverConfig();
$FH->setArr($failoverConfig);
// default values
$show = false;
if (isset($failoverConfig['secondary'])) {
    $show = true;
}
if ($_POST) {
    $result = "";
    $error = "";
    if ($FH->isUpdated("dhcp_failover") and $FH->getValue("dhcp_failover") == "off") {
        delFailoverConfig();
        delSecondaryServer();
        if (!isXMLRPCError()) {
            $result .= _T("Failover configuration disabled.") . "<br />";
        } else {
            $error .= _T("Failed to disable the failover configuration.") . "<br />";
开发者ID:sebastiendu,项目名称:mmc,代码行数:31,代码来源:servicedhcpfailover.php

示例5: FormHandler

$result = "";
// Class managing $_POST array
if ($_POST) {
    $FH = new FormHandler("editPPolicyFH", $_POST);
} else {
    $FH = new FormHandler("editPPolicyFH", array());
}
if ($_GET["action"] == "addppolicy") {
    $mode = "add";
    $title = _T("Add a password policy", "ppolicy");
} else {
    $mode = "edit";
    $title = _T("Edit password policy", "ppolicy");
    $sidemenu->forceActiveItem("indexppolicy");
    $ppolicy = $_GET['ppolicy'];
    $FH->setArr(getAllPPolicyAttributes($ppolicy));
}
if ($_POST) {
    $name = $FH->getPostValue("cn");
    $desc = $FH->getPostValue("description");
    // Some sanity checks...
    if ($FH->isUpdated("pwdMaxAge") or $FH->isUpdated("pwdMinAge")) {
        $max = $FH->getPostValue("pwdMaxAge");
        $min = $FH->getPostValue("pwdMinAge");
        if ($min && $max && $min > $max) {
            $error .= _T('"Maximum age" must be greater than "Minimum age".', 'ppolicy') . "<br />";
            setFormError("pwdMinAge");
        }
    }
    if ($mode == "add") {
        if (!checkPPolicy($name)) {
开发者ID:sebastiendu,项目名称:mmc,代码行数:31,代码来源:edit.php


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