PluginProbe
HT Builder – WordPress Theme Builder for Elementor / 1.2.4
HT Builder – WordPress Theme Builder for Elementor v1.2.4
1.3.5 1.3.4 trunk 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.8 1.0.9 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3
ht-builder / includes / admin / admin-setting.php

admin-setting.php in HT Builder – WordPress Theme Builder for Elementor 1.2.4, at includes/admin/admin-setting.php

567 lines 24.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly.
4
5 require( __DIR__ . '/classes/class.settings-api.php' );
6
7 class HTBuilder_Admin_Settings {
8
9 private $settings_api;
10
11 function __construct() {
12 $this->settings_api = new HTBuilder_Settings_API();
13 add_action( 'admin_init', [ $this, 'admin_init' ] );
14 add_action( 'admin_menu', [ $this, 'admin_menu' ], 220 );
15 add_action('admin_enqueue_scripts', [ $this, 'enqueue_admin_scripts' ] );
16 add_action( 'wsa_form_bottom_htbuilder_general_tabs', [ $this, 'html_general_tabs' ] );
17 add_action( 'wsa_form_top_htbuilder_element_tabs', [ $this, 'html_popup_box' ] );
18 }
19
20 // Admin Initialize
21 function admin_init() {
22
23 //set the settings
24 $this->settings_api->set_sections( $this->admin_get_settings_sections() );
25 $this->settings_api->set_fields( $this->admin_fields_settings() );
26
27 //initialize settings
28 $this->settings_api->admin_init();
29 }
30
31 // Plugins menu Register
32 function admin_menu() {
33 add_menu_page(
34 __( 'HT Builder', 'ht-builder' ),
35 __( 'HT Builder', 'ht-builder' ),
36 'manage_options',
37 'htbuilder',
38 array ( $this, 'plugin_page' ),
39 'dashicons-text-page',
40 100
41 );
42 }
43
44 // Admin Scripts
45 public function enqueue_admin_scripts(){
46
47 // wp core styles
48 wp_enqueue_style( 'wp-jquery-ui-dialog' );
49 // wp core scripts
50 wp_enqueue_script( 'jquery-ui-dialog' );
51
52 wp_enqueue_style( 'htbuilder-admin', HTBUILDER_PL_URL . 'includes/admin/assets/css/admin_optionspanel.css', FALSE, HTBUILDER_VERSION );
53
54 wp_enqueue_script( 'htbuilder-admin', HTBUILDER_PL_URL . 'includes/admin/assets/js/admin_scripts.js', array('jquery'), HTBUILDER_VERSION, TRUE );
55 }
56
57 // Options page Section register
58 function admin_get_settings_sections() {
59 $sections = array(
60
61 array(
62 'id' => 'htbuilder_general_tabs',
63 'title' => esc_html__( 'General', 'ht-builder' )
64 ),
65
66 array(
67 'id' => 'htbuilder_templatebuilder_tabs',
68 'title' => esc_html__( 'Template Builder', 'ht-builder' )
69 ),
70
71 array(
72 'id' => 'htbuilder_element_tabs',
73 'title' => esc_html__( 'Elements', 'ht-builder' )
74 ),
75
76 );
77 return $sections;
78 }
79
80 // Options page field register
81 protected function admin_fields_settings() {
82
83 $settings_fields = array(
84
85 'htbuilder_general_tabs' => array(),
86
87 'htbuilder_templatebuilder_tabs' => array(
88
89 array(
90 'name' => 'enablecustomtemplate',
91 'label' => __( 'Enable Custom template Layout', 'ht-builder' ),
92 'desc' => __( 'Enable', 'ht-builder' ),
93 'type' => 'checkbox',
94 'default' => 'on',
95 'class'=>'htbuilder_table_row',
96 ),
97
98 array(
99 'name' => 'single_blog_page',
100 'label' => __( 'Single Blog Template.', 'ht-builder' ),
101 'desc' => __( 'You can select Single blog page from here.', 'ht-builder' ),
102 'type' => 'select',
103 'default' => '0',
104 'options' => htbuilder_elementor_template()
105 ),
106
107 array(
108 'name' => 'archive_blog_page',
109 'label' => __( 'Blog Template.', 'ht-builder' ),
110 'desc' => __( 'You can select blog page from here.', 'ht-builder' ),
111 'type' => 'select',
112 'default' => '0',
113 'options' => htbuilder_elementor_template()
114 ),
115
116 array(
117 'name' => 'header_page',
118 'label' => __( 'Header Template.', 'ht-builder' ),
119 'desc' => __( 'You can select header template from here.', 'ht-builder' ),
120 'type' => 'select',
121 'default' => '0',
122 'options' => htbuilder_elementor_template()
123 ),
124
125 array(
126 'name' => 'footer_page',
127 'label' => __( 'Footer Template.', 'ht-builder' ),
128 'desc' => __( 'You can select footer template from here.', 'ht-builder' ),
129 'type' => 'select',
130 'default' => '0',
131 'options' => htbuilder_elementor_template()
132 ),
133
134 array(
135 'name' => 'search_pagep',
136 'label' => __( 'Search Page Template.', 'ht-builder' ),
137 'desc' => __( 'You can select search page from here. <span>( Pro )</span>', 'ht-builder' ),
138 'type' => 'select',
139 'default' => 'select',
140 'options' => array(
141 'select'=>'Select Template',
142 ),
143 'class'=>'htproelement',
144 ),
145
146 array(
147 'name' => 'error_pagep',
148 'label' => __( '404 Page Template.', 'ht-builder-pro' ),
149 'desc' => __( 'You can select 404 page from here. <span>( Pro )</span>', 'ht-builder-pro' ),
150 'type' => 'select',
151 'default' => '0',
152 'options' => array(
153 'select'=>'Select Template',
154 ),
155 'class' =>'htproelement',
156 ),
157
158 array(
159 'name' => 'coming_soon_pagep',
160 'label' => __( 'Coming Soon Page Template.', 'ht-builder-pro' ),
161 'desc' => __( 'You can select coming soon page from here. <span>( Pro )</span>', 'ht-builder-pro' ),
162 'type' => 'select',
163 'default' => '0',
164 'options' => array(
165 'select'=>'Select Template',
166 ),
167 'class' =>'htproelement',
168 ),
169
170 ),
171
172 'htbuilder_element_tabs'=>array(
173
174 array(
175 'name' => 'bl_post_title',
176 'label' => __( 'Post Title', 'ht-builder' ),
177 'desc' => __( 'Post Title', 'ht-builder' ),
178 'type' => 'checkbox',
179 'default' => 'on',
180 'class'=>'htbuilder_table_row',
181 ),
182
183 array(
184 'name' => 'bl_post_featured_image',
185 'label' => __( 'Post Featured Image', 'ht-builder' ),
186 'desc' => __( 'Post Featured Image', 'ht-builder' ),
187 'type' => 'checkbox',
188 'default' => 'on',
189 'class'=>'htbuilder_table_row',
190 ),
191
192 array(
193 'name' => 'bl_post_meta_info',
194 'label' => __( 'Post Meta Info', 'ht-builder' ),
195 'desc' => __( 'Post Meta Info', 'ht-builder' ),
196 'type' => 'checkbox',
197 'default' => 'on',
198 'class'=>'htbuilder_table_row',
199 ),
200
201 array(
202 'name' => 'bl_post_excerpt',
203 'label' => __( 'Post Excerpt', 'ht-builder' ),
204 'desc' => __( 'Post Excerpt', 'ht-builder' ),
205 'type' => 'checkbox',
206 'default' => 'on',
207 'class'=>'htbuilder_table_row',
208 ),
209
210 array(
211 'name' => 'bl_post_content',
212 'label' => __( 'Post Content', 'ht-builder' ),
213 'desc' => __( 'Post Content', 'ht-builder' ),
214 'type' => 'checkbox',
215 'default' => 'on',
216 'class'=>'htbuilder_table_row',
217 ),
218
219 array(
220 'name' => 'bl_post_comments',
221 'label' => __( 'Post Comments', 'ht-builder' ),
222 'desc' => __( 'Post Comments', 'ht-builder' ),
223 'type' => 'checkbox',
224 'default' => 'on',
225 'class'=>'htbuilder_table_row',
226 ),
227
228 array(
229 'name' => 'bl_post_search_form',
230 'label' => __( 'Post Search Form', 'ht-builder' ),
231 'desc' => __( 'Post Search Form', 'ht-builder' ),
232 'type' => 'checkbox',
233 'default' => 'on',
234 'class'=>'htbuilder_table_row',
235 ),
236
237 array(
238 'name' => 'bl_post_archive',
239 'label' => __( 'Archive Posts', 'ht-builder' ),
240 'desc' => __( 'Archive Posts', 'ht-builder' ),
241 'type' => 'checkbox',
242 'default' => 'on',
243 'class'=>'htbuilder_table_row',
244 ),
245
246 array(
247 'name' => 'bl_post_archive_title',
248 'label' => __( 'Archive Title', 'ht-builder' ),
249 'desc' => __( 'Archive Title', 'ht-builder' ),
250 'type' => 'checkbox',
251 'default' => 'on',
252 'class'=>'htbuilder_table_row',
253 ),
254
255 array(
256 'name' => 'bl_page_title',
257 'label' => __( 'Page Title', 'ht-builder' ),
258 'desc' => __( 'Page Title', 'ht-builder' ),
259 'type' => 'checkbox',
260 'default' => 'on',
261 'class'=>'htbuilder_table_row',
262 ),
263
264 array(
265 'name' => 'bl_site_title',
266 'label' => __( 'Site Title', 'ht-builder' ),
267 'desc' => __( 'Site Title', 'ht-builder' ),
268 'type' => 'checkbox',
269 'default' => 'on',
270 'class'=>'htbuilder_table_row',
271 ),
272
273 array(
274 'name' => 'bl_site_logo',
275 'label' => __( 'Site Logo', 'ht-builder' ),
276 'desc' => __( 'Site Logo', 'ht-builder' ),
277 'type' => 'checkbox',
278 'default' => 'on',
279 'class'=>'htbuilder_table_row',
280 ),
281
282 array(
283 'name' => 'bl_nav_menu',
284 'label' => __( 'Nav Menu', 'ht-builder' ),
285 'desc' => __( 'Nav Menu', 'ht-builder' ),
286 'type' => 'checkbox',
287 'default' => 'on',
288 'class'=>'htbuilder_table_row',
289 ),
290
291 array(
292 'name' => 'bl_post_author_info',
293 'label' => __( 'Author Info', 'ht-builder' ),
294 'desc' => __( 'Author Info', 'ht-builder' ),
295 'type' => 'checkbox',
296 'default' => 'on',
297 'class'=>'htbuilder_table_row',
298 ),
299
300 array(
301 'name' => 'bl_social_sharep',
302 'label' => __( 'Social Share <span>( Pro )</span>', 'ht-builder' ),
303 'desc' => __( 'Social share', 'ht-builder' ),
304 'type' => 'checkbox',
305 'default' => 'off',
306 'class'=>'htbuilder_table_row pro',
307 ),
308
309 array(
310 'name' => 'bl_print_pagep',
311 'label' => __( 'Print Page <span>( Pro )</span>', 'ht-builder' ),
312 'desc' => __( 'Print Page', 'ht-builder' ),
313 'type' => 'checkbox',
314 'default' => 'off',
315 'class'=>'htbuilder_table_row pro',
316 ),
317
318 array(
319 'name' => 'bl_view_counterp',
320 'label' => __( 'View Counter <span>( Pro )</span>', 'ht-builder' ),
321 'desc' => __( 'View Counter', 'ht-builder-pro' ),
322 'type' => 'checkbox',
323 'default' => 'off',
324 'class'=>'htbuilder_table_row pro',
325 ),
326
327 array(
328 'name' => 'bl_post_navigationp',
329 'label' => __( 'Post Navigation <span>( Pro )</span>', 'ht-builder-pro' ),
330 'desc' => __( 'Post Navigation', 'ht-builder-pro' ),
331 'type' => 'checkbox',
332 'default' => 'off',
333 'class'=>'htbuilder_table_row pro',
334 ),
335
336 array(
337 'name' => 'bl_related_postp',
338 'label' => __( 'Related Post <span>( Pro )</span>', 'ht-builder-pro' ),
339 'desc' => __( 'Related Post', 'ht-builder-pro' ),
340 'type' => 'checkbox',
341 'default' => 'off',
342 'class'=>'htbuilder_table_row pro',
343 ),
344
345 array(
346 'name' => 'bl_popular_postp',
347 'label' => __( 'Popular Post <span>( Pro )</span>', 'ht-builder-pro' ),
348 'desc' => __( 'Popular Post', 'ht-builder-pro' ),
349 'type' => 'checkbox',
350 'default' => 'off',
351 'class'=>'htbuilder_table_row pro',
352 ),
353
354
355 ),
356
357 );
358
359 return array_merge( $settings_fields );
360 }
361
362 // Admin Menu Page Render
363 function plugin_page() {
364
365 echo '<div class="wrap">';
366 echo '<h2>'.esc_html__( 'HT Builder Settings','ht-builder' ).'</h2>';
367 $this->save_message();
368 $this->settings_api->show_navigation();
369 $this->settings_api->show_forms();
370 echo '</div>';
371
372 }
373
374 // Save Options Message
375 function save_message() {
376 if( isset($_GET['settings-updated']) ) { ?>
377 <div class="updated notice is-dismissible">
378 <p><strong><?php esc_html_e('Successfully Settings Saved.', 'ht-builder') ?></strong></p>
379 </div>
380 <?php
381 }
382 }
383
384 // Pop up Box
385 function html_popup_box(){
386 ob_start();
387 ?>
388 <div id="htbuilder-dialog" title="<?php esc_html_e( 'Go Premium', 'ht-builder' ); ?>" style="display: none;">
389 <div class="htdialog-content">
390 <span><i class="dashicons dashicons-warning"></i></span>
391 <p>
392 <?php
393 echo __('Purchase our','ht-builder').' <strong><a href="'.esc_url( 'https://hasthemes.com/plugins/ht-builder-wordpress-theme-builder-for-elementor/' ).'" target="_blank" rel="nofollow">'.__( 'premium version', 'ht-builder' ).'</a></strong> '.__('to unlock these pro elements!','ht-builder');
394 ?>
395 </p>
396 </div>
397 </div>
398 <script type="text/javascript">
399 ( function( $ ) {
400
401 $(function() {
402 $( '.htbuilder_table_row.pro,.htproelement label' ).click(function() {
403 $( "#htbuilder-dialog" ).dialog({
404 modal: true,
405 minWidth: 500,
406 buttons: {
407 Ok: function() {
408 $( this ).dialog( "close" );
409 }
410 }
411 });
412 });
413 $(".htbuilder_table_row.pro input[type='checkbox'],.htproelement select").attr("disabled", true);
414 });
415
416 } )( jQuery );
417 </script>
418 <?php
419 echo ob_get_clean();
420 }
421
422 // General tab
423 function html_general_tabs(){
424 ob_start();
425 ?>
426 <div class="htbuilder-general-tabs">
427
428 <div class="htbuilder-document-section">
429 <div class="htbuilder-column">
430 <a href="https://hasthemes.com/blog-category/ht-builder/" target="_blank">
431 <img src="<?php echo HTBUILDER_PL_URL; ?>/includes/admin/assets/images/video-tutorial.jpg" alt="<?php esc_attr_e( 'Video Tutorial', 'ht-builder' ); ?>">
432 </a>
433 </div>
434 <div class="htbuilder-column">
435 <a href="https://hasthemes.com/blog-category/ht-builder/" target="_blank">
436 <img src="<?php echo HTBUILDER_PL_URL; ?>/includes/admin/assets/images/online-documentation.jpg" alt="<?php esc_attr_e( 'Online Documentation', 'ht-builder' ); ?>">
437 </a>
438 </div>
439 <div class="htbuilder-column">
440 <a href="https://hasthemes.com/contact-us/" target="_blank">
441 <img src="<?php echo HTBUILDER_PL_URL; ?>/includes/admin/assets/images/genral-contact-us.jpg" alt="<?php esc_attr_e( 'Contact Us', 'ht-builder' ); ?>">
442 </a>
443 </div>
444 </div>
445
446 <div class="different-pro-free">
447 <h3 class="htbuilder-section-title">HT Builder Free VS HT Builder Pro.</h3>
448 <div class="htbuilder-admin-row">
449 <div class="features-list-area">
450 <h3>HT Builder Free</h3>
451 <ul>
452 <li>14 Elements</li>
453 <li>Blog Page Builder</li>
454 <li>Single Blog Page Builder</li>
455 <li>Header Builder</li>
456 <li>Footer Builder</li>
457 <li>1 Readymade header to import</li>
458 <li>1 Readymade footer to import</li>
459 <li class="htdel"><del>Blog Search Page Builder</del></li>
460 <li class="htdel"><del>404 Error Page Builder</del></li>
461 <li class="htdel"><del>Coming soon Page Builder</del></li>
462 <li class="htdel"><del>Blog Archive Category Wise Individual layout</del></li>
463 <li class="htdel"><del>Blog Archive Tag Wise Individual layout</del></li>
464 </ul>
465 <a target="_blank" href="<?php echo esc_url( admin_url() ); ?>/plugin-install.php" class="button button-primary">Install Now</a>
466 </div>
467 <div class="features-list-area">
468 <h3>HT Builder Pro</h3>
469 <ul>
470 <li>20 Elements</li>
471 <li>Blog Page Builder</li>
472 <li>Single Blog Page Builder</li>
473 <li>Header Builder</li>
474 <li>Footer Builder</li>
475 <li>10 Readymade headers to import</li>
476 <li>10 Readymade footers to import</li>
477 <li>Blog Search Page Builder</li>
478 <li>404 Error Page Builder</li>
479 <li>Coming soon Page Builder</li>
480 <li>Blog Archive Category Wise Individual layout</li>
481 <li>Blog Archive Tag Wise Individual layout</li>
482 </ul>
483 <a target="_blank" href="https://hasthemes.com/plugins/ht-builder-wordpress-theme-builder-for-elementor/" class="button button-primary">Buy Now</a>
484 </div>
485 </div>
486
487 </div>
488
489 </div>
490 <?php
491 echo ob_get_clean();
492 }
493
494 // Plugins Library
495 function html_our_plugins_library_tabs() {
496 ob_start();
497 ?>
498 <div class="htoptions-plugins-laibrary">
499 <p><?php echo esc_html__( 'Use Our plugins.', 'ht-builder' ); ?></p>
500 <div class="htoptions-plugins-area">
501 <h3><?php esc_html_e( 'Premium Plugins', 'ht-builder' ); ?></h3>
502 <div class="htoptions-plugins-row">
503
504 <div class="htoptions-single-plugins"><img src="<?php echo HTBUILDER_PL_URL; ?>/includes/admin/assets/images/preview_woolentor-pro.jpg" alt="">
505 <div class="htoptions-plugins-content">
506 <a href="https://hasthemes.com/plugins/woolentor-pro-woocommerce-page-builder/" target="_blank">
507 <h3><?php echo esc_html__( 'WooLentor - WooCommerce Page Builder and WooCommerce Elementor Addon', 'ht-builder' ); ?></h3>
508 </a>
509 <a href="https://hasthemes.com/plugins/woolentor-pro-woocommerce-page-builder/" class="htoptions-button" target="_blank"><?php echo esc_html__( 'More Details', 'ht-builder' ); ?></a>
510 </div>
511 </div>
512
513 <div class="htoptions-single-plugins"><img src="<?php echo HTBUILDER_PL_URL; ?>/includes/admin/assets/images/htmega_preview.jpg" alt="">
514 <div class="htoptions-plugins-content">
515 <a href="https://hasthemes.com/plugins/ht-mega-pro/" target="_blank">
516 <h3><?php echo esc_html__( 'HT Mega – Absolute Addons for Elementor Page Builder', 'ht-builder' ); ?></h3>
517 </a>
518 <a href="https://hasthemes.com/plugins/ht-mega-pro/" class="htoptions-button" target="_blank"><?php echo esc_html__( 'More Details', 'ht-builder' ); ?></a>
519 </div>
520 </div>
521
522 <div class="htoptions-single-plugins"><img src="<?php echo HTBUILDER_PL_URL; ?>/includes/admin/assets/images/hasbarpro-preview.jpg" alt="">
523 <div class="htoptions-plugins-content">
524 <a href="https://hasthemes.com/wordpress-notification-bar-plugin/" target="_blank">
525 <h3><?php echo esc_html__( 'HashBar Pro - WordPress Notification Bar plugin', 'ht-builder' ); ?></h3>
526 </a>
527 <a href="https://hasthemes.com/wordpress-notification-bar-plugin/" class="htoptions-button" target="_blank"><?php echo esc_html__( 'More Details', 'ht-builder' ); ?></a>
528 </div>
529 </div>
530
531 <div class="htoptions-single-plugins"><img src="<?php echo HTBUILDER_PL_URL; ?>/includes/admin/assets/images/htscript-preview.png" alt="">
532 <div class="htoptions-plugins-content">
533 <a href="https://hasthemes.com/plugins/insert-headers-and-footers-code-ht-script/" target="_blank">
534 <h3><?php echo esc_html__( 'HT Script Pro - Insert Header & Footer Code', 'ht-builder' ); ?></h3>
535 </a>
536 <a href="https://hasthemes.com/plugins/insert-headers-and-footers-code-ht-script/" class="htoptions-button" target="_blank"><?php echo esc_html__( 'More Details', 'ht-builder' ); ?></a>
537 </div>
538 </div>
539
540 <div class="htoptions-single-plugins"><img src="<?php echo HTBUILDER_PL_URL; ?>/includes/admin/assets/images/wc-builder_pro.jpg" alt="">
541 <div class="htoptions-plugins-content">
542 <a href="https://hasthemes.com/plugins/wc-builder-woocoomerce-page-builder-for-wpbakery/" target="_blank">
543 <h3><?php echo esc_html__( 'WC Builder - WooCommerce Page Builder for WP Bakery', 'wc-sales-notification-pro' ); ?></h3>
544 </a>
545 <a href="https://hasthemes.com/plugins/wc-builder-woocoomerce-page-builder-for-wpbakery/" class="htoptions-button" target="_blank"><?php echo esc_html__( 'More Details', 'wc-sales-notification-pro' ); ?></a>
546 </div>
547 </div>
548
549 </div>
550
551 <h3><?php esc_html_e( 'Free Plugins', 'ht-builder' ); ?></h3>
552 <div class="htoptions-plugins-row">
553
554 <?php htbuilder_get_org_plugins(); ?>
555
556 </div>
557
558 </div>
559 </div>
560 <?php
561 echo ob_get_clean();
562 }
563
564
565 }
566
567 new HTBuilder_Admin_Settings();