From db22e31b1e71368bdbc228ddfe234d704646b20d Mon Sep 17 00:00:00 2001 From: Adrian Greeve Date: Fri, 16 Aug 2013 14:50:12 +0800 Subject: [PATCH] MDL-41231 - mod_data: Export to portfolio and delete selected now work together. --- mod/data/view.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/mod/data/view.php b/mod/data/view.php index 7812c267e595b..742b679ab79f9 100644 --- a/mod/data/view.php +++ b/mod/data/view.php @@ -792,6 +792,16 @@ $records = array(); } + if ($mode != 'single' && $canmanageentries) { + echo html_writer::empty_tag('input', array('type' => 'button', 'id' => 'checkall', 'value' => get_string('selectall'))); + echo html_writer::empty_tag('input', array('type' => 'button', 'id' => 'checknone', 'value' => get_string('deselectall'))); + echo html_writer::empty_tag('input', array('class' => 'form-submit', 'type' => 'submit', 'value' => get_string('deleteselected'))); + + $module = array('name'=>'mod_data', 'fullpath'=>'/mod/data/module.js'); + $PAGE->requires->js_init_call('M.mod_data.init_view', null, false, $module); + } + echo html_writer::end_tag('form'); + if ($mode == '' && !empty($CFG->enableportfolios) && !empty($records)) { require_once($CFG->libdir . '/portfoliolib.php'); $button = new portfolio_add_button(); @@ -802,20 +812,8 @@ echo $button->to_html(PORTFOLIO_ADD_FULL_FORM); } - //Advanced search form doesn't make sense for single (redirects list view) if (($maxcount || $mode == 'asearch') && $mode != 'single') { - if ($canmanageentries) { - echo html_writer::start_tag('div', array('class' => 'form-buttons')); - echo html_writer::empty_tag('input', array('type' => 'button', 'id' => 'checkall', 'value' => get_string('selectall'))); - echo html_writer::empty_tag('input', array('type' => 'button', 'id' => 'checknone', 'value' => get_string('deselectall'))); - echo html_writer::empty_tag('input', array('class' => 'form-submit', 'type' => 'submit', 'value' => get_string('deleteselected'))); - echo html_writer::end_tag('div'); - - $module = array('name'=>'mod_data', 'fullpath'=>'/mod/data/module.js'); - $PAGE->requires->js_init_call('M.mod_data.init_view', null, false, $module); - } - echo html_writer::end_tag('form'); data_print_preference_form($data, $perpage, $search, $sort, $order, $search_array, $advanced, $mode); } }