Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature: added support for type "label" to system.xml #3849

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading