Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Store Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Store:

Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract Mage_Adminhtml_Block_Abstract Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Interface Mage_Core_Block_Template Mage_Core_Block_Abstract Varien_Object

List of all members.

Public Member Functions

 render (Varien_Object $row)

Protected Member Functions

 _getStoreModel ()
 _getShowAllStoresLabelFlag ()

Protected Attributes

 $_skipAllStoresLabel = false


Detailed Description

Definition at line 35 of file Store.php.


Member Function Documentation

_getShowAllStoresLabelFlag (  )  [protected]

Definition at line 49 of file Store.php.

00050     {
00051         return $this->getColumn()->getData('skipAllStoresLabel')?$this->getColumn()->getData('skipAllStoresLabel'):$this->_skipAllStoresLabel;
00052     }

_getStoreModel (  )  [protected]

Retrieve System Store model

Returns:
Mage_Adminhtml_Model_System_Store

Definition at line 44 of file Store.php.

00045     {
00046         return Mage::getSingleton('adminhtml/system_store');
00047     }

render ( Varien_Object row  ) 

Render row store views

Parameters:
Varien_Object $row
Returns:
string

Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract.

Definition at line 60 of file Store.php.

00061     {
00062         $skipAllStoresLabel = $this->_getShowAllStoresLabelFlag();
00063         $origStores = $row->getData($this->getColumn()->getIndex());
00064         $showNumericStores = (bool)$this->getColumn()->getShowNumericStores();
00065         $stores = array();
00066         if (!is_array($origStores)) {
00067             $origStores = array($origStores);
00068         }
00069         foreach ($origStores as $origStore) {
00070             if (is_numeric($origStore)) {
00071                 if (0 == $origStore) {
00072                     if (!$skipAllStoresLabel) {
00073                         $stores[] = Mage::helper('adminhtml')->__('All Store Views');
00074                     }
00075                 }
00076                 elseif ($storeName = $this->_getStoreModel()->getStoreName($origStore)) {
00077                     if ($this->getColumn()->getStoreView()) {
00078                         $store = $this->_getStoreModel()->getStoreNameWithWebsite($origStore);
00079                     } else {
00080                         $store = $this->_getStoreModel()->getStoreNamePath($origStore);
00081                     }
00082                     $layers = array();
00083                     foreach (explode('/', $store) as $key => $value) {
00084                         $layers[] = str_repeat(" ", $key * 3) . $value;
00085                     }
00086                     $stores[] = implode('<br/>', $layers);
00087                 }
00088                 elseif ($showNumericStores) {
00089                     $stores[] = $origStore;
00090                 }
00091             }
00092             elseif (is_null($origStore) && $row->getStoreName()) {
00093                 $stores[] = $row->getStoreName() . ' ' . $this->__('[deleted]');
00094             }
00095             else {
00096                 $stores[] = $origStore;
00097             }
00098         }
00099         return $stores ? join('<br/> ', $stores) : '&nbsp;';
00100     }


Member Data Documentation

$_skipAllStoresLabel = false [protected]

Definition at line 37 of file Store.php.


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

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