示例#1
0
 protected function _prepareColumns()
 {
     $this->addColumn('category_name', array('index' => 'category_name', 'header' => $this->__('Title')));
     $this->addColumn('article_count', array('index' => 'article_count', 'type' => 'number', 'header' => $this->__('Articles'), 'width' => '100px', 'align' => 'right', 'filter_condition_callback' => array($this, '_filterArticleCount')));
     if (!Mage::app()->isSingleStoreMode()) {
         $this->addColumn('store_ids', array('header' => $this->__('Store views'), 'index' => 'store_ids', 'type' => 'store', 'store_all' => true, 'store_view' => true, 'sortable' => false, 'filter_condition_callback' => array($this, '_filterStore')));
     }
     $this->addColumn('category_url_key', array('index' => 'category_url_key', 'header' => $this->__('URL key')));
     $this->addColumn('category_order', array('index' => 'category_order', 'type' => 'number', 'header' => $this->__('Order'), 'width' => '100px', 'align' => 'right'));
     $this->addColumn('category_status', array('index' => 'category_status', 'type' => 'options', 'header' => $this->__('Status'), 'align' => 'left', 'width' => '100px', 'options' => AW_Kbase_Model_Source_Status::toShortOptionArray()));
     $this->addColumn('action', array('header' => $this->__('Action'), 'width' => '80px', 'type' => 'action', 'getter' => 'getId', 'actions' => array(array('caption' => $this->__('Edit'), 'url' => array('base' => '*/*/edit'), 'field' => 'id')), 'filter' => false, 'sortable' => false, 'index' => 'category_id', 'is_system' => true));
     // $this->addExportType('*/*/exportCsv', $this->__('CSV'));
     // $this->addExportType('*/*/exportXml', $this->__('XML'));
     return parent::_prepareColumns();
 }
示例#2
0
 protected function _prepareColumns()
 {
     $this->addColumn('article_title', array('index' => 'article_title', 'header' => $this->__('Title')));
     $this->addColumn('article_author', array('index' => 'u_name', 'header' => $this->__('Author'), 'filter_condition_callback' => array($this, '_filterAuthorCondition')));
     $categoryOptions = AW_Kbase_Model_Mysql4_Category::getCategories();
     $allOptions = array(0 => $this->__('No category'));
     foreach ($categoryOptions as $key => $value) {
         $allOptions[$key] = $value;
     }
     $this->addColumn('categories', array('index' => 'category_ids', 'type' => 'options', 'header' => $this->__('Categories'), 'renderer' => 'AW_Kbase_Block_Adminhtml_Grid_Column_Multiselect', 'options' => $allOptions, 'value_separator' => ',', 'line_separator' => '<br>', 'filter_condition_callback' => array($this, '_filterCategoryCondition')));
     if (!Mage::app()->isSingleStoreMode()) {
         $this->addColumn('store_ids', array('header' => $this->__('Store views'), 'index' => 'store_ids', 'type' => 'store', 'filter' => false, 'store_all' => true, 'store_view' => true, 'sortable' => false));
     }
     $this->addColumn('article_rating', array('index' => 'article_rating', 'type' => 'number', 'header' => $this->__('Rating'), 'width' => '50px', 'align' => 'right', 'renderer' => 'AW_Kbase_Block_Adminhtml_Grid_Column_Rating'));
     $this->addColumn('article_rating_votes', array('index' => 'article_rating_votes', 'type' => 'number', 'header' => $this->__('Votes'), 'width' => '50px', 'align' => 'right'));
     $this->addColumn('article_status', array('index' => 'article_status', 'type' => 'options', 'header' => $this->__('Status'), 'width' => '80px', 'options' => AW_Kbase_Model_Source_Status::toShortOptionArray()));
     $this->addColumn('article_date_created', array('index' => 'article_date_created', 'header' => $this->__('Created at'), 'width' => '120px', 'type' => 'datetime'));
     $this->addColumn('article_date_updated', array('index' => 'article_date_updated', 'header' => $this->__('Updated at'), 'width' => '120px', 'type' => 'datetime'));
     $this->addColumn('action', array('header' => $this->__('Action'), 'width' => '50px', 'type' => 'action', 'getter' => 'getId', 'actions' => array(array('caption' => $this->__('Edit'), 'url' => array('base' => '*/*/edit'), 'field' => 'id')), 'filter' => false, 'sortable' => false, 'index' => 'article_id', 'is_system' => true));
     // $this->addExportType('*/*/exportCsv', $this->__('CSV'));
     // $this->addExportType('*/*/exportXml', $this->__('XML'));
     return parent::_prepareColumns();
 }