本文整理汇总了PHP中Sections::modify_section方法的典型用法代码示例。如果您正苦于以下问题:PHP Sections::modify_section方法的具体用法?PHP Sections::modify_section怎么用?PHP Sections::modify_section使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sections
的用法示例。
在下文中一共展示了Sections::modify_section方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
print "\t<a class='btn btn-sm btn-danger editSectionSubmitDelete' id='editSectionSubmitDelete'>" . _("Confirm") . "</a>";
print "</div>";
print "</div>";
print "</div>";
} else {
# set variables for update
$values = array("id" => @$_POST['id'], "name" => @$_POST['name'], "description" => @$_POST['description'], "strictMode" => @$_POST['strictMode'], "subnetOrdering" => @$_POST['subnetOrdering'], "showVLAN" => @$_POST['showVLAN'], "showVRF" => @$_POST['showVRF'], "masterSection" => @$_POST['masterSection']);
# set permissions
foreach ($_POST as $key => $val) {
if (substr($key, 0, 5) == "group") {
if ($val != "0") {
$perm[substr($key, 5)] = $val;
}
}
}
$values['permissions'] = isset($perm) ? json_encode($perm) : "";
# delegate to all subnets?
if (isset($_POST['delegate'])) {
if ($_POST['delegate'] == 1) {
$values['delegate'] = 1;
} else {
$values['delegate'] = 0;
}
}
# execute update
if (!$Sections->modify_section($_POST['action'], $values, @$_POST['id'])) {
$Result->show("danger", _("Section {$_POST['action']} failed"), true);
} else {
$Result->show("success", _("Section {$_POST['action']} successful"), true);
}
}
示例2: dirname
<?php
/**
* Function to add / edit / delete section
*************************************************/
/* functions */
require dirname(__FILE__) . '/../../../functions/functions.php';
# initialize user object
$Database = new Database_PDO();
$User = new User($Database);
$Admin = new Admin($Database);
$Sections = new Sections($Database);
$Result = new Result();
# verify that user is logged in
$User->check_user_session();
# create array of ordering
$otmp = explode(";", $_POST['position']);
foreach ($otmp as $ot) {
$ptmp = explode(":", $ot);
$order[$ptmp[0]] = $ptmp[1];
}
#update
if (!$Sections->modify_section("reorder", $order)) {
$Result->show("danger", _("Section reordering failed"), true);
} else {
$Result->show("success", _("Section reordering successful"), true);
}