#35 Reworded 'addcertpage' string and changed button to a link
Also added an icon next to the link and moved the location via CSS.
This commit is contained in:
parent
b626e4fd43
commit
971a3fdbfe
4 changed files with 17 additions and 13 deletions
11
edit.php
11
edit.php
|
@ -66,7 +66,6 @@ if ($context->contextlevel == CONTEXT_SYSTEM) {
|
|||
$PAGE->navbar->add(get_string('editcustomcert', 'customcert'));
|
||||
}
|
||||
|
||||
|
||||
// Flag to determine if we are deleting anything.
|
||||
$deleting = false;
|
||||
|
||||
|
@ -84,6 +83,11 @@ if ($tid) {
|
|||
case 'emovedown' :
|
||||
$template->move_item('element', $actionid, 'down');
|
||||
break;
|
||||
case 'addpage' :
|
||||
$template->add_page();
|
||||
$url = new \moodle_url('/mod/customcert/edit.php', array('tid' => $tid));
|
||||
redirect($url);
|
||||
break;
|
||||
case 'deletepage' :
|
||||
if (!empty($confirm)) { // Check they have confirmed the deletion.
|
||||
$template->delete_page($actionid);
|
||||
|
@ -182,11 +186,6 @@ if ($data = $mform->get_data()) {
|
|||
// Save any page data.
|
||||
$template->save_page($data);
|
||||
|
||||
// Check if we are adding a page.
|
||||
if (!empty($data->addcertpage)) {
|
||||
$template->add_page();
|
||||
}
|
||||
|
||||
// Loop through the data.
|
||||
foreach ($data as $key => $value) {
|
||||
// Check if they chose to add an element to a page.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue