// factories and create other sections).
        $section = $db->selectObject('section', 'id=' . intval($_GET['id']));
        $check_id = $section->id;
    } else {
        if (isset($_GET['parent'])) {
            // The isset check is merely a precaution.  This action should
            // ALWAYS be invoked with a parent or id value in the GET.
            $section->parent = intval($_GET['parent']);
            $check_id = $section->parent;
        }
    }
}
if ($check_id != -1 && exponent_permissions_check('manage', exponent_core_makeLocation('NavigationModule', '', $check_id))) {
    if (!isset($section->id)) {
        // Adding pagesets only works for adding, not editting.
        $form = section::pagesetForm($section);
        $form->meta('module', 'NavigationModule');
        $form->meta('action', 'save_pagesetpage');
        // Create a template for the form output, so that the themer can
        // optionally change the form title and caption
        $template = new template('NavigationModule', '_form_addPagesetPage');
        // Assign the form's rendered HTML, with the customary name 'form_html'
        $template->assign('form_html', $form->toHTML());
        $template->output();
    } else {
        // User is trying to edit a pageset page.  This is an error.
        // FIXME: Need some sort of Internal Server Error message.
        // FIXME: For now, using SITE_404_HTML.
        echo SITE_404_HTML;
    }
} else {