mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 08:22:07 +02:00
tag MDL-19823 Updated print_header_simple and build_navigation to OUTPUT and PAGE equivalents
This commit is contained in:
parent
eb79c929e1
commit
968583af41
@ -56,10 +56,10 @@ if ($data = data_submitted()) {
|
||||
$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);
|
||||
|
@ -51,13 +51,11 @@ $welcome = get_string('morewelcome', $tagslang);
|
||||
|
||||
// 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
|
||||
|
12
tag/edit.php
12
tag/edit.php
@ -108,14 +108,10 @@ if ($tagnew = $tagform->get_data()) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$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)) {
|
||||
|
@ -41,19 +41,18 @@ if (($edit != -1) and $PAGE->user_allowed_editing()) {
|
||||
}
|
||||
|
||||
$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)) {
|
||||
@ -100,7 +99,7 @@ if ($courses = coursetag_get_tagged_courses($tag->id)) {
|
||||
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);
|
||||
|
@ -29,13 +29,10 @@ if ($perpage != DEFAULT_PAGE_SIZE) {
|
||||
$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 = '';
|
||||
|
@ -27,14 +27,12 @@ if ($perpage) {
|
||||
$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>' ;
|
||||
|
Loading…
x
Reference in New Issue
Block a user