Public Member Functions | |
render (Varien_Object $row) |
Definition at line 34 of file Options.php.
render | ( | Varien_Object $ | row | ) |
Render a grid cell as options
Varien_Object | $row |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract.
Definition at line 42 of file Options.php.
00043 { 00044 $options = $this->getColumn()->getOptions(); 00045 $showMissingOptionValues = (bool)$this->getColumn()->getShowMissingOptionValues(); 00046 if (!empty($options) && is_array($options)) { 00047 $value = $row->getData($this->getColumn()->getIndex()); 00048 if (is_array($value)) { 00049 $res = array(); 00050 foreach ($value as $item) { 00051 if (isset($options[$item])) { 00052 $res[] = $options[$item]; 00053 } 00054 elseif ($showMissingOptionValues) { 00055 $res[] = $item; 00056 } 00057 } 00058 return implode(', ', $res); 00059 } 00060 elseif (isset($options[$value])) { 00061 return $options[$value]; 00062 } 00063 return ''; 00064 } 00065 }