| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPAdminify\Inc\Admin\Options; |
| 4 |
|
| 5 |
use WPAdminify\Inc\Utils; |
| 6 |
use WPAdminify\Inc\Admin\AdminSettingsModel; |
| 7 |
|
| 8 |
if (!defined('ABSPATH')) { |
| 9 |
die; |
| 10 |
} // Cannot access directly. |
| 11 |
|
| 12 |
class White_Label extends AdminSettingsModel |
| 13 |
{ |
| 14 |
public function __construct() |
| 15 |
{ |
| 16 |
$this->white_label_settings(); |
| 17 |
} |
| 18 |
|
| 19 |
public function get_defaults() |
| 20 |
{ |
| 21 |
return [ |
| 22 |
'jltwp_adminify_wl_plugin_logo' => '', |
| 23 |
'jltwp_adminify_wl_plugin_name' => 'WP Adminify', |
| 24 |
'jltwp_adminify_wl_plugin_desc' => ' Supercharge your WordPress Adminify with <a href="https://wpadminify.com">WP Adminify</a> plugin. It has Professional & Clean UI, White Label, Analytics, Charts, Menu UI, WP Dark Theme, User Roles management, Multisite Support and many more to get amazed.', |
| 25 |
'jltwp_adminify_wl_plugin_author_name' => 'Jewel Theme', |
| 26 |
'jltwp_adminify_wl_plugin_menu_label' => 'WP Adminify', |
| 27 |
'jltwp_adminify_wl_plugin_url' => 'https://wpadminify.com', |
| 28 |
'jltwp_adminify_wl_plugin_row_links' => false, |
| 29 |
'jltwp_adminify_wl_plugin_tab_system_info' => false, |
| 30 |
'jltwp_adminify_wl_plugin_option' => false, |
| 31 |
'jltwp_adminify_remove_action_links' => [], |
| 32 |
]; |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
/** |
| 37 |
* Tweaks: Performance Fields |
| 38 |
* |
| 39 |
* @param [type] $white_label |
| 40 |
* |
| 41 |
* @return void |
| 42 |
*/ |
| 43 |
public function white_label_fields(&$white_label) |
| 44 |
{ |
| 45 |
|
| 46 |
$white_label_class = ''; |
| 47 |
if (!jltwp_adminify()->is_plan__premium_only('agency')) { |
| 48 |
$white_label_class = 'adminify-depend-visible adminify-depend-on'; |
| 49 |
} |
| 50 |
|
| 51 |
$white_label[] = array( |
| 52 |
'type' => 'subheading', |
| 53 |
'content' => Utils::adminfiy_help_urls( |
| 54 |
__('White Label Settings', WP_ADMINIFY_TD), |
| 55 |
'https://wpadminify.com/kb/adminify-white-label/', |
| 56 |
'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8', |
| 57 |
'https://www.facebook.com/groups/jeweltheme', |
| 58 |
'https://wpadminify.com/support/' |
| 59 |
) |
| 60 |
); |
| 61 |
|
| 62 |
$white_label[] = array( |
| 63 |
'id' => 'jltwp_adminify_wl_plugin_logo', |
| 64 |
'type' => 'media', |
| 65 |
'class' => $white_label_class, |
| 66 |
'title' => __('Logo Image', WP_ADMINIFY_TD), |
| 67 |
'library' => 'image', |
| 68 |
'preview_size' => 'thumbnail', |
| 69 |
'button_title' => __('Add Logo Image', WP_ADMINIFY_TD), |
| 70 |
'remove_title' => __('Remove Logo Image', WP_ADMINIFY_TD), |
| 71 |
'default' => $this->get_default_field('jltwp_adminify_wl_plugin_logo') |
| 72 |
); |
| 73 |
|
| 74 |
$white_label[] = array( |
| 75 |
'id' => 'jltwp_adminify_wl_plugin_name', |
| 76 |
'type' => 'text', |
| 77 |
'class' => $white_label_class, |
| 78 |
'title' => __('Plugin Name', WP_ADMINIFY_TD), |
| 79 |
'default' => $this->get_default_field('jltwp_adminify_wl_plugin_name') |
| 80 |
); |
| 81 |
|
| 82 |
$white_label[] = array( |
| 83 |
'id' => 'jltwp_adminify_wl_plugin_desc', |
| 84 |
'type' => 'textarea', |
| 85 |
'class' => $white_label_class, |
| 86 |
'title' => __('Plugin Description', WP_ADMINIFY_TD), |
| 87 |
'default' => $this->get_default_field('jltwp_adminify_wl_plugin_desc') |
| 88 |
); |
| 89 |
|
| 90 |
$white_label[] = array( |
| 91 |
'id' => 'jltwp_adminify_wl_plugin_author_name', |
| 92 |
'type' => 'text', |
| 93 |
'class' => $white_label_class, |
| 94 |
'title' => __('Developer/Agency Name', WP_ADMINIFY_TD), |
| 95 |
'default' => $this->get_default_field('jltwp_adminify_wl_plugin_author_name') |
| 96 |
); |
| 97 |
|
| 98 |
$white_label[] = array( |
| 99 |
'id' => 'jltwp_adminify_wl_plugin_menu_label', |
| 100 |
'type' => 'text', |
| 101 |
'class' => $white_label_class, |
| 102 |
'title' => __('Menu Label', WP_ADMINIFY_TD), |
| 103 |
'default' => $this->get_default_field('jltwp_adminify_wl_plugin_menu_label') |
| 104 |
); |
| 105 |
|
| 106 |
$white_label[] = array( |
| 107 |
'id' => 'jltwp_adminify_wl_plugin_url', |
| 108 |
'type' => 'text', |
| 109 |
'class' => $white_label_class, |
| 110 |
'title' => __('Plugin URL', WP_ADMINIFY_TD), |
| 111 |
'default' => $this->get_default_field('jltwp_adminify_wl_plugin_url') |
| 112 |
); |
| 113 |
|
| 114 |
$white_label[] = array( |
| 115 |
'type' => 'subheading', |
| 116 |
'class' => $white_label_class, |
| 117 |
'content' => __('White Label WP Adminify', WP_ADMINIFY_TD) |
| 118 |
); |
| 119 |
|
| 120 |
// $white_label[] = array( |
| 121 |
// 'id' => 'jltwp_adminify_wl_plugin_tab_system_info', |
| 122 |
// 'type' => 'checkbox', |
| 123 |
// 'label' => __('Hide System Info Menu', WP_ADMINIFY_TD), |
| 124 |
// 'default' => $this->get_default_field('jltwp_adminify_wl_plugin_tab_system_info') |
| 125 |
// ); |
| 126 |
|
| 127 |
$white_label[] = array( |
| 128 |
'id' => 'jltwp_adminify_wl_plugin_row_links', |
| 129 |
'type' => 'checkbox', |
| 130 |
'class' => $white_label_class, |
| 131 |
'label' => __('Hide Plugin Row Meta Links', WP_ADMINIFY_TD), |
| 132 |
'default' => $this->get_default_field('jltwp_adminify_wl_plugin_row_links') |
| 133 |
); |
| 134 |
|
| 135 |
if (!jltwp_adminify()->is_plan__premium_only('agency')) { |
| 136 |
$white_label[] = array( |
| 137 |
'type' => 'callback', |
| 138 |
'class' => 'wp-adminify-white-label-notice', |
| 139 |
'function' => 'WPAdminify\Inc\Utils::jltwp_adminify_white_label_upgrade', |
| 140 |
); |
| 141 |
} |
| 142 |
|
| 143 |
$white_label[] = array( |
| 144 |
'id' => 'jltwp_adminify_remove_action_links', |
| 145 |
'type' => 'checkbox', |
| 146 |
'class' => 'aminify-title-width-40', |
| 147 |
'title' => __('Remove Action Links', WP_ADMINIFY_TD), |
| 148 |
'options' => [ |
| 149 |
'upgrade' => __('Upgrade', WP_ADMINIFY_TD), |
| 150 |
'activate-license' => __('Activate/Change License', WP_ADMINIFY_TD), |
| 151 |
'opt-in-or-opt-out' => __('Opt In/Out', WP_ADMINIFY_TD), |
| 152 |
'adminify-plugin-settings' => __('Settings', WP_ADMINIFY_TD), |
| 153 |
] |
| 154 |
); |
| 155 |
|
| 156 |
|
| 157 |
|
| 158 |
$white_label[] = array( |
| 159 |
'id' => 'jltwp_adminify_wl_plugin_option', |
| 160 |
'type' => 'checkbox', |
| 161 |
'class' => $white_label_class, |
| 162 |
'class' => 'adminify-full-width-field adminify-hightlight-field', |
| 163 |
'label' => __('Enable Force Disable "White Label" Options: If you enable this option, White Label option will be completely hidden. If you want it back, You have to deactivate and activate plugin to make it work again.', WP_ADMINIFY_TD), |
| 164 |
'default' => $this->get_default_field('jltwp_adminify_wl_plugin_option') |
| 165 |
); |
| 166 |
} |
| 167 |
|
| 168 |
|
| 169 |
/* |
| 170 |
White Label Settings |
| 171 |
*/ |
| 172 |
public function white_label_settings() |
| 173 |
{ |
| 174 |
|
| 175 |
if (!class_exists('ADMINIFY')) { |
| 176 |
return; |
| 177 |
} |
| 178 |
|
| 179 |
$white_label = []; |
| 180 |
$this->white_label_fields($white_label); |
| 181 |
|
| 182 |
\ADMINIFY::createSection( |
| 183 |
$this->prefix, |
| 184 |
array( |
| 185 |
'title' => __('White Label', WP_ADMINIFY_TD), |
| 186 |
'icon' => 'far fa-copyright', |
| 187 |
'class' => 'wp-adminify-two-columns ', |
| 188 |
'fields' => $white_label, |
| 189 |
) |
| 190 |
); |
| 191 |
} |
| 192 |
} |
| 193 |
|