PluginProbe
WpStream – Live Streaming, Video on Demand, Pay Per View / 4.5
WpStream – Live Streaming, Video on Demand, Pay Per View v4.5
4.14.0 4.13.2 4.13.1 4.13 4.12.5 4.12.4 4.12.3 4.12.2 4.12.1 4.12 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 4.5 4.5.1 4.5.11 4.5.11.1 4.5.11.2 4.5.11.4 4.5.11.5 4.5.11.6 4.5.12 All 180 releases
wpstream / widgets / wpstream_chat.php

wpstream_chat.php in WpStream – Live Streaming, Video on Demand, Pay Per View 4.5, at widgets/wpstream_chat.php

177 lines 3.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace ElementorWpStream\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 class Wpstream_Chat_Base extends Widget_Base {
11
12 /**
13 * Retrieve the widget name.
14 *
15 * @since 1.0.0
16 *
17 * @access public
18 *
19 * @return string Widget name.
20 */
21 public function get_name() {
22 return 'Wpstream_Chat';
23 }
24
25 public function get_categories() {
26 return [ 'wpstream' ];
27 }
28
29
30 /**
31 * Retrieve the widget title.
32 *
33 * @since 1.0.0
34 *
35 * @access public
36 *
37 * @return string Widget title.
38 */
39 public function get_title() {
40 return '<div class="wpestate_elementor_widget_title">'.__( 'WpStream Chat - Beta Version', 'wpstream' ).'</div>';
41 }
42
43 /**
44 * Retrieve the widget icon.
45 *
46 * @since 1.0.0
47 *
48 * @access public
49 *
50 * @return string Widget icon.
51 */
52 public function get_icon() {
53 return 'eicon-play-o';
54 }
55
56
57
58 /**
59 * Retrieve the list of scripts the widget depended on.
60 *
61 * Used to set scripts dependencies required to run the widget.
62 *
63 * @since 1.0.0
64 *
65 * @access public
66 *
67 * @return array Widget scripts dependencies.
68 */
69 public function get_script_depends() {
70 return [ '' ];
71 }
72
73 /**
74 * Register the widget controls.
75 *
76 * Adds different input fields to allow the user to change and customize the widget settings.
77 *
78 * @since 1.0.0
79 *
80 * @access protected
81 */
82
83 public function elementor_transform($input){
84 $output=array();
85 if( is_array($input) ){
86 foreach ($input as $key=>$tax){
87 $output[$tax['value']]=$tax['label'];
88 }
89 }
90 return $output;
91 }
92
93 protected function _register_controls() {
94 global $all_tax;
95
96 $featured_places_array =array(1=>1,2=>2,3=>3);
97
98 $this->start_controls_section(
99 'section_content',
100 [
101 'label' => __( 'Content', 'wpstream' ),
102 ]
103 );
104
105
106
107
108 $this->add_control(
109 'item_id',
110 [
111 'label' => __( 'Product/Free Product id', 'wpstream' ),
112 'label_block'=>true,
113 'type' => Controls_Manager::TEXT,
114 ]
115 );
116
117
118
119
120 $this->end_controls_section();
121
122
123 }
124
125 /**
126 * Render the widget output on the frontend.
127 *
128 * Written in PHP and used to generate the final HTML.
129 *
130 * @since 1.0.0
131 *
132 * @access protected
133 */
134
135 public function wpresidence_send_to_shortcode($input){
136 $output='';
137 if($input!==''){
138 $numItems = count($input);
139 $i = 0;
140
141 foreach ($input as $key=>$value){
142 $output.=$value;
143 if(++$i !== $numItems) {
144 $output.=', ';
145 }
146 }
147 }
148 return $output;
149 }
150
151 protected function render() {
152 $settings = $this->get_settings_for_display();
153
154 $attributes['id'] = $settings['item_id'] ;
155
156 global $wpstream_plugin;
157 echo $wpstream_plugin->wpstream_insert_chat_elementor($attributes);
158 }
159
160 /**
161 * Render the widget output in the editor.
162 *
163 * Written as a Backbone JavaScript template and used to generate the live preview.
164 *
165 * @since 1.0.0
166 *
167 * @access protected
168 */
169 protected function content_template() {
170 ?>
171 <div class="title">
172 {{{ settings.title }}}
173 </div>
174 <?php
175 }
176 }
177