Пример #1
0
 /**
  * Return the actor URL. Can be overwritten to return custom URLs
  * 
  * @param  ComActorsDomainEntityActor $actor Actor object
  * 
  * @return string
  */
 public function getActorURL($actor)
 {
     return JRoute::_($actor->getURL());
 }
Пример #2
0
 /**
  * Draws an actor cover image.
  *
  * @param ComActorsDomainEntityActor $actor
  * @param string                     $size
  * @param bool                       $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 = JRoute::_($actor->getURL());
         $img = '<a ' . $this->_buildAttribute($attr) . ' data-actor="' . $actor->id . '" href="' . $url . '" >' . $img . '</a>';
     }
     return $img;
 }