protected function _prepareColumns() { $this->addColumnAfter('visibility', array('header' => Mage::helper('M2ePro')->__('Visibility'), 'align' => 'left', 'width' => '90px', 'type' => 'options', 'sortable' => false, 'index' => 'visibility', 'filter_index' => 'visibility', 'options' => Mage::getModel('catalog/product_visibility')->getOptionArray()), 'qty'); $this->addColumnAfter('status', array('header' => Mage::helper('M2ePro')->__('Status'), 'align' => 'left', 'width' => '90px', 'type' => 'options', 'sortable' => false, 'index' => 'status', 'filter_index' => 'status', 'options' => Mage::getSingleton('catalog/product_status')->getOptionArray(), 'frame_callback' => array($this, 'callbackColumnStatus')), 'visibility'); if (!Mage::app()->isSingleStoreMode()) { $this->addColumnAfter('websites', array('header' => Mage::helper('M2ePro')->__('Websites'), 'align' => 'left', 'width' => '90px', 'type' => 'options', 'sortable' => false, 'index' => 'websites', 'filter_index' => 'websites', 'options' => Mage::getModel('core/website')->getCollection()->toOptionHash()), 'status'); } return parent::_prepareColumns(); }
protected function _toHtml() { $html = parent::_toHtml(); $js = ''; if ($this->getRequest()->getParam('category_change')) { $checkedString = implode(',', array_intersect($this->getCollectionIds(), $this->selectedIds)); $js .= <<<HTML <script type="text/javascript"> {$this->getMassactionBlock()->getJsObjectName()}.checkedString = '{$checkedString}'; {$this->getMassactionBlock()->getJsObjectName()}.initCheckboxes(); {$this->getMassactionBlock()->getJsObjectName()}.checkCheckboxes(); {$this->getMassactionBlock()->getJsObjectName()}.updateCount(); {$this->getMassactionBlock()->getJsObjectName()}.initialCheckedString = {$this->getMassactionBlock()->getJsObjectName()}.checkedString; </script> HTML; } if ($this->getRequest()->isXmlHttpRequest()) { return $html . $js; } return <<<HTML <div class="columns"> <div class="side-col">{$this->getTreeBlock()->toHtml()}</div> <div class="main-col">{$html}</div> </div> {$js} HTML; }