forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-73347 blocks: New unaddableblocks theme setting
A new method, get_unaddable_by_theme_block_types(), has been added to block_manager class to let themes define, using the unaddableblocks theme setting, the blocks that won't be displayed in the "Add a block" list. For now, only the boost theme uses it, to disable some of the blocks, like settings, navigation, course_list and section_links (they are still required for classic).
- Loading branch information
Showing
11 changed files
with
151 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@javascript @theme_boost | ||
Feature: Add a block using boost theme | ||
In order to decide the blocks to display in the Add a block list for a theme | ||
As an administrator | ||
I need to define them using the unaddableblocks setting | ||
|
||
Background: | ||
Given the following "courses" exist: | ||
| fullname | shortname | | ||
| Course 1 | C1 | | ||
And I log in as "admin" | ||
|
||
Scenario: Default blocks defined in unaddableblocks settings are not displayed in the Add a block list | ||
Given I am on "Course 1" course homepage with editing mode on | ||
When I click on "Add a block" "link" | ||
Then I should not see "Administration" | ||
And I should not see "Navigation" | ||
And I should not see "Courses" | ||
And I should not see "Section links" | ||
And I should see "Online users" | ||
|
||
Scenario: Admins can change unaddable blocks using the unaddableblocks setting | ||
Given the following config values are set as admin: | ||
| unaddableblocks | settings,private_files | theme_boost| | ||
And I am on "Course 1" course homepage with editing mode on | ||
When I click on "Add a block" "link" | ||
Then I should not see "Administration" | ||
And I should not see "Private files" | ||
And I should see "Navigation" | ||
And I should see "Courses" | ||
And I should see "Section links" | ||
|
||
Scenario: If unaddableblocks settting is empty, no block is excluded from the Add a block list | ||
Given the following config values are set as admin: | ||
| unaddableblocks | | theme_boost| | ||
And I am on "Course 1" course homepage with editing mode on | ||
When I click on "Add a block" "link" | ||
Then I should see "Administration" | ||
And I should see "Navigation" | ||
And I should see "Courses" | ||
And I should see "Section links" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@javascript @theme_classic | ||
Feature: Add a block using classic theme | ||
In order to check the blocks to display in the Add a block list for a them | ||
As an administrator | ||
I need to confirm the unaddableblocks setting is empty for classic. | ||
|
||
Background: | ||
Given the following "courses" exist: | ||
| fullname | shortname | | ||
| Course 1 | C1 | | ||
And I log in as "admin" | ||
|
||
Scenario: All the expected blocks are displayed in the Add a block list for classic | ||
Given I am on "Course 1" course homepage with editing mode on | ||
When I click on "Add a block" "select" | ||
Then I should see "Administration" | ||
And I should see "Navigation" | ||
And I should see "Courses" | ||
And I should see "Section links" | ||
|
||
Scenario: Admins can change unaddable blocks using the unaddableblocks setting for classic | ||
Given the following config values are set as admin: | ||
| unaddableblocks | online_users,private_files,settings | theme_classic| | ||
And I am on "Course 1" course homepage with editing mode on | ||
When I click on "Add a block" "select" | ||
Then I should not see "Online users" | ||
And I should not see "Private files" | ||
# The settings block is defined as required block for classic, so it will be displayed always. | ||
And I should see "Administration" | ||
And I should see "Navigation" | ||
And I should see "Courses" | ||
And I should see "Section links" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters