Merge branch 'MDL-68041-master-rev2' of https://github.com/nhoobin/moodle

This commit is contained in:
Jun Pataleta 2020-05-11 16:27:48 +08:00
commit c314ec6770
7 changed files with 94 additions and 11 deletions

View file

@ -3462,6 +3462,35 @@ EOD;
);
}
/**
* Secure layout login info.
*
* @return string
*/
public function secure_layout_login_info() {
if (get_config('core', 'logininfoinsecurelayout')) {
return $this->login_info(false);
} else {
return '';
}
}
/**
* Returns the language menu in the secure layout.
*
* No custom menu items are passed though, such that it will render only the language selection.
*
* @return string
*/
public function secure_layout_language_menu() {
if (get_config('core', 'langmenuinsecurelayout')) {
$custommenu = new custom_menu('', current_language());
return $this->render_custom_menu($custommenu);
} else {
return '';
}
}
/**
* This renders the navbar.
* Uses bootstrap compatible html.

View file

@ -18,3 +18,21 @@ Feature: Page displaying with secure layout
When I follow "Fixture link"
Then I should see "Acceptance test site" in the "nav" "css_element"
But "Acceptance test site" "link" should not exist
Scenario: Confirm that the user name is displayed in the navbar without a link
Given I log in as "admin"
And the following config values are set as admin:
| logininfoinsecurelayout | 1 |
And I am on "Course 1" course homepage
When I follow "Fixture link"
Then I should see "You are logged in as Admin User" in the "nav" "css_element"
But "Logout" "link" should not exist
Scenario: Confirm that the custom menu items do not appear when language selection is enabled
Given I log in as "admin"
And the following config values are set as admin:
| langmenuinsecurelayout | 1 |
| custommenuitems | -This is a custom item\|/customurl/ |
And I am on "Course 1" course homepage
When I follow "Fixture link"
Then I should not see "This is a custom item" in the "nav" "css_element"