"MDL-14460, fix get_context_instance, merged from MOODLE_19_STABLE"

This commit is contained in:
dongsheng 2008-05-01 06:07:24 +00:00
parent 2cb5f03a66
commit 12d0687748
8 changed files with 23 additions and 23 deletions

View file

@ -2499,7 +2499,7 @@ function print_header ($title='', $heading='', $navigation='', $focus='',
} else {
$menu .= get_string('failedloginattemptsall', '', $count);
}
if (has_capability('moodle/site:viewreports', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (has_capability('moodle/site:viewreports', get_context_instance(CONTEXT_SYSTEM))) {
$menu .= ' (<a href="'.$CFG->wwwroot.'/course/report/log/index.php'.
'?chooselog=1&amp;id=1&amp;modid=site_errors">'.get_string('logs').'</a>)';
}
@ -4802,7 +4802,7 @@ function print_recent_activity_note($time, $user, $text, $link, $return=false, $
$output = '';
if (is_null($viewfullnames)) {
$context = get_context_instance(CONTEXT_SYSTEM, SITEID);
$context = get_context_instance(CONTEXT_SYSTEM);
$viewfullnames = has_capability('moodle/site:viewfullnames', $context);
}
@ -5195,7 +5195,7 @@ function update_category_button($categoryid) {
function update_categories_button() {
global $CFG, $USER;
if (has_capability('moodle/category:update', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (has_capability('moodle/category:update', get_context_instance(CONTEXT_SYSTEM))) {
if (!empty($USER->categoryediting)) {
$string = get_string('turneditingoff');
$categoryedit = 'off';
@ -5221,7 +5221,7 @@ function update_categories_search_button($search,$page,$perpage) {
global $CFG, $USER;
// not sure if this capability is the best here
if (has_capability('moodle/category:update', get_context_instance(CONTEXT_SYSTEM, SITEID))) {
if (has_capability('moodle/category:update', get_context_instance(CONTEXT_SYSTEM))) {
if (!empty($USER->categoryediting)) {
$string = get_string("turneditingoff");
$edit = "off";