Mage_Adminhtml_Block_Customer_Online_Grid Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Customer_Online_Grid:

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


Detailed Description

Definition at line 34 of file Grid.php.


Constructor & Destructor Documentation

__construct (  ) 

Initialize Grid block

Reimplemented from Varien_Object.

Definition at line 40 of file Grid.php.

00041     {
00042         parent::__construct();
00043         $this->setId('onlineGrid');
00044         $this->setSaveParametersInSession(true);
00045         $this->setDefaultSort('last_activity');
00046         $this->setDefaultDir('DESC');
00047     }


Member Function Documentation

_prepareCollection (  )  [protected]

Prepare collection for grid

Returns:
Mage_Adminhtml_Block_Customer_Online_Grid

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 54 of file Grid.php.

00055     {
00056         $collection = Mage::getModel('log/visitor_online')
00057             ->prepare()
00058             ->getCollection();
00059         /* @var $collection Mage_Log_Model_Mysql4_Visitor_Online_Collection */
00060         $collection->addCustomerData();
00061 
00062         $this->setCollection($collection);
00063         parent::_prepareCollection();
00064 
00065         return $this;
00066     }

_prepareColumns (  )  [protected]

Prepare columns

Returns:
Mage_Adminhtml_Block_Customer_Online_Grid

Reimplemented from Mage_Adminhtml_Block_Widget_Grid.

Definition at line 73 of file Grid.php.

00074     {
00075         $this->addColumn('customer_id', array(
00076             'header'    => Mage::helper('customer')->__('ID'),
00077             'width'     => '40px',
00078             'align'     => 'right',
00079             'type'      => 'number',
00080             'default'   => Mage::helper('customer')->__('n/a'),
00081             'index'     => 'customer_id'
00082         ));
00083 
00084         $this->addColumn('firstname', array(
00085             'header'    => Mage::helper('customer')->__('First Name'),
00086             'default'   => Mage::helper('customer')->__('Guest'),
00087             'index'     => 'customer_firstname'
00088         ));
00089 
00090         $this->addColumn('lastname', array(
00091             'header'    => Mage::helper('customer')->__('Last Name'),
00092             'default'   => Mage::helper('customer')->__('n/a'),
00093             'index'     => 'customer_lastname'
00094         ));
00095 
00096         $this->addColumn('email', array(
00097             'header'    => Mage::helper('customer')->__('Email'),
00098             'default'   => Mage::helper('customer')->__('n/a'),
00099             'index'     => 'customer_email'
00100         ));
00101 
00102         $this->addColumn('ip_address', array(
00103             'header'    => Mage::helper('customer')->__('IP Address'),
00104             'default'   => Mage::helper('customer')->__('n/a'),
00105             'index'     => 'remote_addr',
00106             'renderer'  => 'adminhtml/customer_online_grid_renderer_ip',
00107             'filter'    => false,
00108             'sort'      => false
00109         ));
00110 
00111         $this->addColumn('session_start_time', array(
00112             'header'    => Mage::helper('customer')->__('Session Start Time'),
00113             'align'     => 'left',
00114             'width'     => '200px',
00115             'type'      => 'datetime',
00116             'default'   => Mage::helper('customer')->__('n/a'),
00117             'index'     =>'first_visit_at'
00118         ));
00119 
00120         $this->addColumn('last_activity', array(
00121             'header'    => Mage::helper('customer')->__('Last Activity'),
00122             'align'     => 'left',
00123             'width'     => '200px',
00124             'type'      => 'datetime',
00125             'default'   => Mage::helper('customer')->__('n/a'),
00126             'index'     => 'last_visit_at'
00127         ));
00128 
00129         $typeOptions = array(
00130             Mage_Log_Model_Visitor::VISITOR_TYPE_CUSTOMER => Mage::helper('customer')->__('Customer'),
00131             Mage_Log_Model_Visitor::VISITOR_TYPE_VISITOR  => Mage::helper('customer')->__('Visitor'),
00132         );
00133 
00134         $this->addColumn('type', array(
00135             'header'    => Mage::helper('customer')->__('Type'),
00136             'index'     => 'type',
00137             'type'      => 'options',
00138             'options'   => $typeOptions,
00139 //            'renderer'  => 'adminhtml/customer_online_grid_renderer_type',
00140             'index'     => 'visitor_type'
00141         ));
00142 
00143         $this->addColumn('last_url', array(
00144             'header'    => Mage::helper('customer')->__('Last Url'),
00145             'type'      => 'wrapline',
00146             'lineLength' => '60',
00147             'default'   => Mage::helper('customer')->__('n/a'),
00148             'renderer'  => 'adminhtml/customer_online_grid_renderer_url',
00149             'index'     => 'last_url'
00150         ));
00151 
00152         return parent::_prepareColumns();
00153     }

getRowUrl ( row  ) 

Retrieve Row URL

Parameters:
Mage_Core_Model_Abstract 
Returns:
string

Definition at line 161 of file Grid.php.

00162     {
00163         return $row->getCustomerId() ? $this->getUrl('*/customer/edit', array('id' => $row->getCustomerId())) : '';
00164     }


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

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