Пример #1
0
 /**
  * Draws an actor cover image
  * 
  * @param ComActorsDomainEntityActor $actor
  * @param string                    $size 
  * @param boolean                   $linked if true it returns a linked image tag of not just an image tag
  * @param array                     $attr link attributes
  * 
  * @return string
  */
 public function cover($actor, $size = 'large', $linked = true, $attr = array())
 {
     if (is_numeric($size)) {
         $width = "width=\"{$size}\"";
         $size = 'large';
     } else {
         $width = '';
     }
     if ($actor->coverSet()) {
         $src = $actor->getCoverURL($size);
         $name = KHelperString::ucwords($actor->name);
         $img = '<img ' . $width . ' alt="' . $name . '" class="cover" src="' . $src . '"  />';
     }
     if ($linked && $actor->authorize('access')) {
         $url = $this->getActorURL($actor);
         $img = '<a ' . $this->_buildAttribute($attr) . ' data-actor="' . $actor->id . '" href="' . $url . '" >' . $img . '</a>';
     }
     return $img;
 }