PluginProbe
Enter Addons – Ultimate Template Builder for Elementor / 2.2.5
Enter Addons – Ultimate Template Builder for Elementor v2.2.5
trunk 2.2.10 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.3 2.3.4
enteraddons / admin / Admin.php

Admin.php in Enter Addons – Ultimate Template Builder for Elementor 2.2.5, at admin/Admin.php

178 lines 5.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Enteraddons\Admin;
3
4 /**
5 * Enteraddons admin class
6 *
7 * @package Enteraddons
8 * @author ThemeLooks
9 * @copyright 2022 ThemeLooks
10 * @license GPL-2.0-or-later
11 *
12 *
13 */
14
15 if( !class_exists('Admin') ) {
16 class Admin {
17
18 private static $instance = null;
19
20 function __construct() {
21 add_action( 'admin_enqueue_scripts', [ __CLASS__, 'admin_scripts' ] );
22 add_action( 'admin_footer', [ __CLASS__, 'admin_footer_inject' ] );
23 $this->init();
24 }
25 public static function getInstance() {
26
27 if( is_null( self::$instance ) ) {
28 self::$instance = new self();
29 }
30
31 return self::$instance;
32 }
33 public function init() {
34 //
35 new Admin_Notices();
36 //
37 Admin_Menu::getInstance();
38 //
39 Admin_Ajax_handler::getInstance();
40
41 }
42 public static function admin_scripts( $hook ) {
43
44 $hookStack = ['toplevel_page_enteraddons'];
45 $getHookStack = apply_filters( 'ea_admin_scripts_hooks', $hookStack, $hook );
46 if( in_array( $hook, $getHookStack ) || get_post_type() == 'ea_builder_template' ) {
47
48 wp_enqueue_style( 'select2', ENTERADDONS_DIR_ADMIN_ASSETS. 'css/select2.min.css', array(), ' 1.0.0', false );
49 wp_enqueue_script( 'select2', ENTERADDONS_DIR_ADMIN_ASSETS.'js/select2.min.js', array('jquery'), '1.0.0', true );
50 wp_enqueue_style( 'font-awesome', ENTERADDONS_DIR_ADMIN_ASSETS. 'css/font-awesome.min.css', array(), ' 4.7.0', false );
51 wp_enqueue_style( 'enteraddons-icons', ENTERADDONS_DIR_ADMIN_ASSETS. 'css/enteraddons-icons.css', array(), ' 1.0.0', false );
52 wp_enqueue_style( 'jquery-confirm', ENTERADDONS_DIR_ADMIN_ASSETS. 'css/jquery-confirm.min.css', array(), '3.3.2', false );
53 wp_enqueue_style( 'enteraddons', ENTERADDONS_DIR_ADMIN_ASSETS. 'css/style.css', array(), '1.0.0', false );
54 wp_enqueue_script( 'jquery-confirm', ENTERADDONS_DIR_ADMIN_ASSETS.'js/jquery-confirm.min.js', array('jquery'), '1.0.0', true );
55 wp_enqueue_script( 'enteraddons-admin-ajax', ENTERADDONS_DIR_ADMIN_ASSETS. 'js/admin-ajax.js', array('jquery'), '1.0.0', true );
56 wp_enqueue_script( 'enteraddons', ENTERADDONS_DIR_ADMIN_ASSETS. 'js/main.js', array('jquery'), '1.0.0', true );
57 do_action( 'ea_admin_scripts_after' );
58 $args = array(
59 'nonce' => wp_create_nonce( 'enteraddons-settings-data-save' ),
60 'ajaxurl' => admin_url('admin-ajax.php')
61 );
62
63 wp_localize_script( 'enteraddons-admin-ajax', 'enteraddonsAdmin', $args );
64 }
65 }
66
67 public static function admin_footer_inject() {
68
69 if( \Enteraddons\Classes\Helper::is_pro_active() ) {
70 return;
71 }
72
73 ?>
74 <style>
75 .ea-admin-modal-wrap {
76 display: none;
77 position: fixed;
78 top: 0;
79 left: 0;
80 right: 0;
81 bottom: 0;
82 background: rgba(0, 0, 0, 0.2);
83 z-index: 9999999;
84 }
85 .ea-admin-modal-wrap .ea-admin-modal-dialogue {
86 position: absolute;
87 top: 0;
88 left: 0;
89 right: 0;
90 bottom: 0;
91 display: -webkit-box;
92 display: -ms-flexbox;
93 display: flex;
94 -webkit-box-pack: center;
95 -ms-flex-pack: center;
96 justify-content: center;
97 -webkit-box-align: center;
98 -ms-flex-align: center;
99 align-items: center;
100
101 }
102 .ea-admin-modal-wrap .ea-admin-modal-dialogue .ea-modal {
103 width: 100%;
104 max-width: 450px;
105 background: #ffffff;
106 -webkit-box-shadow: 0px 40px 120px rgba(23, 57, 97, 0.1);
107 box-shadow: 0px 40px 120px rgba(23, 57, 97, 0.1);
108 border-radius: 5px;
109 max-height: 90vh;
110 overflow-y: auto;
111 }
112 .ea-admin-modal-wrap .ea-modal-body .ea-modal-close {
113 position: absolute;
114 top: 16px;
115 right: 15px;
116 color: #ffffff;
117 background: #eb0c0c;
118 width: 25px;
119 display: flex;
120 height: 25px;
121 justify-content: center;
122 align-items: center;
123 font-size: 16px;
124 border-radius: 42px;
125 text-decoration: none;
126 }
127 .ea-admin-modal-wrap .ea-modal-body {
128 position: relative;
129 }
130 .ea-admin-modal-wrap .ea-modal-content {
131 padding: 30px;
132 text-align: center;
133 }
134 .ea-admin-modal-wrap .ea-modal-card h3 {
135 font-size: 22px;
136 color: #041137;
137 font-weight: 500;
138 margin-bottom: 10px;
139 }
140 .ea-admin-modal-wrap .ea-modal-card p {
141 font-size: 14px;
142 font-weight: 400;
143 color: #727272;
144 margin-bottom: 20px;
145 }
146 .ea-admin-modal-wrap .ea-modal-card .ea-image {
147 margin-bottom: 20px;
148 }
149 .ea-admin-modal-wrap .ea-modal-card .ea-image img {
150 width: 160px;
151 }
152 </style>
153 <div class="ea-admin-modal-wrap ea-modal-show">
154 <div class="ea-admin-modal-dialogue">
155 <div class="ea-modal">
156 <div class="ea-modal-body">
157 <a href="#" class="ea-modal-close ea-admin-popup-close">X</a>
158 <div id="ea-pro-popup" class="ea-modal-content">
159 <div class="ea-modal-card">
160 <div class="ea-image">
161 <img src="<?php echo esc_url( ENTERADDONS_DIR_ADMIN_ASSETS.'img/pro.svg' ); ?>">
162 </div>
163 <h3><?php esc_html_e( 'Go PRO', 'enteraddons' ); ?></h3>
164 <p><?php esc_html_e( 'Unlock more premium Widgets, Templates, Blocks and possibilities to build awesome websites.', 'enteraddons' ); ?></p>
165 <a target="_blank" href="https://enteraddons.com/pricing/" class="btn s-btn"><?php esc_html_e( 'Upgrade Now', 'enteraddons' ); ?></a>
166 </div>
167 </div>
168 </div>
169 </div>
170 </div>
171 </div>
172 <?php
173 }
174
175 }
176
177 }
178