/** * Returns the image tag, that includes the image resource (front controller action). The * tag definition also contains size and border instruction. * * @return string The image tag. * * @author Ralf Schubert */ public function transform() { // generate the image tag $imgSrc = parent::transform(); $label = $this->getAttribute('label'); $cfg = $this->getConfiguration('APF\\extensions\\news', 'labels.ini'); $lang = $cfg->getSection($this->getLanguage()); $title = $lang->getValue($label); $this->setAttribute('title', $title); $this->setAttribute('alt', $title); $width = $this->getAttribute('width', '20px'); $height = $this->getAttribute('height', '20px'); $attributes = $this->getAttributesAsString($this->getAttributes(), ['alt', 'title']); return '<img src="' . $imgSrc . '" ' . $attributes . ' style="width: ' . $width . '; height: ' . $height . '; border-width: 0px;" />'; }
/** * Returns the image tag, that includes the image resource (front controller action). The * tag definition also contains size and border instruction. * * @return string The image tag. * * @author Christian Achatz * @version * Version 0.1, 26.12.2008<br /> */ public function transform() { // setup the desired attributes $this->setAttribute('namespace', 'APF\\modules\\usermanagement\\pres\\icons'); // execute the parent's onParseTime() parent::onParseTime(); // resolve missing alt attribute $alt = $this->getAttribute('alt'); if ($alt === null) { $this->setAttribute('alt', $this->getAttribute('title')); } // generate the image tag $imgSrc = parent::transform(); $attributes = $this->getAttributesAsString($this->getAttributes(), ['alt', 'title']); return '<img src="' . $imgSrc . '" ' . $attributes . ' class="icon" />'; }
private function getMediaUrl($image) { $media = new MediaInclusionTag(); $media->setAttribute('namespace', 'APF\\modules\\socialbookmark\\pres\\image'); $media->setAttribute('filename', $image); $media->setContent($this->getContext()); $media->setLanguage($this->getLanguage()); $media->onParseTime(); return $media->transform(); }