TemplatesNext ToolKit - Version 3.1.7

Version Description

  • Added: Elementor Slider Widget
  • Added: Elementor Portfolio Widget
  • Added: Elementor Team Widget
  • Added: Elementor Posts Grid Widget
  • Added: Elementor Contact Form Widget
  • Added: Elementor WooCommerce Products listing Widget
Download this release

Release Info

Developer marsian
Plugin Icon 128x128 TemplatesNext ToolKit
Version 3.1.7
Comparing to
See all releases

Code changes from version 3.1.6 to 3.1.7

custom-post-types/itrans-slider.php CHANGED
@@ -20,6 +20,7 @@
20
  'search_items' => __('Search itrans Slide', "nx-admin"),
21
  'not_found' => __('No itrans slide have been added yet', "nx-admin"),
22
  'not_found_in_trash' => __('Nothing found in Trash', "nx-admin"),
 
23
  'parent_item_colon' => ''
24
  );
25
 
20
  'search_items' => __('Search itrans Slide', "nx-admin"),
21
  'not_found' => __('No itrans slide have been added yet', "nx-admin"),
22
  'not_found_in_trash' => __('Nothing found in Trash', "nx-admin"),
23
+ 'featured_image' => __( 'Slide Image' ),
24
  'parent_item_colon' => ''
25
  );
26
 
inc/el-widgets/assets/css/txel-addons.css ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ /* CSS */
2
+
3
+ .tx-slider.tx-el-slider .tx-slider-img {
4
+ background-position: center center;
5
+ background-repeat: no-repeat;
6
+ background-size: cover;
7
+ }
8
+
9
+ .dialog-type-lightbox {
10
+ z-index: 300010;
11
+ }
inc/el-widgets/assets/js/tx-portfolios.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( $ ) {
2
+ /**
3
+ * @param $scope The Widget wrapper element as a jQuery element
4
+ * @param $ The jQuery alias
5
+ */
6
+ var WidgetTxPortfolios = function( $scope, $ ) {
7
+ console.log( $scope );
8
+ };
9
+
10
+ // Make sure you run this code under Elementor.
11
+ $( window ).on( 'elementor/frontend/init', function() {
12
+ elementorFrontend.hooks.addAction( 'frontend/element_ready/tx-portfolio.default', WidgetTxPortfolios );
13
+ } );
14
+ } )( jQuery );
inc/el-widgets/assets/js/tx-posts.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( $ ) {
2
+ /**
3
+ * @param $scope The Widget wrapper element as a jQuery element
4
+ * @param $ The jQuery alias
5
+ */
6
+ var WidgetTxPosts = function( $scope, $ ) {
7
+ console.log( $scope );
8
+ };
9
+
10
+ // Make sure you run this code under Elementor.
11
+ $( window ).on( 'elementor/frontend/init', function() {
12
+ elementorFrontend.hooks.addAction( 'frontend/element_ready/tx-posts.default', WidgetTxPosts );
13
+ } );
14
+ } )( jQuery );
inc/el-widgets/assets/js/tx-slider.js ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( $ ) {
2
+ /**
3
+ * @param $scope The Widget wrapper element as a jQuery element
4
+ * @param $ The jQuery alias
5
+ */
6
+ var WidgetTxSlider = function( $scope, $ ) {
7
+ //console.log( $scope );
8
+
9
+ var tx_slider = $scope.find('.tx-slider');
10
+
11
+ if (tx_slider.length > 0) {
12
+
13
+ console.log( "testing elm" );
14
+
15
+ var _this = tx_slider;
16
+ var slider_delay = _this.data('delay');
17
+ var slider_transition = _this.data('transition');
18
+
19
+ if( slider_fullscreen == 'yes' )
20
+ {
21
+ }
22
+
23
+ if( slider_transition == 'slide' )
24
+ {
25
+ tx_slider.owlCarousel({
26
+ autoPlay : slider_delay,
27
+ stopOnHover : true,
28
+ navigation: true,
29
+ paginationSpeed : 1000,
30
+ goToFirstSpeed : 2000,
31
+ singleItem : true,
32
+ autoHeight : true,
33
+ navigationText: ['<span class="genericon genericon-rightarrow"></span>','<span class="genericon genericon-leftarrow"></span>'],
34
+ addClassActive: true,
35
+ theme : "tx-owl-theme",
36
+ pagination : true
37
+ });
38
+ } else
39
+ {
40
+ tx_slider.owlCarousel({
41
+ autoPlay : slider_delay,
42
+ stopOnHover : true,
43
+ navigation: true,
44
+ paginationSpeed : 1000,
45
+ goToFirstSpeed : 2000,
46
+ singleItem : true,
47
+ autoHeight : true,
48
+ navigationText: ['<span class="genericon genericon-rightarrow"></span>','<span class="genericon genericon-leftarrow"></span>'],
49
+ addClassActive: true,
50
+ theme : "tx-owl-theme",
51
+ transitionStyle : slider_transition,
52
+ pagination : true
53
+ });
54
+ }
55
+ }
56
+
57
+
58
+ //data-parallax="yes"
59
+ //data-fullscreen="yes"
60
+
61
+ var slider_fullscreen = _this.data('fullscreen');
62
+ var slider_parallax = _this.data('parallax');
63
+ var slider_height = _this.data('height');
64
+
65
+ if( slider_fullscreen == 'yes' )
66
+ {
67
+ slider_height = $( window ).height();
68
+ }
69
+
70
+ _this.find('.tx-slider-img').css( "height", slider_height );
71
+ _this.find('.owl-wrapper-outer').css( "height", slider_height );
72
+
73
+ _this.find('.tx-slider-img').css('background-position', 'center center');
74
+ var backgroundPos = _this.find('.tx-slider-img').css('backgroundPosition').split(" ");
75
+ var yPos = backgroundPos[1];
76
+
77
+ if (slider_parallax == 'yes')
78
+ {
79
+ var slidetop = parseInt(_this.offset().top);
80
+
81
+ if( $( window ).width() > 999 )
82
+ {
83
+ $(window).scroll(function(){
84
+ var newvalue = parseInt($(this).scrollTop()*0.70)-60;
85
+
86
+ if ($(this).scrollTop() > slidetop)
87
+ {
88
+ _this.find('.tx-slider-img').css('background-position', 'center calc( 50% + '+newvalue+'px');
89
+ }
90
+
91
+ if ($(this).scrollTop() <= slidetop)
92
+ {
93
+ var slideheight = $('.active .da-img').height();
94
+
95
+ _this.find('.tx-slider-img').css('background-position', 'center center');
96
+ _this.find('.owl-wrapper-outer').css('max-height', slideheight+'px');
97
+ }
98
+ });
99
+ }
100
+ }
101
+
102
+
103
+
104
+ };
105
+
106
+ // Make sure you run this code under Elementor.
107
+ $( window ).on( 'elementor/frontend/init', function() {
108
+ elementorFrontend.hooks.addAction( 'frontend/element_ready/tx-slider.default', WidgetTxSlider );
109
+ } );
110
+ } )( jQuery );
inc/el-widgets/assets/js/tx-team.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( $ ) {
2
+ /**
3
+ * @param $scope The Widget wrapper element as a jQuery element
4
+ * @param $ The jQuery alias
5
+ */
6
+ var WidgetTxTeam = function( $scope, $ ) {
7
+ console.log( $scope );
8
+ };
9
+
10
+ // Make sure you run this code under Elementor.
11
+ $( window ).on( 'elementor/frontend/init', function() {
12
+ elementorFrontend.hooks.addAction( 'frontend/element_ready/tx-team.default', WidgetTxTeam );
13
+ } );
14
+ } )( jQuery );
inc/el-widgets/assets/js/txel-addons.js ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( $ ) {
2
+ /**
3
+ * @param $scope The Widget wrapper element as a jQuery element
4
+ * @param $ The jQuery alias
5
+ */
6
+ var WidgetTxPortfolios = function( $scope, $ ) {
7
+ console.log( $scope );
8
+ };
9
+
10
+ // Make sure you run this code under Elementor.
11
+ $( window ).on( 'elementor/frontend/init', function() {
12
+ elementorFrontend.hooks.addAction( 'frontend/element_ready/hello-world.default', WidgetTxPortfolios );
13
+ } );
14
+ } )( jQuery );
inc/el-widgets/elementor-addon.php ADDED
@@ -0,0 +1,145 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace TXElementorAddons;
3
+
4
+ /**
5
+ * Class Plugin
6
+ *
7
+ * Main Plugin class
8
+ * @since 1.2.0
9
+ */
10
+ class Plugin {
11
+
12
+ /**
13
+ * Instance
14
+ *
15
+ * @since 1.2.0
16
+ * @access private
17
+ * @static
18
+ *
19
+ * @var Plugin The single instance of the class.
20
+ */
21
+ private static $_instance = null;
22
+
23
+ /**
24
+ * Instance
25
+ *
26
+ * Ensures only one instance of the class is loaded or can be loaded.
27
+ *
28
+ * @since 1.2.0
29
+ * @access public
30
+ *
31
+ * @return Plugin An instance of the class.
32
+ */
33
+ public static function instance() {
34
+ if ( is_null( self::$_instance ) ) {
35
+ self::$_instance = new self();
36
+ }
37
+ return self::$_instance;
38
+ }
39
+
40
+ /**
41
+ * Create Widgets category
42
+ *
43
+ *
44
+ * @since 1.2.0
45
+ * @access public
46
+ */
47
+ public function add_elementor_category()
48
+ {
49
+ \Elementor\Plugin::instance()->elements_manager->add_category( 'templatesnext-addons', array(
50
+ 'title' => __( 'TemplatesNext Addons', 'tx' ),
51
+ 'icon' => 'fa fa-plug',
52
+ ), 1 );
53
+ }
54
+ /**
55
+ * widget_scripts
56
+ *
57
+ * Load required plugin core files.
58
+ *
59
+ * @since 1.2.0
60
+ * @access public
61
+ */
62
+ public function widget_scripts() {
63
+ wp_register_script( 'elementor-tx-portfolios', plugins_url( '/assets/js/tx-portfolios.js', __FILE__ ), [ 'jquery' ], false, true );
64
+ wp_register_script( 'elementor-tx-slider', plugins_url( '/assets/js/tx-slider.js', __FILE__ ), [ 'jquery' ], false, true );
65
+ wp_register_script( 'elementor-tx-team', plugins_url( '/assets/js/tx-team.js', __FILE__ ), [ 'jquery' ], false, true );
66
+ wp_register_script( 'elementor-tx-posts', plugins_url( '/assets/js/tx-posts.js', __FILE__ ), [ 'jquery' ], false, true );
67
+ }
68
+
69
+ public function txel_widget_styles() {
70
+ wp_register_style( 'elementor-tx-styles', plugins_url( '/assets/css/txel-addons.css', __FILE__ ), array(), '1.0.1' );
71
+ wp_enqueue_style( 'elementor-tx-styles' );
72
+ }
73
+ /**
74
+ * Include Widgets files
75
+ *
76
+ * Load widgets files
77
+ *
78
+ * @since 1.2.0
79
+ * @access private
80
+ */
81
+ private function include_widgets_files() {
82
+ //require_once( __DIR__ . '/widgets/hello-world.php' );
83
+ require_once( __DIR__ . '/widgets/portfolios.php' );
84
+ require_once( __DIR__ . '/widgets/slider.php' );
85
+ require_once( __DIR__ . '/widgets/team.php' );
86
+ require_once( __DIR__ . '/widgets/txposts.php' );
87
+ if(class_exists('WPCF7')) {
88
+ require_once( __DIR__ . '/widgets/wpcf7.php' );
89
+ }
90
+ if ( class_exists( 'WooCommerce' ) ) {
91
+ require_once( __DIR__ . '/widgets/txwoo.php' );
92
+ }
93
+ }
94
+
95
+ /**
96
+ * Register Widgets
97
+ *
98
+ * Register new Elementor widgets.
99
+ *
100
+ * @since 1.2.0
101
+ * @access public
102
+ */
103
+ public function register_widgets() {
104
+ // Its is now safe to include Widgets files
105
+ $this->include_widgets_files();
106
+
107
+ // Register Widgets
108
+ \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\tx_team() );
109
+ \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\tx_portfolio() );
110
+ \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\tx_slider() );
111
+ \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\tx_posts() );
112
+ if(class_exists('WPCF7')) {
113
+ \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\tx_wpcf7() );
114
+ }
115
+ if ( class_exists( 'WooCommerce' ) ) {
116
+ \Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Widgets\tx_woo() );
117
+ }
118
+ }
119
+
120
+ /**
121
+ * Plugin class constructor
122
+ *
123
+ * Register plugin action hooks and filters
124
+ *
125
+ * @since 1.2.0
126
+ * @access public
127
+ */
128
+ public function __construct() {
129
+
130
+ // Register widget scripts
131
+ add_action( 'elementor/frontend/after_register_scripts', [ $this, 'widget_scripts' ] );
132
+
133
+ // Register widgets
134
+ add_action( 'elementor/widgets/widgets_registered', [ $this, 'register_widgets' ] );
135
+
136
+ // Register styles
137
+ add_action( 'elementor/widgets/widgets_registered', [ $this, 'txel_widget_styles' ] );
138
+
139
+ // Add category
140
+ add_action( 'elementor/elements/categories_registered', [ $this, 'add_elementor_category' ] );
141
+ }
142
+ }
143
+
144
+ // Instantiate Plugin Class
145
+ Plugin::instance();
inc/el-widgets/widgets/hello-world.php ADDED
@@ -0,0 +1,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace TXElementorAddons\Widgets;
3
+
4
+ use Elementor\Widget_Base;
5
+ use Elementor\Controls_Manager;
6
+
7
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
8
+
9
+ /**
10
+ * Elementor Hello World
11
+ *
12
+ * Elementor widget for hello world.
13
+ *
14
+ * @since 1.0.0
15
+ */
16
+ class Hello_World extends Widget_Base {
17
+
18
+ /**
19
+ * Retrieve the widget name.
20
+ *
21
+ * @since 1.0.0
22
+ *
23
+ * @access public
24
+ *
25
+ * @return string Widget name.
26
+ */
27
+ public function get_name() {
28
+ return 'hello-world';
29
+ }
30
+
31
+ /**
32
+ * Retrieve the widget title.
33
+ *
34
+ * @since 1.0.0
35
+ *
36
+ * @access public
37
+ *
38
+ * @return string Widget title.
39
+ */
40
+ public function get_title() {
41
+ return __( 'Hello World', 'tx' );
42
+ }
43
+
44
+ /**
45
+ * Retrieve the widget icon.
46
+ *
47
+ * @since 1.0.0
48
+ *
49
+ * @access public
50
+ *
51
+ * @return string Widget icon.
52
+ */
53
+ public function get_icon() {
54
+ return 'eicon-posts-ticker';
55
+ }
56
+
57
+ /**
58
+ * Retrieve the list of categories the widget belongs to.
59
+ *
60
+ * Used to determine where to display the widget in the editor.
61
+ *
62
+ * Note that currently Elementor supports only one category.
63
+ * When multiple categories passed, Elementor uses the first one.
64
+ *
65
+ * @since 1.0.0
66
+ *
67
+ * @access public
68
+ *
69
+ * @return array Widget categories.
70
+ */
71
+ public function get_categories() {
72
+ return [ 'general' ];
73
+ }
74
+
75
+ /**
76
+ * Retrieve the list of scripts the widget depended on.
77
+ *
78
+ * Used to set scripts dependencies required to run the widget.
79
+ *
80
+ * @since 1.0.0
81
+ *
82
+ * @access public
83
+ *
84
+ * @return array Widget scripts dependencies.
85
+ */
86
+ public function get_script_depends() {
87
+ return [ 'elementor-hello-world' ];
88
+ }
89
+
90
+ /**
91
+ * Register the widget controls.
92
+ *
93
+ * Adds different input fields to allow the user to change and customize the widget settings.
94
+ *
95
+ * @since 1.0.0
96
+ *
97
+ * @access protected
98
+ */
99
+ protected function _register_controls() {
100
+ $this->start_controls_section(
101
+ 'section_content',
102
+ [
103
+ 'label' => __( 'Content', 'tx' ),
104
+ ]
105
+ );
106
+
107
+ $this->add_control(
108
+ 'title',
109
+ [
110
+ 'label' => __( 'Title', 'tx' ),
111
+ 'type' => Controls_Manager::TEXT,
112
+ ]
113
+ );
114
+
115
+ $this->end_controls_section();
116
+
117
+ $this->start_controls_section(
118
+ 'section_style',
119
+ [
120
+ 'label' => __( 'Style', 'tx' ),
121
+ 'tab' => Controls_Manager::TAB_STYLE,
122
+ ]
123
+ );
124
+
125
+ $this->add_control(
126
+ 'text_transform',
127
+ [
128
+ 'label' => __( 'Text Transform', 'tx' ),
129
+ 'type' => Controls_Manager::SELECT,
130
+ 'default' => '',
131
+ 'options' => [
132
+ '' => __( 'None', 'tx' ),
133
+ 'uppercase' => __( 'UPPERCASE', 'tx' ),
134
+ 'lowercase' => __( 'lowercase', 'tx' ),
135
+ 'capitalize' => __( 'Capitalize', 'tx' ),
136
+ ],
137
+ 'selectors' => [
138
+ '{{WRAPPER}} .title' => 'text-transform: {{VALUE}};',
139
+ ],
140
+ ]
141
+ );
142
+
143
+ $this->end_controls_section();
144
+ }
145
+
146
+ /**
147
+ * Render the widget output on the frontend.
148
+ *
149
+ * Written in PHP and used to generate the final HTML.
150
+ *
151
+ * @since 1.0.0
152
+ *
153
+ * @access protected
154
+ */
155
+ protected function render() {
156
+ $settings = $this->get_settings_for_display();
157
+
158
+ echo '<div class="title">';
159
+ echo $settings['title'];
160
+ echo '</div>';
161
+ }
162
+
163
+ /**
164
+ * Render the widget output in the editor.
165
+ *
166
+ * Written as a Backbone JavaScript template and used to generate the live preview.
167
+ *
168
+ * @since 1.0.0
169
+ *
170
+ * @access protected
171
+ */
172
+ protected function _content_template() {
173
+ ?>
174
+ <div class="title">
175
+ {{{ settings.title }}}
176
+ </div>
177
+ <?php
178
+ }
179
+ }
inc/el-widgets/widgets/index.php ADDED
@@ -0,0 +1,2 @@
 
 
1
+ <?php
2
+ // Silence is golden.
inc/el-widgets/widgets/portfolios.php ADDED
@@ -0,0 +1,344 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace TXElementorAddons\Widgets;
3
+
4
+ use Elementor\Widget_Base;
5
+ use Elementor\Controls_Manager;
6
+
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
9
+
10
+ /**
11
+ * @since 1.1.0
12
+ */
13
+ class tx_portfolio extends Widget_Base {
14
+
15
+ /**
16
+ * Retrieve the widget name.
17
+ *
18
+ * @since 1.1.0
19
+ *
20
+ * @access public
21
+ *
22
+ * @return string Widget name.
23
+ */
24
+ public function get_name() {
25
+ return 'tx-portfolio';
26
+ }
27
+
28
+ /**
29
+ * Retrieve the widget title.
30
+ *
31
+ * @since 1.1.0
32
+ *
33
+ * @access public
34
+ *
35
+ * @return string Widget title.
36
+ */
37
+ public function get_title() {
38
+ return __( 'Portfolios', 'tx' );
39
+ }
40
+
41
+ /**
42
+ * Retrieve the widget icon.
43
+ *
44
+ * @since 1.1.0
45
+ *
46
+ * @access public
47
+ *
48
+ * @return string Widget icon.
49
+ */
50
+ public function get_icon() {
51
+ return 'eicon-gallery-justified';
52
+ }
53
+
54
+ /**
55
+ * Retrieve the list of categories the widget belongs to.
56
+ *
57
+ * Used to determine where to display the widget in the editor.
58
+ *
59
+ * Note that currently Elementor supports only one category.
60
+ * When multiple categories passed, Elementor uses the first one.
61
+ *
62
+ * @since 1.1.0
63
+ *
64
+ * @access public
65
+ *
66
+ * @return array Widget categories.
67
+ */
68
+ public function get_categories() {
69
+ return [ 'templatesnext-addons' ];
70
+ }
71
+
72
+ /**
73
+ * Retrieve the list of scripts the widget depended on.
74
+ *
75
+ * Used to set scripts dependencies required to run the widget.
76
+ *
77
+ * @since 1.0.0
78
+ *
79
+ * @access public
80
+ *
81
+ * @return array Widget scripts dependencies.
82
+ */
83
+ public function get_script_depends() {
84
+ return [ 'elementor-tx-portfolios' ];
85
+ }
86
+ /**
87
+ * Register the widget controls.
88
+ *
89
+ * Adds different input fields to allow the user to change and customize the widget settings.
90
+ *
91
+ * @since 1.1.0
92
+ *
93
+ * @access protected
94
+ */
95
+
96
+
97
+ protected function _register_controls() {
98
+ $this->start_controls_section(
99
+ 'section_content',
100
+ [
101
+ 'label' => __( 'Portfolio Settings', 'tx' ),
102
+ ]
103
+ );
104
+ $this->add_control(
105
+ 'style',
106
+ [
107
+ 'label' => __( 'Style', 'tx' ),
108
+ 'type' => \Elementor\Controls_Manager::SELECT2,
109
+ 'options' => [
110
+ 'default' => __( 'Default', 'tx' ),
111
+ 'gallery' => __( 'Gallery', 'tx' ),
112
+ ],
113
+ 'default' => 'default',
114
+ 'dynamic' => [
115
+ 'active' => true,
116
+ ],
117
+ ]
118
+ );
119
+ $this->add_control(
120
+ 'items',
121
+ [
122
+ 'label' => __( 'Items', 'tx' ),
123
+ 'type' => \Elementor\Controls_Manager::NUMBER,
124
+ 'min' => 1,
125
+ 'max' => 20,
126
+ 'step' => 1,
127
+ 'default' => 4,
128
+ 'dynamic' => [
129
+ 'active' => true,
130
+ ],
131
+
132
+ ]
133
+ );
134
+ $this->add_control(
135
+ 'columns',
136
+ [
137
+ 'label' => __( 'Columns', 'tx' ),
138
+ 'type' => \Elementor\Controls_Manager::NUMBER,
139
+ 'min' => 1,
140
+ 'max' => 4,
141
+ 'step' => 1,
142
+ 'default' => 4,
143
+ 'dynamic' => [
144
+ 'active' => true,
145
+ ],
146
+ ]
147
+ );
148
+ $this->add_control(
149
+ 'hide_cat',
150
+ [
151
+ 'label' => __( 'Hide Category', 'tx' ),
152
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
153
+ 'label_on' => __( 'Show', 'tx' ),
154
+ 'label_off' => __( 'Hide', 'tx' ),
155
+ 'return_value' => 'yes',
156
+ 'default' => '',
157
+ 'dynamic' => [
158
+ 'active' => true,
159
+ ],
160
+
161
+ ]
162
+ );
163
+ $this->add_control(
164
+ 'hide_excerpt',
165
+ [
166
+ 'label' => __( 'Hide Excertp', 'tx' ),
167
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
168
+ 'label_on' => __( 'Show', 'tx' ),
169
+ 'label_off' => __( 'Hide', 'tx' ),
170
+ 'return_value' => 'yes',
171
+ 'default' => 'yes',
172
+ 'dynamic' => [
173
+ 'active' => true,
174
+ ],
175
+
176
+ ]
177
+ );
178
+ $this->add_control(
179
+ 'show_pagination',
180
+ [
181
+ 'label' => __( 'Show Pagination', 'tx' ),
182
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
183
+ 'label_on' => __( 'Show', 'tx' ),
184
+ 'label_off' => __( 'Hide', 'tx' ),
185
+ 'return_value' => 'yes',
186
+ 'default' => '',
187
+ 'dynamic' => [
188
+ 'active' => true,
189
+ ],
190
+
191
+ ]
192
+ );
193
+
194
+ $this->end_controls_section();
195
+ }
196
+
197
+ /**
198
+ * Render the widget output on the frontend.
199
+ *
200
+ * Written in PHP and used to generate the final HTML.
201
+ *
202
+ * @since 1.1.0
203
+ *
204
+ * @access protected
205
+ */
206
+ protected function render() {
207
+ $settings = $this->get_settings_for_display();
208
+
209
+ //echo '[tx_portfolio style="' . $settings['style'] . '" items="' . $settings['items'] . '" columns="' . $settings['columns'] . '" hide_cat="' . $settings['hide_cat'] . '" hide_excerpt="' . $settings['hide_excerpt'] . '" show_pagination="' . $settings['show_pagination'] . '" carousel="' . $settings['carousel'] . '"]';
210
+ //echo do_shortcode('[tx_portfolio style="' . $settings['style'] . '" items="' . $settings['items'] . '" columns="' . $settings['columns'] . '" hide_cat="' . $settings['hide_cat'] . '" hide_excerpt="' . $settings['hide_excerpt'] . '" show_pagination="' . $settings['show_pagination'] . '" carousel="' . $settings['carousel'] . '"]');
211
+
212
+ $style = $settings['style'];
213
+ $items = $settings['items'];
214
+ $columns = $settings['columns'];
215
+ $hide_cat = $settings['hide_cat'];
216
+ $hide_excerpt = $settings['hide_excerpt'];
217
+ $show_pagination = $settings['show_pagination'];
218
+ $carousel = '';
219
+
220
+ $blog_term = '';
221
+
222
+ if ( $hide_cat != "yes" ) {
223
+ $hide_cat = "no";
224
+ }
225
+ if ( $hide_excerpt != "yes" ) {
226
+ $hide_excerpt = "no";
227
+ }
228
+ if ( $show_pagination != "yes" ) {
229
+ $show_pagination = "no";
230
+ }
231
+ if ( $carousel != "yes" ) {
232
+ $carousel = "no";
233
+ }
234
+
235
+ $style_class = '';
236
+ $posts_per_page = intval( $items );
237
+ $total_column = intval( $columns );
238
+ $tx_carousel = $carousel;
239
+
240
+ $width = 600;
241
+ $height = 480;
242
+
243
+ if ( $style == 'gallery' ) {
244
+ $style_class = 'folio-style-gallery';
245
+ }
246
+
247
+
248
+ $return_string = '';
249
+
250
+ if( $tx_carousel == 'no' ) {
251
+ $return_string .= '<div class="tx-portfolio tx-post-row tx-masonry '.$style_class.'">';
252
+ } else {
253
+ $return_string .= '<div class="tx-portfolio tx-post-row tx-carousel" data-columns="'.$total_column.'">';
254
+ }
255
+
256
+ $cat_slug = '';
257
+
258
+ if( !empty($blog_term) ) {
259
+ $cat_slug = $blog_term;
260
+ }
261
+
262
+ wp_reset_query();
263
+ global $post;
264
+
265
+ $args = array(
266
+ 'posts_per_page' => $posts_per_page,
267
+ 'post_type' => 'portfolio',
268
+ 'orderby' => 'date',
269
+ 'order' => 'DESC',
270
+ 'portfolio-category' => $cat_slug, //use post ids
271
+ );
272
+
273
+ if ( $show_pagination == 'yes' && $carousel == 'no' )
274
+ {
275
+ $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
276
+ $args['paged'] = $paged;
277
+ $args['prev_text'] = __('&laquo;','tx');
278
+ $args['next_text'] = __('&raquo;','tx');
279
+ }
280
+
281
+ query_posts( $args );
282
+
283
+ if ( have_posts() ) : while ( have_posts() ) : the_post();
284
+
285
+ $full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' );
286
+ $thumb_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
287
+
288
+ if($thumb_image_url) {
289
+ $thumb_image_url = aq_resize( $thumb_image_url[0], $width, $height, true, true, true );
290
+ }
291
+
292
+ $return_string .= '<div class="tx-portfolio-item tx-post-col-'.$total_column.'"><div class="tx-border-box">';
293
+
294
+
295
+ if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
296
+ $return_string .= '<div class="tx-folio-img">';
297
+ $return_string .= '<div class="tx-folio-img-wrap"><img src="'.esc_url($thumb_image_url).'" alt="" class="folio-img" /></div>';
298
+ $return_string .= '<div class="folio-links"><span>';
299
+ $return_string .= '<a href="'.esc_url(get_permalink()).'" class="folio-linkico"><i class="fa fa-link"></i></a>';
300
+ $return_string .= '<a href="'.esc_url($full_image_url[0]).'" class="folio-zoomico"><i class="fa fa-search-plus"></i></a>';
301
+ $return_string .= '</span></div>';
302
+ $return_string .= '</div>';
303
+ }
304
+
305
+ $return_string .= '<span class="folio-head">';
306
+ $return_string .= '<h3 class="tx-folio-title"><a href="'.get_permalink().'">'.get_the_title().'</a></h3>';
307
+ if ( $hide_cat == 'no' ) { // check if the post has a Post Thumbnail assigned to it.
308
+ $return_string .= '<div class="tx-folio-category">'.tx_folio_term( 'portfolio-category' ).'</div>';
309
+ } else {
310
+ $return_string .= '<div style="display: block; clear: both; height: 16px;"></div>';
311
+ }
312
+ $return_string .= '</span>';
313
+ if ( $hide_excerpt == 'no' && $style != 'gallery' ) { // check if the post has a Post Thumbnail assigned to it.
314
+ $return_string .= '<div class="tx-folio-content">'.get_the_excerpt().'</div>';
315
+ }
316
+
317
+ $return_string .= '</div></div>';
318
+ endwhile; else :
319
+ $return_string .= '<div class="tx-noposts"><p>Sorry, no portfolio matched your criteria. Please add few portfolio along with featured images.</p></div>';
320
+ endif;
321
+
322
+ $return_string .= '</div>';
323
+
324
+ if ($show_pagination == 'yes' && $carousel == 'no' ) {
325
+ $return_string .= '<div class="nx-paging"><div class="nx-paging-inner">'.paginate_links( $args ).'</div></div>';
326
+ }
327
+
328
+ wp_reset_query();
329
+
330
+ echo $return_string;
331
+
332
+ }
333
+
334
+ /**
335
+ * Render the widget output in the editor.
336
+ *
337
+ * Written as a Backbone JavaScript template and used to generate the live preview.
338
+ *
339
+ * @since 1.1.0
340
+ *
341
+ * @access protected
342
+ */
343
+ protected function _content_template() {}
344
+ }
inc/el-widgets/widgets/slider.php ADDED
@@ -0,0 +1,458 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace TXElementorAddons\Widgets;
3
+
4
+ use Elementor\Widget_Base;
5
+ use Elementor\Controls_Manager;
6
+ use Elementor\Group_Control_Background;
7
+
8
+
9
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
10
+
11
+ /**
12
+ * @since 1.1.0
13
+ */
14
+ class tx_slider extends Widget_Base {
15
+
16
+ /**
17
+ * Retrieve the widget name.
18
+ *
19
+ * @since 1.1.0
20
+ *
21
+ * @access public
22
+ *
23
+ * @return string Widget name.
24
+ */
25
+ public function get_name() {
26
+ return 'tx-slider';
27
+ }
28
+
29
+ /**
30
+ * Retrieve the widget title.
31
+ *
32
+ * @since 1.1.0
33
+ *
34
+ * @access public
35
+ *
36
+ * @return string Widget title.
37
+ */
38
+ public function get_title() {
39
+ return __( 'Slider', 'tx' );
40
+ }
41
+
42
+ /**
43
+ * Retrieve the widget icon.
44
+ *
45
+ * @since 1.1.0
46
+ *
47
+ * @access public
48
+ *
49
+ * @return string Widget icon.
50
+ */
51
+ public function get_icon() {
52
+ return ' eicon-slider-3d';
53
+ }
54
+
55
+ /**
56
+ * Retrieve the list of categories the widget belongs to.
57
+ *
58
+ * Used to determine where to display the widget in the editor.
59
+ *
60
+ * Note that currently Elementor supports only one category.
61
+ * When multiple categories passed, Elementor uses the first one.
62
+ *
63
+ * @since 1.1.0
64
+ *
65
+ * @access public
66
+ *
67
+ * @return array Widget categories.
68
+ */
69
+ public function get_categories() {
70
+ return [ 'templatesnext-addons' ];
71
+ }
72
+
73
+ /**
74
+ * Retrieve the list of scripts the widget depended on.
75
+ *
76
+ * Used to set scripts dependencies required to run the widget.
77
+ *
78
+ * @since 1.0.0
79
+ *
80
+ * @access public
81
+ *
82
+ * @return array Widget scripts dependencies.
83
+ */
84
+ public function get_script_depends() {
85
+ return [ 'elementor-tx-slider' ];
86
+ }
87
+ /**
88
+ * Register the widget controls.
89
+ *
90
+ * Adds different input fields to allow the user to change and customize the widget settings.
91
+ *
92
+ * @since 1.1.0
93
+ *
94
+ * @access protected
95
+ */
96
+
97
+
98
+ protected function _register_controls() {
99
+ $this->start_controls_section(
100
+ 'section_content',
101
+ [
102
+ 'label' => __( 'Slider Settings', 'tx' ),
103
+ 'description' => __( 'To Add/Edit slider, go to menu &quot;itrans Slider&quot;', 'tx' ),
104
+ ]
105
+ );
106
+ $this->add_control(
107
+ 'category',
108
+ [
109
+ 'label' => __( 'Category', 'tx' ),
110
+ 'type' => \Elementor\Controls_Manager::SELECT2,
111
+ 'options' => tx_get_category_list_el('itrans-slider-category'),
112
+ 'default' => 'all',
113
+ 'dynamic' => [
114
+ 'active' => true,
115
+ ],
116
+ ]
117
+ );
118
+ $this->add_control(
119
+ 'delay',
120
+ [
121
+ 'label' => __( 'Delay', 'tx' ),
122
+ 'description' => __( 'Delay between slides', 'tx'),
123
+ 'type' => \Elementor\Controls_Manager::NUMBER,
124
+ 'min' => 1,
125
+ 'max' => 60,
126
+ 'step' => 1,
127
+ 'default' => 8,
128
+ 'dynamic' => [
129
+ 'active' => true,
130
+ ],
131
+
132
+ ]
133
+ );
134
+ $this->add_control(
135
+ 'items',
136
+ [
137
+ 'label' => __( 'Number Of Slides', 'tx' ),
138
+ 'type' => \Elementor\Controls_Manager::NUMBER,
139
+ 'min' => 1,
140
+ 'max' => 20,
141
+ 'step' => 1,
142
+ 'default' => 4,
143
+ 'dynamic' => [
144
+ 'active' => true,
145
+ ],
146
+ ]
147
+ );
148
+
149
+ $this->add_control(
150
+ 'transition',
151
+ [
152
+ 'label' => __( 'Slide Transition', 'tx' ),
153
+ 'type' => \Elementor\Controls_Manager::SELECT,
154
+ 'options' => [
155
+ 'slide' => __( 'Slide', 'tx' ),
156
+ 'fade' => __( 'Fade', 'tx' ),
157
+ 'backSlide' => __( 'Back Slide', 'tx' ),
158
+ 'goDown' => __( 'Go Down', 'tx' ),
159
+ 'fadeUp' => __( 'Fade Up', 'tx' ),
160
+ ],
161
+ 'default' => 'slide',
162
+ 'dynamic' => [
163
+ 'active' => true,
164
+ ],
165
+ ]
166
+ );
167
+
168
+ $this->add_control(
169
+ 'title',
170
+ [
171
+ 'label' => __( 'Show Slide Title', 'tx' ),
172
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
173
+ 'label_on' => __( 'Show', 'tx' ),
174
+ 'label_off' => __( 'Hide', 'tx' ),
175
+ 'return_value' => 'yes',
176
+ 'default' => 'yes',
177
+ 'dynamic' => [
178
+ 'active' => true,
179
+ ],
180
+
181
+ ]
182
+ );
183
+ $this->add_control(
184
+ 'desc',
185
+ [
186
+ 'label' => __( 'Show Slide Description', 'tx' ),
187
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
188
+ 'label_on' => __( 'Show', 'tx' ),
189
+ 'label_off' => __( 'Hide', 'tx' ),
190
+ 'return_value' => 'yes',
191
+ 'default' => 'yes',
192
+ 'dynamic' => [
193
+ 'active' => true,
194
+ ],
195
+
196
+ ]
197
+ );
198
+ $this->add_control(
199
+ 'link',
200
+ [
201
+ 'label' => __( 'Show Slide Link', 'tx' ),
202
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
203
+ 'label_on' => __( 'Show', 'tx' ),
204
+ 'label_off' => __( 'Hide', 'tx' ),
205
+ 'return_value' => 'yes',
206
+ 'default' => 'yes',
207
+ 'dynamic' => [
208
+ 'active' => true,
209
+ ],
210
+
211
+ ]
212
+ );
213
+ $this->add_control(
214
+ 'align',
215
+ [
216
+ 'label' => __( 'Content Alignment', 'tx' ),
217
+ 'type' => \Elementor\Controls_Manager::CHOOSE,
218
+ 'options' => [
219
+ 'left' => [
220
+ 'title' => __( 'Left', 'tx' ),
221
+ 'icon' => 'fa fa-align-left',
222
+ ],
223
+ 'center' => [
224
+ 'title' => __( 'Center', 'tx' ),
225
+ 'icon' => 'fa fa-align-center',
226
+ ],
227
+ 'right' => [
228
+ 'title' => __( 'Right', 'tx' ),
229
+ 'icon' => 'fa fa-align-right',
230
+ ],
231
+ ],
232
+ 'default' => 'center',
233
+ 'dynamic' => [
234
+ 'active' => true,
235
+ ],
236
+
237
+ ]
238
+ );
239
+ $this->add_control(
240
+ 'height',
241
+ [
242
+ 'label' => __( 'Slider Height', 'tx' ),
243
+ 'type' => \Elementor\Controls_Manager::NUMBER,
244
+ 'min' => 200,
245
+ 'max' => 800,
246
+ 'step' => 10,
247
+ 'default' => 420,
248
+ 'dynamic' => [
249
+ 'active' => true,
250
+ ],
251
+
252
+ ]
253
+ );
254
+ $this->add_control(
255
+ 'fullscreen',
256
+ [
257
+ 'label' => __( 'Fullscreen', 'tx' ),
258
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
259
+ 'label_on' => __( 'Show', 'tx' ),
260
+ 'label_off' => __( 'Hide', 'tx' ),
261
+ 'return_value' => 'yes',
262
+ 'default' => '',
263
+ 'dynamic' => [
264
+ 'active' => true,
265
+ ],
266
+
267
+ ]
268
+ );
269
+ $this->add_control(
270
+ 'textbg',
271
+ [
272
+ 'label' => __( 'Slider Image Overlay', 'tx' ),
273
+ 'type' => \Elementor\Controls_Manager::SELECT,
274
+ 'options' => [
275
+ 'shadow' => __( 'Shadowed Text', 'tx' ),
276
+ 'transparent' => __( 'Semi-transparent Background', 'tx' ),
277
+ 'softvignette' => __( 'Soft Vignette', 'tx' ),
278
+ 'hardvignette' => __( 'Hard Vignette', 'tx' ),
279
+ 'darkoverlay' => __( 'Dark Overlay', 'tx' ),
280
+ 'pattern' => __( 'Pixel Pattern', 'tx' ),
281
+ 'custombg' => __( 'Custom Overlay', 'tx' ),
282
+ ],
283
+ 'default' => 'darkoverlay',
284
+ 'dynamic' => [
285
+ 'active' => true,
286
+ ],
287
+ ]
288
+ );
289
+
290
+ $this->add_group_control(
291
+ Group_Control_Background::get_type(),
292
+ [
293
+ 'name' => 'background',
294
+ 'label' => __( 'Image Overlau', 'tx' ),
295
+ 'types' => [ 'classic', 'gradient' ],
296
+ 'selector' => '{{WRAPPER}} .tx-slide-content',
297
+ 'condition' => ['textbg' => 'custombg']
298
+ ]
299
+ );
300
+
301
+ $this->add_control(
302
+ 'parallax',
303
+ [
304
+ 'label' => __( 'Parallax', 'tx' ),
305
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
306
+ 'label_on' => __( 'Yes', 'tx' ),
307
+ 'label_off' => __( 'no', 'tx' ),
308
+ 'return_value' => 'yes',
309
+ 'default' => 'yes',
310
+ 'dynamic' => [
311
+ 'active' => true,
312
+ ],
313
+
314
+ ]
315
+ );
316
+
317
+ $this->end_controls_section();
318
+ }
319
+
320
+ /**
321
+ * Render the widget output on the frontend.
322
+ *
323
+ * Written in PHP and used to generate the final HTML.
324
+ *
325
+ * @since 1.1.0
326
+ *
327
+ * @access protected
328
+ */
329
+ protected function render() {
330
+ $settings = $this->get_settings_for_display();
331
+
332
+ $category = $settings['category'];
333
+ $delay = $settings['delay'];
334
+ $items = $settings['items'];
335
+ $transition = $settings['transition'];
336
+ $title = $settings['title'];
337
+ $desc = $settings['desc'];
338
+ $link = $settings['link'];
339
+ $align = $settings['align'];
340
+ $height = $settings['height'];
341
+ $fullscreen = $settings['fullscreen'];
342
+ $textbg = $settings['textbg'];
343
+ $parallax = $settings['parallax'];
344
+
345
+ $return_string = '';
346
+ $cat_slug = '';
347
+
348
+ if( !empty($category) ){
349
+ $cat_slug = $category;
350
+ }
351
+ $delay = (int)$delay*1000;
352
+
353
+ if( !empty($category) ){
354
+ $textbg_class = $textbg;
355
+ } else {
356
+ $textbg_class = 'darkoverlay';
357
+ }
358
+
359
+ $posts_per_page = intval( $items );
360
+ $tx_class = '';
361
+ $tx_delay = $delay;
362
+ $tx_parallax = $parallax;
363
+ $tx_transition = $transition;
364
+ $tx_title = $title;
365
+ $tx_desc = $desc;
366
+ $tx_link = $link;
367
+ $tx_align = $align;
368
+ $tx_height = $height;
369
+
370
+
371
+ $return_string .= '<div class="tx-slider tx-el-slider '.$textbg_class.'" data-delay="'.$tx_delay.'"';
372
+ $return_string .= ' data-parallax="'.$tx_parallax.'" data-transition="'.$tx_transition.'"';
373
+ $return_string .= ' data-fullscreen="'.$fullscreen.'" data-height="'.$tx_height.'">';
374
+
375
+
376
+ wp_reset_query();
377
+ global $post;
378
+
379
+ if( $category == 'all' ) {
380
+ $args = array(
381
+ 'post_type' => 'itrans-slider',
382
+ 'posts_per_page' => $posts_per_page,
383
+ 'orderby' => 'date',
384
+ 'order' => 'DESC',
385
+ 'ignore_sticky_posts' => 1,
386
+ );
387
+ } else {
388
+ $args = array(
389
+ 'post_type' => 'itrans-slider',
390
+ 'posts_per_page' => $posts_per_page,
391
+ 'orderby' => 'date',
392
+ 'order' => 'DESC',
393
+ 'ignore_sticky_posts' => 1,
394
+ 'itrans-slider-category' => $cat_slug, //use post ids
395
+ );
396
+ }
397
+
398
+ $full_image_url = '';
399
+ $large_image_url = '';
400
+ $image_url = '';
401
+ $width = 1600;
402
+ $height = (int)$tx_height;
403
+
404
+ query_posts( $args );
405
+
406
+ if ( have_posts() ) : while ( have_posts() ) : the_post();
407
+
408
+ $full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
409
+ $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' );
410
+ $image_url = aq_resize( $full_image_url[0], $width, $height, true, false, true );
411
+
412
+ $slide_link_text = rwmb_meta('tx_slide_link_text');
413
+ $show_link_url = rwmb_meta('tx_slide_link_url');
414
+
415
+ $return_string .= '<div class="tx-slider-item">';
416
+ $return_string .= '<div class="tx-slider-box">';
417
+
418
+ if ( has_post_thumbnail() ) {
419
+ $return_string .= '<div class="tx-slider-img" style="background-image: url('.esc_url($image_url['0']).');">';
420
+ $return_string .= '</div>';
421
+ }
422
+
423
+ $return_string .= '<div class="tx-slide-content"><div class="tx-slide-content-inner" style="text-align:'.$tx_align.';">';
424
+ if ( $tx_title == 'yes' ) {
425
+ $return_string .= '<h3 class="tx-slide-title">'.get_the_title().'</h3>';
426
+ }
427
+ if ( $tx_desc == 'yes' ) {
428
+ $return_string .= '<div class="tx-slide-details"><p>'.tx_custom_excerpt(32).'</p></div>';
429
+ }
430
+ if ( $tx_link == 'yes' ) {
431
+ $return_string .= '<div class="tx-slide-button"><a href="'.esc_url( $show_link_url ).'">'.esc_attr( $slide_link_text ).'</a></div>';
432
+ }
433
+ $return_string .= '</div></div></div></div>';
434
+
435
+
436
+ endwhile; else :
437
+ $return_string .= '<div class="tx-noposts"><p>Sorry, no slider matched your criteria. Please add few slides via menu "itrans slider" along with featured image.</p></div>';
438
+ endif;
439
+
440
+ $return_string .= '</div>';
441
+
442
+ wp_reset_query();
443
+
444
+ echo $return_string;
445
+
446
+ }
447
+
448
+ /**
449
+ * Render the widget output in the editor.
450
+ *
451
+ * Written as a Backbone JavaScript template and used to generate the live preview.
452
+ *
453
+ * @since 1.1.0
454
+ *
455
+ * @access protected
456
+ */
457
+ protected function _content_template() {}
458
+ }
inc/el-widgets/widgets/team.php ADDED
@@ -0,0 +1,244 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace TXElementorAddons\Widgets;
3
+
4
+ use Elementor\Widget_Base;
5
+ use Elementor\Controls_Manager;
6
+
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
9
+
10
+ /**
11
+ * @since 1.1.0
12
+ */
13
+ class tx_team extends Widget_Base {
14
+
15
+ /**
16
+ * Retrieve the widget name.
17
+ *
18
+ * @since 1.1.0
19
+ *
20
+ * @access public
21
+ *
22
+ * @return string Widget name.
23
+ */
24
+ public function get_name() {
25
+ return 'tx-team';
26
+ }
27
+
28
+ /**
29
+ * Retrieve the widget title.
30
+ *
31
+ * @since 1.1.0
32
+ *
33
+ * @access public
34
+ *
35
+ * @return string Widget title.
36
+ */
37
+ public function get_title() {
38
+ return __( 'Team', 'tx' );
39
+ }
40
+
41
+ /**
42
+ * Retrieve the widget icon.
43
+ *
44
+ * @since 1.1.0
45
+ *
46
+ * @access public
47
+ *
48
+ * @return string Widget icon.
49
+ */
50
+ public function get_icon() {
51
+ return 'eicon-person';
52
+ }
53
+
54
+ /**
55
+ * Retrieve the list of categories the widget belongs to.
56
+ *
57
+ * Used to determine where to display the widget in the editor.
58
+ *
59
+ * Note that currently Elementor supports only one category.
60
+ * When multiple categories passed, Elementor uses the first one.
61
+ *
62
+ * @since 1.1.0
63
+ *
64
+ * @access public
65
+ *
66
+ * @return array Widget categories.
67
+ */
68
+ public function get_categories() {
69
+ return [ 'templatesnext-addons' ];
70
+ }
71
+
72
+ /**
73
+ * Retrieve the list of scripts the widget depended on.
74
+ *
75
+ * Used to set scripts dependencies required to run the widget.
76
+ *
77
+ * @since 1.0.0
78
+ *
79
+ * @access public
80
+ *
81
+ * @return array Widget scripts dependencies.
82
+ */
83
+ public function get_script_depends() {
84
+ return [ 'elementor-tx-team' ];
85
+ }
86
+ /**
87
+ * Register the widget controls.
88
+ *
89
+ * Adds different input fields to allow the user to change and customize the widget settings.
90
+ *
91
+ * @since 1.1.0
92
+ *
93
+ * @access protected
94
+ */
95
+
96
+
97
+ protected function _register_controls() {
98
+ $this->start_controls_section(
99
+ 'section_content',
100
+ [
101
+ 'label' => __( 'Team Settings', 'tx' ),
102
+ ]
103
+ );
104
+ $this->add_control(
105
+ 'items',
106
+ [
107
+ 'label' => __( 'Items', 'tx' ),
108
+ 'type' => \Elementor\Controls_Manager::NUMBER,
109
+ 'min' => 1,
110
+ 'max' => 20,
111
+ 'step' => 1,
112
+ 'default' => 4,
113
+ 'dynamic' => [
114
+ 'active' => true,
115
+ ],
116
+
117
+ ]
118
+ );
119
+ $this->add_control(
120
+ 'columns',
121
+ [
122
+ 'label' => __( 'Columns', 'tx' ),
123
+ 'type' => \Elementor\Controls_Manager::NUMBER,
124
+ 'min' => 1,
125
+ 'max' => 4,
126
+ 'step' => 1,
127
+ 'default' => 4,
128
+ 'dynamic' => [
129
+ 'active' => true,
130
+ ],
131
+ ]
132
+ );
133
+
134
+ $this->end_controls_section();
135
+ }
136
+
137
+ /**
138
+ * Render the widget output on the frontend.
139
+ *
140
+ * Written in PHP and used to generate the final HTML.
141
+ *
142
+ * @since 1.1.0
143
+ *
144
+ * @access protected
145
+ */
146
+ protected function render() {
147
+
148
+ $settings = $this->get_settings_for_display();
149
+
150
+ $return_string = '';
151
+
152
+ $posts_per_page = intval( $settings['items'] );
153
+ $columns = intval( $settings['columns'] );
154
+ $tx_class = '';
155
+
156
+ $return_string .= '<div class="tx-team tx-'.$columns.'-column-team">';
157
+
158
+ wp_reset_query();
159
+ global $post;
160
+
161
+ $args = array(
162
+ 'post_type' => 'team',
163
+ 'posts_per_page' => $posts_per_page,
164
+ 'orderby' => 'date',
165
+ 'order' => 'DESC',
166
+ 'ignore_sticky_posts' => 1,
167
+ );
168
+
169
+ $full_image_url = '';
170
+ $large_image_url = '';
171
+ $image_url = '';
172
+ $width = 400;
173
+ $height = 400;
174
+
175
+ query_posts( $args );
176
+
177
+ if ( have_posts() ) : while ( have_posts() ) : the_post();
178
+
179
+ $full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
180
+ $image_url = aq_resize( $full_image_url[0], $width, $height, true, false, true );
181
+
182
+ $designation = esc_attr(rwmb_meta('tx_designation'));
183
+ $team_email = esc_attr(rwmb_meta('tx_team_email'));
184
+ $team_phone = esc_attr(rwmb_meta('tx_team_phone'));
185
+ $team_twitter = esc_url(rwmb_meta('tx_team_twitter'));
186
+ $team_facebook = esc_url(rwmb_meta('tx_team_facebook'));
187
+ $team_gplus = esc_url(rwmb_meta('tx_team_gplus'));
188
+ $team_skype = esc_attr(rwmb_meta('tx_team_skype'));
189
+ $team_linkedin = esc_url(rwmb_meta('tx_team_linkedin'));
190
+
191
+ $return_string .= '<div class="tx-team-item">';
192
+ $return_string .= '<div class="tx-team-box">';
193
+
194
+ if ( has_post_thumbnail() ) {
195
+ $return_string .= '<div class="tx-team-img">';
196
+ $return_string .= '<img src="'.esc_url($image_url['0']).'" alt="" class="team-image" />';
197
+
198
+ /*
199
+ if($team_email) { $return_string .= '<span class="tx-temail">'.$team_email.'</span>'; }
200
+ if($team_phone) { $return_string .= '<span class="tx-phone">'.$team_phone.'</span>'; }
201
+ */
202
+ $return_string .= '<div class="tx-team-socials">';
203
+ if($team_twitter) { $return_string .= '<span class="tx-twitter"><a href="'.$team_twitter.'"><i class="fa fa-twitter"></i></a></span>'; }
204
+ if($team_facebook) { $return_string .= '<span class="tx-facebook"><a href="'.$team_facebook.'"><i class="fa fa-facebook"></i></a></span>'; }
205
+ if($team_gplus) { $return_string .= '<span class="tx-gplus"><a href="'.$team_gplus.'"><i class="fa fa-google-plus"></i></a></span>'; }
206
+ if($team_skype) { $return_string .= '<span class="tx-skype"><a href="skype:'.$team_skype.'"><i class="fa fa-skype"></i></a></span>'; }
207
+ if($team_linkedin) { $return_string .= '<span class="tx-linkedin"><a href="'.$team_linkedin.'"><i class="fa fa-linkedin"></i></a></span>'; }
208
+ $return_string .= '</div>';
209
+
210
+ $return_string .= '</div>';
211
+ }
212
+ /**/
213
+ $return_string .= '<div class="tx-team-content"><div class="tx-team-content-inner" style="">';
214
+ $return_string .= '<h3 class="">'.get_the_title().'</h3>';
215
+ $return_string .= '<div class="desig">'.$designation.'</div>';
216
+ $return_string .= '</div></div></div>';
217
+ $return_string .= '</div>';
218
+
219
+
220
+ endwhile; else :
221
+ $return_string .= '<div class="tx-noposts"><p>Sorry, no team member matched your criteria. Please add few team member along with featured image.</p></div>';
222
+ endif;
223
+
224
+ $return_string .= '<div class="clear"></div>';
225
+
226
+ $return_string .= '</div>';
227
+
228
+ wp_reset_query();
229
+
230
+ echo $return_string;
231
+
232
+ }
233
+
234
+ /**
235
+ * Render the widget output in the editor.
236
+ *
237
+ * Written as a Backbone JavaScript template and used to generate the live preview.
238
+ *
239
+ * @since 1.1.0
240
+ *
241
+ * @access protected
242
+ */
243
+ protected function _content_template() {}
244
+ }
inc/el-widgets/widgets/txposts.php ADDED
@@ -0,0 +1,301 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace TXElementorAddons\Widgets;
3
+
4
+ use Elementor\Widget_Base;
5
+ use Elementor\Controls_Manager;
6
+
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
9
+
10
+ /**
11
+ * @since 1.1.0
12
+ */
13
+ class tx_posts extends Widget_Base {
14
+
15
+ /**
16
+ * Retrieve the widget name.
17
+ *
18
+ * @since 1.1.0
19
+ *
20
+ * @access public
21
+ *
22
+ * @return string Widget name.
23
+ */
24
+ public function get_name() {
25
+ return 'tx-posts';
26
+ }
27
+
28
+ /**
29
+ * Retrieve the widget title.
30
+ *
31
+ * @since 1.1.0
32
+ *
33
+ * @access public
34
+ *
35
+ * @return string Widget title.
36
+ */
37
+ public function get_title() {
38
+ return __( 'Posts Grid', 'tx' );
39
+ }
40
+
41
+ /**
42
+ * Retrieve the widget icon.
43
+ *
44
+ * @since 1.1.0
45
+ *
46
+ * @access public
47
+ *
48
+ * @return string Widget icon.
49
+ */
50
+ public function get_icon() {
51
+ return 'eicon-posts-grid';
52
+ }
53
+
54
+ /**
55
+ * Retrieve the list of categories the widget belongs to.
56
+ *
57
+ * Used to determine where to display the widget in the editor.
58
+ *
59
+ * Note that currently Elementor supports only one category.
60
+ * When multiple categories passed, Elementor uses the first one.
61
+ *
62
+ * @since 1.1.0
63
+ *
64
+ * @access public
65
+ *
66
+ * @return array Widget categories.
67
+ */
68
+ public function get_categories() {
69
+ return [ 'templatesnext-addons' ];
70
+ }
71
+
72
+ /**
73
+ * Retrieve the list of scripts the widget depended on.
74
+ *
75
+ * Used to set scripts dependencies required to run the widget.
76
+ *
77
+ * @since 1.0.0
78
+ *
79
+ * @access public
80
+ *
81
+ * @return array Widget scripts dependencies.
82
+ */
83
+ public function get_script_depends() {
84
+ return [ 'elementor-tx-posts' ];
85
+ }
86
+ /**
87
+ * Register the widget controls.
88
+ *
89
+ * Adds different input fields to allow the user to change and customize the widget settings.
90
+ *
91
+ * @since 1.1.0
92
+ *
93
+ * @access protected
94
+ */
95
+
96
+
97
+ protected function _register_controls() {
98
+ $this->start_controls_section(
99
+ 'section_content',
100
+ [
101
+ 'label' => __( 'Post Grid Settings', 'tx' ),
102
+ ]
103
+ );
104
+ $this->add_control(
105
+ 'items',
106
+ [
107
+ 'label' => __( 'Items', 'tx' ),
108
+ 'type' => \Elementor\Controls_Manager::NUMBER,
109
+ 'min' => 1,
110
+ 'max' => 20,
111
+ 'step' => 1,
112
+ 'default' => 4,
113
+ 'dynamic' => [
114
+ 'active' => true,
115
+ ],
116
+
117
+ ]
118
+ );
119
+ $this->add_control(
120
+ 'columns',
121
+ [
122
+ 'label' => __( 'Columns', 'tx' ),
123
+ 'type' => \Elementor\Controls_Manager::NUMBER,
124
+ 'min' => 1,
125
+ 'max' => 4,
126
+ 'step' => 1,
127
+ 'default' => 4,
128
+ 'dynamic' => [
129
+ 'active' => true,
130
+ ],
131
+ ]
132
+ );
133
+ $this->add_control(
134
+ 'showcat',
135
+ [
136
+ 'label' => __( 'Show Category', 'tx' ),
137
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
138
+ 'label_on' => __( 'Show', 'tx' ),
139
+ 'label_off' => __( 'Hide', 'tx' ),
140
+ 'return_value' => 'yes',
141
+ 'default' => 'yes',
142
+ 'dynamic' => [
143
+ 'active' => true,
144
+ ],
145
+
146
+ ]
147
+ );
148
+ $this->add_control(
149
+ 'show_pagination',
150
+ [
151
+ 'label' => __( 'Show Pagination', 'tx' ),
152
+ 'type' => \Elementor\Controls_Manager::SWITCHER,
153
+ 'label_on' => __( 'Show', 'tx' ),
154
+ 'label_off' => __( 'Hide', 'tx' ),
155
+ 'return_value' => 'yes',
156
+ 'default' => '',
157
+ 'dynamic' => [
158
+ 'active' => true,
159
+ ],
160
+
161
+ ]
162
+ );
163
+
164
+ $this->end_controls_section();
165
+ }
166
+
167
+ /**
168
+ * Render the widget output on the frontend.
169
+ *
170
+ * Written in PHP and used to generate the final HTML.
171
+ *
172
+ * @since 1.1.0
173
+ *
174
+ * @access protected
175
+ */
176
+ protected function render() {
177
+ $settings = $this->get_settings_for_display();
178
+
179
+ //echo '[tx_portfolio style="' . $settings['style'] . '" items="' . $settings['items'] . '" columns="' . $settings['columns'] . '" hide_cat="' . $settings['hide_cat'] . '" hide_excerpt="' . $settings['hide_excerpt'] . '" show_pagination="' . $settings['show_pagination'] . '" carousel="' . $settings['carousel'] . '"]';
180
+ //echo do_shortcode('[tx_portfolio style="' . $settings['style'] . '" items="' . $settings['items'] . '" columns="' . $settings['columns'] . '" hide_cat="' . $settings['hide_cat'] . '" hide_excerpt="' . $settings['hide_excerpt'] . '" show_pagination="' . $settings['show_pagination'] . '" carousel="' . $settings['carousel'] . '"]');
181
+
182
+ $items = $settings['items'];
183
+ $columns = $settings['columns'];
184
+ $showcat = $settings['showcat'];
185
+ $show_pagination = $settings['show_pagination'];
186
+ $category_id = '';
187
+
188
+ $blog_term = '';
189
+
190
+ if ( $showcat == "yes" ) {
191
+ $showcat = "show";
192
+ } else {
193
+ $showcat = "hide";
194
+ }
195
+ if ( $show_pagination != "yes" ) {
196
+ $show_pagination = "no";
197
+ }
198
+
199
+ $width = 600;
200
+ $height = 360;
201
+
202
+ $post_in_cat = tx_shortcodes_comma_delim_to_array( $category_id );
203
+ $post_comments = '';
204
+
205
+ $posts_per_page = intval( $items );
206
+ $total_column = intval( $columns );
207
+ $tx_category = $showcat;
208
+
209
+ $return_string = '';
210
+
211
+ $return_string .= '<div class="tx-blog tx-post-row tx-masonry">';
212
+
213
+ wp_reset_query();
214
+ global $post;
215
+
216
+ $args = array(
217
+ 'posts_per_page' => $posts_per_page,
218
+ 'orderby' => 'date',
219
+ 'order' => 'DESC',
220
+ 'ignore_sticky_posts' => 1,
221
+ 'category__in' => $post_in_cat, //use post ids
222
+ );
223
+
224
+ if ( $show_pagination == 'yes' ) {
225
+ $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
226
+ $args['paged'] = $paged;
227
+ $args['prev_text'] = __('&laquo;','tx');
228
+ $args['next_text'] = __('&raquo;','tx');
229
+ $args['show_all'] = false;
230
+ }
231
+
232
+
233
+ query_posts( $args );
234
+
235
+ if ( have_posts() ) : while ( have_posts() ) : the_post();
236
+
237
+ $post_comments = get_comments_number();
238
+
239
+ $full_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large' );
240
+ $thumb_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
241
+
242
+ if( $thumb_image_url ) {
243
+ $thumb_image_url = aq_resize( $thumb_image_url[0], $width, $height, true, true, true );
244
+ }
245
+
246
+ $return_string .= '<div class="tx-blog-item tx-post-col-'.$total_column.'"><div class="tx-border-box">';
247
+
248
+ if ( has_post_thumbnail() ) {
249
+ $return_string .= '<div class="tx-blog-img"><a href="'.esc_url($full_image_url[0]).'" class="">';
250
+ $return_string .= '<img src="'.esc_url($thumb_image_url).'" alt="" class="blog-image" /></a><span class="tx-post-comm"><span>'.$post_comments.'</span></span></div>';
251
+ } else
252
+ {
253
+ $return_string .= '<div class="tx-blog-imgpad"></div>';
254
+ }
255
+
256
+ $return_string .= '<div class="tx-post-content"><h3 class="tx-post-title"><a href="'.get_permalink().'">'.get_the_title().'</a></h3>';
257
+
258
+ if ( $tx_category == "show" ) {
259
+ $return_string .= '<div class="tx-category">'.get_the_category_list( ', ' ).'</div>';
260
+ } else {
261
+ $return_string .= '<div style="height: 16px;"></div>';
262
+ }
263
+
264
+ $return_string .= '<div class="tx-blog-content">'.get_the_excerpt().'</div>';
265
+
266
+ $return_string .= '<div class="tx-meta">';
267
+ $return_string .= '<span class="tx-author">By : <a href="'.esc_url( get_author_posts_url( get_the_author_meta("ID") ) ).'">'.get_the_author().'</a></span>';
268
+ $return_string .= '<span class="tx-date"> | '.get_the_date('M j, Y').'</span>';
269
+ $return_string .= '</div>';
270
+
271
+
272
+ $return_string .= '</div></div></div>';
273
+
274
+
275
+ endwhile; else :
276
+ $return_string .= '<div class="tx-noposts"><p>Sorry, no posts matched your criteria. Please add some posts with featured images.</p></div>';
277
+ endif;
278
+
279
+ $return_string .= '</div>';
280
+
281
+ if ( $show_pagination == 'yes' ) {
282
+ $return_string .= '<div class="nx-paging"><div class="nx-paging-inner">'.paginate_links( $args ).'</div></div>';
283
+ }
284
+
285
+ wp_reset_query();
286
+
287
+ echo $return_string;
288
+
289
+ }
290
+
291
+ /**
292
+ * Render the widget output in the editor.
293
+ *
294
+ * Written as a Backbone JavaScript template and used to generate the live preview.
295
+ *
296
+ * @since 1.1.0
297
+ *
298
+ * @access protected
299
+ */
300
+ protected function _content_template() {}
301
+ }
inc/el-widgets/widgets/txwoo.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace TXElementorAddons\Widgets;
3
+
4
+ use Elementor\Widget_Base;
5
+ use Elementor\Controls_Manager;
6
+
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
9
+
10
+ /**
11
+ * @since 1.1.0
12
+ */
13
+ class tx_woo extends Widget_Base {
14
+
15
+ /**
16
+ * Retrieve the widget name.
17
+ *
18
+ * @since 1.1.0
19
+ *
20
+ * @access public
21
+ *
22
+ * @return string Widget name.
23
+ */
24
+ public function get_name() {
25
+ return 'tx-woo';
26
+ }
27
+
28
+ /**
29
+ * Retrieve the widget title.
30
+ *
31
+ * @since 1.1.0
32
+ *
33
+ * @access public
34
+ *
35
+ * @return string Widget title.
36
+ */
37
+ public function get_title() {
38
+ return __( 'Products', 'tx' );
39
+ }
40
+
41
+ /**
42
+ * Retrieve the widget icon.
43
+ *
44
+ * @since 1.1.0
45
+ *
46
+ * @access public
47
+ *
48
+ * @return string Widget icon.
49
+ */
50
+ public function get_icon() {
51
+ return 'eicon-cart-medium';
52
+ }
53
+
54
+ /**
55
+ * Retrieve the list of categories the widget belongs to.
56
+ *
57
+ * Used to determine where to display the widget in the editor.
58
+ *
59
+ * Note that currently Elementor supports only one category.
60
+ * When multiple categories passed, Elementor uses the first one.
61
+ *
62
+ * @since 1.1.0
63
+ *
64
+ * @access public
65
+ *
66
+ * @return array Widget categories.
67
+ */
68
+ public function get_categories() {
69
+ return [ 'templatesnext-addons' ];
70
+ }
71
+
72
+ /**
73
+ * Register the widget controls.
74
+ *
75
+ * Adds different input fields to allow the user to change and customize the widget settings.
76
+ *
77
+ * @since 1.1.0
78
+ *
79
+ * @access protected
80
+ */
81
+
82
+
83
+ protected function _register_controls() {
84
+ $this->start_controls_section(
85
+ 'section_content',
86
+ [
87
+ 'label' => __( 'Products Listing', 'tx' ),
88
+ ]
89
+ );
90
+
91
+ $this->add_control(
92
+ 'listingtype',
93
+ [
94
+ 'label' => __( 'Listing Type', 'tx' ),
95
+ 'type' => \Elementor\Controls_Manager::SELECT,
96
+ 'options' => [
97
+ 'product_categories' => __( 'Product Categories', 'tx' ),
98
+ 'recent_products' => __( 'Recent Products', 'tx' ),
99
+ 'featured_products' => __( 'Featured Products', 'tx' ),
100
+ 'sale_products' => __( 'Products On Sale', 'tx' ),
101
+ 'best_selling_products' => __( 'Best Selling Products', 'tx' ),
102
+ 'top_rated_products' => __( 'Top Rated Products', 'tx' ),
103
+ 'products' => __( 'Products By Ids', 'tx' ),
104
+ ],
105
+ 'default' => 'featured_products',
106
+ 'dynamic' => [
107
+ 'active' => true,
108
+ ],
109
+ ]
110
+ );
111
+ $this->add_control(
112
+ 'ids',
113
+ [
114
+ 'label' => __( 'Product IDs', 'tx' ),
115
+ 'type' => \Elementor\Controls_Manager::TEXT,
116
+ 'default' => '',
117
+ 'description' => __( 'Comma seperated product ids, ex. 12,16,24 ', 'tx' ),
118
+ 'condition' => ['listingtype' => 'products']
119
+ ]
120
+ );
121
+ $this->add_control(
122
+ 'items',
123
+ [
124
+ 'label' => __( 'Number Of Products', 'tx' ),
125
+ 'type' => \Elementor\Controls_Manager::NUMBER,
126
+ 'min' => 1,
127
+ 'max' => 20,
128
+ 'step' => 1,
129
+ 'default' => 4,
130
+ 'dynamic' => [
131
+ 'active' => true,
132
+ ],
133
+ ]
134
+ );
135
+ $this->add_control(
136
+ 'columns',
137
+ [
138
+ 'label' => __( 'Number Of Columns', 'tx' ),
139
+ 'type' => \Elementor\Controls_Manager::NUMBER,
140
+ 'min' => 1,
141
+ 'max' => 4,
142
+ 'step' => 1,
143
+ 'default' => 4,
144
+ 'dynamic' => [
145
+ 'active' => true,
146
+ ],
147
+ ]
148
+ );
149
+
150
+ $this->end_controls_section();
151
+ }
152
+
153
+ /**
154
+ * Render the widget output on the frontend.
155
+ *
156
+ * Written in PHP and used to generate the final HTML.
157
+ *
158
+ * @since 1.1.0
159
+ *
160
+ * @access protected
161
+ */
162
+ protected function render() {
163
+
164
+ $settings = $this->get_settings_for_display();
165
+
166
+ $return_string = '';
167
+
168
+ //$return_string = do_shortcode('[contact-form-7 id="5" title="Contact form 1"]');
169
+ $listtype = $settings['listingtype'];
170
+ $prodids = $settings['ids'];
171
+ $items = $settings['items'];
172
+ $columns = $settings['columns'];
173
+
174
+
175
+ if ( !empty($prodids) && ( $listtype == 'product_categories' || $listtype == 'products' ))
176
+ {
177
+ if ( $listtype == 'product_categories' )
178
+ {
179
+ $prod_shortcode = '['.$listtype.' number="'.$items.'" columns="'.$columns.'" ids="'.$prodids.'"]';
180
+ } else
181
+ {
182
+ $prod_shortcode = '['.$listtype.' per_page="'.$items.'" columns="'.$columns.'" ids="'.$prodids.'"]';
183
+ }
184
+ } else
185
+ {
186
+ if ( $listtype == 'product_categories' )
187
+ {
188
+ $prod_shortcode = '['.$listtype.' number="'.$items.'" columns="'.$columns.'"]';
189
+ } else
190
+ {
191
+ $prod_shortcode = '['.$listtype.' per_page="'.$items.'" columns="'.$columns.'"]';
192
+ }
193
+ }
194
+
195
+ $return_string = $prod_shortcode;
196
+
197
+ echo do_shortcode($return_string);
198
+
199
+ }
200
+
201
+ /**
202
+ * Render the widget output in the editor.
203
+ *
204
+ * Written as a Backbone JavaScript template and used to generate the live preview.
205
+ *
206
+ * @since 1.1.0
207
+ *
208
+ * @access protected
209
+ */
210
+ protected function _content_template() {}
211
+ }
inc/el-widgets/widgets/wpcf7.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ namespace TXElementorAddons\Widgets;
3
+
4
+ use Elementor\Widget_Base;
5
+ use Elementor\Controls_Manager;
6
+
7
+
8
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
9
+
10
+ /**
11
+ * @since 1.1.0
12
+ */
13
+ class tx_wpcf7 extends Widget_Base {
14
+
15
+ /**
16
+ * Retrieve the widget name.
17
+ *
18
+ * @since 1.1.0
19
+ *
20
+ * @access public
21
+ *
22
+ * @return string Widget name.
23
+ */
24
+ public function get_name() {
25
+ return 'tx-wpcf7';
26
+ }
27
+
28
+ /**
29
+ * Retrieve the widget title.
30
+ *
31
+ * @since 1.1.0
32
+ *
33
+ * @access public
34
+ *
35
+ * @return string Widget title.
36
+ */
37
+ public function get_title() {
38
+ return __( 'Contact Form 7', 'tx' );
39
+ }
40
+
41
+ /**
42
+ * Retrieve the widget icon.
43
+ *
44
+ * @since 1.1.0
45
+ *
46
+ * @access public
47
+ *
48
+ * @return string Widget icon.
49
+ */
50
+ public function get_icon() {
51
+ return 'eicon-text-area';
52
+ }
53
+
54
+ /**
55
+ * Retrieve the list of categories the widget belongs to.
56
+ *
57
+ * Used to determine where to display the widget in the editor.
58
+ *
59
+ * Note that currently Elementor supports only one category.
60
+ * When multiple categories passed, Elementor uses the first one.
61
+ *
62
+ * @since 1.1.0
63
+ *
64
+ * @access public
65
+ *
66
+ * @return array Widget categories.
67
+ */
68
+ public function get_categories() {
69
+ return [ 'templatesnext-addons' ];
70
+ }
71
+
72
+ /**
73
+ * Register the widget controls.
74
+ *
75
+ * Adds different input fields to allow the user to change and customize the widget settings.
76
+ *
77
+ * @since 1.1.0
78
+ *
79
+ * @access protected
80
+ */
81
+
82
+
83
+ protected function _register_controls() {
84
+ $this->start_controls_section(
85
+ 'section_content',
86
+ [
87
+ 'label' => __( 'Form Select', 'tx' ),
88
+ ]
89
+ );
90
+ $this->add_control(
91
+ 'formid',
92
+ [
93
+ 'label' => __( 'Select A Form', 'tx' ),
94
+ 'type' => \Elementor\Controls_Manager::SELECT,
95
+ 'options' => tx_contactform7_list (),
96
+ 'label_block' => true,
97
+ 'default' => '',
98
+ 'dynamic' => [
99
+ 'active' => true,
100
+ ],
101
+ ]
102
+ );
103
+
104
+ $this->end_controls_section();
105
+ }
106
+
107
+ /**
108
+ * Render the widget output on the frontend.
109
+ *
110
+ * Written in PHP and used to generate the final HTML.
111
+ *
112
+ * @since 1.1.0
113
+ *
114
+ * @access protected
115
+ */
116
+ protected function render() {
117
+
118
+ $settings = $this->get_settings_for_display();
119
+
120
+ $return_string = '';
121
+
122
+ //$return_string = do_shortcode('[contact-form-7 id="5" title="Contact form 1"]');
123
+ $return_string = '[contact-form-7 id="'.$settings['formid'].'"]';
124
+
125
+ echo do_shortcode($return_string);
126
+
127
+ }
128
+
129
+ /**
130
+ * Render the widget output in the editor.
131
+ *
132
+ * Written as a Backbone JavaScript template and used to generate the live preview.
133
+ *
134
+ * @since 1.1.0
135
+ *
136
+ * @access protected
137
+ */
138
+ protected function _content_template() {}
139
+ }
inc/tx-meta.php CHANGED
@@ -63,7 +63,7 @@ function tx_register_meta_boxes( $meta_boxes )
63
 
64
  // designation
65
  array(
66
- 'name' => __( 'Lide Link URL', 'nx-admin' ),
67
  'id' => "{$prefix}slide_link_url",
68
  'type' => 'text',
69
  'std' => __( '', 'nx-admin' ),
63
 
64
  // designation
65
  array(
66
+ 'name' => __( 'Slide Link URL', 'nx-admin' ),
67
  'id' => "{$prefix}slide_link_url",
68
  'type' => 'text',
69
  'std' => __( '', 'nx-admin' ),
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: marsian
3
  Tags: shortcode, shortcodes, columns, column, section, sections, portfolio, testimonial, border, borders, button, buttons, masonry, posts, post_type, font awesome, icons, fontawesome
4
  Requires at least: 3.6
5
- Tested up to: 5.0
6
- Stable tag: 3.1.6
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -14,19 +14,24 @@ This plugin alse adds wish-list and compare button for WooCommerce.
14
 
15
  == Description ==
16
 
17
- Custom Portfolios, Testimonial, Sliders, Team and Shortcode functionalities like Rows and columns, Deviders,
18
- Spacers, Buttons, Call To Act, Services, Headings, Fullscreen Video Sliders, YouTube video, WooCommerce Product Carousels,
19
- Animations, Fancy Blocks, etc, for TemplatesNext Wordpress Themes.
20
 
21
- Demo and documentation : [http://www.templatesnext.org/icreate/?page_id=541](http://www.templatesnext.org/icreate/?page_id=541)
 
 
 
 
 
 
22
 
23
- https://www.youtube.com/watch?v=vqTHQCN2ci4
 
24
 
25
- = Page Builder Support =
 
26
 
27
- **TemplatesNext Toolkit** not only supports **Page Builder by SiteOrigin**, but it extends it with ToolKit functionality.
28
 
29
- Some of the shortcode may not work properly with any other themes.
30
 
31
  == Installation ==
32
 
@@ -34,6 +39,14 @@ Install the plugin into the `/wp-content/plugins/` folder, and activate it.
34
 
35
 
36
  == Changelog ==
 
 
 
 
 
 
 
 
37
  = 3.1.5 =
38
  * Removed: Breadcrumb removed
39
  * Added: Shape dividers
2
  Contributors: marsian
3
  Tags: shortcode, shortcodes, columns, column, section, sections, portfolio, testimonial, border, borders, button, buttons, masonry, posts, post_type, font awesome, icons, fontawesome
4
  Requires at least: 3.6
5
+ Tested up to: 5.2
6
+ Stable tag: 3.1.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
14
 
15
  == Description ==
16
 
17
+ Essential addons for your websites like Portfolios, Team Members, Testiminials, Sliders, WooCommerce Product Listing. etc via Shortcodes or SiteOrigin Page builder or using Elementor widgets. This plugin also optionally adds Wishlist and Compare Products for Woocommerce.
 
 
18
 
19
+ #### Elementor Demos
20
+ [Slider](http://www.wp-demos.com/i-spirit/tx-demo/elementor-templatesnext-toolkit/) - A simple Slider widget for elementor.
21
+ [Portfolio](http://www.wp-demos.com/i-spirit/tx-demo/templatesnext-toolkit-portfolio/) - A Portfolio widget for elementor to showcase your work.
22
+ [Team](http://www.wp-demos.com/i-spirit/tx-demo/elementor-team-contact-form-7/) - Team widget for elementor to show team member.
23
+ [Posts Grid](http://www.wp-demos.com/i-spirit/tx-demo/product-lists-post-grids/#postgrid) - Create Posts Grid with this elementor widget.
24
+ [Contact Form 7](http://www.wp-demos.com/i-spirit/tx-demo/elementor-team-contact-form-7/#contactform7) - An elementor widget for Contact Form 7.
25
+ [Products Lists](http://www.wp-demos.com/i-spirit/tx-demo/product-lists-post-grids/) - this widget combines elementor with WooCommerce.
26
 
27
+ #### SiteOrgin Page Builder Demo
28
+ [Home Page](http://www.wp-demos.com/i-spirit/tx-demo/) - Created with **TemplatesNext Toolkit** widgets for SiteOrigin Page Builder.
29
 
30
+ #### Shortcodes Demos And Documentations
31
+ [Demos And Documentation](http://www.templatesnext.org/icreate/?page_id=541) - Demos created with shortcode generators and documentations.
32
 
33
+ Some of the shortcodes/widgets may only work properly with TemplatesNext Themes themes.
34
 
 
35
 
36
  == Installation ==
37
 
39
 
40
 
41
  == Changelog ==
42
+ = 3.1.7 =
43
+ * Added: Elementor Slider Widget
44
+ * Added: Elementor Portfolio Widget
45
+ * Added: Elementor Team Widget
46
+ * Added: Elementor Posts Grid Widget
47
+ * Added: Elementor Contact Form Widget
48
+ * Added: Elementor WooCommerce Products listing Widget
49
+
50
  = 3.1.5 =
51
  * Removed: Breadcrumb removed
52
  * Added: Shape dividers
tx-functions.php CHANGED
@@ -70,12 +70,27 @@ function tx_get_category_list_key_array($category_name) {
70
 
71
  foreach( $get_category as $category ){
72
  if (isset($category->slug)) {
73
- $category_list[$category->slug] = $category->cat_name;
74
  }
75
  }
76
  return $category_list;
77
  }
78
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
 
80
  /*
81
  * @author Matthew Ruddy (http://easinglider.com)
@@ -382,8 +397,7 @@ if ( ! function_exists( 'tx_custom_excerpt' ) ) {
382
  }
383
 
384
 
385
- function tx_slider_cat_list ()
386
- {
387
  $post_type = 'itrans-slider';
388
  $tax = 'itrans-slider-category';
389
  $return = '';
@@ -424,14 +438,26 @@ function tx_add_widget_tabs($tabs) {
424
  }
425
  add_filter('siteorigin_panels_widget_dialog_tabs', 'tx_add_widget_tabs', 20);
426
 
427
- /*
428
- //Insert tx shortcode media button
429
- function tx_shortcode_button() {
430
- echo '<a href="#" id="insert-tx-button" class="button">Insert [tx] Shortcode</a>';
431
- }
432
- add_action('media_buttons', 'tx_shortcode_button');
433
- */
434
-
435
-
436
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
437
 
70
 
71
  foreach( $get_category as $category ){
72
  if (isset($category->slug)) {
73
+ $category_list[$category->slug] = $category->cat_name;
74
  }
75
  }
76
  return $category_list;
77
  }
78
 
79
+ /************************ Category list ***************************/
80
+ /******************************************************************/
81
+
82
+ function tx_get_category_list_el($category_name) {
83
+
84
+ $get_category = get_categories( array( 'taxonomy' => $category_name ));
85
+ $category_list = array( 'all' => 'All Category');
86
+
87
+ foreach( $get_category as $category ){
88
+ if (isset($category->slug)) {
89
+ $category_list[$category->slug] = $category->cat_name;
90
+ }
91
+ }
92
+ return $category_list;
93
+ }
94
 
95
  /*
96
  * @author Matthew Ruddy (http://easinglider.com)
397
  }
398
 
399
 
400
+ function tx_slider_cat_list () {
 
401
  $post_type = 'itrans-slider';
402
  $tax = 'itrans-slider-category';
403
  $return = '';
438
  }
439
  add_filter('siteorigin_panels_widget_dialog_tabs', 'tx_add_widget_tabs', 20);
440
 
 
 
 
 
 
 
 
 
 
441
 
442
+ /* Get list of contact form 7 */
443
+ function tx_contactform7_list () {
444
+
445
+ $options = array();
446
+
447
+ if (function_exists('wpcf7')) {
448
+ $wpcf7_form_list = get_posts(array(
449
+ 'post_type' => 'wpcf7_contact_form',
450
+ 'showposts' => 999,
451
+ ));
452
+ $options[0] = esc_html__('Select a Form', 'tx');
453
+ if (!empty($wpcf7_form_list) && !is_wp_error($wpcf7_form_list)) {
454
+ foreach ($wpcf7_form_list as $post) {
455
+ $options[$post->ID] = $post->post_title;
456
+ }
457
+ } else {
458
+ $options[0] = esc_html__('Create a Form First', 'tx');
459
+ }
460
+ }
461
+ return $options;
462
+ }
463
 
tx-toolkit.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin Name: TemplatesNext ToolKit
5
  Description: Custom Portfolio and Shortcode functionality for TemplatesNext Wordpress Themes
6
- Version: 3.1.6
7
  Author: TemplatesNext
8
  Author URI: http://templatesnext.org/
9
  License: GPLv2 or later
@@ -156,4 +156,10 @@ if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', g
156
 
157
 
158
  /* *********************** Shape Dividers ********************/
159
- require_once('inc/shape-seperators.php');
 
 
 
 
 
 
3
  /*
4
  Plugin Name: TemplatesNext ToolKit
5
  Description: Custom Portfolio and Shortcode functionality for TemplatesNext Wordpress Themes
6
+ Version: 3.1.7
7
  Author: TemplatesNext
8
  Author URI: http://templatesnext.org/
9
  License: GPLv2 or later
156
 
157
 
158
  /* *********************** Shape Dividers ********************/
159
+ require_once('inc/shape-seperators.php');
160
+
161
+
162
+ /* *********************** WishList & Compare ********************/
163
+ if ( in_array( 'elementor/elementor.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
164
+ require_once('inc/el-widgets/elementor-addon.php');
165
+ }