Skip to content

Commit

Permalink
navigation MDL-20216 Refactored add arguments
Browse files Browse the repository at this point in the history
Moved $action argument from arg5 to arg2
  • Loading branch information
samhemelryk committed Sep 4, 2009
1 parent a800639 commit 91152a3
Show file tree
Hide file tree
Showing 44 changed files with 192 additions and 228 deletions.
3 changes: 1 addition & 2 deletions admin/dbperformance.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
$site = get_site();

if (!empty($topframe)) {
$PAGE->navbar->add($stradministration, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/admin/index.php'));
$PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/admin/index.php'));
$PAGE->navbar->add($strdatabaseperformance);
$PAGE->set_title("$site->shortname: $strdatabaseperformance");
$PAGE->set_heading($site->fullname);
Expand Down
6 changes: 2 additions & 4 deletions admin/mnet/delete.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<?php
$PAGE->navbar->add($stradministration, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php'));
$PAGE->navbar->add(get_string('mnetsettings', 'mnet'), null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/mnet/index.php'));
$PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php'));
$PAGE->navbar->add(get_string('mnetsettings', 'mnet'), new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/mnet/index.php'));
$PAGE->navbar->add(get_string('deletehost', 'mnet'));

$PAGE->set_title("$site->shortname: $strmnetsettings");
Expand Down
6 changes: 2 additions & 4 deletions admin/roles/assign.php
Original file line number Diff line number Diff line change
Expand Up @@ -266,15 +266,13 @@
$PAGE->set_title($title);
if ($courseid != SITEID) {
if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_COURSE, $courseid))) {
$PAGE->navbar->add(get_string('participants'), null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
$PAGE->navbar->add(get_string('participants'), new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
}
$PAGE->set_heading($fullname);
} else {
$PAGE->set_heading($course->fullname);
}
$PAGE->navbar->add($fullname, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
$PAGE->navbar->add($fullname, new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
$PAGE->navbar->add($straction);
echo $OUTPUT->header();

Expand Down
6 changes: 2 additions & 4 deletions admin/roles/check.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,13 @@
$PAGE->set_title($title);
if ($courseid != SITEID) {
if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_COURSE, $courseid))) {
$PAGE->navbar->add(get_string('participants'), null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
$PAGE->navbar->add(get_string('participants'), new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
}
$PAGE->set_heading($fullname);
} else {
$PAGE->set_heading($course->fullname);
}
$PAGE->navbar->add($fullname, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
$PAGE->navbar->add($fullname, new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
$PAGE->navbar->add($straction);
echo $OUTPUT->header();

Expand Down
6 changes: 2 additions & 4 deletions admin/roles/override.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,13 @@
$PAGE->set_title($title);
if ($courseid != SITEID) {
if (has_capability('moodle/course:viewparticipants', get_context_instance(CONTEXT_COURSE, $course->id))) {
$PAGE->navbar->add(get_string('participants'), null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$course->id)));
$PAGE->navbar->add(get_string('participants'), new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$course->id)));
}
$PAGE->set_heading($fullname);
} else {
$PAGE->set_heading($course->fullname);
}
$PAGE->navbar->add($fullname, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
$PAGE->navbar->add($fullname, new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
$PAGE->navbar->add($straction);
echo $OUTPUT->header();

Expand Down
8 changes: 4 additions & 4 deletions admin/roles/tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
if (empty($title)) {
$title = $SITE->fullname;
}
$PAGE->navbar->add($stradministration, null, null, navigation_node::TYPE_SETTING, new moodle_url($CFG->wwwroot.'/admin/'));
$PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/admin/'), null, null, navigation_node::TYPE_SETTING);
$PAGE->navbar->add($straction);
$PAGE->set_title($title);
$PAGE->set_heading($SITE->fullname);
Expand All @@ -73,8 +73,8 @@
$title = "$SITE->shortname: $category->name";
}

$PAGE->navbar->add($strcategories, null, null, navigation_node::TYPE_SETTING, new moodle_url($CFG->wwwroot.'/course/index.php'));
$PAGE->navbar->add($category->name, null, null, navigation_node::TYPE_SETTING, new moodle_url($CFG->wwwroot.'/course/category.php', array('id'=>$category->id)));
$PAGE->navbar->add($strcategories, new moodle_url($CFG->wwwroot.'/course/index.php'), null, null, navigation_node::TYPE_SETTING);
$PAGE->navbar->add($category->name, new moodle_url($CFG->wwwroot.'/course/category.php', array('id'=>$category->id)), null, null, navigation_node::TYPE_SETTING);
$PAGE->set_title($title);
$PAGE->set_heading("$SITE->fullname: $strcourses");
echo $OUTPUT->header();
Expand All @@ -89,7 +89,7 @@
$title = get_string("editcoursesettings");
}
$roleslink = new moodle_url("$CFG->wwwroot/$CFG->admin/roles/assign.php", array('contextid'=>$context->id));
$PAGE->navbar->add(get_string('roles'), null, null, navigation_node::TYPE_SETTING, $roleslink);
$PAGE->navbar->add(get_string('roles'), $roleslink, null, null, navigation_node::TYPE_SETTING);
$PAGE->set_title($title);
$PAGE->set_heading($course->fullname);
echo $OUTPUT->header();
Expand Down
6 changes: 2 additions & 4 deletions admin/roles/usersroles.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,12 @@
if ($courseid != SITEID) {
$PAGE->set_heading($fullname);
if (has_capability('moodle/course:viewparticipants', $coursecontext)) {
$PAGE->navbar->add(get_string('participants'), null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
$PAGE->navbar->add(get_string('participants'),new moodle_url($CFG->wwwroot.'/user/index.php', array('id'=>$courseid)));
}
} else {
$PAGE->set_heading($course->fullname);
}
$PAGE->navbar->add($fullname, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
$PAGE->navbar->add($fullname, new moodle_url("$CFG->wwwroot/user/view.php", array('id'=>$userid,'course'=>$courseid)));
$PAGE->navbar->add($straction);
echo $OUTPUT->header();

Expand Down
4 changes: 2 additions & 2 deletions admin/xmldb/actions/edit_field_save/edit_field_save.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ function invoke() {
$tempfield->setDefault($default);
/// Prepare the output
$site = get_site();
$PAGE->navbar->add($this->str['administration'], null, null. navigation_node::TYPE_CUSTOM, '../index.php');
$PAGE->navbar->add('XMLDB', null, null. navigation_node::TYPE_CUSTOM, 'index.php');
$PAGE->navbar->add($this->str['administration'], '../index.php');
$PAGE->navbar->add('XMLDB', 'index.php');
$PAGE->set_title("$site->shortname: XMLDB");
$PAGE->set_heading($site->fullname);
echo $OUTPUT->header();
Expand Down
4 changes: 2 additions & 2 deletions admin/xmldb/actions/edit_index_save/edit_index_save.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ function invoke() {
$tempindex->setFields($fieldsarr);
/// Prepare the output
$site = get_site();
$PAGE->navbar->add($this->str['administration'], null, null. navigation_node::TYPE_CUSTOM, '../index.php');
$PAGE->navbar->add('XMLDB', null, null. navigation_node::TYPE_CUSTOM, 'index.php');
$PAGE->navbar->add($this->str['administration'], '../index.php');
$PAGE->navbar->add('XMLDB', 'index.php');
$PAGE->set_title("$site->shortname: XMLDB");
$PAGE->set_heading($site->fullname);
echo $OUTPUT->header();
Expand Down
4 changes: 2 additions & 2 deletions admin/xmldb/actions/edit_key_save/edit_key_save.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ function invoke() {
}
/// Prepare the output
$site = get_site();
$PAGE->navbar->add($this->str['administration'], null, null. navigation_node::TYPE_CUSTOM, '../index.php');
$PAGE->navbar->add('XMLDB', null, null. navigation_node::TYPE_CUSTOM, 'index.php');
$PAGE->navbar->add($this->str['administration'], '../index.php');
$PAGE->navbar->add('XMLDB', 'index.php');
$PAGE->set_title("$site->shortname: XMLDB");
$PAGE->set_heading($site->fullname);
echo $OUTPUT->header();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ function invoke() {
if (!empty($errors)) {
/// Prepare the output
$site = get_site();
$PAGE->navbar->add($this->str['administration'], null, null. navigation_node::TYPE_CUSTOM, '../index.php');
$PAGE->navbar->add('XMLDB', null, null. navigation_node::TYPE_CUSTOM, 'index.php');
$PAGE->navbar->add($this->str['administration'], '../index.php');
$PAGE->navbar->add('XMLDB', 'index.php');
$PAGE->set_title("$site->shortname: XMLDB");
$PAGE->set_heading($site->fullname);
echo $OUTPUT->header();
Expand Down
4 changes: 2 additions & 2 deletions admin/xmldb/actions/edit_table_save/edit_table_save.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ function invoke() {
$temptable = new xmldb_table($name);
/// Prepare the output
$site = get_site();
$PAGE->navbar->add($this->str['administration'], null, null. navigation_node::TYPE_CUSTOM, '../index.php');
$PAGE->navbar->add('XMLDB', null, null. navigation_node::TYPE_CUSTOM, 'index.php');
$PAGE->navbar->add($this->str['administration'], '../index.php');
$PAGE->navbar->add('XMLDB', 'index.php');
$PAGE->set_title("$site->shortname: XMLDB");
$PAGE->set_heading($site->fullname);
echo $OUTPUT->header();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ protected function showmyhistory() {
// If we have `more than nothing` in the history display it :D
if ($historycount > 0) {
// Add a branch to hold the users history
$myhistorybranch = $PAGE->navigation->add(get_string('showmyhistorytitle', $this->blockname), null, 'myhistory',navigation_node::TYPE_CATEGORY);
$myhistorybranch = $PAGE->navigation->add(get_string('showmyhistorytitle', $this->blockname), null, null, 'myhistory',navigation_node::TYPE_CATEGORY);
$PAGE->navigation->get($myhistorybranch)->children = array_reverse($history);
}

Expand Down Expand Up @@ -318,7 +318,7 @@ protected function showmycourses() {
}

// Add a branch labelled something like My Courses
$mycoursesbranch = $PAGE->navigation->add(get_string('mycourses'), null, 'mycourses',navigation_node::TYPE_CATEGORY);
$mycoursesbranch = $PAGE->navigation->add(get_string('mycourses'), null, null, 'mycourses',navigation_node::TYPE_CATEGORY);
$PAGE->navigation->add_courses($courses, $mycoursesbranch);

return true;
Expand Down
2 changes: 1 addition & 1 deletion blocks/rss_client/editfeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public static function autodiscover_feed_url($url){

$settingsurl = new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksettingrss_client');
$PAGE->navbar->add(get_string('blocks'));
$PAGE->navbar->add(get_string('feedstitle', 'block_rss_client'), null, null, navbar::TYPE_SETTING, $settingsurl);
$PAGE->navbar->add(get_string('feedstitle', 'block_rss_client'), $settingsurl);
$PAGE->navbar->add(get_string('managefeeds', 'block_rss_client'));
$PAGE->navbar->add($strtitle);

Expand Down
4 changes: 2 additions & 2 deletions blocks/rss_client/managefeeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@
$settingsurl = new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksettingrss_client');
$managefeeds = new moodle_url($CFG->wwwroot . '/blocks/rss_client/managefeeds.php', $urlparams);
$PAGE->navbar->add(get_string('blocks'));
$PAGE->navbar->add(get_string('feedstitle', 'block_rss_client'), null, null, navbar::TYPE_SETTING, $settingsurl);
$PAGE->navbar->add(get_string('managefeeds', 'block_rss_client'), null, null, navbar::TYPE_SETTING, $managefeeds);
$PAGE->navbar->add(get_string('feedstitle', 'block_rss_client'), $settingsurl);
$PAGE->navbar->add(get_string('managefeeds', 'block_rss_client'), $managefeeds);
echo $OUTPUT->header();

$table = new flexible_table('rss-display-feeds');
Expand Down
2 changes: 1 addition & 1 deletion blocks/rss_client/viewfeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
$settingsurl = new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=blocksettingrss_client');
$managefeeds = new moodle_url($CFG->wwwroot . '/blocks/rss_client/managefeeds.php', $urlparams);
$PAGE->navbar->add(get_string('blocks'));
$PAGE->navbar->add(get_string('feedstitle', 'block_rss_client'), null, null, navbar::TYPE_SETTING, $settingsurl);
$PAGE->navbar->add(get_string('feedstitle', 'block_rss_client'), $settingsurl);
$PAGE->navbar->add(get_string('managefeeds', 'block_rss_client'));
$PAGE->navbar->add($strviewfeed);
echo $OUTPUT->header();
Expand Down
9 changes: 3 additions & 6 deletions course/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@

$category = $DB->get_record("course_categories", array("id"=>$course->category));

$PAGE->navbar->add($stradministration, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php/'));
$PAGE->navbar->add($strcategories, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/index.php'));
$PAGE->navbar->add($category->name, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/category.php', array('id'=>$course->category)));
$PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php/'));
$PAGE->navbar->add($strcategories, new moodle_url($CFG->wwwroot.'/course/index.php'));
$PAGE->navbar->add($category->name, new moodle_url($CFG->wwwroot.'/course/category.php', array('id'=>$course->category)));
if (! $delete) {
$strdeletecheck = get_string("deletecheck", "", $course->shortname);
$strdeletecoursecheck = get_string("deletecoursecheck");
Expand Down
6 changes: 2 additions & 4 deletions course/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,8 @@
$title = $streditcoursesettings;
$fullname = $course->fullname;
} else {
$PAGE->navbar->add($stradministration, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php'));
$PAGE->navbar->add($strcategories, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/index.php'));
$PAGE->navbar->add($stradministration, new moodle_url($CFG->wwwroot.'/'.$CFG->admin.'/index.php'));
$PAGE->navbar->add($strcategories, new moodle_url($CFG->wwwroot.'/course/index.php'));
$PAGE->navbar->add($straddnewcourse);
$title = "$site->shortname: $straddnewcourse";
$fullname = $site->fullname;
Expand Down
6 changes: 2 additions & 4 deletions course/import/activities/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@
}
}

$PAGE->navbar->add($course->shortname, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id)));
$PAGE->navbar->add(get_string('import'), null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/import.php', array('id'=>$course->id)));
$PAGE->navbar->add($course->shortname, new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id)));
$PAGE->navbar->add(get_string('import'), new moodle_url($CFG->wwwroot.'/course/import.php', array('id'=>$course->id)));
$PAGE->navbar->add($strimportactivities);

$PAGE->set_title("$course->shortname: $strimportactivities");
Expand Down
6 changes: 2 additions & 4 deletions course/import/groups/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@
}

/// Print the header
$PAGE->navbar->add($course->shortname, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id)));
$PAGE->navbar->add(get_string('import'), null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/import.php', array('id'=>$course->id)));
$PAGE->navbar->add($course->shortname, new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$course->id)));
$PAGE->navbar->add(get_string('import'), new moodle_url($CFG->wwwroot.'/course/import.php', array('id'=>$course->id)));
$PAGE->navbar->add($strimportgroups);

$PAGE->set_title("$course->shortname: $strimportgroups");
Expand Down
3 changes: 1 addition & 2 deletions course/recent.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@
}

$strrecentactivity = get_string('recentactivity');
$PAGE->navbar->add($strrecentactivity, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/recent.php', array('id'=>$course->id)));
$PAGE->navbar->add($strrecentactivity, new moodle_url($CFG->wwwroot.'/course/recent.php', array('id'=>$course->id)));
$PAGE->navbar->add($userinfo);
$PAGE->set_title("$course->shortname: $strrecentactivity");
$PAGE->set_heading($course->fullname);
Expand Down
9 changes: 3 additions & 6 deletions course/report/log/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,8 @@
} else {
$PAGE->set_title($course->shortname .': '. $strlogs);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add($strreports, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
$PAGE->navbar->add($strlogs, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/index.php', array('id'=>$course->id)));
$PAGE->navbar->add($strreports, new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
$PAGE->navbar->add($strlogs, new moodle_url($CFG->wwwroot.'/course/index.php', array('id'=>$course->id)));
$PAGE->navbar->add("$userinfo, $dateinfo");
echo $OUTPUT->header();
}
Expand Down Expand Up @@ -133,8 +131,7 @@
} else {
$PAGE->set_title($course->shortname .': '. $strlogs);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add($strreports, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
$PAGE->navbar->add($strreports, new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
$PAGE->navbar->add($strlogs);
echo $OUTPUT->header();
}
Expand Down
3 changes: 1 addition & 2 deletions course/report/outline/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@

$PAGE->set_title($course->shortname .': '. $stractivityreport);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add($strreports, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
$PAGE->navbar->add($strreports, new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
$PAGE->navbar->add($stractivityreport);
echo $OUTPUT->header();
echo $OUTPUT->heading(format_string($course->fullname));
Expand Down
3 changes: 1 addition & 2 deletions course/report/participation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@

$PAGE->set_title($course->shortname .': '. $strparticipation);
$PAGE->set_heading($course->fullname);
$PAGE->navbar->add($strreports, null, null, navigation_node::TYPE_CUSTOM,
new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
$PAGE->navbar->add($strreports, new moodle_url($CFG->wwwroot.'/course/report.php', array('id'=>$course->id)));
$PAGE->navbar->add($strparticipation);
echo $OUTPUT->header();

Expand Down
Loading

0 comments on commit 91152a3

Please sign in to comment.