Public Member Functions | |
__construct () | |
getGridUrl () | |
Protected Member Functions | |
_prepareCollection () | |
_prepareColumns () | |
_prepareMassaction () | |
_getStore () |
Definition at line 34 of file Item.php.
__construct | ( | ) |
Constructor
By default is looking for first argument as array and assignes it as object attributes This behaviour may change in child classes
Reimplemented from Varien_Object.
Definition at line 36 of file Item.php.
00037 { 00038 parent::__construct(); 00039 $this->setId('items'); 00040 $this->setUseAjax(true); 00041 }
_getStore | ( | ) | [protected] |
Definition at line 188 of file Item.php.
00189 { 00190 return Mage::app()->getStore($this->getRequest()->getParam('store')); 00191 }
_prepareCollection | ( | ) | [protected] |
Prepare grid collection object
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 43 of file Item.php.
00044 { 00045 $collection = Mage::getResourceModel('googlebase/item_collection'); 00046 $store = $this->_getStore(); 00047 $collection->addStoreFilterId($store->getId()); 00048 $this->setCollection($collection); 00049 parent::_prepareCollection(); 00050 return $this; 00051 }
_prepareColumns | ( | ) | [protected] |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 53 of file Item.php.
00054 { 00055 $this->addColumn('name', 00056 array( 00057 'header' => $this->__('Product Name'), 00058 'width' => '30%', 00059 'index' => 'name', 00060 )); 00061 00062 $this->addColumn('gbase_item_id', 00063 array( 00064 'header' => $this->__('Google Base ID'), 00065 'width' => '150px', 00066 'index' => 'gbase_item_id', 00067 'renderer' => 'googlebase/adminhtml_items_renderer_id', 00068 00069 )); 00070 00071 $this->addColumn('gbase_itemtype', 00072 array( 00073 'header' => $this->__('Google Base Item Type'), 00074 'width' => '150px', 00075 'index' => 'gbase_itemtype', 00076 )); 00077 00078 // $this->addColumn('published', 00079 // array( 00080 // 'header'=> $this->__('Published'), 00081 // 'type' => 'datetime', 00082 // 'width' => '100px', 00083 // 'index' => 'published', 00084 // )); 00085 00086 $this->addColumn('expires', 00087 array( 00088 'header' => $this->__('Expires'), 00089 'type' => 'datetime', 00090 'width' => '100px', 00091 'index' => 'expires', 00092 )); 00093 00094 $this->addColumn('impr', 00095 array( 00096 'header' => $this->__('Impr.'), 00097 'width' => '150px', 00098 'index' => 'impr', 00099 'filter' => false, 00100 )); 00101 00102 $this->addColumn('clicks', 00103 array( 00104 'header' => $this->__('Clicks'), 00105 'width' => '150px', 00106 'index' => 'clicks', 00107 'filter' => false, 00108 )); 00109 00110 $this->addColumn('views', 00111 array( 00112 'header' => $this->__('Page views'), 00113 'width' => '150px', 00114 'index' => 'views', 00115 'filter' => false, 00116 )); 00117 00118 $this->addColumn('active', 00119 array( 00120 'header' => $this->__('Active'), 00121 'width' => '150px', 00122 'type' => 'options', 00123 'width' => '70px', 00124 'options' => Mage::getSingleton('googlebase/source_statuses')->getStatuses(), 00125 'index' => 'is_hidden', 00126 )); 00127 00128 return parent::_prepareColumns(); 00129 }
_prepareMassaction | ( | ) | [protected] |
Prepare grid massaction actions
Reimplemented from Mage_Adminhtml_Block_Widget_Grid.
Definition at line 131 of file Item.php.
00132 { 00133 $this->setMassactionIdField('item_id'); 00134 $this->getMassactionBlock()->setFormFieldName('item'); 00135 $this->setNoFilterMassactionColumn(true); 00136 00137 $this->getMassactionBlock()->addItem('delete', array( 00138 'label' => $this->__('Delete'), 00139 'url' => $this->getUrl('*/*/massDelete', array('_current'=>true)), 00140 'confirm' => $this->__('Are you sure?') 00141 )); 00142 00143 $this->getMassactionBlock()->addItem('publish', array( 00144 'label' => $this->__('Publish'), 00145 'url' => $this->getUrl('*/*/massPublish', array('_current'=>true)) 00146 )); 00147 00148 $this->getMassactionBlock()->addItem('unpublish', array( 00149 'label' => $this->__('Hide'), 00150 'url' => $this->getUrl('*/*/massHide', array('_current'=>true)) 00151 )); 00152 00153 $this->getMassactionBlock()->addItem('refresh', array( 00154 'label' => $this->__('Synchronize'), 00155 'url' => $this->getUrl('*/*/refresh', array('_current'=>true)), 00156 'confirm' => $this->__('This action will update items statistics and remove the items which are not available in Google Base. Continue?') 00157 )); 00158 return $this; 00159 }
getGridUrl | ( | ) |