Example #1
0
 public function render(Varien_Object $row)
 {
     if (!$this->getColumn()->getDisplayNotSet()) {
         $row->setData($this->getColumn()->getIndex(), explode(',', $row->getData($this->getColumn()->getIndex())));
         return parent::render($row);
     }
     $out = '';
     $skipAllStoresLabel = $this->_getShowAllStoresLabelFlag();
     $skipEmptyStoresLabel = $this->_getShowEmptyStoresLabelFlag();
     $origStores = $row->getData($this->getColumn()->getIndex());
     if (is_null($origStores) && $row->getStoreName()) {
         $scopes = array();
         foreach (explode("\n", $row->getStoreName()) as $k => $label) {
             $scopes[] = str_repeat(' ', $k * 3) . $label;
         }
         $out .= implode('<br/>', $scopes) . $this->__(' [deleted]');
         return $out;
     }
     if (empty($origStores) && !$skipEmptyStoresLabel) {
         return '';
     }
     if (!is_array($origStores)) {
         $origStores = array($origStores);
     }
     if (empty($origStores)) {
         return '';
     } elseif (in_array('_notset_', $origStores)) {
         return Mage::helper('adminhtml')->__('Not Visible');
     } elseif (in_array(0, $origStores) && count($origStores) == 1 && !$skipAllStoresLabel) {
         return Mage::helper('adminhtml')->__('All Store Views');
     }
     $data = $this->_getStoreModel()->getStoresStructure(false, $origStores);
     foreach ($data as $website) {
         $out .= $website['label'] . '<br/>';
         foreach ($website['children'] as $group) {
             $out .= str_repeat('&nbsp;', 3) . $group['label'] . '<br/>';
             foreach ($group['children'] as $store) {
                 $out .= str_repeat('&nbsp;', 6) . $store['label'] . '<br/>';
             }
         }
     }
     return $out;
 }
Example #2
0
 public function render(Varien_Object $row)
 {
     return $row->getData($this->getColumn()->getIndex()) == 0 ? Mage::helper('giftcard')->__('All Store Views') : parent::render($row);
 }
Example #3
0
 public function render(Varien_Object $row)
 {
     $value = $row->getData($this->getColumn()->getIndex());
     $row->setData($this->getColumn()->getIndex(), explode(',', $value));
     return parent::render($row);
 }