PluginProbe
WP Directory Kit / 1.3.1
WP Directory Kit v1.3.1
1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 1.4.0 1.4.1 All 35 releases
wpdirectorykit / elementor-extensions / class-hider.php

class-hider.php in WP Directory Kit 1.3.1, at elementor-extensions/class-hider.php

706 lines 27.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('ABSPATH'))
4 exit; // Exit if accessed directly
5
6 use Elementor\Plugin;
7 use Elementor\Controls_Manager;
8 use Elementor\Modules\DynamicTags\Module;
9
10 add_action( 'elementor/init', function() {
11
12 $listing_page_id = get_option('wdk_listing_page');
13
14 if(!empty($listing_page_id))
15 {
16 new WDK_Extension_Hider();
17
18 /*
19 if(isset($_GET['post']) && $_GET['post'] == $listing_page_id)
20 {
21 new WDK_Extension_Hider();
22 }
23 elseif(!Plugin::$instance->editor->is_edit_mode())
24 {
25 new WDK_Extension_Hider();
26 }*/
27 }
28 });
29
30 /**
31 * WDK_Extension_Hider
32 *
33 * Class to extend Elementor controls functionality, adding hide feature based on specific wdk field
34 *
35 */
36
37 class WDK_Extension_Hider {
38
39 public $name = 'WDK Hider';
40
41 private $is_common = true;
42
43 private $depended_scripts = [];
44
45 private $depended_styles = [];
46
47 private $has_controls = TRUE;
48
49 public $common_sections_actions = array(
50 array(
51 'element' => 'common',
52 'action' => '_section_style',
53 ),
54 array(
55 'element' => 'container',
56 'action' => 'section_layout',
57 ),
58 array(
59 'element' => 'section',
60 'action' => 'section_advanced',
61 ),
62 array(
63 'element' => 'column',
64 'action' => 'section_advanced',
65 ),
66 );
67
68 private $supported_elements = array(
69 'heading'
70 );
71
72 public function __construct() {
73
74 /*
75 Controls_Manager::add_tab(
76 'wdk_hider',
77 __( 'Hider', 'wpdirectorykit' )
78 );*/
79
80 $this->init();
81 }
82
83 public function init( $param = null ) {
84 // Enqueue scripts
85 add_action( 'elementor/frontend/after_enqueue_scripts', [ $this, 'enqueue_scripts' ] );
86
87 // Enqueue styles
88 add_action( 'elementor/frontend/after_enqueue_styles', [ $this, 'enqueue_styles' ] );
89
90 // Elementor hooks
91
92 if ( $this->is_common ) {
93 // Add the advanced section required to display controls
94 $this->add_common_sections_actions();
95 }
96
97 $this->add_actions();
98 }
99
100 public static function is_enabled() {
101 return true;
102 }
103
104 public function add_script_depends( $handler ) {
105 $this->depended_scripts[] = $handler;
106 }
107
108 public function add_style_depends( $handler ) {
109 $this->depended_styles[] = $handler;
110 }
111
112 public function get_script_depends() {
113 return $this->depended_scripts;
114 }
115
116 public function enqueue_scripts() {
117 foreach ( $this->get_script_depends() as $script ) {
118 wp_enqueue_script( $script );
119 }
120 }
121
122 public function get_style_depends() {
123 return $this->depended_styles;
124 }
125
126 public static function get_description() {
127 return '';
128 }
129
130 public function enqueue_styles() {
131 foreach ( $this->get_style_depends() as $style ) {
132 wp_enqueue_style( $style );
133 }
134 }
135
136 public function _enqueue_scripts() {
137 $scripts = $this->get_script_depends();
138 if ( ! empty( $scripts ) ) {
139 foreach ( $scripts as $script ) {
140 wp_enqueue_script( $script );
141 }
142 }
143 }
144
145 public function _enqueue_styles() {
146 $styles = $this->get_style_depends();
147 if ( ! empty( $styles ) ) {
148 foreach ( $styles as $style ) {
149 wp_enqueue_style( $style );
150 }
151 }
152 }
153
154 public function enqueue_all() {
155 $this->_enqueue_styles();
156 $this->_enqueue_scripts();
157 }
158
159 public function get_low_name() {
160 return 'hider';
161 }
162
163 final public function add_common_sections( $element, $args ) {
164 $low_name = $this->get_low_name();
165 $section_name = 'wdk_section_' . $low_name . '_advanced';
166
167 if ( ! $this->has_controls ) {
168 // no need settings
169 return false;
170 }
171
172 // Check if this section exists
173 $section_exists = \Elementor\Plugin::instance()->controls_manager->get_control_from_stack( $element->get_unique_name(), $section_name );
174
175 if ( ! is_wp_error( $section_exists ) ) {
176 // We can't and should try to add this section to the stack
177 return false;
178 }
179
180 $this->get_control_section( $section_name, $element );
181 }
182
183 public function add_common_sections_actions() {
184 foreach ( $this->common_sections_actions as $action ) {
185 // Activate action for elements
186 add_action('elementor/element/' . $action['element'] . '/' . $action['action'] . '/after_section_end', function ( $element, $args ) {
187 $this->add_common_sections( $element, $args );
188 }, 10, 2);
189 }
190 }
191
192 protected function add_actions() {
193
194 // WIDGET
195 add_action( 'elementor/frontend/widget/before_render', [ $this, '_start_element' ], 10, 1 );
196 add_action( 'elementor/frontend/widget/after_render', [ $this, '_end_element' ], 10, 1 );
197
198 // SECTION
199 add_action( 'elementor/frontend/section/before_render', [ $this, '_start_element' ], 10, 1 );
200 add_action( 'elementor/frontend/section/after_render', [ $this, '_end_element' ], 10, 1 );
201
202 // CONTAINER
203 add_action( 'elementor/frontend/container/before_render', [ $this, '_start_element' ], 10, 1 );
204 add_action( 'elementor/frontend/container/after_render', [ $this, '_end_element' ], 10, 1 );
205
206 // COLUMN
207 add_action( 'elementor/frontend/column/before_render', [ $this, '_start_element' ], 10, 1 );
208 add_action( 'elementor/frontend/column/after_render', [ $this, '_end_element' ], 10, 1 );
209
210
211 }
212
213 protected function remove_controls( $element, $controls = null ) {
214 if ( empty( $controls ) ) {
215 return;
216 }
217
218 if ( is_array( $controls ) ) {
219 $control_id = $controls;
220
221 foreach ( $controls as $control_id ) {
222 $element->remove_control( $control_id );
223 }
224 } else {
225 $element->remove_control( $controls );
226 }
227 }
228
229 public function get_control_section( $section_name, $element ) {
230 $low_name = $this->get_low_name();
231
232 $element->start_controls_section(
233 $section_name,
234 [
235 'label' => '<span class="color-wdk icon icon-dyn-logo-wdk pull-right ml-1"></span> ' . $this->name,
236 'tab' => 'advanced',
237 ]
238 );
239
240 $fields_data = wdk_cached_field_get();
241 $fields_list = array('' => esc_html__('Not Selected', 'wpdirectorykit'));
242 $order_i = 0;
243 $fields_allow_for_get = array();
244 $fields_allow_for_compare = array();
245 $fields_list [(++$order_i).'__section'] = esc_html__('-- Section Custom fields --', 'wpdirectorykit');
246
247 $fields_list [(++$order_i).'__hide_on_get'] = esc_html__('Hide if GET is', 'wpdirectorykit');
248 $fields_allow_for_get[] = $order_i.'__hide_on_get';
249 $fields_list [(++$order_i).'__show_on_get'] = esc_html__('Show if GET is', 'wpdirectorykit');
250 $fields_allow_for_get[] = $order_i.'__show_on_get';
251
252 $fields_list [(++$order_i).'__profile_have_agency'] = esc_html__('Profile page is agency', 'wpdirectorykit');
253 $fields_list [(++$order_i).'__have_agency'] = esc_html__('Listing have agency', 'wpdirectorykit');
254 $fields_list [(++$order_i).'__have_sublistings'] = esc_html__('Listing have sublistings', 'wpdirectorykit');
255 $fields_list [(++$order_i).'__have_calendar'] = esc_html__('Listing have calendar', 'wpdirectorykit');
256 $fields_list [(++$order_i).'__havent_calendar'] = esc_html__('Listing not have calendar', 'wpdirectorykit');
257 $fields_list [(++$order_i).'__havent_images'] = esc_html__('Listing not have images', 'wpdirectorykit');
258 $fields_list [(++$order_i).'__have_images'] = esc_html__('Listing have images', 'wpdirectorykit');
259 $fields_list [(++$order_i).'__idlisting'] = esc_html__('Id listing', 'wpdirectorykit');
260 $fields_list [(++$order_i).'__post_id'] = esc_html__('Post Id', 'wpdirectorykit');
261 $fields_allow_for_compare[] = ($order_i).'__post_id';
262 $fields_list [(++$order_i).'__lat'] = esc_html__('Gps Lat', 'wpdirectorykit');
263 $fields_list [(++$order_i).'__lng'] = esc_html__('Gps Lng', 'wpdirectorykit');
264 $fields_list [(++$order_i).'__date'] = esc_html__('Date', 'wpdirectorykit');
265 $fields_list [(++$order_i).'__date_modified'] = esc_html__('Date Modified', 'wpdirectorykit');
266 $fields_list [(++$order_i).'__post_content'] = esc_html__('WP Content', 'wpdirectorykit');
267 $fields_list [(++$order_i).'__address'] = esc_html__('Address', 'wpdirectorykit');
268 $fields_list [(++$order_i).'__category_id'] = esc_html__('Category', 'wpdirectorykit');
269 $fields_allow_for_compare[] = ($order_i).'__category_id';
270 $fields_list [(++$order_i).'__location_id'] = esc_html__('Location', 'wpdirectorykit');
271 $fields_allow_for_compare[] = ($order_i).'__location_id';
272 foreach($fields_data as $field)
273 {
274 if(wmvc_show_data('field_type', $field) == 'SECTION') {
275 $fields_list [(++$order_i).'section__'.wmvc_show_data('idfield', $field)] = '-- '.esc_html__('Section', 'wpdirectorykit').' '.wmvc_show_data('field_label', $field).' --';
276 } else {
277 $fields_list[(++$order_i).'__'.wmvc_show_data('idfield', $field)] = '#'.wmvc_show_data('idfield', $field).' '.wmvc_show_data('field_label', $field).'['.wmvc_show_data('field_type', $field).']';
278 $fields_allow_for_compare[] = ($order_i).'__'.wmvc_show_data('idfield', $field);
279 }
280 }
281
282 $element->add_control(
283 'wdk_related_field',
284 [
285 'label' => esc_html__('WDK Related FIeld', 'wpdirectorykit'),
286 'type' => Controls_Manager::SELECT,
287 'options' => $fields_list,
288 'default' => '',
289 'return_value' => 'section',
290 'frontend_available' => true,
291 'render_type' => 'none',
292 ]
293 );
294
295 $element->add_control(
296 'wdk_related_show_on_get_key',
297 [
298 'label' => __( 'Key', 'wpdirectorykit' ),
299 'type' => \Elementor\Controls_Manager::TEXT,
300 'default' => '',
301 'condition' => [
302 'wdk_related_field' => $fields_allow_for_get,
303 ],
304 ]
305 );
306
307 $element->add_control(
308 'wdk_related_show_on_get_value',
309 [
310 'label' => __( 'Value', 'wpdirectorykit' ),
311 'type' => \Elementor\Controls_Manager::TEXT,
312 'default' => '',
313 'condition' => [
314 'wdk_related_field' => $fields_allow_for_get,
315 ],
316 ]
317 );
318
319 $element->add_control(
320 'wdk_related_compare_type',
321 [
322 'label' => __( 'Compare Type', 'wpdirectorykit' ),
323 'type' => \Elementor\Controls_Manager::SELECT,
324 'default' => '',
325 'options' => [
326 '' => esc_html__('Default (if not empty)', 'wpdirectorykit'),
327 '==' => esc_html__('==', 'wpdirectorykit'),
328 '!=' => esc_html__('!=', 'wpdirectorykit'),
329 '>' => esc_html__('>', 'wpdirectorykit'),
330 '<' => esc_html__('<', 'wpdirectorykit'),
331 ],
332 'condition' => [
333 'wdk_related_field' => $fields_allow_for_compare,
334 ],
335 ]
336 );
337
338 $element->add_control(
339 'wdk_related_compare_value',
340 [
341 'label' => __( 'Value', 'wpdirectorykit' ),
342 'type' => \Elementor\Controls_Manager::TEXT,
343 'default' => '',
344 'condition' => [
345 'wdk_related_field' => $fields_allow_for_compare,
346 ],
347 ]
348 );
349
350 $element->end_controls_section();
351
352 }
353
354 public function _start_element( $element ) {
355 global $wdk_listing_id;
356 $wdkmembership_user_id = wdk_get_profile_page_id();
357
358 //if(Plugin::$instance->editor->is_edit_mode())return;
359 if(Plugin::$instance->editor->is_edit_mode() || (empty($wdk_listing_id) && empty($wdkmembership_user_id)))return;
360 //if(!in_array($element->get_name(), $this->supported_elements))return;
361
362 $WMVC = &wdk_get_instance();
363 $WMVC->model('field_m');
364 $WMVC->load_helper('listing');
365 $settings = $element->get_settings_for_display();
366
367 if(isset($settings['wdk_related_field']) && !empty($settings['wdk_related_field']))
368 {
369
370 $field_id = NULL;
371 $field_value = NULL;
372 $field_empty = FALSE;
373 if(strpos($settings['wdk_related_field'], '__') !== FALSE){
374 $field_id = substr($settings['wdk_related_field'], strpos($settings['wdk_related_field'],'__')+2);
375 }
376
377 if(is_null($field_id))return;
378 if($field_id == 'show_on_get' || $field_id == 'hide_on_get') {
379 if(!empty($settings['wdk_related_show_on_get_key']) && !empty($settings['wdk_related_show_on_get_value'])) {
380 $get_val = null;
381 if(isset($_GET[$settings['wdk_related_show_on_get_key']])){
382 $get_val = sanitize_text_field($_GET[$settings['wdk_related_show_on_get_key']]);
383 }
384
385 if($field_id == 'hide_on_get') {
386 if($get_val == $settings['wdk_related_show_on_get_value']){
387 $field_empty = true;
388 }
389 } else if($field_id == 'show_on_get') {
390 if($get_val !== $settings['wdk_related_show_on_get_value']){
391 $field_empty = true;
392 }
393 }
394 }
395 }elseif($field_id == 'havent_calendar' || $field_id == 'have_calendar') {
396 if(function_exists('run_wdk_bookings')) {
397 global $Winter_MVC_wdk_bookings;
398 $Winter_MVC_wdk_bookings->model('calendar_m');
399 $calendar = $Winter_MVC_wdk_bookings->calendar_m->get_by(array('post_id' => $wdk_listing_id, 'is_activated' => 1));
400 if($field_id == 'havent_calendar') {
401 if($calendar){
402 $field_empty = true;
403 }
404 } else if($field_id == 'have_calendar') {
405 if(!$calendar){
406 $field_empty = true;
407 }
408 }
409 }
410 } elseif($field_id == 'profile_have_agency') {
411 $wdkmembership_user_id = wdk_get_profile_page_id();
412 $field_empty = true;
413
414
415 if($wdkmembership_user_id) {
416 $user = wdk_get_user_data($wdkmembership_user_id);
417 if($user && wmvc_is_user_in_role($user['userdata'], 'wdk_agency')) {
418 $field_empty = false;
419 }
420
421 }
422 } elseif($field_id == 'have_agency') {
423 $field_empty = true;
424 if(function_exists('run_wdk_membership') && file_exists(WDK_MEMBERSHIP_PATH.'application/models/Agency_agent_m.php')) {
425 if(wdk_field_value ('user_id_editor', $wdk_listing_id)) {
426 $agent_id = wdk_field_value ('user_id_editor', $wdk_listing_id);
427 global $Winter_MVC_wdk_membership;
428 $Winter_MVC_wdk_membership->model('agency_agent_m');
429 $agent_agency = $Winter_MVC_wdk_membership->agency_agent_m->get_by(array('agent_id' => $agent_id, 'status' => 'CONFIRMED'), TRUE);
430 if($agent_agency) {
431 $user = wdk_get_user_data( wmvc_show_data('agency_id', $agent_agency, 0));
432 if($user){
433 $field_empty = false;
434 }
435 }
436 }
437 }
438 } elseif($field_id == 'have_sublistings') {
439
440 $field_empty = true;
441 if(!empty(wdk_field_value('listing_related_ids', $wdk_listing_id))){
442 foreach (explode(',',wdk_field_value('listing_related_ids', $wdk_listing_id)) as $key => $child_idlisting) {
443 if(!wdk_field_value('is_activated', $child_idlisting) || !wdk_field_value('is_approved', $child_idlisting)) continue;
444
445 $field_empty = false;
446 break;
447 }
448 }
449 } elseif($field_id == 'havent_images' || $field_id == 'have_images') {
450 $images = wdk_field_value('listing_images', $wdk_listing_id);
451 if($field_id == 'havent_images') {
452 if($images){
453 $field_empty = true;
454 }
455 } else if($field_id == 'have_images') {
456 if(!$images){
457 $field_empty = true;
458 }
459 }
460 } elseif(wdk_field_option($field_id, 'field_type') == "SECTION") {
461
462 // get all section fields
463 $sections_data = $WMVC->field_m->get_fields_section();
464
465 if(!isset($sections_data[$field_id]) || !isset($sections_data[$field_id]['fields']))return;
466
467 // check if all subfields are empty
468 $field_empty = true;
469 foreach($sections_data[$field_id]['fields'] as $field) {
470 if(!empty(wdk_field_value(wmvc_show_data('idfield', $field), $wdk_listing_id))){
471 $field_empty = false;
472 break;
473 }
474 }
475 }
476 else
477 {
478 $field_value = wdk_field_value($field_id, $wdk_listing_id);
479 if(!empty($settings['wdk_related_compare_type'])) {
480 switch ($settings['wdk_related_compare_type']) {
481 case '==':
482 if($field_value == $settings['wdk_related_compare_value']) {
483 } else {
484 $field_empty = TRUE;
485 }
486 break;
487 case '!=':
488 if($field_value != $settings['wdk_related_compare_value']) {
489 } else {
490 $field_empty = TRUE;
491 }
492 break;
493 case '>':
494 if($field_value > $settings['wdk_related_compare_value']) {
495 } else {
496 $field_empty = TRUE;
497 }
498 break;
499 case '<':
500 if($field_value < $settings['wdk_related_compare_value']) {
501 } else {
502 $field_empty = TRUE;
503 }
504 break;
505 default:
506 # code...
507 break;
508 }
509 } else {
510 if(empty($field_value))$field_empty = TRUE;
511 }
512 }
513
514 if($field_empty)
515 {
516 /*
517 echo '<pre>';
518 var_dump($settings['wdk_related_field']);
519 echo '</pre>';
520 */
521
522 ob_start();
523 }
524
525 }
526 }
527
528 public function _end_element( $element ) {
529 global $wdk_listing_id;
530
531 $wdkmembership_user_id = wdk_get_profile_page_id();
532
533 //if(Plugin::$instance->editor->is_edit_mode())return;
534 if(Plugin::$instance->editor->is_edit_mode() || (empty($wdk_listing_id) && empty($wdkmembership_user_id)))return;
535 //if(!in_array($element->get_name(), $this->supported_elements))return;
536
537 $WMVC = &wdk_get_instance();
538 $WMVC->model('field_m');
539 $WMVC->load_helper('listing');
540 $settings = $element->get_settings_for_display();
541
542 if(isset($settings['wdk_related_field']) && !empty($settings['wdk_related_field']))
543 {
544 $field_id = NULL;
545 $field_value = NULL;
546 $field_empty = FALSE;
547 if(strpos($settings['wdk_related_field'], '__') !== FALSE){
548 $field_id = substr($settings['wdk_related_field'], strpos($settings['wdk_related_field'],'__')+2);
549 }
550
551 if(is_null($field_id))return;
552 if($field_id == 'show_on_get' || $field_id == 'hide_on_get') {
553 if(!empty($settings['wdk_related_show_on_get_key']) && !empty($settings['wdk_related_show_on_get_value'])) {
554 $get_val = null;
555 if(isset($_GET[$settings['wdk_related_show_on_get_key']])){
556 $get_val = sanitize_text_field($_GET[$settings['wdk_related_show_on_get_key']]);
557 }
558 if($field_id == 'hide_on_get') {
559 if($get_val == $settings['wdk_related_show_on_get_value']){
560 $field_empty = true;
561 }
562 } else if($field_id == 'show_on_get') {
563 if($get_val !== $settings['wdk_related_show_on_get_value']){
564 $field_empty = true;
565 }
566 }
567 }
568 }elseif($field_id == 'havent_calendar' || $field_id == 'have_calendar') {
569 if(function_exists('run_wdk_bookings')) {
570 global $Winter_MVC_wdk_bookings;
571 $Winter_MVC_wdk_bookings->model('calendar_m');
572 $calendar = $Winter_MVC_wdk_bookings->calendar_m->get_by(array('post_id' => $wdk_listing_id, 'is_activated' => 1));
573 if($field_id == 'havent_calendar') {
574 if($calendar){
575 $field_empty = true;
576 }
577 } else if($field_id == 'have_calendar') {
578 if(!$calendar){
579 $field_empty = true;
580 }
581 }
582 }
583 } elseif($field_id == 'have_sublistings') {
584
585 $field_empty = true;
586 if(!empty(wdk_field_value('listing_related_ids', $wdk_listing_id))){
587 foreach (explode(',',wdk_field_value('listing_related_ids', $wdk_listing_id)) as $key => $child_idlisting) {
588 if(!wdk_field_value('is_activated', $child_idlisting) || !wdk_field_value('is_approved', $child_idlisting)) continue;
589
590 $field_empty = false;
591 break;
592 }
593 }
594 } elseif($field_id == 'have_agency') {
595 $field_empty = true;
596 if(function_exists('run_wdk_membership') && file_exists(WDK_MEMBERSHIP_PATH.'application/models/Agency_agent_m.php')) {
597 if(wdk_field_value ('user_id_editor', $wdk_listing_id)) {
598 $agent_id = wdk_field_value ('user_id_editor', $wdk_listing_id);
599 global $Winter_MVC_wdk_membership;
600 $Winter_MVC_wdk_membership->model('agency_agent_m');
601 $agent_agency = $Winter_MVC_wdk_membership->agency_agent_m->get_by(array('agent_id' => $agent_id, 'status' => 'CONFIRMED'), TRUE);
602 if($agent_agency) {
603 $user = wdk_get_user_data( wmvc_show_data('agency_id', $agent_agency, 0));
604 if($user){
605 $field_empty = false;
606 }
607 }
608 }
609 }
610 } elseif($field_id == 'profile_have_agency') {
611 $wdkmembership_user_id = wdk_get_profile_page_id();
612 $field_empty = true;
613 if($wdkmembership_user_id) {
614 $user = wdk_get_user_data($wdkmembership_user_id);
615 if($user && wmvc_is_user_in_role($user['userdata'], 'wdk_agency')) {
616 $field_empty = false;
617 }
618
619 }
620 } elseif($field_id == 'havent_images' || $field_id == 'have_images') {
621 $images = wdk_field_value('listing_images', $wdk_listing_id);
622 if($field_id == 'havent_images') {
623 if($images){
624 $field_empty = true;
625 }
626 } else if($field_id == 'have_images') {
627 if(!$images){
628 $field_empty = true;
629 }
630 }
631 } elseif(wdk_field_option($field_id, 'field_type') == "SECTION") {
632
633 // get all section fields
634 $sections_data = $WMVC->field_m->get_fields_section();
635
636 if(!isset($sections_data[$field_id]) || !isset($sections_data[$field_id]['fields']))return;
637
638 // check if all subfields are empty
639 $field_empty = true;
640 foreach($sections_data[$field_id]['fields'] as $field) {
641 if(!empty(wdk_field_value(wmvc_show_data('idfield', $field), $wdk_listing_id))){
642 $field_empty = false;
643 break;
644 }
645 }
646 }
647 else
648 {
649 $field_value = wdk_field_value($field_id, $wdk_listing_id);
650 if(!empty($settings['wdk_related_compare_type'])) {
651 switch ($settings['wdk_related_compare_type']) {
652 case '==':
653 if($field_value == $settings['wdk_related_compare_value']) {
654 } else {
655 $field_empty = TRUE;
656 }
657 break;
658 case '!=':
659 if($field_value != $settings['wdk_related_compare_value']) {
660 } else {
661 $field_empty = TRUE;
662 }
663 break;
664 case '>':
665 if($field_value > $settings['wdk_related_compare_value']) {
666 } else {
667 $field_empty = TRUE;
668 }
669 break;
670 case '<':
671 if($field_value < $settings['wdk_related_compare_value']) {
672 } else {
673 $field_empty = TRUE;
674 }
675 break;
676 default:
677 # code...
678 break;
679 }
680 } else {
681 if(empty($field_value))$field_empty = TRUE;
682 }
683 }
684
685 if($field_empty)
686 {
687 /*
688 echo '<pre>';
689 var_dump($settings['wdk_related_field']);
690 echo '</pre>';
691 */
692
693 $content = ob_get_clean();
694 }
695
696 }
697 }
698
699 }
700
701
702
703
704
705
706