MDL-70801 core_my: Add a new courses page

This commit is contained in:
Mathew May 2021-10-21 12:13:36 +08:00
parent c69c33b14d
commit 6ca9c2154a
33 changed files with 417 additions and 51 deletions

View file

@ -249,7 +249,7 @@ class block_base {
$this->arialabel = $bc->arialabel;
}
if ($this->page->user_is_editing()) {
if ($this->page->user_is_editing() && $this->instance_can_be_edited()) {
$bc->controls = $this->page->blocks->edit_controls($this);
} else {
// we must not use is_empty on hidden blocks
@ -692,6 +692,15 @@ class block_base {
return true;
}
/**
* If overridden and set to false by the block it will not be editable.
*
* @return bool
*/
public function instance_can_be_edited() {
return true;
}
/** @callback callback functions for comments api */
public static function comment_template($options) {
$ret = <<<EOD