| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPAdminify\Inc\Admin\Options; |
| 4 |
|
| 5 |
use WPAdminify\Inc\Admin\AdminSettingsModel ; |
| 6 |
if ( !defined( 'ABSPATH' ) ) { |
| 7 |
die; |
| 8 |
} |
| 9 |
// Cannot access directly. |
| 10 |
if ( !class_exists( 'Modules' ) ) { |
| 11 |
class Modules extends AdminSettingsModel |
| 12 |
{ |
| 13 |
public function __construct() |
| 14 |
{ |
| 15 |
$this->jltwp_adminify_general_options(); |
| 16 |
} |
| 17 |
|
| 18 |
public function get_defaults() |
| 19 |
{ |
| 20 |
return [ |
| 21 |
'admin_ui' => true, |
| 22 |
'folders' => true, |
| 23 |
'admin_notices' => true, |
| 24 |
'login_customizer' => true, |
| 25 |
'redirect_urls' => true, |
| 26 |
'admin_columns' => true, |
| 27 |
'menu_editor' => true, |
| 28 |
'dashboard_widgets' => true, |
| 29 |
'pagespeed_insights' => true, |
| 30 |
'custom_css_js' => true, |
| 31 |
'quick_menu' => true, |
| 32 |
'menu_duplicator' => true, |
| 33 |
'activity_logs' => true, |
| 34 |
'admin_pages' => true, |
| 35 |
'notification_bar' => true, |
| 36 |
'post_duplicator' => true, |
| 37 |
'post_types_order' => true, |
| 38 |
'server_info' => true, |
| 39 |
'sidebar_generator' => true, |
| 40 |
'disable_comments' => true, |
| 41 |
]; |
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* Module Fields |
| 46 |
* |
| 47 |
* @param [type] $modules_fields |
| 48 |
* |
| 49 |
* @return void |
| 50 |
*/ |
| 51 |
public function module_fields( &$modules_fields ) |
| 52 |
{ |
| 53 |
$modules_fields[] = [ |
| 54 |
'id' => 'admin_ui', |
| 55 |
'type' => 'switcher', |
| 56 |
'title' => __( 'Adminify UI', 'adminify' ), |
| 57 |
'subtitle' => __( 'Choose WordPress Default or Adminify UI for your Dashboard. Default: Adminify UI', 'adminify' ), |
| 58 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 59 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 60 |
'text_width' => 100, |
| 61 |
'default' => $this->get_default_field( 'admin_ui' ), |
| 62 |
]; |
| 63 |
$modules_fields[] = [ |
| 64 |
'id' => 'folders', |
| 65 |
'type' => 'switcher', |
| 66 |
'title' => __( 'Folders', 'adminify' ), |
| 67 |
'subtitle' => __( 'Categorize Post/Page/Media & Custom Post Types', 'adminify' ), |
| 68 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 69 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 70 |
'text_width' => 100, |
| 71 |
'default' => $this->get_default_field( 'folders' ), |
| 72 |
]; |
| 73 |
$modules_fields[] = [ |
| 74 |
'id' => 'login_customizer', |
| 75 |
'type' => 'switcher', |
| 76 |
'title' => __( 'Login Customizer', 'adminify' ), |
| 77 |
'subtitle' => __( '16 pre-built Templates, with Video,Slideshow,Gradient and many more', 'adminify' ), |
| 78 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 79 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 80 |
'text_width' => 100, |
| 81 |
'default' => $this->get_default_field( 'login_customizer' ), |
| 82 |
]; |
| 83 |
$modules_fields[] = [ |
| 84 |
'id' => 'admin_notices', |
| 85 |
'type' => 'switcher', |
| 86 |
'title' => __( 'Admin Notices', 'adminify' ), |
| 87 |
'subtitle' => __( 'Enable/Disable Hide All admin Notices Module', 'adminify' ), |
| 88 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 89 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 90 |
'text_width' => 100, |
| 91 |
'default' => $this->get_default_field( 'admin_notices' ), |
| 92 |
]; |
| 93 |
$modules_fields[] = [ |
| 94 |
'id' => 'admin_columns', |
| 95 |
'type' => 'switcher', |
| 96 |
'title' => __( 'Admin Columns', 'adminify' ), |
| 97 |
'subtitle' => __( 'Customize Column names post,page,products,media,taxonomoy etc', 'adminify' ), |
| 98 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 99 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 100 |
'text_width' => 100, |
| 101 |
'default' => $this->get_default_field( 'admin_columns' ), |
| 102 |
]; |
| 103 |
$modules_fields[] = [ |
| 104 |
'id' => 'menu_editor', |
| 105 |
'type' => 'switcher', |
| 106 |
'title' => __( 'Menu Editor', 'adminify' ), |
| 107 |
'subtitle' => __( 'Advanced Menu Editor with restrict users, Custom Icons etc', 'adminify' ), |
| 108 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 109 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 110 |
'text_width' => 100, |
| 111 |
'default' => $this->get_default_field( 'menu_editor' ), |
| 112 |
]; |
| 113 |
$modules_fields[] = [ |
| 114 |
'id' => 'dashboard_widgets', |
| 115 |
'type' => 'switcher', |
| 116 |
'title' => __( 'Dashboard & Welcome Widget', 'adminify' ), |
| 117 |
'subtitle' => __( 'Create Custom Dashboard & Sidebar Widgets', 'adminify' ), |
| 118 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 119 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 120 |
'text_width' => 100, |
| 121 |
'default' => $this->get_default_field( 'dashboard_widgets' ), |
| 122 |
]; |
| 123 |
$modules_fields[] = [ |
| 124 |
'id' => 'pagespeed_insights', |
| 125 |
'type' => 'switcher', |
| 126 |
'title' => __( 'Pagespeed Insights', 'adminify' ), |
| 127 |
'subtitle' => __( 'Analyze Google Pagespeed from Dashboard', 'adminify' ), |
| 128 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 129 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 130 |
'text_width' => 100, |
| 131 |
'default' => $this->get_default_field( 'pagespeed_insights' ), |
| 132 |
]; |
| 133 |
$modules_fields[] = [ |
| 134 |
'id' => 'custom_css_js', |
| 135 |
'type' => 'switcher', |
| 136 |
'title' => __( 'Header/Footer Scripts', 'adminify' ), |
| 137 |
'subtitle' => __( 'Inject Custom CSS/JS on Header or Footer', 'adminify' ), |
| 138 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 139 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 140 |
'text_width' => 100, |
| 141 |
'default' => $this->get_default_field( 'custom_css_js' ), |
| 142 |
]; |
| 143 |
$modules_fields[] = [ |
| 144 |
'id' => 'quick_menu', |
| 145 |
'type' => 'switcher', |
| 146 |
'title' => __( 'Quick Menu', 'adminify' ), |
| 147 |
'subtitle' => __( 'Quick Menu for navigating quickly', 'adminify' ), |
| 148 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 149 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 150 |
'text_width' => 100, |
| 151 |
'default' => $this->get_default_field( 'quick_menu' ), |
| 152 |
]; |
| 153 |
$modules_fields[] = [ |
| 154 |
'id' => 'menu_duplicator', |
| 155 |
'type' => 'switcher', |
| 156 |
'title' => __( 'Menu Duplicator', 'adminify' ), |
| 157 |
'subtitle' => __( 'Duplicate menu and Nav menu items also', 'adminify' ), |
| 158 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 159 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 160 |
'text_width' => 100, |
| 161 |
'default' => $this->get_default_field( 'menu_duplicator' ), |
| 162 |
]; |
| 163 |
$modules_fields[] = [ |
| 164 |
'id' => 'notification_bar', |
| 165 |
'type' => 'switcher', |
| 166 |
'title' => __( 'Notification Bar', 'adminify' ), |
| 167 |
'subtitle' => __( 'Cookie Notice, Promotional Bar on frontend', 'adminify' ), |
| 168 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 169 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 170 |
'text_width' => 100, |
| 171 |
'default' => $this->get_default_field( 'notification_bar' ), |
| 172 |
]; |
| 173 |
$modules_fields[] = [ |
| 174 |
'id' => 'activity_logs', |
| 175 |
'type' => 'switcher', |
| 176 |
'title' => __( 'Activity Logs', 'adminify' ), |
| 177 |
'subtitle' => __( 'Security check for all users Activity', 'adminify' ), |
| 178 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 179 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 180 |
'text_width' => 100, |
| 181 |
'default' => $this->get_default_field( 'activity_logs' ), |
| 182 |
]; |
| 183 |
$modules_fields[] = [ |
| 184 |
'id' => 'post_duplicator', |
| 185 |
'type' => 'switcher', |
| 186 |
'title' => __( 'Post Duplicator', 'adminify' ), |
| 187 |
'subtitle' => __( 'Duplicate Post/Page and any Custom Post Type', 'adminify' ), |
| 188 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 189 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 190 |
'text_width' => 100, |
| 191 |
'default' => $this->get_default_field( 'post_duplicator' ), |
| 192 |
]; |
| 193 |
$modules_fields[] = [ |
| 194 |
'id' => 'admin_pages', |
| 195 |
'type' => 'switcher', |
| 196 |
'title' => __( 'Admin Pages', 'adminify' ), |
| 197 |
'subtitle' => __( 'Custom Admin Pages hooks on Top/Sub Menu', 'adminify' ), |
| 198 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 199 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 200 |
'text_width' => 100, |
| 201 |
'default' => $this->get_default_field( 'admin_pages' ), |
| 202 |
]; |
| 203 |
$modules_fields[] = [ |
| 204 |
'id' => 'sidebar_generator', |
| 205 |
'type' => 'switcher', |
| 206 |
'title' => __( 'Sidebar Generator', 'adminify' ), |
| 207 |
'subtitle' => __( 'Create Custom Sidebar Widgets', 'adminify' ), |
| 208 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 209 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 210 |
'text_width' => 100, |
| 211 |
'default' => $this->get_default_field( 'sidebar_generator' ), |
| 212 |
]; |
| 213 |
$modules_fields[] = [ |
| 214 |
'id' => 'post_types_order', |
| 215 |
'type' => 'switcher', |
| 216 |
'title' => __( 'Post Types Order', 'adminify' ), |
| 217 |
'subtitle' => __( 'Post Types and Taxonomy Order', 'adminify' ), |
| 218 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 219 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 220 |
'text_width' => 100, |
| 221 |
'default' => $this->get_default_field( 'post_types_order' ), |
| 222 |
]; |
| 223 |
$modules_fields[] = [ |
| 224 |
'id' => 'server_info', |
| 225 |
'type' => 'switcher', |
| 226 |
'title' => __( 'Server Info', 'adminify' ), |
| 227 |
'subtitle' => __( 'Server Info menu Module', 'adminify' ), |
| 228 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 229 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 230 |
'text_width' => 100, |
| 231 |
'default' => $this->get_default_field( 'server_info' ), |
| 232 |
]; |
| 233 |
$modules_fields[] = [ |
| 234 |
'id' => 'disable_comments', |
| 235 |
'type' => 'switcher', |
| 236 |
'title' => __( 'Disable Comments', 'adminify' ), |
| 237 |
'subtitle' => __( 'Disable Comments for Post/Pages/Post Types etc', 'adminify' ), |
| 238 |
'text_on' => __( 'Enabled', 'adminify' ), |
| 239 |
'text_off' => __( 'Disabled', 'adminify' ), |
| 240 |
'text_width' => 100, |
| 241 |
'default' => $this->get_default_field( 'disable_comments' ), |
| 242 |
]; |
| 243 |
} |
| 244 |
|
| 245 |
public function jltwp_adminify_general_options() |
| 246 |
{ |
| 247 |
if ( !class_exists( 'ADMINIFY' ) ) { |
| 248 |
return; |
| 249 |
} |
| 250 |
$modules_fields = []; |
| 251 |
$this->module_fields( $modules_fields ); |
| 252 |
// Modules Section |
| 253 |
\ADMINIFY::createSection( $this->prefix, [ |
| 254 |
'title' => __( 'Modules', 'adminify' ), |
| 255 |
'icon' => 'fas fa-layer-group', |
| 256 |
'class' => 'wp-adminify-two-columns aminify-title-width-65', |
| 257 |
'fields' => $modules_fields, |
| 258 |
] ); |
| 259 |
} |
| 260 |
|
| 261 |
} |
| 262 |
} |