]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19792 Applied Sam's patch
authornicolasconnault <nicolasconnault>
Mon, 7 Sep 2009 10:01:26 +0000 (10:01 +0000)
committernicolasconnault <nicolasconnault>
Mon, 7 Sep 2009 10:01:26 +0000 (10:01 +0000)
blog/edit.php
blog/external.php
blog/header.php
blog/lib.php
blog/preferences.php

index 6b37aa5ec88ed10174d41193e65d5296088fd47e..af16198fd5cb35edc2dec22f6c9686c57f534094 100755 (executable)
@@ -82,7 +82,7 @@ if (!empty($courseid) && empty($modid)) {
 // If a modid is given, guess courseid
 if (!empty($modid)) {
     $returnurl->param('modid', $modid);
-    $courseid = $DB->get_field('course_modules', 'course', array('id' => $modid)); 
+    $courseid = $DB->get_field('course_modules', 'course', array('id' => $modid));
     $returnurl->param('courseid', $courseid);
     $PAGE->set_context(get_context_instance(CONTEXT_MODULE, $modid));
 }
@@ -99,7 +99,9 @@ if ($action === 'delete'){
     } else {
         $optionsyes = array('id'=>$id, 'action'=>'delete', 'confirm'=>1, 'sesskey'=>sesskey(), 'courseid'=>$courseid);
         $optionsno = array('userid'=>$existing->userid, 'courseid'=>$courseid);
-        print_header("$SITE->shortname: $strblogs", $SITE->fullname);
+        $PAGE->set_title("$SITE->shortname: $strblogs");
+        $PAGE->set_heading($SITE->fullname);
+        echo $OUTPUT->header();
         //blog_print_entry($existing);
         $existing->print_html();
         echo '<br />';
@@ -226,19 +228,9 @@ if (!$user = $DB->get_record('user', array('id'=>$userid))) {
 
 $blog_headers = blog_get_headers();
 
-$navigation = build_navigation($blog_headers['navlinks'], $blog_headers['cm']);
-/*
-$navlinks = array();
-$navlinks[] = array('name' => fullname($user), 'link' => "$CFG->wwwroot/user/view.php?id=$userid", 'type' => 'misc');
-$navlinks[] = array('name' => $strblogs, 'link' => "$CFG->wwwroot/blog/index.php?userid=$userid", 'type' => 'misc');
-$navlinks[] = array('name' => $strformheading, 'link' => null, 'type' => 'misc');
-$navigation = build_navigation($navlinks);
-*/
-$PAGE->requires->js('blog/edit_form.js'); 
-$PAGE->set_title($blog_headers['title']);
-$PAGE->set_heading($blog_headers['title']);
-
-echo $OUTPUT->header($navigation);
+$PAGE->requires->js('blog/edit_form.js');
+
+echo $OUTPUT->header();
 
 $blogeditform->set_data($entry);
 $blogeditform->display();
index e5cc9e7ae111c2c135c9e5c02b3b3a316b6fa2a2..6e0a9c845ab6af4d82559c3b1e8450135a0ad98d 100644 (file)
@@ -113,16 +113,13 @@ if ($externalblogform->is_cancelled()){
     redirect($returnurl);
 }
 
-$navlinks = array();
-$navlinks[] = array('name' => fullname($user), 'link' => "$CFG->wwwroot/user/view.php?id=$user->id", 'type' => 'misc');
-$navlinks[] = array('name' => $strblogs, 'link' => "$CFG->wwwroot/blog/index.php?userid=$user->id", 'type' => 'misc');
-$navlinks[] = array('name' => $strformheading, 'link' => null, 'type' => 'misc');
-$navigation = build_navigation($navlinks);
-
+$PAGE->navbar->add(fullname($user), new moodle_url($CFG->wwwroot.'/user/view.php', array('id'=>$user->id)));
+$PAGE->navbar->add($strblogs, new moodle_url($CFG->wwwroot.'/blog/index.php', array('userid'=>$user->id)));
+$PAGE->navbar->add($strformheading);
 $PAGE->set_heading("$SITE->shortname: $strblogs: $strexternalblogs", $SITE->fullname);
 $PAGE->set_title("$SITE->shortname: $strblogs: $strexternalblogs");
 
-echo $OUTPUT->header($navigation);
+echo $OUTPUT->header();
 echo $OUTPUT->heading($strformheading, 2);
 
 $external->returnurl = $returnurl;
index 0c14c6703a815235d4a01528069f703494d48832..0823407a9563782bc6c1f04558cb31a991c86fc7 100755 (executable)
@@ -99,12 +99,6 @@ if (!empty($search_link)) {
 
 $blog_headers = blog_get_headers();
 
-if (isset($cm)) {
-    $navigation = build_navigation($blog_headers['navlinks'], $cm);
-} else {
-    $navigation = build_navigation($blog_headers['navlinks']);
-}
-
 // prints the tabs
 $showroles = !empty($userid);
 $currenttab = 'blogs';
index 0ff3436a8329ea3bfbb4ca0c217f78b88f12440b..4b51b721b20a41700f7092926bc7cf2bc48d64fb 100755 (executable)
@@ -518,7 +518,7 @@ function blog_get_headers() {
     $action   = optional_param('action', null, PARAM_ALPHA);
     $confirm  = optional_param('confirm', false, PARAM_BOOL);
 
-    $headers = array('navlinks' => array(), 'title' => '', 'heading' => '', 'cm' => null);
+    $headers = array('title' => '', 'heading' => '', 'cm' => null);
 
     $blog_url = new moodle_url($CFG->wwwroot . '/blog/index.php');
     $site = $DB->get_record('course', array('id' => SITEID));
index e5e9ed9f9b5fccf9b15145228bc5d9e373266d21..6b28503fd308afb94a895f601858b335cf5fabe3 100755 (executable)
@@ -67,15 +67,14 @@ $site = get_site();
 
 $strpreferences = get_string('preferences');
 $strblogs       = get_string('blogs', 'blog');
-$navlinks = array(array('name' => $strblogs, 'link' => "$CFG->wwwroot/blog/", 'type' => 'misc'));
-$navlinks[] = array('name' => $strpreferences, 'link' => null, 'type' => 'misc');
-$navigation = build_navigation($navlinks);
 
 $title = "$site->shortname: $strblogs : $strpreferences";
 $PAGE->set_title($title);
 $PAGE->set_heading($title);
+$PAGE->navbar->add($strblogs, new moodle_url($CFG->wwwroot.'/blog/'));
+$PAGE->navbar->add($strpreferences);
 
-echo $OUTPUT->header($navigation);
+echo $OUTPUT->header();
 
 echo $OUTPUT->heading("$strblogs : $strpreferences", 2);