Public Member Functions | |
render (Varien_Object $row) | |
Protected Member Functions | |
_getStoreModel () | |
_getShowAllStoresLabelFlag () | |
Protected Attributes | |
$_skipAllStoresLabel = false |
Definition at line 35 of file Store.php.
_getShowAllStoresLabelFlag | ( | ) | [protected] |
_getStoreModel | ( | ) | [protected] |
Retrieve System Store model
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
Varien_Object | $row |
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) : ' '; 00100 }