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

This commit is contained in:
Marina Glancy 2016-11-24 14:23:29 +08:00
parent be2247fb24
commit bf07b81543
2 changed files with 6 additions and 6 deletions

View File

@ -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');
}

View File

@ -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']);
}
}