Example #1
0
 public function init()
 {
     parent::init();
     $image = $this->params['content']->image;
     $image['filename'] = ImageHelper::resizeDown($image['filename'], $this->params['content']->width, $this->params['content']->height);
     $this->params['content']->image = $image;
 }
Example #2
0
 public function init()
 {
     parent::init();
     $keys = array_keys($this->params['content']->images);
     $image = $this->params['content']->images[$keys[rand(0, count($keys) - 1)]];
     $image['filename'] = ImageHelper::resizeDown($image['filename'], $this->params['content']->width, $this->params['content']->height);
     $this->params['image'] = $image;
     if (isset($image['data'][Yii::app()->language . '_caption'])) {
         $this->params['caption'] = $image['data'][Yii::app()->language . '_caption'];
     } else {
         $this->params['caption'] = $this->params['widget']->title;
     }
 }