Ejemplo n.º 1
0
 function process_subsections($parent_section, $subtpl)
 {
     global $db;
     $section = null;
     $section->parent = $parent_section->id;
     $section->name = $subtpl->name;
     $section->subtheme = $subtpl->subtheme;
     $section->active = $subtpl->active;
     $section->public = $subtpl->public;
     $section->rank = $subtpl->rank;
     $section->page_title = $subtpl->page_title;
     $section->keywords = $subtpl->keywords;
     $section->description = $subtpl->description;
     $section->id = $db->insertObject($section, 'section');
     navigationmodule::process_section($section, $subtpl);
 }
Ejemplo n.º 2
0
}
$section = section::updatePageset($_POST, null);
// 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(gt('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.'));
}
if (expPermissions::check('manage', expCore::makeLocation('navigationmodule', '', $section->parent))) {
    // Still have to do some pageset processing, mostly handled by a handy
    // member method of the navigationmodule class.
    // Since this is new, we need to increment ranks, in case the user
    // added it in the middle of the level.
    $db->increment('section', 'rank', 1, 'rank >= ' . $section->rank . ' AND parent=' . $section->parent);
    // New section (Pagesets always are).  Insert a new database
    // record, and save the ID for the processing methods that need them.
    $section->id = $db->insertObject($section, 'section');
    // Process the pageset, to add sections and subsections, as well as default content
    // that the pageset writer added to each element of the set.
    expSession::clearAllUsersSessionCache('navigationmodule');
    navigationmodule::process_section($section, $_POST['pageset']);
    // Go back to where we came from.  Probably the navigation manager.
    expHistory::back();
} else {
    echo SITE_403_HTML;
}