/**
  * @param Mana_Filters_Block_View $block
  * @param Mana_Filters_Model_Filter2_Store $filterOptions
  * @return string
  */
 public function isCollapseable($block, $filterOptions)
 {
     if ($block->getData("expanded_{$filterOptions->getCode()}")) {
         return 'expand';
     } elseif ($block->getData("collapsed_{$filterOptions->getCode()}")) {
         return 'collapse';
     } elseif ($block->getData("dropdown_{$filterOptions->getCode()}")) {
         return 'dropdown';
     } elseif ($block->getData("not_collapseable_{$filterOptions->getCode()}")) {
         return '';
     } else {
         return $filterOptions->getCollapseable();
     }
 }
Example #2
0
 /**
  * @param string $field
  * @param Mana_Filters_Model_Filter2_Store $options
  * @return string
  */
 public function getFilterTypeName($field, $options)
 {
     $displayOptions = $options->getDisplayOptions();
     $result = (string) $displayOptions->{$field};
     // add Solr prefix
     $prefix = '';
     if ($this->useSolr()) {
         $prefix .= 'solr_';
     }
     if ($prefix) {
         $prefixedField = $prefix . $field;
         if ($prefixedResult = (string) $displayOptions->{$prefixedField}) {
             $result = $prefixedResult;
         }
     }
     // add prefix for alternative logic
     if ($options->getIsReverse()) {
         $prefix .= 'reverse_';
     } elseif ($options->getOperation() == 'and') {
         $prefix .= 'and_';
     }
     if ($prefix) {
         $prefixedField = $prefix . $field;
         if ($prefixedResult = (string) $displayOptions->{$prefixedField}) {
             $result = $prefixedResult;
         }
     }
     return $result;
 }
 /**
  * @param Mana_Filters_Model_Filter2_Store $filter
  * @return bool|int
  */
 public function getAttributeId($filter)
 {
     $db = $this->_getReadAdapter();
     return $db->fetchOne($db->select()->from(array('a' => $this->getTable('eav/attribute')), 'attribute_id')->joinInner(array('f' => $this->getTable('mana_filters/filter2')), "a.attribute_code = f.code", null)->joinInner(array('t' => $this->getTable('eav/entity_type')), "`t`.`entity_type_id` = `a`.`entity_type_id` AND `t`.`entity_type_code` = 'catalog_product'", null)->joinInner(array('ca' => $this->getTable('catalog/eav_attribute')), "`ca`.`attribute_id` = `a`.`attribute_id`", null)->where('f.id = ?', $filter->getGlobalId()));
 }