Added drag & drop feature to rearrange elements

This commit is contained in:
Shamim Rezaie 2015-08-05 15:38:35 +10:00 committed by Mark Nelson
parent 58d7312d9e
commit 9998fa2b4a
22 changed files with 854 additions and 6 deletions

View file

@ -238,8 +238,12 @@ class mod_customcert_edit_form extends moodleform {
$row->cells[] = $icons;
$table->data[] = $row;
}
// Create link to order the elements.
$link = html_writer::link(new moodle_url('/mod/customcert/rearrange.php', array('id' => $page->id)),
get_string('rearrangeelements', 'customcert'));
// Add the table to the form.
$mform->addElement('static', 'elements_' . $page->id, get_string('elements', 'customcert'), html_writer::table($table));
$mform->addElement('static', 'elements_' . $page->id, get_string('elements', 'customcert'), html_writer::table($table)
. html_writer::tag( 'div', $link, array('style' => 'text-align:right')));
$mform->addHelpButton('elements_' . $page->id, 'elements', 'customcert');
}