![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/amasty/feed/Block/Adminhtml/Category/Edit/Tab/ |
<?php /** * @author Amasty Team * @copyright Copyright (c) Amasty (https://www.amasty.com) * @package Product Feed for Magento 2 */ namespace Amasty\Feed\Block\Adminhtml\Category\Edit\Tab; use Magento\Backend\Block\Widget\Form; use Magento\Backend\Block\Widget\Form\Generic; use Magento\Backend\Block\Widget\Tab\TabInterface; class General extends Generic implements TabInterface { public const HTML_ID_PREFIX = 'feed_category_'; public function getTabLabel() { return __('General'); } /** * Prepare title for tab * * @return \Magento\Framework\Phrase * @codeCoverageIgnore */ public function getTabTitle() { return __('General'); } /** * Returns status flag about this tab can be showed or not * * @return bool * @codeCoverageIgnore */ public function canShowTab() { return true; } /** * Returns status flag about this tab hidden or not * * @return bool * @codeCoverageIgnore */ public function isHidden() { return false; } /** * @return Form * @SuppressWarnings(PHPMD.ExcessiveMethodLength) */ protected function _prepareForm() { $model = $this->_coreRegistry->registry('current_amfeed_category'); /** @var \Magento\Framework\Data\Form $form */ $form = $this->_formFactory->create(); $form->setHtmlIdPrefix(self::HTML_ID_PREFIX); $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('General Information')]); if ($model->getId()) { $fieldset->addField('feed_category_id', 'hidden', ['name' => 'feed_category_id']); } else { $model->setData('is_active', 1); } $fieldset->addField( 'code', 'text', [ 'name' => 'code', 'label' => __('Code'), 'title' => __('Code'), 'required' => true ] ); $fieldset->addField( 'name', 'text', [ 'name' => 'name', 'label' => __('Name'), 'title' => __('Name'), 'required' => true ] ); $form->addValues($model->getData()); $this->setForm($form); return parent::_prepareForm(); } }