6
6
7
7
namespace Magento \Sitemap \Controller \Adminhtml \Sitemap ;
8
8
9
+ use Magento \Backend \App \Action \Context ;
10
+ use Magento \Backend \Block \Template ;
11
+ use Magento \Backend \Model \Session ;
9
12
use Magento \Framework \App \Action \HttpGetActionInterface ;
13
+ use Magento \Framework \Registry ;
14
+ use Magento \Sitemap \Controller \Adminhtml \Sitemap ;
10
15
11
16
/**
12
17
* Controller class Edit. Responsible for rendering of a sitemap edit page
13
18
*/
14
- class Edit extends \ Magento \ Sitemap \ Controller \ Adminhtml \ Sitemap implements HttpGetActionInterface
19
+ class Edit extends Sitemap implements HttpGetActionInterface
15
20
{
16
21
/**
17
22
* Core registry
18
23
*
19
- * @var \Magento\Framework\ Registry
24
+ * @var Registry
20
25
*/
21
- protected $ _coreRegistry = null ;
26
+ protected $ _coreRegistry ;
22
27
23
28
/**
24
- * @param \Magento\Backend\App\Action\ Context $context
25
- * @param \Magento\Framework\ Registry $coreRegistry
29
+ * @param Context $context
30
+ * @param Registry $coreRegistry
26
31
*/
27
- public function __construct (\ Magento \ Backend \ App \ Action \ Context $ context , \ Magento \ Framework \ Registry $ coreRegistry )
32
+ public function __construct (Context $ context , Registry $ coreRegistry )
28
33
{
29
34
$ this ->_coreRegistry = $ coreRegistry ;
30
35
parent ::__construct ($ context );
@@ -53,7 +58,7 @@ public function execute()
53
58
}
54
59
55
60
// 3. Set entered data if was error when we do save
56
- $ data = $ this ->_objectManager ->get (\ Magento \ Backend \ Model \ Session::class)->getFormData (true );
61
+ $ data = $ this ->_objectManager ->get (Session::class)->getFormData (true );
57
62
if (!empty ($ data )) {
58
63
$ model ->setData ($ data );
59
64
}
@@ -67,6 +72,8 @@ public function execute()
67
72
$ id ? __ ('Edit Sitemap ' ) : __ ('New Sitemap ' )
68
73
)->_addContent (
69
74
$ this ->_view ->getLayout ()->createBlock (\Magento \Sitemap \Block \Adminhtml \Edit::class)
75
+ )->_addJs (
76
+ $ this ->_view ->getLayout ()->createBlock (Template::class)->setTemplate ('Magento_Sitemap::js.phtml ' )
70
77
);
71
78
$ this ->_view ->getPage ()->getConfig ()->getTitle ()->prepend (__ ('Site Map ' ));
72
79
$ this ->_view ->getPage ()->getConfig ()->getTitle ()->prepend (
0 commit comments