Advertisement
Guest User

Untitled

a guest
Dec 3rd, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.92 KB | None | 0 0
  1. <?php
  2.  
  3. // @codingStandardsIgnoreFile
  4.  
  5. namespace VendorOptionsImportBlockAdminhtmlItemsEditTab;
  6.  
  7.  
  8. use MagentoBackendBlockWidgetFormGeneric;
  9. use MagentoBackendBlockWidgetTabTabInterface;
  10.  
  11.  
  12.  
  13. class Main extends Generic implements TabInterface
  14. {
  15.  
  16. /**
  17. * {@inheritdoc}
  18. */
  19. public function getTabLabel()
  20. {
  21. return __('Item Information');
  22. }
  23.  
  24. /**
  25. * {@inheritdoc}
  26. */
  27. public function getTabTitle()
  28. {
  29. return __('Item Information');
  30. }
  31.  
  32. /**
  33. * {@inheritdoc}
  34. */
  35. public function canShowTab()
  36. {
  37. return true;
  38. }
  39.  
  40. /**
  41. * {@inheritdoc}
  42. */
  43. public function isHidden()
  44. {
  45. return false;
  46. }
  47.  
  48. /**
  49. * Prepare form before rendering HTML
  50. *
  51. * @return $this
  52. * @SuppressWarnings(PHPMD.NPathComplexity)
  53. * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
  54. */
  55. protected function _prepareForm()
  56. {
  57. $model = $this->_coreRegistry->registry('current_pinkblue_optionsimport_items');
  58. /** @var MagentoFrameworkDataForm $form */
  59. $form = $this->_formFactory->create();
  60. $form->setHtmlIdPrefix('item_');
  61. $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Import File Information')]);
  62. if ($model->getId()) {
  63. $fieldset->addField('id', 'hidden', ['name' => 'id']);
  64. }
  65. $fieldset->addField(
  66. 'pbimport',
  67. 'text',
  68. ['name' => 'pbimport', 'label' => __('Import File Name'), 'title' => __('File Name'), 'required' => true ]
  69. );
  70.  
  71. $fieldset->addField(
  72. 'file',
  73. 'file',
  74. [
  75. 'name' => 'file',
  76. 'label' => __('NewOptions'),
  77. 'title' => __('New Options'),
  78. 'required' => true,
  79.  
  80. ]
  81. );
  82.  
  83. $form->setValues($model->getData());
  84. $this->setForm($form);
  85. return parent::_prepareForm();
  86. }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement