TVShowFilter::renderControls()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 23
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 13
nc 2
nop 0
dl 0
loc 23
rs 9.8333
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Renders the filter on the TV show index page
5
 *
6
 * @author Sam Stenvall <[email protected]>
7
 * @copyright Copyright &copy; Sam Stenvall 2013-
8
 * @license https://www.gnu.org/licenses/gpl.html The GNU General Public License v3.0
9
 */
10
class TVShowFilter extends VideoFilter
11
{
12
	
13
	protected function renderControls()
14
	{
15
		$ctrl = Yii::app()->controller;
16
		
17
		echo $this->form->typeaheadFieldControlGroup($this->model, 'name', array(
18
			'prefetch'=>$ctrl->createUrl('typeahead/getTVShowNames')));
19
20
		echo $this->form->dropDownListControlGroup($this->model, 'genre', 
21
				$this->model->getGenres(), array('empty'=>' '));
22
		
23
		echo $this->form->dropDownListControlGroup($this->model, 'watchedStatus', 
24
				VideoFilterForm::getWatchedStatuses(), 
25
				array('empty'=>' ', 'style'=>'width: 120px;'));
26
27
		if ($this->enableActorTypeahead())
28
		{
29
			echo $this->form->typeaheadFieldControlGroup($this->model, 'actor', [
30
				'prefetch' => $ctrl->createUrl('typeahead/getActorNames', ['mediaType' => Actor::MEDIA_TYPE_TVSHOW]),
31
			]);
32
		}
33
		else
34
		{
35
			echo $this->form->textFieldControlGroup($this->model, 'actor');
36
		}
37
	}
38
39
}
40