Mage_Adminhtml_Block_Customer_Edit_Tab_Tag Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Customer_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 34 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         $this->setFilterVisibility(false);
00045     }


Member Function Documentation

_afterLoadCollection (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 62 of file Tag.php.

00063     {
00064             $this->getCollection()->addProductName();
00065         return parent::_afterLoadCollection();
00066     }

_prepareCollection (  )  [protected]

Prepare grid collection object

Returns:
this

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 47 of file Tag.php.

00048     {
00049         $tagId = Mage::registry('tagId');
00050 
00051         if( $this->getCustomerId() instanceof Mage_Customer_Model_Customer ) {
00052             $this->setCustomerId( $this->getCustomerId()->getId() );
00053         }
00054 
00055         $collection = Mage::getResourceModel('tag/customer_collection')
00056             ->addCustomerFilter($this->getCustomerId());
00057 
00058         $this->setCollection($collection);
00059         return parent::_prepareCollection();
00060     }

_prepareColumns (  )  [protected]

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 68 of file Tag.php.

00069     {
00070         $this->addColumn('name', array(
00071             'header'    => Mage::helper('customer')->__('Tag Name'),
00072             'index'     => 'name',
00073         ));
00074 
00075         $this->addColumn('status', array(
00076             'header'    => Mage::helper('customer')->__('Status'),
00077             'width'     => '90px',
00078             'index'     => 'status',
00079             'type'      => 'options',
00080             'options'    => array(
00081                 Mage_Tag_Model_Tag::STATUS_DISABLED => Mage::helper('customer')->__('Disabled'),
00082                 Mage_Tag_Model_Tag::STATUS_PENDING  => Mage::helper('customer')->__('Pending'),
00083                 Mage_Tag_Model_Tag::STATUS_APPROVED => Mage::helper('customer')->__('Approved'),
00084             ),
00085             'filter'    => false,
00086         ));
00087 
00088         $this->addColumn('product', array(
00089             'header'    => Mage::helper('customer')->__('Product Name'),
00090             'index'     => 'product',
00091             'filter'    => false,
00092             'sortable'  => false,
00093         ));
00094 
00095         $this->addColumn('product_sku', array(
00096             'header'    => Mage::helper('customer')->__('SKU'),
00097             'index'     => 'product_sku',
00098             'filter'    => false,
00099             'sortable'  => false,
00100         ));
00101 
00102         return parent::_prepareColumns();
00103     }

getGridUrl (  ) 

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 113 of file Tag.php.

00114     {
00115         return $this->getUrl('*/customer/tagGrid', array(
00116             '_current' => true,
00117             'id'       => $this->getCustomerId()
00118         ));
00119     }

getRowUrl ( row  )  [protected]

Definition at line 105 of file Tag.php.

00106     {
00107         return $this->getUrl('*/tag/edit', array(
00108             'tag_id' => $row->getTagId(),
00109             'customer_id' => $this->getCustomerId(),
00110         ));
00111     }


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

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