From: tjhunt Date: Wed, 6 May 2009 09:28:26 +0000 (+0000) Subject: blocklib: MDL-19010 remove no-longer-necessary global variable use from blocks X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=cb6402296cf6f89c21c7b2970966e2faf5c01126;p=moodle.git blocklib: MDL-19010 remove no-longer-necessary global variable use from blocks --- diff --git a/blocks/activity_modules/block_activity_modules.php b/blocks/activity_modules/block_activity_modules.php index bf9c770e82..0efc4a27f6 100644 --- a/blocks/activity_modules/block_activity_modules.php +++ b/blocks/activity_modules/block_activity_modules.php @@ -7,7 +7,7 @@ class block_activity_modules extends block_list { } function get_content() { - global $CFG, $COURSE, $DB; + global $CFG, $DB; if($this->content !== NULL) { return $this->content; diff --git a/blocks/admin_bookmarks/block_admin_bookmarks.php b/blocks/admin_bookmarks/block_admin_bookmarks.php index 0cd292ea46..79029809cb 100644 --- a/blocks/admin_bookmarks/block_admin_bookmarks.php +++ b/blocks/admin_bookmarks/block_admin_bookmarks.php @@ -29,7 +29,7 @@ class block_admin_bookmarks extends block_base { function get_content() { - global $CFG, $USER, $PAGE; + global $CFG, $USER; if ($this->content !== NULL) { return $this->content; @@ -62,12 +62,13 @@ class block_admin_bookmarks extends block_base { $bookmarks = array(); } - if (isset($PAGE->section) and $PAGE->section == 'search'){ + // TODO + if (isset($this->page->section) and $this->page->section == 'search'){ // the search page can't be properly bookmarked at present $this->content->footer = ''; - } else if (($section = (isset($PAGE->section) ? $PAGE->section : '')) && (in_array($section, $bookmarks))) { + } else if (($section = (isset($this->page->section) ? $this->page->section : '')) && (in_array($section, $bookmarks))) { $this->content->footer = '' . get_string('unbookmarkthispage','admin') . ''; - } else if ($section = (isset($PAGE->section) ? $PAGE->section : '')) { + } else if ($section = (isset($this->page->section) ? $this->page->section : '')) { $this->content->footer = '' . get_string('bookmarkthispage','admin') . ''; } else { $this->content->footer = ''; diff --git a/blocks/admin_tree/block_admin_tree.php b/blocks/admin_tree/block_admin_tree.php index ef6a3a6a35..5ac22c0b93 100644 --- a/blocks/admin_tree/block_admin_tree.php +++ b/blocks/admin_tree/block_admin_tree.php @@ -10,13 +10,13 @@ class block_admin_tree extends block_base { var $destination; function init() { - global $PAGE; $this->title = get_string('administrationsite'); $this->version = 2007101509; $this->currentdepth = 0; $this->divcounter = 1; $this->tempcontent = ''; - $this->section = (isset($PAGE->section) ? $PAGE->section : ''); + // TODO + $this->section = (isset($this->page->section) ? $this->page->section : ''); $this->pathtosection = array(); $this->expandnodes = array(); } diff --git a/blocks/blog_menu/block_blog_menu.php b/blocks/blog_menu/block_blog_menu.php index 4bbd378dd8..2967304084 100755 --- a/blocks/blog_menu/block_blog_menu.php +++ b/blocks/blog_menu/block_blog_menu.php @@ -11,7 +11,7 @@ class block_blog_menu extends block_base { } function get_content() { - global $CFG, $USER, $COURSE; + global $CFG, $USER; if (empty($CFG->bloglevel)) { $this->content->text = ''; @@ -47,10 +47,10 @@ class block_blog_menu extends block_base { $sitecontext = get_context_instance(CONTEXT_SYSTEM); - if ($COURSE->id != SITEID) { + if ($this->page->course->id != SITEID) { $incoursecontext = true; - $curcontext = get_context_instance(CONTEXT_COURSE, $COURSE->id); + $curcontext = get_context_instance(CONTEXT_COURSE, $this->page->course->id); } else { $incoursecontext = false; $curcontext = $sitecontext; @@ -63,10 +63,10 @@ class block_blog_menu extends block_base { if ( (isloggedin() && !isguest()) && $incoursecontext && $CFG->bloglevel >= BLOG_COURSE_LEVEL && $canviewblogs) { - $coursearg = '&courseid='.$COURSE->id; + $coursearg = '&courseid='.$this->page->course->id; // a course is specified - $courseviewlink = '
  • '; + $courseviewlink = '
  • '; $courseviewlink .= get_string('viewcourseentries', 'blog') ."
  • \n"; } diff --git a/blocks/blog_tags/block_blog_tags.php b/blocks/blog_tags/block_blog_tags.php index c230a743eb..77e42b891d 100644 --- a/blocks/blog_tags/block_blog_tags.php +++ b/blocks/blog_tags/block_blog_tags.php @@ -39,7 +39,7 @@ class block_blog_tags extends block_base { } function get_content() { - global $CFG, $SITE, $COURSE, $USER, $DB; + global $CFG, $SITE, $USER, $DB; if (empty($CFG->usetags) || empty($CFG->bloglevel)) { $this->content->text = ''; @@ -130,18 +130,18 @@ class block_blog_tags extends block_base { case BLOG_GROUP_LEVEL: $filtertype = 'group'; - $filterselect = groups_get_course_group($COURSE); + $filterselect = groups_get_course_group($this->page->course); break; case BLOG_COURSE_LEVEL: $filtertype = 'course'; - $filterselect = $COURSE->id; + $filterselect = $this->page->course->id; break; default: - if (isset($COURSE->id) && $COURSE->id != SITEID) { + if ($this->page->course->id != SITEID) { $filtertype = 'course'; - $filterselect = $COURSE->id; + $filterselect = $this->page->course->id; } else { $filtertype = 'site'; $filterselect = SITEID; diff --git a/blocks/calendar_month/block_calendar_month.php b/blocks/calendar_month/block_calendar_month.php index 626864a03b..a699935f51 100644 --- a/blocks/calendar_month/block_calendar_month.php +++ b/blocks/calendar_month/block_calendar_month.php @@ -11,7 +11,7 @@ class block_calendar_month extends block_base { } function get_content() { - global $USER, $CFG, $SESSION, $COURSE; + global $USER, $CFG, $SESSION; $cal_m = optional_param( 'cal_m', 0, PARAM_INT ); $cal_y = optional_param( 'cal_y', 0, PARAM_INT ); @@ -21,7 +21,7 @@ class block_calendar_month extends block_base { return $this->content; } // Reset the session variables - calendar_session_vars($COURSE); + calendar_session_vars($this->page->course); $this->content = new stdClass; $this->content->text = ''; @@ -30,7 +30,7 @@ class block_calendar_month extends block_base { // [pj] To me it looks like this if would never be needed, but Penny added it // when committing the /my/ stuff. Reminder to discuss and learn what it's about. // It definitely needs SOME comment here! - $courseshown = $COURSE->id; + $courseshown = $this->page->course->id; if ($courseshown == SITEID) { // Being displayed at site level. This will cause the filter to fall back to auto-detecting @@ -42,9 +42,9 @@ class block_calendar_month extends block_base { } else { //MDL-14693: fix calendar on resource page - $courseshown = optional_param( 'id', $COURSE->id, PARAM_INT ); + $courseshown = optional_param( 'id', $this->page->course->id, PARAM_INT ); // Forcibly filter events to include only those from the particular course we are in. - $filtercourse = array($courseshown => $COURSE); + $filtercourse = array($courseshown => $this->page->course); $groupeventsfrom = array($courseshown => 1); } @@ -52,9 +52,9 @@ class block_calendar_month extends block_base { calendar_set_referring_course($courseshown); // MDL-9059, set to show this course when admins go into a course, then unset it. - if ($COURSE->id != SITEID && !isset($SESSION->cal_courses_shown[$COURSE->id]) && has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_SYSTEM))) { + if ($this->page->course->id != SITEID && !isset($SESSION->cal_courses_shown[$this->page->course->id]) && has_capability('moodle/calendar:manageentries', get_context_instance(CONTEXT_SYSTEM))) { $courseset = true; - $SESSION->cal_courses_shown[$COURSE->id] = $COURSE; + $SESSION->cal_courses_shown[$this->page->course->id] = $this->page->course; } // Be VERY careful with the format for default courses arguments! @@ -73,13 +73,13 @@ class block_calendar_month extends block_base { $this->content->text .= calendar_top_controls('course', array('id' => $courseshown, 'm' => $cal_m, 'y' => $cal_y)); $this->content->text .= calendar_get_mini($courses, $group, $user, $cal_m, $cal_y); $this->content->text .= '

    '.get_string('eventskey', 'calendar').'

    '; - $this->content->text .= '
    '.calendar_filter_controls('course', '', $COURSE).'
    '; + $this->content->text .= '
    '.calendar_filter_controls('course', '', $this->page->course).'
    '; } // MDL-9059, unset this so that it doesn't stay in session if (!empty($courseset)) { - unset($SESSION->cal_courses_shown[$COURSE->id]); + unset($SESSION->cal_courses_shown[$this->page->course->id]); } return $this->content; diff --git a/blocks/calendar_upcoming/block_calendar_upcoming.php b/blocks/calendar_upcoming/block_calendar_upcoming.php index f7060527f8..32d748ed71 100644 --- a/blocks/calendar_upcoming/block_calendar_upcoming.php +++ b/blocks/calendar_upcoming/block_calendar_upcoming.php @@ -7,7 +7,7 @@ class block_calendar_upcoming extends block_base { } function get_content() { - global $USER, $CFG, $SESSION, $COURSE; + global $USER, $CFG, $SESSION; $cal_m = optional_param( 'cal_m', 0, PARAM_INT ); $cal_y = optional_param( 'cal_y', 0, PARAM_INT ); @@ -17,7 +17,7 @@ class block_calendar_upcoming extends block_base { return $this->content; } // Reset the session variables - calendar_session_vars($COURSE); + calendar_session_vars($this->page->course); $this->content = new stdClass; $this->content->text = ''; @@ -27,7 +27,7 @@ class block_calendar_upcoming extends block_base { $this->content->footer = ''; } else { - $courseshown = $COURSE->id; + $courseshown = $this->page->course->id; $this->content->footer = '
    '. get_string('gotocalendar', 'calendar').'...'; @@ -47,7 +47,7 @@ class block_calendar_upcoming extends block_base { calendar_set_referring_course(0); } else { // Forcibly filter events to include only those from the particular course we are in. - $filtercourse = array($courseshown => $COURSE); + $filtercourse = array($courseshown => $this->page->course); $groupeventsfrom = array($courseshown => 1); } } diff --git a/blocks/course_summary/block_course_summary.php b/blocks/course_summary/block_course_summary.php index 55cde01dd2..dcbf5d4661 100644 --- a/blocks/course_summary/block_course_summary.php +++ b/blocks/course_summary/block_course_summary.php @@ -7,13 +7,13 @@ class block_course_summary extends block_base { } function specialization() { - if($this->page->pagetype == PAGE_COURSE_VIEW && $PAGE->course->id != SITEID) { + if($this->page->pagetype == PAGE_COURSE_VIEW && $this->page->course->id != SITEID) { $this->title = get_string('coursesummary', 'block_course_summary'); } } function get_content() { - global $CFG, $COURSE, $PAGE; + global $CFG; if($this->content !== NULL) { return $this->content; @@ -26,12 +26,12 @@ class block_course_summary extends block_base { $this->content = new object(); $options = new object(); $options->noclean = true; // Don't clean Javascripts etc - $this->content->text = format_text($COURSE->summary, FORMAT_HTML, $options); - if ($PAGE->user_is_editing()) { - if($COURSE->id == SITEID) { + $this->content->text = format_text($this->page->course->summary, FORMAT_HTML, $options); + if ($this->page->user_is_editing()) { + if($this->page->course->id == SITEID) { $editpage = $CFG->wwwroot.'/'.$CFG->admin.'/settings.php?section=frontpagesettings'; } else { - $editpage = $CFG->wwwroot.'/course/edit.php?id='.$COURSE->id; + $editpage = $CFG->wwwroot.'/course/edit.php?id='.$this->page->course->id; } $this->content->text .= "
    pixpath/t/edit.gif\" alt=\"".get_string('edit')."\" />
    "; } diff --git a/blocks/glossary_random/block_glossary_random.php b/blocks/glossary_random/block_glossary_random.php index 0140db8a84..92c8518235 100644 --- a/blocks/glossary_random/block_glossary_random.php +++ b/blocks/glossary_random/block_glossary_random.php @@ -13,8 +13,8 @@ class block_glossary_random extends block_base { } function specialization() { - global $CFG, $COURSE, $DB; - $this->course = $COURSE; + global $CFG, $DB; + $this->course = $this->page->course; // load userdefined title and make sure it's never empty if (empty($this->config->title)) { @@ -152,7 +152,7 @@ class block_glossary_random extends block_base { } function get_content() { - global $USER, $CFG, $COURSE, $DB; + global $USER, $CFG, $DB; if (empty($this->config->glossary)) { $this->content->text = get_string('notyetconfigured','block_glossary_random'); @@ -162,11 +162,7 @@ class block_glossary_random extends block_base { $glossaryid = $this->config->glossary; - if ($this->course->id == $COURSE->id) { - $course = $COURSE; - } else { - $course = $DB->get_record('course', array('id'=>$this->course->id)); - } + $course = $this->page->course; require_once($CFG->dirroot.'/course/lib.php'); $modinfo = get_fast_modinfo($course); diff --git a/blocks/moodleblock.class.php b/blocks/moodleblock.class.php index 004e9702ff..c987b183c0 100644 --- a/blocks/moodleblock.class.php +++ b/blocks/moodleblock.class.php @@ -406,7 +406,7 @@ class block_base { * @todo complete documenting this function. Define $options. */ function _add_edit_controls($options) { - global $CFG, $USER, $PAGE; + global $CFG, $USER; // TODO if (empty($this->instance->pinned)) { diff --git a/blocks/news_items/block_news_items.php b/blocks/news_items/block_news_items.php index 7512097771..941d8aaffc 100644 --- a/blocks/news_items/block_news_items.php +++ b/blocks/news_items/block_news_items.php @@ -7,7 +7,7 @@ class block_news_items extends block_base { } function get_content() { - global $CFG, $USER, $COURSE; + global $CFG, $USER; if ($this->content !== NULL) { return $this->content; @@ -22,17 +22,17 @@ class block_news_items extends block_base { } - if ($COURSE->newsitems) { // Create a nice listing of recent postings + if ($this->page->course->newsitems) { // Create a nice listing of recent postings require_once($CFG->dirroot.'/mod/forum/lib.php'); // We'll need this $text = ''; - if (!$forum = forum_get_course_forum($COURSE->id, 'news')) { + if (!$forum = forum_get_course_forum($this->page->course->id, 'news')) { return ''; } - $modinfo = get_fast_modinfo($COURSE); + $modinfo = get_fast_modinfo($this->page->course); if (empty($modinfo->instances['forum'][$forum->id])) { return ''; } @@ -58,7 +58,7 @@ class block_news_items extends block_base { /// Get all the recent discussions we're allowed to see if (! $discussions = forum_get_discussions($cm, 'p.modified DESC', false, - $currentgroup, $COURSE->newsitems) ) { + $currentgroup, $this->page->course->newsitems) ) { $text .= '('.get_string('nonews', 'forum').')'; $this->content->text = $text; return $this->content; @@ -107,7 +107,7 @@ class block_news_items extends block_base { } else { $userid = $USER->id; } - $this->content->footer .= '
    '.rss_get_link($COURSE->id, $userid, 'forum', $forum->id, $tooltiptext); + $this->content->footer .= '
    '.rss_get_link($this->page->course->id, $userid, 'forum', $forum->id, $tooltiptext); } } diff --git a/blocks/online_users/block_online_users.php b/blocks/online_users/block_online_users.php index 17112c414e..4f16bfe775 100644 --- a/blocks/online_users/block_online_users.php +++ b/blocks/online_users/block_online_users.php @@ -14,7 +14,7 @@ class block_online_users extends block_base { function has_config() {return true;} function get_content() { - global $USER, $CFG, $COURSE, $DB; + global $USER, $CFG, $DB; if ($this->content !== NULL) { return $this->content; @@ -35,7 +35,7 @@ class block_online_users extends block_base { $timefrom = 100 * floor((time()-$timetoshowusers) / 100); // Round to nearest 100 seconds for better query cache // Get context so we can check capabilities. - $context = get_context_instance(CONTEXT_COURSE, $COURSE->id); + $context = $this->page->context; // TODO if (empty($this->instance->pinned)) { @@ -45,12 +45,12 @@ class block_online_users extends block_base { } //Calculate if we are in separate groups - $isseparategroups = ($COURSE->groupmode == SEPARATEGROUPS - && $COURSE->groupmodeforce + $isseparategroups = ($this->page->course->groupmode == SEPARATEGROUPS + && $this->page->course->groupmodeforce && !has_capability('moodle/site:accessallgroups', $context)); //Get the user current group - $currentgroup = $isseparategroups ? groups_get_course_group($COURSE) : NULL; + $currentgroup = $isseparategroups ? groups_get_course_group($this->page->course) : NULL; $groupmembers = ""; $groupselect = ""; @@ -65,7 +65,7 @@ class block_online_users extends block_base { $params['currentgroup'] = $currentgroup; } - if ($COURSE->id == SITEID) { // Site-level + if ($this->page->course->id == SITEID) { // Site-level $sql = "SELECT u.id, u.username, u.firstname, u.lastname, u.picture, MAX(u.lastaccess) AS lastaccess FROM {user} u $groupmembers WHERE u.lastaccess > $timefrom @@ -103,7 +103,7 @@ class block_online_users extends block_base { $groupselect $rawhere GROUP BY u.id"; - $params['courseid'] = $COURSE->id; + $params['courseid'] = $this->page->course->id; } //Calculate minutes @@ -151,12 +151,12 @@ class block_online_users extends block_base { $this->content->text .= '
  • '; $timeago = format_time(time() - $user->lastaccess); //bruno to calculate correctly on frontpage if ($user->username == 'guest') { - $this->content->text .= '
    '.print_user_picture($user->id, $COURSE->id, $user->picture, 16, true, false, '', false); + $this->content->text .= '
    '.print_user_picture($user->id, $this->page->course->id, $user->picture, 16, true, false, '', false); $this->content->text .= get_string('guestuser').'
    '; } else { - $this->content->text .= '
    '; - $this->content->text .= print_user_picture($user->id, $COURSE->id, $user->picture, 16, true, false, '', false); + $this->content->text .= ''; } if ($canshowicon and ($USER->id != $user->id) and $user->username != 'guest') { // Only when logged in and messaging active etc diff --git a/blocks/participants/block_participants.php b/blocks/participants/block_participants.php index eb99df9159..c7653937ba 100644 --- a/blocks/participants/block_participants.php +++ b/blocks/participants/block_participants.php @@ -8,7 +8,7 @@ class block_participants extends block_list { function get_content() { - global $CFG, $COURSE; + global $CFG; if (empty($this->instance)) { $this->content = ''; @@ -23,7 +23,7 @@ class block_participants extends block_list { /// MDL-13252 Always get the course context or else the context may be incorrect in the user/index.php $currentcontext = $this->page->context; - if ($COURSE->id == SITEID) { + if ($this->page->course->id == SITEID) { if (!has_capability('moodle/site:viewparticipants', get_context_instance(CONTEXT_SYSTEM))) { $this->content = ''; return $this->content; diff --git a/blocks/recent_activity/block_recent_activity.php b/blocks/recent_activity/block_recent_activity.php index 4e326ff3e5..37284e9516 100644 --- a/blocks/recent_activity/block_recent_activity.php +++ b/blocks/recent_activity/block_recent_activity.php @@ -7,8 +7,6 @@ class block_recent_activity extends block_base { } function get_content() { - global $COURSE; - if ($this->content !== NULL) { return $this->content; } @@ -24,7 +22,7 @@ class block_recent_activity extends block_base { // Slightly hacky way to do it but... ob_start(); - print_recent_activity($COURSE); + print_recent_activity($this->page->course); $this->content->text = ob_get_contents(); ob_end_clean(); diff --git a/blocks/rss_client/block_rss_client.php b/blocks/rss_client/block_rss_client.php index a3dfaec1b5..b264ea32f5 100644 --- a/blocks/rss_client/block_rss_client.php +++ b/blocks/rss_client/block_rss_client.php @@ -43,10 +43,10 @@ } function get_content() { - global $CFG, $editing, $COURSE, $USER; + global $CFG, $editing, $USER; - if (!empty($COURSE)) { - $this->courseid = $COURSE->id; + if (!empty($this->page->course)) { + $this->courseid = $this->page->course->id; } /// When displaying feeds in block, we double $CFG->block_rss_client_timeout diff --git a/blocks/section_links/block_section_links.php b/blocks/section_links/block_section_links.php index e7c1bdc06d..eadb0fb408 100644 --- a/blocks/section_links/block_section_links.php +++ b/blocks/section_links/block_section_links.php @@ -28,7 +28,7 @@ class block_section_links extends block_base { } function get_content() { - global $CFG, $USER, $COURSE, $DB; + global $CFG, $USER, $DB; $highlight = 0; diff --git a/blocks/site_main_menu/block_site_main_menu.php b/blocks/site_main_menu/block_site_main_menu.php index 8f7cb875fb..3d1cfd3c44 100644 --- a/blocks/site_main_menu/block_site_main_menu.php +++ b/blocks/site_main_menu/block_site_main_menu.php @@ -11,7 +11,7 @@ class block_site_main_menu extends block_list { } function get_content() { - global $USER, $CFG, $COURSE, $DB, $PAGE; + global $USER, $CFG, $DB; if ($this->content !== NULL) { return $this->content; @@ -29,7 +29,7 @@ class block_site_main_menu extends block_list { $course = $this->page->course; require_once($CFG->dirroot.'/course/lib.php'); $context = get_context_instance(CONTEXT_COURSE, $course->id); - $isediting = $PAGE->user_is_editing() && has_capability('moodle/course:manageactivities', $context); + $isediting = $this->page->user_is_editing() && has_capability('moodle/course:manageactivities', $context); $modinfo = get_fast_modinfo($course); /// extra fast view mode diff --git a/blocks/social_activities/block_social_activities.php b/blocks/social_activities/block_social_activities.php index cf2777e69e..5e5bd35ebf 100644 --- a/blocks/social_activities/block_social_activities.php +++ b/blocks/social_activities/block_social_activities.php @@ -11,7 +11,7 @@ class block_social_activities extends block_list { } function get_content() { - global $USER, $CFG, $COURSE, $DB, $PAGE; + global $USER, $CFG, $DB; if ($this->content !== NULL) { return $this->content; @@ -31,7 +31,7 @@ class block_social_activities extends block_list { require_once($CFG->dirroot.'/course/lib.php'); $context = get_context_instance(CONTEXT_COURSE, $course->id); - $isediting = $PAGE->user_is_editing() && has_capability('moodle/course:manageactivities', $context); + $isediting = $this->page->user_is_editing() && has_capability('moodle/course:manageactivities', $context); $modinfo = get_fast_modinfo($course); /// extra fast view mode diff --git a/blocks/tags/block_tags.php b/blocks/tags/block_tags.php index f3865d4bda..7a54fc2b39 100644 --- a/blocks/tags/block_tags.php +++ b/blocks/tags/block_tags.php @@ -38,7 +38,7 @@ class block_tags extends block_base { function get_content() { - global $CFG, $SITE, $COURSE, $USER, $SCRIPT; + global $CFG, $SITE, $USER, $SCRIPT; if (empty($CFG->usetags)) { $this->content->text = ''; @@ -79,10 +79,10 @@ class block_tags extends block_base { $isguest = has_capability('moodle/legacy:guest', $systemcontext, $USER->id, false); $loggedin = isloggedin() && !$isguest; $coursepage = $canedit = false; - $coursepage = (isset($COURSE->id) && $COURSE->id != SITEID); + $coursepage = (isset($this->page->course->id) && $this->page->course->id != SITEID); $mymoodlepage = ($SCRIPT == '/my/index.php') ? true : false; - $sitepage = (isset($COURSE->id) && $COURSE->id == SITEID && !$mymoodlepage); - $coursecontext = get_context_instance(CONTEXT_COURSE, $COURSE->id); + $sitepage = (isset($this->page->course->id) && $this->page->course->id == SITEID && !$mymoodlepage); + $coursecontext = get_context_instance(CONTEXT_COURSE, $this->page->course->id); if ($coursepage) { $canedit = has_capability('moodle/tag:create', $systemcontext); } @@ -111,9 +111,9 @@ class block_tags extends block_base { } } if ($coursepage) { - $coursetags = coursetag_print_cloud(coursetag_get_tags($COURSE->id, 0, '', $numoftags, $sort), true); + $coursetags = coursetag_print_cloud(coursetag_get_tags($this->page->course->id, 0, '', $numoftags, $sort), true); if (!$coursetags) $coursetags = get_string('notagsyet', $tagslang); - $courseflag = '&courseid='.$COURSE->id; + $courseflag = '&courseid='.$this->page->course->id; } if ($mymoodlepage) { $mytags = coursetag_print_cloud(coursetag_get_tags(0, $USER->id, 'default', $numoftags, $sort), true); @@ -236,7 +236,7 @@ class block_tags extends block_base {
    - +
    @@ -266,7 +266,7 @@ EOT; // add the edit link $this->content->footer .= ' '; }