Skip to content

Commit

Permalink
[bug-OpenMage#14] Typo and missing functions in Mage_Page_Block_Templ…
Browse files Browse the repository at this point in the history
…ate_Links_Block
  • Loading branch information
Syam Mohan authored and edannenberg committed Apr 1, 2019
1 parent 5e3c938 commit 2772372
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions app/code/core/Mage/Page/Block/Template/Links/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}

}

0 comments on commit 2772372

Please sign in to comment.