| @@ -1,5 +1,6 @@ | ||
| 1 | 1 | <?php |
| 2 | + | |
| 2 | 3 | namespace UiCoreElements; |
| 3 | 4 | |
| 4 | 5 | /** |
| 5 | 6 | * Scripts and Styles Class |
| @@ -10,62 +11,79 @@ | ||
| 10 | 11 | { |
| 11 | 12 | $this->init_utils(); |
| 12 | 13 | |
| 13 | 14 | require_once UICORE_ELEMENTS_INCLUDES . '/class-widget-base.php'; |
| 14 | - if(!class_exists('\UiCoreAnimate\Base')){ | |
| 15 | + require_once UICORE_ELEMENTS_INCLUDES . '/class-nested-widget-base.php'; | |
| 16 | + if (!class_exists('\UiCoreAnimate\Base')) { | |
| 15 | 17 | require_once UICORE_ELEMENTS_INCLUDES . '/class-animate.php'; |
| 16 | - } | |
| 18 | + } | |
| 17 | 19 | |
| 18 | 20 | |
| 19 | 21 | add_action('elementor/elements/categories_registered', [$this, 'create_custom_category'], 999); |
| 22 | + add_action('elementor/widgets/widgets_registered', [$this, 'extend_widgets'], 999); | |
| 20 | 23 | add_action('elementor/controls/register', [$this, 'init_controls']); |
| 21 | 24 | add_action('elementor/widgets/register', [$this, 'init_widgets']); |
| 22 | - | |
| 23 | - // WPML String Translation plugin exist check | |
| 24 | - if ( defined( 'WPML_ST_VERSION' ) ) { | |
| 25 | - | |
| 26 | - if ( class_exists( 'WPML_Elementor_Module_With_Items' ) ) { | |
| 27 | - $this->load_wpml_modules(); | |
| 28 | - } | |
| 29 | - | |
| 30 | - add_filter( 'wpml_elementor_widgets_to_translate', [$this, 'add_translatable_nodes'] ); | |
| 31 | - } | |
| 32 | - | |
| 33 | 25 | } |
| 34 | 26 | |
| 35 | 27 | public function init_widgets() |
| 36 | 28 | { |
| 37 | - //Only working with UiCore Framework | |
| 38 | - if(defined('UICORE_ASSETS')){ | |
| 39 | - require_once UICORE_ELEMENTS_INCLUDES . '/widgets/post-grid.php'; | |
| 40 | - } | |
| 41 | - | |
| 29 | + // Generic widgets | |
| 42 | 30 | require_once UICORE_ELEMENTS_INCLUDES . '/widgets/highlighted-text.php'; |
| 43 | - require_once UICORE_ELEMENTS_INCLUDES . '/widgets/advanced-post-grid.php'; | |
| 44 | - require_once UICORE_ELEMENTS_INCLUDES . '/widgets/advanced-post-carousel.php'; | |
| 31 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/icon-list.php'; | |
| 45 | 32 | require_once UICORE_ELEMENTS_INCLUDES . '/widgets/counter.php'; |
| 46 | 33 | require_once UICORE_ELEMENTS_INCLUDES . '/widgets/icon-box.php'; |
| 47 | 34 | require_once UICORE_ELEMENTS_INCLUDES . '/widgets/accordion.php'; |
| 48 | - require_once UICORE_ELEMENTS_INCLUDES . '/widgets/icon-list.php'; | |
| 35 | + | |
| 36 | + // Gallery Widgets | |
| 37 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/gallery-grid.php'; | |
| 38 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/gallery-carousel.php'; | |
| 39 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/gallery-slider.php'; | |
| 40 | + | |
| 41 | + // Post Widgets | |
| 42 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/advanced-post-grid.php'; | |
| 43 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/advanced-post-carousel.php'; | |
| 44 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/advanced-product-grid.php'; | |
| 45 | + | |
| 46 | + // Testimonial widgets | |
| 49 | 47 | require_once UICORE_ELEMENTS_INCLUDES . '/widgets/testimonial-grid.php'; |
| 50 | 48 | require_once UICORE_ELEMENTS_INCLUDES . '/widgets/testimonial-carousel.php'; |
| 51 | 49 | require_once UICORE_ELEMENTS_INCLUDES . '/widgets/testimonial-slider.php'; |
| 50 | + | |
| 51 | + // Logo widgets | |
| 52 | 52 | require_once UICORE_ELEMENTS_INCLUDES . '/widgets/logo-grid.php'; |
| 53 | 53 | require_once UICORE_ELEMENTS_INCLUDES . '/widgets/logo-carousel.php'; |
| 54 | 54 | |
| 55 | + // Form widgets | |
| 56 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/contact-form.php'; | |
| 57 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/newsletter.php'; | |
| 58 | + | |
| 59 | + // Nested feature widgets | |
| 60 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/tabs.php'; | |
| 61 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/custom-carousel.php'; | |
| 62 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/custom-slider.php'; | |
| 63 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/custom-table.php'; | |
| 64 | + | |
| 65 | + // Theme Builder widgets | |
| 55 | 66 | require_once UICORE_ELEMENTS_INCLUDES . '/widgets/theme-builder/the-content.php'; |
| 56 | 67 | require_once UICORE_ELEMENTS_INCLUDES . '/widgets/theme-builder/the-title.php'; |
| 57 | 68 | require_once UICORE_ELEMENTS_INCLUDES . '/widgets/theme-builder/post-meta.php'; |
| 58 | 69 | require_once UICORE_ELEMENTS_INCLUDES . '/widgets/theme-builder/page-description.php'; |
| 70 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/theme-builder/post-featured-image.php'; | |
| 71 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/theme-builder/advanced-menu.php'; | |
| 72 | + | |
| 73 | + // Dependent on Uicore Framework | |
| 74 | + if (defined('UICORE_ASSETS')) { | |
| 75 | + require_once UICORE_ELEMENTS_INCLUDES . '/widgets/post-grid.php'; | |
| 76 | + } | |
| 59 | 77 | } |
| 60 | 78 | |
| 61 | 79 | |
| 62 | 80 | public function init_controls() |
| 63 | 81 | { |
| 64 | - require UICORE_ELEMENTS_INCLUDES . '/controls/class-post-filter-control.php'; | |
| 82 | + require_once UICORE_ELEMENTS_INCLUDES . '/controls/class-post-filter-control.php'; | |
| 83 | + require_once UICORE_ELEMENTS_INCLUDES . '/controls/class-product-filter-control.php'; | |
| 65 | 84 | } |
| 66 | 85 | |
| 67 | - | |
| 68 | 86 | public function init_utils() |
| 69 | 87 | { |
| 70 | 88 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/grid-component.php'; |
| 71 | 89 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/carousel-component.php'; |
| @@ -70,8 +88,9 @@ | ||
| 70 | 88 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/grid-component.php'; |
| 71 | 89 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/carousel-component.php'; |
| 72 | 90 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/testimonial-component.php'; |
| 73 | 91 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/logo-component.php'; |
| 92 | + require_once UICORE_ELEMENTS_INCLUDES . '/utils/gallery-component.php'; | |
| 74 | 93 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/animation-component.php'; |
| 75 | 94 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/meta-component.php'; |
| 76 | 95 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/pagination-component.php'; |
| 77 | 96 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/post-filter-component.php'; |
| @@ -76,10 +95,19 @@ | ||
| 76 | 95 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/pagination-component.php'; |
| 77 | 96 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/post-filter-component.php'; |
| 78 | 97 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/item-style-component.php'; |
| 79 | 98 | require_once UICORE_ELEMENTS_INCLUDES . '/utils/post-component.php'; |
| 99 | + require_once UICORE_ELEMENTS_INCLUDES . '/utils/product-component.php'; | |
| 100 | + require_once UICORE_ELEMENTS_INCLUDES . '/utils/form-service.php'; | |
| 101 | + require_once UICORE_ELEMENTS_INCLUDES . '/utils/newsletter-services.php'; | |
| 102 | + require_once UICORE_ELEMENTS_INCLUDES . '/utils/form-component.php'; | |
| 80 | 103 | } |
| 81 | 104 | |
| 105 | + public function extend_widgets() | |
| 106 | + { | |
| 107 | + require UICORE_ELEMENTS_INCLUDES . '/controls/class-lightbox-button.php'; | |
| 108 | + } | |
| 109 | + | |
| 82 | 110 | function create_custom_category($elements_manager) |
| 83 | 111 | { |
| 84 | 112 | $elements_manager->add_category('uicore', [ |
| 85 | 113 | 'title' => __('UiCore', 'uicore-elements'), |
| @@ -84,21 +112,6 @@ | ||
| 84 | 112 | $elements_manager->add_category('uicore', [ |
| 85 | 113 | 'title' => __('UiCore', 'uicore-elements'), |
| 86 | 114 | 'icon' => 'fa fa-plug', |
| 87 | 115 | ]); |
| 88 | - } | |
| 89 | - | |
| 90 | - function load_wpml_modules() | |
| 91 | - { | |
| 92 | - require_once( UICORE_ELEMENTS_INCLUDES. '/compatibility/class-wpml-ui-highlighted-text.php'); | |
| 93 | - } | |
| 94 | - | |
| 95 | - function add_translatable_nodes( $nodes_to_translate ) | |
| 96 | - { | |
| 97 | - $nodes_to_translate[ 'highlighted-text' ] = [ | |
| 98 | - 'conditions' => [ 'widgetType' => 'highlighted-text' ], | |
| 99 | - 'fields' => [], | |
| 100 | - 'integration-class' => '\UiCoreElements\Compatibility\WPML_UI_HighlightedText', | |
| 101 | - ]; | |
| 102 | - return $nodes_to_translate; | |
| 103 | 116 | } |
| 104 | 117 | } |