}
}
+/**
+ * Data structure representing an emoticon image
+ *
+ * @since Moodle 2.0
+ */
+class pix_emoticon extends pix_icon implements renderable {
+
+ /**
+ * Constructor
+ * @param string $pix short icon name
+ * @param string $component component name
+ */
+ public function __construct($pix, $alt, $component = 'moodle') {
+ $attributes = array('class' => 'emoticon');
+ parent::__construct($pix, $alt, $component, $attributes);
+ }
+}
/**
* Data structure representing a simple form with only one button.
return html_writer::empty_tag('img', $attributes);
}
+ /**
+ * Render emoticon
+ * @param pix_emoticon $emoticon
+ * @return string HTML fragment
+ */
+ protected function render_pix_emoticon(pix_emoticon $emoticon) {
+ $attributes = $emoticon->attributes;
+ $attributes['src'] = $this->pix_url($emoticon->pix, $emoticon->component);
+ return html_writer::empty_tag('img', $attributes);
+ }
+
/**
* Produces the html that represents this rating in the UI
* @param $page the page object on which this rating will appear