mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
Merge branch 'MDL-68041-master-rev2' of https://github.com/nhoobin/moodle
This commit is contained in:
commit
c314ec6770
7 changed files with 94 additions and 11 deletions
|
@ -25,6 +25,12 @@ if ($hassiteconfig or has_any_capability($capabilities, $systemcontext)) { // sp
|
||||||
$temp->add(new admin_setting_configcheckbox('allowcohortthemes', new lang_string('allowcohortthemes', 'admin'), new lang_string('configallowcohortthemes', 'admin'), 0));
|
$temp->add(new admin_setting_configcheckbox('allowcohortthemes', new lang_string('allowcohortthemes', 'admin'), new lang_string('configallowcohortthemes', 'admin'), 0));
|
||||||
$temp->add(new admin_setting_configcheckbox('allowthemechangeonurl', new lang_string('allowthemechangeonurl', 'admin'), new lang_string('configallowthemechangeonurl', 'admin'), 0));
|
$temp->add(new admin_setting_configcheckbox('allowthemechangeonurl', new lang_string('allowthemechangeonurl', 'admin'), new lang_string('configallowthemechangeonurl', 'admin'), 0));
|
||||||
$temp->add(new admin_setting_configcheckbox('allowuserblockhiding', new lang_string('allowuserblockhiding', 'admin'), new lang_string('configallowuserblockhiding', 'admin'), 1));
|
$temp->add(new admin_setting_configcheckbox('allowuserblockhiding', new lang_string('allowuserblockhiding', 'admin'), new lang_string('configallowuserblockhiding', 'admin'), 1));
|
||||||
|
$temp->add(new admin_setting_configcheckbox('langmenuinsecurelayout',
|
||||||
|
new lang_string('langmenuinsecurelayout', 'admin'),
|
||||||
|
new lang_string('langmenuinsecurelayout_desc', 'admin'), 0));
|
||||||
|
$temp->add(new admin_setting_configcheckbox('logininfoinsecurelayout',
|
||||||
|
new lang_string('logininfoinsecurelayout', 'admin'),
|
||||||
|
new lang_string('logininfoinsecurelayout_desc', 'admin'), 0));
|
||||||
$temp->add(new admin_setting_configtextarea('custommenuitems', new lang_string('custommenuitems', 'admin'),
|
$temp->add(new admin_setting_configtextarea('custommenuitems', new lang_string('custommenuitems', 'admin'),
|
||||||
new lang_string('configcustommenuitems', 'admin'), '', PARAM_RAW, '50', '10'));
|
new lang_string('configcustommenuitems', 'admin'), '', PARAM_RAW, '50', '10'));
|
||||||
$temp->add(new admin_setting_configtextarea(
|
$temp->add(new admin_setting_configtextarea(
|
||||||
|
|
|
@ -688,6 +688,8 @@ $string['langcache'] = 'Cache language menu';
|
||||||
$string['langcache_desc'] = 'Cache the language menu. If enabled, the list of available translations is cached. The cache is automatically refreshed when you install or delete a language pack via the in-built language packs management tool. If you install a new language pack manually, you have to use Purge all caches feature to refresh the cached list.';
|
$string['langcache_desc'] = 'Cache the language menu. If enabled, the list of available translations is cached. The cache is automatically refreshed when you install or delete a language pack via the in-built language packs management tool. If you install a new language pack manually, you have to use Purge all caches feature to refresh the cached list.';
|
||||||
$string['langlist'] = 'Languages on language menu';
|
$string['langlist'] = 'Languages on language menu';
|
||||||
$string['langmenu'] = 'Display language menu';
|
$string['langmenu'] = 'Display language menu';
|
||||||
|
$string['langmenuinsecurelayout'] = 'Display language menu in secure layout';
|
||||||
|
$string['langmenuinsecurelayout_desc'] = 'If enabled, a user will be able to change their language when attempting a quiz or other activity using secure layout.';
|
||||||
$string['langpackwillbeupdated'] = 'NOTE: Moodle will try to download updates for your language packs during the upgrade.';
|
$string['langpackwillbeupdated'] = 'NOTE: Moodle will try to download updates for your language packs during the upgrade.';
|
||||||
$string['langstringcache'] = 'Cache all language strings';
|
$string['langstringcache'] = 'Cache all language strings';
|
||||||
$string['languagesettings'] = 'Language settings';
|
$string['languagesettings'] = 'Language settings';
|
||||||
|
@ -734,6 +736,8 @@ $string['lockrequestcategory'] = 'Prevent category selection';
|
||||||
$string['log'] = 'Logs';
|
$string['log'] = 'Logs';
|
||||||
$string['logguests'] = 'Log guest access';
|
$string['logguests'] = 'Log guest access';
|
||||||
$string['logguests_help'] = 'This setting enables logging of actions by guest account and not logged in users. High profile sites may want to disable this logging for performance reasons. It is recommended to keep this setting enabled on production sites.';
|
$string['logguests_help'] = 'This setting enables logging of actions by guest account and not logged in users. High profile sites may want to disable this logging for performance reasons. It is recommended to keep this setting enabled on production sites.';
|
||||||
|
$string['logininfoinsecurelayout'] = 'Display logged-in user in secure layout';
|
||||||
|
$string['logininfoinsecurelayout_desc'] = 'If enabled, the logged-in user\'s full name will be displayed in the navigation bar when attempting a quiz or other activity using secure layout.';
|
||||||
$string['loginpageautofocus'] = 'Autofocus login page form';
|
$string['loginpageautofocus'] = 'Autofocus login page form';
|
||||||
$string['loginpageautofocus_help'] = 'Enabling this option improves usability of the login page, but automatically focusing fields may be considered an accessibility issue.';
|
$string['loginpageautofocus_help'] = 'Enabling this option improves usability of the login page, but automatically focusing fields may be considered an accessibility issue.';
|
||||||
$string['loglifetime'] = 'Keep logs for';
|
$string['loglifetime'] = 'Keep logs for';
|
||||||
|
|
|
@ -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.
|
* This renders the navbar.
|
||||||
* Uses bootstrap compatible html.
|
* Uses bootstrap compatible html.
|
||||||
|
|
|
@ -18,3 +18,21 @@ Feature: Page displaying with secure layout
|
||||||
When I follow "Fixture link"
|
When I follow "Fixture link"
|
||||||
Then I should see "Acceptance test site" in the "nav" "css_element"
|
Then I should see "Acceptance test site" in the "nav" "css_element"
|
||||||
But "Acceptance test site" "link" should not exist
|
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"
|
||||||
|
|
|
@ -15,7 +15,18 @@
|
||||||
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||||
}}
|
}}
|
||||||
{{!
|
{{!
|
||||||
secure navbar.
|
@template theme_boost/navbar-secure
|
||||||
|
|
||||||
|
This template renders the top navbar.
|
||||||
|
|
||||||
|
Example context (json):
|
||||||
|
{
|
||||||
|
"output": {
|
||||||
|
"should_display_navbar_logo": "true",
|
||||||
|
"get_compact_logo_url": "http://example.com/image.png"
|
||||||
|
},
|
||||||
|
"sitename": "Moodle Site"
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
<nav class="fixed-top navbar navbar-light bg-white navbar-expand moodle-has-zindex" aria-label="{{#str}}navigation{{/str}}">
|
<nav class="fixed-top navbar navbar-light bg-white navbar-expand moodle-has-zindex" aria-label="{{#str}}navigation{{/str}}">
|
||||||
|
|
||||||
|
@ -26,9 +37,15 @@
|
||||||
{{/ output.should_display_navbar_logo }}
|
{{/ output.should_display_navbar_logo }}
|
||||||
<span class="site-name d-none d-md-inline">{{{ sitename }}}</span>
|
<span class="site-name d-none d-md-inline">{{{ sitename }}}</span>
|
||||||
|
|
||||||
<ul class="nav navbar-nav ml-auto">
|
{{# output.secure_layout_language_menu }}
|
||||||
<li class="nav-item">
|
<ul class="navbar-nav d-none d-md-flex">
|
||||||
{{{ output.secure_login_info }}}
|
<!-- language_menu -->
|
||||||
</li>
|
{{{ . }}}
|
||||||
</ul>
|
</ul>
|
||||||
|
{{/ output.secure_layout_language_menu }}
|
||||||
|
{{# output.secure_layout_login_info }}
|
||||||
|
<div class="ml-auto">
|
||||||
|
{{{ . }}}
|
||||||
|
</div>
|
||||||
|
{{/ output.secure_layout_login_info }}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -25,8 +25,7 @@
|
||||||
"should_display_navbar_logo": "true",
|
"should_display_navbar_logo": "true",
|
||||||
"get_compact_logo_url": "http://example.com/image.png"
|
"get_compact_logo_url": "http://example.com/image.png"
|
||||||
},
|
},
|
||||||
"sitename": "Moodle Site",
|
"sitename": "Moodle Site"
|
||||||
"secure_login_info": "Logged in as test user"
|
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
<nav class="fixed-top navbar navbar-bootswatch navbar-expand moodle-has-zindex">
|
<nav class="fixed-top navbar navbar-bootswatch navbar-expand moodle-has-zindex">
|
||||||
|
@ -37,9 +36,15 @@
|
||||||
{{/ output.should_display_navbar_logo }}
|
{{/ output.should_display_navbar_logo }}
|
||||||
<span class="site-name d-none d-md-inline">{{{ sitename }}}</span>
|
<span class="site-name d-none d-md-inline">{{{ sitename }}}</span>
|
||||||
|
|
||||||
<ul class="nav navbar-nav ml-auto">
|
{{# output.secure_layout_language_menu }}
|
||||||
<li class="nav-item">
|
<ul class="navbar-nav d-none d-md-flex">
|
||||||
{{{ output.secure_login_info }}}
|
<!-- language_menu -->
|
||||||
</li>
|
{{{ . }}}
|
||||||
</ul>
|
</ul>
|
||||||
|
{{/ output.secure_layout_language_menu }}
|
||||||
|
{{# output.secure_layout_login_info }}
|
||||||
|
<div class="ml-auto">
|
||||||
|
{{{ . }}}
|
||||||
|
</div>
|
||||||
|
{{/ output.secure_layout_login_info }}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
|
@ -4,6 +4,10 @@ information provided here is intended especially for theme designer.
|
||||||
=== 3.9 ===
|
=== 3.9 ===
|
||||||
|
|
||||||
* Add class .d-print-block to #page, #page-wrapper and #page content to fix Firefox printing problems
|
* Add class .d-print-block to #page, #page-wrapper and #page content to fix Firefox printing problems
|
||||||
|
* A function to core_renderer has been added, secure_layout_login_info. This allows the boost and classic templates to
|
||||||
|
display the users full name in a secure layout.
|
||||||
|
* Secure layout in themes boost and classic have been modified to allow language selection as they now call the
|
||||||
|
output.secure_layout_language_menu function.
|
||||||
|
|
||||||
=== 3.8 ===
|
=== 3.8 ===
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue