Guest User

Untitled

a guest
May 23rd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.11 KB | None | 0 0
  1. {"name": "bbc/ProdAdmin",
  2. "description": "A module that creates a page in the Magento admin area",
  3. "type": "magento2-module",
  4. "version": "1.0.0",
  5. "license": [
  6. "OSL-3.0",
  7. "AFL-3.0"
  8. ],
  9. "require": {
  10. "php": "~5.6.0|7.0.2|7.0.4|~7.0.6"
  11. },
  12. "autoload": {
  13. "files": [ "registration.php" ],
  14. "psr-4": {
  15. "BBC\ProdAdmin\": ""
  16. }
  17. }}
  18.  
  19. <?php
  20. MagentoFrameworkComponentComponentRegistrar::register(
  21. MagentoFrameworkComponentComponentRegistrar::MODULE,
  22. 'BBC_ProdAdmin',
  23. __DIR__
  24. );
  25.  
  26. <?xml version="1.0"?>
  27. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
  28. <module name="BBC_ProdAdmin" setup_version="1.0.0">
  29. </module>
  30. </config>
  31.  
  32. <?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
  33. <menu>
  34. <add id="BBC_ProdAdmin::greetings" title="Prod Admin Panel" translate="title" module="BBC_ProdAdmin" parent="Magento_Backend::content" sortOrder="50" dependsOnModule="BBC_ProdAdmin" resource="BBC_ProdAdmin::greetings"/>
  35. <add id="BBC_ProdAdmin::greetings_helloworld" title="Admin Access" translate="title" module="BBC_ProdAdmin" parent="BBC_ProdAdmin::greetings" sortOrder="10" dependsOnModule="BBC_ProdAdmin" action="prodadmin/ProdAdminControl" resource="BBC_ProdAdmin::greetings"/>
  36. </menu>
  37. </config>
  38.  
  39. <?xml version="1.0"?><config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
  40. <router id="admin">
  41. <route id="prodadmin" frontName="prodadmin">
  42. <module name="BBC_ProdAdmin"/>
  43. </route>
  44. </router>
  45.  
  46. <?php namespace BBCProdAdminControllerAdminhtmlProdAdminControl;
  47.  
  48. class Index extends MagentoBackendAppAction
  49. {
  50. /**
  51. * @var MagentoFrameworkViewResultPageFactory
  52. */
  53. protected $resultPageFactory;
  54.  
  55. /**
  56. * Constructor
  57. *
  58. * @param MagentoBackendAppActionContext $context
  59. * @param MagentoFrameworkViewResultPageFactory $resultPageFactory
  60. */
  61. public function __construct(
  62. MagentoBackendAppActionContext $context,
  63. MagentoFrameworkViewResultPageFactory $resultPageFactory
  64. ) {
  65. parent::__construct($context);
  66. $this->resultPageFactory = $resultPageFactory;
  67. }
  68.  
  69. /**
  70. * Load the page defined in view/adminhtml/layout/exampleadminnewpage_helloworld_index.xml
  71. *
  72. * @return MagentoFrameworkViewResultPage
  73. */
  74. public function execute()
  75. {
  76. return $resultPage = $this->resultPageFactory->create();
  77. }
  78. }
  79. ?>
  80.  
  81. <?xml version="1.0"?><page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
  82. <head>
  83. <title>
  84. Product Admin Access
  85. </title>
  86. </head>
  87. <body>
  88. <referenceContainer name="content">
  89. <block class="MagentoBackendBlockTemplate" template="BBC_ProdAdmin::AdminAccess.phtml"/>
  90. </referenceContainer>
  91. </body>
  92. </page>
  93.  
  94. <p>Hello World!</p>
Add Comment
Please, Sign In to add comment