From b626e4fd4362e9285384ba50d17780bcf9783692 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Mon, 7 Aug 2017 16:08:29 +0800 Subject: [PATCH] #35 Reworded 'deletecertpage' string and added icon --- classes/edit_form.php | 8 ++++---- lang/en/customcert.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/edit_form.php b/classes/edit_form.php index 1ba2f25..9c1d034 100644 --- a/classes/edit_form.php +++ b/classes/edit_form.php @@ -291,11 +291,11 @@ class edit_form extends \moodleform { // Add option to delete this page if there is more than one page. if ($this->numpages > 1) { - // Link to delete the element. + // Link to delete the page. $deletelink = new \moodle_url($editlink, $editlinkparams + array('action' => 'deletepage', 'aid' => $page->id)); - $deletelink = \html_writer::tag('a', get_string('deletecertpage', 'customcert'), - array('href' => $deletelink->out(false), 'class' => 'deletebutton')); - $mform->addElement('html', \html_writer::tag('div', $deletelink, array('class' => 'deletebutton'))); + $icon = $OUTPUT->pix_icon('t/delete', get_string('deletecertpage', 'customcert')); + $deletepagehtml = \html_writer::link($deletelink, $icon . get_string('deletecertpage', 'customcert')); + $mform->addElement('html', \html_writer::tag('div', $deletepagehtml, array('class' => 'deletebutton'))); } } } diff --git a/lang/en/customcert.php b/lang/en/customcert.php index ec8bd43..b4f084e 100644 --- a/lang/en/customcert.php +++ b/lang/en/customcert.php @@ -39,7 +39,7 @@ $string['customcert:view'] = 'View a custom certificate'; $string['customcert:viewreport'] = 'View course report'; $string['customcert:viewallcertificates'] = 'View all certificates'; $string['customcert:verifycertificate'] = 'Verify a certificate'; -$string['deletecertpage'] = 'Delete certificate page'; +$string['deletecertpage'] = 'Delete page'; $string['deleteconfirm'] = 'Delete confirmation'; $string['deleteelement'] = 'Delete element'; $string['deleteelementconfirm'] = 'Are you sure you want to delete this element?';