예제 #1
0
 protected function getImageBanner(Banner $banner, $width = null, $height = null)
 {
     $clickUrl = $banner->getClickUrl();
     $htmlOptions = array("class" => 'thumbnail');
     if ($width != null) {
         $htmlOptions['width'] = $width;
     }
     if ($height != null) {
         $htmlOptions['height'] = $height;
     }
     $htmlOptions = array('width' => $width, 'height' => $height);
     $code = CHtml::image($banner->getShowUrl(), $banner->alt, $htmlOptions);
     $code .= CHtml::openTag("div", array("class" => 'caption')) . CHtml::tag("h5", array(), $banner->alt, true) . CHtml::closeTag("div");
     if (($link = $banner->link) != null && $link != 'http://') {
         $link = "#";
     }
     $code = CHtml::link($code, $clickUrl, array('title' => $banner->alt, 'class' => 'thumbnails'));
     return $code;
 }
예제 #2
0
 protected function getImageBanner(Banner $banner, $width = null, $height = null)
 {
     $clickUrl = $banner->getClickUrl();
     $htmlOptions = array();
     if ($width != null) {
         $htmlOptions['width'] = $width;
     }
     if ($height != null) {
         $htmlOptions['height'] = $height;
     }
     $htmlOptions = array('width' => $width, 'height' => $height);
     $code = CHtml::image($banner->getShowUrl(), $banner->alt, $htmlOptions);
     if (($link = $banner->link) != null && $link != 'http://') {
         $code = CHtml::link($code, $clickUrl, array('title' => $banner->alt));
     }
     return $code;
 }