| 1 |
<?php |
| 2 |
|
| 3 |
namespace PXLBSAdminify\Inc\Admin; |
| 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; |
| 18 |
|
| 19 |
// no direct access allowed |
| 20 |
if (!defined('ABSPATH')) { |
| 21 |
exit; |
| 22 |
} |
| 23 |
/** |
| 24 |
* WP Adminify |
| 25 |
* |
| 26 |
* @package Modules |
| 27 |
* |
| 28 |
* @author Jewel Theme <support@jeweltheme.com> |
| 29 |
*/ |
| 30 |
|
| 31 |
class Modules extends AdminSettingsModel |
| 32 |
{ |
| 33 |
|
| 34 |
public function __construct() |
| 35 |
{ |
| 36 |
$this->modules_init(); |
| 37 |
} |
| 38 |
|
| 39 |
|
| 40 |
/** |
| 41 |
* Include Moduels |
| 42 |
* |
| 43 |
* @return void |
| 44 |
*/ |
| 45 |
public function modules_init() |
| 46 |
{ |
| 47 |
$this->options = AdminSettings::get_instance()->get(); |
| 48 |
|
| 49 |
new Dismiss_Admin_Notices(); |
| 50 |
|
| 51 |
if (!empty($this->options['folders']['enable_folders'])) { |
| 52 |
new Folders(); |
| 53 |
} |
| 54 |
|
| 55 |
if (!empty($this->options['post_duplicator']['enable_post_duplicator'])) { |
| 56 |
new PostDuplicator(); |
| 57 |
} |
| 58 |
|
| 59 |
if (!empty($this->options['menu_duplicator'])) { |
| 60 |
new MenuDuplicator(); |
| 61 |
} |
| 62 |
|
| 63 |
if (!empty($this->options['post_types_order']['enable_pto'])) { |
| 64 |
new PostTypesOrder(); |
| 65 |
} |
| 66 |
|
| 67 |
if (!empty($this->options['disable_comments']['enable_disable_comments'] ) ) { |
| 68 |
new DisableComments(); |
| 69 |
} |
| 70 |
|
| 71 |
if (!empty($this->options['dashboard_widgets'])) { |
| 72 |
new DashboardWidget(); |
| 73 |
} |
| 74 |
|
| 75 |
// new ServerInformation(); |
| 76 |
|
| 77 |
MenuEditor::get_instance(); |
| 78 |
|
| 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 |
} |
| 84 |
} |
| 85 |
|