Merge branch 'MDL-50446-master' of git://github.com/ryanwyllie/moodle
This commit is contained in:
@@ -73,8 +73,9 @@ class block_site_main_menu extends block_list {
|
||||
$attrs['title'] = $cm->modfullname;
|
||||
$attrs['class'] = $cm->extraclasses . ' activity-action';
|
||||
if ($cm->onclick) {
|
||||
$attrs['id'] = html_writer::random_id('onclick');
|
||||
$OUTPUT->add_action_handler(new component_action('click', $cm->onclick), $attrs['id']);
|
||||
// Get on-click attribute value if specified and decode the onclick - it
|
||||
// has already been encoded for display.
|
||||
$attrs['onclick'] = htmlspecialchars_decode($cm->onclick);
|
||||
}
|
||||
if (!$cm->visible) {
|
||||
$attrs['class'] .= ' dimmed';
|
||||
@@ -161,8 +162,9 @@ class block_site_main_menu extends block_list {
|
||||
$attrs['title'] = $mod->modfullname;
|
||||
$attrs['class'] = $mod->extraclasses . ' activity-action';
|
||||
if ($mod->onclick) {
|
||||
$attrs['id'] = html_writer::random_id('onclick');
|
||||
$OUTPUT->add_action_handler(new component_action('click', $mod->onclick), $attrs['id']);
|
||||
// Get on-click attribute value if specified and decode the onclick - it
|
||||
// has already been encoded for display.
|
||||
$attrs['onclick'] = htmlspecialchars_decode($mod->onclick);
|
||||
}
|
||||
if (!$mod->visible) {
|
||||
$attrs['class'] .= ' dimmed';
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
@block @block_main_menu
|
||||
Feature: Add URL to main menu block
|
||||
In order to add helpful resources for students
|
||||
As a admin
|
||||
I need to add URLs to the main menu block and check it works.
|
||||
|
||||
@javascript
|
||||
Scenario: Add a URL in menu block and ensure it appears
|
||||
Given I log in as "admin"
|
||||
And I am on site homepage
|
||||
And I navigate to "Turn editing on" node in "Front page settings"
|
||||
When I add a "URL" to section "0" and I fill the form with:
|
||||
| Name | google |
|
||||
| Description | gooooooooogle |
|
||||
| External URL | http://www.google.com |
|
||||
| id_display | In pop-up |
|
||||
Then "google" "link" should exist in the "Main menu" "block"
|
||||
And "Add an activity or resource" "link" should exist in the "Main menu" "block"
|
||||
Reference in New Issue
Block a user