-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now displays the configuration code (which is used for Mage::getStore…
…Config) with the configuration fields. (Closes #7)
- Loading branch information
1 parent
ae56afd
commit 5b86c92
Showing
4 changed files
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,10 +94,12 @@ public function render(Varien_Data_Form_Element_Abstract $element) | |
if ($element->getScope()) { | ||
$html .= $element->getScopeLabel(); | ||
} | ||
$html .= '<br />'; | ||
$html .= $this->_getConfigCode($element); | ||
$html .= '</td>'; | ||
|
||
$html .= '<td class="scopehint" style="padding: 6px 6px 0 6px;">'; | ||
$html .= $this->_getScopeHint($element); | ||
$html .= $this->_getScopeHintHtml($element); | ||
$html .= '</td>'; | ||
|
||
$html .= '<td class="">'; | ||
|
@@ -112,12 +114,33 @@ public function render(Varien_Data_Form_Element_Abstract $element) | |
return $html; | ||
} | ||
|
||
protected function _getScopeHint($element) | ||
/** | ||
* @param Varien_Data_Form_Element_Abstract $element | ||
* @return string | ||
*/ | ||
protected function _getScopeHintHtml(Varien_Data_Form_Element_Abstract $element) | ||
{ | ||
return $this->getLayout() | ||
->createBlock('scopehint/hint', 'scopehint') | ||
->setElement($element) | ||
->setType('config') | ||
->toHtml(); | ||
} | ||
|
||
/** | ||
* @param Varien_Data_Form_Element_Abstract $element | ||
* @return string | ||
*/ | ||
protected function _getConfigCode(Varien_Data_Form_Element_Abstract $element) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
avstudnitz
Author
Owner
|
||
{ | ||
$configCode = preg_replace('#\[value\](\[\])?$#', '', $element->getName()); | ||
$configCode = str_replace('[fields]', '', $configCode); | ||
$configCode = str_replace('groups[', '[', $configCode); | ||
$configCode = str_replace('][', '/', $configCode); | ||
$configCode = str_replace(']', '', $configCode); | ||
$configCode = str_replace('[', '', $configCode); | ||
$configCode = Mage::app()->getRequest()->getParam('section') . '/' . $configCode; | ||
return $configCode; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
such an ugly function - but if you think that works :-)