Esempio n. 1
0
 protected function _afterToHtml($html)
 {
     $html = parent::_afterToHtml($html);
     $queldorei = false;
     if (!$html) {
         // compatibility with "shopper" theme
         // @see catalog/layer/view.phtml
         $queldorei_blocks = Mage::registry('queldorei_blocks');
         if ($queldorei_blocks and !empty($queldorei_blocks['block_layered_nav'])) {
             $html = $queldorei_blocks['block_layered_nav'];
         }
         if (!$html) {
             return '';
         }
         $queldorei = true;
     }
     $pos = strrpos($html, '</div>');
     if ($pos !== false) {
         //add an overlay before closing tag
         $html = substr($html, 0, strrpos($html, '</div>')) . '<div style="display:none" class="amshopby-overlay"></div>' . '</div>';
     }
     // to make js and css work for 1.3 also
     $html = str_replace('class="narrow-by', 'class="block-layered-nav narrow-by', $html);
     // add selector for ajax
     $html = str_replace('block-layered-nav', 'block-layered-nav ' . $this->getBlockId(), $html);
     // we don't want to move this into the template are different in custom themes
     foreach ($this->getFilters() as $f) {
         $name = $this->__($f->getName());
         if ($f->getCollapsed() && !$f->getHasSelection()) {
             $html = str_replace('<dt>' . $name, '<dt class="amshopby-collapsed">' . $name, $html);
         }
         $comment = $f->getComment();
         if ($comment) {
             $img = Mage::getDesign()->getSkinUrl('images/amshopby-tooltip.png');
             $img = '<img class="amshopby-tooltip-img" src="' . $img . '" width="9" height="9" alt="' . htmlspecialchars($comment) . '" id="amshopby-img-' . $f->getAttributeCode() . '"/>';
             $html = str_replace($name . '</dt>', $name . $img . '</dt>', $html);
         }
     }
     if ($queldorei and !empty($queldorei_blocks['block_layered_nav'])) {
         // compatibility with "shopper" theme
         // @see catalog/layer/view.phtml
         Mage::unregister('queldorei_blocks');
         $queldorei_blocks['block_layered_nav'] = $html;
         Mage::register('queldorei_blocks', $queldorei_blocks);
         return '';
     }
     return $html;
 }
 protected function _afterToHtml($html)
 {
     $html = parent::_afterToHtml($html);
     //to make js and css work for 1.3 also
     $html = str_replace('narrow-by', 'narrow-by block-layered-nav', $html);
     $collapsing = intval(Mage::getStoreConfig('amshopby/general/enable_collapsing'));
     $html .= '<script>amshopby_start(' . $collapsing . ')</script>';
     // we don't want to move this into the template as there are different
     // teplates for different themes
     foreach ($this->getFilters() as $f) {
         if ($f->getCollapsed() && !$f->getHasSelection()) {
             $name = $this->__($f->getName());
             $html = str_replace('<dt>' . $name, '<dt class="amshopby-collapsed">' . $name, $html);
         }
     }
     return $html;
 }
Esempio n. 3
0
 protected function _afterToHtml($html)
 {
     $html = parent::_afterToHtml($html);
     // add an overlay before closing tag
     /* XXXTT modificato per evitare il problema della chisura del div in eccesso quando non viene mostrato lo shopby */
     if (strrpos($html, '</div>')) {
         $html = substr($html, 0, strrpos($html, '</div>')) . '<div style="display:none" class="amshopby-overlay"></div>' . '</div>';
     }
     // to make js and css work for 1.3 also
     $html = str_replace('class="narrow-by', 'class="block-layered-nav narrow-by', $html);
     // add selector for ajax
     $html = str_replace('block-layered-nav', 'block-layered-nav ' . $this->getBlockId(), $html);
     // we don't want to move this into the template are different in custom themes
     foreach ($this->getFilters() as $f) {
         $name = $this->__($f->getName());
         if ($f->getCollapsed() && !$f->getHasSelection()) {
             $html = str_replace('<dt>' . $name, '<dt class="amshopby-collapsed">' . $name, $html);
         }
         $comment = $f->getComment();
         if ($comment) {
             $img = Mage::getDesign()->getSkinUrl('images/amshopby-tooltip.png');
             $img = '<img class="amshopby-tooltip-img" src="' . $img . '" width="9" height="9" alt="' . htmlspecialchars($comment) . '" id="amshopby-img-' . $f->getAttributeCode() . '"/>';
             $html = str_replace($name . '</dt>', $name . $img . '</dt>', $html);
         }
     }
     return $html;
 }