コード例 #1
0
ファイル: birthday.php プロジェクト: jfquestiaux/fabrik
 /**
  * Get the list filter for the element
  *
  * @param   int   $counter  Filter order
  * @param   bool  $normal   Do we render as a normal filter or as an advanced search filter
  * if normal include the hidden fields as well (default true, use false for advanced filter rendering)
  *
  * @return  string	Filter html
  */
 public function getFilter($counter = 0, $normal = true)
 {
     $params = $this->getParams();
     $element = $this->getElement();
     if ($element->filter_type === 'dropdown' && $params->get('list_filter_layout', 'individual') === 'day_mont_year') {
         $layout = $this->getLayout('filter-select-day-month-year');
         $elName = $this->getFullName(true, false);
         $layoutData = new stdClass();
         $layoutData->name = $this->filterName($counter, $normal);
         $layoutData->days = $this->_dayOptions();
         $layoutData->months = $this->_monthOptions();
         $layoutData->years = $this->_yearOptions();
         $layoutData->default = (array) $this->getDefaultFilterVal($normal, $counter);
         $layoutData->elementName = $this->getFullName(true, false);
         $this->filterDisplayValues = array($layoutData->default);
         $return = array();
         $return[] = $layout->render($layoutData);
         $return[] = $normal ? $this->getFilterHiddenFields($counter, $elName, false, $normal) : $this->getAdvancedFilterHiddenFields();
         return implode("\n", $return);
     } else {
         return parent::getFilter($counter, $normal);
     }
 }