示例#1
0
 function print_header()
 {
     global $USER, $CFG;
     $tagname = tag_display_name($this->tag_object);
     $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 ($this->user_allowed_editing()) {
         $button = update_tag_button($this->id);
     }
     print_header_simple($title, '', $navigation, '', '', '', $button);
 }
示例#2
0
$PAGE->set_url('tag/index.php', array('id' => $tag->id));
$PAGE->set_subpage($tag->id);
$PAGE->set_blocks_editing_capability('moodle/tag:editblocks');
$pageblocks = blocks_setup($PAGE, BLOCKS_PINNED_BOTH);
if ($edit != -1 and $PAGE->user_allowed_editing()) {
    $USER->editing = $edit;
}
$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 = update_tag_button($tag->id);
}
print_header_simple($title, '', $navigation, '', '', '', $button);
// Manage all tags links
$systemcontext = get_context_instance(CONTEXT_SYSTEM);
if (has_capability('moodle/tag:manage', $systemcontext)) {
    echo '<div class="managelink"><a href="' . $CFG->wwwroot . '/tag/manage.php">' . get_string('managetags', 'tag') . '</a></div>';
}
echo '<table border="0" cellpadding="3" cellspacing="0" width="100%" id="layout-table">';
echo '<tr valign="top">';
//----------------- left column -----------------
$blocks_preferred_width = bounded_number(180, blocks_preferred_width($pageblocks[BLOCK_POS_LEFT]), 210);
if (blocks_have_content($pageblocks, BLOCK_POS_LEFT) || $PAGE->user_is_editing()) {
    echo '<td style="vertical-align: top; width: ' . $blocks_preferred_width . 'px;" id="left-column">';
    blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
    echo '</td>';