mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 02:16:41 +02:00
Merge branch 'MDL-73646-master-v2' of https://github.com/sharidas/moodle
This commit is contained in:
commit
4e1a6e6830
4 changed files with 40 additions and 4 deletions
|
@ -106,7 +106,7 @@ class primary extends view {
|
|||
} else if (in_array($this->context->contextlevel, [CONTEXT_COURSE, CONTEXT_MODULE])) {
|
||||
$activekey = 'courses';
|
||||
} else if (in_array('siteadminnode', $children) && $node = $this->get_site_admin_node()) {
|
||||
if ($this->context->contextlevel == CONTEXT_COURSECAT || $node->search_for_active_node()) {
|
||||
if ($this->context->contextlevel == CONTEXT_COURSECAT || $node->search_for_active_node(URL_MATCH_EXACT)) {
|
||||
$activekey = 'siteadminnode';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -645,14 +645,15 @@ class navigation_node implements renderable {
|
|||
|
||||
/**
|
||||
* Searches all children for the best matching active node
|
||||
* @param int $strength The url match to be made.
|
||||
* @return navigation_node|false
|
||||
*/
|
||||
public function search_for_active_node() {
|
||||
if ($this->check_if_active(URL_MATCH_BASE)) {
|
||||
public function search_for_active_node($strength = URL_MATCH_BASE) {
|
||||
if ($this->check_if_active($strength)) {
|
||||
return $this;
|
||||
} else {
|
||||
foreach ($this->children as &$child) {
|
||||
$outcome = $child->search_for_active_node();
|
||||
$outcome = $child->search_for_active_node($strength);
|
||||
if ($outcome !== false) {
|
||||
return $outcome;
|
||||
}
|
||||
|
|
|
@ -173,6 +173,8 @@ value to get the list of blocks that won't be displayed for a theme.
|
|||
MESSAGE_DEFAULT_PERMITTED also deprecated.
|
||||
core_message_get_user_notification_preferences and core_message_get_user_message_preferences Webservice are now returning enabled boolean on
|
||||
components > notifications > processors. loggedin and loggedoff are deprecated but present for backward compatibility.
|
||||
* A new parameter $strength of type int is added to method search_for_active_node. This parameter would help us to search for the active nodes based on the
|
||||
$strength passed to it.
|
||||
|
||||
=== 3.11.4 ===
|
||||
* A new option dontforcesvgdownload has been added to the $options parameter of the send_file() function.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue