Skip to content

Commit

Permalink
core MDL-19799 Upgraded deprecated calls and minor documentation impr…
Browse files Browse the repository at this point in the history
…ovement
  • Loading branch information
samhemelryk committed Sep 30, 2009
1 parent 521fb44 commit ceebb2e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/deprecatedlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,10 @@ function isteacherinanycourse($userid=0, $includeadmin=true) {
/**
* Determines if the specified user is logged in as guest.
*
* See {@link isguestuser()} as an alternative
*
* @deprecated
* @global object
* @uses CONTEXT_SYSTEM
* @param int $userid The user being tested. You can set this to 0 or leave it blank to test the currently logged in user.
* @return bool
*/
Expand Down
6 changes: 4 additions & 2 deletions lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1467,15 +1467,17 @@ protected function load_course_categories(&$keys) {
protected function load_categories($categoryid=0) {
global $PAGE, $CFG, $DB, $USER;

$systemcontext = get_context_instance(CONTEXT_SYSTEM);

// Cache capability moodle/site:config we use this in the next bit of code
if (!$this->cache->cached('hassiteconfig')) {
$this->cache->hassiteconfig = has_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
$this->cache->hassiteconfig = has_capability('moodle/site:config', $systemcontext);
}

// If the user is logged in (but not as a guest), doesnt have the site config capability,
// and my courses havn't been disabled then we will show the user's courses in the
// global navigation, otherwise we will show up to FRONTPAGECOURSELIMIT available courses
if (isloggedin() && !$this->cache->hassiteconfig && !isguest() && empty($CFG->disablemycourses)) {
if (isloggedin() && !$this->cache->hassiteconfig && !isguestuser() && empty($CFG->disablemycourses)) {
if (!$this->cache->cached('mycourses')) {
$this->cache->mycourses = get_my_courses($USER->id);
}
Expand Down
2 changes: 2 additions & 0 deletions theme/preview.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
$preview = 'standard';
}

$PAGE->set_url(new moodle_url($CFG->wwwroot.'/theme/preview.php', array('preview'=>$preview)));

require_login();

require_capability('moodle/site:config', get_context_instance(CONTEXT_SYSTEM));
Expand Down

0 comments on commit ceebb2e

Please sign in to comment.