本文整理汇总了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();
}
}
示例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 */
示例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");
示例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 />";
示例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)) {