| 1 |
<?php |
| 2 |
namespace UiCoreElements; |
| 3 |
|
| 4 |
/** |
| 5 |
* Scripts and Styles Class |
| 6 |
*/ |
| 7 |
class Elementor |
| 8 |
{ |
| 9 |
public function __construct() |
| 10 |
{ |
| 11 |
$this->init_utils(); |
| 12 |
|
| 13 |
require_once UICORE_ELEMENTS_INCLUDES . '/class-widget-base.php'; |
| 14 |
require_once UICORE_ELEMENTS_INCLUDES . '/class-nested-widget-base.php'; |
| 15 |
if(!class_exists('\UiCoreAnimate\Base')){ |
| 16 |
require_once UICORE_ELEMENTS_INCLUDES . '/class-animate.php'; |
| 17 |
} |
| 18 |
|
| 19 |
|
| 20 |
add_action('elementor/elements/categories_registered', [$this, 'create_custom_category'], 999); |
| 21 |
add_action('elementor/controls/register', [$this, 'init_controls']); |
| 22 |
add_action('elementor/widgets/register', [$this, 'init_widgets']); |
| 23 |
} |
| 24 |
|
| 25 |
public function init_widgets() |
| 26 |
{ |
| 27 |
//Only working with UiCore Framework |
| 28 |
if(defined('UICORE_ASSETS')){ |
| 29 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/post-grid.php'; |
| 30 |
} |
| 31 |
|
| 32 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/highlighted-text.php'; |
| 33 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/advanced-post-grid.php'; |
| 34 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/advanced-post-carousel.php'; |
| 35 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/counter.php'; |
| 36 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/icon-box.php'; |
| 37 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/accordion.php'; |
| 38 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/tabs.php'; |
| 39 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/custom-carousel.php'; |
| 40 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/custom-slider.php'; |
| 41 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/icon-list.php'; |
| 42 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/testimonial-grid.php'; |
| 43 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/testimonial-carousel.php'; |
| 44 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/testimonial-slider.php'; |
| 45 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/logo-grid.php'; |
| 46 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/logo-carousel.php'; |
| 47 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/contact-form.php'; |
| 48 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/newsletter.php'; |
| 49 |
|
| 50 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/theme-builder/the-content.php'; |
| 51 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/theme-builder/the-title.php'; |
| 52 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/theme-builder/post-meta.php'; |
| 53 |
require_once UICORE_ELEMENTS_INCLUDES . '/widgets/theme-builder/page-description.php'; |
| 54 |
} |
| 55 |
|
| 56 |
|
| 57 |
public function init_controls() |
| 58 |
{ |
| 59 |
require UICORE_ELEMENTS_INCLUDES . '/controls/class-post-filter-control.php'; |
| 60 |
} |
| 61 |
|
| 62 |
|
| 63 |
public function init_utils() |
| 64 |
{ |
| 65 |
require_once UICORE_ELEMENTS_INCLUDES . '/utils/grid-component.php'; |
| 66 |
require_once UICORE_ELEMENTS_INCLUDES . '/utils/carousel-component.php'; |
| 67 |
require_once UICORE_ELEMENTS_INCLUDES . '/utils/testimonial-component.php'; |
| 68 |
require_once UICORE_ELEMENTS_INCLUDES . '/utils/logo-component.php'; |
| 69 |
require_once UICORE_ELEMENTS_INCLUDES . '/utils/animation-component.php'; |
| 70 |
require_once UICORE_ELEMENTS_INCLUDES . '/utils/meta-component.php'; |
| 71 |
require_once UICORE_ELEMENTS_INCLUDES . '/utils/pagination-component.php'; |
| 72 |
require_once UICORE_ELEMENTS_INCLUDES . '/utils/post-filter-component.php'; |
| 73 |
require_once UICORE_ELEMENTS_INCLUDES . '/utils/item-style-component.php'; |
| 74 |
require_once UICORE_ELEMENTS_INCLUDES . '/utils/post-component.php'; |
| 75 |
require_once UICORE_ELEMENTS_INCLUDES . '/utils/form-service.php'; |
| 76 |
require_once UICORE_ELEMENTS_INCLUDES . '/utils/form-component.php'; |
| 77 |
} |
| 78 |
|
| 79 |
function create_custom_category($elements_manager) |
| 80 |
{ |
| 81 |
$elements_manager->add_category('uicore', [ |
| 82 |
'title' => __('UiCore', 'uicore-elements'), |
| 83 |
'icon' => 'fa fa-plug', |
| 84 |
]); |
| 85 |
} |
| 86 |
} |
| 87 |
|