예제 #1
0
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: save_template.php,v 1.6 2005/04/03 07:57:14 filetreefrog Exp $
##################################################
if (!defined("PATHOS")) {
    exit("");
}
if ($user && $user->is_acting_admin == 1) {
    $page = null;
    if (isset($_POST['id'])) {
        $page = $db->selectObject("section_template", "id=" . $_POST['id']);
    }
    $page = section_template::update($_POST, $page);
    if (isset($page->id)) {
        $db->updateObject($page, "section_template");
    } else {
        if ($page->parent != 0) {
            // May have to change the section rankings, because the user could have put us in between two previous pages
            $db->increment('section_template', 'rank', 1, 'parent=' . $page->parent . ' AND rank >= ' . $page->rank);
        }
        $db->insertObject($page, "section_template");
    }
    pathos_flow_redirect();
} else {
    echo SITE_403_HTML;
}
예제 #2
0
# General Public License along with Exponent; if
# not, write to:
#
# Free Software Foundation, Inc.,
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307  USA
#
# $Id: edit_template.php,v 1.5 2005/04/03 07:57:14 filetreefrog Exp $
##################################################
if (!defined('PATHOS')) {
    exit('');
}
if ($user && $user->is_acting_admin == 1) {
    $page = null;
    if (isset($_GET['id'])) {
        $page = $db->selectObject('section_template', 'id=' . $_GET['id']);
    }
    if ($page == null) {
        $page->parent = isset($_GET['parent']) ? $_GET['parent'] : 0;
    }
    $form = section_template::form($page);
    $form->meta('module', 'navigationmodule');
    $form->meta('action', 'save_template');
    $template = new template('navigationmodule', '_form_editTemplate', $loc);
    $template->assign('form_html', $form->toHTML());
    $template->assign('is_top', $page->parent == 0 ? 1 : 0);
    $template->output();
} else {
    echo SITE_403_HTML;
}