Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text Class Reference

Inheritance diagram for Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text:

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 Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Options Mage_Adminhtml_Block_Extensions_Local_Grid_Renderer_Action Mage_Adminhtml_Block_Extensions_Remote_Grid_Renderer_Action Mage_Adminhtml_Block_Newsletter_Queue_Grid_Renderer_Action Mage_Adminhtml_Block_Newsletter_Template_Grid_Renderer_Action Mage_Adminhtml_Block_Sitemap_Grid_Renderer_Action Mage_Adminhtml_Block_System_Email_Template_Grid_Renderer_Action

List of all members.

Public Member Functions

 _getValue (Varien_Object $row)

Protected Attributes

 $_variablePattern = '/\\$([a-z0-9_]+)/i'


Detailed Description

Definition at line 35 of file Text.php.


Member Function Documentation

_getValue ( Varien_Object row  ) 

Renders grid column

Parameters:
Varien_Object $row
Returns:
mixed

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     }


Member Data Documentation

$_variablePattern = '/\\$([a-z0-9_]+)/i' [protected]

Definition at line 42 of file Text.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