| @@ -1,29 +1,35 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -namespace PXLBSAdminify\Inc\Admin; | |
| 3 | +namespace WPAdminify\Inc\Admin; | |
| 4 | 4 | |
| 5 | -use PXLBSAdminify\Inc\Utils; | |
| 6 | -use \PXLBSAdminify\Inc\Admin\AdminSettings; | |
| 7 | -use \PXLBSAdminify\Inc\Admin\AdminSettingsModel; | |
| 8 | -use \PXLBSAdminify\Inc\Modules\MenuEditor\MenuEditor; | |
| 9 | -use \PXLBSAdminify\Inc\Modules\MenuDuplicator\MenuDuplicator; | |
| 10 | -use \PXLBSAdminify\Inc\Modules\PostDuplicator\PostDuplicator; | |
| 11 | -use \PXLBSAdminify\Inc\Modules\PostTypesOrder\PostTypesOrder; | |
| 12 | -use \PXLBSAdminify\Inc\Modules\Folders\Folders; | |
| 13 | -use \PXLBSAdminify\Inc\Modules\DisableComments\DisableComments; | |
| 14 | -use \PXLBSAdminify\Inc\Modules\ServerInformation\ServerInformation; | |
| 15 | -use \PXLBSAdminify\Inc\Modules\DismissNotices\Dismiss_Admin_Notices; | |
| 16 | -use \PXLBSAdminify\Inc\Modules\DashboardWidget\DashboardWidget; | |
| 17 | -use PXLBSAdminify\Inc\Admin\Options\RollbackVersion; | |
| 5 | +use WPAdminify\Inc\Utils; | |
| 6 | +use \WPAdminify\Inc\Admin\AdminSettings; | |
| 7 | +use \WPAdminify\Inc\Admin\AdminSettingsModel; | |
| 8 | +use \WPAdminify\Inc\Classes\QuickCircleMenu; | |
| 9 | +use \WPAdminify\Inc\Modules\MenuEditor\MenuEditor; | |
| 10 | +use \WPAdminify\Inc\Modules\AdminColumns\AdminColumns; | |
| 11 | +use \WPAdminify\Inc\Modules\Folders\Folders; | |
| 12 | +use \WPAdminify\Inc\Modules\GooglePageSpeed\GooglePageSpeed; | |
| 13 | +use \WPAdminify\Inc\Modules\LoginCustomizer\LoginCustomizer; | |
| 14 | +use \WPAdminify\Inc\Modules\NotificationBar\NotificationBar; | |
| 15 | +use \WPAdminify\Inc\Modules\SidebarGenerator\Sidebar_Generator; | |
| 16 | +use \WPAdminify\Inc\Modules\DismissNotices\Dismiss_Admin_Notices; | |
| 17 | +use \WPAdminify\Inc\Modules\ActivityLogs\ActivityLogs; | |
| 18 | +use \WPAdminify\Inc\Modules\AdminPages\AdminPages; | |
| 19 | +use \WPAdminify\Inc\Modules\CustomHeaderFooter\CustomHeaderFooter; | |
| 20 | +use \WPAdminify\Inc\Modules\DashboardWidget\DashboardWidget; | |
| 21 | +use \WPAdminify\Inc\Modules\PostDuplicator\PostDuplicator; | |
| 22 | +use \WPAdminify\Inc\Modules\MenuDuplicator\MenuDuplicator; | |
| 23 | +use \WPAdminify\Inc\Modules\PostTypesOrder\PostTypesOrder; | |
| 24 | +use \WPAdminify\Inc\Modules\DisableComments\DisableComments; | |
| 25 | +use \WPAdminify\Inc\Modules\ServerInformation\ServerInformation; | |
| 26 | +use WPAdminify\Inc\Admin\Options\RollbackVersion; | |
| 18 | 27 | |
| 19 | 28 | // no direct access allowed |
| 20 | -if (!defined('ABSPATH')) { | |
| 21 | - exit; | |
| 22 | -} | |
| 29 | +if (!defined('ABSPATH')) exit; | |
| 23 | 30 | /** |
| 24 | 31 | * WP Adminify |
| 25 | - * | |
| 26 | 32 | * @package Modules |
| 27 | 33 | * |
| 28 | 34 | * @author Jewel Theme <support@jeweltheme.com> |
| 29 | 35 | */ |
| @@ -29,56 +35,95 @@ | ||
| 29 | 35 | */ |
| 30 | 36 | |
| 31 | 37 | class Modules extends AdminSettingsModel |
| 32 | 38 | { |
| 39 | + public function __construct() | |
| 40 | + { | |
| 41 | + $this->modules_init(); | |
| 42 | + } | |
| 33 | 43 | |
| 34 | - public function __construct() | |
| 35 | - { | |
| 36 | - $this->modules_init(); | |
| 37 | - } | |
| 44 | + /** | |
| 45 | + * Include Moduels | |
| 46 | + * | |
| 47 | + * @return void | |
| 48 | + */ | |
| 49 | + public function modules_init() | |
| 50 | + { | |
| 51 | + $this->options = AdminSettings::get_instance()->get(); | |
| 38 | 52 | |
| 53 | + if (Utils::check_modules($this->options['folders'])) { | |
| 54 | + new Folders(); | |
| 55 | + } | |
| 39 | 56 | |
| 40 | - /** | |
| 41 | - * Include Moduels | |
| 42 | - * | |
| 43 | - * @return void | |
| 44 | - */ | |
| 45 | - public function modules_init() | |
| 46 | - { | |
| 47 | - $this->options = AdminSettings::get_instance()->get(); | |
| 57 | + if (Utils::check_modules($this->options['quick_menu'])) { | |
| 58 | + new QuickCircleMenu(); | |
| 59 | + } | |
| 48 | 60 | |
| 49 | - new Dismiss_Admin_Notices(); | |
| 61 | + if (Utils::check_modules($this->options['login_customizer'])) { | |
| 62 | + new LoginCustomizer(); | |
| 63 | + } | |
| 50 | 64 | |
| 51 | - if (!empty($this->options['folders']['enable_folders'])) { | |
| 52 | - new Folders(); | |
| 53 | - } | |
| 65 | + if (Utils::check_modules($this->options['admin_notices'])) { | |
| 66 | + new Dismiss_Admin_Notices(); | |
| 67 | + } | |
| 54 | 68 | |
| 55 | - if (!empty($this->options['post_duplicator']['enable_post_duplicator'])) { | |
| 56 | - new PostDuplicator(); | |
| 57 | - } | |
| 69 | + if (Utils::check_modules($this->options['admin_columns'])) { | |
| 70 | + new AdminColumns(); | |
| 71 | + } | |
| 58 | 72 | |
| 59 | - if (!empty($this->options['menu_duplicator'])) { | |
| 60 | - new MenuDuplicator(); | |
| 61 | - } | |
| 73 | + if (Utils::check_modules($this->options['menu_editor'])) { | |
| 74 | + new MenuEditor(); | |
| 75 | + } | |
| 62 | 76 | |
| 63 | - if (!empty($this->options['post_types_order']['enable_pto'])) { | |
| 64 | - new PostTypesOrder(); | |
| 65 | - } | |
| 77 | + if (Utils::check_modules($this->options['dashboard_widgets'])) { | |
| 78 | + new DashboardWidget(); | |
| 79 | + } | |
| 66 | 80 | |
| 67 | - if (!empty($this->options['disable_comments']['enable_disable_comments'] ) ) { | |
| 68 | - new DisableComments(); | |
| 69 | - } | |
| 81 | + if (Utils::check_modules($this->options['pagespeed_insights'])) { | |
| 82 | + new GooglePageSpeed(); | |
| 83 | + } | |
| 70 | 84 | |
| 71 | - if (!empty($this->options['dashboard_widgets'])) { | |
| 72 | - new DashboardWidget(); | |
| 73 | - } | |
| 85 | + if (Utils::check_modules($this->options['custom_css_js'])) { | |
| 86 | + new CustomHeaderFooter(); | |
| 87 | + } | |
| 74 | 88 | |
| 75 | - // new ServerInformation(); | |
| 89 | + if (Utils::check_modules($this->options['menu_duplicator'])) { | |
| 90 | + new MenuDuplicator(); | |
| 91 | + } | |
| 76 | 92 | |
| 77 | - MenuEditor::get_instance(); | |
| 93 | + if (Utils::check_modules($this->options['activity_logs'])) { | |
| 94 | + new ActivityLogs(); | |
| 95 | + } | |
| 78 | 96 | |
| 79 | - // TO DO: Turned Off for future release, after making Network Options stable | |
| 80 | - // if (Utils::check_modules($this->options['server_info'])) { | |
| 81 | - // new RollbackVersion(); | |
| 82 | - // } | |
| 83 | - } | |
| 97 | + if (Utils::check_modules($this->options['notification_bar'])) { | |
| 98 | + new NotificationBar(); | |
| 99 | + } | |
| 100 | + | |
| 101 | + if (Utils::check_modules($this->options['admin_pages'])) { | |
| 102 | + new AdminPages(); | |
| 103 | + } | |
| 104 | + | |
| 105 | + if (Utils::check_modules($this->options['post_duplicator'])) { | |
| 106 | + new PostDuplicator(); | |
| 107 | + } | |
| 108 | + | |
| 109 | + if (Utils::check_modules($this->options['post_types_order'])) { | |
| 110 | + new PostTypesOrder(); | |
| 111 | + } | |
| 112 | + | |
| 113 | + if (Utils::check_modules($this->options['disable_comments'])) { | |
| 114 | + new DisableComments(); | |
| 115 | + } | |
| 116 | + | |
| 117 | + if (Utils::check_modules($this->options['sidebar_generator'])) { | |
| 118 | + new Sidebar_Generator(); | |
| 119 | + } | |
| 120 | + | |
| 121 | + if (Utils::check_modules($this->options['server_info'])) { | |
| 122 | + new ServerInformation(); | |
| 123 | + } | |
| 124 | + | |
| 125 | + if (Utils::check_modules($this->options['server_info'])) { | |
| 126 | + new RollbackVersion(); | |
| 127 | + } | |
| 128 | + } | |
| 84 | 129 | } |