From 42bec30b67c5f962b569023953c2856da2ede17f Mon Sep 17 00:00:00 2001 From: Syam Mohan Date: Tue, 5 May 2015 16:39:20 +0530 Subject: [PATCH] [bug-#14] Typo and missing functions in Mage_Page_Block_Template_Links_Block --- .../Mage/Page/Block/Template/Links/Block.php | 46 +++++++++++++++++-- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/app/code/core/Mage/Page/Block/Template/Links/Block.php b/app/code/core/Mage/Page/Block/Template/Links/Block.php index 4ae326fbb6e..6ae7978d874 100644 --- a/app/code/core/Mage/Page/Block/Template/Links/Block.php +++ b/app/code/core/Mage/Page/Block/Template/Links/Block.php @@ -75,14 +75,14 @@ class Mage_Page_Block_Template_Links_Block extends Mage_Core_Block_Template * * @var string */ - protected $_liPparams = null; + protected $_liParams = null; /** * A elemnt params * * @var string */ - protected $_aPparams = null; + protected $_aParams = null; /** * Message before link text @@ -197,5 +197,45 @@ public function getLinkUrl() { return $this->_url; } - + + /** + * Prepare tag attributes + * + * @param string|array $params + * @return string + */ + protected function _prepareParams($params) + { + if (is_string($params)) { + return $params; + } elseif (is_array($params)) { + $result = ''; + foreach ($params as $key=>$value) { + $result .= ' ' . $key . '="' . addslashes($value) . '"'; + } + return $result; + } + return ''; + } + + /** + * Return Li Params + * + * @return string + */ + public function getLiParams() + { + return $this->_prepareParams($this->_liParams); + } + + /** + * Return Link Tag Params + * + * @return string + */ + public function getAParams() + { + return $this->_prepareParams($this->_aParams); + } + }