PluginProbe
WP Directory Kit / 1.1.8
WP Directory Kit v1.1.8
1.5.9 1.5.7 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 All 37 releases
wpdirectorykit / application / views / fields_edit / SAVE_SEARCH_QUERY.php

SAVE_SEARCH_QUERY.php in WP Directory Kit 1.1.8, at application/views/fields_edit/SAVE_SEARCH_QUERY.php

140 lines 6.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The template for Edit field SAVE SEARCH QUERY.
4 *
5 * This is the template that field layout for edit form
6 *
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit; // Exit if accessed directly.
11 }
12 ?>
13 <?php
14
15 //wmvc_dump($field);
16
17 if(isset($field->field))
18 {
19 $field_id = $field->field;
20 }
21 else
22 {
23 $field_id = 'field_'.$field->idfield;
24 }
25
26 if(!isset($field->hint))$field->hint = '';
27 if(!isset($field->columns_number))$field->columns_number = '';
28 if(!isset($field->class))$field->class = '';
29
30 $field_label = $field->field_label;
31
32 $required = '';
33 if(isset($field->is_required) && $field->is_required == 1)
34 $required = '*';
35
36 if(isset($field->rules) && strpos($field->rules, 'required') !== FALSE)
37 $required = '*';
38
39 global $Winter_MVC_WDK;
40 $Winter_MVC_WDK->load_helper('listing');
41 ?>
42
43 <div class="wdk-field-edit <?php echo esc_attr($field->field_type); ?> wdk-col-<?php echo esc_attr($field->columns_number); ?> <?php echo esc_attr($field->class); ?>">
44 <label for="<?php echo esc_attr($field_id); ?>"><?php echo esc_html($field_label).esc_html($required); ?></label>
45 <div class="wdk-field-container">
46 <?php
47 wp_editor(wmvc_show_data(esc_attr($field_id), $db_data, ''), esc_attr($field_id), array (
48 'textarea_rows' => 5,
49 'media_buttons' => FALSE,
50 'wpautop' => false,
51 'teeny' => false,
52 'tinymce' => false,
53 'teeny' => false,
54 'dfw' => false,
55 'quicktags' => false
56 ));
57 ?>
58 <div>
59 <?php
60 $custom_parameters = array();
61 $qr_string = trim(wmvc_show_data(esc_attr($field_id), $db_data, ''));
62 $string_par = array();
63 parse_str($qr_string, $string_par);
64 $custom_parameters = $string_par;
65 ?>
66 <?php $comma = false; foreach ($custom_parameters as $field_key => $field_value) :
67 $field_data = explode('_', $field_key);
68 if(isset($field_data[1]) && is_array($field_value)) {
69 if($comma)
70 echo ', ';
71 if(is_numeric($field_data[1])) {
72 echo '<b style="font-weight: 500;">'.esc_html(wdk_field_label($field_data[1])).'</b>: ';
73 }
74 elseif($field_data[1] == 'category') {
75 $Winter_MVC_WDK->model('category_m');
76 $tree_data = $Winter_MVC_WDK->category_m->get($field_value, TRUE);
77 echo '<b style="font-weight: 500;">'.esc_html__('Category','wdk-membership').'</b>: ';
78 }
79 elseif($field_data[1] == 'location') {
80 $Winter_MVC_WDK->model('location_m');
81 $tree_data = $Winter_MVC_WDK->location_m->get($field_value, TRUE);
82 echo '<b style="font-weight: 500;">'.esc_html__('Location','wdk-membership').'</b>: ';
83 }
84 elseif($field_data[1] == 'search') {
85 echo '<b style="font-weight: 500;">'.esc_html__('Search Smart','wdk-membership').'</b>: ';
86 }
87 else {
88 echo '<b style="font-weight: 500;">'.esc_html($field_data[1]).'</b>: '.esc_html($field_value);
89 }
90 $comma = true;
91 foreach($field_value as $value) {
92 if(empty($value)) continue;
93 if($field_data[1] == 'category') {
94 $Winter_MVC_WDK->model('category_m');
95 $tree_data = $Winter_MVC_WDK->category_m->get($field_value, TRUE);
96 echo esc_html(wmvc_show_data('category_title', $tree_data));
97 }
98 elseif($field_data[1] == 'location') {
99 $Winter_MVC_WDK->model('location_m');
100 $tree_data = $Winter_MVC_WDK->location_m->get($field_value, TRUE);
101 echo esc_html(wmvc_show_data('location_title', $tree_data));
102 }
103 else {
104 echo esc_html($field_value);
105 }
106 }
107
108 } elseif(isset($field_data[1]) && is_string($field_value)){
109 if($comma)
110 echo ', ';
111 if(is_numeric($field_data[1])) {
112 echo '<b style="font-weight: 500;">'.esc_html(wdk_field_label($field_data[1])).'</b>: '.esc_html($field_value);
113 }
114 elseif($field_data[1] == 'category') {
115 $Winter_MVC_WDK->model('category_m');
116 $tree_data = $Winter_MVC_WDK->category_m->get($field_value, TRUE);
117 echo '<b style="font-weight: 500;">'.esc_html__('Category','wdk-membership').'</b>: '.esc_html(wmvc_show_data('category_title', $tree_data));
118 }
119 elseif($field_data[1] == 'location') {
120 $Winter_MVC_WDK->model('location_m');
121 $tree_data = $Winter_MVC_WDK->location_m->get($field_value, TRUE);
122 echo '<b style="font-weight: 500;">'.esc_html__('Location','wdk-membership').'</b>: '.esc_html(wmvc_show_data('location_title', $tree_data));
123 }
124 elseif($field_data[1] == 'search') {
125 echo '<b style="font-weight: 500;">'.esc_html__('Search Smart','wdk-membership').'</b>: '.esc_html($field_value);
126 }
127 else {
128 echo '<b style="font-weight: 500;">'.esc_html($field_data[1]).'</b>: '.esc_html($field_value);
129 }
130 $comma = true;
131 }
132 endforeach;?>
133 </div>
134 <?php if(!empty($field->hint)):?>
135 <p class="wdk-hint">
136 <?php echo esc_html($field->hint); ?>
137 </p>
138 <?php endif;?>
139 </div>
140 </div>