@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | //save the widget |
| 62 | 62 | $instance = $old_instance; |
| 63 | 63 | $instance['title'] = strip_tags($new_instance['title']); |
| 64 | - $category_limit = (int)$new_instance['category_limit']; |
|
| 64 | + $category_limit = (int) $new_instance['category_limit']; |
|
| 65 | 65 | $instance['category_limit'] = $category_limit > 0 ? $category_limit : 15; |
| 66 | 66 | $instance['default_post_type'] = isset($new_instance['default_post_type']) ? $new_instance['default_post_type'] : ''; |
| 67 | 67 | $instance['parent_only'] = !empty($new_instance['parent_only']) ? true : false; |
@@ -81,13 +81,13 @@ discard block |
||
| 81 | 81 | public function form($instance) |
| 82 | 82 | {
|
| 83 | 83 | //widgetform in backend |
| 84 | - $instance = wp_parse_args((array)$instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => '', 'parent_only' => false));
|
|
| 84 | + $instance = wp_parse_args((array) $instance, array('title' => '', 'category_limit' => 15, 'default_post_type' => '', 'parent_only' => false));
|
|
| 85 | 85 | |
| 86 | 86 | $title = strip_tags($instance['title']); |
| 87 | - $category_limit = (int)$instance['category_limit']; |
|
| 87 | + $category_limit = (int) $instance['category_limit']; |
|
| 88 | 88 | $category_limit = $category_limit > 0 ? $category_limit : 15; |
| 89 | 89 | $default_post_type = isset($instance['default_post_type']) ? $instance['default_post_type'] : ''; |
| 90 | - $parent_only = !empty($instance['parent_only']) ? true: false; |
|
| 90 | + $parent_only = !empty($instance['parent_only']) ? true : false; |
|
| 91 | 91 | |
| 92 | 92 | $post_type_options = geodir_get_posttypes('options');
|
| 93 | 93 | ?> |
@@ -97,23 +97,23 @@ discard block |
||
| 97 | 97 | </label> |
| 98 | 98 | </p> |
| 99 | 99 | <p> |
| 100 | - <label for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Default post type to use (if not set by page)', 'geodirectory');?>
|
|
| 100 | + <label for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Default post type to use (if not set by page)', 'geodirectory'); ?>
|
|
| 101 | 101 | <select class="widefat" id="<?php echo $this->get_field_id('default_post_type'); ?>" name="<?php echo $this->get_field_name('default_post_type'); ?>">
|
| 102 | 102 | <?php foreach ($post_type_options as $name => $title) { ?>
|
| 103 | - <option value="<?php echo $name;?>" <?php selected($name, $default_post_type);?>><?php echo $title; ?></option> |
|
| 103 | + <option value="<?php echo $name; ?>" <?php selected($name, $default_post_type); ?>><?php echo $title; ?></option> |
|
| 104 | 104 | <?php } ?> |
| 105 | 105 | </select> |
| 106 | 106 | </label> |
| 107 | 107 | </p> |
| 108 | 108 | <p> |
| 109 | 109 | <label for="<?php echo $this->get_field_id('category_limit'); ?>"><?php _e('Customize categories count to appear by default:', 'geodirectory'); ?>
|
| 110 | - <input class="widefat" id="<?php echo $this->get_field_id('category_limit'); ?>" name="<?php echo $this->get_field_name('category_limit'); ?>" type="text" value="<?php echo (int)esc_attr($category_limit); ?>"/>
|
|
| 110 | + <input class="widefat" id="<?php echo $this->get_field_id('category_limit'); ?>" name="<?php echo $this->get_field_name('category_limit'); ?>" type="text" value="<?php echo (int) esc_attr($category_limit); ?>"/>
|
|
| 111 | 111 | <p class="description" style="padding:0"><?php _e('After categories count reaches this limit option More Categories / Less Categoris will be displayed to show/hide categories. Default: 15', 'geodirectory'); ?></p>
|
| 112 | 112 | </label> |
| 113 | 113 | </p> |
| 114 | 114 | <p> |
| 115 | - <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('parent_only'); ?>" name="<?php echo $this->get_field_name('parent_only'); ?>"<?php checked( $parent_only ); ?> value="1" />
|
|
| 116 | - <label for="<?php echo $this->get_field_id('parent_only'); ?>"><?php _e( 'Show parent categories only', 'geodirectory' ); ?></label>
|
|
| 115 | + <input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('parent_only'); ?>" name="<?php echo $this->get_field_name('parent_only'); ?>"<?php checked($parent_only); ?> value="1" />
|
|
| 116 | + <label for="<?php echo $this->get_field_id('parent_only'); ?>"><?php _e('Show parent categories only', 'geodirectory'); ?></label>
|
|
| 117 | 117 | </p> |
| 118 | 118 | <?php |
| 119 | 119 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | public function form($instance) |
| 217 | 217 | {
|
| 218 | 218 | //widgetform in backend |
| 219 | - $instance = wp_parse_args((array)$instance, |
|
| 219 | + $instance = wp_parse_args((array) $instance, |
|
| 220 | 220 | array('title' => '',
|
| 221 | 221 | 'post_type' => '', |
| 222 | 222 | 'category' => array(), |
@@ -268,9 +268,9 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | ?> |
| 270 | 270 | <p> |
| 271 | - <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory');?>
|
|
| 271 | + <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:', 'geodirectory'); ?>
|
|
| 272 | 272 | <small>(%posttype_singular_label% , |
| 273 | - %posttype_plural_label% <?php _e('can be used', 'geodirectory');?>)
|
|
| 273 | + %posttype_plural_label% <?php _e('can be used', 'geodirectory'); ?>)
|
|
| 274 | 274 | </small> |
| 275 | 275 | |
| 276 | 276 | <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>"
|
@@ -281,7 +281,7 @@ discard block |
||
| 281 | 281 | |
| 282 | 282 | <p> |
| 283 | 283 | <label |
| 284 | - for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory');?>
|
|
| 284 | + for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Post Type:', 'geodirectory'); ?>
|
|
| 285 | 285 | |
| 286 | 286 | <?php $postypes = geodir_get_posttypes(); |
| 287 | 287 | /** |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | |
| 314 | 314 | <p id="post_type_cats"> |
| 315 | 315 | <label |
| 316 | - for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Post Category:', 'geodirectory');?>
|
|
| 316 | + for="<?php echo $this->get_field_id('category'); ?>"><?php _e('Post Category:', 'geodirectory'); ?>
|
|
| 317 | 317 | |
| 318 | 318 | <?php |
| 319 | 319 | |
@@ -352,13 +352,13 @@ discard block |
||
| 352 | 352 | |
| 353 | 353 | <input type="hidden" name="<?php echo $this->get_field_name('category_title'); ?>"
|
| 354 | 354 | id="<?php echo $this->get_field_id('category_title'); ?>"
|
| 355 | - value="<?php if ($category_title != '') echo $category_title; else echo __('All', 'geodirectory');?>"/>
|
|
| 355 | + value="<?php if ($category_title != '') echo $category_title; else echo __('All', 'geodirectory'); ?>"/>
|
|
| 356 | 356 | |
| 357 | 357 | </label> |
| 358 | 358 | </p> |
| 359 | 359 | |
| 360 | 360 | <p> |
| 361 | - <label for="<?php echo $this->get_field_id('list_sort'); ?>"><?php _e('Sort by:', 'geodirectory');?>
|
|
| 361 | + <label for="<?php echo $this->get_field_id('list_sort'); ?>"><?php _e('Sort by:', 'geodirectory'); ?>
|
|
| 362 | 362 | |
| 363 | 363 | <?php |
| 364 | 364 | $list_sort_arr = array( |
@@ -377,14 +377,14 @@ discard block |
||
| 377 | 377 | * @param array $list_sort_arr The array of key value pairs of settings. |
| 378 | 378 | * @param array $instance The array of widget settings. |
| 379 | 379 | */ |
| 380 | - $list_sort_arr = apply_filters('geodir_popular_post_view_list_sort',$list_sort_arr,$instance);
|
|
| 380 | + $list_sort_arr = apply_filters('geodir_popular_post_view_list_sort', $list_sort_arr, $instance);
|
|
| 381 | 381 | ?> |
| 382 | 382 | |
| 383 | 383 | <select class="widefat" id="<?php echo $this->get_field_id('list_sort'); ?>"
|
| 384 | 384 | name="<?php echo $this->get_field_name('list_sort'); ?>">
|
| 385 | 385 | <?php |
| 386 | - foreach($list_sort_arr as $sort_val => $sort_title){
|
|
| 387 | - echo "<option value='$sort_val' ".selected($list_sort,$sort_val)." >$sort_title</option>"; |
|
| 386 | + foreach ($list_sort_arr as $sort_val => $sort_title) {
|
|
| 387 | + echo "<option value='$sort_val' ".selected($list_sort, $sort_val)." >$sort_title</option>"; |
|
| 388 | 388 | } |
| 389 | 389 | ?> |
| 390 | 390 | </select> |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | <p> |
| 395 | 395 | |
| 396 | 396 | <label |
| 397 | - for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts:', 'geodirectory');?>
|
|
| 397 | + for="<?php echo $this->get_field_id('post_number'); ?>"><?php _e('Number of posts:', 'geodirectory'); ?>
|
|
| 398 | 398 | |
| 399 | 399 | <input class="widefat" id="<?php echo $this->get_field_id('post_number'); ?>"
|
| 400 | 400 | name="<?php echo $this->get_field_name('post_number'); ?>" type="text"
|
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | |
| 405 | 405 | <p> |
| 406 | 406 | <label for="<?php echo $this->get_field_id('layout'); ?>">
|
| 407 | - <?php _e('Layout:', 'geodirectory');?>
|
|
| 407 | + <?php _e('Layout:', 'geodirectory'); ?>
|
|
| 408 | 408 | <select class="widefat" id="<?php echo $this->get_field_id('layout'); ?>"
|
| 409 | 409 | name="<?php echo $this->get_field_name('layout'); ?>">
|
| 410 | 410 | <option <?php if ($layout == 'gridview_onehalf') {
|
@@ -433,7 +433,7 @@ discard block |
||
| 433 | 433 | |
| 434 | 434 | <p> |
| 435 | 435 | <label |
| 436 | - for="<?php echo $this->get_field_id('listing_width'); ?>"><?php _e('Listing width:', 'geodirectory');?>
|
|
| 436 | + for="<?php echo $this->get_field_id('listing_width'); ?>"><?php _e('Listing width:', 'geodirectory'); ?>
|
|
| 437 | 437 | |
| 438 | 438 | <input class="widefat" id="<?php echo $this->get_field_id('listing_width'); ?>"
|
| 439 | 439 | name="<?php echo $this->get_field_name('listing_width'); ?>" type="text"
|
@@ -443,7 +443,7 @@ discard block |
||
| 443 | 443 | |
| 444 | 444 | <p> |
| 445 | 445 | <label |
| 446 | - for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory');?>
|
|
| 446 | + for="<?php echo $this->get_field_id('character_count'); ?>"><?php _e('Post Content excerpt character count :', 'geodirectory'); ?>
|
|
| 447 | 447 | <input class="widefat" id="<?php echo $this->get_field_id('character_count'); ?>"
|
| 448 | 448 | name="<?php echo $this->get_field_name('character_count'); ?>" type="text"
|
| 449 | 449 | value="<?php echo esc_attr($character_count); ?>"/> |
@@ -452,41 +452,41 @@ discard block |
||
| 452 | 452 | |
| 453 | 453 | <p> |
| 454 | 454 | <label for="<?php echo $this->get_field_id('add_location_filter'); ?>">
|
| 455 | - <?php _e('Enable Location Filter:', 'geodirectory');?>
|
|
| 455 | + <?php _e('Enable Location Filter:', 'geodirectory'); ?>
|
|
| 456 | 456 | <input type="checkbox" id="<?php echo $this->get_field_id('add_location_filter'); ?>"
|
| 457 | - name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"';?>
|
|
| 457 | + name="<?php echo $this->get_field_name('add_location_filter'); ?>" <?php if ($add_location_filter) echo 'checked="checked"'; ?>
|
|
| 458 | 458 | value="1"/> |
| 459 | 459 | </label> |
| 460 | 460 | </p> |
| 461 | 461 | <p> |
| 462 | 462 | <label for="<?php echo $this->get_field_id('show_featured_only'); ?>">
|
| 463 | - <?php _e('Show only featured listings:', 'geodirectory');?> <input type="checkbox"
|
|
| 463 | + <?php _e('Show only featured listings:', 'geodirectory'); ?> <input type="checkbox"
|
|
| 464 | 464 | id="<?php echo $this->get_field_id('show_featured_only'); ?>"
|
| 465 | - name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) echo 'checked="checked"';?>
|
|
| 465 | + name="<?php echo $this->get_field_name('show_featured_only'); ?>" <?php if ($show_featured_only) echo 'checked="checked"'; ?>
|
|
| 466 | 466 | value="1"/> |
| 467 | 467 | </label> |
| 468 | 468 | </p> |
| 469 | 469 | <p> |
| 470 | 470 | <label for="<?php echo $this->get_field_id('show_special_only'); ?>">
|
| 471 | - <?php _e('Show only listings with special offers:', 'geodirectory');?> <input type="checkbox"
|
|
| 471 | + <?php _e('Show only listings with special offers:', 'geodirectory'); ?> <input type="checkbox"
|
|
| 472 | 472 | id="<?php echo $this->get_field_id('show_special_only'); ?>"
|
| 473 | - name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) echo 'checked="checked"';?>
|
|
| 473 | + name="<?php echo $this->get_field_name('show_special_only'); ?>" <?php if ($show_special_only) echo 'checked="checked"'; ?>
|
|
| 474 | 474 | value="1"/> |
| 475 | 475 | </label> |
| 476 | 476 | </p> |
| 477 | 477 | <p> |
| 478 | 478 | <label for="<?php echo $this->get_field_id('with_pics_only'); ?>">
|
| 479 | - <?php _e('Show only listings with pics:', 'geodirectory');?> <input type="checkbox"
|
|
| 479 | + <?php _e('Show only listings with pics:', 'geodirectory'); ?> <input type="checkbox"
|
|
| 480 | 480 | id="<?php echo $this->get_field_id('with_pics_only'); ?>"
|
| 481 | - name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) echo 'checked="checked"';?>
|
|
| 481 | + name="<?php echo $this->get_field_name('with_pics_only'); ?>" <?php if ($with_pics_only) echo 'checked="checked"'; ?>
|
|
| 482 | 482 | value="1"/> |
| 483 | 483 | </label> |
| 484 | 484 | </p> |
| 485 | 485 | <p> |
| 486 | 486 | <label for="<?php echo $this->get_field_id('with_videos_only'); ?>">
|
| 487 | - <?php _e('Show only listings with videos:', 'geodirectory');?> <input type="checkbox"
|
|
| 487 | + <?php _e('Show only listings with videos:', 'geodirectory'); ?> <input type="checkbox"
|
|
| 488 | 488 | id="<?php echo $this->get_field_id('with_videos_only'); ?>"
|
| 489 | - name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) echo 'checked="checked"';?>
|
|
| 489 | + name="<?php echo $this->get_field_name('with_videos_only'); ?>" <?php if ($with_videos_only) echo 'checked="checked"'; ?>
|
|
| 490 | 490 | value="1"/> |
| 491 | 491 | </label> |
| 492 | 492 | </p> |
@@ -536,7 +536,7 @@ discard block |
||
| 536 | 536 | |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | - <?php if(is_active_widget( false, false, $this->id_base, true )){ ?>
|
|
| 539 | + <?php if (is_active_widget(false, false, $this->id_base, true)) { ?>
|
|
| 540 | 540 | var post_type = jQuery('#<?php echo $this->get_field_id('post_type'); ?>').val();
|
| 541 | 541 | |
| 542 | 542 | <?php } ?> |