Skip to content

Commit 8e57b69

Browse files
committed
refactor source code issue 24147
1 parent 86434a2 commit 8e57b69

File tree

1 file changed

+15
-5
lines changed
  • app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main

1 file changed

+15
-5
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,7 @@ protected function _prepareForm()
5050

5151
/** @var \Magento\Framework\Data\Form $form */
5252
$form = $this->_formFactory->create();
53-
if (!$this->getRequest()->getParam('id', false)) {
54-
$fieldset = $form->addFieldset('set_name', ['legend' => __('Attribute Set Information')]);
55-
} else {
56-
$fieldset = $form->addFieldset('set_name', ['legend' => __('Edit Attribute Set Name')]);
57-
}
53+
$fieldset = $form->addFieldset('set_name', ['legend' => $this->getAttributeSetLabel()]);
5854
$fieldset->addField(
5955
'attribute_set_name',
6056
'text',
@@ -95,4 +91,18 @@ protected function _prepareForm()
9591
$form->setOnsubmit('return false;');
9692
$this->setForm($form);
9793
}
94+
95+
/**
96+
* Get Attribute Set Label
97+
*
98+
* @return \Magento\Framework\Phrase
99+
*/
100+
private function getAttributeSetLabel()
101+
{
102+
if ($this->getRequest()->getParam('id', false)) {
103+
return __('Edit Attribute Set Name');
104+
}
105+
106+
return __('Attribute Set Information');
107+
}
98108
}

0 commit comments

Comments
 (0)