Beispiel #1
0
            $error = get_string('missingtitle', 'cms');
        }
    }
}
$usehtmleditor = can_use_html_editor();
$form = empty($page) ? cms_get_pagedata($id) : $page;
if (!empty($version)) {
    if ($versiondata = get_record("cmspages_history", "id", $version)) {
        $form->body = $versiondata->content;
    }
}
$form->menus = get_records("cmsnavi", "course", $course->id);
$form->id = $form->naviid;
$form->pageid = empty($page) ? $id : intval($page->pageid);
ob_start();
include_webfx_scripts();
if (isset($page->preview)) {
    // Preview button has been pressed
    cms_print_preview($page, $course);
}
print_simple_box_start("center", "100%", "", 20);
if (!empty($error)) {
    notify($error);
}
include_once 'html/editpage.php';
print_simple_box_end();
if ($usehtmleditor) {
    use_html_editor();
}
print_footer($course);
ob_end_flush();
Beispiel #2
0
$form->menus = get_records("cmsnavi", "course", $course->id);
// provide default values unless fields are already set
$form->title = $pagetitle;
$form->body = $pagebody;
$form->pagename = $pagename;
$form->parentname = $pageparentname;
$form->showinmenu = !empty($pageshowinmenu) ? $pageshowinmenu : 1;
$form->showblocks = !empty($pageshowblocks) ? $pageshowblocks : 0;
$form->publish = !empty($pagepublish) ? $pagepublish : 1;
ob_start();
$navlinks = array();
$navlinks[] = array('name' => $strcms . ' ' . $stradministration, 'link' => "index.php?course={$course->id}&sesskey={$USER->sesskey}", 'type' => 'misc');
$navlinks[] = array('name' => $straddnew, 'link' => "", 'type' => 'misc');
$navigation = build_navigation($navlinks);
print_header_simple($straddnew, "", $navigation, "", "", true);
include_webfx_scripts();
if (!empty($pagepreview)) {
    // Preview button has been pressed
    cms_print_preview(data_submitted(), $course);
}
print_simple_box_start("center", "100%", "", 20);
if (!empty($error)) {
    notify($error);
}
include_once 'html/editpage.php';
print_simple_box_end();
if ($usehtmleditor) {
    use_html_editor();
}
print_footer($course);
ob_end_flush();