コード例 #1
0
 public function render($conf = array())
 {
     $GLOBALS['TSFE']->lastImgResourceInfo = $this->cObj->getImgResource($conf['file'], $conf['file.']);
     ###################################
     ## Here begins RealUrl_image ######
     ###################################
     if (is_array($GLOBALS['TSFE']->lastImgResourceInfo)) {
         // call fl_realurl_image to generate $new_fileName
         $tx_flrealurlimage = new tx_flrealurlimage();
         $tx_flrealurlimage->start($this->data, $this->table);
         $new_fileName = $tx_flrealurlimage->main($conf, $GLOBALS['TSFE']->lastImgResourceInfo);
         // generate the image URL
         $theValue = htmlspecialchars($GLOBALS['TSFE']->absRefPrefix) . $new_fileName;
         // stdWrap and return
         return $this->getContentObject()->stdWrap($theValue, $conf['stdWrap.']);
     }
     ##################################
     ### Here ends RealURL_Image ######
     ##################################
     $imageResource = $GLOBALS['TSFE']->lastImgResourceInfo[3];
     $theValue = isset($conf['stdWrap.']) ? $this->cObj->stdWrap($imageResource, $conf['stdWrap.']) : $imageResource;
     return $theValue;
 }
コード例 #2
0
 /**
  * Returns a <img> tag with the image file defined by $file and processed according to the properties in the TypoScript array.
  * Mostly this function is a sub-function to the IMAGE function which renders the IMAGE cObject in TypoScript. This function is called by "$this->cImage($conf['file'],$conf);" from IMAGE().
  *
  * @param		string		File TypoScript resource
  * @param		array		TypoScript configuration properties for the IMAGE object
  * @return		string		<img> tag, (possibly wrapped in links and other HTML) if any image found.
  * @access private
  * @see IMAGE()
  */
 function cImage($file, $conf)
 {
     $info = $this->getImgResource($file, $conf['file.']);
     $GLOBALS['TSFE']->lastImageInfo = $info;
     if (is_array($info)) {
         $info[3] = t3lib_div::png_to_gif_by_imagemagick($info[3]);
         $GLOBALS['TSFE']->imagesOnPage[] = $info[3];
         // This array is used to collect the image-refs on the page...
         if (!strlen($conf['altText']) && !is_array($conf['altText.'])) {
             // Backwards compatible:
             $conf['altText'] = $conf['alttext'];
             $conf['altText.'] = $conf['alttext.'];
         }
         $altParam = $this->getAltParam($conf);
         ###################################
         ## Here begins RealUrl_image ######
         ###################################
         // call fl_realurl_image to generate $new_fileName
         $tx_flrealurlimage = new tx_flrealurlimage();
         $tx_flrealurlimage->start($this->data, $this->table);
         $new_fileName = $tx_flrealurlimage->main($conf, $info);
         // generate the <img>-tag
         if (isset($conf['params.']) && is_array($conf['params.'])) {
             $conf['params'] = $this->stdWrap($conf['params'], $conf['params.']);
         }
         $theValue = '<img src="' . htmlspecialchars($GLOBALS['TSFE']->absRefPrefix) . $new_fileName . '"' . ' width="' . $info[0] . '" height="' . $info[1] . '"' . $this->getBorderAttr(' border="' . intval($conf['border']) . '"') . ($conf['params'] ? ' ' . $conf['params'] : '') . $altParam . ' />';
         ##################################
         ### Here ends RealURL_Image ######
         ##################################
         /*
          $theValue = '<img src="'.htmlspecialchars($GLOBALS['TSFE']->absRefPrefix.t3lib_div::rawUrlEncodeFP($info[3])).'" width="'.$info[0].'" height="'.$info[1].'"'.$this->getBorderAttr(' border="'.intval($conf['border']).'"').(($conf['params'] || is_array($conf['params.']))?' '.$this->stdwrap($conf['params'],$conf['params.']):'').($altParam).' />';
         */
         if ($conf['linkWrap']) {
             $theValue = $this->linkWrap($theValue, $conf['linkWrap']);
         } elseif ($conf['imageLinkWrap']) {
             $theValue = $this->imageLinkWrap($theValue, $info['origFile'], $conf['imageLinkWrap.']);
         }
         return $this->wrap($theValue, $conf['wrap']);
     }
 }