mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-56295 mod_book: JS Confirmation of chapter removal
This commit is contained in:
parent
6a69cda97d
commit
6942122290
@ -299,9 +299,20 @@ function book_get_toc($chapters, $chapter, $book, $cm, $edit) {
|
||||
$toc .= html_writer::link(new moodle_url('edit.php', array('cmid' => $cm->id, 'id' => $ch->id)),
|
||||
$OUTPUT->pix_icon('t/edit', get_string('editchapter', 'mod_book', $title)),
|
||||
array('title' => get_string('editchapter', 'mod_book', $titleunescaped)));
|
||||
$toc .= html_writer::link(new moodle_url('delete.php', array('id' => $cm->id, 'chapterid' => $ch->id, 'sesskey' => $USER->sesskey)),
|
||||
$OUTPUT->pix_icon('t/delete', get_string('deletechapter', 'mod_book', $title)),
|
||||
array('title' => get_string('deletechapter', 'mod_book', $titleunescaped)));
|
||||
|
||||
$deleteaction = new confirm_action(get_string('deletechapter', 'mod_book', $titleunescaped));
|
||||
$toc .= $OUTPUT->action_icon(
|
||||
new moodle_url('delete.php', [
|
||||
'id' => $cm->id,
|
||||
'chapterid' => $ch->id,
|
||||
'sesskey' => sesskey(),
|
||||
'confirm' => 1,
|
||||
]),
|
||||
new pix_icon('t/delete', get_string('deletechapter', 'mod_book', $title)),
|
||||
$deleteaction,
|
||||
['title' => get_string('deletechapter', 'mod_book', $titleunescaped)]
|
||||
);
|
||||
|
||||
if ($ch->hidden) {
|
||||
$toc .= html_writer::link(new moodle_url('show.php', array('id' => $cm->id, 'chapterid' => $ch->id, 'sesskey' => $USER->sesskey)),
|
||||
$OUTPUT->pix_icon('t/show', get_string('showchapter', 'mod_book', $title)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user