示例#1
0
<?php

$NavGroups = new PerchContent_NavGroups();
$groups = $NavGroups->all();
示例#2
0
<?php

$NavGroups = new PerchContent_NavGroups();
$Pages = new PerchContent_Pages();
$Form = new PerchForm('edit');
$message = false;
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $groupID = (int) $_GET['id'];
    $NavGroup = $NavGroups->find($groupID);
} else {
    $groupID = false;
    $NavGroup = false;
}
$Form = new PerchForm('editpage');
$req = array();
$req['groupTitle'] = "Required";
$Form->set_required($req);
if ($Form->posted() && $Form->validate()) {
    $postvars = array('groupTitle');
    $data = $Form->receive($postvars);
    if (is_object($NavGroup)) {
        $NavGroup->update($data);
        $Alert->set('success', PerchLang::get('Your navigation group has been successfully updated.'));
    } else {
        $data['groupSlug'] = PerchUtil::urlify($data['groupTitle']);
        $NavGroup = $NavGroups->create($data);
        if (is_object($NavGroup)) {
            PerchUtil::redirect(PERCH_LOGINPATH . '/core/apps/content/navigation/edit/?id=' . $NavGroup->id() . '&created=1');
        } else {
            $Alert->set('failure', PerchLang::get('There was a problem creating the navigation group.'));
        }
示例#3
0
<?php

$NavGroups = new PerchContent_NavGroups();
$Pages = new PerchContent_Pages();
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
    $groupID = (int) $_GET['id'];
    $NavGroup = $NavGroups->find($groupID);
} else {
    $groupID = false;
    $NavGroup = false;
}