assets
5 months ago
includes
5 months ago
pages
2 months ago
boot.php
5 months ago
index.php
5 months ago
boot.php
102 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Factory Templates |
| 4 | * |
| 5 | * @since 1.0.2 |
| 6 | * @package clearfy |
| 7 | */ |
| 8 | |
| 9 | // Exit if accessed directly |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; |
| 12 | } |
| 13 | |
| 14 | if ( defined( 'FACTORY_TEMPLATES_759_LOADED' ) ) { |
| 15 | return; |
| 16 | } |
| 17 | |
| 18 | define( 'FACTORY_TEMPLATES_759_LOADED', true ); |
| 19 | define( 'FACTORY_TEMPLATES_759', '1.3.4' ); |
| 20 | |
| 21 | define( 'FACTORY_TEMPLATES_759_DIR', __DIR__ ); |
| 22 | define( 'FACTORY_TEMPLATES_759_URL', plugins_url( '', __FILE__ ) ); |
| 23 | |
| 24 | add_action( |
| 25 | 'init', |
| 26 | function () { |
| 27 | load_plugin_textdomain( 'robin-image-optimizer', false, dirname( plugin_basename( __FILE__ ) ) . '/langs' ); |
| 28 | } |
| 29 | ); |
| 30 | |
| 31 | require FACTORY_TEMPLATES_759_DIR . '/includes/ajax-handlers.php'; |
| 32 | require FACTORY_TEMPLATES_759_DIR . '/includes/class-helpers.php'; |
| 33 | require FACTORY_TEMPLATES_759_DIR . '/includes/class-configurate.php'; |
| 34 | |
| 35 | // module provides function only for the admin area |
| 36 | if ( is_admin() ) { |
| 37 | /** |
| 38 | * Подключаем скрипты для установки компонентов |
| 39 | * на все страницы админпанели. |
| 40 | */ |
| 41 | add_action( |
| 42 | 'admin_enqueue_scripts', |
| 43 | function ( $hook ) { |
| 44 | wp_enqueue_script( |
| 45 | 'wbcr-factory-templates-759-global', |
| 46 | FACTORY_TEMPLATES_759_URL . '/assets/js/clearfy-globals.js', |
| 47 | [ |
| 48 | 'jquery', |
| 49 | 'wfactory-600-core-general', |
| 50 | ], |
| 51 | FACTORY_TEMPLATES_759 |
| 52 | ); |
| 53 | |
| 54 | require_once FACTORY_TEMPLATES_759_DIR . '/includes/class-search-options.php'; |
| 55 | $all_options = \WBCR\Factory_Templates_759\Search_Options::get_all_options(); |
| 56 | |
| 57 | if ( empty( $all_options ) ) { |
| 58 | return; |
| 59 | } |
| 60 | |
| 61 | $allow_print_data = false; |
| 62 | $formated_options = []; |
| 63 | |
| 64 | foreach ( $all_options as $option ) { |
| 65 | // if( !$allow_print_data && isset($_GET['page']) && $option['page_id'] === $_GET['page'] ) { |
| 66 | // $allow_print_data = true; |
| 67 | // } |
| 68 | |
| 69 | $formated_options[] = [ |
| 70 | 'value' => $option['title'], |
| 71 | 'data' => [ |
| 72 | // 'hint' => isset($option['hint']) ? $option['hint'] : '', |
| 73 | 'page_url' => $option['page_url'], |
| 74 | 'page_id' => $option['page_id'], |
| 75 | ], |
| 76 | ]; |
| 77 | } |
| 78 | |
| 79 | // if( !$allow_print_data ) { |
| 80 | // return; |
| 81 | // } |
| 82 | |
| 83 | wp_localize_script( 'wbcr-factory-templates-759-global', 'wfactory_clearfy_search_options', $formated_options ); |
| 84 | } |
| 85 | ); |
| 86 | |
| 87 | if ( defined( 'FACTORY_PAGES_600_LOADED' ) ) { |
| 88 | require FACTORY_TEMPLATES_759_DIR . '/pages/templates/impressive/class-page-template-impressive.php'; |
| 89 | require FACTORY_TEMPLATES_759_DIR . '/pages/templates/impressive/class-pages.php'; |
| 90 | require FACTORY_TEMPLATES_759_DIR . '/pages/templates/impressive-lite/class-page-template-impressive-lite.php'; |
| 91 | |
| 92 | require FACTORY_TEMPLATES_759_DIR . '/pages/class-page-more-features.php'; |
| 93 | require FACTORY_TEMPLATES_759_DIR . '/pages/class-page-license.php'; |
| 94 | require FACTORY_TEMPLATES_759_DIR . '/pages/class-pages-components.php'; |
| 95 | |
| 96 | require FACTORY_TEMPLATES_759_DIR . '/pages/setup-parts/class-step.php'; |
| 97 | require FACTORY_TEMPLATES_759_DIR . '/pages/setup-parts/class-step-form.php'; |
| 98 | require FACTORY_TEMPLATES_759_DIR . '/pages/setup-parts/class-step-custom.php'; |
| 99 | require FACTORY_TEMPLATES_759_DIR . '/pages/class-page-setup.php'; |
| 100 | } |
| 101 | } |
| 102 |