本文整理匯總了PHP中Sections::updateSection方法的典型用法代碼示例。如果您正苦於以下問題:PHP Sections::updateSection方法的具體用法?PHP Sections::updateSection怎麽用?PHP Sections::updateSection使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sections
的用法示例。
在下文中一共展示了Sections::updateSection方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: act
function act($section)
{
$data = array();
$data['parent_id'] = $_POST['parent_id'];
$data['name'] = $_POST['name'];
$data['text'] = $_POST['text'];
if (isset($_POST['edit'])) {
$data['id'] = $section;
if (!Sections::isSection($data['parent_id'])) {
$data['parent_id'] = 0;
}
Sections::updateSection($data);
header("Location: " . PATH . "/admin.php?section=" . $section);
} else {
if (isset($_POST['delete'])) {
Sections::deleteSection($section);
header("Location: " . PATH . "/admin.php");
} else {
if (isset($_POST['add'])) {
if (!Sections::isSection($data['parent_id'])) {
$data['parent_id'] = 0;
}
Sections::insertSection($data);
header("Location: " . PATH . "/admin.php?section=" . $data['parent_id']);
} else {
header("Location: " . PATH . "/admin.php?section=" . $section);
}
}
}
}