예제 #1
0
    exit('');
}
$check_id = -1;
$section = null;
$old_parent = null;
if (isset($_POST['id'])) {
    // Saving an existing content page.  Read it from the database.
    $section = $db->selectObject('section', 'id=' . intval($_POST['id']));
    if ($section) {
        $old_parent = $section->parent;
        $check_id = $section->id;
    }
}
echo $old_parent;
// Update the section from the _POST data.
$section = section::update($_POST, $section);
if ($check_id == -1) {
    $check_id = $section->parent;
}
if ($check_id != -1 && expPermissions::check('manage', expCore::makeLocation('navigationmodule', '', $check_id))) {
    // make sure the SEF name is valid
    global $router;
    if (empty($section->sef_name)) {
        $section->sef_name = $router->encode($section->name);
    }
    if (!section::isValidName($section->sef_name)) {
        expValidator::failAndReturnToForm('You have invalid characters in the SEF Name field.');
    }
    if (section::isDuplicateName($section)) {
        expValidator::failAndReturnToForm(gt('The name specified in the SEF Name field is a duplicate of an existing page.'));
    }