Skip to content

Commit

Permalink
New feature: added support for type "label" to system.xml (#3849)
Browse files Browse the repository at this point in the history
  • Loading branch information
fballiano authored Feb 27, 2024
1 parent 3f6db4d commit 6f441b5
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class Mage_Adminhtml_Block_System_Config_Form_Field_Heading extends Mage_Adminht
*/
public function render(Varien_Data_Form_Element_Abstract $element)
{
$useContainerId = $element->getData('use_container_id');
return sprintf(
'<tr class="system-fieldset-sub-head" id="row_%s"><td colspan="5"><h4 id="%s">%s</h4></td></tr>',
$element->getHtmlId(),
Expand Down
44 changes: 44 additions & 0 deletions lib/Varien/Data/Form/Element/Info.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* OpenMage
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available at https://opensource.org/license/osl-3-0-php
*
* @category Varien
* @package Varien_Data
* @copyright Copyright (c) 2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/**
* @category Varien
* @package Varien_Data
*/
class Varien_Data_Form_Element_Info extends Varien_Data_Form_Element_Abstract
{
/**
* @param array $attributes
*/
public function __construct($attributes = [])
{
parent::__construct($attributes);
$this
->setType('info')
->unsScope()
->unsCanUseDefaultValue()
->unsCanUseWebsiteValue();
}

/**
* @return string
*/
public function getHtml()
{
$id = $this->getHtmlId();
$label = $this->getLabel();
$html = '<tr class="' . $id . '"><td class="label" colspan="99"><label>' . $label . '</label></td></tr>';
return $html;
}
}
2 changes: 1 addition & 1 deletion skin/adminhtml/default/default/boxes.css
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ select.multiselect option { padding:3px 4px; border-bottom:1px solid #ddd;
.form-list td.hidden { border:0 !important; padding:0 !important; background:0 !important; }
.form-list td.label { width:200px; }
.form-list td.use-default label { display:inline-block; vertical-align:middle; padding:0 3px; }
.form-list td.label label { display:block; width:185px; padding-right:15px; padding-top:1px; }
.form-list td.label label { display:block; padding-right:15px; padding-top:1px; }
.form-list td.value input.input-text,
.form-list td.value textarea { width:274px; }
.form-list td.value textarea { height:15em; }
Expand Down

0 comments on commit 6f441b5

Please sign in to comment.