protected function renderControls()
 {
     echo $this->form->typeaheadFieldControlGroup($this->model, 'name', CJavaScript::encode($this->getTypeaheadData(VideoLibrary::getTVShows(array('properties' => array())))));
     echo $this->form->dropDownListControlGroup($this->model, 'genre', $this->model->getGenres(), array('empty' => ' '));
     echo $this->form->dropDownListControlGroup($this->model, 'watchedStatus', VideoFilterForm::getWatchedStatuses(), array('empty' => ' ', 'style' => 'width: 120px;'));
     echo $this->form->typeaheadFieldControlGroup($this->model, 'actor', $this->getActorNameTypeaheadData(Actor::MEDIA_TYPE_TVSHOW));
 }
示例#2
0
 protected function renderControls()
 {
     $ctrl = Yii::app()->controller;
     echo $this->form->typeaheadFieldControlGroup($this->model, 'name', array('prefetch' => $ctrl->createUrl('typeahead/getTVShowNames')));
     echo $this->form->dropDownListControlGroup($this->model, 'genre', $this->model->getGenres(), array('empty' => ' '));
     echo $this->form->dropDownListControlGroup($this->model, 'watchedStatus', VideoFilterForm::getWatchedStatuses(), array('empty' => ' ', 'style' => 'width: 120px;'));
     echo $this->form->typeaheadFieldControlGroup($this->model, 'actor', array('prefetch' => $ctrl->createUrl('typeahead/getActorNames', array('mediaType' => Actor::MEDIA_TYPE_TVSHOW))));
 }
 /**
  * Returns the defined filter as an array
  * @return array the filter
  */
 public function getFilterDefinitions()
 {
     $filter = parent::getCommonFilterDefinitions();
     $filter['year'] = array('operator' => 'is', 'value' => $this->year);
     $filter['rating'] = array('operator' => 'greaterthan', 'value' => $this->rating);
     $filter['director'] = array('operator' => 'is', 'value' => $this->director);
     $quality = $this->quality;
     // SD means anything less than 720p
     if ($quality == self::QUALITY_SD) {
         $filter['videoresolution'] = array('operator' => 'lessthan', 'value' => (string) self::QUALITY_720);
     } else {
         $filter['videoresolution'] = array('operator' => 'is', 'value' => $quality);
     }
     return $filter;
 }
示例#4
0
 protected function renderControls()
 {
     $ctrl = Yii::app()->controller;
     // Wrap the movie name typeahead field in a container so we can style it
     echo CHtml::openTag('div', array('class' => 'movie-name-typeahead'));
     echo $this->form->movieNameFieldControlGroup($this->model, 'name', array('prefetch' => $ctrl->createUrl('typeahead/getMovieNames')));
     echo CHtml::closeTag('div');
     echo $this->form->dropDownListControlGroup($this->model, 'genre', $this->model->getGenres(), array('empty' => ' '));
     echo $this->form->textFieldControlGroup($this->model, 'year', array('style' => 'max-width: 40px;'));
     echo $this->form->textFieldControlGroup($this->model, 'rating', array('style' => 'max-width: 40px;'));
     echo $this->form->dropDownListControlGroup($this->model, 'quality', $this->model->getQualities(), array('empty' => ' ', 'style' => 'width: 70px;'));
     echo $this->form->dropDownListControlGroup($this->model, 'watchedStatus', VideoFilterForm::getWatchedStatuses(), array('empty' => ' ', 'style' => 'width: 120px;'));
     echo $this->form->typeaheadFieldControlGroup($this->model, 'actor', array('prefetch' => $ctrl->createUrl('typeahead/getActorNames', array('mediaType' => Actor::MEDIA_TYPE_MOVIE))));
     echo $this->form->typeaheadFieldControlGroup($this->model, 'director', array('prefetch' => $ctrl->createUrl('typeahead/getDirectorNames')));
 }
 /**
  * @return array the request parameters
  */
 public function getFilterDefinitions()
 {
     return parent::getCommonFilterDefinitions();
 }
 /**
  * Pre-validation logic
  * @return boolean whether to perform validation at all
  */
 protected function beforeValidate()
 {
     // Convert commas to dots
     $this->rating = str_replace(',', '.', $this->rating);
     return parent::beforeValidate();
 }