/** * Return the second row of the controls: colour + tool selectors. * @return string */ protected function output_toolbar() { global $OUTPUT; $tools = ''; // Choose comment colour. $titlestr = get_string('commentcolour', 'assignfeedback_pdf'); $tools .= html_writer::empty_tag('input', array('type' => 'image', 'id' => 'choosecolour', 'style' => 'line-height:normal;', 'name' => 'choosecolour', 'value' => '', 'title' => $titlestr)); $colours = array('red', 'yellow', 'green', 'blue', 'white', 'clear'); $list = ''; foreach ($colours as $colour) { $colourimg = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url($colour, 'assignfeedback_pdf'))); $list .= html_writer::tag('li', $colourimg, array('class' => "choosecolour-{$colour}", 'value' => $colour)); } $list = html_writer::tag('ul', $list, array('id' => 'choosecolourmenu', 'class' => 'dropmenu')); $tools .= $list; // Choose line colour. $titlestr = get_string('linecolour', 'assignfeedback_pdf'); $tools .= html_writer::empty_tag('input', array('type' => 'image', 'id' => 'chooselinecolour', 'style' => 'line-height:normal;', 'name' => 'chooselinecolour', 'value' => '', 'title' => $titlestr)); $colours = array('red', 'yellow', 'green', 'blue', 'white', 'black'); $list = ''; foreach ($colours as $colour) { $colourimg = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url("line{$colour}", 'assignfeedback_pdf'))); $list .= html_writer::tag('li', $colourimg, array('class' => "choosecolour-{$colour}", 'value' => $colour)); } $list = html_writer::tag('ul', $list, array('id' => 'chooselinecolourmenu', 'class' => 'dropmenu')); $tools .= $list; // Stamps. $titlestr = get_string('stamp', 'assignfeedback_pdf'); $tools .= html_writer::empty_tag('input', array('type' => 'image', 'id' => 'choosestamp', 'style' => 'line-height:normal;', 'name' => 'choosestamp', 'width' => '32px', 'height' => '32px', 'value' => '', 'title' => $titlestr)); $stamps = AssignPDFLib::get_stamps(); $list = ''; foreach ($stamps as $stamp => $filename) { $stampimg = html_writer::empty_tag('img', array('src' => $OUTPUT->pix_url("stamps/{$stamp}", 'assignfeedback_pdf'), 'width' => '32', 'height' => '32')); $list .= html_writer::tag('li', $stampimg, array('class' => "choosestamp-{$stamp}", 'value' => $stamp)); } $list = html_writer::tag('ul', $list, array('id' => 'choosestampmenu', 'class' => 'dropmenu')); $tools .= $list; // Choose annotation type. $drawingtools = array('commenticon', 'lineicon', 'rectangleicon', 'ovalicon', 'freehandicon', 'highlighticon', 'stampicon', 'eraseicon'); $list = ''; foreach ($drawingtools as $drawingtool) { $item = html_writer::tag('button', '', array('name' => 'choosetoolradio', 'value' => $drawingtool, 'id' => $drawingtool, 'title' => get_string($drawingtool, 'assignfeedback_pdf'))); $list .= $item; } $list = html_writer::tag('div', $list, array('id' => 'choosetoolgroup', 'class' => 'yui-buttongroup')); $tools .= $list; return $tools; }