/** * Class constructor * @param ItemLink $itemLink */ public function __construct($itemLink) { $this->title = $itemLink->name; $this->location = $itemLink->url; $media = $itemLink->media; // Set runtime $this->runtime = $media->runtime; // Generate a link to the artwork $thumbnail = ThumbnailFactory::create($media->getArtwork(), Thumbnail::SIZE_LARGE); $this->image = Yii::app()->request->hostInfo . $thumbnail->getUrl(); }
/** * Returns the typeahead data for the movie name field */ public function actionGetMovieNames() { $cacheId = 'MovieFilterMovieNameTypeahead'; $this->renderJson($this->getTypeaheadSource($cacheId, function () { $movies = VideoLibrary::getMovies(array('properties' => array('year', 'genre', 'thumbnail'))); // Modify some of the raw data so it's ready for rendering foreach ($movies as $movie) { $thumbnail = ThumbnailFactory::create($movie->thumbnail, Thumbnail::SIZE_VERY_SMALL); $movie->thumbnail = LazyImage::image($thumbnail->getUrl()); $movie->genre = $movie->getGenreString(); } return $movies; })); }
/** * Returns the column definitions for the grid view. Child classes can * override this to provide additional columns. * @return array the column definitions */ protected function getColumns() { return array(array('type' => 'raw', 'header' => Yii::t('EpisodeList', 'Episode'), 'value' => function ($data) { Yii::app()->controller->renderPartial('_getEpisode', array('episode' => $data)); }), array('type' => 'raw', 'header' => '', 'value' => function ($data) { $thumbnail = ThumbnailFactory::create($data->thumbnail, Thumbnail::SIZE_SMALL); return LazyImage::image($thumbnail->getUrl(), '', array('class' => 'item-thumbnail episode-thumbnail')); }), array('header' => Yii::t('GenericList', 'Title'), 'name' => 'title'), array('type' => 'raw', 'header' => Yii::t('EpisodeList', 'Plot'), 'cssClassExpression' => function () { return 'episode-list-plot'; }, 'value' => function ($data) { Yii::app()->controller->renderPartial('_plotStreamDetails', array('episode' => $data)); }), array('header' => Yii::t('GenericList', 'Runtime'), 'type' => 'html', 'value' => function ($data) { echo $data->getRuntimeString(); })); }
<?php use yiilazyimage\components\LazyImage; /* @var $season Season */ /* @var $this TvShowController */ $dataProvider = $this->getEpisodeDataProvider($season->tvshowid, $season->season); $artwork = ThumbnailFactory::create($season->getArtwork(), Thumbnail::SIZE_MEDIUM, ThumbnailFactory::THUMBNAIL_TYPE_SEASON); ?> <div class="season-episode-list-info row-fluid"> <div class="season-artwork pull-left"> <?php echo LazyImage::image($artwork->getUrl()); ?> </div> <h3> <?php echo $season->getDisplayName(); ?> </h3> <p> <?php echo $season->getEpisodesString(); ?> </p> <?php if (Yii::app()->user->role !== User::ROLE_SPECTATOR) { ?> <div class="season-download">
<?php /* @var $this MediaController */ /* @var $data Media */ $itemUrl = $this->createUrl('details', array('id' => $data->getId())); $thumbnail = ThumbnailFactory::create($data->getArtwork(), Thumbnail::SIZE_MEDIUM); $this->renderPartial('//videoLibrary/_gridItem', array('label' => CHtml::link($data->label, $itemUrl), 'itemUrl' => $itemUrl, 'thumbnail' => $thumbnail, 'watchedIcon' => $data->getWatchedIcon()));
<?php /* @var $this MovieController */ /* @var $actorDataProvider LibraryDataProvider */ /* @var $details Movie */ $this->pageTitle = $details->getDisplayName() . ' - ' . Yii::t('Movies', 'Movies'); $artwork = ThumbnailFactory::create($details->getArtwork(), Thumbnail::SIZE_LARGE); ?> <div class="row-fluid"> <div class="span3"> <?php echo CHtml::image($artwork->getUrl(), '', array('class' => 'item-thumbnail hidden-phone')); // Don't show the modal trigger to spectators if (Yii::app()->user->role !== User::ROLE_SPECTATOR) { $buttonOptions = array('style' => 'margin-top: 20px;'); $this->widget('WatchMovieModal', array('media' => $details))->renderTriggerButton($buttonOptions); } ?> </div> <div class="span9 item-description"> <div class="item-top row-fluid"> <div class="item-title span6"> <h2> <a href="<?php echo $details->getIMDbUrl(); ?> " target="_blank"> <?php echo $details->label;
<?php /* @var $this TvShowController */ /* @var $data Season */ $itemUrl = $this->createUrl('season', array('tvshowid' => $data->tvshowid, 'season' => $data->season)); $thumbnail = ThumbnailFactory::create($data->getArtwork(), Thumbnail::SIZE_MEDIUM, ThumbnailFactory::THUMBNAIL_TYPE_SEASON); $this->renderPartial('//videoLibrary/_gridItem', array('label' => CHtml::link($data->label, $itemUrl) . CHtml::tag('p', array(), $data->getEpisodesString()), 'itemUrl' => $itemUrl, 'thumbnail' => $thumbnail));
<?php /* @var $this MediaController */ // Unlike movies and TV shows, actors don't always have the thumbnail property $thumbnailPath = isset($data->thumbnail) ? $data->thumbnail : ''; $thumbnail = ThumbnailFactory::create($thumbnailPath, Thumbnail::SIZE_MEDIUM, ThumbnailFactory::THUMBNAIL_TYPE_ACTOR); // Make the label a link to the IMDB search page for the actor $label = Yii::t('Media', '{actorName} as {role}', array('{actorName}' => $data->name, '{role}' => '<em>' . $data->role . '</em>')); $labelUrl = 'http://www.imdb.com/find?q=' . urlencode($data->name) . '&s=nm'; $itemUrl = $this->createUrl('movie/index', array('MovieFilterForm[actor]' => $data->name)); $this->renderPartial('//videoLibrary/_gridItem', array('label' => CHtml::link($label, $labelUrl, array('target' => '_blank')), 'itemUrl' => $itemUrl, 'thumbnail' => $thumbnail));