| 1 |
<?php |
| 2 |
namespace MasterAddons\Inc\Admin\Theme_Builder; |
| 3 |
|
| 4 |
defined( 'ABSPATH' ) || exit; |
| 5 |
|
| 6 |
if( !class_exists(__NAMESPACE__ . '\Theme_Builder') ){ |
| 7 |
|
| 8 |
class Theme_Builder{ |
| 9 |
|
| 10 |
public $dir; |
| 11 |
|
| 12 |
public $url; |
| 13 |
|
| 14 |
private static $plugin_path; |
| 15 |
|
| 16 |
private static $plugin_url; |
| 17 |
|
| 18 |
private static $_instance = null; |
| 19 |
|
| 20 |
public $jltma_plugin_path; |
| 21 |
|
| 22 |
const MINIMUM_PHP_VERSION = '5.6'; |
| 23 |
|
| 24 |
const MINIMUM_ELEMENTOR_VERSION = '3.5.0'; |
| 25 |
|
| 26 |
private static $plugin_name = 'Master Header Footer & Comment Form Builder'; |
| 27 |
|
| 28 |
public function __construct(){ |
| 29 |
$this->jltma_plugin_path = \JLTMA_PATH; |
| 30 |
$this->jltma_include_files(); |
| 31 |
|
| 32 |
add_action('admin_footer', [$this, 'jltma_header_footer_modal_view']); |
| 33 |
} |
| 34 |
|
| 35 |
public function jltma_include_files(){ |
| 36 |
include $this->jltma_plugin_path . 'inc/admin/theme-builder/inc/cpt.php'; |
| 37 |
include $this->jltma_plugin_path . 'inc/admin/theme-builder/inc/api/rest-api.php'; |
| 38 |
include $this->jltma_plugin_path . 'inc/admin/theme-builder/inc/api/cpt-api.php'; |
| 39 |
include $this->jltma_plugin_path . 'inc/admin/theme-builder/inc/cpt-hooks.php'; |
| 40 |
include $this->jltma_plugin_path . 'inc/admin/theme-builder/inc/jltma-activator.php'; |
| 41 |
include $this->jltma_plugin_path . 'inc/admin/theme-builder/inc/theme-builder-assets.php'; |
| 42 |
include $this->jltma_plugin_path . 'inc/admin/theme-builder/inc/api/handler-api.php'; |
| 43 |
include $this->jltma_plugin_path . 'inc/admin/theme-builder/inc/api/select2-api.php'; |
| 44 |
include $this->jltma_plugin_path . 'inc/admin/theme-builder/inc/comments/class-comments-builder.php'; |
| 45 |
|
| 46 |
} |
| 47 |
|
| 48 |
public function jltma_header_footer_modal_view(){ |
| 49 |
$screen = get_current_screen(); |
| 50 |
if($screen->id == 'edit-master_template'){ |
| 51 |
include_once $this->jltma_plugin_path . 'inc/admin/theme-builder/inc/view/modal-options.php'; |
| 52 |
} |
| 53 |
} |
| 54 |
|
| 55 |
|
| 56 |
public static function render_elementor_content_css($content_id){ |
| 57 |
if ( class_exists( '\Elementor\Core\Files\CSS\Post' ) ) { |
| 58 |
$css_file = new \Elementor\Core\Files\CSS\Post( $content_id ); |
| 59 |
$css_file->enqueue(); |
| 60 |
} |
| 61 |
} |
| 62 |
|
| 63 |
public static function render_elementor_content($content_id){ |
| 64 |
$elementor_instance = \Elementor\Plugin::instance(); |
| 65 |
return $elementor_instance->frontend->get_builder_content_for_display( $content_id , true); |
| 66 |
} |
| 67 |
|
| 68 |
public static function get_instance() { |
| 69 |
if ( is_null( self::$_instance ) ) { |
| 70 |
self::$_instance = new self(); |
| 71 |
} |
| 72 |
return self::$_instance; |
| 73 |
} |
| 74 |
} |
| 75 |
} |
| 76 |
|