mystickymenu
Last commit date
admin
7 months ago
css
7 months ago
fonts
4 years ago
images
1 year ago
js
7 months ago
languages
2 months ago
class-email-signup.php
7 months ago
class-help.php
2 months ago
class-review-box.php
7 months ago
class-upgrade-box.php
9 months ago
index.php
8 years ago
mystickymenu-admin-widgetanalytics.php
7 months ago
mystickymenu-contact-leads.php
1 year ago
mystickymenu-deactivate-form.php
1 year ago
mystickymenu-fonts.php
2 years ago
mystickymenu-popup.php
1 year ago
mystickymenu-review-popup.php
9 months ago
mystickymenu.php
2 months ago
mystickymeny-new-welcomebar.php
7 months ago
readme.txt
2 months ago
recommended-plugins.php
7 months ago
stickymenu-dashboard.php
9 months ago
uninstall.php
2 years ago
upgrade-to-pro.php
1 year ago
welcome-bar.php
7 months ago
class-help.php
99 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Help And Footer Menu Class |
| 4 | * |
| 5 | * @author : Premio <contact@premio.io> |
| 6 | * @license : GPL2 |
| 7 | * */ |
| 8 | |
| 9 | if (defined('ABSPATH') === false) { |
| 10 | exit; |
| 11 | } |
| 12 | |
| 13 | // Class for help and footer menu |
| 14 | class MSB_HELP { |
| 15 | |
| 16 | |
| 17 | // Allowed pages for showing the help menu |
| 18 | private static $allowed_pages = ['my-stickymenu-welcomebar', 'my-stickymenu-new-welcomebar', 'my-sticky-menu-analytics', 'my-sticky-menu-leads', 'my-stickymenu-settings', 'my-stickymenu-upgrade' ]; |
| 19 | |
| 20 | // constructor |
| 21 | public function __construct() { |
| 22 | |
| 23 | $page = $_GET['page'] ?? ''; |
| 24 | // Check if we're on one of those pages |
| 25 | if (in_array($page, self::$allowed_pages, true)) { |
| 26 | // register enqueue css |
| 27 | add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts')); |
| 28 | // add need help in footer |
| 29 | add_action('admin_footer', array($this, 'admin_footer_need_help_content')); |
| 30 | } |
| 31 | |
| 32 | }//end __construct() |
| 33 | |
| 34 | // load help settings |
| 35 | public function load_help_settings(){ |
| 36 | define('MSB_FOOTER_HELP_DATA', array( |
| 37 | 'help_icon' => esc_url(MYSTICKYMENU_URL."images/help/help-icon.svg"), |
| 38 | 'close_icon' => esc_url(MYSTICKYMENU_URL."images/help/close.svg"), |
| 39 | 'premio_site_info' => esc_url('https://premio.io/'), |
| 40 | 'help_center_link' => esc_url('https://premio.io/help/mystickymenu/?utm_source=pluginspage'), |
| 41 | 'footer_menu' => array( |
| 42 | 'support' => array( |
| 43 | 'title' => esc_html("Get Support", "mystickymenu"), |
| 44 | 'link' => esc_url("https://premio.io/help/mystickymenu/"), |
| 45 | 'status' => true, |
| 46 | ), |
| 47 | 'upgrade_to_pro' => array( |
| 48 | 'title' => esc_html("Upgrade to Pro", "mystickymenu"), |
| 49 | 'link' => esc_url(admin_url("admin.php?page=my-stickymenu-upgrade")), |
| 50 | 'status' => true, |
| 51 | ), |
| 52 | 'recommended_plugins' => array( |
| 53 | 'title' => esc_html("Recommended Plugins", "mystickymenu"), |
| 54 | 'link' => esc_url(admin_url("admin.php?page=msm-recommended-plugins")), |
| 55 | 'status' => get_option("hide_msmrecommended_plugin") ? false : true, |
| 56 | ), |
| 57 | 'live_link' => array( |
| 58 | 'title' => esc_html("Add Poptin Popups", "mystickymenu"), |
| 59 | 'link' => esc_url(admin_url("admin.php?page=install-poptin-plugin")), |
| 60 | 'status' => class_exists( 'POPTIN_Plugin_Base' ) ? false : true, |
| 61 | ), |
| 62 | ), |
| 63 | 'support_widget' => array( |
| 64 | 'upgrade_to_pro' => array( |
| 65 | 'title' => esc_html("Upgrade to Pro", "mystickymenu"), |
| 66 | 'link' => esc_url(admin_url("admin.php?page=my-stickymenu-upgrade")), |
| 67 | 'icon' => esc_url(MYSTICKYMENU_URL."images/help/pro.svg"), |
| 68 | ), |
| 69 | 'get_support' => array( |
| 70 | 'title' => esc_html("Get Support", "mystickymenu"), |
| 71 | 'link' => esc_url("https://premio.io/help/mystickymenu/"), |
| 72 | 'icon' => esc_url(MYSTICKYMENU_URL."images/help/help-circle.svg"), |
| 73 | ), |
| 74 | 'contact' => array( |
| 75 | 'title' => esc_html("Contact Us", "mystickymenu"), |
| 76 | 'link' => false, |
| 77 | 'icon' => esc_url(MYSTICKYMENU_URL."images/help/headphones.svg"), |
| 78 | ), |
| 79 | ), |
| 80 | )); |
| 81 | } |
| 82 | |
| 83 | // enqueue scripts |
| 84 | public function admin_enqueue_scripts(){ |
| 85 | $suffix = MSM_DEV_MODE ? '' : '.min'; |
| 86 | // enqueue css |
| 87 | wp_enqueue_style('mystickymenu-help-css', MYSTICKYMENU_URL . 'css/help'.$suffix.'.css', array(), MYSTICKY_VERSION); |
| 88 | |
| 89 | } |
| 90 | |
| 91 | // Need Help Footer Content |
| 92 | public function admin_footer_need_help_content(){ |
| 93 | $this->load_help_settings(); |
| 94 | |
| 95 | include_once MYSTICKYMENU_PATH.'/admin/help.php'; |
| 96 | } |
| 97 | |
| 98 | } |
| 99 | new MSB_HELP(); |