Public Member Functions | |
_getValue (Varien_Object $row) | |
Protected Attributes | |
$_variablePattern = '/\\$([a-z0-9_]+)/i' |
Definition at line 35 of file Text.php.
_getValue | ( | Varien_Object $ | row | ) |
Renders grid column
Varien_Object | $row |
Reimplemented from Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract.
Definition at line 50 of file Text.php.
00051 { 00052 $format = ( $this->getColumn()->getFormat() ) ? $this->getColumn()->getFormat() : null; 00053 $defaultValue = $this->getColumn()->getDefault(); 00054 if (is_null($format)) { 00055 // If no format and it column not filtered specified return data as is. 00056 $data = parent::_getValue($row); 00057 $string = is_null($data) ? $defaultValue : $data; 00058 return htmlspecialchars($string); 00059 } 00060 elseif (preg_match_all($this->_variablePattern, $format, $matches)) { 00061 // Parsing of format string 00062 $formatedString = $format; 00063 foreach ($matches[0] as $matchIndex=>$match) { 00064 $value = $row->getData($matches[1][$matchIndex]); 00065 $formatedString = str_replace($match, $value, $formatedString); 00066 } 00067 return $formatedString; 00068 } else { 00069 return htmlspecialchars($format); 00070 } 00071 }