WordPress.org

Plugin Directory

Changeset 452292


Ignore:
Timestamp:
10/18/11 03:47:27 (3 years ago)
Author:
andypotanin
Message:

1.24.0

  • Added check to verify that the property type of the property being edited exists, if not a warning is displayed (in case property type was deleted by accident)
  • Added a notice to developer tab when new attributes are being added that are used for address storage, and the attributes are displayed a read-only on property editing pages.
  • Added a function to hide attributes from the back-end overview column when there are over 5, and added a button to toggle all the attributes over 5.
  • Fixed issue with Denali theme not showing property-specific sideshow.
  • Fixed bug that occurred with pagination when hashes() function was not found.
  • Fixed to Attribute Grouping functions.
  • Added "Help" tab tool to mass-set property type.
  • Added some support for legacy property templates.
  • Changed property export function to export in JSON format.
  • Added conditional function checking to prevent all JS to break when Fancybox, and other functions, were not found.
  • Improved attachment deleting function - now if the folder has no files upon deletion, it is deleted as well.
  • Added wpp_property_page_vars filter for API ability to load extra variables into WPP templates.
  • Added styling for FEPS (Front End Property Submissions)
  • Tweaks to Supermap searching and custom Map Icon uploading. (Super Map)
Location:
wp-property/trunk
Files:
8 added
22 edited

Legend:

Unmodified
Added
Removed
  • wp-property/trunk/action_hooks.php

    r448681 r452292  
    145145   * 
    146146   */ 
    147  
    148   // Don't load defaults if settings exist in db 
     147   
     148  //* Don't load defaults if settings exist in db */ 
    149149  if(!is_array($wp_properties_db['image_sizes'])) 
    150150    $wp_properties['image_sizes'] = array( 
     
    154154      'slideshow' => array('width'=> '640', 'height' => '235') 
    155155    ); 
    156  
    157  
     156   
     157  $wp_properties['default_coords']['latitude'] = '57.7973333'; 
     158  $wp_properties['default_coords']['longitude'] = '12.0502107'; 
     159   
     160  //* Geo type attributes are predefined and should not be editable on property adding/updating */ 
     161  $wp_properties['geo_type_attributes'] = array( 
     162    'formatted_address', 
     163    'street_number', 
     164    'route', 
     165    'district', 
     166    'city', 
     167    'county', 
     168    'state', 
     169    'state_code', 
     170    'country', 
     171    'country_code', 
     172    'postal_code' 
     173  ); 
     174   
    158175  // Image URLs. 
    159176  $wp_properties['images']['map_icon_shadow'] = WPP_URL . "images/map_icon_shadow.png"; 
     
    245262    'uploading' => __( 'Uploading', 'wpp' ), 
    246263    'drop_file' => __( 'Drop files here to upload', 'wpp' ), 
     264    'upload_images' => __( 'Upload Image', 'wpp' ), 
    247265    'cancel'    => __( 'Cancel', 'wpp' ), 
    248266    'fail'      => __( 'Failed', 'wpp' ) 
  • wp-property/trunk/core/class_core.php

    r448681 r452292  
    44 * 
    55 * @version 1.08 
    6  * @author Andy Potanin <andy.potanin@twincitiestech.com> 
     6 * @author Usability Dynamics, Inc. <info@usabilitydynamics.com> 
    77 * @package WP-Property 
    88*/ 
     
    6666    include_once WPP_Templates . '/template-functions.php'; 
    6767     
    68     // Load settings into $wp_properties and save settings if nonce exists 
     68    //** Load settings into $wp_properties and save settings if nonce exists */ 
    6969    WPP_F::settings_action(); 
    7070     
    71     // Load early so plugins can use them as well 
     71    //** Load early so plugins can use them as well */ 
    7272    wp_register_script('jquery-fancybox', WPP_URL. '/third-party/fancybox/jquery.fancybox-1.3.4.pack.js', array('jquery'), '1.7.3' ); 
    7373    wp_register_script('jquery-colorpicker', WPP_URL. '/third-party/colorpicker/colorpicker.js', array('jquery')); 
     
    7676    wp_register_script('jquery-ajaxupload', WPP_URL. '/js/fileuploader.js', array('jquery')); 
    7777    wp_register_script('wp-property-admin-overview', WPP_URL. '/js/wp-property-admin-overview.js', array('jquery'),WPP_Version); 
     78    wp_register_script('wp-property-backend-global', WPP_URL. '/js/wp-property-backend-global.js', array('jquery'),WPP_Version); 
    7879    wp_register_script('wp-property-global', WPP_URL. '/js/wp-property-global.js', array('jquery'),WPP_Version); 
    7980    wp_register_script('google-maps', 'http://maps.google.com/maps/api/js?sensor=true'); 
     
    8384    wp_register_script('jquery-address', WPP_URL. '/js/jquery.address-1.3.2.js', array('jquery')); 
    8485    wp_register_script('jquery-scrollTo', WPP_URL. '/js/jquery.scrollTo-min.js', array('jquery')); 
    85     //wp_register_script('jquery-validate', WPP_URL. '/js/jquery.validate.min.js', array('jquery')); 
    8686    wp_register_script('jquery-validate', WPP_URL. '/js/jquery.validate.js', array('jquery')); 
    8787    wp_register_script('jquery-number-format', WPP_URL. '/js/jquery.number.format.js', array('jquery')); 
     
    9696    wp_register_style('jquery-data-tables', WPP_URL . "/third-party/dataTables/wpp-data-tables.css"); 
    9797     
    98     // Find and register stylesheet 
     98    //** Find and register stylesheet  */ 
    9999    if ( file_exists( STYLESHEETPATH . '/wp_properties.css') ) { 
    100100      wp_register_style('wp-property-frontend', get_bloginfo('stylesheet_directory') . '/wp_properties.css',   array(),'1.13' ); 
     
    126126    // Init action hook 
    127127     do_action('wpp_init'); 
    128  
    129  
    130     // Load UD scripts 
    131     //WPP_UD_UI::use_ud_scripts(); 
    132128 
    133129    // Add troubleshoot log page 
     
    185181          continue; 
    186182        } 
    187          
    188         /*  
    189         // Commented out for now. Because Taxonomy was modified (Custom Capability was added).  
    190         // And now it should be overwrited to implement changes. Maxim Peshkov 
    191         if(taxonomy_exists($taxonomy)) 
    192           continue; 
    193         //*/ 
    194          
     183 
    195184        register_taxonomy( $taxonomy, 'property', array( 
    196185           'hierarchical' => $taxonomy_data['hierarchical'], 
     
    205194     
    206195    // Ajax functions 
     196    add_action('wp_ajax_wpp_ajax_max_set_property_type', create_function("",' die(WPP_F::mass_set_property_type($_REQUEST["property_type"]));')); 
    207197    add_action('wp_ajax_wpp_ajax_property_query', create_function("",' $class = WPP_F::get_property($_REQUEST["property_id"]); if($class)  print_r($class); else echo __("No property found.","wpp"); die();')); 
    208198    add_action('wp_ajax_wpp_ajax_image_query', create_function("",' $class = WPP_F::get_property_image_data($_REQUEST["image_id"]); if($class)  print_r($class); else echo __("No image found.","wpp"); die();')); 
     
    252242    add_filter("manage_edit-property_sortable_columns", array(&$this, "sortable_columns")); 
    253243    add_filter("manage_edit-property_columns", array(&$this, "edit_columns")); 
    254     add_action("manage_pages_custom_column", array(&$this, "custom_columns")); 
    255244     
    256245    // Called in setup_postdata().  We add property values here to make available in global $post variable on frontend 
     
    346335     
    347336    // Include on all pages 
     337    wp_enqueue_script('wp-property-backend-global'); 
    348338    wp_enqueue_script('wp-property-global'); 
    349339     
     
    368358      #wp-list-table.wp-list-table td.column-thumbnail {text-align: right;} 
    369359      #wp-list-table.wp-list-table .column-type {width: 90px;} 
    370        #wp-list-table.wp-list-table .column-menu_order {width: 50px; } 
     360      #wp-list-table.wp-list-table .column-menu_order {width: 50px; } 
    371361      #wp-list-table.wp-list-table td.column-menu_order {text-align: center; } 
    372362      #wp-list-table.wp-list-table .column-featured {width: 100px;} 
     
    419409    $settings_page  = add_submenu_page( 'edit.php?post_type=property', __('Settings','wpp'), __('Settings','wpp'), 'manage_wpp_settings', 'property_settings', create_function('','global $wp_properties; include "ui/page_settings.php";')); 
    420410    $all_properties = add_submenu_page( 'edit.php?post_type=property', $wp_properties['labels']['all_items'], $wp_properties['labels']['all_items'], 'edit_wpp_properties', 'all_properties', create_function('','global $wp_properties; include "ui/page_all_properties.php";')); 
     411     
    421412    /** 
    422413     * Next used to add custom submenu page 'All Properties' with Javascript dataTable 
    423414     * @author Anton K 
    424415     */ 
    425     //* 
    426416    if(!empty($submenu['edit.php?post_type=property'])) { 
    427417       
     
    436426      } 
    437427    } 
    438     /**  */ 
    439428     
    440429    // Load jQuery UI Tabs and Cookie into settings page (settings_page_property_settings) 
     
    463452        $contextual_help = ' 
    464453        <h3>Theme Problems</h3> 
    465         We do theme customizations, and if you need help customizing your theme, please <a href="http://twincitiestech.com/contact-us/">contact us</a>.<br /> 
     454        We do theme customizations, and if you need help customizing your theme, please <a href="http://usabilitydynamics.com/contact-us/">contact us</a>.<br /> 
    466455        <h3>Premium Theme</h3> 
    467         If you would like to purchase the official WP-Property theme, <a href="http://twincitiestech.com/plugins/wp-property/wp-property-premium-theme-the-denali/">please view it here</a>. <br /> 
     456        If you would like to purchase the official WP-Property theme, <a href="http://usabilitydynamics.com/products/wp-property/wp-property-premium-theme-the-denali/">please view it here</a>. <br /> 
    468457        <h3>Shortcodes</h3> 
    469         For examples of how to use shortcodes, visit the <a href="http://sites.twincitiestech.com/the-denali/help/wp-property-shortcode-overview/">shortcode cheatsheet page<a>. 
     458        For examples of how to use shortcodes, visit the <a href="http://usabilitydynamics.com/help/wp-property-help/wp-property-shortcode-cheat-sheet//">shortcode cheatsheet page<a>. 
    470459        '; 
    471460         
     
    489478              "<p><b><?php _e('Thank you for installing WP-Property!','wpp') ?></b> " + 
    490479              "<?php echo $permalink_problem; ?></p>" + 
    491               "<p><?php _e('You may also visit <a href="http://twincitiestech.com/plugins/wp-property/">TwinCitiesTech.com</a> for more information, and <a href="http://twincitiestech.com/plugins/wp-property/screencasts/">screencasts</a>.', 'wpp') ?></p></div>"; 
     480              "<p><?php _e('You may also visit <a href="http://usabilitydynamics.com/products/wp-property/">TwinCitiesTech.com</a> for more information, and <a href="http://usabilitydynamics.com/products/wp-property/screencasts/">screencasts</a>.', 'wpp') ?></p></div>"; 
    492481 
    493482             jQuery(message).insertAfter(".wp-list-table   h2"); 
     
    498487        <script type="text/javascript"> 
    499488          jQuery(document).ready(function() { 
    500             jQuery("<p class='wpp_notification'>Help improve WP-Property by <a href='http://feedback.twincitiestech.com/forums/95259-wp-property'>suggesting ideas</a>. Support WP-Property by using the <a href='http://sites.twincitiestech.com/the-denali/'>official premium theme</a>.</p>").insertAfter("#posts-filter"); 
     489            jQuery("<p class='wpp_notification'>Help improve WP-Property by <a href='http://feedback.twincitiestech.com/forums/95259-wp-property'>suggesting ideas</a>. Support WP-Property by using the <a href='http://sites.usabilitydynamics.com/the-denali/'>official premium theme</a>.</p>").insertAfter("#posts-filter"); 
    501490          }); 
    502491        </script> 
     
    549538    global $wp_query, $wp_properties; 
    550539 
    551     if(empty($wp_properties['configuration']['base_slug'])) 
     540    if(empty($wp_properties['configuration']['base_slug'])) { 
    552541      return; 
    553  
    554     if( 
    555       $query->query_vars['name'] == $wp_properties['configuration']['base_slug']  || 
    556       $query->query_vars['category_name'] == $wp_properties['configuration']['base_slug'] 
    557     ) { 
     542    } 
     543 
     544    if($query->query_vars['name'] == $wp_properties['configuration']['base_slug']  || $query->query_vars['category_name'] == $wp_properties['configuration']['base_slug']) { 
    558545      $query->is_search = true; 
    559546    } 
     
    591578  function save_property( $post_id ) { 
    592579    global $wp_rewrite, $wp_properties; 
    593  
     580     
    594581    if (!wp_verify_nonce( $_POST['_wpnonce'],'update-property_' . $post_id)) { 
    595582      return $post_id; 
    596583    } 
    597  
    598     //Delete cache files of search values for search widget's form 
     584     
     585    //* Delete cache files of search values for search widget's form */ 
    599586    $directory = WPP_Path . '/cache/searchwidget'; 
    600  
     587     
    601588    if(is_dir($directory)) { 
    602589      $dir = opendir($directory); 
    603         while(($cachefile = readdir($dir))){ 
    604           if ( is_file ($directory."/".$cachefile)) { 
    605               unlink ($directory."/".$cachefile); 
    606           } 
    607         } 
    608     } 
    609  
     590      while(($cachefile = readdir($dir))){ 
     591        if ( is_file ($directory."/".$cachefile)) { 
     592          unlink ($directory."/".$cachefile); 
     593        } 
     594      } 
     595    } 
     596     
    610597    if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE ) { 
    611598      return $post_id; 
    612599    } 
    613  
     600     
    614601    /* 
    615     if ( !current_user_can( 'edit_property', $post_id) ) 
     602    if ( !current_user_can( 'edit_property', $post_id) ) { 
    616603      return $post_id; 
    617     */ 
    618  
     604    } 
     605    //*/ 
     606     
    619607    $update_data = $_REQUEST['wpp_data']['meta']; 
    620  
     608     
    621609    $old_location = get_post_meta($post_id, $wp_properties['configuration']['address_attribute'], true); 
    622610    $coordinates = get_post_meta($post_id,'latitude', true) . get_post_meta($post_id,'longitude', true); 
    623611    $new_location = $update_data[$wp_properties['configuration']['address_attribute']]; 
    624  
    625  
     612     
    626613    if($update_data['manual_coordinates'] != get_post_meta($post_id, 'manual_coordinates', true)) { 
    627614      $manual_coordinates_updated = true; 
    628615    } 
    629  
     616     
    630617    // Update Coordinates (skip if old address matches new address), but always do if no coordinates set 
    631618    if(empty($coordinates) || ($old_location != $new_location && !empty($new_location)) || $manual_coordinates_updated) { 
    632  
    633619      $geo_data = WPP_UD_F::geo_locate_address($update_data[$wp_properties['configuration']['address_attribute']], $wp_properties['configuration']['google_maps_localization'], true); 
    634620       
    635621      if(!empty($geo_data->formatted_address)) { 
    636622        update_post_meta($post_id, 'address_is_formatted', true); 
    637  
     623         
    638624        if(!empty($wp_properties['configuration']['address_attribute'])) { 
    639625          update_post_meta($post_id, $wp_properties['configuration']['address_attribute'], WPP_F::encode_mysql_input( $geo_data->formatted_address, $wp_properties['configuration']['address_attribute'])); 
    640626        } 
    641  
     627         
    642628        foreach($geo_data as $geo_type => $this_data) { 
    643629          update_post_meta($post_id, $geo_type, WPP_F::encode_mysql_input( $this_data, $geo_type)); 
    644630        } 
    645  
    646631      } else { 
    647632        // Try to figure out why it failed 
    648633        update_post_meta($post_id, 'address_is_formatted', false); 
    649634      } 
    650  
    651     } else { 
    652  
    653     } 
    654  
     635    } 
     636     
    655637    if($geo_data->status == 'OVER_QUERY_LIMIT') { 
    656638      //** Could add some sort of user notification that over limit */ 
    657639    } 
    658  
     640     
    659641    foreach($update_data as $meta_key => $meta_value) { 
    660  
    661642      $attribute_data = WPP_F::get_attribute_data($meta_key); 
    662643       
    663       /* Cleans the user input */ 
     644      //* Cleans the user input */ 
    664645      $meta_value = WPP_F::encode_mysql_input( $meta_value, $meta_key); 
    665  
    666       // Only admins can mark properties as featured. 
     646       
     647      //* Only admins can mark properties as featured. */ 
    667648      if( $meta_key == 'featured' && !current_user_can('manage_options') ) { 
    668649        continue; 
    669650      } 
    670  
    671       //Remove certain characters 
     651       
     652      //* Remove certain characters */ 
    672653       
    673654      if($attribute_data['currency'] || $attribute_data['numeric']) { 
    674         $meta_value = str_replace(array("$", ","), '', $meta_value);       
    675       } 
    676  
    677        //** Overwrite old post meta allowing only one value */ 
     655        $meta_value = str_replace(array("$", ","), '', $meta_value); 
     656      } 
     657       
     658      //* Overwrite old post meta allowing only one value */ 
    678659      delete_post_meta($post_id, $meta_key); 
    679660      add_post_meta($post_id, $meta_key, $meta_value); 
    680      } 
    681  
    682     // Check if property has children 
     661    } 
     662     
     663    //* Check if property has children */ 
    683664    $children = get_children("post_parent=$post_id&post_type=property"); 
    684  
    685     // Write any data to children properties that are supposed to inherit things 
     665     
     666    //* Write any data to children properties that are supposed to inherit things */ 
    686667    if(count($children) > 0) { 
    687       //1) Go through all children 
     668      //* 1) Go through all children */ 
    688669      foreach($children as $child_id => $child_data) { 
    689  
    690         // Determine child property_type 
     670        //* Determine child property_type */ 
    691671        $child_property_type = get_post_meta($child_id, 'property_type', true); 
    692  
    693         // Check if child's property type has inheritence rules, and if meta_key exists in inheritance array 
    694         if(is_array($wp_properties['property_inheritance'][$child_property_type])) 
    695  
     672        //* Check if child's property type has inheritence rules, and if meta_key exists in inheritance array */ 
     673        if(is_array($wp_properties['property_inheritance'][$child_property_type])) { 
    696674          foreach($wp_properties['property_inheritance'][$child_property_type] as $i_meta_key) { 
    697  
    698675            $parent_meta_value = get_post_meta($post_id, $i_meta_key, true); 
    699  
    700             // inheritance rule exists for this property_type for this meta_key 
     676            //* inheritance rule exists for this property_type for this meta_key */ 
    701677            update_post_meta($child_id, $i_meta_key, $parent_meta_value); 
    702678          } 
    703679        } 
    704     } 
    705  
     680      } 
     681    } 
     682     
    706683    WPP_F::maybe_set_gpid($post_id); 
    707  
     684     
    708685    if($_REQUEST['parent_id']) { 
    709686      update_post_meta($post_id, 'parent_gpid', WPP_F::maybe_set_gpid($_REQUEST['parent_id'])); 
    710687    } 
    711  
     688     
    712689    do_action('save_property',$post_id, $_REQUEST, $geo_data); 
    713  
     690     
    714691    $wp_rewrite->flush_rules(); 
    715  
     692     
    716693    return true; 
    717    } 
     694  } 
    718695 
    719696  /** 
     
    737714 
    738715        <?php if(current_user_can('manage_options')): ?> 
    739         <li><?php $display_property_text = __('Display property in featured listing.','wpp'); echo WPP_UD_UI::checkbox("name=wpp_data[meta][featured]&label=$display_property_text", $featured); ?></li> 
     716        <li><?php echo WPP_UD_UI::checkbox("name=wpp_data[meta][featured]&label=" . __('Display property in featured listing.','wpp'), $featured); ?></li> 
    740717        <?php endif; ?> 
    741718 
     
    878855  } 
    879856 
    880  
    881   /** 
    882    * Displays custom property columns on the overview page 
    883    * 
    884    * 
    885    * @since 0.5 
    886    * 
    887    */ 
    888   function custom_columns($column) { 
    889     global $post, $wp_properties; 
    890     $post_id = $post->ID; 
    891  
    892     switch ($column)    { 
    893       case "description": 
    894         the_excerpt(); 
    895       break; 
    896  
    897       case "property_type": 
    898         $property_type = $post->property_type; 
    899         echo $wp_properties['property_types'][$property_type]; 
    900       break; 
    901  
    902       case "price": 
    903          echo apply_filters("wpp_stat_filter_$column", $post->price); 
    904       break; 
    905  
    906       case $wp_properties['configuration']['address_attribute']: 
    907  
    908         // Only show this is the property type has an address 
    909         if(in_array($post->property_type, $wp_properties['location_matters'])) { 
    910  
    911         $localization = ($wp_properties['configuration']['google_maps_localization'] ? $wp_properties['configuration']['google_maps_localization'] : 'en'); 
    912  
    913         if($post->latitude && $post->longitude) 
    914           echo "<a href='http://maps.google.com/maps?q={$post->latitude},+{$post->longitude}&hl=$localization' target='_blank'>".$post->display_address ."</a>."; 
    915         else 
    916           _e(' - ','wpp'); 
    917  
    918         } 
    919  
    920  
    921       break; 
    922  
    923       case "overview": 
    924  
    925         $overview_stats = $wp_properties['property_stats']; 
    926  
    927         unset($overview_stats['phone_number']); 
    928  
    929         // Not the best way of doing it, but better than nothing. 
    930         // We basically take all property stats, then dump everything too long and empty 
    931         foreach($overview_stats as $stat => $label) { 
    932  
    933           if(empty($post->$stat) || strlen($post->$stat) > 15) 
    934             continue; 
    935  
    936           echo "$label: " . apply_filters("wpp_stat_filter_$stat", $post->$stat) . " <br />"; 
    937  
    938         } 
    939  
    940  
    941       break; 
    942  
    943  
    944       case "features": 
    945         $features = get_the_terms($post_id, "property_feature"); 
    946          $features_html = array(); 
    947  
    948         if($features) { 
    949         foreach ($features as $feature) 
    950           array_push($features_html, '<a href="' . get_term_link($feature->slug, "property_feature") . '">' . $feature->name . '</a>'); 
    951  
    952         echo implode($features_html, ", "); 
    953         } 
    954       break; 
    955  
    956       case "thumbnail": 
    957  
    958         if($post->featured_image) { 
    959  
    960           $overview_thumb_type = $wp_properties['configuration']['admin_ui']['overview_table_thumbnail_size']; 
    961  
    962           if(empty($overview_thumb_type)) { 
    963             $overview_thumb_type = 'thumbnail'; 
    964           } 
    965  
    966            $image_thumb_obj = wpp_get_image_link($post->featured_image, $overview_thumb_type, array('return'=>'array')); 
    967  
    968  
    969         } 
    970  
    971         if(!empty($image_thumb_obj)) { ?> 
    972           <a href="<?php echo $post->images['large']; ?>" class="fancybox" rel="overview_group" title="<?php echo  $post->post_title; ?>"> 
    973             <img src="<?php echo $image_thumb_obj['url']; ?>" width="<?php echo $image_thumb_obj['width']; ?>" height="<?php echo $image_thumb_obj['height']; ?>" /> 
    974           </a> 
    975  
    976         <?php 
    977         } else { 
    978           echo " - "; 
    979         } 
    980  
    981       break; 
    982  
    983       case "featured": 
    984  
    985         if(current_user_can('manage_options')) { 
    986           if($post->featured) 
    987             echo "<input type='button' id='wpp_feature_$post_id' class='wpp_featured_toggle wpp_is_featured' nonce='".wp_create_nonce('wpp_make_featured_' . $post_id)."' value='".__('Featured','wpp')."' />"; 
    988           else 
    989             echo "<input type='button' id='wpp_feature_$post_id' class='wpp_featured_toggle' ' nonce='".wp_create_nonce('wpp_make_featured_' . $post_id)."'  value='".__('Feature','wpp')."' />"; 
    990         } else { 
    991           if($post->featured) 
    992             echo __('Featured','wpp'); 
    993           else 
    994             echo ""; 
    995  
    996         } 
    997       break; 
    998  
    999       case "menu_order": 
    1000         if($post->menu_order) 
    1001           echo $post->menu_order; 
    1002       break; 
    1003  
    1004       default: 
    1005  
    1006         echo (!empty($post->$column) ? apply_filters('wpp_stat_filter_' . $column, $post->$column) : ""); 
    1007  
    1008       break; 
    1009  
    1010  
    1011     } 
    1012   } 
    1013  
    1014  
    1015857  /** 
    1016858   * Performs front-end pre-header functionality 
     
    1116958 
    1117959      $type = $post->property_type; 
     960       
     961      //** Make certain variables available to be used within the single listing page */ 
     962      $single_page_vars = apply_filters('wpp_property_page_vars', array( 
     963        'property' => $post 
     964      )); 
     965        
     966      //** By merging our extra variables into $wp_query->query_vars they will be extracted in load_template() */ 
     967      if(is_array($single_page_vars)) { 
     968        $wp_query->query_vars = array_merge($wp_query->query_vars, $single_page_vars); 
     969      } 
    1118970 
    1119971      if(file_exists(STYLESHEETPATH . "/property-$type.php")) { 
     
    15361388      //** Legacy Support - include variables so old templates still work */ 
    15371389      $properties = $wpp_query['properties']['results']; 
    1538       //$properties['total'] = $wpp_query['properties']['total']; 
     1390      $thumbnail_sizes = WPP_F::image_sizes($thumbnail_size); 
     1391      $child_properties_title = $wpp_query['child_properties_title']; 
    15391392      $unique = $wpp_query['unique_hash']; 
    15401393      $thumbnail_size = $wpp_query['thumbnail_size']; 
     
    15501403      $fancybox_preview = $wpp_query['fancybox_preview']; 
    15511404      $show_children = $wpp_query['show_children']; 
     1405 
    15521406       
    15531407      // 1. Try custom template in theme folder ("template=" in shortcode) 
  • wp-property/trunk/core/class_functions.php

    r448681 r452292  
    1313class WPP_F { 
    1414 
     15  /** 
     16   * Set all existing property objects' property type 
     17   * 
     18   * @todo Add regex to check for opening and closing bracket. 
     19   * @version 1.23.1 
     20   */ 
     21    function mass_set_property_type($property_type = false) { 
     22      global $wpdb;       
     23       
     24      if(!$property_type) { 
     25        return false; 
     26      } 
     27       
     28      //** Get all properties */ 
     29      $ap = $wpdb->get_col("SELECT ID FROM {$wpdb->posts} WHERE post_type = 'property'"); 
     30  
     31      if(!$ap) { 
     32        return false; 
     33      } 
     34       
     35      foreach($ap as $id) { 
     36       
     37        if(update_post_meta($id, 'property_type', $property_type)) { 
     38          $success[] = true; 
     39        } 
     40       
     41      } 
     42       
     43      if(!$success) { 
     44        return false; 
     45      } 
     46       
     47      return sprintf(__('Set %1s properties to "%2s" property type', 'wpp'), count($success), $property_type); 
     48       
     49       
     50     
     51    } 
     52     
     53     
     54  /** 
     55   * Attempts to detect if current page has a given shortcode 
     56   * 
     57   * @todo Add regex to check for opening and closing bracket. 
     58   * @version 1.23.1 
     59   */ 
     60    function detect_shortcode($shortcode = false){ 
     61      global $post; 
     62       
     63      if(!$post) { 
     64        return false; 
     65      }       
     66       
     67      $shortcode = '[' . $shortcode; 
     68       
     69      if(strpos($post->post_content, $shortcode) !== false) {       
     70        return true;       
     71      } 
     72       
     73      return false; 
     74     
     75    } 
     76     
     77     
    1578  /** 
    1679   * Reassemble address from parts 
     
    199262      } 
    200263 
    201  
    202264      if(is_array($wp_properties['searchable_attributes']) && in_array($attribute, $wp_properties['searchable_attributes'])) { 
    203265        $return['searchable'] = true; 
    204266        $ui_class[] = 'searchable'; 
    205267      } 
    206  
     268       
     269      if(empty($return['title'])) { 
     270        $return['title'] = WPP_UD_F::de_slug($return['slug']); 
     271      } 
    207272 
    208273      $return['ui_class'] = implode(' wpp_', $ui_class); 
    209  
    210274 
    211275      return apply_filters('wpp_attribute_data', $return); 
     
    444508 
    445509      //* Make sure this is a property */ 
    446       $is_property = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE ID = $post_id AND post_type = 'property'"); 
     510      $is_property = $wpdb->get_var("SELECT ID FROM {$wpdb->posts} WHERE ID = {$post_id} AND post_type = 'property'"); 
    447511 
    448512      if(!$is_property) { 
     
    450514      } 
    451515 
     516      $uploads = wp_upload_dir(); 
     517 
    452518      //* Get Attachments */ 
    453       $attachments = $wpdb->get_col("SELECT ID FROM {$wpdb->posts} WHERE post_parent = $post_id AND post_type = 'attachment' "); 
     519      $attachments = $wpdb->get_col("SELECT ID FROM {$wpdb->posts} WHERE post_parent = {$post_id} AND post_type = 'attachment' "); 
    454520 
    455521      if($attachments) { 
    456522        foreach($attachments as $attachment_id) { 
    457523 
     524          $file_path = $wpdb->get_var("SELECT meta_value FROM {$wpdb->postmeta} WHERE post_id = {$attachment_id} AND meta_key = '_wp_attached_file' "); 
     525 
    458526          wp_delete_attachment($attachment_id, true); 
    459527 
    460         } 
    461  
    462       } 
    463  
    464    } 
     528          if($file_path) { 
     529            $attachment_directories[] = $uploads['basedir'] . '/' . dirname($file_path); 
     530          } 
     531 
     532        } 
     533      } 
     534 
     535      if(is_array($attachment_directories)) { 
     536        $attachment_directories = array_unique($attachment_directories); 
     537        foreach($attachment_directories as $dir) { 
     538          @rmdir($dir); 
     539        } 
     540 
     541      } 
     542 
     543 
     544  } 
     545 
    465546 
    466547 
     
    861942    global $wp_properties; 
    862943 
    863     if(!$type) 
     944    if(!$type) { 
    864945      return; 
    865  
    866     $dimensions = $wp_properties[image_sizes][$type]; 
    867  
    868     $return[0] = $dimensions[width]; 
    869     $return[1] = $dimensions[height]; 
    870     $return['width'] = $dimensions[width]; 
    871     $return['height'] = $dimensions[height]; 
     946    } 
     947 
     948    $dimensions = $wp_properties['image_sizes'][$type]; 
     949 
     950    $return[0] = $dimensions['width']; 
     951    $return[1] = $dimensions['height']; 
     952    $return['width'] = $dimensions['width']; 
     953    $return['height'] = $dimensions['height']; 
    872954 
    873955    return $return; 
     
    26802762            $return['children'][$child_id] = $child_object; 
    26812763            // Exclude variables from searchable attributes (to prevent ranges) 
    2682             $excluded_attributes = array( 
    2683               $wp_properties['configuration']['address_attribute'], 
    2684               'city', 
    2685               'country_code', 
    2686               'country', 
    2687               'state', 
    2688               'state_code', 
    2689               'state' 
    2690             ); 
     2764            $excluded_attributes = $wp_properties['geo_type_attributes']; 
     2765            $excluded_attributes[] = $wp_properties['configuration']['address_attribute']; 
    26912766 
    26922767            foreach($wp_properties['searchable_attributes'] as $searchable_attribute) { 
     
    27512826 
    27522827 
    2753     if(empty($return['phone_number']) && !empty($wp_properties['configuration']['phone_number'])) 
     2828    if(empty($return['phone_number']) && !empty($wp_properties['configuration']['phone_number'])) { 
    27542829      $return['phone_number'] = $wp_properties['configuration']['phone_number']; 
    2755  
    2756     if(is_array($return)) 
     2830    } 
     2831 
     2832    if(is_array($return)) { 
    27572833      ksort($return); 
     2834    } 
    27582835 
    27592836    $return = apply_filters('wpp_get_property', $return); 
     
    30073084          <?php endif; ?> 
    30083085        </td> 
    3009         <td  class="wpp_google_maps_right_col"   valign="top"> 
     3086        <td  class="wpp_google_maps_right_col" vertical-align="top" style="vertical-align: top;"> 
    30103087         
    30113088          <?php 
  • wp-property/trunk/core/class_property_export.php

    r448681 r452292  
    144144  $taxonomies = $wp_properties['taxonomies']; 
    145145 
    146   $limit = ($_REQUEST['limit'] ? $_REQUEST['limit'] : -1); 
    147      
    148146    // If the API key isn't valid, we quit 
    149     if($_REQUEST['api'] != $api_key) die(__('Invalid API key.', 'wpp')); 
    150     // Start building our wp query object 
    151     $args = array( 
    152       'post_type' => 'property', 
    153       'post_status' => 'publish', 
    154       'posts_per_page' => $limit 
    155     ); 
    156     $wpq = new wp_query($args); 
    157     if($wpq->post_count == 0) die(__('No published properties.', 'wpp')); 
     147    if($_REQUEST['api'] != $api_key) { 
     148      die(__('Invalid API key.', 'wpp')); 
     149    } 
     150     
     151    if(isset($_REQUEST['limit'])) { 
     152      $per_page = $_REQUEST['limit']; 
     153      $starting_row = 0; 
     154    }     
     155     
     156    if(isset($_REQUEST['per_page'])) { 
     157      $per_page = $_REQUEST['per_page']; 
     158    } 
     159     
     160    if(isset($_REQUEST['starting_row'])) { 
     161      $starting_row = $_REQUEST['starting_row']; 
     162    } 
     163     
     164    if(isset($_REQUEST['property_type'])) { 
     165      $property_type = $_REQUEST['property_type']; 
     166    } else { 
     167      $property_type = 'all'; 
     168    } 
     169     
     170    $wpp_query['query']['property_type'] = 'listing'; 
     171   
     172    $wpp_query['query']['pagi'] = $starting_row . '--' . $per_page; 
     173    $wpp_query['query']['sort_by'] = ($_REQUEST['sort_by'] ? $_REQUEST['sort_by'] : 'post_date' ); 
     174    $wpp_query['query']['sort_order'] = ($_REQUEST['sort_order'] ? $_REQUEST['sort_order'] : 'ASC' ); 
     175    $wpp_query['query']['property_type'] = $property_type; 
     176  
     177    $wpp_query = WPP_F::get_properties($wpp_query['query'], true); 
     178     
     179    $results = $wpp_query['results']; 
     180  
     181    if(count($results) == 0) { 
     182      die(__('No published properties.', 'wpp')); 
     183    } 
     184     
    158185    //Start the XML 
     186    /* 
    159187    header('Content-type: text/xml'); 
    160188    print '<?xml version="1.0"?><properties>'; 
    161  
    162     $count = 0; 
    163      
    164     foreach($wpq->posts as $post){ 
    165       if(isset($_REQUEST['limit']) && $count == $_REQUEST['limit']) break; 
    166       $count++; 
    167       $property = WPP_F::get_property($post->ID, "return_object=true&load_parent=false");       
     189*/ 
     190 
     191    header('Content-type: application/json'); 
     192    header('Content-Disposition: inline; filename="wpp_xml_data.json"'); 
     193    header("Cache-Control: no-cache"); 
     194    header("Pragma: no-cache"); 
     195         
     196    foreach($results as $count => $id){ 
     197 
     198      $property = WPP_F::get_property($id, "return_object=true&load_parent=false");       
    168199       
    169200      if($property->post_parent && !$property->parent_gpid) { 
     
    200231      } 
    201232       
    202       $xml = new XML_Serializer(); 
    203       $xml->serialize($property); 
    204       $data = preg_replace('/stdClass/i', 'property', $xml->getSerializedData()); 
    205       $data = preg_replace('/XML_Serializer_Tag/i', 'tag', $data); 
    206       print $data; 
    207     } 
    208  
    209     $mtime = microtime(); 
    210     $mtime = explode(" ",$mtime); 
    211     $mtime = $mtime[1] + $mtime[0]; 
    212     $endtime = $mtime; 
    213     $totaltime = ($endtime - $starttime); 
    214  
     233      foreach($property as $meta_key => $meta_value) { 
     234       
     235        if(is_array($meta_value) || is_object($meta_value)) { 
     236          $fixed_property->$meta_key = $meta_value; 
     237          continue; 
     238        } 
     239         
     240        //$meta_value = strip_tags($meta_value); 
     241        $fixed_property->$meta_key = $meta_value; 
     242        //$fixed_property->$meta_key = '<![CDATA[' .  ($meta_value) . ']]>'; 
     243        $properties[$id] = $fixed_property; 
     244 
     245       
     246      } 
     247       
     248  
     249    } 
     250     
     251    echo json_encode($properties); 
     252 
     253    /* 
    215254    print '<stats>'; 
    216255    print '<count>' . $wpq->post_count . '</count>'; 
    217256    print '<load_time>' . $totaltime . '</load_time>'; 
    218257    print '</stats>';    
    219     die("</properties>"); 
     258    */ 
     259    die(); 
    220260  } 
    221261} 
  • wp-property/trunk/core/class_widgets.php

    r448681 r452292  
    985985        } 
    986986         
    987  
    988          
    989987        //** Load different attribute list depending on group selection */ 
    990988        if($instance['group_attributes'] == 'true') { 
     
    995993        } 
    996994         
     995        //* Clean searchable attributes: remove unavailable ones */ 
     996        $all_searchable_attributes = array_unique($wp_properties['searchable_attributes']); 
     997        foreach($search_args['search_attributes'] as $k => $v) { 
     998          if(!in_array($v, $all_searchable_attributes)) { 
     999            //* Don't remove hardcoded attributes (property_type,city) */ 
     1000            if ($v != 'property_type' && $v != 'city') { 
     1001              unset($search_args['search_attributes'][$k]); 
     1002            } 
     1003          } 
     1004        } 
     1005         
    9971006        $search_args['searchable_property_types'] = $searchable_property_types; 
    998  
     1007         
    9991008        if(isset($instance['use_pagi']) && $instance['use_pagi']=='on') { 
    10001009 
     
    10811090      } 
    10821091         
    1083        if(is_array($all_searchable_property_types) && count($all_searchable_property_types) > 1) {         
     1092       if(is_array($all_searchable_property_types) && count($all_searchable_property_types) > 1) { 
    10841093 
    10851094        //** Add property type to the beginning of the attribute list, even though it's not a typical attribute */ 
    10861095        array_unshift($all_searchable_attributes, 'property_type'); 
    10871096       } 
    1088  
    10891097       
    10901098      //** Find the difference between selected attributes and all attributes, i.e. unselected attributes */ 
    10911099      if(is_array($searchable_attributes) && is_array($all_searchable_attributes)) { 
    1092         $unselected_attributes = array_diff($all_searchable_attributes, $searchable_attributes);       
    1093        
    1094         //** Build new array beginning with selected attributes, in order, follow by all other attributes */ 
     1100        $unselected_attributes = array_diff($all_searchable_attributes, $searchable_attributes); 
     1101         
     1102        //* Clean searchable attributes: remove unavailable ones */ 
     1103        foreach($searchable_attributes as $k => $v) { 
     1104          if(!in_array($v, $all_searchable_attributes)) { 
     1105            //* Don't remove hardcoded attributes (property_type,city) */ 
     1106            if ($v != 'property_type' && $v != 'city') { 
     1107              unset($searchable_attributes[$k]); 
     1108            } 
     1109          } 
     1110        } 
     1111         
     1112        // Build new array beginning with selected attributes, in order, follow by all other attributes 
    10951113        $ungrouped_searchable_attributes = array_merge($searchable_attributes, $unselected_attributes); 
    10961114       
     
    10981116        $ungrouped_searchable_attributes = $all_searchable_attributes; 
    10991117      } 
    1100       
    1101  
     1118      //$ungrouped_searchable_attributes = $all_searchable_attributes; 
     1119       
    11021120      //* Perpare $all_searchable_attributes for using by sort function */ 
    11031121      $temp_attrs = array(); 
    1104  
     1122       
    11051123      foreach($all_searchable_attributes as $slug) { 
    11061124        $attribute_label = $wp_properties['property_stats'][$slug]; 
  • wp-property/trunk/core/premium/class_admin_tools.php

    r448681 r452292  
    22/* 
    33Name: Admin Tools 
     4Feature ID: 1 
     5Minimum Version: 1.24.0 
     6Version: 3.0.0 
     7Description: Tools for developing themes and extensions for WP-Property. 
    48Class: class_admin_tools 
    5 Version: 2.9.3 
    6 Feature ID: 1 
    7 Minimum Version: 1.22.0 
    8 Description: Tools for developing themes and extensions for WP-Property. 
    99*/ 
    1010 
     
    124124  global $wpdb, $wp_properties; ?> 
    125125  <script type="text/javascript"> 
     126    var geo_type_attrs = <?php echo json_encode((array)$wp_properties['geo_type_attributes']); ?> 
     127     
    126128    jQuery(document).ready(function() { 
    127        
    128129      jQuery("#wpp_inquiry_attribute_fields tbody").sortable(); 
    129130      jQuery("#wpp_inquiry_meta_fields tbody").sortable(); 
     
    137138      });; 
    138139       
    139       /* Stats to group functionality */ 
     140      //* Stats to group functionality */ 
    140141      jQuery('.wpp_attribute_group').wppGroups(); 
     142       
     143      //* Fire Event after Row is added */ 
     144      jQuery('#wpp_inquiry_attribute_fields tr').live('added', function(){ 
     145        //* Remove notice block if it exists */ 
     146        var notice = jQuery(this).find('.wpp_notice'); 
     147        if(notice.length > 0) { 
     148          notice.remove(); 
     149        } 
     150        //* Unassign Group from just added Attribute */ 
     151        jQuery('input.wpp_group_slug' , this).val(''); 
     152        this.removeAttribute('wpp_attribute_group'); 
     153         
     154        //* Remove background-color from the added row if it's set */ 
     155        if(typeof jQuery.browser.msie != 'undefined' && (parseInt(jQuery.browser.version) == 9)) { 
     156          //* HACK FOR IE9 (it's just unset background color) peshkov@UD: */ 
     157          setTimeout(function(){ 
     158            var lr = jQuery('#wpp_inquiry_attribute_fields tr.wpp_dynamic_table_row').last(); 
     159            var bc = lr.css('background-color'); 
     160            lr.css('background-color', ''); 
     161            jQuery(document).bind('mousemove', function(){ 
     162              setTimeout(function(){ 
     163                lr.prev().css('background-color', bc); 
     164              }, 50); 
     165              jQuery(document).unbind('mousemove'); 
     166            }); 
     167          }, 50); 
     168        } else { 
     169          jQuery(this).css('background-color', ''); 
     170        } 
     171         
     172        //* Stat to group functionality */ 
     173        jQuery(this).find('.wpp_attribute_group').wppGroups(); 
     174      }); 
     175       
     176      //* Determine if slug of property stat is the same as Geo Type has and show notice */ 
     177      jQuery('#wpp_inquiry_attribute_fields tr .wpp_stats_slug_field').live('change', function(){ 
     178        var slug = jQuery(this).val(); 
     179        var geo_type = false; 
     180        if(typeof geo_type_attrs == 'object') { 
     181          for(var i in geo_type_attrs) { 
     182            if(slug == geo_type_attrs[i]) { 
     183              geo_type = true; 
     184              break; 
     185            } 
     186          } 
     187        } 
     188        var notice = jQuery(this).parent().find('.wpp_notice'); 
     189        if(geo_type) { 
     190          if(!notice.length > 0) { 
     191            //* Toggle Advanced option to show notice */ 
     192            var advanced_options = (jQuery(this).parents('tr.wpp_dynamic_table_row').find('.wpp_development_advanced_option')); 
     193            if(advanced_options.length > 0) { 
     194              if(jQuery(advanced_options.get(0)).is(':hidden')) { 
     195                jQuery(this).parents('tr.wpp_dynamic_table_row').find('.wpp_show_advanced').trigger('click'); 
     196              } 
     197            } 
     198            jQuery(this).parent().append('<div class="wpp_notice"></div>'); 
     199            notice = jQuery(this).parent().find('.wpp_notice'); 
     200          } 
     201          notice.html('<span><?php _e('Attention! This attribute (slug) is used by Google Validator and Address Display functionality. It is set automaticaly and can not be edited on Property Adding/Updating page.','wpp'); ?></span>'); 
     202        } else { 
     203          if(notice.length > 0) { 
     204            notice.remove(); 
     205          } 
     206        } 
     207      }); 
    141208    }); 
    142209  </script> 
     
    150217      <td> 
    151218        <h3><?php _e('Property Types','wpp') ?></h3> 
    152         <table id="wpp_inquiry_property_types" class="ud_ui_dynamic_table widefat"> 
     219        <table id="wpp_inquiry_property_types" class="ud_ui_dynamic_table widefat" allow_random_slug="true"> 
    153220        <thead> 
    154221          <tr> 
     
    191258            </ul> 
    192259          </td> 
    193  
    194  
     260           
    195261          <td > 
    196262            <ul class="wp-tab-panel wpp_hidden_property_attributes"> 
     
    264330        </div> 
    265331         
     332        <div id="wpp_dialog_wrapper_for_groups"></div> 
    266333        <div id="wpp_attribute_groups"> 
    267334            <table cellpadding="0" cellspacing="0" allow_random_slug="true" class="ud_ui_dynamic_table widefat wpp_sortable"> 
     
    330397        </div> 
    331398         
    332         <table id="wpp_inquiry_attribute_fields" class="ud_ui_dynamic_table widefat"> 
     399        <table id="wpp_inquiry_attribute_fields" class="ud_ui_dynamic_table widefat" allow_random_slug="true"> 
    333400        <thead> 
    334401          <tr> 
     
    359426              </li> 
    360427              <li class="wpp_development_advanced_option"> 
    361                 <input type="text" class="slug" readonly='readonly' value="<?php echo $slug; ?>" /> 
     428                <input type="text" class="slug wpp_stats_slug_field" readonly='readonly' value="<?php echo $slug; ?>" /> 
     429                <?php if(in_array($slug, $wp_properties['geo_type_attributes'])): ?> 
     430                <div class="wpp_notice"> 
     431                  <span><?php _e('Attention! This attribute (slug) is used by Google Validator and Address Display functionality. It is set automaticaly and can not be edited on Property Adding/Updating page.','wpp'); ?></span> 
     432                </div> 
     433                <?php endif; ?> 
    362434              </li> 
    363435              <li> 
  • wp-property/trunk/core/ui/class_wpp_object_list_table.php

    r448681 r452292  
    154154         
    155155        case 'overview': 
     156               
    156157          $overview_stats = $wp_properties['property_stats']; 
    157158 
    158159          unset($overview_stats['phone_number']); 
    159160 
    160           // Not the best way of doing it, but better than nothing. 
    161           // We basically take all property stats, then dump everything too long and empty 
     161          $stat_count = 0; 
     162          $hidden_count = 0; 
     163           
    162164          foreach($overview_stats as $stat => $label) { 
    163165 
    164             if(empty($post->$stat) || strlen($post->$stat) > 15) 
     166            if(empty($post->$stat) || strlen($post->$stat) > 15) { 
    165167              continue; 
    166  
    167             $r .= "$label: " . apply_filters("wpp_stat_filter_$stat", $post->$stat) . " <br />"; 
    168  
    169           } 
     168            } 
     169             
     170            $stat_count++; 
     171             
     172            if($stat_count > 5) { 
     173              $stat_row_class = 'hidden wpp_overview_hidden_stats'; 
     174              $hidden_count++; 
     175            } 
     176             
     177            $display_stats[$stat] = '<li class="'.$stat_row_class.'"><span class="wpp_label">' . $label . ':</span> <span class="wpp_value">' . apply_filters("wpp_stat_filter_$stat", $post->$stat) . '</span></li>';; 
     178 
     179          } 
     180           
     181          if(is_array($display_stats) && count($display_stats) > 0) { 
     182           
     183            if($stat_count > 5) { 
     184              $display_stats['toggle_advanced'] = '<li class="wpp_show_advanced" advanced_option_class="wpp_overview_hidden_stats">' . sprintf(__('Toggle %1s more.', 'wpp'), $hidden_count) . '</li>'; 
     185            } 
     186             
     187            $r .= '<ul class="wpp_overview_column_stats wpp_something_advanced_wrapper">' . implode('', $display_stats) . '</ul>'; 
     188          } 
     189           
    170190        break; 
    171191         
     
    200220 
    201221          if(!empty($image_thumb_obj)) { 
    202             $r .= '<a href="'.$post->images['large'].'" class="fancybox" rel="overview_group" title="'.$post->post_title.'"> 
    203 <img src="'.$image_thumb_obj['url'].'" width="'.$image_thumb_obj['width'].'" height="'.$image_thumb_obj['height'].'" /> 
    204 </a>'; 
     222            $r .= '<a href="'.$post->images['large'].'" class="fancybox" rel="overview_group" title="'.$post->post_title.'"><img src="'.$image_thumb_obj['url'].'" width="'.$image_thumb_obj['width'].'" height="'.$image_thumb_obj['height'].'" /></a>'; 
    205223          } else { 
    206224            $r .= " - "; 
  • wp-property/trunk/core/ui/page_settings.php

    r448681 r452292  
    1818  
    1919 
    20 // Check if premium folder is writable 
    21 $wp_messages = WPP_F::check_premium_folder_permissions(); 
    22  
    23 if(isset($_REQUEST['message'])) { 
    24  
    25   switch($_REQUEST['message']) { 
     20  //** Check if premium folder is writable */ 
     21  $wp_messages = WPP_F::check_premium_folder_permissions(); 
     22 
     23  if(isset($_REQUEST['message'])) { 
     24 
     25    switch($_REQUEST['message']) { 
     26     
     27      case 'updated':     
     28      $wp_messages['notice'][] = __("Settings updated.", 'wpp'); 
     29      break; 
     30    } 
     31  } 
     32  $parseUrl = parse_url(trim(get_bloginfo('url'))); 
     33  $this_domain = trim($parseUrl['host'] ? $parseUrl['host'] : array_shift(explode('/', $parseUrl['path'], 2))); 
    2634   
    27     case 'updated':     
    28     $wp_messages['notice'][] = __("Settings updated.", 'wpp'); 
    29     break; 
     35  /** Check if custom css exists */ 
     36  if ( file_exists( STYLESHEETPATH . '/wp_properties.css') || file_exists( TEMPLATEPATH . '/wp_properties.css')) { 
     37    $using_custom_css = true; 
    3038  } 
    31 } 
    32     $parseUrl = parse_url(trim(get_bloginfo('url'))); 
    33     $this_domain = trim($parseUrl['host'] ? $parseUrl['host'] : array_shift(explode('/', $parseUrl['path'], 2))); 
    34     
     39  
    3540?> 
    3641 
     
    121126      }); 
    122127 
     128  });    
     129   
     130  //** Mass set property type */ 
     131  jQuery("#wpp_ajax_max_set_property_type").click(function() { 
     132   
     133    if(!confirm("<?php _e('You are about to set ALL your properties to the selected property type. Are you sure?', 'wpp'); ?>")) { 
     134      return; 
     135    } 
     136     
     137    var property_type = jQuery("#wpp_ajax_max_set_property_type_type").val(); 
     138 
     139    jQuery.post(ajaxurl, { 
     140      action: 'wpp_ajax_max_set_property_type', 
     141      property_type: property_type 
     142      }, function(data) { 
     143        jQuery("#wpp_ajax_max_set_property_type_result").show(); 
     144        jQuery("#wpp_ajax_max_set_property_type_result").html(data);  
     145      }); 
     146 
    123147  });  
    124148 
     
    301325        <ul> 
    302326          <li> 
    303           <?php echo WPP_UD_UI::checkbox("name=wpp_settings[configuration][autoload_css]&label=" . __('Automatically include default CSS.','wpp'), $wp_properties['configuration']['autoload_css']); ?> 
     327          <?php  
     328            if($using_custom_css) {  
     329              echo WPP_UD_UI::checkbox("name=wpp_settings[configuration][autoload_css]&label=" . __('Load default CSS. If unchecked, the wp-properties.css in your theme folder will not be loaded.','wpp'), $wp_properties['configuration']['autoload_css']);  
     330            } else { 
     331              echo WPP_UD_UI::checkbox("name=wpp_settings[configuration][autoload_css]&label=" . __('Load default CSS.','wpp'), $wp_properties['configuration']['autoload_css']); 
     332            } 
     333            ?> 
    304334          </li> 
    305335            
     
    682712         <input type="button" value="<?php _e('Revalidate','wpp');?>" id="wpp_ajax_revalidate_all_addresses"> 
    683713      </div> 
    684  
    685              
     714       
     715      <div class="wpp_settings_block"><?php _e('Set all properties to same property type:','wpp') ?> 
     716        <select id="wpp_ajax_max_set_property_type_type"> 
     717        <?php foreach($wp_properties['property_types'] as $p_slug => $p_label) { ?> 
     718        <option value="<?php echo $p_slug; ?>"><?php echo $p_label; ?></option> 
     719        <?php } ?> 
     720        <input type="button" value="<?php _e('Set','wpp') ?>" id="wpp_ajax_max_set_property_type"> 
     721        <pre id="wpp_ajax_max_set_property_type_result" class="wpp_class_pre hidden"></pre> 
     722      </div> 
     723       
    686724      <div class="wpp_settings_block"> 
    687725        <?php if(function_exists('memory_get_usage')): ?> 
  • wp-property/trunk/core/ui/property_metaboxes.php

    r448681 r452292  
    1818    if ($post_type_object->hierarchical) { 
    1919      $pages = wp_dropdown_pages(array('post_type' => $post->post_type, 'exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('(no parent)', 'wpp'), 'sort_column' => 'menu_order, post_title', 'echo' => 0)); 
    20       if (!empty($pages)) { 
    21         ?> 
    22  
    23  
     20      if (!empty($pages)) { ?> 
    2421 
    2522        <p><strong><?php _e('Parent', 'wpp') ?></strong></p> 
     
    6764      $this_property_type = WPP_F::get_most_common_property_type(); 
    6865    } 
     66     
     67    //** Check for current property type if it is deleted */     
     68    if(is_array($wp_properties['property_types']) && isset($property['property_type']) && !in_array($property['property_type'], array_keys($wp_properties['property_types']))) {       
     69      $wp_properties['property_types'][$property['property_type']] =  WPP_UD_F::de_slug($property['property_type']); 
     70      $wp_properties['descriptions']['property_type'] = '<span class="attention">' . sprintf(__('<strong>Warning!</strong> The %1s property type has been deleted.', 'wpp'), $wp_properties['property_types'][$property['property_type']]) . '</span>'; 
     71    } 
     72     
    6973    ?> 
    7074     
     
    218222          </tr> 
    219223        <?php endif; ?> 
    220          
     224   
    221225        <?php if(count($wp_properties['property_types']) > 1) { ?> 
    222226        <tr class="wpp_attribute_row_type wpp_attribute_row <?php if (is_array($wp_properties['hidden_attributes'][$property['property_type']]) && in_array('type', $wp_properties['hidden_attributes'][$property['property_type']])) echo 'disabled_row;'; ?>"> 
     
    285289            ?> 
    286290             
    287             <?php //* Check if attribute has predefine values */ ?> 
    288             <?php if (!empty($wp_properties['predefined_values'][$slug])) : ?> 
    289               <?php $predefined_values = str_replace(array(', ', ' ,'), array(',', ','), trim($wp_properties['predefined_values'][$slug])); ?> 
    290               <?php if ($predefined_values == 'true,false' || $predefined_values == 'false,true') : ?> 
    291                 <?php echo apply_filters("wpp_property_stats_input_$slug", "<input type='hidden' name='wpp_data[meta][{$slug}]' value='false' /><input " . checked($value, 'true', false) . "type='checkbox' id='wpp_meta_{$slug}' name='wpp_data[meta][{$slug}]' value='true' /> <label for='wpp_meta_{$slug}'>" . __('Enable.', 'wpp') . "</label>", $slug, $property); ?> 
     291            <?php //* Determine if the current attribute is geo type, it will be disabled */ ?> 
     292            <?php if(in_array($slug, (array)$wp_properties['geo_type_attributes'])) : ?> 
     293              <?php echo apply_filters("wpp_property_stats_input_$slug", "<input type='text' id='wpp_meta_{$slug}' name='wpp_data[meta][{$slug}]' class='text-input wpp_field_disabled {$attribute_data['ui_class']}' value='{$value}' disabled='disabled' />", $slug, $property); ?> 
     294            <?php else : ?> 
     295              <?php //* Check if attribute has predefine values */ ?> 
     296              <?php if (!empty($wp_properties['predefined_values'][$slug])) : ?> 
     297                <?php $predefined_values = str_replace(array(', ', ' ,'), array(',', ','), trim($wp_properties['predefined_values'][$slug])); ?> 
     298                <?php if ($predefined_values == 'true,false' || $predefined_values == 'false,true') : ?> 
     299                  <?php echo apply_filters("wpp_property_stats_input_$slug", "<input type='hidden' name='wpp_data[meta][{$slug}]' value='false' /><input " . checked($value, 'true', false) . "type='checkbox' id='wpp_meta_{$slug}' name='wpp_data[meta][{$slug}]' value='true' {$disabled} /> <label for='wpp_meta_{$slug}'>" . __('Enable.', 'wpp') . "</label>", $slug, $property); ?> 
     300                <?php else : ?> 
     301                  <?php foreach (explode(',', $predefined_values) as $option) : ?> 
     302                    <?php $predefined_options[$slug][] = "<option " . selected(esc_attr(trim($value)), esc_attr(trim(str_replace('-', '&ndash;', $option))), false) . " value='" . esc_attr($option) . "'>" . trim(esc_attr($option)) . "</option>"; ?> 
     303                  <?php endforeach; ?> 
     304                  <?php echo apply_filters("wpp_property_stats_input_$slug", "<select id='wpp_meta_{$slug}' name='wpp_data[meta][{$slug}]'><option value=''> - </option>" . implode($predefined_options[$slug]) . "</select>", $slug, $property); ?> 
     305                <?php endif; ?> 
    292306              <?php else : ?> 
    293                 <?php foreach (explode(',', $predefined_values) as $option) : ?> 
    294                   <?php $predefined_options[$slug][] = "<option " . selected(esc_attr(trim($value)), esc_attr(trim(str_replace('-', '&ndash;', $option))), false) . " value='" . esc_attr($option) . "'>" . trim(esc_attr($option)) . "</option>"; ?> 
    295                 <?php endforeach; ?> 
    296                 <?php echo apply_filters("wpp_property_stats_input_$slug", "<select id='wpp_meta_{$slug}' name='wpp_data[meta][{$slug}]'><option value=''> - </option>" . implode($predefined_options[$slug]) . "</select>", $slug, $property); ?> 
     307                <?php echo apply_filters("wpp_property_stats_input_$slug", "<input type='text' id='wpp_meta_{$slug}' name='wpp_data[meta][{$slug}]' class='text-input {$attribute_data[ui_class]}' value=\"{$value}\" />", $slug, $property); ?> 
    297308              <?php endif; ?> 
    298             <?php else : ?> 
    299               <?php echo apply_filters("wpp_property_stats_input_$slug", "<input type='text' id='wpp_meta_{$slug}' name='wpp_data[meta][{$slug}]'  class='text-input {$attribute_data[ui_class]}' value=\"{$value}\" />", $slug, $property); ?> 
    300309            <?php endif; ?> 
    301310             
     
    347356 
    348357      <?php 
    349       /* 
    350         echo "<pre>"; 
    351         print_r($filters); 
    352         echo "</pre>"; 
    353        */ 
    354       ?> 
    355  
    356  
    357       <?php 
    358358      if (!empty($filters)) { 
    359359        foreach ($filters as $key => $filter) { 
  • wp-property/trunk/css/wp_properties_admin.css

    r448681 r452292  
     1.wpp_notice { 
     2  display:block; 
     3  font-size:11px; 
     4  border:1px dashed #DFDFDF; 
     5} 
     6 
     7input.wpp_field_disabled, 
     8select.wpp_field_disabled { 
     9  background-color: #f3f3f3; 
     10} 
     11 
    112.wpp_post_status_trash { 
    213  text-decoration: line-through; 
     
    303314} 
    304315 
    305  
    306   
     316#wpp_inquiry_attribute_fields .wpp_notice { 
     317  width:96%; 
     318  margin-top:5px; 
     319  color: #b68282; 
     320  border-color: #b68282; 
     321} 
     322#wpp_inquiry_attribute_fields .wpp_notice span { 
     323  display:block; 
     324  padding:5px; 
     325} 
    307326 
    308327#metabox_profile_images .inside { 
     
    398417  cursor: pointer; 
    399418  border-color: #BBBBBB; 
    400    background-color: #FFFFFF; 
     419  background-color: #FFFFFF; 
    401420  color: #464646; 
    402     -moz-box-sizing: content-box; 
    403     border-radius: 8px; 
    404     border-style: solid; 
    405     border-width: 1px; 
    406     cursor: pointer; 
    407     font-size: 12px; 
    408     line-height: 13px; 
    409     padding: 3px 8px; 
    410     text-decoration: none;   
     421  -moz-box-sizing: content-box; 
     422  border-radius: 8px; 
     423  border-style: solid; 
     424  border-width: 1px; 
     425  cursor: pointer; 
     426  font-size: 12px; 
     427  line-height: 13px; 
     428  padding: 3px 8px; 
     429  text-decoration: none;   
    411430} 
    412431 
     
    489508td.wpp_attribute_group_col { 
    490509  width:20px !important; 
    491   position:relative; 
    492510} 
    493511 
     
    510528} 
    511529 
    512 #wpp_dialog_wrapper { 
     530#wpp_dialog_wrapper, 
     531#wpp_dialog_wrapper_for_groups { 
    513532  display: none; 
    514533  position:fixed; 
  • wp-property/trunk/default_api.php

    r448681 r452292  
    11<?php 
     2 
     3  /* add_filter('wpp_get_property', array('wpp_default_api', 'maybe_load_map_press_data')); */ 
     4   
     5  class wpp_default_api { 
     6   
     7    function maybe_load_map_press_data ($property) { 
     8      global $wpdb, $wp_properties; 
     9       
     10      $property = (array) $property; 
     11      $property_id = $property['ID']; 
     12      $address_attribute = $wp_properties['configuration']['address_attribute']; 
     13       
     14      if(!empty($address_attribute) || !empty($property[$address_attribute])) { 
     15        return $property; 
     16      } 
     17       
     18      if($obj = $wpdb->get_var("SELECT obj FROM {$wpdb->prefix}mappress_posts mpp LEFT JOIN {$wpdb->prefix}mappress_maps mpm ON mpp.mapid = mpm.mapid WHERE postid = '{$property_id}'")) { 
     19        $obj = maybe_unserialize($obj); 
     20        if($obj->pois) { 
     21         
     22          foreach($obj->pois as $map_entry) { 
     23           
     24            if(!empty($map_entry->point['lat']) && empty($property['latitude'])) { 
     25              $map_data['latitude'] = $map_entry->point['lat']; 
     26            } 
     27            if(!empty($map_entry->point['lng']) && empty($property['longitude'])) { 
     28              $map_data['longitude'] = $map_entry->point['lng']; 
     29            } 
     30  
     31            if(!empty($map_entry->correctedAddress) && empty($property[$address_attribute])) { 
     32              $map_data[$address_attribute] = $map_entry->correctedAddress;             
     33            } 
     34             
     35            if(!empty($map_data)) {             
     36              return array_merge($property, $map_data); 
     37            } 
     38            
     39           
     40          } 
     41         
     42        }         
     43      } 
     44       
     45      return $property; 
     46       
     47    } 
     48   
     49  } 
    250 
    351  // Widget address format 
     
    171219 
    172220      // Remove line if comma is first character 
    173       if(strlen($line) < 3 && (strpos($line, ',') === 1 || strpos($line, ',') === 0)) 
     221      if(strlen($line) < 3 && (strpos($line, ',') === 1 || strpos($line, ',') === 0)) { 
    174222        continue; 
     223      } 
    175224 
    176225      $return[] = $line; 
     
    688737  } 
    689738 
    690  
    691   ?> 
     739   
  • wp-property/trunk/js/fileuploader.js

    r448681 r452292  
    256256        params: {}, 
    257257        button: null, 
    258         multiple: true, 
     258        multiple: false, 
    259259        maxConnections: 3, 
    260260        // validation         
    261         allowedExtensions: [],                
     261        allowedExtensions: ['jpg','gif','png'],                
    262262        sizeLimit: 0,    
    263263        minSizeLimit: 0,                              
     
    487487        template: '<div class="qq-uploader">' +  
    488488                '<div class="qq-upload-drop-area"><span>'+l10n.drop_file+'</span></div>' + 
    489                 '<div class="qq-upload-button">Upload a file</div>' + 
     489                '<div class="qq-upload-button">'+l10n.upload_images+'</div>' + 
    490490                '<ul class="qq-upload-list"></ul>' +  
    491491             '</div>', 
  • wp-property/trunk/js/wp-property-admin-overview.js

    r442860 r452292  
    44*/ 
    55 
    6 jQuery(document).ready(function() {  
     6jQuery(document).ready(function() {   
     7 
    78  admin_overview_init(); 
    89   
     
    3233function admin_overview_init() { 
    3334   
    34   jQuery(".fancybox").fancybox({ 
    35         'transitionIn'  :   'elastic', 
    36         'transitionOut' :   'elastic', 
    37         'speedIn'       :   600,  
    38         'speedOut'      :   200,  
    39         'overlayShow'   :   false 
    40     }); 
     35  /* Load fancybox if it exists */ 
     36  if(typeof fancybox == 'function') {  
     37    jQuery(".fancybox").fancybox({ 
     38      'transitionIn'  :  'elastic', 
     39      'transitionOut'  :  'elastic', 
     40      'speedIn'    :  600,  
     41      'speedOut'    :  200,  
     42      'overlayShow'  :  false 
     43    });   
     44  } 
    4145 
    4246 
    43     // Toggle Featured Setting 
    44      
    45     jQuery(".wpp_featured_toggle").click(function(){ 
    46          
    47         var button_id   = jQuery(this).attr("id"); 
    48         var post_id     = button_id.replace('wpp_feature_', ''); 
    49         var _wpnonce = jQuery(this).attr("nonce"); 
    50          
    51         jQuery.post( 
    52             ajaxurl, 
    53             { 
    54                 post_id: post_id, 
    55                 action: 'wpp_make_featured', 
    56                 _wpnonce: _wpnonce               
    57             }, 
    58             function(data) { 
    59              
    60                 var button = jQuery("#wpp_feature_" + data.post_id); 
    61                 if(data.status == 'featured') { 
    62                     jQuery(button).val("Featured"); 
    63                     jQuery(button).addClass('wpp_is_featured'); 
    64                 } 
    65                 if(data.status == 'not_featured') { 
    66                     jQuery(button).val("Feature"); 
    67                     jQuery(button).removeClass('wpp_is_featured'); 
    68                 } 
    69                  
    70             }, 
    71             'json' 
    72             ); 
    73              
    74          
    75     }); 
     47  // Toggle Featured Setting 
     48   
     49  jQuery(".wpp_featured_toggle").click(function(){ 
     50     
     51    var button_id   = jQuery(this).attr("id"); 
     52    var post_id   = button_id.replace('wpp_feature_', ''); 
     53    var _wpnonce = jQuery(this).attr("nonce"); 
     54     
     55    jQuery.post( 
     56      ajaxurl, 
     57      { 
     58        post_id: post_id, 
     59        action: 'wpp_make_featured', 
     60        _wpnonce: _wpnonce         
     61      }, 
     62      function(data) { 
     63       
     64        var button = jQuery("#wpp_feature_" + data.post_id); 
     65         if(data.status == 'featured') { 
     66          jQuery(button).val("Featured"); 
     67          jQuery(button).addClass('wpp_is_featured'); 
     68         } 
     69        if(data.status == 'not_featured') { 
     70          jQuery(button).val("Feature"); 
     71          jQuery(button).removeClass('wpp_is_featured'); 
     72         } 
     73         
     74      }, 
     75      'json' 
     76      ); 
     77       
     78     
     79  }); 
    7680   
    7781} 
  • wp-property/trunk/js/wp-property-global.js

    r448681 r452292  
    11/** 
    2  * WP-Property Global Admin Scripts 
     2 * WP-Property Global Scripts 
    33 * 
    4  * This file is included on all back-end pages, so extra care needs be taken to avoid conflicts 
     4 * This file is included on all back-end and front-end pages. 
    55 * 
    66*/ 
    77 
    8 /* 
    9  * Assign Property Stat to Group Functionality 
    10  * 
    11  * @param object opt Params 
    12  * @author Maxim Peshkov 
    13  */ 
    14 jQuery.fn.wppGroups = function(opt) { 
    15   var 
    16   instance = jQuery(this), 
    17   //* Default params */ 
    18   defaults = { 
    19     groupsBox: '#wpp_attribute_groups', 
    20     groupWrapper: '#wpp_dialog_wrapper', 
    21     closeButton: '.wpp_close_dialog', 
    22     assignButton: '.wpp_assign_to_group', 
    23     unassignButton: '.wpp_unassign_from_group', 
    24     removeButton: '.wpp_delete_row', 
    25     sortButton: "#sort_stats_by_groups" 
    26   }; 
    27  
    28   opt = jQuery.extend({}, defaults, opt); 
    29  
    30   //* Determine if dialog Wrapper exist */ 
    31   if(!jQuery(opt.groupWrapper).length > 0) { 
    32     jQuery('body').append('<div id="wpp_dialog_wrapper"></div>'); 
    33   } 
    34  
    35   var 
    36   groupsBlock = jQuery(opt.groupsBox), 
    37   sortButton = jQuery(opt.sortButton), 
    38   statsRow = instance.parent().parent(), 
    39   statsTable = instance.parents('#wpp_inquiry_attribute_fields'), 
    40   close = jQuery(opt.closeButton, groupsBlock), 
    41   assign = jQuery(opt.assignButton), 
    42   unassign = jQuery(opt.unassignButton), 
    43   wrapper = jQuery(opt.groupWrapper), 
    44   colorpicker = jQuery('input.wpp_input_colorpicker', groupsBlock), 
    45   groupname = jQuery('input.slug_setter', groupsBlock), 
    46   remove = jQuery(opt.removeButton, groupsBlock), 
    47   sortButton = jQuery(opt.sortButton), 
    48  
    49   //* Open Groups Block */ 
    50   showGroupBox = function() { 
    51     groupsBlock.show(300); 
    52     wrapper.css('display','block'); 
    53   }, 
    54  
    55   //* Close Groups Block */ 
    56   closeGroupBox = function () { 
    57     groupsBlock.hide(300); 
    58     wrapper.css('display','none'); 
    59  
    60     statsRow.each(function(i, e){ 
    61       jQuery(e).removeClass('groups_active'); 
    62     }) 
    63   }; 
    64  
    65   //* EVENTS */ 
    66   instance.live('click', function(){ 
    67     showGroupBox(); 
    68     jQuery(this).parent().parent().addClass('groups_active'); 
    69   }); 
    70  
    71   instance.live('focus', function(){ 
    72     jQuery(this).trigger('blur'); 
    73   }); 
    74  
    75   //* Close Group Box */ 
    76   close.live('click', function(){ 
    77     closeGroupBox(); 
    78   }); 
    79  
    80   //* Assign attribute to Group */ 
    81   assign.live('click', function(){ 
    82     var row = jQuery(this).parent().parent(); 
    83     statsRow.each(function(i,e){ 
    84       if(jQuery(e).hasClass('groups_active')) { 
    85         jQuery(e).css('background-color', jQuery('input.wpp_input_colorpicker' , row).val()); 
    86         jQuery(e).attr('wpp_attribute_group' , row.attr('slug')); 
    87         jQuery('input.wpp_group_slug' , e).val(row.attr('slug')); 
    88          
    89         var groupName = jQuery('input.slug_setter' , row).val(); 
    90         if(groupName == '') { 
    91           groupName = 'NO NAME'; 
    92         } 
    93          
    94         jQuery('input.wpp_attribute_group' , e).val(groupName); 
    95       } 
    96     }); 
    97     closeGroupBox(); 
    98   }); 
    99  
    100   //* Unassign attribute from Group */ 
    101   unassign.live('click', function(){ 
    102     statsRow.each(function(i,e){ 
    103       if(jQuery(e).hasClass('groups_active')) { 
    104         jQuery(e).css('background-color', ''); 
    105         jQuery(e).removeAttr('wpp_attribute_group'); 
    106         jQuery('input.wpp_group_slug' , e).val(''); 
    107         jQuery('input.wpp_attribute_group' , e).val(''); 
    108       } 
    109     }); 
    110     closeGroupBox(); 
    111   }); 
    112  
    113   //* Refresh background of all attributes on color change */ 
    114   colorpicker.live('change', function(){ 
    115     var cp = jQuery(this); 
    116     var s = cp.parent().parent().attr('slug'); 
    117     instance.each(function(i,e){ 
    118       if(s == jQuery(e).next().val()) { 
    119         jQuery(e).parent().parent().css('background-color', cp.val()); 
    120       } 
    121     }); 
    122   }); 
    123  
    124   //* Refresh Group Name field of all assigned attributes on group name change */ 
    125   groupname.live('change', function(){ 
    126     var gn = ( jQuery(this).val() != '' ) ? jQuery(this).val() : 'NO NAME'; 
    127     var s = jQuery(this).parent().parent().attr('slug'); 
    128     instance.each(function(i,e){ 
    129       if(s == jQuery(e).next().val()) { 
    130         jQuery(e).val(gn); 
    131       } 
    132     }); 
    133   }); 
    134    
    135   //* Remove group from the list */ 
    136   remove.live('click', function(){ 
    137     var s = jQuery(this).parent().parent().attr('slug'); 
    138     instance.each(function(i,e){ 
    139       if(s == jQuery(e).next().val()) { 
    140         jQuery(e).parent().parent().css('background-color', ''); 
    141         jQuery(e).val(''); 
    142         jQuery(e).next().val(''); 
    143       } 
    144     }); 
    145   }); 
    146  
    147   //* Close Groups Box on wrapper click */ 
    148   wrapper.live('click', function(){ 
    149     closeGroupBox(); 
    150   }); 
    151  
    152   //* Sorts all attributes by Groups */ 
    153   sortButton.live('click', function(){ 
    154     jQuery('tbody tr' , groupsBlock).each(function(gi,ge){ 
    155       statsRow.each(function(si,se){ 
    156         if(typeof jQuery(se).attr('wpp_attribute_group') != 'undefined') { 
    157           if(jQuery(se).attr('wpp_attribute_group') == jQuery(ge).attr('slug')) { 
    158             jQuery(se).attr('sortpos', (gi + 1)); 
    159           } 
    160         } else { 
    161           jQuery(se).attr('sortpos', '9999'); 
    162         } 
    163       }); 
    164     }); 
    165     var sortlist = jQuery('tbody' , statsTable); 
    166     var listitems = sortlist.children('tr').get(); 
    167     listitems.sort(function(a, b) { 
    168         var compA = parseFloat(jQuery(a).attr('sortpos')); 
    169         var compB = parseFloat(jQuery(b).attr('sortpos')); 
    170         return (compA < compB) ? -1 : (compA > compB) ? 1 : 0; 
    171     }); 
    172     jQuery.each(listitems, function(idx, itm) { 
    173       sortlist.append(itm); 
    174     }); 
    175   }); 
    176 } 
    177  
    178 /* 
    179  * Basic e-mail validation 
    180  */ 
    181 function wpp_validate_email(address) { 
    182    var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; 
    183  
    184    if(reg.test(address) == false) { 
    185       return false; 
    186    } else { 
    187     return true; 
    188    } 
    189 } 
    190  
    191 /* 
    192  * Bind ColorPicker with input fields '.wpp_input_colorpicker' 
    193  * @param object instance. jQuery object 
    194  */ 
    195 var bindColorPicker = function(instance){ 
    196   if(typeof window.jQuery.prototype.ColorPicker == 'function') { 
    197     if(!instance) { 
    198       instance = jQuery('body'); 
    199     } 
    200     jQuery('.wpp_input_colorpicker', instance).ColorPicker({ 
    201       onSubmit: function(hsb, hex, rgb, el) { 
    202         jQuery(el).val('#' + hex); 
    203         jQuery(el).ColorPickerHide(); 
    204         jQuery(el).trigger('change'); 
    205       }, 
    206       onBeforeShow: function () { 
    207         jQuery(this).ColorPickerSetColor(this.value); 
    208       } 
    209     }) 
    210     .bind('keyup', function(){ 
    211       jQuery(this).ColorPickerSetColor(this.value); 
    212     }); 
    213   } 
    214 } 
    215  
    216 /* 
    217  * Updates Row field names 
    218  * @param object instance. DOM element 
    219  * @param boolean allowRandomSlug. Determine if Row can contains random slugs. 
    220  */ 
    221 var updateRowNames = function(instance, allowRandomSlug) { 
    222   if(typeof instance == 'undefined') { 
    223     return false; 
    224   } 
    225   if(typeof allowRandomSlug == 'undefined') { 
    226     var allowRandomSlug = false; 
    227   } 
    228    
    229   var this_row = jQuery(instance).parents('tr.wpp_dynamic_table_row'); 
    230   // Slug of row in question 
    231   var old_slug = jQuery(this_row).attr('slug'); 
    232   // Get data from input.slug_setter 
    233   var new_slug = jQuery(instance).val(); 
    234   // Convert into slug 
    235   var new_slug = wpp_create_slug(new_slug); 
    236    
    237   // Don't allow to blank out slugs 
    238   if(new_slug == "") { 
    239     if(allowRandomSlug) { 
    240       new_slug = 'random_' + Math.floor(Math.random()*1000); 
    241     } else { 
    242       return; 
    243     } 
    244   } 
    245    
    246   // If slug input.slug exists in row, we modify it 
    247   jQuery(".slug" , this_row).val(new_slug); 
    248   // Update row slug 
    249   jQuery(this_row).attr('slug', new_slug); 
    250    
    251   // Cycle through all child elements and fix names 
    252   jQuery('input,select,textarea', this_row).each(function(i,e) { 
    253     var old_name = jQuery(e).attr('name'); 
    254     if (typeof old_name != 'undefined' && !jQuery(e).hasClass('wpp_no_change_name')) { 
    255       var new_name =  old_name.replace('['+old_slug+']','['+new_slug+']'); 
    256       if(jQuery(e).attr('id')) { 
    257         var old_id = jQuery(e).attr('id'); 
    258         var new_id =  old_id.replace('['+old_slug+']','['+new_slug+']'); 
    259       } 
    260       // Update to new name 
    261       jQuery(e).attr('name', new_name); 
    262       jQuery(e).attr('id', new_id); 
    263     } 
    264   }); 
    265    
    266   // Cycle through labels too 
    267   jQuery('label', this_row).each(function(i,e) { 
    268     if(jQuery(e).attr('id')) { 
    269       var old_for = jQuery(e).attr('for'); 
    270       var new_for =  old_for.replace(old_slug,new_slug); 
    271       // Update to new name 
    272       jQuery(e).attr('for', new_for); 
    273     } 
    274   }); 
    275    
    276   jQuery(".slug" , this_row).trigger('change'); 
    277 } 
    278  
    279  
    280 /** 
    281   * Toggle advanced options that are somehow related to the clicked trigger 
    282   * 
    283   * If trigger element has an attr of 'show_type_source', then function attempt to find that element and get its value 
    284   * if value is found, that value is used as an additional requirement when finding which elements to toggle 
    285   * 
    286   * Example: <span class="wpp_show_advanced" show_type_source="id_of_input_with_a_string" advanced_option_class="class_of_elements_to_trigger" show_type_element_attribute="attribute_name_to_match">Show Advanced</span> 
    287   * The above, when clicked, will toggle all elements within the same parent tree of cicked element, with class of "advanced_option_class" and with attribute of "show_type_element_attribute" the equals value of "#id_of_input_with_a_string" 
    288   *  
    289   * Clicking the trigger in example when get the value of: 
    290   * <input id="value_from_source_element" value="some_sort_of_identifier" /> 
    291   *  
    292   * And then toggle all elements like below: 
    293   * <li class="class_of_elements_to_trigger" attribute_name_to_match="some_sort_of_identifier">Data that will be toggled.</li> 
    294   * 
    295   * Copyright 2011 Usability Dynamics, Inc. <info@usabilitydynamics.com> 
    296   */ 
    297   function toggle_advanced_options() { 
    298  
    299     jQuery(".wpp_show_advanced").live("click", function() { 
    300  
    301       var advanced_option_class = false; 
    302       var show_type = false; 
    303       var show_type_element_attribute = false; 
    304  
    305       /* Try getting arguments automatically */ 
    306       var wrapper = jQuery(this).parents('tr.wpp_dynamic_table_row'); 
    307        
    308       if(jQuery(this).attr("advanced_option_class") !== undefined) { 
    309         var advanced_option_class = "." + jQuery(this).attr("advanced_option_class"); 
    310       }     
    311        
    312       if(jQuery(this).attr("show_type_element_attribute") !== undefined) { 
    313         var show_type_element_attribute = jQuery(this).attr("show_type_element_attribute"); 
    314       }     
    315  
    316       /* If no advanced_option_class is found in attribute, we default to 'wpp_development_advanced_option' */ 
    317       if(!advanced_option_class) { 
    318          advanced_option_class = "li.wpp_development_advanced_option"; 
    319       }    
    320  
    321       /* If element does not have a table row wrapper, we look for the closts .wpp_something_advanced_wrapper wrapper */ 
    322       if(wrapper.length == 0) { 
    323         var wrapper = jQuery(this).parents('.wpp_something_advanced_wrapper'); 
    324       } 
    325  
    326       /* get_show_type_value forces the a look up a value of a passed element, ID of which is passed, which is then used as another conditional argument */ 
    327       if(show_type_source = jQuery(this).attr("show_type_source")) { 
    328         var source_element = jQuery("#" + show_type_source); 
    329  
    330         if(source_element) { 
    331           /* Element found, determine type and get current value */ 
    332  
    333           if(jQuery(source_element).is("select")) { 
    334             show_type = jQuery("option:selected", source_element).val(); 
    335           } 
    336         } 
    337       } 
    338        
    339       if(!show_type) { 
    340         jQuery(advanced_option_class, wrapper).toggle(); 
    341         return; 
    342       } 
    343  
    344       //** Look for advanced options with show type */ 
    345       if(show_type) { 
    346         jQuery(advanced_option_class + "[" + show_type_element_attribute + "='"+show_type+"']", wrapper).toggle(); 
    347         return; 
    348       } 
    349  
    350  
    351     }); 
    352   } 
    353  
    354 jQuery(document).ready(function() { 
    355  
    356   toggle_advanced_options(); 
    357    
    358   //* Easy way of displaying the contextual help dropdown */ 
    359   jQuery(".wpp_toggle_contextual_help").live("click", function () { 
    360     wpp_toggle_contextual_help(this); 
    361   }); 
    362    
    363   // Toggle wpp_wpp_settings_configuration_do_not_override_search_result_page_ 
    364   jQuery("#wpp_wpp_settings_configuration_automatically_insert_overview_").change(function() { 
    365     if(jQuery(this).is(":checked")) { 
    366       jQuery("li.wpp_wpp_settings_configuration_do_not_override_search_result_page_row").hide(); 
    367     } else { 
    368       jQuery("li.wpp_wpp_settings_configuration_do_not_override_search_result_page_row").show(); 
    369     } 
    370   }); 
    371    
    372   // Bind (Set) ColorPicker 
    373   bindColorPicker(); 
    374    
    375   // Add row to UD UI Dynamic Table 
    376   jQuery(".wpp_add_row").live("click" , function() { 
    377     wpp_add_row(this); 
    378   }); 
    379    
    380   // When the .slug_setter input field is modified, we update names of other elements in row 
    381   jQuery(".wpp_dynamic_table_row[new_row=true] input.slug_setter").live("keyup", function() { 
    382     updateRowNames(this); 
    383   }); 
    384   jQuery(".wpp_dynamic_table_row[new_row=true] select.slug_setter").live("change", function() { 
    385     updateRowNames(this); 
    386   }); 
    387    
    388   // Delete dynamic row 
    389   jQuery(".wpp_delete_row").live("click", function() { 
    390     var parent = jQuery(this).parents('tr.wpp_dynamic_table_row'); 
    391     var row_count = jQuery(".wpp_delete_row:visible").length; 
    392     if(jQuery(this).attr('verify_action') == 'true') { 
    393       if(!confirm('Are you sure?')) 
    394         return false; 
    395     } 
    396     // Blank out all values 
    397     jQuery("input[type=text]", parent).val(''); 
    398     jQuery("input[type=checkbox]", parent).attr('checked', false); 
    399     // Don't hide last row 
    400     if(row_count > 1) { 
    401       jQuery(parent).hide(); 
    402       jQuery(parent).remove(); 
    403     } 
    404   }); 
    405  
    406   jQuery('.wpp_attach_to_agent').live('click', function(){ 
    407     var agent_image_id = jQuery(this).attr('id'); 
    408     if (agent_image_id != '') 
    409       jQuery('#library-form').append('<input name="wpp_agent_post_id" type="text" value="' + agent_image_id + '" />').submit(); 
    410   }); 
    411  
    412   //* Add Sort functionality to Table */ 
    413   if(typeof jQuery.fn.sortable == 'function') { 
    414     jQuery('table.wpp_sortable tbody').sortable(); 
    415     jQuery('table.wpp_sortable tbody tr').live("mouseover mouseout", function(event) { 
    416       if ( event.type == "mouseover" ) { 
    417         jQuery(this).addClass("wpp_draggable_handle_show"); 
    418       } else { 
    419         jQuery(this).removeClass("wpp_draggable_handle_show"); 
    420       } 
    421     }); 
    422   } 
    423 }); 
    424  
    425  
    426 function wpp_create_slug(slug) { 
    427  
    428  
    429     slug = slug.replace(/[^a-zA-Z0-9_\s]/g,""); 
    430     slug = slug.toLowerCase(); 
    431     slug = slug.replace(/\s/g,'_'); 
    432  
    433     return slug; 
    434 } 
    435  
    436 function wpp_add_row(element) { 
    437  
    438     var auto_increment = false; 
    439     var table = jQuery(element).parents('.ud_ui_dynamic_table'); 
    440     var table_id = jQuery(table).attr("id"); 
    441  
    442  
    443     // Determine if table rows are numeric 
    444     if(jQuery(table).attr('auto_increment') == 'true') { 
    445       var auto_increment = true; 
    446     } else if (jQuery(table).attr('use_random_row_id') == 'true') { 
    447       var use_random_row_id = true; 
    448     } else if (jQuery(table).attr('allow_random_slug') == 'true') { 
    449       var allow_random_slug = true; 
    450     } 
    451      
    452     // Clone last row 
    453     var cloned = jQuery(".wpp_dynamic_table_row:last", table).clone(); 
    454  
    455     // Insert new row after last one 
    456     jQuery(cloned).appendTo(table); 
    457  
    458     // Get Last row to update names to match slug 
    459     var added_row = jQuery(".wpp_dynamic_table_row:last", table); 
    460     added_row.trigger('added'); 
    461      
    462     // Bind (Set) ColorPicker with new fields '.wpp_input_colorpicker' 
    463     bindColorPicker(added_row); 
    464     // Display row just in case 
    465     jQuery(added_row).show(); 
    466  
    467     // Blank out all values 
    468     jQuery("textarea", added_row).val(''); 
    469     jQuery("select", added_row).val(''); 
    470     jQuery("input[type=text]", added_row).val(''); 
    471     jQuery("input[type=checkbox]", added_row).attr('checked', false); 
    472  
    473     // Increment name value automatically 
    474     if(auto_increment) { 
    475       // Cycle through all child elements and fix names 
    476       jQuery('input,select,textarea', added_row).each(function(element) { 
    477       var old_name = jQuery(this).attr('name'); 
    478  
    479       var matches = old_name.match(/\[(\d{1,2})\]/); 
    480  
    481       if (matches) { 
    482         old_count = parseInt(matches[1]); 
    483         new_count = (old_count + 1); 
    484       } 
    485       var new_name =  old_name.replace('[' + old_count + ']','[' + new_count + ']'); 
    486  
    487       // Update to new name 
    488       jQuery(this).attr('name', new_name); 
    489  
    490       }); 
    491  
    492     } else if (use_random_row_id){ 
    493       /* Get the current random id of row */ 
    494       var random_row_id = jQuery(added_row).attr('random_row_id'); 
    495       var new_random_row_id = Math.floor(Math.random()*1000) 
    496  
    497  
    498      // Cycle through all child elements and fix names 
    499       jQuery('input,select,textarea', added_row).each(function(element) { 
    500       var old_name = jQuery(this).attr('name'); 
    501       var new_name =  old_name.replace('[' + random_row_id + ']','[' + new_random_row_id + ']'); 
    502  
    503       // Update to new name 
    504       jQuery(this).attr('name', new_name); 
    505  
    506       }); 
    507  
    508       jQuery(added_row).attr('random_row_id', new_random_row_id); 
    509  
    510  
    511     } else if (allow_random_slug){ 
    512       // Update Row names 
    513       var slug_setter = jQuery("input.slug_setter", added_row); 
    514       if(slug_setter.length > 0) { 
    515         updateRowNames(slug_setter.get(0), true); 
    516       } 
    517     } 
    518  
    519     // Unset 'new_row' attribute 
    520     jQuery(added_row).attr('new_row', 'true'); 
    521  
    522     // Focus on new element 
    523     jQuery('input.slug_setter', added_row).focus(); 
    524  
    525     if (callback_function = jQuery(element).attr("callback_function")) { 
    526       wpp_call_function(callback_function, window, added_row); 
    527     } 
    528  
    529  
    530     return added_row; 
    531  
    532 } 
    533  
    534  
    535   /* Slides down WP contextual help, and if 'wpp_scroll_to' attribute exists, scroll to it.*/ 
    536   function wpp_toggle_contextual_help(element) { 
    537  
    538     panel = jQuery("#contextual-help-wrap"); 
    539     link = jQuery("#contextual-help-link-wrap"); 
    540      
    541     console.log(panel); 
    542      
    543     if ( panel.is(':visible') ) {     
    544      
    545       panel.slideUp( 'fast', function() { 
    546         link.removeClass('screen-meta-active'); 
    547         jQuery('.screen-meta-toggle').css('visibility', ''); 
    548       });     
    549        
    550       jQuery(wpp_scroll_to).removeClass('wpp_contextual_highlight'); 
    551        
    552       return; 
    553      
    554     } else { 
    555       panel.slideDown( 'fast', function() { 
    556         link.addClass('screen-meta-active'); 
    557       });     
    558     } 
    559      
    560     if(jQuery(element).attr('wpp_scroll_to')) { 
    561          
    562       var wpp_scroll_to = jQuery(element).attr('wpp_scroll_to'); 
    563        
    564       if(jQuery(wpp_scroll_to).length) { 
    565        
    566        jQuery('html, body').animate({ 
    567          scrollTop: jQuery(wpp_scroll_to).offset().top 
    568         }, 1000); 
    569          
    570        jQuery(wpp_scroll_to).addClass('wpp_contextual_highlight'); 
    571    
    572       } 
    573     } 
    574   } 
    5758 
    5769  function wpp_format_currency( selector ) { 
     
    60235     
    60336  }  
    604  
    605   function wpp_call_function(functionName, context, args) { 
    606     var args = Array.prototype.slice.call(arguments).splice(2); 
    607     var namespaces = functionName.split("."); 
    608     var func = namespaces.pop(); 
    609     for(var i = 0; i < namespaces.length; i++) { 
    610       context = context[namespaces[i]]; 
    611     } 
    612     return context[func].apply(this, args); 
    613   } 
  • wp-property/trunk/readme.txt

    r448681 r452292  
    160160== Upgrade Notice == 
    161161 
     162= 1.24.0 = 
     163* Changed property export function to export in JSON format. 
    162164= 1.20.0 = 
    163165* Major changes to the way pagination is handled.  Pagination is no longer loaded from a file but from wpi_draw_pagination(). 
     
    206208 
    207209== Changelog == 
     210 
     211= 1.24.0 = 
     212* Added check to verify that the property type of the property being edited exists, if not a warning is displayed (in case property type was deleted by accident) 
     213* Added a notice to developer tab when new attributes are being added that are used for address storage, and the attributes are displayed a read-only on property editing pages. 
     214* Added a function to hide attributes from the back-end overview column when there are over 5, and added a button to toggle all the attributes over 5. 
     215* Fixed issue with Denali theme not showing property-specific sideshow. 
     216* Fixed bug that occurred with pagination when hashes() function was not found. 
     217* Fixed to Attribute Grouping functions.  
     218* Added "Help" tab tool to mass-set property type.  
     219* Added some support for legacy property templates. 
     220* Changed property export function to export in JSON format. 
     221* Added conditional function checking to prevent all JS to break when Fancybox, and other functions, were not found. 
     222* Improved attachment deleting function - now if the folder has no files upon deletion, it is deleted as well. 
     223* Added wpp_property_page_vars filter for API ability to load extra variables into WPP templates. 
     224* Added styling for FEPS (Front End Property Submissions) 
     225* Tweaks to Supermap searching and custom Map Icon uploading. (Super Map) 
    208226 
    209227= 1.23.0 = 
  • wp-property/trunk/templates/property.php

    r448681 r452292  
    119119         
    120120      <?php if(!empty($wp_properties['taxonomies'])) foreach($wp_properties['taxonomies'] as $tax_slug => $tax_data): ?> 
    121         <?php if(get_features("type=$tax_slug&format=count")):  ?> 
     121        <?php if(get_features("type={$tax_slug}&format=count")):  ?> 
    122122        <div class="<?php echo $tax_slug; ?>_list"> 
    123123        <h2><?php echo $tax_data['label']; ?></h2> 
    124124        <ul class="clearfix"> 
    125         <?php get_features("type=$tax_slug&format=list&links=true"); ?> 
     125        <?php get_features("type={$tax_slug}&format=list&links=true"); ?> 
    126126        </ul> 
    127127        </div> 
  • wp-property/trunk/templates/template-functions.php

    r448681 r452292  
    1818   * @since 1.17.3 
    1919   */ 
    20    function property_overview_image($args = '') { 
     20  function property_overview_image($args = '') { 
    2121    global $wpp_query, $property; 
    22  
     22     
    2323    $defaults = array( 
    2424      'return' => 'false' 
    2525    ); 
    26  
     26     
    2727    $args = wp_parse_args( $args, $defaults ); 
    28  
     28     
    2929    if($wpp_query['fancybox_preview'] == 'true') { 
    3030      $thumbnail_link = $property['featured_image_url']; 
    3131      $link_class = "fancybox_image"; 
    3232    } 
    33  
     33     
    3434    $thumbnail_size = $wpp_query['thumbnail_size']; 
    35  
     35     
    3636    $image = wpp_get_image_link($property['featured_image'], $thumbnail_size, array('return'=>'array')); 
    37  
    38     ob_start(); 
    39     ?> 
    40     <div class="property_image"> 
    41       <a href="<?php echo $thumbnail_link; ?>" title="<?php echo $property['post_title'] . ($property['parent_title'] ? __(' of ', 'wpp') . $property['parent_title'] : "");?>"  class="property_overview_thumb property_overview_thumb_<?php echo $thumbnail_size; ?> <?php echo $link_class; ?>" rel="properties" > 
    42         <img width="<?php echo $image['width']; ?>" height="<?php echo $image['height']; ?>" src="<?php echo $image['link']; ?>" alt="<?php echo $property['post_title'];?>" /> 
    43       </a> 
    44     </div> 
    45     <?php 
    46     $html = ob_get_contents(); 
    47     ob_end_clean(); 
    48  
     37     
     38    if(!empty($image)) { 
     39      ob_start(); 
     40      ?> 
     41      <div class="property_image"> 
     42        <a href="<?php echo $thumbnail_link; ?>" title="<?php echo $property['post_title'] . ($property['parent_title'] ? __(' of ', 'wpp') . $property['parent_title'] : "");?>"  class="property_overview_thumb property_overview_thumb_<?php echo $thumbnail_size; ?> <?php echo $link_class; ?>" rel="properties" > 
     43          <img width="<?php echo $image['width']; ?>" height="<?php echo $image['height']; ?>" src="<?php echo $image['link']; ?>" alt="<?php echo $property['post_title'];?>" /> 
     44        </a> 
     45      </div> 
     46      <?php 
     47      $html = ob_get_contents(); 
     48      ob_end_clean(); 
     49    } else { 
     50      $html = ''; 
     51    } 
     52     
    4953    if($args['return'] == 'true') { 
    5054      return $html; 
     
    5256      echo $html; 
    5357    } 
    54  
    55  
    56     } 
     58  } 
    5759} 
    5860 
     
    217219            hashes = hashes.split('&'); 
    218220            for (var i in hashes) { 
    219               hash = hashes[i].split('='); 
    220               history[hash[0]] = hash[1]; 
     221              if(typeof hashes[i] != 'function') { 
     222                hash = hashes[i].split('='); 
     223                history[hash[0]] = hash[1]; 
     224              } 
    221225            } 
    222  
     226             
    223227            if(history.i) { 
    224228              /* get current shortcode's object */ 
     
    766770endif; 
    767771 
    768 if(!function_exists('get_features')): 
     772if(!function_exists('get_features')) { 
    769773  function get_features($args = '', $property = false) { 
    770774    global $post; 
    771775 
    772     if(is_array($property)) 
     776    if(is_array($property)) { 
    773777      $property = (object) $property; 
    774  
    775     if(!$property) 
     778    } 
     779 
     780    if(!$property) { 
    776781      $property = $post; 
     782    } 
    777783 
    778784    $defaults = array('type' => 'property_feature', 'format' => 'comma', 'links' => true); 
     
    784790 
    785791    if($features) { 
    786     foreach ($features as $feature) 
    787  
    788       if($links) 
     792    foreach ($features as $feature) { 
     793 
     794      if($links) { 
    789795        array_push($features_html, '<a href="' . get_term_link($feature->slug, $args['type']) . '">' . $feature->name . '</a>'); 
    790       else 
     796      } else { 
    791797        array_push($features_html, $feature->name); 
    792  
    793       if($args[format] == 'comma') 
     798      } 
     799 
     800      if($args['format'] == 'comma') { 
    794801        echo implode($features_html, ", "); 
    795  
    796       if($args[format] == 'array') 
     802      } 
     803 
     804      if($args['format'] == 'array') { 
    797805        return $features_html; 
    798  
    799       if($args[format] == 'count') 
     806      } 
     807 
     808      if($args['format'] == 'count') { 
    800809        return (count($features) > 0 ? count($features) : false); 
    801  
    802       if($args[format] == 'list') 
     810      } 
     811 
     812      if($args['format'] == 'list') { 
    803813        echo "<li>" . implode($features_html, "</li><li>") . "</li>"; 
    804  
    805     } 
    806  
     814      } 
     815       
     816      } 
     817 
     818    } 
    807819 
    808820  } 
    809 endif; 
     821} 
    810822 
    811823if(!function_exists('draw_stats')): 
     
    13321344      ?> 
    13331345      </ul> 
     1346      <div class="clear"></div> 
    13341347      </li> 
    13351348      <?php } ?> 
  • wp-property/trunk/templates/theme-specific/denali.css

    r448681 r452292  
    66  WP-Property loads this stylesheet after the other Denali styles are loaded, so it has authority.   
    77 
    8    This file is loaded for Denali child theme as well.  Loading can be disabled in Settings -> Display -> "Do not load theme-specific stylesheet." 
     8  This file is loaded for Denali child theme as well.  Loading can be disabled in Settings -> Display -> "Do not load theme-specific stylesheet." 
    99 
     10  This file should only include critical CSS rules - mostly structural. Colors and images should be loaded into the main Denali styles. 
    1011 
    1112  Version: 0.1 
     
    1314  
    1415  
     16/* FEPS Styles Begin */ 
    1517 
    16  #body_container ul.feps_user_input_fields, 
    17  #body_container ul.feps_user_input_fields  li { 
     18 
     19.container .wpp_feps_form .wpp_feps_row_wrapper { 
     20  list-style:none !important;   
     21  width: 100%; 
     22  padding: 0 0 9px 0; 
     23  margin-bottom: 13px; 
     24} 
     25 
     26.container .entry-content .wpp_feps_form  li { 
    1827  list-style: none; 
    19   margin:0; 
    20   padding:2px; 
    21   overflow: auto; 
    22 } 
    23  #body_container ul.feps_property_input_fields, 
    24  #body_container ul.feps_property_input_fields  li { 
    25  
    26   padding:2px; 
    27   list-style: none; 
    28   overflow: auto; 
     28  list-style-type: none; 
    2929} 
    3030 
    3131.wpp_feps_form { 
    32   padding: 1px; 
     32  overflow: hidden; 
    3333} 
     34 
     35 
     36.wpp_feps_form span.wpp_feps_input_error { 
     37  color: #A53535;  
     38} 
     39 
     40.wpp_feps_form .wpp_feps_row_wrapper.wpp_checkbox  .wpp_feps_label_wrapper { 
     41    clear: none; 
     42    float: right; 
     43    left: 5px; 
     44    text-align: left; 
     45    width: 375px; 
     46} 
     47.wpp_feps_form .wpp_feps_row_wrapper.wpp_checkbox  .wpp_feps_label_wrapper .the_title { 
     48  float: left; 
     49  text-transform: none; 
     50} 
     51 
     52.wpp_feps_form .wpp_feps_row_wrapper.wpp_checkbox .wpp_feps_input_wrapper { 
     53 
     54    clear: none; 
     55    float: left; 
     56    margin: 0; 
     57    min-height: 2em; 
     58    width: 246px; 
     59} 
     60 
     61.wpp_feps_form input.wpp_feps_submit_form { 
     62  float: right; 
     63} 
     64  
     65.wpp_feps_form .wpp_feps_row_wrapper .wpp_feps_label_wrapper { 
     66  clear: left; 
     67  float: left; 
     68  position: relative; 
     69  width: 215px;  /* Base Width */ 
     70  text-align: right; 
     71} 
     72.wpp_feps_form .feps_user_input_fields .wpp_feps_label_wrapper, 
     73.wpp_feps_form .feps_user_input_fields .wpp_feps_input_wrapper { 
     74  margin-top: 10px; 
     75} 
     76 
     77.wpp_feps_form .wpp_feps_row_wrapper .wpp_feps_input_wrapper { 
     78  clear: right; 
     79  float: right; 
     80  margin-left: -240px; /* -(40 + Base Width) */ 
     81  width: 100%; 
     82  margin-bottom: 0px; 
     83  position: relative; 
     84} 
     85.wpp_feps_form .wpp_feps_row_wrapper .wpp_feps_input_wrapper .wpp_feps_input_content { 
     86  margin-left: 230px; /* +20 to Base Width */  
     87  padding-right: 3px; 
     88} 
     89 
     90.wpp_feps_form .wpp_feps_row_wrapper .wpp_feps_description_wrapper { 
     91  clear: both; 
     92  margin-left: 230px;  
     93} 
     94 
     95.wpp_feps_form ul.feps_property_input_fields div.qq-upload-button { 
     96  margin-left: 220px;  
     97  float: left; 
     98} 
     99.wpp_feps_form ul.feps_property_input_fields ul.qq-upload-list { 
     100  clear: both; 
     101  padding-top: 15px; 
     102} 
     103 
     104.wpp_feps_form ul.feps_property_input_fields li.qq-upload-success { 
     105  margin: 0 0 10px 10px; 
     106  padding: 0; 
     107  float: right; 
     108} 
     109 
     110.wpp_feps_form ul.feps_property_input_fields img.wpp_feps_preview_thumb { 
     111  border: 3px solid #FFFFFF; 
     112  box-shadow: 0 0 4px #000000; 
     113  -moz-box-shadow: 0 0 4px #000000; 
     114  -webkit-box-shadow: 0 0 4px #000000; 
     115  -khtml-box-shadow: 0 0 4px #000000; 
     116  -o-box-shadow: 0 0 4px #000000; 
     117  -ms-box-shadow: 0 0 4px #000000; 
     118  height: 124px; 
     119  width: 188px !important; 
     120} 
     121 
     122.wpp_feps_form .the_title { 
     123  text-transform: uppercase; 
     124  float: right; 
     125} 
     126 
     127.wpp_feps_form .wpp_feps_ajax_message { 
     128    color: #5B4949; 
     129    display: block; 
     130    float: right; 
     131    line-height: 52px; 
     132    margin-right: 10px; 
     133    text-align: righ; 
     134} 
     135 
     136.wpp_feps_form .wpp_feps_row_wrapper.image_upload .wpp_feps_input_wrapper .wpp_feps_input_content {  
     137    margin-left: 10px; 
     138} 
     139 
     140/* FEPS Styles End */ 
  • wp-property/trunk/templates/theme-specific/twentyeleven.css

    r448681 r452292  
    435435} 
    436436 
    437  
    438  
    439  
    440  
     437/* Feps begin */ 
     438ul.feps_property_input_fields li.wpp_feps_row_wrapper { 
     439  border-bottom: 1px dotted #DDDDDD; 
     440  margin-bottom: 12px; 
     441  padding-bottom: 12px; 
     442} 
     443 
     444.wpp_feps_description_wrapper span.attribute_description_text { 
     445  color: #CCCCCC; 
     446  font-size: 0.8em; 
     447} 
     448 
     449ul.feps_property_input_fields li.wpp_feps_row_wrapper.wpp_checkbox input.wpp_checkbox { 
     450  top: 0; 
     451} 
     452 
     453ul.feps_property_input_fields textarea,  
     454ul.feps_property_input_fields input[type="text"], 
     455ul.feps_property_input_fields select, 
     456ul.feps_user_input_fields input[type="text"] { 
     457  width: 95%; 
     458  background: none repeat scroll 0 0 #FFFFFF; 
     459  border: 4px solid #EEEEEE; 
     460  border-radius: 5px 5px 5px 5px; 
     461  box-shadow: 0 1px 3px rgba(204, 204, 204, 0.95) inset; 
     462  padding: 10px; 
     463  position: relative; 
     464} 
     465 
     466ul.feps_property_input_fields select { 
     467  width: 100%; 
     468} 
     469 
     470.wpp_feps_input_error { 
     471  border: 4px solid #FFC5C4 !important; 
     472} 
     473 
     474input.wpp_checkbox.wpp_feps_input_error { 
     475  box-shadow: 2px 2px 1px #DD5D40; 
     476  -moz-box-shadow: 2px 2px 1px #DD5D40; 
     477  -webkit-box-shadow: 2px 2px 1px #DD5D40; 
     478  -khtml-box-shadow: 2px 2px 1px #DD5D40; 
     479  -o-box-shadow: 2px 2px 1px #DD5D40; 
     480  -ms-box-shadow: 2px 2px 1px #DD5D40; 
     481} 
     482 
     483ul.feps_user_input_fields li { 
     484  list-style: none; 
     485} 
     486 
     487input.wpp_feps_submit_form, div.qq-upload-button { 
     488  background: #222 !important; 
     489    border: none !important; 
     490    -moz-border-radius: 3px; 
     491    border-radius: 3px; 
     492    -webkit-box-shadow: 0px 1px 2px rgba(0,0,0,0.3); 
     493    -moz-box-shadow: 0px 1px 2px rgba(0,0,0,0.3); 
     494    box-shadow: 0px 1px 2px rgba(0,0,0,0.3); 
     495    color: #eee !important; 
     496    cursor: pointer !important; 
     497    font-size: 15px !important; 
     498    margin: 20px 0 !important; 
     499    padding: 5px 42px 5px 22px !important; 
     500    position: relative; 
     501    text-shadow: 0 -1px 0 rgba(0,0,0,0.3); 
     502} 
     503 
     504ul.feps_property_input_fields li.required label { 
     505  padding-right: 15px; 
     506  background: url("../images/red-asterisk.jpg") no-repeat top right; 
     507} 
  • wp-property/trunk/templates/theme-specific/twentyten.css

    r448681 r452292  
    1111  margin :0; 
    1212 } 
    13   
    14  .wpp_feps_form input { 
    15   margin: 0; 
    16  } 
    17   
    18  .wpp_feps_form input.wpp_feps_user_password, 
    19  .wpp_feps_form input.wpp_feps_user_email { 
    20   width: 20em; 
    21  } 
    22   
    2313  
    2414 .wpp_pagination_slider_wrapper .wpp_pagination_back, .wpp_pagination_slider_wrapper .wpp_pagination_forward { 
     
    193183#content .wpp_supermap_wrapper .map_filters, 
    194184#content .wpp_supermap_wrapper .show_more { 
    195   border:none; 
    196185  width:96%; 
    197186  border: 1px solid #DAE0FF; 
     
    243232} 
    244233 
     234/* FEPS */ 
     235.wpp_feps_preview_thumb { 
     236  max-width: 640px; 
     237} 
     238.wpp_feps_form input[type="text"], .wpp_feps_form input[type="password"] { 
     239  width: 99% !important; 
     240} 
     241 
     242.wpp_feps_description_wrapper span.attribute_description_text { 
     243  font-size: 0.7em; 
     244} 
     245 
     246ul.feps_user_input_fields li { 
     247  list-style: none; 
     248  margin-bottom: 10px; 
     249} 
     250 
     251ul.feps_user_input_fields li label { 
     252  font-size: 1em; 
     253  font-weight: bold; 
     254} 
     255 
     256ul.feps_property_input_fields label span.the_title { 
     257  font-size: 1.3em; 
     258} 
     259 
     260form.wpp_feps_form ul.feps_property_input_fields .qq-upload-button { 
     261  font-size: 0.8em; 
     262} 
     263 
     264ul.feps_property_input_fields select, .wpp_feps_form input[type="password"] { 
     265    background: #f9f9f9; 
     266    border: 1px solid #ccc; 
     267    box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); 
     268    -moz-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); 
     269    -webkit-box-shadow: inset 1px 1px 1px rgba(0,0,0,0.1); 
     270    padding: 2px; 
     271  margin-bottom: 5px; 
     272  margin-top: 2px; 
     273} 
     274 
     275ul.feps_property_input_fields li.wpp_feps_row_wrapper.wpp_checkbox input.wpp_checkbox { 
     276  top: 0; 
     277} 
     278 
     279ul.feps_property_input_fields li.wpp_feps_row_wrapper { 
     280  border-bottom: 1px solid #E7E7E7; 
     281  margin-bottom: 10px; 
     282  padding-bottom: 10px; 
     283} 
     284 
     285.wpp_feps_form input { 
     286  margin: 0; 
     287} 
     288 
     289li.wpp_feps_row_wrapper.required span.the_title { 
     290  background: url("../images/red-asterisk.jpg") no-repeat scroll right top transparent; 
     291  padding-right: 15px; 
     292} 
     293 
     294input[type="text"].wpp_feps_input_error, 
     295input[type="password"].wpp_feps_input_error, 
     296select.wpp_feps_input_error { 
     297  border-bottom: 1px solid #FF8989 !important; 
     298} 
     299input.wpp_checkbox.wpp_feps_input_error { 
     300  box-shadow: 0px 1px 0px #FF8989; 
     301  -moz-box-shadow: 0px 1px 0px #FF8989; 
     302  -webkit-box-shadow: 0px 1px 0px #FF8989; 
     303  -khtml-box-shadow: 0px 1px 0px #FF8989; 
     304  -o-box-shadow: 0px 1px 0px #FF8989; 
     305  -ms-box-shadow: 0px 1px 0px #FF8989; 
     306} 
  • wp-property/trunk/templates/wp_properties.css

    r448681 r452292  
     1/* FEPS Styles Begin */ 
     2 
    13form.wpp_feps_form label.error { 
    24  display: block; 
    35} 
    46 
    5 ul.wpp_search_group { 
     7form.wpp_feps_form ul.wpp_search_group { 
    68  list-style:none; 
    79} 
    810 
    9  
    10 /* Image Uploader Styles */ 
    11 .wpp_feps_input_wrapper  .qq-upload-list{ 
     11form.wpp_feps_form li.wpp_feps_row_wrapper { 
     12  list-style:none; 
     13} 
     14 
     15form.wpp_feps_form .wpp_feps_row_wrapper  .qq-upload-list{ 
    1216  margin: 0; 
    13 } 
    14  
    15 .wpp_feps_input_wrapper  .qq-upload-list .qq-upload-cancel { 
     17  list-tyle-type:none;  
     18  padding-top: 15px; 
     19} 
     20 
     21form.wpp_feps_form  .wpp_feps_row_wrapper  .qq-upload-list .qq-upload-cancel { 
    1622  text-decoration: none; 
    1723  color: #A0A0A0; 
     
    2026} 
    2127 
    22 .wpp_feps_input_wrapper  .qq-upload-list .qq-upload-size, 
    23 .wpp_feps_input_wrapper  .qq-upload-list .wpp_upload_progress { 
     28form.wpp_feps_form div.qq-upload-drop-area { 
     29  display: none !important; 
     30} 
     31 
     32form.wpp_feps_form span.images_limit { 
     33  clear: both; 
     34  float: right; 
     35  position: absolute; 
     36  right: 12px; 
     37  top: 4px; 
     38} 
     39 
     40 
     41form.wpp_feps_form  .qq-upload-list .qq-upload-size, 
     42form.wpp_feps_form  .qq-upload-list .wpp_upload_progress { 
    2443  height: 20px; 
    2544} 
    2645 
    27 .wpp_feps_input_wrapper .qq-upload-list .qq-upload-size { 
     46form.wpp_feps_form .qq-upload-list .qq-upload-size { 
    2847  display: block; 
    2948  clear: both; 
     
    3150} 
    3251 
    33 .wpp_feps_input_wrapper .qq-upload-list .wpp_upload_progress { 
     52form.wpp_feps_form .qq-upload-list .wpp_upload_progress { 
    3453  background: #666666; 
    3554  display: block; 
     
    3857} 
    3958 
    40  
    41      
    42 .wpp_feps_input_wrapper  .qq-upload-list .wpp_upload_progress_text { 
     59form.wpp_feps_form   .qq-upload-list .wpp_upload_progress_text { 
    4360  font-size: 11px; /* fixed height to fit into progress bar wrapper */ 
    4461  display: block; 
     
    4865} 
    4966 
    50 .wpp_feps_input_wrapper .qq-upload-list .wpp_upload_progress .wpp_upload_progress_text { 
     67form.wpp_feps_form .qq-upload-list .wpp_upload_progress .wpp_upload_progress_text { 
    5168  float: right; 
    5269  color: #FFF; 
     
    5572  
    5673 
    57 .wpp_feps_input_wrapper .qq-uploader li { 
     74form.wpp_feps_form .qq-uploader li { 
    5875  margin: 0 10px 10px 0; 
    5976  padding: 0; 
    6077} 
    61 .wpp_feps_input_wrapper .qq-uploader li.qq-upload-success{ 
     78form.wpp_feps_form .qq-uploader li.qq-upload-success{ 
    6279  display: inline; 
    6380} 
    6481 
    65 /* Image Uploader Styles */ 
    66  
    67 #wp-admin-bar-wpp_approve_property { 
    68   background: #CF982D; 
    69 } 
    70  
    71 #wp-admin-bar-wpp_approve_property a { 
    72   color: #FFFFFF; 
    73 } 
    74  
    75 ul.feps_property_input_fields .qq-upload-button { 
     82 
     83form.wpp_feps_form ul.feps_property_input_fields .qq-upload-button { 
    7684    background: none repeat scroll 0 0 #DDDDDD; 
    7785    border: 1px solid #BBBBBB; 
     
    8492} 
    8593 
    86 .qq-upload-failed-text {display:none;} 
    87  
    88  
    89 ul.feps_property_input_fields li.wpp_feps_input_wrapper.wpp_currency, 
    90 ul.feps_property_input_fields li.wpp_feps_input_wrapper.wpp_numeric { 
    91     margin-right: 15px; 
    92     width: 44%; 
    93 } 
    94  
    95 ul.feps_user_input_fields { 
    96    
    97 } 
    98  
    99 ul.feps_user_input_fields, 
    100 ul.feps_property_input_fields { 
     94form.wpp_feps_form .qq-upload-failed-text {display:none;} 
     95  
     96form.wpp_feps_form  ul.feps_user_input_fields, 
     97form.wpp_feps_form ul.feps_property_input_fields { 
    10198  margin: 0; 
    10299  clear: both; 
    103100} 
    104101  
    105 ul.feps_user_input_fields li.wpp_feps_input_wrapper, 
    106 ul.feps_property_input_fields li.wpp_feps_input_wrapper   {   
    107     background-color: #F5F5F5; 
    108     display: block; 
    109     float: left; 
     102ul.feps_user_input_fields li.wpp_feps_row_wrapper, 
     103ul.feps_property_input_fields li.wpp_feps_row_wrapper   {   
     104    list-style: none; 
    110105    list-style-type: none; 
    111     margin: 0 4px 6px 0; 
    112     padding: 5px 13px; 
    113     width: 94%; 
    114 } 
    115  
    116 ul.feps_property_input_fields li.wpp_feps_input_wrapper.wpp_checkbox input.wpp_checkbox   {   
     106} 
     107 
     108ul.feps_property_input_fields li.wpp_feps_row_wrapper.wpp_checkbox input.wpp_checkbox   {   
    117109  float: left; 
    118110  position: relative; 
    119111  top: 7px; 
    120112} 
    121 ul.feps_property_input_fields li.wpp_feps_input_wrapper.wpp_checkbox  label {   
    122   margin-left: 10px; 
     113ul.feps_property_input_fields li.wpp_feps_row_wrapper.wpp_checkbox  label {   
     114 
    123115}  
    124116 
    125 ul.feps_property_input_fields li.wpp_feps_input_wrapper.wpp_checkbox  label span.description {   
     117ul.feps_property_input_fields li.wpp_feps_row_wrapper.wpp_checkbox  label span.description {   
    126118  float: none; 
    127119} 
    128120 
    129 ul.feps_user_input_fields li.wpp_feps_input_wrapper { 
     121ul.feps_user_input_fields li.wpp_feps_row_wrapper { 
    130122  background: #EBEBEB; 
    131123} 
    132124 
    133 ul.feps_property_input_fields label span.the_title {   
     125ul.feps_property_input_fields label span.the_title, 
     126ul.feps_user_input_fields label span.the_title{   
    134127  font-weight: bold; 
    135   font-size: 1.1em; 
    136   margin-right: 10px; 
    137 } 
     128} 
     129 
    138130ul.feps_property_input_fields label span.description{   
    139131  float: right; 
     
    155147 
    156148ul.feps_property_input_fields textarea,   
    157 ul.feps_property_input_fields input[type="text"] {   
     149ul.feps_property_input_fields input[type="text"], 
     150ul.feps_user_input_fields input[type="text"], 
     151ul.feps_user_input_fields input[type="password"]{   
    158152  display: block; 
    159153  margin-bottom: 5px; 
     
    175169 
    176170ul.feps_property_input_fields .description {   
    177     color: #777777; 
    178171    font-weight: normal; 
    179172}    
    180173  
     174/* FEPS Styles End */ 
     175  
     176 
     177#wp-admin-bar-wpp_approve_property { 
     178  background: #CF982D; 
     179} 
     180 
     181#wp-admin-bar-wpp_approve_property a { 
     182  color: #FFFFFF; 
     183} 
     184 
     185 
    181186 
    182187.wpp_pagination_slider_wrapper .wpp_pagination_back, 
     
    413418  margin:0; 
    414419} 
     420#content .wpp_shortcode_search  ul li { 
     421  margin-bottom:4px; 
     422} 
    415423#content .wpp_shortcode_search  ul label{ 
    416424  width: 150px; 
     
    650658 
    651659  .wpp_gallery_widget  img { 
     660    max-width: 100%; 
    652661    border: 5px solid #DFDFDF; 
    653662    margin: 0 9px 9px 0; } 
     
    791800/* --- Supermap ---*/ 
    792801.super_map_list_property { 
    793   padding-top: 10px; 
    794   width: 35; } 
     802} 
    795803 
    796804.property_in_list { 
     
    801809  border: 1px solid #E8E8E8; 
    802810  margin-bottom: 6px; 
    803   width: 96%; } 
     811  width: 96%;  
     812} 
    804813 
    805814.map_filters { 
     
    818827  background: #DAE0FF; 
    819828  border: 2px ridge grey; 
    820   text-align: center; } 
     829  text-align: center; 
     830  margin-bottom:10px; 
     831} 
    821832 
    822833.super_map_list input { margin: 5px 5px 5px 0; } 
     
    871882} 
    872883.super_map_list .show_more .search_loader { 
     884  display:none; 
    873885  height:auto; 
    874886  margin:0; 
     
    883895  font-size: 0.9em; 
    884896  position: relative; 
    885   width: 100%; 
    886    } 
     897} 
    887898 
    888899  .super_map_list ul.property_in_list_items li { 
  • wp-property/trunk/wp-property.php

    r448681 r452292  
    55Description: Property and Real Estate Management Plugin for WordPress.  Create a directory of real estate / rental properties and integrate them into you WordPress CMS. 
    66Author: Usability Dynamics, Inc. 
    7 Version: 1.23.0 
     7Version: 1.24.0 
    88Author URI: http://usabilitydynamics.com 
    99 
     
    2828 
    2929/** This Version  */ 
    30 define('WPP_Version', '1.23.0'); 
     30define('WPP_Version', '1.24.0'); 
    3131 
    3232/** Path for Includes */ 
Note: See TracChangeset for help on using the changeset viewer.