function cms_breadcrumbs(&$path, $navidata) { global $CFG; $path[$navidata->title] = $CFG->wwwroot . '/cms/view.php?page=' . $navidata->pagename; if ($navidata->parentid) { if (!($parent = get_record('cmsnavi_data', 'pageid', $navidata->parentid, '', '', '', '', 'title, pagename, parentid'))) { error('Could not find data for page ' . $navidata->parentid); } cms_breadcrumbs($path, $parent); } }
} if (!empty($section)) { if (!empty($move) and confirm_sesskey()) { if (!move_section($course, $section, $move)) { notify('An error occurred while moving a section'); } } } } else { $USER->editing = 0; } $SESSION->fromdiscussion = $CFG->wwwroot . '/cms/view.php?page=' . $pagedata->pagename; if ($course->id == SITEID) { // do these if we're on site level. $breadcrumbs = array(); cms_breadcrumbs($breadcrumbs, $pagedata); $navigation = cms_navigation_string($breadcrumbs); //$PAGE->print_header('%fullname%', $breadcrumbs); // Use this since we might want to manipulate metadata. Otherwise we // should write derived page class for cms plugin. print_header(strip_tags($course->fullname), $course->fullname, $navigation, '', '<meta name="description" content="' . s(strip_tags($course->summary)) . '" />', true, '', user_login_string($course) . $langmenu); echo '<div class="course-content">'; // course wrapper start // TODO: for efficiency, check first that sections are actually used in the page //if ( preg_match("/{#section([0-9]+)}/im", $pagedata->body) && // empty($GLOBALS['mods']) && empty($GLOBALS['modnames']) ) { $modinfo =& get_fast_modinfo($COURSE); get_all_mods($course->id, $mods, $modnames, $modnamesplural, $modnamesused); foreach ($mods as $modid => $unused) { if (!isset($modinfo->cms[$modid])) { rebuild_course_cache($course->id);