mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 07:25:30 +02:00
MDL-56586 blocks: use template for non-JS add block selector
This commit is contained in:
parent
be2247fb24
commit
bf07b81543
@ -1348,10 +1348,10 @@ class block_manager {
|
||||
echo $OUTPUT->box(get_string('noblockstoaddhere'));
|
||||
echo $OUTPUT->container($OUTPUT->action_link($addpage->url, get_string('back')), 'm-x-3 m-b-1');
|
||||
} else {
|
||||
foreach ($addableblocks as $blockname => $block) {
|
||||
$url = new moodle_url($addpage->url, array('sesskey' => sesskey(), 'bui_addblock' => $blockname));
|
||||
echo $OUTPUT->container($OUTPUT->single_button($url, $block->title), 'm-x-3 m-b-1');
|
||||
}
|
||||
$url = new moodle_url($addpage->url, array('sesskey' => sesskey()));
|
||||
echo $OUTPUT->render_from_template('core/add_block_body',
|
||||
['blocks' => array_values($addableblocks),
|
||||
'url' => '?' . $url->get_query_string(false)]);
|
||||
echo $OUTPUT->container($OUTPUT->action_link($addpage->url, get_string('cancel')), 'm-x-3 m-b-1');
|
||||
}
|
||||
|
||||
|
@ -41,9 +41,9 @@ class behat_theme_boost_behat_blocks extends behat_blocks {
|
||||
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', get_string('addblock'));
|
||||
|
||||
if (!$this->running_javascript()) {
|
||||
$this->execute('behat_forms::press_button', $blockname);
|
||||
$this->execute('behat_general::i_click_on_in_the', [$blockname, 'link', '#region-main', 'css_element']);
|
||||
} else {
|
||||
$this->execute('behat_general::i_click_on_in_the', $blockname, 'link', '.modal-body', 'css_element');
|
||||
$this->execute('behat_general::i_click_on_in_the', [$blockname, 'link', '.modal-body', 'css_element']);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user