Commit bf07b815 authored by Marina Glancy's avatar Marina Glancy
Browse files

MDL-56586 blocks: use template for non-JS add block selector

parent be2247fb
......@@ -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']);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment