Merge branch 'MDL-74958-m400' of https://github.com/sammarshallou/moodle into MOODLE_400_STABLE

This commit is contained in:
Jun Pataleta
2022-10-17 21:10:45 +08:00
12 changed files with 57 additions and 10 deletions
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace core_block\local\views;
namespace core_block\navigation\views;
/**
* Class secondary
+6 -2
View File
@@ -1688,8 +1688,12 @@ class block_manager {
* @return \core\navigation\views\secondary
*/
protected function get_secondarynav(block_base $block): \core\navigation\views\secondary {
$class = "core_block\\local\\views\\secondary";
if (class_exists("block_{$block->name()}\\local\\views\\secondary")) {
$class = "core_block\\navigation\\views\\secondary";
if (class_exists("block_{$block->name()}\\navigation\\views\\secondary")) {
$class = "block_{$block->name()}\\navigation\\views\\secondary";
} else if (class_exists("block_{$block->name()}\\local\\views\\secondary")) {
// For backwards compatibility, support the old location for this class (it was in a
// 'local' namespace which shouldn't be used for core APIs).
$class = "block_{$block->name()}\\local\\views\\secondary";
}
$secondarynav = new $class($this->page);
+2
View File
@@ -83,4 +83,6 @@ $renamedclasses = [
'core_question\\form\\tags' => 'qbank_tagquestion\\form\\tags_form',
'context_to_string_translator' => 'core_question\\local\\bank\\context_to_string_translator',
'question_edit_contexts' => 'core_question\\local\\bank\\question_edit_contexts',
// Since Moodle 4.0.5.
'core_block\\local\\views\\secondary' => 'core_block\\navigation\\views\\secondary',
];
+5 -1
View File
@@ -873,7 +873,11 @@ class moodle_page {
if ($this->_secondarynav === null) {
$class = 'core\navigation\views\secondary';
// Try and load a custom class first.
if (class_exists("mod_{$this->activityname}\\local\\views\\secondary")) {
if (class_exists("mod_{$this->activityname}\\navigation\\views\\secondary")) {
$class = "mod_{$this->activityname}\\navigation\\views\\secondary";
} else if (class_exists("mod_{$this->activityname}\\local\\views\\secondary")) {
// For backwards compatibility, support the old location for this class (it was in a
// 'local' namespace which shouldn't be used for core APIs).
$class = "mod_{$this->activityname}\\local\\views\\secondary";
}
+5
View File
@@ -1,6 +1,11 @@
This files describes API changes in core libraries and APIs,
information provided here is intended especially for developers.
=== 4.0.5 ===
* For plugins that override secondary navigation, the namespace for the custom secondary navigation class has
changed. It was (for example) mod_mymodule\local\views\secondary but is now
mod_mymodule\navigation\views\secondary. The old location will continue to work, but will be deprecated in 4.1.
=== 4.0.2 ===
* The core renderer `edit_button` method now accepts an optional `$method` argument (get/post) for the button
* The check for $plugin->incompatible was found to be incorrect. The $plugin->incompatible attribute is meant to define the minimum
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace mod_assign\local\views;
namespace mod_assign\navigation\views;
use core\navigation\views\secondary as core_secondary;
+3 -1
View File
@@ -28,5 +28,7 @@ defined('MOODLE_INTERNAL') || die();
$renamedclasses = [
// Since Moodle 4.0.
'assign_header' => 'mod_assign\output\assign_header',
'assign_submission_status' => 'mod_assign\output\assign_submission_status'
'assign_submission_status' => 'mod_assign\output\assign_submission_status',
// Since Moodle 4.0.5.
'mod_assign\local\views\secondary' => 'mod_assign\navigation\views\secondary',
];
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace mod_feedback\local\views;
namespace mod_feedback\navigation\views;
use core\navigation\views\secondary as core_secondary;
use settings_navigation;
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace mod_glossary\local\views;
namespace mod_glossary\navigation\views;
use core\navigation\views\secondary as core_secondary;
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace mod_label\local\views;
namespace mod_label\navigation\views;
use core\navigation\views\secondary as core_secondary;
use settings_navigation;
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
namespace mod_quiz\local\views;
namespace mod_quiz\navigation\views;
use core\navigation\views\secondary as core_secondary;
+30
View File
@@ -0,0 +1,30 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains mappings for classes that have been renamed.
*
* @package mod_quiz
* @copyright 2022 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$renamedclasses = [
// Since Moodle 4.0.5.
'mod_quiz\local\views\secondary' => 'mod_quiz\navigation\views\secondary',
];