mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-64901 block_myoverview: admin settings to control available layouts
Added an admin setting which allows the administrator to set the available layouts for users and which defaults to all layouts being available, or the card layout only if no layouts are enabled. If only one layout is enabled, the dropdown `nav-display-selector` template will not be displayed as it can no longer be utilised. If the user preference is set to a layout that is no longer available, this is ignored and the first available layout defaulted to.
This commit is contained in:
parent
29c395187f
commit
5f59a4c063
10 changed files with 109 additions and 34 deletions
|
@ -34,4 +34,15 @@ if ($ADMIN->fulltree) {
|
|||
get_string('displaycategories_help', 'block_myoverview'),
|
||||
1));
|
||||
|
||||
$choices = array(BLOCK_MYOVERVIEW_VIEW_CARD => get_string('card', 'block_myoverview'),
|
||||
BLOCK_MYOVERVIEW_VIEW_LIST => get_string('list', 'block_myoverview'),
|
||||
BLOCK_MYOVERVIEW_VIEW_SUMMARY => get_string('summary', 'block_myoverview'));
|
||||
|
||||
$settings->add(new admin_setting_configmulticheckbox(
|
||||
'block_myoverview/layouts',
|
||||
get_string('layouts', 'block_myoverview'),
|
||||
get_string('layouts_help', 'block_myoverview'),
|
||||
$choices,
|
||||
$choices));
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue