. /** * This file contains the annotation class for the assignfeedback_editpdfplus plugin * * @package assignfeedback_editpdfplus * @copyright 2016 Université de Lausanne * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace assignfeedback_editpdfplus\bdd; /** * Description of tool * * @author kury */ class tool_generic extends tool { const DISPLAY_CLASS_BUTTON = array( "highlight" => "fa fa-paint-brush", "line" => "fa fa-minus", "oval" => "fa fa-circle-o", "pen" => "fa fa-pencil", "rectangle" => "fa fa-square-o", "drag" => "fa fa-hand-paper-o", "select" => "fa fa-mouse-pointer", "annotationcolour" => "fa fa-tint", "rotateleft" => "fa fa-undo", "rotateright" => "fa fa-undo fa-flip-horizontal" ); /** * Get elements (display label, parameters) to render a button in HTML * @param bool $disabled if the button must be disabled * @return array */ public function getRendererBoutonHTMLDisplay($disabled = false) { $iconhtml = \html_writer::tag("i", "", array('class' => self::DISPLAY_CLASS_BUTTON[$this->label], 'aria-hidden' => 'true')); $iconparams = array( 'data-tool' => $this->label, 'class' => $this->label . 'button generictoolbarbutton btn btn-light', 'type' => 'button' ); if ($this->id) { $iconparams['id'] = 'ctbutton' . $this->id; } if ($disabled) { $iconparams['disabled'] = 'true'; } return array( 'content' => $iconhtml, 'parameters' => $iconparams ); } }