├── Block └── Adminhtml │ ├── Help.php │ └── System │ └── Config │ └── Form │ └── Info.php ├── Cron └── XmlUpdate.php ├── Model ├── Config.php └── XmlReader.php ├── README.md ├── composer.json ├── etc ├── acl.xml ├── adminhtml │ └── system.xml ├── config.xml ├── crontab.xml └── module.xml ├── registration.php └── view └── adminhtml ├── layout └── default.xml └── templates └── help.phtml /Block/Adminhtml/Help.php: -------------------------------------------------------------------------------- 1 | xmlReader = $xmlReader; 47 | $this->config = $config; 48 | $this->authorization = $authorization; 49 | } 50 | 51 | /** 52 | * @return array 53 | * @throws \Magento\Framework\Exception\FileSystemException 54 | */ 55 | public function getPageHelp() 56 | { 57 | $data = []; 58 | if (!$this->authorization->isAllowed('Magefan_AdminUserGuide::help')) { 59 | return $data; 60 | } 61 | 62 | if ($this->config->isEnabled()) { 63 | $guideData = $this->xmlReader->get(); 64 | 65 | $fullActionName = str_replace('_', '-', $this->getRequest()->getFullActionName()); 66 | $secondActionName = $fullActionName; 67 | 68 | if ('adminhtml-system-config-edit' == $secondActionName) { 69 | $secondActionName .= '-section-' . $this->getRequest()->getParam('section'); 70 | } 71 | 72 | $data = []; 73 | if ($guideData) { 74 | foreach ($guideData as $item) { 75 | if (empty($item['class']) || empty($item['title'])) { 76 | continue; 77 | } 78 | 79 | $classes = explode(' ', $item['class']); 80 | if (in_array($fullActionName, $classes) 81 | || in_array($secondActionName, $classes) 82 | ) { 83 | $links = []; 84 | for ($i = 0; $i <= count($item) - 2; $i++) { 85 | if ($i == 0) { 86 | if (isset($item['link'])) { 87 | $links[] = $item['link']; 88 | } 89 | $i++; 90 | } else { 91 | if (isset($item['link' . $i])) { 92 | $links[] = $item['link' . $i]; 93 | } 94 | } 95 | } 96 | 97 | if (!count($links)) { 98 | continue; 99 | } 100 | 101 | foreach ($links as $klink => $link) { 102 | if (false !== strpos($link, 'magefan.com') && false === strpos($link, 'utm_source')) { 103 | $linkInfo = explode('#', $link); 104 | $linkInfo[0] .= (false !== strpos($linkInfo[0], '?')) ? '&' : '?'; 105 | $linkInfo[0] .= 'utm_source=admin&utm_medium=admin-user-guide&utm_campaign=admin-user-guide'; 106 | $link = implode('#', $linkInfo); 107 | $links[$klink] = $link; 108 | } 109 | } 110 | 111 | $data[] = [ 112 | 'title' => $item['title'], 113 | 'links' => $links 114 | ]; 115 | } 116 | } 117 | } 118 | 119 | } 120 | return $data; 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /Block/Adminhtml/System/Config/Form/Info.php: -------------------------------------------------------------------------------- 1 | xmlReader = $xmlReader; 27 | } 28 | 29 | /** 30 | * @throws \Magento\Framework\Exception\FileSystemException 31 | */ 32 | public function execute() 33 | { 34 | $this->xmlReader->update(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Model/Config.php: -------------------------------------------------------------------------------- 1 | scopeConfig = $scopeConfig; 35 | } 36 | 37 | /** 38 | * Retrieve true if blog module is enabled 39 | * 40 | * @return bool 41 | */ 42 | public function isEnabled($storeId = null) 43 | { 44 | return (bool)$this->getConfig(self::XML_PATH_EXTENSION_ENABLED, $storeId); 45 | } 46 | 47 | /** 48 | * Retrieve store config value 49 | * @param string $path 50 | * @param null $storeId 51 | * @return mixed 52 | */ 53 | public function getConfig($path, $storeId = null) 54 | { 55 | return $this->scopeConfig->getValue( 56 | $path, 57 | ScopeInterface::SCOPE_STORE, 58 | $storeId 59 | ); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Model/XmlReader.php: -------------------------------------------------------------------------------- 1 | cache = $cache; 55 | $this->filesystem = $filesystem; 56 | $this->json = $json; 57 | $this->curl = $curl; 58 | } 59 | 60 | /** 61 | * @return array|bool|float|int|mixed|string|null 62 | * @throws \Magento\Framework\Exception\FileSystemException 63 | */ 64 | public function get() 65 | { 66 | if (!$this->cache->load('magefan_aug_data')) { 67 | $this->readFile(); 68 | } 69 | 70 | try { 71 | return $this->json->unserialize($this->cache->load('magefan_aug_data')); 72 | } catch (\Exception $e) { 73 | return []; 74 | } 75 | } 76 | 77 | /** 78 | * @throws \Magento\Framework\Exception\FileSystemException 79 | */ 80 | private function readFile() 81 | { 82 | $directoryRead = $this->filesystem->getDirectoryRead(DirectoryList::VAR_DIR); 83 | if (!$directoryRead->isExist(self::DATA_FILE_NAME)) { 84 | $this->update(); 85 | } 86 | if (!$directoryRead->isExist(self::DATA_FILE_NAME)) { 87 | return; 88 | } 89 | $xml = $directoryRead->readFile(self::DATA_FILE_NAME); 90 | try { 91 | $new = simplexml_load_string($xml); 92 | } catch (\Exception $e) { 93 | $new = null; 94 | } 95 | 96 | $data = []; 97 | if (isset($new) && isset($new->channel) && isset($new->channel->item)) { 98 | foreach ($new->channel->item as $item) { 99 | $data[] = (array)$item; 100 | } 101 | } 102 | $this->cache->save($this->json->serialize($data),'magefan_aug_data'); 103 | } 104 | 105 | /** 106 | * @throws \Magento\Framework\Exception\FileSystemException 107 | */ 108 | public function update() 109 | { 110 | $fileUrl = 'https://' . 'mage' . 'fan.com' .'/media/knowledge-base.xml'; 111 | try { 112 | $this->curl->get($fileUrl); 113 | $contents = $this->curl->getBody(); 114 | } catch (\Exception $e) { 115 | $contents = null; 116 | } 117 | if ($contents) { 118 | $media = $this->filesystem->getDirectoryWrite(DirectoryList::VAR_DIR); 119 | $media->writeFile(self::DATA_FILE_NAME, $contents); 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [Magento 2 Admin User Guide Extension](https://magefan.com/) by Magefan 2 | 3 | [![Total Downloads](https://poser.pugx.org/magefan/module-admin-user-guide/downloads)](https://packagist.org/packages/magefan/module-admin-user-guide) 4 | [![Latest Stable Version](https://poser.pugx.org/magefan/module-admin-user-guide/v/stable)](https://packagist.org/packages/magefan/module-admin-user-guide) 5 | 6 | This Magento 2 Admin User Guide module adds guide links in admin panel to improve admin experience. 7 | 8 | ## 🇺🇦 Stand with Ukraine! [How can you help?](https://magefan.com/blog/join-our-donations) 9 | 10 | ## Requirements 11 | * Magento Community Edition 2.1.x-2.4.x or Magento Enterprise Edition 2.1.x-2.4.x 12 | 13 | ## Installation Method 1 - Installing via composer 14 | * Open command line 15 | * Using command "cd" navigate to your magento2 root directory 16 | * Run command: composer require magefan/module-admin-user-guide 17 | 18 | 19 | 20 | ## Installation Method 2 - Installing using archive 21 | * Download [ZIP Archive](https://github.com/magefan/module-admin-user-guide/archive/refs/heads/main.zip) 22 | * Extract files 23 | * In your Magento 2 root directory create folder app/code/Magefan/AdminUserGuide 24 | * Copy files and folders from archive to that folder 25 | * In command line, using "cd", navigate to your Magento 2 root directory 26 | * Run commands: 27 | ``` 28 | php bin/magento setup:upgrade 29 | php bin/magento setup:di:compile 30 | php bin/magento setup:static-content:deploy 31 | ``` 32 | 33 | ## Support 34 | If you have any issues, please [contact us](mailto:support@magefan.com) 35 | then if you still need help, open a bug report in GitHub's 36 | [issue tracker](https://github.com/magefan/module-admin-user-guide/issues). 37 | 38 | Please do not use Magento Marketplace Reviews or (especially) the Q&A for support. 39 | There isn't a way for us to reply to reviews and the Q&A moderation is very slow. 40 | 41 | ## Need More Features? 42 | Please contact us to get a quote 43 | https://magefan.com/contact 44 | 45 | ## License 46 | The code is licensed under [EULA](https://magefan.com/end-user-license-agreement). 47 | 48 | ## [Magento 2 Extensions](https://magefan.com/magento-2-extensions) by Magefan 49 | 50 | ### [Magento 2 Google Extensions](https://magefan.com/magento-2-extensions/google-extensions) 51 | 52 | * [Magento 2 Google Indexing](https://magefan.com/magento-2-google-indexing-api) 53 | * [Magento 2 Google Analytics 4](https://magefan.com/magento-2-google-analytics-4) 54 | * [Magento 2 Google Tag Manager](https://magefan.com/magento-2-google-tag-manager) 55 | * [Magento 2 Google Shopping Feed](https://magefan.com/magento-2-google-shopping-feed-extension) 56 | * [Magento 2 Google Customer Reviews](https://magefan.com/magento-2-google-customer-reviews) 57 | 58 | ### Magento 2 SEO Extensions 59 | 60 | * [Magento 2 SEO Extension](https://magefan.com/magento-2-seo-extension) 61 | * [Magento 2 Rich Snippets](https://magefan.com/magento-2-rich-snippets) 62 | * [Magento 2 HTML Sitemap](https://magefan.com/magento-2-html-sitemap-extension) 63 | * [Magento 2 XML Sitemap](https://magefan.com/magento-2-xml-sitemap-extension) 64 | * [Magento 2 Facebook Open Graph](https://magefan.com/magento-2-open-graph-extension-og-tags) 65 | * [Magento 2 Twitter Cards](https://magefan.com/magento-2-twitter-cards-extension) 66 | 67 | 68 | ### [Magento 2 Speed Optimization Extensions](https://magefan.com/magento-2-extensions/speed-optimization) 69 | 70 | * [Magento 2 Google Page Speed Optimizer](https://magefan.com/magento-2-google-page-speed-optimizer) 71 | * [Magento 2 Full Page Cache Warmer](https://magefan.com/magento-2-full-page-cache-warmer) 72 | * [Magento 2 Image Lazy Load](https://magefan.com/magento-2-image-lazy-load-extension) 73 | * [Magento 2 WebP Images](https://magefan.com/magento-2-webp-optimized-images) 74 | * [Magento 2 Rocket JavaScript](https://magefan.com/rocket-javascript-deferred-javascript) 75 | 76 | ### [Magento 2 Admin Panel Extensions](https://magefan.com/magento-2-extensions/admin-extensions) 77 | 78 | * [Magento 2 Size Chart Extension](https://magefan.com/magento-2-size-chart) 79 | * [Magento 2 Security Extension](https://magefan.com/magento-2-security-extension) 80 | * [Magento 2 Admin Action Log](https://magefan.com/magento-2-admin-action-log) 81 | * [Magento 2 Order Editor](https://magefan.com/magento-2-edit-order-extension) 82 | * [Magento 2 Better Order Grid](https://magefan.com/magento-2-better-order-grid-extension) 83 | * [Magento 2 Extended Product Grid](https://magefan.com/magento-2-product-grid-inline-editor) 84 | * [Magento 2 Product Tabs](https://magefan.com/magento-2/extensions/product-tabs) 85 | * [Magento 2 Facebook Pixel](https://magefan.com/magento-2-facebook-pixel-extension) 86 | * [Magento 2 Email Attachments](https://magefan.com/magento-2-email-attachments) 87 | * [Magento 2 Admin View](https://magefan.com/magento-2-admin-view-extension) 88 | * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) 89 | * [Magento 2 Login As Customer](https://magefan.com/login-as-customer-magento-2-extension) 90 | 91 | ### Magento 2 Blog Extensions 92 | 93 | * [Magento 2 Blog](https://magefan.com/magento2-blog-extension) 94 | * [Magento 2 Multi Blog](https://magefan.com/magento-2-multi-blog-extension) 95 | * [Magento 2 Product Widget](https://magefan.com/magento-2-product-widget) 96 | 97 | ### [Magento 2 Marketing Automation Extensions](https://magefan.com/magento-2-extensions/marketing-automation) 98 | 99 | * [Magento 2 Cookie Consent](https://magefan.com/magento-2-cookie-consent) 100 | * [Magento 2 Product Labels](https://magefan.com/magento-2-product-labels) 101 | * [Magento 2 Base Price](https://magefan.com/magento-2-base-price) 102 | * [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) 103 | * [Magento 2 Dynamic Blocks and Pages Extension](https://magefan.com/magento-2-cms-display-rules-extension) 104 | * [Magento 2 Automatic Related Products](https://magefan.com/magento-2-automatic-related-products) 105 | * [Magento 2 Price History](https://magefan.com/magento-2-price-history) 106 | * [Magento 2 Mautic Integration](https://magefan.com/magento-2-mautic-extension) 107 | * [Magento 2 YouTube Video](https://magefan.com/magento2-youtube-extension) 108 | 109 | ### [Magento 2 Cart Extensions](https://magefan.com/magento-2-extensions/cart-extensions) 110 | 111 | * [Magento 2 Checkout Extension](https://magefan.com/better-magento-2-checkout-extension) 112 | * [Magento 2 Coupon Code](https://magefan.com/magento-2-coupon-code-link) 113 | * [Magento 2 Guest to Customer](https://magefan.com/magento2-convert-guest-to-customer) 114 | 115 | ### [Magento 2 Multi-Language Extensions](https://magefan.com/magento-2-extensions/multi-language-extensions) 116 | 117 | * [Magento 2 Hreflang Tags](https://magefan.com/magento2-alternate-hreflang-extension) 118 | * [Magento 2 Auto Currency Switcher](https://magefan.com/magento-2-currency-switcher-auto-currency-by-country) 119 | * [Magento 2 Auto Language Switcher](https://magefan.com/magento-2-auto-language-switcher) 120 | * [Magento 2 GeoIP Store Switcher](https://magefan.com/magento-2-geoip-switcher-extension) 121 | * [Magento 2 Translation](https://magefan.com/magento-2-translation-extension) 122 | 123 | ### [Developers Tools](https://magefan.com/magento-2-extensions/developer-tools) 124 | 125 | * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) 126 | * [Magento 2 Cron Schedule](https://magefan.com/magento-2-cron-schedule) 127 | * [Magento 2 CLI Extension](https://magefan.com/magento2-cli-extension) 128 | * [Magento 2 Conflict Detector](https://magefan.com/magento2-conflict-detector) 129 | 130 | ## [Shopify Apps](https://magefan.com/shopify/apps) by Magefan 131 | 132 | * [Shopify Login As Customer](https://apps.shopify.com/login-as-customer) 133 | * [Shopify Blog](https://apps.shopify.com/magefan-blog) 134 | * [Shopify Size Chart](https://magefan.com/shopify/apps/size-chart) 135 | * [Shopify Google Indexer](https://magefan.com/shopify/apps/google-indexing) 136 | * [Shopify Product Feeds](https://magefan.com/shopify/apps/product-feed) 137 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "magefan/module-admin-user-guide", 3 | "description": "Admin panel user guides.", 4 | "type": "magento2-module", 5 | "version": "2.0.6", 6 | "autoload": { 7 | "files": [ "registration.php" ], 8 | "psr-4": { 9 | "Magefan\\AdminUserGuide\\": "" 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /etc/acl.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /etc/adminhtml/system.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 |
11 | separator-top 12 | 13 | magefan 14 | Magefan_AdminUserGuide::configuration 15 | 16 | 17 | 1 18 | 19 | Magefan\AdminUserGuide\Block\Adminhtml\System\Config\Form\Info 20 | 21 | 22 | 23 | Magento\Config\Model\Config\Source\Yesno 24 | 25 | 26 |
27 |
28 |
29 | -------------------------------------------------------------------------------- /etc/config.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 10 | 11 | 12 | 13 | 1 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /etc/crontab.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 15 2 * * * 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /etc/module.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /registration.php: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /view/adminhtml/templates/help.phtml: -------------------------------------------------------------------------------- 1 | 7 | 15 | getPageHelp(); 17 | ?> 18 | 19 |
20 |
21 | 22 | 23 | 24 | 25 |
26 | 27 | 68 |
69 | 80 | renderTag('script', [], $script, false) ?> 81 | 180 | 181 | --------------------------------------------------------------------------------