class-email-signup.php
1 year ago
class-help.php
1 month ago
class-polylang.php
7 months ago
class-review-box.php
1 year ago
class-upgrade-box.php
10 months ago
class-wpml.php
7 months ago
folders.class.php
1 month ago
form.class.php
10 months ago
form.fields.php
1 year ago
import.export.class.php
8 months ago
media.replace.php
7 months ago
notifications.class.php
8 months ago
plugins.class.php
8 months ago
tree.class.php
8 months ago
class-help.php
97 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 FOLDERS_HELP extends WCP_Folders { |
| 15 | |
| 16 | |
| 17 | // Allowed pages for showing the help menu |
| 18 | private static $allowed_pages = ['wcp_folders_settings', 'folders-upgrade-to-pro', 'plugins.php']; |
| 19 | |
| 20 | // constructor |
| 21 | public function __construct() { |
| 22 | |
| 23 | $current = basename($_SERVER['PHP_SELF'] ?? ''); |
| 24 | $page = $_GET['page'] ?? ''; |
| 25 | // Check if we're on one of those pages |
| 26 | if (in_array($current, self::$allowed_pages, true) || in_array($page, self::$allowed_pages, true)) { |
| 27 | // register enqueue css |
| 28 | add_action('admin_enqueue_scripts', array($this, 'admin_enqueue_scripts')); |
| 29 | // add need help in footer |
| 30 | add_action('admin_footer', array($this, 'admin_footer_need_help_content')); |
| 31 | } |
| 32 | |
| 33 | }//end __construct() |
| 34 | |
| 35 | // load help settings |
| 36 | public function load_help_settings(){ |
| 37 | $customize_folders = get_option("customize_folders"); |
| 38 | define('WCP_FOLDER_FOOTER_HELP_DATA', array( |
| 39 | 'help_icon' => esc_url(WCP_FOLDER_URL."assets/images/help/help-icon.svg"), |
| 40 | 'close_icon' => esc_url(WCP_FOLDER_URL."assets/images/help/close.svg"), |
| 41 | 'premio_site_info' => esc_url('https://premio.io/'), |
| 42 | 'help_center_link' => esc_url('https://premio.io/help/folders/?utm_source=pluginspage'), |
| 43 | 'footer_menu' => array( |
| 44 | 'support' => array( |
| 45 | 'title' => esc_html("Get Support", "folders"), |
| 46 | 'link' => esc_url("https://premio.io/help/folders/"), |
| 47 | 'status' => true, |
| 48 | ), |
| 49 | 'upgrade_to_pro' => array( |
| 50 | 'title' => esc_html("Upgrade to Pro", "folders"), |
| 51 | 'link' => esc_url($this->getFoldersUpgradeURL()), |
| 52 | 'status' => true, |
| 53 | ), |
| 54 | 'recommended_plugins' => array( |
| 55 | 'title' => esc_html("Recommended Plugins", "folders"), |
| 56 | 'link' => esc_url($this->getFoldersRecommendedPluginsURL()), |
| 57 | 'status' => get_option("hide_folder_recommended_plugin") || (isset($customize_folders['show_folder_in_settings']) && $customize_folders['show_folder_in_settings'] == "yes") ? false : true, |
| 58 | ), |
| 59 | ), |
| 60 | 'support_widget' => array( |
| 61 | 'upgrade_to_pro' => array( |
| 62 | 'title' => esc_html("Upgrade to Pro", "folders"), |
| 63 | 'link' => esc_url($this->getFoldersUpgradeURL()), |
| 64 | 'icon' => esc_url(WCP_FOLDER_URL."assets/images/help/pro.svg"), |
| 65 | ), |
| 66 | 'get_support' => array( |
| 67 | 'title' => esc_html("Get Support", "folders"), |
| 68 | 'link' => esc_url("https://premio.io/help/folders/"), |
| 69 | 'icon' => esc_url(WCP_FOLDER_URL."assets/images/help/help-circle.svg"), |
| 70 | ), |
| 71 | 'contact' => array( |
| 72 | 'title' => esc_html("Contact Us", "folders"), |
| 73 | 'link' => false, |
| 74 | 'icon' => esc_url(WCP_FOLDER_URL."assets/images/help/headphones.svg"), |
| 75 | ), |
| 76 | ), |
| 77 | )); |
| 78 | } |
| 79 | |
| 80 | |
| 81 | |
| 82 | // enqueue scripts |
| 83 | public function admin_enqueue_scripts(){ |
| 84 | // enqueue css |
| 85 | wp_enqueue_style('folders-help-css', WCP_FOLDER_URL . 'assets/css/help.css', array(), WCP_FOLDER_VERSION); |
| 86 | |
| 87 | } |
| 88 | |
| 89 | // Need Help Footer Content |
| 90 | public function admin_footer_need_help_content(){ |
| 91 | $this->load_help_settings(); |
| 92 | |
| 93 | include_once WCP_FOLDERS_PLUGIN_PATH.'/templates/admin/help.php'; |
| 94 | } |
| 95 | |
| 96 | } |
| 97 | new FOLDERS_HELP(); |