Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Tag Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Tag:

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 ()
 getGridUrl ()

Protected Member Functions

 _prepareCollection ()
 _afterLoadCollection ()
 _prepareColumns ()
 getRowUrl ($row)


Detailed Description

Definition at line 35 of file Tag.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 Tag.php.

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


Member Function Documentation

_afterLoadCollection (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 58 of file Tag.php.

00059     {
00060         return parent::_afterLoadCollection();
00061     }

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 46 of file Tag.php.

00047     {
00048         $tagId = Mage::registry('tagId');
00049         $collection = Mage::getModel('tag/tag')
00050             ->getResourceCollection()
00051             ->addProductFilter($this->getProductId())
00052             ->addPopularity($tagId);
00053 
00054         $this->setCollection($collection);
00055         return parent::_prepareCollection();
00056     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 63 of file Tag.php.

00064     {
00065         $this->addColumn('name', array(
00066             'header'    => Mage::helper('catalog')->__('Tag Name'),
00067             'index'     => 'name',
00068         ));
00069 
00070         $this->addColumn('popularity', array(
00071             'header'        => Mage::helper('catalog')->__('# of Use'),
00072             'width'         => '50px',
00073             'align'         => 'right',
00074             'index'         => 'popularity',
00075             'type'          => 'number',
00076         ));
00077 
00078         $this->addColumn('status', array(
00079             'header'    => Mage::helper('catalog')->__('Status'),
00080             'width'     => '90px',
00081             'index'     => 'status',
00082             'type'      => 'options',
00083             'options'    => array(
00084                 Mage_Tag_Model_Tag::STATUS_DISABLED => Mage::helper('catalog')->__('Disabled'),
00085                 Mage_Tag_Model_Tag::STATUS_PENDING  => Mage::helper('catalog')->__('Pending'),
00086                 Mage_Tag_Model_Tag::STATUS_APPROVED => Mage::helper('catalog')->__('Approved'),
00087             ),
00088         ));
00089 
00090         return parent::_prepareColumns();
00091     }

getGridUrl (  ) 

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 101 of file Tag.php.

00102     {
00103         return $this->getUrl('*/catalog_product/tagGrid', array(
00104             '_current' => true,
00105             'id'       => $this->getProductId(),
00106             'product_id' => $this->getProductId(),
00107         ));
00108     }

getRowUrl ( row  )  [protected]

Definition at line 93 of file Tag.php.

00094     {
00095         return $this->getUrl('*/tag/edit', array(
00096             'tag_id' => $row->getId(),
00097             'product_id' => $this->getProductId(),
00098         ));
00099     }


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

Generated on Sat Jul 4 17:22:46 2009 for Magento by  doxygen 1.5.8