Skip to content

Commit

Permalink
tag MDL-19823 Updated print_header_simple and build_navigation to OUT…
Browse files Browse the repository at this point in the history
…PUT and PAGE equivalents
  • Loading branch information
samhemelryk committed Sep 8, 2009
1 parent eb79c92 commit 968583a
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 38 deletions.
8 changes: 4 additions & 4 deletions tag/coursetags_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@
$title = get_string('edittitle', $tagslang);
$coursefullname = format_string($course->fullname);
$courseshortname = format_string($course->shortname);
//$navigation[] = array('name' => $coursefullname, 'link' => $CFG->wwwroot.'/course/view.php?id='.$courseid, 'type' => 'misc');
$navigation[] = array('name' => $title, 'link' => null, 'type' => 'misc');
$nav = build_navigation($navigation);
print_header_simple($title, '', $nav, '', '', false);
$PAGE->navbar->add($title);
$PAGE->set_title($title);
$PAGE->set_cacheable(false);
echo $OUTPUT->header();

// Print personal tags for all courses
$title = get_string('edittitle', $tagslang);
Expand Down
10 changes: 4 additions & 6 deletions tag/coursetags_more.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,11 @@

// The title and breadcrumb
if ($courseid) {
$navigation[] = array('name' => format_string($course->shortname), 'link' => $CFG->wwwroot.'/course/view.php?id='.$courseid, 'type' => 'misc');
$navigation[] = array('name' => $title, 'link' => null, 'type' => 'misc');
} else {
$navigation[] = array('name' => $title, 'link' => null, 'type' => 'misc');
$PAGE->navbar->add(format_string($course->shortname), new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$courseid)));
}
$nav = build_navigation($navigation);
print_header_simple($title, '', $nav, '', '', false);
$PAGE->navbar->add($title);
$PAGE->set_title($title);
echo $OUTPUT->header();
echo $OUTPUT->heading($title, 'centre');

// Prepare data for tags
Expand Down
12 changes: 4 additions & 8 deletions tag/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,10 @@
}
}


$navlinks = array();
$navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => '');
$navlinks[] = array('name' => $tagname, 'link' => '', 'type' => '');

$navigation = build_navigation($navlinks);
print_header_simple(get_string('tag', 'tag') . ' - '. $tagname, '', $navigation);

$PAGE->navbar->add(get_string('tags', 'tag'), new moodle_url($CFG->wwwroot.'/tag/search.php'));
$PAGE->navbar->add($tagname);
$PAGE->set_title(get_string('tag', 'tag') . ' - '. $tagname);
echo $OUTPUT->header();
echo $OUTPUT->heading($tagname, 2);

if (!empty($errorstring)) {
Expand Down
15 changes: 7 additions & 8 deletions tag/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,18 @@
}

$tagname = tag_display_name($tag);

$navlinks = array();
$navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => '');
$navlinks[] = array('name' => $tagname, 'link' => '', 'type' => '');

$navigation = build_navigation($navlinks);
$title = get_string('tag', 'tag') .' - '. $tagname;

$button = '';
if ($PAGE->user_allowed_editing() ) {
$button = $OUTPUT->edit_button(new moodle_url("$CFG->wwwroot/tag/index.php", array('id' => $tagid)));
}
print_header_simple($title, '', $navigation, '', '', '', $button);

$PAGE->navbar->add(get_string('tags', 'tag'), new moodle_url($CFG->wwwroot.'/tag/search.php'));
$PAGE->navbar->add($tagname);
$PAGE->set_title($title);
$PAGE->set_button($button);
echo $OUTPUT->header();

// Manage all tags links
if (has_capability('moodle/tag:manage', $systemcontext)) {
Expand Down Expand Up @@ -100,7 +99,7 @@
if (has_capability('moodle/blog:view', $systemcontext)) { // You have to see blogs obviously

$count = 10;
if ($blogs = blog_fetch_entries(array('tag'=>$tag->id)), $count) {
if ($blogs = blog_fetch_entries(array('tag'=>$tag->id), $count)) {

echo $OUTPUT->box_start('generalbox', 'tag-blogs');
$heading = get_string('relatedblogs', 'tag', $tagname). ' ' . get_string('taggedwith', 'tag', $tagname);
Expand Down
11 changes: 4 additions & 7 deletions tag/manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@
$PAGE->set_url('tag/manage.php', $params);
$PAGE->set_context($systemcontext);
$PAGE->set_blocks_editing_capability('moodle/tag:editblocks');

$navlinks = array();
$navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => '');
$navlinks[] = array('name' => get_string('managetags', 'tag'), 'link' => '', 'type' => '');

$navigation = build_navigation($navlinks);
print_header_simple(get_string('managetags', 'tag'), '', $navigation);
$PAGE->navbar->add(get_string('tags', 'tag'), new moodle_url($CFG->wwwroot.'/tag/search.php'));
$PAGE->navbar->add(get_string('managetags', 'tag'));
$PAGE->set_title(get_string('managetags', 'tag'));
echo $OUTPUT->header();

$err_notice = '';
$notice = '';
Expand Down
8 changes: 3 additions & 5 deletions tag/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,12 @@
$PAGE->set_url('tag/search.php', $params);
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));

$navlinks = array();
$navlinks[] = array('name' => get_string('tags', 'tag'), 'link' => "{$CFG->wwwroot}/tag/search.php", 'type' => '');
$navigation = build_navigation($navlinks);

$systemcontext = get_context_instance(CONTEXT_SYSTEM);
$manage_link = ' ';

print_header_simple(get_string('tags', 'tag'), '', $navigation);
$PAGE->navbar->add(get_string('tags', 'tag'), new moodle_url($CFG->wwwroot.'/tag/search.php'));
$PAGE->set_title(get_string('tags', 'tag'));
echo $OUTPUT->header();

if ( has_capability('moodle/tag:manage',$systemcontext) ) {
echo '<div class="managelink"><a href="'. $CFG->wwwroot .'/tag/manage.php">' . get_string('managetags', 'tag') . '</a></div>' ;
Expand Down

0 comments on commit 968583a

Please sign in to comment.