mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-11814 use system context for pinned blocks; merged from MOODLE_19_STABLE
This commit is contained in:
parent
baae1acfef
commit
5c10879f55
4 changed files with 41 additions and 10 deletions
|
@ -96,7 +96,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
|
||||
if (empty($this->instance->pinned)) {
|
||||
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
|
||||
} else {
|
||||
$context = get_context_instance(CONTEXT_SYSTEM); // pinned blocks do not have own context
|
||||
}
|
||||
|
||||
if (has_capability('block/rss_client:createsharedfeeds', $context)
|
||||
|| has_capability('block/rss_client:createprivatefeeds', $context)) {
|
||||
|
|
|
@ -93,7 +93,11 @@ print_box_start();
|
|||
print $checkbox . $feedtitle .'<br />'."\n";
|
||||
}
|
||||
} else {
|
||||
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
|
||||
if (empty($this->instance->pinned)) {
|
||||
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
|
||||
} else {
|
||||
$context = get_context_instance(CONTEXT_SYSTEM); // pinned blocks do not have own context
|
||||
}
|
||||
print_string('nofeeds', 'block_rss_client');
|
||||
|
||||
if (has_capability('block/rss_client:createprivatefeeds', $context)
|
||||
|
@ -169,7 +173,11 @@ print_box_start();
|
|||
} else {
|
||||
global $act, $url, $rssid, $preferredtitle, $shared;
|
||||
print '</div></form></div>'; // Closes off page form
|
||||
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
|
||||
if (empty($this->instance->pinned)) {
|
||||
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
|
||||
} else {
|
||||
$context = get_context_instance(CONTEXT_SYSTEM); // pinned blocks do not have own context
|
||||
}
|
||||
|
||||
print_box_start();
|
||||
rss_display_feeds($id, $USER->id, '', $context);
|
||||
|
|
|
@ -6,7 +6,11 @@ global $USER;
|
|||
$tabs = $row = array();
|
||||
|
||||
|
||||
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
|
||||
if (empty($this->instance->pinned)) {
|
||||
$context = get_context_instance(CONTEXT_BLOCK, $this->instance->id);
|
||||
} else {
|
||||
$context = get_context_instance(CONTEXT_SYSTEM); // pinned blocks do not have own context
|
||||
}
|
||||
|
||||
if (has_capability('moodle/site:manageblocks', $context)) {
|
||||
$script = $page->url_get_full(array('instanceid' => $this->instance->id, 'sesskey' => $USER->sesskey, 'blockaction' => 'config', 'currentaction' => 'configblock', 'id' => $id, 'section' => 'rss'));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue