| @@ -32,11 +32,28 @@ | ||
| 32 | 32 | if(isset($_POST['listing_post_id'])) |
| 33 | 33 | $listing_post_id = sanitize_text_field($_POST['listing_post_id']); |
| 34 | 34 | |
| 35 | 35 | $listing = $this->load->listing_m->get($listing_post_id, TRUE); |
| 36 | + | |
| 37 | + if (!$listing || $listing->post_status != 'publish' || !empty($listing->post_password)) { | |
| 38 | + return false; | |
| 39 | + } | |
| 36 | 40 | |
| 41 | + /* protect check */ | |
| 42 | + if ( | |
| 43 | + !wdk_field_value('is_activated', $listing, false) || !wdk_field_value('is_approved', $listing,false) | |
| 44 | + ) { | |
| 45 | + $data['popup_content'] = __( 'Listing is not public', 'wpdirectorykit' ); | |
| 46 | + $this->output($data); | |
| 47 | + } | |
| 48 | + | |
| 49 | + $popup_layout = 'result_item_card'; | |
| 50 | + if(!empty($_POST['custom_layout_id'])) { | |
| 51 | + $popup_layout = (int) sanitize_text_field($_POST['custom_layout_id']); | |
| 52 | + } | |
| 53 | + | |
| 37 | 54 | if(!empty($listing)) { |
| 38 | - $data['popup_content'] = wdk_listing_card($listing, array('infobox' => true), false, '<div class="infobox map-box">%1$s<div>'); | |
| 55 | + $data['popup_content'] = wdk_listing_card($listing, array('infobox' => true), false, '<div class="infobox map-box">%1$s<div>', $popup_layout); | |
| 39 | 56 | } else { |
| 40 | 57 | $data['popup_content'] = __( 'Listing is missing', 'wpdirectorykit' ); |
| 41 | 58 | } |
| 42 | 59 | |
| @@ -57,8 +74,21 @@ | ||
| 57 | 74 | $listing_post_id = sanitize_text_field($_POST['listing_post_id']); |
| 58 | 75 | |
| 59 | 76 | $listing = $this->load->listing_m->get($listing_post_id, TRUE); |
| 60 | 77 | |
| 78 | + | |
| 79 | + if (!$listing || $listing->post_status != 'publish' || !empty($listing->post_password)) { | |
| 80 | + return false; | |
| 81 | + } | |
| 82 | + | |
| 83 | + /* protect check */ | |
| 84 | + if ( | |
| 85 | + !wdk_field_value('is_activated', $listing, false) || !wdk_field_value('is_approved', $listing,false) | |
| 86 | + ) { | |
| 87 | + $data['popup_content'] = __( 'Listing is not public', 'wpdirectorykit' ); | |
| 88 | + $this->output($data); | |
| 89 | + } | |
| 90 | + | |
| 61 | 91 | if(!empty($listing)) { |
| 62 | 92 | $data['popup_content'] = wdk_listing_card($listing, [], false, '<div class="infobox map-box">%1$s<div>', 'result_item_card_dash_edit'); |
| 63 | 93 | } else { |
| 64 | 94 | $data['popup_content'] = __( 'Listing is missing', 'wpdirectorykit' ); |
| @@ -70,8 +100,11 @@ | ||
| 70 | 100 | } |
| 71 | 101 | |
| 72 | 102 | public function treefieldid($output="", $atts=array(), $instance=NULL) |
| 73 | 103 | { |
| 104 | + | |
| 105 | + check_ajax_referer('wdk_secure_treefieldid', 'wdk_secure'); | |
| 106 | + | |
| 74 | 107 | $this->load->load_helper('listing'); |
| 75 | 108 | $this->load->model('listing_m'); |
| 76 | 109 | $this->load->model('listingfield_m'); |
| 77 | 110 | |
| @@ -100,8 +133,14 @@ | ||
| 100 | 133 | $parameters['attribute_value'] = 'address'; |
| 101 | 134 | |
| 102 | 135 | if(empty($parameters['offset'])) |
| 103 | 136 | $parameters['offset'] = 0; |
| 137 | + | |
| 138 | + if(empty($parameters['sql_where'])) | |
| 139 | + $parameters['sql_where'] = ''; | |
| 140 | + | |
| 141 | + if(empty($parameters['hide_fields'])) | |
| 142 | + $parameters['hide_fields'] = ''; | |
| 104 | 143 | |
| 105 | 144 | $start_id = ''; |
| 106 | 145 | if(isset($parameters['start_id'])) |
| 107 | 146 | $start_id = $parameters['start_id']; |
| @@ -118,15 +157,20 @@ | ||
| 118 | 157 | |
| 119 | 158 | if($table == 'calendar_listing_m') |
| 120 | 159 | $table = 'listing_m'; |
| 121 | 160 | |
| 161 | + $post_table = $this->db->prefix.'posts'; | |
| 162 | + | |
| 122 | 163 | $table_name = substr($table,0, -2); |
| 123 | - $attr_id = sanitize_text_field($parameters['attribute_id']); | |
| 124 | - $attr_val = sanitize_text_field($parameters['attribute_value']); | |
| 125 | - $attr_search = sanitize_text_field($parameters['search_term']); | |
| 126 | - $skip_id = intval($parameters['skip_id']); | |
| 127 | - $language_id = intval($parameters['language_id']); | |
| 128 | 164 | |
| 165 | + $attr_id = preg_replace("/[^0-9a-zA-Z_\-]/", "",sanitize_text_field($parameters['attribute_id'])); | |
| 166 | + $attr_val = preg_replace("/[^0-9a-zA-Z_\-]/", "",sanitize_text_field($parameters['attribute_value'])); | |
| 167 | + | |
| 168 | + | |
| 169 | + $attr_search = wdk_esc_sql(sanitize_text_field($parameters['search_term'] ?? '')); | |
| 170 | + $skip_id = intval($parameters['skip_id'] ?? 0); | |
| 171 | + $language_id = intval($parameters['language_id'] ?? 0); | |
| 172 | + | |
| 129 | 173 | if(empty($language_id)) |
| 130 | 174 | $language_id = NULL; |
| 131 | 175 | |
| 132 | 176 | $id_part=""; |
| @@ -158,20 +202,63 @@ | ||
| 158 | 202 | } else { |
| 159 | 203 | $this->load->model($table); |
| 160 | 204 | |
| 161 | 205 | $where = array(); |
| 162 | - if(!empty($attr_search)) | |
| 163 | - $where["($id_part $attr_val LIKE '%$attr_search%')"] = NULL; | |
| 206 | + if(!empty($attr_search)) { | |
| 207 | + $attr_val_sql = $attr_val; | |
| 208 | + if($attr_val == 'location_title') { | |
| 209 | + $this->load->model($table); | |
| 210 | + $attr_val_sql = $this->$table->_table_name.'.location_title'; | |
| 211 | + } elseif($attr_val == 'category_title'){ | |
| 212 | + $this->load->model($table); | |
| 213 | + $attr_val_sql = $this->$table->_table_name.'.category_title'; | |
| 214 | + } | |
| 215 | + | |
| 216 | + /* if category/locations search also in translated field */ | |
| 217 | + if($attr_val == 'location_title' || $attr_val == 'category_title') { | |
| 218 | + $where["($id_part $attr_val_sql LIKE '%$attr_search%' OR ".$this->$table->_table_name.".titles_for_search LIKE '%$attr_search%')"] = NULL; | |
| 219 | + } else { | |
| 220 | + $where["($id_part $attr_val_sql LIKE '%$attr_search%')"] = NULL; | |
| 221 | + } | |
| 222 | + } | |
| 223 | + | |
| 224 | + if(!empty($parameters['sql_where'] )) { | |
| 225 | + $sql_where = ''; | |
| 226 | + if($parameters['sql_where'] == 'only_nochilds') { | |
| 227 | + $sql_where = "((".$this->listing_m->_table_name.".listing_parent_post_id IS NULL OR ".$this->listing_m->_table_name.".listing_parent_post_id = 0) AND (".$this->listing_m->_table_name.".`listing_related_ids` IS NULL OR ".$this->listing_m->_table_name.".`listing_related_ids` = '') )"; | |
| 228 | + } else { | |
| 229 | + | |
| 230 | + } | |
| 231 | + if(!empty($sql_where)) | |
| 232 | + $where[$sql_where] = NULL; | |
| 233 | + } | |
| 234 | + | |
| 235 | + if(!empty($parameters['hide_fields'])) { | |
| 236 | + $parameters['hide_fields'] = preg_replace('/[^0-9,]/', '', $parameters['hide_fields']); | |
| 237 | + if($table == 'location_m') { | |
| 238 | + $sql_where = esc_sql($this->$table->_table_name.'.idlocation').' NOT IN ('.esc_sql(sanitize_text_field($parameters['hide_fields'])).')'; | |
| 239 | + foreach (explode(',', $parameters['hide_fields']) as $key => $id) { | |
| 240 | + $sql_where .= ' AND CONCAT(",", '.$this->$table->_table_name.'.parent_path, ",") NOT LIKE CONCAT("%,", '.intval($id).', ",%")'; | |
| 241 | + } | |
| 242 | + | |
| 243 | + $where[$sql_where] = NULL; | |
| 244 | + } | |
| 245 | + | |
| 246 | + if($table == 'category_m') { | |
| 247 | + $sql_where = esc_sql($this->$table->_table_name.'.idcategory').' NOT IN ('.esc_sql(sanitize_text_field($parameters['hide_fields'])).')'; | |
| 248 | + foreach (explode(',', $parameters['hide_fields']) as $key => $id) { | |
| 249 | + $sql_where .= ' AND CONCAT(",", '.$this->$table->_table_name.'.parent_path, ",") NOT LIKE CONCAT("%,", '.intval($id).', ",%")'; | |
| 250 | + } | |
| 251 | + $where[$sql_where] = NULL; | |
| 252 | + } | |
| 253 | + } | |
| 164 | 254 | |
| 165 | - if(!empty($parameters['attr_search'])) | |
| 166 | - $where[$parameters['attr_search']] = NULL; | |
| 167 | - | |
| 168 | 255 | if(isset($parameters['user_check']) && ($parameters['user_check'] == 'true' || $parameters['user_check'] == '1')) { |
| 169 | 256 | if($table == 'listing_m') { |
| 170 | 257 | if($parameters['table'] == 'calendar_listing_m') { |
| 171 | 258 | global $Winter_MVC_wdk_bookings; |
| 172 | 259 | $Winter_MVC_wdk_bookings->model('calendar_m'); |
| 173 | - $this->db->join($Winter_MVC_wdk_bookings->calendar_m->_table_name.' ON '.$this->$table->_table_name.'.post_id = '.$Winter_MVC_wdk_bookings->calendar_m->_table_name.'.post_id'); | |
| 260 | + $this->db->join($Winter_MVC_wdk_bookings->calendar_m->_table_name.' ON '.$post_table.'.ID = '.$Winter_MVC_wdk_bookings->calendar_m->_table_name.'.post_id'); | |
| 174 | 261 | } |
| 175 | 262 | |
| 176 | 263 | $tree_results = $this->$table->get_pagination(intval($parameters['limit']),intval($parameters['offset']), $where, TRUE, get_current_user_id()); |
| 177 | 264 | } else { |
| @@ -176,9 +263,9 @@ | ||
| 176 | 263 | $tree_results = $this->$table->get_pagination(intval($parameters['limit']),intval($parameters['offset']), $where, TRUE, get_current_user_id()); |
| 177 | 264 | } else { |
| 178 | 265 | |
| 179 | 266 | if(!empty($parameters['filter_ids'])){ |
| 180 | - $this->db->where(array( esc_sql($this->$table->_primary_key).' IN ('.esc_sql($parameters['filter_ids']).')' => NULL)); | |
| 267 | + $this->db->where(array( esc_sql($this->$table->_table_name.'.'.$this->$table->_primary_key).' IN ('.esc_sql(preg_replace('/[^0-9,]/', '', $parameters['filter_ids'])).')' => NULL)); | |
| 181 | 268 | } |
| 182 | 269 | |
| 183 | 270 | $tree_results = $this->$table->get_pagination(intval($parameters['limit']),intval($parameters['offset']), $where ); |
| 184 | 271 | } |
| @@ -185,13 +272,13 @@ | ||
| 185 | 272 | } else { |
| 186 | 273 | if($parameters['table'] == 'calendar_listing_m') { |
| 187 | 274 | global $Winter_MVC_wdk_bookings; |
| 188 | 275 | $Winter_MVC_wdk_bookings->model('calendar_m'); |
| 189 | - $this->db->join($Winter_MVC_wdk_bookings->calendar_m->_table_name.' ON '.$this->$table->_table_name.'.post_id = '.$Winter_MVC_wdk_bookings->calendar_m->_table_name.'.post_id'); | |
| 276 | + $this->db->join($Winter_MVC_wdk_bookings->calendar_m->_table_name.' ON '.$post_table.'.ID = '.$Winter_MVC_wdk_bookings->calendar_m->_table_name.'.post_id'); | |
| 190 | 277 | } |
| 191 | 278 | |
| 192 | 279 | if(!empty($parameters['filter_ids'])){ |
| 193 | - $this->db->where(array( esc_sql($this->$table->_primary_key).' IN ('.esc_sql($parameters['filter_ids']).')' => NULL)); | |
| 280 | + $this->db->where(array( esc_sql($this->$table->_table_name.'.'.$this->$table->_primary_key).' IN ('.esc_sql(preg_replace('/[^0-9,]/', '', $parameters['filter_ids'])).')' => NULL)); | |
| 194 | 281 | } |
| 195 | 282 | |
| 196 | 283 | if($table == 'user_m') { |
| 197 | 284 | $like = "(meta_value LIKE '%wdk_%' )"; |
| @@ -197,14 +284,25 @@ | ||
| 197 | 284 | $like = "(meta_value LIKE '%wdk_%' )"; |
| 198 | 285 | $tree_results = $this->$table->get_pagination(intval($parameters['limit']),intval($parameters['offset']), $where, NULL, $like); |
| 199 | 286 | |
| 200 | 287 | } else { |
| 201 | - $tree_results = $this->$table->get_pagination(intval($parameters['limit']),intval($parameters['offset']), $where); | |
| 288 | + | |
| 289 | + if(method_exists($this->$table, 'get_pagination_simple')) { | |
| 290 | + if($table == 'location_m') { | |
| 291 | + $this->db->select('location_title, idlocation, level'); | |
| 292 | + } else if($table == 'category_m') { | |
| 293 | + $this->db->select('category_title, idcategory, level'); | |
| 294 | + } | |
| 295 | + $tree_results = $this->$table->get_pagination_simple(intval($parameters['limit']),intval($parameters['offset']), $where); | |
| 296 | + } else { | |
| 297 | + $tree_results = $this->$table->get_pagination(intval($parameters['limit']),intval($parameters['offset']), $where); | |
| 298 | + } | |
| 299 | + | |
| 202 | 300 | } |
| 301 | + } | |
| 203 | 302 | |
| 204 | - } | |
| 205 | 303 | } |
| 206 | - | |
| 304 | + | |
| 207 | 305 | $ind_order=1; |
| 208 | 306 | foreach ($tree_results as $key=>$row) |
| 209 | 307 | { |
| 210 | 308 | $level_gen=''; |
| @@ -216,9 +314,12 @@ | ||
| 216 | 314 | $results[$ind_order]['value'] = $level_gen |
| 217 | 315 | .'#'.wmvc_show_data($attr_id, $row).', '.wmvc_show_data($attr_val, $row); |
| 218 | 316 | } elseif($table == 'user_m') { |
| 219 | 317 | $results[$ind_order]['value'] = $level_gen |
| 220 | - .'#'.wmvc_show_data($attr_id, $row).', '.wmvc_show_data($attr_val, $row).' ('.wmvc_show_data('user_email', $row).')'; | |
| 318 | + .'#'.wmvc_show_data($attr_id, $row).', '.wmvc_show_data('display_name', $row); | |
| 319 | + | |
| 320 | + //if(current_user_can('wdk_listings_manage')) | |
| 321 | + // $results[$ind_order]['value'] .= ' ('.wmvc_show_data('user_email', $row).')'; | |
| 221 | 322 | } elseif($table == 'icons_list') { |
| 222 | 323 | $results[$ind_order]['key'] = $row; |
| 223 | 324 | if(defined('ELEMENTOR_ASSETS_URL')){ |
| 224 | 325 | $results[$ind_order]['value'] = '<i class="'. $row.'"></i> '.$row; |
| @@ -226,8 +327,10 @@ | ||
| 226 | 327 | $results[$ind_order]['value'] = $row; |
| 227 | 328 | } |
| 228 | 329 | } else { |
| 229 | 330 | $results[$ind_order]['value'] = $level_gen |
| 331 | + // Dynamic field values are registered in the translation catalog separately. | |
| 332 | + // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 230 | 333 | .esc_html__(wmvc_show_data($attr_val, $row), 'wpdirectorykit'); |
| 231 | 334 | } |
| 232 | 335 | $ind_order++; |
| 233 | 336 | } |
| @@ -253,11 +356,14 @@ | ||
| 253 | 356 | $level_gen = str_pad('', $row->level*12, ' ').''; |
| 254 | 357 | |
| 255 | 358 | if($table == 'user_m') { |
| 256 | 359 | $data['curr_val'] = $level_gen |
| 257 | - .wmvc_show_data(wmvc_show_data('attribute_value', $parameters), $row).' ('.wmvc_show_data('user_email', $row).')'.' #'.wmvc_show_data($attr_id, $row); | |
| 360 | + .wmvc_show_data('display_name', $row); | |
| 361 | + | |
| 258 | 362 | } else { |
| 259 | 363 | $data['curr_val'] = $level_gen |
| 364 | + // Dynamic field values are registered in the translation catalog separately. | |
| 365 | + // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 260 | 366 | .esc_html__(wmvc_show_data(wmvc_show_data('attribute_value', $parameters), $row), 'wpdirectorykit'); |
| 261 | 367 | } |
| 262 | 368 | |
| 263 | 369 | |
| @@ -271,14 +377,16 @@ | ||
| 271 | 377 | |
| 272 | 378 | $this->data['success'] = true; |
| 273 | 379 | |
| 274 | 380 | $data['results'] = $results; |
| 275 | - //$data['sql'] = $this->db->last_query(); | |
| 381 | + $data['sql'] = $this->db->last_query(); | |
| 276 | 382 | $this->output($data); |
| 277 | 383 | } |
| 278 | 384 | |
| 279 | 385 | public function treefieldid_checkboxes($output="", $atts=array(), $instance=NULL) |
| 280 | 386 | { |
| 387 | + check_ajax_referer('wdk_secure_treefieldid_checkboxes', 'wdk_secure'); | |
| 388 | + | |
| 281 | 389 | $this->load->load_helper('listing'); |
| 282 | 390 | $this->load->model('listing_m'); |
| 283 | 391 | $this->load->model('listingfield_m'); |
| 284 | 392 | |
| @@ -308,8 +416,14 @@ | ||
| 308 | 416 | |
| 309 | 417 | if(empty($parameters['offset'])) |
| 310 | 418 | $parameters['offset'] = 0; |
| 311 | 419 | |
| 420 | + if(empty($parameters['sql_where'])) | |
| 421 | + $parameters['sql_where'] = ''; | |
| 422 | + | |
| 423 | + if(empty($parameters['hide_fields'])) | |
| 424 | + $parameters['hide_fields'] = ''; | |
| 425 | + | |
| 312 | 426 | $start_id = ''; |
| 313 | 427 | if(isset($parameters['start_id'])) |
| 314 | 428 | $start_id = $parameters['start_id']; |
| 315 | 429 | |
| @@ -326,11 +440,12 @@ | ||
| 326 | 440 | if($table == 'calendar_listing_m') |
| 327 | 441 | $table = 'listing_m'; |
| 328 | 442 | |
| 329 | 443 | $table_name = substr($table,0, -2); |
| 330 | - $attr_id = sanitize_text_field($parameters['attribute_id']); | |
| 331 | - $attr_val = sanitize_text_field($parameters['attribute_value']); | |
| 332 | - $attr_search = sanitize_text_field($parameters['search_term']); | |
| 444 | + $attr_id = preg_replace("/[^0-9a-zA-Z_\-]/", "",sanitize_text_field($parameters['attribute_id'])); | |
| 445 | + $attr_val = preg_replace("/[^0-9a-zA-Z_\-]/", "",sanitize_text_field($parameters['attribute_value'])); | |
| 446 | + | |
| 447 | + $attr_search = wdk_esc_sql(sanitize_text_field($parameters['search_term'])); | |
| 333 | 448 | $skip_id = intval($parameters['skip_id']); |
| 334 | 449 | $language_id = intval($parameters['language_id']); |
| 335 | 450 | |
| 336 | 451 | if(empty($language_id)) |
| @@ -343,9 +458,23 @@ | ||
| 343 | 458 | $this->load->model($table); |
| 344 | 459 | |
| 345 | 460 | $where = array(); |
| 346 | 461 | if(!empty($attr_search)) |
| 347 | - $where["($id_part $attr_val LIKE '%$attr_search%')"] = NULL; | |
| 462 | + $attr_val_sql = $attr_val; | |
| 463 | + if($attr_val == 'location_title') { | |
| 464 | + $this->load->model($table); | |
| 465 | + $attr_val_sql = $this->$table->_table_name.'.location_title'; | |
| 466 | + } elseif($attr_val == 'category_title'){ | |
| 467 | + $this->load->model($table); | |
| 468 | + $attr_val_sql = $this->$table->_table_name.'.category_title'; | |
| 469 | + } | |
| 470 | + | |
| 471 | + /* if category/locations search also in translated field */ | |
| 472 | + if($attr_val == 'location_title' || $attr_val == 'category_title') { | |
| 473 | + $where["($id_part $attr_val_sql LIKE '%$attr_search%' OR ".$this->$table->_table_name.".titles_for_search LIKE '%$attr_search%')"] = NULL; | |
| 474 | + } else { | |
| 475 | + $where["($id_part $attr_val_sql LIKE '%$attr_search%')"] = NULL; | |
| 476 | + } | |
| 348 | 477 | |
| 349 | 478 | if(isset($parameters['selected']) && !empty($parameters['selected'])) { |
| 350 | 479 | |
| 351 | 480 | if(is_string($parameters['selected']) && strpos($parameters['selected'], ',') !== FALSE){ |
| @@ -370,10 +499,30 @@ | ||
| 370 | 499 | } |
| 371 | 500 | } |
| 372 | 501 | |
| 373 | 502 | if(!empty($parameters['filter_ids'])){ |
| 374 | - $this->db->where(array( esc_sql($this->$table->_primary_key).' IN ('.esc_sql($parameters['filter_ids']).')' => NULL)); | |
| 503 | + $this->db->where(array( esc_sql($this->$table->_table_name.'.'.$this->$table->_primary_key).' IN ('.esc_sql(preg_replace('/[^0-9,]/', '', $parameters['filter_ids'])).')' => NULL)); | |
| 375 | 504 | } |
| 505 | + | |
| 506 | + if(!empty($parameters['hide_fields'])) { | |
| 507 | + $parameters['hide_fields'] = preg_replace('/[^0-9,]/', '', $parameters['hide_fields']); | |
| 508 | + if($table == 'location_m') { | |
| 509 | + $sql_where = esc_sql($this->$table->_table_name.'.idlocation').' NOT IN ('.esc_sql(sanitize_text_field($parameters['hide_fields'])).')'; | |
| 510 | + foreach (explode(',', $parameters['hide_fields']) as $key => $id) { | |
| 511 | + $sql_where .= ' AND CONCAT(",", '.$this->$table->_table_name.'.parent_path, ",") NOT LIKE CONCAT("%,", '.intval($id).', ",%")'; | |
| 512 | + } | |
| 513 | + | |
| 514 | + $where[$sql_where] = NULL; | |
| 515 | + } | |
| 516 | + | |
| 517 | + if($table == 'category_m') { | |
| 518 | + $sql_where = esc_sql($this->$table->_table_name.'.idcategory').' NOT IN ('.esc_sql(sanitize_text_field($parameters['hide_fields'])).')'; | |
| 519 | + foreach (explode(',', $parameters['hide_fields']) as $key => $id) { | |
| 520 | + $sql_where .= ' AND CONCAT(",", '.$this->$table->_table_name.'.parent_path, ",") NOT LIKE CONCAT("%,", '.intval($id).', ",%")'; | |
| 521 | + } | |
| 522 | + $where[$sql_where] = NULL; | |
| 523 | + } | |
| 524 | + } | |
| 376 | 525 | |
| 377 | 526 | $tree_results = $this->$table->get_pagination(intval($parameters['limit']),intval($parameters['offset']), $where); |
| 378 | 527 | |
| 379 | 528 | $ind_order=1; |
| @@ -384,8 +533,10 @@ | ||
| 384 | 533 | $level_gen = str_pad('', $row->level*12, ' ').''; |
| 385 | 534 | |
| 386 | 535 | $results[$ind_order]['key'] = wmvc_show_data($attr_id, $row); |
| 387 | 536 | $results[$ind_order]['value'] = $level_gen |
| 537 | + // Dynamic field values are registered in the translation catalog separately. | |
| 538 | + // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 388 | 539 | .esc_html__(wmvc_show_data($attr_val, $row), 'wpdirectorykit'); |
| 389 | 540 | $ind_order++; |
| 390 | 541 | } |
| 391 | 542 | |
| @@ -398,10 +549,11 @@ | ||
| 398 | 549 | { |
| 399 | 550 | $level_gen=''; |
| 400 | 551 | if(isset($row->level)) |
| 401 | 552 | $level_gen = str_pad('', $row->level*12, ' ').''; |
| 402 | - | |
| 403 | - $data['curr_val'] = $level_gen | |
| 553 | + $data['curr_val'] = $level_gen | |
| 554 | + // Dynamic field values are registered in the translation catalog separately. | |
| 555 | + // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 404 | 556 | .esc_html__(wmvc_show_data(wmvc_show_data('attribute_value', $parameters), $row), 'wpdirectorykit'); |
| 405 | 557 | |
| 406 | 558 | } |
| 407 | 559 | else |
| @@ -428,11 +580,14 @@ | ||
| 428 | 580 | return $data; |
| 429 | 581 | } |
| 430 | 582 | } |
| 431 | 583 | |
| 432 | - | |
| 584 | + | |
| 433 | 585 | public function select_2_ajax($output="", $atts=array(), $instance=NULL) |
| 434 | 586 | { |
| 587 | + | |
| 588 | + check_ajax_referer('wdk_secure_ajax', 'wdk_secure'); | |
| 589 | + | |
| 435 | 590 | $this->load->load_helper('listing'); |
| 436 | 591 | $this->load->model('listing_m'); |
| 437 | 592 | $this->load->model('listingfield_m'); |
| 438 | 593 | |
| @@ -449,8 +604,14 @@ | ||
| 449 | 604 | if(empty($parameters['table'])) return false; |
| 450 | 605 | |
| 451 | 606 | $model_name = $parameters['table']; |
| 452 | 607 | |
| 608 | + // allow only 'listing_m', 'category_m', or 'location_m' for security | |
| 609 | + $allowed_models = array('listing_m', 'category_m', 'location_m'); | |
| 610 | + if (!in_array($model_name, $allowed_models)) { | |
| 611 | + return false; | |
| 612 | + } | |
| 613 | + | |
| 453 | 614 | $key_column = ''; |
| 454 | 615 | $print_column = ''; |
| 455 | 616 | |
| 456 | 617 | $search_column = ''; |
| @@ -456,12 +617,14 @@ | ||
| 456 | 617 | $search_column = ''; |
| 457 | 618 | if(empty($parameters['columns_search'])) { |
| 458 | 619 | switch ($model_name) { |
| 459 | 620 | case 'category_m': |
| 460 | - $search_column = 'idcategory,category_title'; | |
| 621 | + $this->load->model($model_name); | |
| 622 | + $search_column = $this->$model_name->_table_name.'.idcategory,'.$this->$model_name->_table_name.'.category_title, '.$this->$model_name->_table_name.'.titles_for_search'; | |
| 461 | 623 | break; |
| 462 | 624 | case 'location_m': |
| 463 | - $search_column = 'idlocation,location_title'; | |
| 625 | + $this->load->model($model_name); | |
| 626 | + $search_column = $this->$model_name->_table_name.'.idlocation,'.$this->$model_name->_table_name.'.location_title, '.$this->$model_name->_table_name.'.titles_for_search'; | |
| 464 | 627 | break; |
| 465 | 628 | |
| 466 | 629 | default: |
| 467 | 630 | # code... |
| @@ -466,10 +629,11 @@ | ||
| 466 | 629 | default: |
| 467 | 630 | # code... |
| 468 | 631 | break; |
| 469 | 632 | } |
| 633 | + | |
| 470 | 634 | } else { |
| 471 | - $search_column = $parameters['columns_search']; | |
| 635 | + $search_column = esc_sql(preg_replace('/[^a-z0-9_,]/i', '', $parameters['columns_search'])); | |
| 472 | 636 | } |
| 473 | 637 | |
| 474 | 638 | if(empty($parameters['key_column'])) { |
| 475 | 639 | switch ($model_name) { |
| @@ -533,9 +697,8 @@ | ||
| 533 | 697 | } |
| 534 | 698 | |
| 535 | 699 | $db_results_total = $this->$model_name->total($where); |
| 536 | 700 | $db_results = $this->$model_name->get_pagination($limit,$offset, $where); |
| 537 | - $data['output'] = $db_results; | |
| 538 | 701 | |
| 539 | 702 | if (!$db_results) { |
| 540 | 703 | $data['errors'] = ''; |
| 541 | 704 | } else { |
| @@ -546,8 +709,10 @@ | ||
| 546 | 709 | $level_gen = str_pad('', $row->level*12, ' ').''; |
| 547 | 710 | |
| 548 | 711 | $results[] = [ |
| 549 | 712 | 'id'=> wmvc_show_data($key_column, $row), |
| 713 | + // Dynamic field values are registered in the translation catalog separately. | |
| 714 | +// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 550 | 715 | 'text'=> $level_gen.esc_html__(trim(wmvc_show_data($print_column, $row)), 'wpdirectorykit'), |
| 551 | 716 | ]; |
| 552 | 717 | } |
| 553 | 718 | |
| @@ -597,9 +762,13 @@ | ||
| 597 | 762 | $offset = (intval($parameters['page_result']) - 1) * $limit; |
| 598 | 763 | } |
| 599 | 764 | |
| 600 | 765 | $this->load->model($model_name); |
| 601 | - $search_column = 'display_name,user_email,user_login,ID'; | |
| 766 | + $search_column = 'display_name,user_login,ID'; | |
| 767 | + if(current_user_can('administrator')) { | |
| 768 | + $search_column = 'display_name,user_email,user_login,ID'; | |
| 769 | + } | |
| 770 | + | |
| 602 | 771 | $where = array(); |
| 603 | 772 | if(!empty($_POST['q']['term']) && !empty($search_column)) { |
| 604 | 773 | $sql_search = ''; |
| 605 | 774 | foreach (explode(',', $search_column) as $column) { |
| @@ -617,9 +786,8 @@ | ||
| 617 | 786 | $like = "(meta_value LIKE '%wdk_%' )"; |
| 618 | 787 | $db_results_total = $this->$model_name->total($where, NULL, $like); |
| 619 | 788 | |
| 620 | 789 | $db_results = $this->$model_name->get_pagination($limit,$offset, $where, NULL, $like); |
| 621 | - $data['output'] = $db_results; | |
| 622 | 790 | |
| 623 | 791 | if (!$db_results) { |
| 624 | 792 | $data['errors'] = ''; |
| 625 | 793 | } else { |
| @@ -648,9 +816,8 @@ | ||
| 648 | 816 | |
| 649 | 817 | //$data['sql'] = $this->db->last_query(); |
| 650 | 818 | $this->output($data); |
| 651 | 819 | } |
| 652 | - | |
| 653 | 820 | |
| 654 | 821 | public function wdk_tree_dropdowns($output="", $atts=array(), $instance=NULL) |
| 655 | 822 | { |
| 656 | 823 | $this->load->load_helper('listing'); |
| @@ -770,8 +937,10 @@ | ||
| 770 | 937 | |
| 771 | 938 | foreach($db_results as $row) { |
| 772 | 939 | $results[] = [ |
| 773 | 940 | 'id'=> wmvc_show_data($key_column, $row), |
| 941 | + // Dynamic field values are registered in the translation catalog separately. | |
| 942 | +// phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 774 | 943 | 'text'=> esc_html__(trim(wmvc_show_data($print_column, $row)),'wpdirectorykit'), |
| 775 | 944 | ]; |
| 776 | 945 | } |
| 777 | 946 | |
| @@ -792,11 +961,11 @@ | ||
| 792 | 961 | $this->load->model('location_m'); |
| 793 | 962 | $this->load->model('listing_m'); |
| 794 | 963 | |
| 795 | 964 | $data = array(); |
| 796 | - $categories_limit = 10; | |
| 965 | + $categories_limit = 5; | |
| 797 | 966 | $categories_search_column = array('idcategory','category_title'); |
| 798 | - $locations_limit = 10; | |
| 967 | + $locations_limit = 5; | |
| 799 | 968 | $locations_search_column = array('idlocation','location_title'); |
| 800 | 969 | |
| 801 | 970 | $results = array(); |
| 802 | 971 | /* |
| @@ -839,9 +1008,9 @@ | ||
| 839 | 1008 | foreach ($categories_search_column as $column) { |
| 840 | 1009 | if(!empty($sql_search)) |
| 841 | 1010 | $sql_search .= " OR "; |
| 842 | 1011 | |
| 843 | - $sql_search .= " ".esc_sql($column)." LIKE '%".esc_sql($search_text)."%'"; | |
| 1012 | + $sql_search .= " ".$this->category_m->_table_name.'.'.esc_sql($column)." LIKE '%".esc_sql($search_text)."%'"; | |
| 844 | 1013 | } |
| 845 | 1014 | $where ["($sql_search)"] = NULL; |
| 846 | 1015 | $db_results = $this->category_m->get_pagination($categories_limit, NULL, $where); |
| 847 | 1016 | } else { |
| @@ -853,9 +1022,11 @@ | ||
| 853 | 1022 | 'field_key' => 'search_category', |
| 854 | 1023 | 'value' => $row->category_title, |
| 855 | 1024 | 'print' => [ |
| 856 | 1025 | 'parsed_content' => [ |
| 857 | - 'icon_class' => (!empty(wmvc_show_data('font_icon_code', $row, false))) ? wmvc_show_data('font_icon_code', $row) : 'fa fa-tag', | |
| 1026 | + 'icon_class' => (!empty(wmvc_show_data('font_icon_code', $row, false))) ? esc_attr(wmvc_show_data('font_icon_code', $row)): 'fa fa-tag', | |
| 1027 | + // Dynamic field values are registered in the translation catalog separately. | |
| 1028 | + // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 858 | 1029 | 'title' => esc_html__($row->category_title, 'wpdirectorykit'), |
| 859 | 1030 | 'sub_title' => '', |
| 860 | 1031 | 'right_text' => __('Category', 'wpdirectorykit') |
| 861 | 1032 | ] |
| @@ -906,10 +1077,14 @@ | ||
| 906 | 1077 | 'field_key' => 'search_location', |
| 907 | 1078 | 'value' => $row->location_title, |
| 908 | 1079 | 'print' => [ |
| 909 | 1080 | 'parsed_content' => [ |
| 910 | - 'icon_class' => (!empty(wmvc_show_data('font_icon_code', $row, false))) ? wmvc_show_data('font_icon_code', $row) : 'fa fa-map-marker', | |
| 1081 | + 'icon_class' => (!empty(wmvc_show_data('font_icon_code', $row, false))) ? esc_attr(wmvc_show_data('font_icon_code', $row)) : 'fa fa-map-marker', | |
| 1082 | + // Dynamic field values are registered in the translation catalog separately. | |
| 1083 | + // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 911 | 1084 | 'title' => esc_html__($row->location_title, 'wpdirectorykit'), |
| 1085 | + // Dynamic field values are registered in the translation catalog separately. | |
| 1086 | + // phpcs:ignore WordPress.WP.I18n.NonSingularStringLiteralText | |
| 912 | 1087 | 'sub_title' => esc_html__($subtitle, 'wpdirectorykit'), |
| 913 | 1088 | 'right_text' => __('Location', 'wpdirectorykit') |
| 914 | 1089 | ] |
| 915 | 1090 | ] |
| @@ -918,13 +1093,15 @@ | ||
| 918 | 1093 | |
| 919 | 1094 | /* END Locations */ |
| 920 | 1095 | |
| 921 | 1096 | /* address suggestion if empty other */ |
| 922 | - if(empty($results)) { | |
| 1097 | + $limit = apply_filters('wdk/search_suggestion/address_limit', 5); | |
| 1098 | + if(count($results)<10) { | |
| 923 | 1099 | $this->db->select('address'); |
| 924 | 1100 | $db_results = $this->db->where(array("address LIKE '%".esc_sql($search_text)."%'" => NULL)); |
| 925 | 1101 | $this->db->from($this->listing_m->_table_name); |
| 926 | 1102 | $this->db->group_by('address'); |
| 1103 | + $this->db->limit($limit); | |
| 927 | 1104 | |
| 928 | 1105 | $query = $this->db->get(); |
| 929 | 1106 | if ($this->db->num_rows() > 0) { |
| 930 | 1107 | $db_results = $this->db->results(); |
| @@ -946,11 +1123,35 @@ | ||
| 946 | 1123 | ] |
| 947 | 1124 | ]; |
| 948 | 1125 | } |
| 949 | 1126 | } |
| 1127 | + | |
| 1128 | + /* listings by title suggestion */ | |
| 1129 | + // Example of how to use add_filter for 'wdk/search_suggestion/listings_limit' | |
| 1130 | + // In your theme's functions.php or a custom plugin, you can add: | |
| 1131 | + // add_filter('wdk/search_suggestion/listings_limit', function($limit) { return 10; }); | |
| 950 | 1132 | |
| 951 | - if(empty($results)) { | |
| 1133 | + $limit = apply_filters('wdk/search_suggestion/listings_limit', 5); | |
| 1134 | + $this->db->where(array("post_title LIKE '%".esc_sql($search_text)."%'" => NULL)); | |
| 1135 | + $db_results = $this->listing_m->get_pagination($limit, NULL, array('is_activated' => 1,'is_approved'=>1)); | |
| 952 | 1136 | |
| 1137 | + if($db_results) foreach($db_results as $row) { | |
| 1138 | + $results[] = [ | |
| 1139 | + 'field_key' => 'link', | |
| 1140 | + 'value' => get_permalink($row), | |
| 1141 | + 'print' => [ | |
| 1142 | + 'parsed_content' => [ | |
| 1143 | + 'icon_class' => 'fa fa-circle', | |
| 1144 | + 'title' => $row->post_title, | |
| 1145 | + 'sub_title' => '', | |
| 1146 | + 'right_text' => __('Listing', 'wpdirectorykit') | |
| 1147 | + ] | |
| 1148 | + ] | |
| 1149 | + ]; | |
| 1150 | + } | |
| 1151 | + | |
| 1152 | + if(count($results)<10) { | |
| 1153 | + | |
| 953 | 1154 | $name_part = str_replace(' ','+',$search_text); |
| 954 | 1155 | |
| 955 | 1156 | //$url = 'http://photon.komoot.de/api/?q='.$name_part; |
| 956 | 1157 | $url = 'https://api.teleport.org/api/cities/?limit=1&search='.$name_part; |
| @@ -1023,21 +1224,28 @@ | ||
| 1023 | 1224 | |
| 1024 | 1225 | if(isset($parameters['post_id'])) { |
| 1025 | 1226 | $post_id = $parameters['post_id']; |
| 1026 | 1227 | } |
| 1228 | + | |
| 1229 | + $calendar = $Winter_MVC_wdk_bookings->calendar_m->get_by(array('post_id'=>$post_id), TRUE); | |
| 1230 | + $time_format = "00:00:00"; | |
| 1231 | + if($calendar && $calendar->is_hour_enabled == 1) | |
| 1232 | + $time_format = "H:i:s"; | |
| 1233 | + | |
| 1027 | 1234 | |
| 1028 | 1235 | if(isset($parameters['date_from'])) { |
| 1029 | - $date_from = wdk_normalize_date_db($parameters['date_from']); | |
| 1236 | + $date_from = wdk_normalize_date_db($parameters['date_from'], 'Y-m-d H:i:s', 'Y-m-d '.$time_format); | |
| 1030 | 1237 | } |
| 1031 | 1238 | |
| 1032 | 1239 | if(isset($parameters['date_to'])) { |
| 1033 | - $date_to = wdk_normalize_date_db($parameters['date_to']); | |
| 1240 | + $date_to = wdk_normalize_date_db($parameters['date_to'], 'Y-m-d H:i:s', 'Y-m-d '.$time_format); | |
| 1034 | 1241 | } |
| 1035 | 1242 | |
| 1243 | + | |
| 1036 | 1244 | if($post_id && $date_from && $date_to) { |
| 1037 | 1245 | $price = $Winter_MVC_wdk_bookings->reservation_m->calculate_price($post_id, $date_from, $date_to); |
| 1038 | 1246 | |
| 1039 | - $calendar = $Winter_MVC_wdk_bookings->calendar_m->get_by(array('post_id'=>$post_id), TRUE); // date_package_expire package_id | |
| 1247 | + | |
| 1040 | 1248 | $calendar_fees = array(); |
| 1041 | 1249 | if($calendar && !empty($calendar->json_data_fees)) |
| 1042 | 1250 | $calendar_fees = json_decode($calendar->json_data_fees ); |
| 1043 | 1251 | |
| @@ -1047,15 +1255,15 @@ | ||
| 1047 | 1255 | |
| 1048 | 1256 | if($price) { |
| 1049 | 1257 | $results['price'] = $price['price']; |
| 1050 | 1258 | $results['total'] = $price['price']; |
| 1259 | + $results['fees_data'] = array(); | |
| 1051 | 1260 | $results['fees'] = array(); |
| 1052 | - foreach ($calendar_fees as $fee) { | |
| 1261 | + foreach ($calendar_fees as $key => $fee) { | |
| 1053 | 1262 | if(!wmvc_show_data('is_activated', $fee, false,TRUE,TRUE)) continue; |
| 1054 | 1263 | if(is_intval(wmvc_show_data('value', $fee,'',TRUE,TRUE))) { |
| 1055 | - $field = str_replace(' ','_',strtolower(esc_html(wmvc_show_data('title', $fee,'-',TRUE,TRUE)))); | |
| 1264 | + $field = wdk_generate_slug(strtolower(esc_html(wmvc_show_data('title', $fee,'-',TRUE,TRUE)))); | |
| 1056 | 1265 | if(!wmvc_show_data('is_required', $fee, false,TRUE,TRUE) && isset($parameters['fee_'.$field]) && $parameters['fee_'.$field] == 0) { |
| 1057 | - | |
| 1058 | 1266 | } else { |
| 1059 | 1267 | $price = 0; |
| 1060 | 1268 | if(wmvc_show_data('calculation_base', $fee,'',TRUE,TRUE) == 'per_night') { |
| 1061 | 1269 | $nights = (int)abs(strtotime($date_from) - strtotime($date_to))/(60*60*24); |
| @@ -1068,8 +1276,12 @@ | ||
| 1068 | 1276 | $results['fees'][wmvc_show_data('title', $fee,'',TRUE,TRUE)] = $price; |
| 1069 | 1277 | $results['total'] += $price; |
| 1070 | 1278 | } |
| 1071 | 1279 | } |
| 1280 | + | |
| 1281 | + $results['fees_data'][$key] = $fee; | |
| 1282 | + $results['fees_data'][$key]->field_id = wdk_generate_slug(strtolower(esc_html(wmvc_show_data('title', $fee,'-',TRUE,TRUE)))); | |
| 1283 | + $results['fees_data'][$key]->calculation_base_text = (isset($Winter_MVC_wdk_bookings->calendar_m->calculation_base[wmvc_show_data('calculation_base', $fee,'-',TRUE,TRUE)])) ? $Winter_MVC_wdk_bookings->calendar_m->calculation_base[wmvc_show_data('calculation_base', $fee,'-',TRUE,TRUE)] : 'per stay'; | |
| 1072 | 1284 | } |
| 1073 | 1285 | $data['success'] = true; |
| 1074 | 1286 | } else { |
| 1075 | 1287 | $data['popup_text_error'] = __('Those dates are not available', 'wpdirectorykit'); |
| @@ -1074,9 +1286,8 @@ | ||
| 1074 | 1286 | } else { |
| 1075 | 1287 | $data['popup_text_error'] = __('Those dates are not available', 'wpdirectorykit'); |
| 1076 | 1288 | } |
| 1077 | 1289 | } |
| 1078 | - | |
| 1079 | 1290 | |
| 1080 | 1291 | $data['results'] = $results; |
| 1081 | 1292 | |
| 1082 | 1293 | //$data['sql'] = $this->db->last_query(); |
| @@ -1081,10 +1292,496 @@ | ||
| 1081 | 1292 | |
| 1082 | 1293 | //$data['sql'] = $this->db->last_query(); |
| 1083 | 1294 | $this->output($data); |
| 1084 | 1295 | } |
| 1296 | + | |
| 1297 | + public function loading_listings() { | |
| 1298 | + $this->load->load_helper('listing'); | |
| 1299 | + $this->load->load_helper('get_element_settings'); | |
| 1300 | + $this->load->model('listing_m'); | |
| 1301 | + $this->load->model('listingfield_m'); | |
| 1302 | + $this->load->model('category_m'); | |
| 1303 | + | |
| 1304 | + $data = array(); | |
| 1305 | + $data['message'] = ''; | |
| 1306 | + $data['popup_text_success'] = ''; | |
| 1307 | + $data['popup_text_error'] = ''; | |
| 1308 | + $data['output'] = [ | |
| 1309 | + 'map_results'=>null, | |
| 1310 | + 'listings_result'=>null, | |
| 1311 | + 'listings_result_message'=>null, | |
| 1312 | + 'pagination_html'=>null, | |
| 1313 | + 'listings_count'=>null, | |
| 1314 | + 'listings_count_html'=>null, | |
| 1315 | + ]; | |
| 1316 | + $data['success'] = false; | |
| 1317 | + | |
| 1318 | + $parameters = array(); | |
| 1319 | + foreach ($_POST as $key => $value) { | |
| 1320 | + $parameters[$key] = sanitize_text_field($value); | |
| 1321 | + } | |
| 1322 | + | |
| 1323 | + $options = [ | |
| 1324 | + 'offset' => 0, | |
| 1325 | + 'limit' => 6, | |
| 1326 | + 'current_page' => 1, | |
| 1327 | + 'limit_pagination' => 5, | |
| 1328 | + 'layout_type' => 'grid', | |
| 1329 | + ]; | |
| 1330 | + | |
| 1331 | + $custom_parameters = array(); | |
| 1332 | + $parameters['url'] = strstr($parameters['url'], "#", true); | |
| 1333 | + $parameters['url'] = strstr($parameters['url'], "?"); | |
| 1334 | + if(!empty($parameters['url'])) { | |
| 1335 | + $qr_string = trim($parameters['url'],'?'); | |
| 1336 | + $string_par = array(); | |
| 1337 | + parse_str($qr_string, $string_par); | |
| 1338 | + $custom_parameters += $string_par; | |
| 1339 | + } | |
| 1340 | + | |
| 1341 | + $controller = 'listing'; | |
| 1342 | + $columns = array('ID', 'location_id', 'category_id', 'post_title', 'post_date', 'search', 'order_by','is_featured', 'address'); | |
| 1343 | + $external_columns = array('location_id', 'category_id', 'post_title'); | |
| 1344 | + | |
| 1345 | + if(isset($parameters['el_results_id'])) { | |
| 1346 | + wdk_prepare_search_query_GET($columns, $controller.'_m', $external_columns, $custom_parameters); | |
| 1347 | + $data['output']['listings_count'] = $this->listing_m->total(array('is_activated' => 1,'is_approved'=>1)); | |
| 1348 | + $data['output']['listings_count_html'] = $data['output']['listings_count'].' '.esc_html__('Listings', 'wpdirectorykit'); | |
| 1349 | + | |
| 1350 | + if(defined( 'WP_DEBUG' ) && WP_DEBUG) | |
| 1351 | + $data['listings_count_sql'] = $this->db->last_query(); | |
| 1352 | + | |
| 1353 | + if(isset($custom_parameters['wmvc_paged'])) | |
| 1354 | + $options['current_page'] = intval(wmvc_xss_clean($custom_parameters['wmvc_paged'])); | |
| 1355 | + | |
| 1356 | + $get_settings_el_results = new WdkGetElementSettings($parameters['el_results_page_id'],$parameters['el_results_id'],$parameters['el_results_type']); | |
| 1357 | + $settings_el_results = $get_settings_el_results->get_settings(); | |
| 1358 | + $settings_el_results = $settings_el_results['settings'] ?? []; | |
| 1359 | + | |
| 1360 | + if(wmvc_show_data('per_page', $settings_el_results, false)) { | |
| 1361 | + $options['limit'] = wmvc_show_data('per_page', $settings_el_results, false); | |
| 1362 | + } | |
| 1363 | + | |
| 1364 | + if(wmvc_show_data('layout_type', $settings_el_results, false)) { | |
| 1365 | + $options['layout_type'] = wmvc_show_data('layout_type', $settings_el_results, false); | |
| 1366 | + } | |
| 1367 | + | |
| 1368 | + $offset = $options['limit']*( $options['current_page']-1); | |
| 1369 | + | |
| 1370 | + global $_GET; | |
| 1371 | + $temp_get = $_GET; | |
| 1372 | + $_GET = $custom_parameters; | |
| 1373 | + do_action('wpdirectorykit/ajax/loading_listings'); | |
| 1374 | + $REQUEST_URI = $_SERVER["REQUEST_URI"]; | |
| 1375 | + | |
| 1376 | + $_SERVER["REQUEST_URI"] = $_SERVER['HTTP_REFERER']; | |
| 1377 | + | |
| 1378 | + $data['output']['pagination_html'] = wdk_wp_frontend_paginate($data['output']['listings_count'], $options['limit'], 'wmvc_paged', array(), TRUE, | |
| 1379 | + FALSE, FALSE, $options['limit_pagination']); | |
| 1380 | + | |
| 1381 | + $_SERVER["REQUEST_URI"] = $REQUEST_URI; | |
| 1382 | + $_GET = $temp_get; | |
| 1383 | + | |
| 1384 | + wdk_prepare_search_query_GET($columns, $controller.'_m', $external_columns, $custom_parameters); | |
| 1385 | + $listings_result = $this->listing_m->get_pagination($options['limit'], $offset, array('is_activated' => 1,'is_approved'=>1)); | |
| 1386 | + | |
| 1387 | + if(defined( 'WP_DEBUG' ) && WP_DEBUG) | |
| 1388 | + $data['listings_result_sql'] = $this->db->last_query(); | |
| 1389 | + | |
| 1390 | + if(wmvc_show_data('layout_type', $settings_el_results, false)) { | |
| 1391 | + $settings_el_results['content_button_icon'] = $get_settings_el_results->generate_icon(wmvc_show_data('layout_type', $settings_el_results, false)); | |
| 1392 | + } else { | |
| 1393 | + $settings_el_results['content_button_icon'] = ''; | |
| 1394 | + } | |
| 1395 | + | |
| 1396 | + if($listings_result) { | |
| 1397 | + foreach ($listings_result as $key => $listing) { | |
| 1398 | + $listing->card_view = ''; | |
| 1399 | + | |
| 1400 | + if ( | |
| 1401 | + wdk_get_option('wdk_experimental_features') && wdk_get_option('wdk_experimental_listing_card_elementor_layout') && | |
| 1402 | + wmvc_show_data('is_custom_layout_enable', $settings_el_results) == 'yes' | |
| 1403 | + ) { | |
| 1404 | + if ($options['layout_type'] == 'list' && wmvc_show_data('custom_layout_id_list', $settings_el_results, false)) { | |
| 1405 | + $content = ''; | |
| 1406 | + $post_data = get_post(wmvc_show_data('custom_layout_id_list', $settings_el_results, false)); | |
| 1407 | + | |
| 1408 | + global $wdk_listing_id; | |
| 1409 | + $wdk_listing_id = wmvc_show_data('post_id', $listing); | |
| 1410 | + if ($post_data) { | |
| 1411 | + if ($post_data->post_type == 'page' || $post_data->post_type == 'elementor_library') { | |
| 1412 | + $elementor_instance = \Elementor\Plugin::instance(); | |
| 1413 | + $content = $elementor_instance->frontend->get_builder_content_for_display(wmvc_show_data('custom_layout_id_list', $settings_el_results, false)); | |
| 1414 | + if (empty($content)) | |
| 1415 | + $content = $post_data->post_content; | |
| 1416 | + } else { | |
| 1417 | + $content = $post_data->post_content; | |
| 1418 | + } | |
| 1419 | + } | |
| 1420 | + $listing->card_view = ($content); | |
| 1421 | + } elseif ($options['layout_type'] == 'grid' && wmvc_show_data('custom_layout_id_grid', $settings_el_results, false)) { | |
| 1422 | + $content = ''; | |
| 1423 | + $post_data = get_post( wmvc_show_data('custom_layout_id_grid', $settings_el_results, false)); | |
| 1424 | + | |
| 1425 | + global $wdk_listing_id; | |
| 1426 | + $wdk_listing_id = wmvc_show_data('post_id', $listing); | |
| 1427 | + if ($post_data) { | |
| 1428 | + if ($post_data->post_type == 'page' || $post_data->post_type == 'elementor_library') { | |
| 1429 | + $elementor_instance = \Elementor\Plugin::instance(); | |
| 1430 | + $content = $elementor_instance->frontend->get_builder_content_for_display(wmvc_show_data('custom_layout_id_grid', $settings_el_results, false)); | |
| 1431 | + if (empty($content)) | |
| 1432 | + $content = $post_data->post_content; | |
| 1433 | + } else { | |
| 1434 | + $content = $post_data->post_content; | |
| 1435 | + } | |
| 1436 | + } | |
| 1437 | + $listing->card_view = ($content); | |
| 1438 | + } else { | |
| 1439 | + $listing->card_view = wdk_listing_card($listing, $settings_el_results); | |
| 1440 | + } | |
| 1441 | + } else { | |
| 1442 | + $listing->card_view = wdk_listing_card($listing, $settings_el_results); | |
| 1443 | + } | |
| 1444 | + | |
| 1445 | + $data['output']['listings_result'][] = $listing; | |
| 1446 | + } | |
| 1447 | + } else { | |
| 1448 | + $data['output']['listings_result_message'] = '<p class="wdk_alert wdk_alert-danger">'.esc_html__('Results not found', 'wpdirectorykit').'</p>'; | |
| 1449 | + } | |
| 1450 | + | |
| 1451 | + } | |
| 1452 | + | |
| 1453 | + /* map results */ | |
| 1454 | + if(isset($parameters['el_map_id'])) { | |
| 1455 | + wdk_prepare_search_query_GET($columns, $controller.'_m', $external_columns, $custom_parameters); | |
| 1456 | + $map_results = $this->listing_m->get_pagination(NULL, NULL, array('is_activated' => 1,'is_approved'=>1)); | |
| 1457 | + if(defined( 'WP_DEBUG' ) && WP_DEBUG) | |
| 1458 | + $data['map_results_sql'] = $this->db->last_query(); | |
| 1459 | + | |
| 1460 | + $get_settings_el_map = new WdkGetElementSettings($parameters['el_map_page_id'],$parameters['el_map_id'],$parameters['el_map_type']); | |
| 1461 | + $settings_el_map = $get_settings_el_map->get_settings(); | |
| 1462 | + $settings_el_map = $settings_el_map['settings']; | |
| 1463 | + | |
| 1464 | + foreach ($map_results as $key => $listing) { | |
| 1465 | + $listing->inner_marker = ''; | |
| 1466 | + | |
| 1467 | + $pin_icon = ""; | |
| 1468 | + $font_class = ""; | |
| 1469 | + $font_icon = (wmvc_show_data('conf_custom_map_pin_icon', $settings_el_map)) ? esc_url($get_settings_el_map->generate_icon($settings_el_map['conf_custom_map_pin_icon'])) : '<i class="fa fa-home"></i>'; | |
| 1470 | + $pin_icon = (isset( $settings_el_map['conf_custom_map_pin'])) ? esc_url($settings_el_map['conf_custom_map_pin']['url']) : ''; | |
| 1471 | + | |
| 1472 | + if(wmvc_show_data('conf_hide_real_location', $category) == 'yes') { | |
| 1473 | + $listing->listing_lat = wdk_move_gps($listing->listing_lat); | |
| 1474 | + $listing->listing_lng = wdk_move_gps($listing->listing_lng); | |
| 1475 | + } | |
| 1476 | + | |
| 1477 | + if(!empty(wmvc_show_data('category_id', $listing))){ | |
| 1478 | + $category = $this->category_m->get_data(wmvc_show_data('category_id', $listing)); | |
| 1479 | + if(wmvc_show_data('marker_image_id', $category, false, TRUE, TRUE)){ | |
| 1480 | + $pin_icon = wdk_image_src($category, 'full', NULL,'marker_image_id'); | |
| 1481 | + } else if(!empty(wmvc_show_data('font_icon_code', $category))) { | |
| 1482 | + $font_class = wmvc_show_data('font_icon_code', $category); | |
| 1483 | + } | |
| 1484 | + } else { | |
| 1485 | + $font_class = ""; | |
| 1486 | + } | |
| 1487 | + | |
| 1488 | + if($pin_icon){ | |
| 1489 | + $listing->inner_marker = '<div class="wdk_marker-container wdk_marker-container-image"><img src='.$pin_icon.'></img></div>'; | |
| 1490 | + }elseif($font_icon && empty($font_class)){ | |
| 1491 | + $listing->inner_marker = '<div class="wdk_marker-container category_id_'.esc_js(wmvc_show_data('category_id', $listing)).'"><div class="front wdk_face">'.$font_icon.'</div><div class="wdk_marker-card"><div class="wdk_marker-arrow"></div></div></div>'; | |
| 1492 | + }else{ | |
| 1493 | + $listing->inner_marker = '<div class="wdk_marker-container category_id_'.esc_js(wmvc_show_data('category_id', $listing)).'"><div class="front wdk_face"><i class="'.esc_html($font_class).'"></i></div><div class="wdk_marker-card"><div class="wdk_marker-arrow"></div></div></div>'; | |
| 1494 | + } | |
| 1495 | + | |
| 1496 | + $data['output']['map_results'][] = $listing; | |
| 1497 | + } | |
| 1498 | + } | |
| 1499 | + | |
| 1500 | + $data['success'] = true; | |
| 1501 | + $this->output($data); | |
| 1502 | + | |
| 1503 | + } | |
| 1504 | + | |
| 1085 | 1505 | |
| 1506 | + public function suggestion_locations (&$output=NULL, $atts=array()) | |
| 1507 | + { | |
| 1508 | + | |
| 1509 | + $this->load->load_helper('listing'); | |
| 1510 | + $this->load->model('category_m'); | |
| 1511 | + $this->load->model('location_m'); | |
| 1512 | + $this->load->model('listing_m'); | |
| 1513 | + | |
| 1514 | + $data = array(); | |
| 1515 | + $data['message'] = __('No message returned!', 'wpdirectorykit'); | |
| 1516 | + | |
| 1517 | + $data['results'] = array(); | |
| 1518 | + $parameters = array(); | |
| 1519 | + foreach ($_POST as $key => $value) { | |
| 1520 | + $parameters[$key] = sanitize_text_field($value); | |
| 1521 | + } | |
| 1522 | + | |
| 1523 | + $search_text = ''; | |
| 1524 | + if(!empty($parameters['search'])) | |
| 1525 | + $search_text = trim($parameters['search']); | |
| 1526 | + | |
| 1527 | + if(!empty($search_text)) { | |
| 1528 | + $this->db->select("location_title as value"); | |
| 1529 | + $this->db->from($this->location_m->_table_name); | |
| 1530 | + $this->db->where(array("location_title LIKE '%".esc_sql($search_text)."%'" => NULL)); | |
| 1531 | + | |
| 1532 | + $query = $this->db->get(); | |
| 1533 | + if($this->db->num_rows() > 0) foreach($this->db->results() as $row) { | |
| 1534 | + $data['results'][] = $row->value; | |
| 1535 | + } | |
| 1536 | + } | |
| 1537 | + | |
| 1538 | + $data['success'] = true; | |
| 1539 | + $this->output($data); | |
| 1540 | + } | |
| 1541 | + | |
| 1542 | + public function suggestion_categories (&$output=NULL, $atts=array()) | |
| 1543 | + { | |
| 1544 | + | |
| 1545 | + $this->load->load_helper('listing'); | |
| 1546 | + $this->load->model('category_m'); | |
| 1547 | + | |
| 1548 | + $data = array(); | |
| 1549 | + $data['message'] = __('No message returned!', 'wpdirectorykit'); | |
| 1550 | + | |
| 1551 | + $data['results'] = array(); | |
| 1552 | + $parameters = array(); | |
| 1553 | + foreach ($_POST as $key => $value) { | |
| 1554 | + $parameters[$key] = sanitize_text_field($value); | |
| 1555 | + } | |
| 1556 | + | |
| 1557 | + $search_text = ''; | |
| 1558 | + if(!empty($parameters['search'])) | |
| 1559 | + $search_text = trim($parameters['search']); | |
| 1560 | + | |
| 1561 | + if(!empty($search_text)) { | |
| 1562 | + $this->db->select("category_title as value"); | |
| 1563 | + $this->db->from($this->category_m->_table_name); | |
| 1564 | + $this->db->where(array("category_title LIKE '%".esc_sql($search_text)."%'" => NULL)); | |
| 1565 | + | |
| 1566 | + $query = $this->db->get(); | |
| 1567 | + if($this->db->num_rows() > 0) foreach($this->db->results() as $row) { | |
| 1568 | + $data['results'][] = $row->value; | |
| 1569 | + } | |
| 1570 | + } | |
| 1571 | + | |
| 1572 | + $data['success'] = true; | |
| 1573 | + $this->output($data); | |
| 1574 | + } | |
| 1575 | + | |
| 1576 | + public function suggestion_db_field (&$output=NULL, $atts=array()) | |
| 1577 | + { | |
| 1578 | + $this->load->load_helper('listing'); | |
| 1579 | + $this->load->model('category_m'); | |
| 1580 | + $this->load->model('location_m'); | |
| 1581 | + $this->load->model('listing_m'); | |
| 1582 | + | |
| 1583 | + $data = array(); | |
| 1584 | + $data['message'] = __('No message returned!', 'wpdirectorykit'); | |
| 1585 | + | |
| 1586 | + $data['results'] = array(); | |
| 1587 | + $parameters = array(); | |
| 1588 | + foreach ($_POST as $key => $value) { | |
| 1589 | + $parameters[$key] = sanitize_text_field($value); | |
| 1590 | + } | |
| 1591 | + | |
| 1592 | + $search_text = ''; | |
| 1593 | + if(!empty($parameters['search'])) | |
| 1594 | + $search_text = trim($parameters['search']); | |
| 1595 | + | |
| 1596 | + $search_field_id = ''; | |
| 1597 | + if(!empty($parameters['field_id'])) | |
| 1598 | + $search_field_id = (int) trim($parameters['field_id']); | |
| 1599 | + | |
| 1600 | + if(!empty($search_field_id) && wdk_field_option($search_field_id, 'field_type', false)) { | |
| 1601 | + | |
| 1602 | + /* listings by title suggestion */ | |
| 1603 | + $this->db->select("DISTINCT field_".$search_field_id."_".wdk_field_option($search_field_id, 'field_type', false)." as value"); | |
| 1604 | + $this->db->from($this->db->prefix.'wdk_listings_fields'); | |
| 1605 | + $this->db->where(array("field_".$search_field_id."_".wdk_field_option($search_field_id, 'field_type', false)." LIKE '%".esc_sql($search_text)."%'" => NULL)); | |
| 1606 | + | |
| 1607 | + $query = $this->db->get(); | |
| 1608 | + if($this->db->num_rows() > 0) foreach($this->db->results() as $row) { | |
| 1609 | + $data['results'][] = $row->value; | |
| 1610 | + } | |
| 1611 | + | |
| 1612 | + $field_values = wdk_field_option($search_field_id, 'values', ''); | |
| 1613 | + $field_values = explode(',', $field_values); | |
| 1614 | + if(!empty($field_values)) { | |
| 1615 | + foreach($field_values as $value) { | |
| 1616 | + if(empty($value)) continue; | |
| 1617 | + $data['results'][] = $value; | |
| 1618 | + } | |
| 1619 | + } | |
| 1620 | + | |
| 1621 | + } | |
| 1622 | + | |
| 1623 | + $data['success'] = true; | |
| 1624 | + $this->output($data); | |
| 1625 | + | |
| 1626 | + } | |
| 1627 | + | |
| 1628 | + function select_2_ajax_field_db_suggestion($output="", $atts=array(), $instance=NULL) | |
| 1629 | + { | |
| 1630 | + global $Winter_MVC_WDK; | |
| 1631 | + $Winter_MVC_WDK->load_helper('listing'); | |
| 1632 | + $Winter_MVC_WDK->model('location_m'); | |
| 1633 | + | |
| 1634 | + $data = array(); | |
| 1635 | + $data['message'] = __('No message returned!', 'wpdirectorykit'); | |
| 1636 | + $data['pagination'] = true; | |
| 1637 | + $results = array(); | |
| 1638 | + | |
| 1639 | + $parameters = array(); | |
| 1640 | + foreach ($_POST as $key => $value) { | |
| 1641 | + $parameters[$key] = sanitize_text_field($value); | |
| 1642 | + } | |
| 1643 | + | |
| 1644 | + $limit = 10; | |
| 1645 | + if(!empty($parameters['limit'])) { | |
| 1646 | + $limit = intval($parameters['limit']); | |
| 1647 | + } | |
| 1648 | + | |
| 1649 | + $offset = 0; | |
| 1650 | + if(!empty($parameters['page_result']) && $parameters['page_result'] > 1) { | |
| 1651 | + $offset = (intval($parameters['page_result']) - 1) * $limit; | |
| 1652 | + } | |
| 1653 | + | |
| 1654 | + $search_text = ''; | |
| 1655 | + if(!empty($_POST['q']['term'])) | |
| 1656 | + $search_text = sanitize_text_field($_POST['q']['term']); | |
| 1657 | + | |
| 1658 | + $search_field_id = ''; | |
| 1659 | + if(!empty($parameters['field_id'])) | |
| 1660 | + $search_field_id = (int) trim($parameters['field_id']); | |
| 1661 | + | |
| 1662 | + if(!empty($search_field_id) && wdk_field_option($search_field_id, 'field_type', false)) { | |
| 1663 | + | |
| 1664 | + /* listings by title suggestion */ | |
| 1665 | + $Winter_MVC_WDK->db->select("DISTINCT field_".$search_field_id."_".wdk_field_option($search_field_id, 'field_type', false)." as value"); | |
| 1666 | + $Winter_MVC_WDK->db->from($Winter_MVC_WDK->db->prefix.'wdk_listings_fields'); | |
| 1667 | + $Winter_MVC_WDK->db->where(array("field_".$search_field_id."_".wdk_field_option($search_field_id, 'field_type', false)." LIKE '%".esc_sql($search_text)."%'" => NULL)); | |
| 1668 | + | |
| 1669 | + $query = $Winter_MVC_WDK->db->get(); | |
| 1670 | + if($Winter_MVC_WDK->db->num_rows() > 0) foreach($Winter_MVC_WDK->db->results() as $row) { | |
| 1671 | + | |
| 1672 | + $results[] = [ | |
| 1673 | + 'id'=> $row->value, | |
| 1674 | + 'text'=> $row->value, | |
| 1675 | + ]; | |
| 1676 | + } | |
| 1677 | + | |
| 1678 | + $field_values = wdk_field_option($search_field_id, 'values', ''); | |
| 1679 | + $field_values = explode(',', $field_values); | |
| 1680 | + if(!empty($field_values)) { | |
| 1681 | + foreach($field_values as $value) { | |
| 1682 | + if(empty($value)) continue; | |
| 1683 | + | |
| 1684 | + $results[] = [ | |
| 1685 | + 'id'=> $value, | |
| 1686 | + 'text'=> $value, | |
| 1687 | + ]; | |
| 1688 | + } | |
| 1689 | + } | |
| 1690 | + | |
| 1691 | + } | |
| 1692 | + | |
| 1693 | + $data['success'] = true; | |
| 1694 | + | |
| 1695 | + $data['results'] = array_slice($results, $offset, $limit); | |
| 1696 | + if(count($results) >= $limit + $offset) { | |
| 1697 | + $data['pagination'] =[ | |
| 1698 | + "more"=> true | |
| 1699 | + ]; | |
| 1700 | + } | |
| 1701 | + | |
| 1702 | + $data['success'] = true; | |
| 1703 | + $this->output($data); | |
| 1704 | + } | |
| 1705 | + | |
| 1086 | 1706 | private function get_fa_icons() { |
| 1707 | + | |
| 1708 | + /* icons font Awesome 5 */ | |
| 1709 | + | |
| 1710 | + return array("fab fa-500px","fab fa-accessible-icon","fab fa-accusoft","fas fa-address-book","far fa-address-book","fas fa-address-card","far fa-address-card","fas fa-adjust","fab fa-adn","fab fa-adversal","fab fa-affiliatetheme","fab fa-algolia", | |
| 1711 | + "fas fa-align-center","fas fa-align-justify","fas fa-align-left","fas fa-align-right","fab fa-amazon","fas fa-ambulance","fas fa-american-sign-language-interpreting","fab fa-amilia","fas fa-anchor","fab fa-android","fab fa-angellist", | |
| 1712 | + "fas fa-angle-double-down","fas fa-angle-double-left","fas fa-angle-double-right","fas fa-angle-double-up","fas fa-angle-down","fas fa-angle-left","fas fa-angle-right","fas fa-angle-up","fab fa-angrycreative","fab fa-angular","fab fa-app-store", | |
| 1713 | + "fab fa-app-store-ios","fab fa-apper","fab fa-apple","fab fa-apple-pay","fas fa-archive","fas fa-arrow-alt-circle-down","far fa-arrow-alt-circle-down","fas fa-arrow-alt-circle-left","far fa-arrow-alt-circle-left","fas fa-arrow-alt-circle-right", | |
| 1714 | + "far fa-arrow-alt-circle-right","fas fa-arrow-alt-circle-up","far fa-arrow-alt-circle-up","fas fa-arrow-circle-down","fas fa-arrow-circle-left","fas fa-arrow-circle-right","fas fa-arrow-circle-up","fas fa-arrow-down","fas fa-arrow-left", | |
| 1715 | + "fas fa-arrow-right","fas fa-arrow-up","fas fa-arrows-alt","fas fa-arrows-alt-h","fas fa-arrows-alt-v","fas fa-assistive-listening-systems","fas fa-asterisk","fab fa-asymmetrik","fas fa-at","fab fa-audible","fas fa-audio-description", | |
| 1716 | + "fab fa-autoprefixer","fab fa-avianex","fab fa-aviato","fab fa-aws","fas fa-backward","fas fa-balance-scale","fas fa-ban","fab fa-bandcamp","fas fa-barcode","fas fa-bars","fas fa-bath","fas fa-battery-empty","fas fa-battery-full", | |
| 1717 | + "fas fa-battery-half","fas fa-battery-quarter","fas fa-battery-three-quarters","fas fa-bed","fas fa-beer","fab fa-behance","fab fa-behance-square","fas fa-bell","far fa-bell","fas fa-bell-slash","far fa-bell-slash","fas fa-bicycle","fab fa-bimobject", | |
| 1718 | + "fas fa-binoculars","fas fa-birthday-cake","fab fa-bitbucket","fab fa-bitcoin","fab fa-bity","fab fa-black-tie","fab fa-blackberry","fas fa-blind","fab fa-blogger","fab fa-blogger-b","fab fa-bluetooth","fab fa-bluetooth-b","fas fa-bold","fas fa-bolt", | |
| 1719 | + "fas fa-bomb","fas fa-book","fas fa-bookmark","far fa-bookmark","fas fa-braille","fas fa-briefcase","fab fa-btc","fas fa-bug","fas fa-building","far fa-building","fas fa-bullhorn","fas fa-bullseye","fab fa-buromobelexperte","fas fa-bus","fab fa-buysellads", | |
| 1720 | + "fas fa-calculator","fas fa-calendar","far fa-calendar","fas fa-calendar-alt","far fa-calendar-alt","fas fa-calendar-check","far fa-calendar-check","fas fa-calendar-minus","far fa-calendar-minus","fas fa-calendar-plus","far fa-calendar-plus","fas fa-calendar-times", | |
| 1721 | + "far fa-calendar-times","fas fa-camera","fas fa-camera-retro","fas fa-car","fas fa-caret-down","fas fa-caret-left","fas fa-caret-right","fas fa-caret-square-down","far fa-caret-square-down","fas fa-caret-square-left","far fa-caret-square-left","fas fa-caret-square-right", | |
| 1722 | + "far fa-caret-square-right","fas fa-caret-square-up","far fa-caret-square-up","fas fa-caret-up","fas fa-cart-arrow-down","fas fa-cart-plus","fab fa-cc-amex","fab fa-cc-apple-pay","fab fa-cc-diners-club","fab fa-cc-discover","fab fa-cc-jcb","fab fa-cc-mastercard", | |
| 1723 | + "fab fa-cc-paypal","fab fa-cc-stripe","fab fa-cc-visa","fab fa-centercode","fas fa-certificate","fas fa-chart-area","fas fa-chart-bar","far fa-chart-bar","fas fa-chart-line","fas fa-chart-pie","fas fa-check","fas fa-check-circle","far fa-check-circle", | |
| 1724 | + "fas fa-check-square","far fa-check-square","fas fa-chevron-circle-down","fas fa-chevron-circle-left","fas fa-chevron-circle-right","fas fa-chevron-circle-up","fas fa-chevron-down","fas fa-chevron-left","fas fa-chevron-right","fas fa-chevron-up", | |
| 1725 | + "fas fa-child","fab fa-chrome","fas fa-circle","far fa-circle","fas fa-circle-notch","fas fa-clipboard","far fa-clipboard","fas fa-clock","far fa-clock","fas fa-clone","far fa-clone","fas fa-closed-captioning","far fa-closed-captioning", | |
| 1726 | + "fas fa-cloud","fas fa-cloud-download-alt","fas fa-cloud-upload-alt","fab fa-cloudscale","fab fa-cloudsmith","fab fa-cloudversify","fas fa-code","fas fa-code-branch","fab fa-codepen","fab fa-codiepie","fas fa-coffee","fas fa-cog", | |
| 1727 | + "fas fa-cogs","fas fa-columns","fas fa-comment","far fa-comment","fas fa-comment-alt","far fa-comment-alt","fas fa-comments","far fa-comments","fas fa-compass","far fa-compass","fas fa-compress","fab fa-connectdevelop","fab fa-contao", | |
| 1728 | + "fas fa-copy","far fa-copy","fas fa-copyright","far fa-copyright","fab fa-cpanel","fab fa-creative-commons","fas fa-credit-card","far fa-credit-card","fas fa-crop","fas fa-crosshairs","fab fa-css3","fab fa-css3-alt","fas fa-cube","fas fa-cubes", | |
| 1729 | + "fas fa-cut","fab fa-cuttlefish","fab fa-d-and-d","fab fa-dashcube","fas fa-database","fas fa-deaf","fab fa-delicious","fab fa-deploydog","fab fa-deskpro","fas fa-desktop","fab fa-deviantart","fab fa-digg","fab fa-digital-ocean", | |
| 1730 | + "fab fa-discord","fab fa-discourse","fab fa-dochub","fab fa-docker","fas fa-dollar-sign","fas fa-dot-circle","far fa-dot-circle","fas fa-download","fab fa-draft2digital","fab fa-dribbble","fab fa-dribbble-square","fab fa-dropbox","fab fa-drupal", | |
| 1731 | + "fab fa-dyalog","fab fa-earlybirds","fab fa-edge","fas fa-edit","far fa-edit","fas fa-eject","fas fa-ellipsis-h","fas fa-ellipsis-v","fab fa-ember","fab fa-empire","fas fa-envelope","far fa-envelope","fas fa-envelope-open","far fa-envelope-open", | |
| 1732 | + "fas fa-envelope-square","fab fa-envira","fas fa-eraser","fab fa-erlang","fab fa-etsy","fas fa-euro-sign","fas fa-exchange-alt","fas fa-exclamation","fas fa-exclamation-circle","fas fa-exclamation-triangle","fas fa-expand","fas fa-expand-arrows-alt", | |
| 1733 | + "fab fa-expeditedssl","fas fa-external-link-alt","fas fa-external-link-square-alt","fas fa-eye","fas fa-eye-dropper","fas fa-eye-slash","far fa-eye-slash","fab fa-facebook","fab fa-facebook-f","fab fa-facebook-messenger","fab fa-facebook-square", | |
| 1734 | + "fas fa-fast-backward","fas fa-fast-forward","fas fa-fax","fas fa-female","fas fa-fighter-jet","fas fa-file","far fa-file","fas fa-file-alt","far fa-file-alt","fas fa-file-archive","far fa-file-archive","fas fa-file-audio","far fa-file-audio", | |
| 1735 | + "fas fa-file-code","far fa-file-code","fas fa-file-excel","far fa-file-excel","fas fa-file-image","far fa-file-image","fas fa-file-pdf","far fa-file-pdf","fas fa-file-powerpoint","far fa-file-powerpoint","fas fa-file-video","far fa-file-video", | |
| 1736 | + "fas fa-file-word","far fa-file-word","fas fa-film","fas fa-filter","fas fa-fire","fas fa-fire-extinguisher","fab fa-firefox","fab fa-first-order","fab fa-firstdraft","fas fa-flag","far fa-flag","fas fa-flag-checkered","fas fa-flask","fab fa-flickr", | |
| 1737 | + "fab fa-fly","fas fa-folder","far fa-folder","fas fa-folder-open","far fa-folder-open","fas fa-font","fab fa-font-awesome","fab fa-font-awesome-alt","fab fa-font-awesome-flag","fab fa-fonticons","fab fa-fonticons-fi","fab fa-fort-awesome", | |
| 1738 | + "fab fa-fort-awesome-alt","fab fa-forumbee","fas fa-forward","fab fa-foursquare","fab fa-free-code-camp","fab fa-freebsd","fas fa-frown","far fa-frown","fas fa-futbol","far fa-futbol","fas fa-gamepad","fas fa-gavel","fas fa-gem","far fa-gem", | |
| 1739 | + "fas fa-genderless","fab fa-get-pocket","fab fa-gg","fab fa-gg-circle","fas fa-gift","fab fa-git","fab fa-git-square","fab fa-github","fab fa-github-alt","fab fa-github-square","fab fa-gitkraken","fab fa-gitlab","fab fa-gitter", | |
| 1740 | + "fas fa-glass-martini","fab fa-glide","fab fa-glide-g","fas fa-globe","fab fa-gofore","fab fa-goodreads","fab fa-goodreads-g","fab fa-google","fab fa-google-drive","fab fa-google-play","fab fa-google-plus","fab fa-google-plus-g", | |
| 1741 | + "fab fa-google-plus-square","fab fa-google-wallet","fas fa-graduation-cap","fab fa-gratipay","fab fa-grav","fab fa-gripfire","fab fa-grunt","fab fa-gulp","fas fa-h-square","fab fa-hacker-news","fab fa-hacker-news-square","fas fa-hand-lizard", | |
| 1742 | + "far fa-hand-lizard","fas fa-hand-paper","far fa-hand-paper","fas fa-hand-peace","far fa-hand-peace","fas fa-hand-point-down","far fa-hand-point-down","fas fa-hand-point-left","far fa-hand-point-left","fas fa-hand-point-right","far fa-hand-point-right","fas fa-hand-point-up", | |
| 1743 | + "far fa-hand-point-up","fas fa-hand-pointer","far fa-hand-pointer","fas fa-hand-rock","far fa-hand-rock","fas fa-hand-scissors","far fa-hand-scissors","fas fa-hand-spock","far fa-hand-spock","fas fa-handshake","far fa-handshake","fas fa-hashtag","fas fa-hdd", | |
| 1744 | + "far fa-hdd","fas fa-heading","fas fa-headphones","fas fa-heart","far fa-heart","fas fa-heartbeat","fab fa-hire-a-helper","fas fa-history","fas fa-home","fab fa-hooli","fas fa-hospital","far fa-hospital","fab fa-hotjar","fas fa-hourglass","far fa-hourglass", | |
| 1745 | + "fas fa-hourglass-end","fas fa-hourglass-half","fas fa-hourglass-start","fab fa-houzz","fab fa-html5","fab fa-hubspot","fas fa-i-cursor","fas fa-id-badge","far fa-id-badge","fas fa-id-card","far fa-id-card","fas fa-image","far fa-image","fas fa-images", | |
| 1746 | + "far fa-images","fab fa-imdb","fas fa-inbox","fas fa-indent","fas fa-industry","fas fa-info","fas fa-info-circle","fab fa-instagram","fab fa-internet-explorer","fab fa-ioxhost","fas fa-italic","fab fa-itunes","fab fa-itunes-note","fab fa-jenkins", | |
| 1747 | + "fab fa-joget","fab fa-joomla","fab fa-js","fab fa-js-square","fab fa-jsfiddle","fas fa-key","fas fa-keyboard","far fa-keyboard","fab fa-keycdn","fab fa-kickstarter","fab fa-kickstarter-k","fas fa-language","fas fa-laptop","fab fa-laravel", | |
| 1748 | + "fab fa-lastfm","fab fa-lastfm-square","fas fa-leaf","fab fa-leanpub","fas fa-lemon","far fa-lemon","fab fa-less","fas fa-level-down-alt","fas fa-level-up-alt","fas fa-life-ring","far fa-life-ring","fas fa-lightbulb","far fa-lightbulb", | |
| 1749 | + "fab fa-line","fas fa-link","fab fa-linkedin","fab fa-linkedin-in","fab fa-linode","fab fa-linux","fas fa-lira-sign","fas fa-list","fas fa-list-alt","far fa-list-alt","fas fa-list-ol","fas fa-list-ul","fas fa-location-arrow", | |
| 1750 | + "fas fa-lock","fas fa-lock-open","fas fa-long-arrow-alt-down","fas fa-long-arrow-alt-left","fas fa-long-arrow-alt-right","fas fa-long-arrow-alt-up","fas fa-low-vision","fab fa-lyft","fab fa-magento","fas fa-magic","fas fa-magnet", | |
| 1751 | + "fas fa-male","fas fa-map","far fa-map","fas fa-map-marker","fas fa-map-marker-alt","fas fa-map-pin","fas fa-map-signs","fas fa-mars","fas fa-mars-double","fas fa-mars-stroke","fas fa-mars-stroke-h","fas fa-mars-stroke-v","fab fa-maxcdn", | |
| 1752 | + "fab fa-medapps","fab fa-medium","fab fa-medium-m","fas fa-medkit","fab fa-medrt","fab fa-meetup","fas fa-meh","far fa-meh","fas fa-mercury","fas fa-microchip","fas fa-microphone","fas fa-microphone-slash","fab fa-microsoft","fas fa-minus", | |
| 1753 | + "fas fa-minus-circle","fas fa-minus-square","far fa-minus-square","fab fa-mix","fab fa-mixcloud","fab fa-mizuni","fas fa-mobile","fas fa-mobile-alt","fab fa-modx","fab fa-monero","fas fa-money-bill-alt","far fa-money-bill-alt", | |
| 1754 | + "fas fa-moon","far fa-moon","fas fa-motorcycle","fas fa-mouse-pointer","fas fa-music","fab fa-napster","fas fa-neuter","fas fa-newspaper","far fa-newspaper","fab fa-nintendo-switch","fab fa-node","fab fa-node-js","fab fa-npm","fab fa-ns8", | |
| 1755 | + "fab fa-nutritionix","fas fa-object-group","far fa-object-group","fas fa-object-ungroup","far fa-object-ungroup","fab fa-odnoklassniki","fab fa-odnoklassniki-square","fab fa-opencart","fab fa-openid","fab fa-opera","fab fa-optin-monster","fab fa-osi", | |
| 1756 | + "fas fa-outdent","fab fa-page4","fab fa-pagelines","fas fa-paint-brush","fab fa-palfed","fas fa-paper-plane","far fa-paper-plane","fas fa-paperclip","fas fa-paragraph","fas fa-paste","fab fa-patreon","fas fa-pause","fas fa-pause-circle", | |
| 1757 | + "far fa-pause-circle","fas fa-paw","fab fa-paypal","fas fa-pen-square","fas fa-pencil-alt","fas fa-percent","fab fa-periscope","fab fa-phabricator","fab fa-phoenix-framework","fas fa-phone","fas fa-phone-square","fas fa-phone-volume", | |
| 1758 | + "fab fa-pied-piper","fab fa-pied-piper-alt","fab fa-pied-piper-pp","fab fa-pinterest","fab fa-pinterest-p","fab fa-pinterest-square","fas fa-plane","fas fa-play","fas fa-play-circle","far fa-play-circle","fab fa-playstation","fas fa-plug","fas fa-plus", | |
| 1759 | + "fas fa-plus-circle","fas fa-plus-square","far fa-plus-square","fas fa-podcast","fas fa-pound-sign","fas fa-power-off","fas fa-print","fab fa-product-hunt","fab fa-pushed","fas fa-puzzle-piece","fab fa-python","fab fa-qq","fas fa-qrcode","fas fa-question", | |
| 1760 | + "fas fa-question-circle","far fa-question-circle","fab fa-quora","fas fa-quote-left","fas fa-quote-right","fas fa-random","fab fa-ravelry","fab fa-react","fab fa-rebel","fas fa-recycle","fab fa-red-river","fab fa-reddit","fab fa-reddit-alien", | |
| 1761 | + "fab fa-reddit-square","fas fa-redo","fas fa-redo-alt","fas fa-registered","far fa-registered","fab fa-rendact","fab fa-renren","fas fa-reply","fas fa-reply-all","fab fa-replyd","fab fa-resolving","fas fa-retweet","fas fa-road","fas fa-rocket","fab fa-rocketchat", | |
| 1762 | + "fab fa-rockrms","fas fa-rss","fas fa-rss-square","fas fa-ruble-sign","fas fa-rupee-sign","fab fa-safari","fab fa-sass","fas fa-save","far fa-save","fab fa-schlix","fab fa-scribd","fas fa-search","fas fa-search-minus","fas fa-search-plus", | |
| 1763 | + "fab fa-searchengin","fab fa-sellcast","fab fa-sellsy","fas fa-server","fab fa-servicestack","fas fa-share","fas fa-share-alt","fas fa-share-alt-square","fas fa-share-square","far fa-share-square","fas fa-shekel-sign","fas fa-shield-alt", | |
| 1764 | + "fas fa-ship","fab fa-shirtsinbulk","fas fa-shopping-bag","fas fa-shopping-basket","fas fa-shopping-cart","fas fa-shower","fas fa-sign-in-alt","fas fa-sign-language","fas fa-sign-out-alt","fas fa-signal","fab fa-simplybuilt","fab fa-sistrix", | |
| 1765 | + "fas fa-sitemap","fab fa-skyatlas","fab fa-skype","fab fa-slack","fab fa-slack-hash","fas fa-sliders-h","fab fa-slideshare","fas fa-smile","far fa-smile","fab fa-snapchat","fab fa-snapchat-ghost","fab fa-snapchat-square","fas fa-snowflake", | |
| 1766 | + "far fa-snowflake","fas fa-sort","fas fa-sort-alpha-down","fas fa-sort-alpha-up","fas fa-sort-amount-down","fas fa-sort-amount-up","fas fa-sort-down","fas fa-sort-numeric-down","fas fa-sort-numeric-up","fas fa-sort-up","fab fa-soundcloud", | |
| 1767 | + "fas fa-space-shuttle","fab fa-speakap","fas fa-spinner","fab fa-spotify","fas fa-square","far fa-square","fab fa-stack-exchange","fab fa-stack-overflow","fas fa-star","far fa-star","fas fa-star-half","far fa-star-half","fab fa-staylinked", | |
| 1768 | + "fab fa-steam","fab fa-steam-square","fab fa-steam-symbol","fas fa-step-backward","fas fa-step-forward","fas fa-stethoscope","fab fa-sticker-mule","fas fa-sticky-note","far fa-sticky-note","fas fa-stop","fas fa-stop-circle","far fa-stop-circle", | |
| 1769 | + "fab fa-strava","fas fa-street-view","fas fa-strikethrough","fab fa-stripe","fab fa-stripe-s","fab fa-studiovinari","fab fa-stumbleupon","fab fa-stumbleupon-circle","fas fa-subscript","fas fa-subway","fas fa-suitcase","fas fa-sun","far fa-sun", | |
| 1770 | + "fab fa-superpowers","fas fa-superscript","fab fa-supple","fas fa-sync","fas fa-sync-alt","fas fa-table","fas fa-tablet","fas fa-tablet-alt","fas fa-tachometer-alt","fas fa-tag","fas fa-tags","fas fa-tasks","fas fa-taxi","fab fa-telegram", | |
| 1771 | + "fab fa-telegram-plane","fab fa-tencent-weibo","fas fa-terminal","fas fa-text-height","fas fa-text-width","fas fa-th","fas fa-th-large","fas fa-th-list","fab fa-themeisle","fas fa-thermometer-empty","fas fa-thermometer-full","fas fa-thermometer-half", | |
| 1772 | + "fas fa-thermometer-quarter","fas fa-thermometer-three-quarters","fas fa-thumbs-down","far fa-thumbs-down","fas fa-thumbs-up","far fa-thumbs-up","fas fa-thumbtack","fas fa-ticket-alt","fas fa-times","fas fa-times-circle","far fa-times-circle", | |
| 1773 | + "fas fa-tint","fas fa-toggle-off","fas fa-toggle-on","fas fa-trademark","fas fa-train","fas fa-transgender","fas fa-transgender-alt","fas fa-trash","fas fa-trash-alt","far fa-trash-alt","fas fa-tree","fab fa-trello","fab fa-tripadvisor", | |
| 1774 | + "fas fa-trophy","fas fa-truck","fas fa-tty","fab fa-tumblr","fab fa-tumblr-square","fas fa-tv","fab fa-twitch","fab fa-twitter","fab fa-twitter-square","fab fa-typo3","fab fa-uber","fab fa-uikit","fas fa-umbrella","fas fa-underline", | |
| 1775 | + "fas fa-undo","fas fa-undo-alt","fab fa-uniregistry","fas fa-universal-access","fas fa-university","fas fa-unlink","fas fa-unlock","fas fa-unlock-alt","fab fa-untappd","fas fa-upload","fab fa-usb","fas fa-user","far fa-user", | |
| 1776 | + "fas fa-user-circle","far fa-user-circle","fas fa-user-md","fas fa-user-plus","fas fa-user-secret","fas fa-user-times","fas fa-users","fab fa-ussunnah","fas fa-utensil-spoon","fas fa-utensils","fab fa-vaadin","fas fa-venus", | |
| 1777 | + "fas fa-venus-double","fas fa-venus-mars","fab fa-viacoin","fab fa-viadeo","fab fa-viadeo-square","fab fa-viber","fas fa-video","fab fa-vimeo","fab fa-vimeo-square","fab fa-vimeo-v","fab fa-vine","fab fa-vk","fab fa-vnv", | |
| 1778 | + "fas fa-volume-down","fas fa-volume-off","fas fa-volume-up","fab fa-vuejs","fab fa-weibo","fab fa-weixin","fab fa-whatsapp","fab fa-whatsapp-square","fas fa-wheelchair","fab fa-whmcs","fas fa-wifi","fab fa-wikipedia-w","fas fa-window-close", | |
| 1779 | + "far fa-window-close","fas fa-window-maximize","far fa-window-maximize","fas fa-window-minimize","fas fa-window-restore","far fa-window-restore","fab fa-windows","fas fa-won-sign","fab fa-wordpress","fab fa-wordpress-simple", | |
| 1780 | + "fab fa-wpbeginner","fab fa-wpexplorer","fab fa-wpforms","fas fa-wrench","fab fa-xbox","fab fa-xing","fab fa-xing-square","fab fa-y-combinator","fab fa-yahoo","fab fa-yandex","fab fa-yandex-international","fab fa-yelp","fas fa-yen-sign","fab fa-yoast","fab fa-youtube","fas fa-school"); | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + /* icons font Awesome 4 */ | |
| 1087 | 1784 | return array("fa fa-500px","fa fa-address-book","fa fa-address-book-o","fa fa-address-card","fa fa-address-card-o","fa fa-adjust","fa fa-adn","fa fa-align-center","fa fa-align-justify","fa fa-align-left","fa fa-align-right", |
| 1088 | 1785 | "fa fa-amazon","fa fa-ambulance","fa fa-american-sign-language-interpreting","fa fa-anchor","fa fa-android","fa fa-angellist","fa fa-angle-double-down","fa fa-angle-double-left","fa fa-angle-double-right","fa fa-angle-double-up", |
| 1089 | 1786 | "fa fa-angle-down","fa fa-angle-left","fa fa-angle-right","fa fa-angle-up","fa fa-apple","fa fa-archive","fa fa-area-chart","fa fa-arrow-circle-down","fa fa-arrow-circle-left","fa fa-arrow-circle-o-down","fa fa-arrow-circle-o-left", |
| 1090 | 1787 | "fa fa-arrow-circle-o-right","fa fa-arrow-circle-o-up","fa fa-arrow-circle-right","fa fa-arrow-circle-up","fa fa-arrow-down","fa fa-arrow-left","fa fa-arrow-right","fa fa-arrow-up","fa fa-arrows","fa fa-arrows-alt","fa fa-arrows-h", |
| @@ -1130,13 +1827,14 @@ | ||
| 1130 | 1827 | "fa fa-stop-circle-o","fa fa-street-view","fa fa-strikethrough","fa fa-stumbleupon","fa fa-stumbleupon-circle","fa fa-subscript","fa fa-subway","fa fa-suitcase","fa fa-sun-o","fa fa-superpowers","fa fa-superscript","fa fa-table", |
| 1131 | 1828 | "fa fa-tablet","fa fa-tachometer","fa fa-tag","fa fa-tags","fa fa-tasks","fa fa-taxi","fa fa-telegram","fa fa-television","fa fa-tencent-weibo","fa fa-terminal","fa fa-text-height","fa fa-text-width","fa fa-th","fa fa-th-large","fa fa-th-list", |
| 1132 | 1829 | "fa fa-themeisle","fa fa-thermometer-empty","fa fa-thermometer-full","fa fa-thermometer-half","fa fa-thermometer-quarter","fa fa-thermometer-three-quarters","fa fa-thumb-tack","fa fa-thumbs-down","fa fa-thumbs-o-down", |
| 1133 | 1830 | "fa fa-thumbs-o-up","fa fa-thumbs-up","fa fa-ticket","fa fa-times","fa fa-times-circle","fa fa-times-circle-o","fa fa-tint","fa fa-toggle-off","fa fa-toggle-on","fa fa-trademark","fa fa-train","fa fa-transgender","fa fa-transgender-alt", |
| 1134 | - "fa fa-trash","fa fa-trash-o","fa fa-tree","fa fa-trello","fa fa-tripadvisor","fa fa-trophy","fa fa-truck","fa fa-try","fa fa-tty","fa fa-tumblr","fa fa-tumblr-square","fa fa-twitch","fa fa-twitter","fa fa-twitter-square","fa fa-umbrella", | |
| 1831 | + "fa fa-trash","fa fa-trash-o","fa fa-tree","fa fa-trello","fa fa-tripadvisor","fa fa-trophy","fa fa-truck","fa fa-try","fa fa-tty","fa fa-tumblr","fa fa-tumblr-square","fa fa-twitch","fab fa-x-twitter","fab fa-x-twitter-square","fa fa-umbrella", | |
| 1135 | 1832 | "fa fa-underline","fa fa-undo","fa fa-universal-access","fa fa-university","fa fa-unlock","fa fa-unlock-alt","fa fa-upload","fa fa-usb","fa fa-usd","fa fa-user","fa fa-user-circle","fa fa-user-circle-o","fa fa-user-md","fa fa-user-o", |
| 1136 | 1833 | "fa fa-user-plus","fa fa-user-secret","fa fa-user-times","fa fa-users","fa fa-venus","fa fa-venus-double","fa fa-venus-mars","fa fa-viacoin","fa fa-viadeo","fa fa-viadeo-square","fa fa-video-camera","fa fa-vimeo","fa fa-vimeo-square","fa fa-vine", |
| 1137 | 1834 | "fa fa-vk","fa fa-volume-control-phone","fa fa-volume-down","fa fa-volume-off","fa fa-volume-up","fa fa-weibo","fa fa-weixin","fa fa-whatsapp","fa fa-wheelchair","fa fa-wheelchair-alt","fa fa-wifi","fa fa-wikipedia-w","fa fa-window-close", |
| 1138 | 1835 | "fa fa-window-close-o","fa fa-window-maximize","fa fa-window-minimize","fa fa-window-restore","fa fa-windows","fa fa-wordpress","fa fa-wpbeginner","fa fa-wpexplorer","fa fa-wpforms","fa fa-wrench","fa fa-xing","fa fa-xing-square", |
| 1139 | - "fa fa-y-combinator","fa fa-yahoo","fa fa-yelp","fa fa-yoast","fa fa-youtube","fa fa-youtube-play","fa fa-youtube-square"); | |
| 1140 | - } | |
| 1836 | + "fa fa-y-combinator","fa fa-yahoo","fa fa-yelp","fa fa-yoast","fa fa-youtube","fa fa-youtube-play","fa fa-youtube-square","fa-solid fa-school"); | |
| 1837 | + } | |
| 1141 | 1838 | |
| 1142 | 1839 | } |
| 1840 | + | |