MDL-49296 Lesson: Add titles to action links

This commit is contained in:
Stephen Bourget 2015-03-16 20:33:22 -04:00
parent beaceef9ee
commit d27e9a2cdb
2 changed files with 22 additions and 8 deletions

View File

@ -125,6 +125,7 @@ $string['defaultessayresponse'] = 'Your essay will be graded by your teacher.';
$string['deleteallattempts'] = 'Delete all lesson attempts';
$string['deletedefaults'] = 'Deleted {$a} x lesson default';
$string['deletedpage'] = 'Deleted page';
$string['deletepagenamed'] = 'Delete page: {$a}';
$string['deleting'] = 'Deleting';
$string['deletingpage'] = 'Deleting page: {$a}';
$string['dependencyon'] = 'Dependent on';
@ -291,6 +292,7 @@ $string['modulenameplural'] = 'Lessons';
$string['move'] = 'Move page';
$string['movedpage'] = 'Moved page';
$string['movepagehere'] = 'Move page to here';
$string['movepagenamed'] = 'Move page: {$a}';
$string['moving'] = 'Moving page: {$a}';
$string['multianswer'] = 'Multiple-answer';
$string['multianswer_help'] = 'Tick the checkbox if more than one response is a correct answer.';
@ -371,6 +373,7 @@ $string['preprocesserror'] = 'Error occurred during pre-processing!';
$string['prerequisitelesson'] = 'Prerequisite lesson';
$string['preview'] = 'Preview';
$string['previewlesson'] = 'Preview {$a}';
$string['previewpagenamed'] = 'Preview page: {$a}';
$string['previouspage'] = 'Previous page';
$string['processerror'] = 'Error occurred during processing!';
$string['progressbar'] = 'Progress bar';
@ -447,6 +450,7 @@ $string['unabledtosavefile'] = 'The file you uploaded could not be saved';
$string['unknownqtypesnotimported'] = '{$a} questions with unsupported question types were not imported';
$string['unseenpageinbranch'] = 'Unseen question within a content page';
$string['unsupportedqtype'] = 'Unsupported question type ({$a})!';
$string['updatepagenamed'] = 'Update page: {$a}';
$string['updatedpage'] = 'Updated page';
$string['updatefailed'] = 'Update failed';
$string['usemaximum'] = 'Use maximum';

View File

@ -396,17 +396,27 @@ class mod_lesson_renderer extends plugin_renderer_base {
$actions = array();
if ($printmove) {
$printmovehtml = new moodle_url('/mod/lesson/lesson.php', array('id'=>$this->page->cm->id, 'action'=>'move', 'pageid'=>$page->id, 'sesskey'=>sesskey()));
$actions[] = html_writer::link($printmovehtml, '<img src="'.$this->output->pix_url('t/move').'" class="iconsmall" alt="'.get_string('move').'" />');
$url = new moodle_url('/mod/lesson/lesson.php',
array('id' => $this->page->cm->id, 'action' => 'move', 'pageid' => $page->id, 'sesskey' => sesskey()));
$label = get_string('movepagenamed', 'lesson', format_string($page->title));
$img = html_writer::img($this->output->pix_url('t/move'), $label, array('class' => 'iconsmall'));
$actions[] = html_writer::link($url, $img, array('title' => $label));
}
$url = new moodle_url('/mod/lesson/editpage.php', array('id'=>$this->page->cm->id, 'pageid'=>$page->id, 'edit'=>1));
$actions[] = html_writer::link($url, '<img src="'.$this->output->pix_url('t/edit').'" class="iconsmall" alt="'.get_string('update').'" />');
$url = new moodle_url('/mod/lesson/editpage.php', array('id' => $this->page->cm->id, 'pageid' => $page->id, 'edit' => 1));
$label = get_string('updatepagenamed', 'lesson', format_string($page->title));
$img = html_writer::img($this->output->pix_url('t/edit'), $label, array('class' => 'iconsmall'));
$actions[] = html_writer::link($url, $img, array('title' => $label));
$url = new moodle_url('/mod/lesson/view.php', array('id'=>$this->page->cm->id, 'pageid'=>$page->id));
$actions[] = html_writer::link($url, '<img src="'.$this->output->pix_url('t/preview').'" class="iconsmall" alt="'.get_string('preview').'" />');
$url = new moodle_url('/mod/lesson/view.php', array('id' => $this->page->cm->id, 'pageid' => $page->id));
$label = get_string('previewpagenamed', 'lesson', format_string($page->title));
$img = html_writer::img($this->output->pix_url('t/preview'), $label, array('class' => 'iconsmall'));
$actions[] = html_writer::link($url, $img, array('title' => $label));
$url = new moodle_url('/mod/lesson/lesson.php', array('id'=>$this->page->cm->id, 'action'=>'confirmdelete', 'pageid'=>$page->id, 'sesskey'=>sesskey()));
$actions[] = html_writer::link($url, '<img src="'.$this->output->pix_url('t/delete').'" class="iconsmall" alt="'.get_string('delete').'" />');
$url = new moodle_url('/mod/lesson/lesson.php',
array('id' => $this->page->cm->id, 'action' => 'confirmdelete', 'pageid' => $page->id, 'sesskey' => sesskey()));
$label = get_string('deletepagenamed', 'lesson', format_string($page->title));
$img = html_writer::img($this->output->pix_url('t/delete'), $label, array('class' => 'iconsmall'));
$actions[] = html_writer::link($url, $img, array('title' => $label));
if ($printaddpage) {
$options = array();