/**
  * 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 = new ThumbnailVideo($data->thumbnail, Thumbnail::SIZE_SMALL);
         return LazyImage::image($thumbnail, '', 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();
     }));
 }
Example #3
0
<?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">
<li class="span2">
	<div class="thumbnail">
		
		<div class="image-container">
			<?php 
$image = \yiilazyimage\components\LazyImage::image($thumbnail);
if ($itemUrl) {
    echo CHtml::link($image, $itemUrl);
} else {
    echo $image;
}
?>
		</div>
		
		<div class="caption">
			<?php 
echo $label;
if (isset($watchedIcon)) {
    echo $watchedIcon;
}
?>
		</div>
	
	</div>
</li>
<?php

/* @var $season Season */
?>
<div class="season row-fluid">
	
	<div class="pull-left season-artwork hide-when-toggled">
	<?php 
echo \yiilazyimage\components\LazyImage::image(new ThumbnailSeason($season->getArtwork(), Thumbnail::SIZE_VERY_SMALL));
?>
	</div>

	<div class="pull-left">
		<?php 
echo CHtml::link($season->label, $linkUrl, $linkOptions);
?>

		<span class="season-info hide-when-toggled">
			<?php 
echo $season->getEpisodesString() . $season->getWatchedIcon();
?>
		</span>
	</div>
	
</div>
<?php

/* @var $season Season */
$artwork = ThumbnailFactory::create($season->getArtwork(), Thumbnail::SIZE_VERY_SMALL, ThumbnailFactory::THUMBNAIL_TYPE_SEASON);
?>
<div class="season row-fluid">
	
	<div class="pull-left season-artwork hide-when-toggled">
	<?php 
echo \yiilazyimage\components\LazyImage::image($artwork->getUrl());
?>
	</div>

	<div class="pull-left">
		<?php 
echo CHtml::link($season->label, $linkUrl, $linkOptions);
?>

		<span class="season-info hide-when-toggled">
			<?php 
echo $season->getEpisodesString() . $season->getWatchedIcon();
?>
		</span>
	</div>
	
</div>
Example #7
0
<li class="span2">
	<div class="thumbnail">
		
		<div class="image-container">
			<?php 
$image = \yiilazyimage\components\LazyImage::image($thumbnail->getUrl());
if ($itemUrl) {
    echo CHtml::link($image, $itemUrl);
} else {
    echo $image;
}
?>
		</div>
		
		<div class="caption">
			<?php 
echo $label;
if (isset($watchedIcon)) {
    echo $watchedIcon;
}
?>
		</div>
	
	</div>
</li>
<?php

use yiilazyimage\components\LazyImage;
/* @var $season Season */
/* @var $this TvShowController */
$dataProvider = $this->getEpisodeDataProvider($season->tvshowid, $season->season);
?>
<div class="season-episode-list-info row-fluid">
	<div class="season-artwork pull-left">
		<?php 
echo LazyImage::image(new ThumbnailSeason($season->getArtwork(), Thumbnail::SIZE_MEDIUM));
?>
	</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