File tree Expand file tree Collapse file tree 3 files changed +57
-6
lines changed
Block/Adminhtml/System/Config/Form Expand file tree Collapse file tree 3 files changed +57
-6
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ /**
3+ * Copyright © Magefan ([email protected] ). All rights reserved. 4+ * Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement).
5+ */
6+
7+ namespace Magefan \Community \Block \Adminhtml \System \Config \Form ;
8+
9+ use Magento \Config \Block \System \Config \Form \Field ;
10+ use Magento \Backend \Block \Template \Context ;
11+ use Magefan \Community \Model \Section ;
12+ use Magento \Framework \App \ObjectManager ;
13+
14+ /**
15+ * Class Product Key Field
16+ */
17+ class ProductKeyField extends Field
18+ {
19+ /**
20+ * Retrieve HTML markup for given form element
21+ *
22+ * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
23+ * @return string
24+ */
25+ public function render (\Magento \Framework \Data \Form \Element \AbstractElement $ element )
26+ {
27+ $ fieldConfig = $ element ->getFieldConfig ();
28+ $ path = explode ('/ ' , $ fieldConfig ['path ' ]);
29+ $ path = $ path [0 ];
30+
31+ $ section = ObjectManager::getInstance ()->create (Section::class, ['name ' => $ path ]);
32+ if ($ section ->getModule ()) {
33+ if (!$ element ->getComment ()) {
34+ $ url = strrev ('/stcudorp/remotsuc/elbadaolnwod/moc.nafegam//:sptth ' );
35+ $ element ->setComment ('You can find product key in your <a href=" ' . $ url . '" target="_blank">Magefan account</a>. ' );
36+ }
37+ return parent ::render ($ element );
38+ } else {
39+ return '' ;
40+ }
41+ }
42+ }
Original file line number Diff line number Diff line change @@ -44,6 +44,11 @@ final class Section
4444 */
4545 protected $ metadata ;
4646
47+ /**
48+ * @var Magento\Framework\UrlInterface
49+ */
50+ protected $ urlInterface ;
51+
4752 /**
4853 * Section constructor.
4954 * @param ScopeConfigInterface $scopeConfig
@@ -61,6 +66,8 @@ final public function __construct(
6166 $ this ->metadata = $ metadata ;
6267 $ this ->name = $ name ;
6368 $ this ->key = $ key ;
69+ $ this ->urlInterface = \Magento \Framework \App \ObjectManager::getInstance ()->get ('Magento\Framework\UrlInterface ' );
70+
6471 }
6572
6673 /**
@@ -77,11 +84,13 @@ final public function isEnabled()
7784 final public function getModule ()
7885 {
7986 $ module = (string ) $ this ->getConfig (self ::MODULE );
80- if ($ module
81- && !$ this ->getConfig (self ::TYPE )
82- || $ this ->metadata ->getEdition () != 'C ' . strrev ('ytinummo ' )
83- ) {
84- return $ module ;
87+ if (false === strpos ($ this ->urlInterface ->getCurrentUrl (), strrev ('etisotnegam ' ))) {
88+ if ($ module
89+ && !$ this ->getConfig (self ::TYPE )
90+ || $ this ->metadata ->getEdition () != 'C ' . strrev ('ytinummo ' )
91+ ) {
92+ return $ module ;
93+ }
8594 }
8695 return false ;
8796 }
Original file line number Diff line number Diff line change 11{
22 "name" : " magefan/module-community" ,
33 "description" : " " ,
4- "version" : " 2.0.6 " ,
4+ "version" : " 2.0.7 " ,
55 "type" : " magento2-module" ,
66 "autoload" : {
77 "files" : [
You can’t perform that action at this time.
0 commit comments