示例#1
0
 /**
  * {@inheritdoc}
  *
  * @SuppressWarnings(PHPMD.Superglobals)
  * @SuppressWarnings(PHPMD.CamelCaseVariableName)
  */
 public function getParameterFilterWidgets($arrIds, $arrFilterUrl, $arrJumpTo, FrontendFilterOptions $objFrontendFilterOptions, $arrCustom = array())
 {
     /* $arrCustom array with settings which makes the function more flexible to use in template
            the following keys can be set: objAttribute, forceToUseArrIds, strParamName, 
            [Widget > eval: includeBlankOption, onlyused, onlypossible, template] (only eval for now)
        */
     $strParam = !isset($arrCustom['strParamName']) ? $this->getParamName() : $arrCustom['strParamName'];
     $forceToUseArrIds = !isset($arrCustom['forceToUseArrIds']) ? false : $arrCustom['forceToUseArrIds'];
     // If defined as static, return nothing as not to be manipulated via editors.
     if (!$this->enableFEFilterWidget()) {
         return array();
     }
     $objAttribute = !isset($arrCustom['objAttribute']) ? $this->getMetaModel()->getAttributeById($this->get('attr_id')) : $arrCustom['objAttribute'];
     if (!$objAttribute) {
         return array();
     }
     $GLOBALS['MM_FILTER_PARAMS'][] = $strParam;
     $arrCount = array();
     $arrWidget = array('label' => array($this->get('label') ? $this->get('label') : $objAttribute->getName(), 'GET: ' . $strParam), 'inputType' => 'select', 'options' => $this->getParameterFilterOptions($objAttribute, $arrIds, $arrCount, $forceToUseArrIds), 'count' => $arrCount, 'showCount' => $objFrontendFilterOptions->isShowCountValues(), 'eval' => array('includeBlankOption' => $this->get('blankoption') && !$objFrontendFilterOptions->isHideClearFilter() ? true : false, 'blankOptionLabel' => &$GLOBALS['TL_LANG']['metamodels_frontendfilter']['do_not_filter'], 'colname' => $objAttribute->getColname(), 'urlparam' => $strParam, 'onlyused' => $this->get('onlyused'), 'onlypossible' => $this->get('onlypossible'), 'template' => $this->get('template')));
     if (isset($arrCustom['Widget']['eval']) && is_array($arrCustom['Widget']['eval'])) {
         $arrWidget['eval'] = array_merge($arrWidget['eval'], $arrCustom['Widget']['eval']);
     }
     return array($strParam => $this->prepareFrontendFilterWidget($arrWidget, $arrFilterUrl, $arrJumpTo, $objFrontendFilterOptions));
 }
示例#2
0
 /**
  * {@inheritdoc}
  *
  * @SuppressWarnings(PHPMD.Superglobals)
  * @SuppressWarnings(PHPMD.CamelCaseVariableName)
  */
 public function getParameterFilterWidgets($arrIds, $arrFilterUrl, $arrJumpTo, FrontendFilterOptions $objFrontendFilterOptions)
 {
     // If defined as static, return nothing as not to be manipulated via editors.
     if (!$this->enableFEFilterWidget()) {
         return array();
     }
     $objAttribute = $this->getMetaModel()->getAttributeById($this->get('attr_id'));
     if (!$objAttribute) {
         return array();
     }
     $GLOBALS['MM_FILTER_PARAMS'][] = $this->getParamName();
     $arrCount = array();
     $arrWidget = array('label' => array($this->get('label') ? $this->get('label') : $objAttribute->getName(), 'GET: ' . $this->getParamName()), 'inputType' => 'select', 'options' => $this->getParameterFilterOptions($objAttribute, $arrIds, $arrCount), 'count' => $arrCount, 'showCount' => $objFrontendFilterOptions->isShowCountValues(), 'eval' => array('includeBlankOption' => $this->get('blankoption') && !$objFrontendFilterOptions->isHideClearFilter() ? true : false, 'blankOptionLabel' => &$GLOBALS['TL_LANG']['metamodels_frontendfilter']['do_not_filter'], 'colname' => $objAttribute->getColname(), 'urlparam' => $this->getParamName(), 'onlyused' => $this->get('onlyused'), 'onlypossible' => $this->get('onlypossible'), 'template' => $this->get('template')));
     return array($this->getParamName() => $this->prepareFrontendFilterWidget($arrWidget, $arrFilterUrl, $arrJumpTo, $objFrontendFilterOptions));
 }