| 1 |
<?php |
| 2 |
|
| 3 |
namespace WPAdminify\Inc\Admin\Options; |
| 4 |
|
| 5 |
use WPAdminify\Inc\Utils; |
| 6 |
use WPAdminify\Inc\Admin\AdminSettingsModel; |
| 7 |
|
| 8 |
/** |
| 9 |
* WP Adminify |
| 10 |
* @package WP Admin Bar |
| 11 |
* |
| 12 |
* @author Jewel Theme <support@jeweltheme.com> |
| 13 |
*/ |
| 14 |
|
| 15 |
|
| 16 |
class Assets_Manager extends AdminSettingsModel |
| 17 |
{ |
| 18 |
public function __construct() |
| 19 |
{ |
| 20 |
$this->assets_manager_settings(); |
| 21 |
} |
| 22 |
|
| 23 |
|
| 24 |
public function get_defaults() |
| 25 |
{ |
| 26 |
return [ |
| 27 |
'adminify_assets' => [], |
| 28 |
]; |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* Assets Manager Fields |
| 33 |
* |
| 34 |
* @param [type] $fields |
| 35 |
* |
| 36 |
* @return void |
| 37 |
*/ |
| 38 |
public static function assets_manager_fields(&$fields) |
| 39 |
{ |
| 40 |
$fields[] = array( |
| 41 |
'type' => 'subheading', |
| 42 |
'content' => Utils::adminfiy_help_urls( |
| 43 |
__('Assets Manager Settings', WP_ADMINIFY_TD), |
| 44 |
'https://wpadminify.com/kb/wp-adminify-options-panel/#assets-manager', |
| 45 |
'https://www.youtube.com/playlist?list=PLqpMw0NsHXV-EKj9Xm1DMGa6FGniHHly8', |
| 46 |
'https://www.facebook.com/groups/jeweltheme', |
| 47 |
'https://wpadminify.com/support/' |
| 48 |
) |
| 49 |
); |
| 50 |
|
| 51 |
$icon_style1 = []; |
| 52 |
if (Utils::is_plugin_active('elementor/elementor.php')) { |
| 53 |
$icon_style1 = [ |
| 54 |
'elementor-icons' => __('Elementor Icons', WP_ADMINIFY_TD), |
| 55 |
]; |
| 56 |
} |
| 57 |
$icon_style2 = [ |
| 58 |
'wp-adminify-simple-line-icons' => __('Simple Line Icons', WP_ADMINIFY_TD), |
| 59 |
'wp-adminify-icomoon' => __('Icomoon', WP_ADMINIFY_TD), |
| 60 |
'wp-adminify-themify-icons' => __('Themify Icons', WP_ADMINIFY_TD), |
| 61 |
]; |
| 62 |
$icon_library_styles = $icon_style1 + $icon_style2; |
| 63 |
|
| 64 |
$script_options = [ |
| 65 |
'Styles' => $icon_library_styles, |
| 66 |
'Scripts' => array( |
| 67 |
'wp-adminify-circle-menu' => __('Quick Circle Menu', WP_ADMINIFY_TD), |
| 68 |
'wp-adminify-realtime-server' => __('Realtime Server', WP_ADMINIFY_TD), |
| 69 |
), |
| 70 |
]; |
| 71 |
|
| 72 |
|
| 73 |
$fields[] = array( |
| 74 |
'id' => 'adminify_assets', |
| 75 |
'type' => 'checkbox', |
| 76 |
'title' => __('Remove Scripts/Styles', WP_ADMINIFY_TD), |
| 77 |
'options' => $script_options |
| 78 |
); |
| 79 |
} |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
/** |
| 84 |
* Assets Manager Settings |
| 85 |
*/ |
| 86 |
public function assets_manager_settings() |
| 87 |
{ |
| 88 |
if (!class_exists('ADMINIFY')) { |
| 89 |
return; |
| 90 |
} |
| 91 |
|
| 92 |
$fields = []; |
| 93 |
self::assets_manager_fields($fields); |
| 94 |
|
| 95 |
// Folders Order Section |
| 96 |
\ADMINIFY::createSection($this->prefix, array( |
| 97 |
'title' => __('Assets Manager', WP_ADMINIFY_TD), |
| 98 |
'id' => 'assets_manager_section', |
| 99 |
'icon' => 'far fa-folder-open', |
| 100 |
'fields' => $fields |
| 101 |
)); |
| 102 |
} |
| 103 |
} |
| 104 |
|