Mage_Adminhtml_Block_Tag_Grid_Pending Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Tag_Grid_Pending:

Mage_Adminhtml_Block_Widget_Grid Mage_Adminhtml_Block_Widget Mage_Adminhtml_Block_Template Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 __construct ()
 getRowUrl ($row)

Protected Member Functions

 _prepareCollection ()
 _prepareColumns ()
 _addColumnFilterToCollection ($column)
 _prepareMassaction ()


Detailed Description

Definition at line 34 of file Pending.php.


Constructor & Destructor Documentation

__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 37 of file Pending.php.

00038     {
00039         parent::__construct();
00040         $this->setId('pending_grid');
00041         $this->setDefaultSort('name');
00042         $this->setDefaultDir('ASC');
00043     }


Member Function Documentation

_addColumnFilterToCollection ( column  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 163 of file Pending.php.

00164     {
00165          if($column->getIndex()=='stores') {
00166                 $this->getCollection()->addStoreFilter($column->getFilter()->getCondition(), false);
00167          } else {
00168                 parent::_addColumnFilterToCollection($column);
00169          }
00170 
00171          return $this;
00172     }

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 45 of file Pending.php.

00046     {
00047         $collection = Mage::getResourceModel('tag/tag_collection')
00048             ->addSummary(0)
00049             ->addStoresVisibility()
00050             ->addStatusFilter(Mage_Tag_Model_Tag::STATUS_PENDING);
00051         $this->setCollection($collection);
00052         return parent::_prepareCollection();
00053     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 55 of file Pending.php.

00056     {
00057         $baseUrl = $this->getUrl();
00058 
00059         $this->addColumn('name', array(
00060             'header'    => Mage::helper('tag')->__('Tag'),
00061             'index'     => 'name',
00062         ));
00063 
00064         $this->addColumn('total_used', array(
00065             'header'    => Mage::helper('tag')->__('Uses'),
00066             'width'     => '140px',
00067             'align'     => 'right',
00068             'index'     => 'uses',
00069             'type'      => 'number',
00070         ));
00071 
00072         $this->addColumn('products', array(
00073             'header'    => Mage::helper('tag')->__('Products'),
00074             'width'     => '140px',
00075             'align'     => 'right',
00076             'index'     => 'products',
00077             'type'      => 'number',
00078         ));
00079 
00080         $this->addColumn('customers', array(
00081             'header'    => Mage::helper('tag')->__('Customers'),
00082             'width'     => '140px',
00083             'align'     => 'right',
00084             'index'     => 'customers',
00085             'type'      => 'number',
00086         ));
00087 
00088         $this->addColumn('popularity', array(
00089             'header'    => Mage::helper('tag')->__('Popularity'),
00090             'width'     => '140px',
00091             'align'     => 'right',
00092             'index'     => 'popularity',
00093             'type'      => 'number',
00094         ));
00095 
00096         /*
00097         $this->addColumn('status', array(
00098             'header'    => Mage::helper('tag')->__('Status'),
00099             'width'     => '90px',
00100             'index'     => 'status',
00101             'type'      => 'options',
00102             'filter'    => false,
00103             'sortable'  => false,
00104             'options'    => array(
00105                 Mage_Tag_Model_Tag::STATUS_DISABLED => Mage::helper('tag')->__('Disabled'),
00106                 Mage_Tag_Model_Tag::STATUS_PENDING  => Mage::helper('tag')->__('Pending'),
00107                 Mage_Tag_Model_Tag::STATUS_APPROVED => Mage::helper('tag')->__('Approved'),
00108             ),
00109         ));
00110         */
00111 
00112           // Collection for stores filters
00113         if (!$collection = Mage::registry('stores_select_collection')) {
00114             $collection =  Mage::app()->getStore()->getResourceCollection()
00115                 ->load();
00116             Mage::register('stores_select_collection', $collection);
00117         }
00118 
00119         if (!Mage::app()->isSingleStoreMode()) {
00120             $this->addColumn('visible_in', array(
00121                 'header'    => Mage::helper('tag')->__('Visible In'),
00122                 'type'      => 'store',
00123                 'index'     => 'stores',
00124                 'sortable'  => false,
00125                 'store_view'=> true
00126             ));
00127         }
00128 
00129         $this->addColumn('actions', array(
00130             'header'    => Mage::helper('tag')->__('Actions'),
00131             'width'     => '100px',
00132             'type'      => 'action',
00133             'sortable'  => false,
00134             'filter'    => false,
00135             'actions'    => array(
00136                 array(
00137                     'caption'   => Mage::helper('tag')->__('Edit Tag'),
00138                     'url'       => $this->getUrl('*/*/edit', array('ret' => 'pending', 'tag_id'=>'$tag_id')),
00139                 ),
00140                 array(
00141                     'caption'   => Mage::helper('tag')->__('View Products'),
00142                     'url'       => $this->getUrl('*/*/product', array('ret' => 'pending', 'tag_id'=>'$tag_id')),
00143                 ),
00144 
00145                 array(
00146                     'caption'   => Mage::helper('tag')->__('View Customers'),
00147                     'url'       => $this->getUrl('*/*/customer', array('ret' => 'pending', 'tag_id'=>'$tag_id')),
00148                 )
00149             ),
00150         ));
00151 
00152         return parent::_prepareColumns();
00153     }

_prepareMassaction (  )  [protected]

Prepare grid massaction actions

Returns:
Mage_Adminhtml_Block_Widget_Grid

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 174 of file Pending.php.

00175     {
00176         $this->setMassactionIdField('tag_id');
00177         $this->getMassactionBlock()->setFormFieldName('tag');
00178 
00179         $this->getMassactionBlock()->addItem('delete', array(
00180              'label'=> Mage::helper('tag')->__('Delete'),
00181              'url'  => $this->getUrl('*/*/massDelete', array('ret' => 'pending')),
00182              'confirm' => Mage::helper('tag')->__('Are you sure?')
00183         ));
00184 
00185         $statuses = $this->helper('tag/data')->getStatusesOptionsArray();
00186 
00187         array_unshift($statuses, array('label'=>'', 'value'=>''));
00188 
00189         $this->getMassactionBlock()->addItem('status', array(
00190              'label'=> Mage::helper('tag')->__('Change status'),
00191              'url'  => $this->getUrl('*/*/massStatus', array('_current'=>true, 'ret' => 'pending')),
00192              'additional' => array(
00193                     'visibility' => array(
00194                          'name' => 'status',
00195                          'type' => 'select',
00196                          'class' => 'required-entry',
00197                          'label' => Mage::helper('tag')->__('Status'),
00198                          'values' => $statuses
00199                      )
00200              )
00201         ));
00202 
00203         return $this;
00204     }

getRowUrl ( row  ) 

Definition at line 155 of file Pending.php.

00156     {
00157         return $this->getUrl('*/*/edit', array(
00158             'tag_id' => $row->getId(),
00159             'ret'    => 'pending',
00160         ));
00161     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:05 2009 for Magento by  doxygen 1.5.8