Exemplo n.º 1
0
 public static function translate_amenities($amenities)
 {
     $local_dictionary = array('half_baths' => 'Half Baths', 'price' => 'Price', 'sqft' => 'Square Feet', 'baths' => 'Baths', 'avail_on' => 'Available On', 'cons_stts' => 'Construction Status', 'beds' => 'Beds', 'url' => 'Link', 'desc' => 'Description', 'lt_sz' => 'Lot Size', 'ngb_shop' => 'Local Shopping', 'ngb_hgwy' => 'Local Highway Access', 'grnt_tops' => 'Granite Counter Tops', 'ngb_med' => 'Local Medical Facilities', 'ngb_trails' => 'Local Walk/Jog Trails', 'cent_ht' => 'Central Heat', 'pk_spce' => 'Parking Spaces Included', 'park_type' => "Parking Type", 'air_cond' => 'Air Conditioning', 'air_conditioning' => 'Air Conditioning', 'price_unit' => 'Unit Price', 'lt_sz_unit' => 'Unit Lot Size', 'lse_trms' => 'Lease Terms', 'lse_type' => "Lease Type", 'ngb_trans' => 'Local Public Transportation', 'off_den' => 'Office / Den', 'frnshed' => 'Furnished', 'refrig' => 'Refrigerator', 'deposit' => 'Deposit', 'ngb_pubsch' => 'Local Public Schools', 'beds_avail' => 'Beds Available', 'hoa_fee' => 'Home Owners Assocation Fee', 'floors' => 'Floors', 'bns_rec_rm' => 'Basement Rec Room', 'fm_lv_rm' => 'Family Rec Room', 'yard' => 'Has Yard', 'hdwdflr' => 'Hardwood Floors', 'sauna' => 'Sauna', 'year_blt' => 'Year Built', "oid" => "Office ID", "aid" => "Agent ID", "mls_id" => "MLS ID", "oname" => "Office Name", "aname" => "Agent Name", "aemail" => "Agent Email", "assofee" => "Association Fee", "assocation_fee" => "Association Fee", "association_fee_per" => "Association Fee Per", "garagetype" => "Garage Type", "foundlength" => "Foundation Length", "foundation_length" => "Foundation Length", "foundwidth" => "Foundation Width", "foundation_width" => "Foundation Width", "assessment" => "Assessment", "assessed_value" => "Assessed Value", "lender_owned" => "Lender Owned", "retaxes" => "Real Estate Taxes", "tax_amount" => "Tax Amount", "real_estate_tax" => "Real Estate Taxes", "lotfrontage" => "Waterfront", "lot_frontage" => "Waterfront", "taxyear" => "Tax Year", "tax_year" => "Tax Year", "heat1" => "Heat", "room" => "Rooms", "rooms" => "Rooms", "floor" => "Floors", "flooring" => "Flooring", "belowgroundlsqf" => "Below Ground Sqft", "below_ground_sqft" => "Below Ground Sqft", "above_ground_sqft" => "Above Ground Sqft", "pricesqft_abv_gr" => "Price/sqft Above Ground", "approx_acres" => "Approximate Acres", "approx_lot_sqft" => "Approximate Lot Sqft", "fire_district_tax" => "Fire District Tax", "garage_description" => "Garage Description", "garage_spaces" => "Garage Spaces", "insulation" => "Insulation", "tank_type" => "Tank Type", "tank_size" => "Tank Size", "number_of_rooms" => "Number of Rooms", "energy_features" => "Energy Features", "exterior_constr" => "Exterior Construction", "occupancyclose" => "Occupancy Close", "zone_desc" => "Zone Description", "assessment_amount" => "Assessment Amount", "assessor_plat" => "Assessor Plat", "assessor_lot" => "Assessor Lot", "occupancy" => "Occupancy", "pets" => "Pets", "historic" => "Historic", "blc_deck_pt" => "Balcony/Deck/Patio", "dryer" => "Dryer", "washer" => "Washer", "status" => "Status", "appliances" => "Appliances", "appliances_included" => "Appliances", "oid" => "Office ID", "aid" => "Agent ID", "mls_id" => "MLS ID", "oname" => "Office Name", "aname" => "Agent Name", "aemail" => "Agent Email", "assofee" => "Association Fee", "garagetype" => "Garage Type", "historic" => "Historic", "age_years" => "Age in Years", "foundation" => "Foundation", "foundlength" => "Foundation Length", "foundwidth" => "Foundation Width", "assessment" => "Assessment", "retaxes" => "Real Estate Taxes", "lotfrontage" => "Waterfront", "taxyear" => "Tax Year", "heat1" => "Heat", "total_rooms" => "Total Rooms", "total_fireplaces" => "Total Fireplaces", "total_closets" => "Total Closets", "fencing" => "Fencing", "construction" => "Construction", "floor" => "Floors", "occupancy" => "Occupancy", "belowgroundlsqf" => "Below Ground Sqft", "insulation" => "Insulation", "approx_head_cost" => "Approximate Head Cost", "approx_lot_sqft" => "4791", "cooling" => "Cooling", "basement" => "Basement", "basemnt" => "Basement", "building_levels" => "Building Levels", "levels" => "Levels", "utility_room" => "Utility Room", "room_areas" => "Room Areas", "water_heater" => "Water Heater", "other_rooms" => "Other Rooms", "fence" => "Fence", "fireplace_details" => "Fireplace Details", "lot_number" => "Lot Number", "water_heaters" => "Water Heaters", "kitchen_equipment" => "Kitchen Equipment", "living_areas" => "Living Areas", "electric" => "Electric", "first_floor_rooms" => "First Floor Rooms", "second_floor_rooms" => "Second Floor Rooms", "third_floor_rooms" => "Third Floor Rooms", "flooring" => "Flooring", "fireplace" => "Fireplace", "heating_fuel" => "Heating Fuel", "garage_description" => "Garage Description", "heat_system" => "Heat System", "hot_water" => "Hot Water", "living_room_length" => "Living Room Length", "list_of_rooms" => "List of Rooms", "living_room_width" => "Living Room Width", "lot_description" => "Lot Description", "lower_level_rooms" => "Lower Level Rooms", "master_bedroom_l" => "Master Bedroom Length", "master_bedroom_w" => "Master Bedroom Width", "number_of_fireplaces" => "Number of Fireplaces", "number_of_rooms" => "Number of Rooms", "near" => "Near", "plumbing" => "Plumbing", "pricesqft_abv_gr" => "Price per Sqft Above Ground", "tank_size" => "Tank Size", "sewer" => "Sewer", "tank_type" => "Tank Type", "type" => "Type", "wall_description" => "Wall Description", "water_supply" => "Water Supply", "approx_heat_cost" => "Approximate Heat Cost", "association_fee" => "Association Fee", "exterior" => "Exterior", "exterior_features" => "Exterior Features", "interior" => "Interior", "Interior_features" => "Interior Features", "water_amenities" => "Water Amenities", "acres" => "Acres", "master_bath" => "Master Bath", "park_type" => "Parking Type", "property_type" => "Property Type", "built_to_suit" => "Built to Suit", "mobile_homes_allowed" => "Mobile Homes Allowed", "basemnt" => "Basement", "move_in" => "Move In", "bld_name" => "Building Name", "tl_earn" => "Total Earned", "style" => "Style", "company" => "Company", "landing_select" => "Advertising Style", "bld_suit" => "Build to Suit", "cent_ac" => "Central A/C", "frplce" => "Fireplace", "hv_ceil" => "High/Vaulted Ceiling", "wlk_clst" => "Walk-In Closet", "tle_flr" => "Tile Floor", "lft_lyout" => "Loft Layout", "off_den" => "Office/Den", "dng_rm" => "Dining Room", "brkfst_nk" => "Breakfast Nook", "dshwsher" => "Dishwasher", "refrig" => "Refrigerator", "stve_ovn" => "Stove/Oven", "stnstl_app" => "Stainless Steel Appliances", "attic" => "Attic", "washer" => "Washer", "dryer" => "Dryer", "lndry_in" => "Laundry Area - Inside", "lndry_gar" => "Laundry Area - Garage", "blc_deck_pt" => "Balcony/Deck/Patio", "yard" => "Yard", "swm_pool" => "Swimming Pool", "jacuzzi" => "Jacuzzi/Whirlpool", "sauna" => "Sauna", "cble_rdy" => "Cable-ready", "hghspd_net" => "High-speed Internet", "lt_sz" => "Lot Size", "lt_sz_unit" => "Lot Unit Type", "accoms" => "Accommodates", "avail_info" => "Availability", "hoa_mand" => "HOA Mandatory", "hoa_fee" => "HOA Fee", "hoa_fee_desc" => "HOA Fee Description", "lndr_own" => "Lender Owned", "ngb_trans" => "Public Transportation", "ngb_shop" => "Shopping", "ngb_pool" => "Swimming Pool", "ngb_court" => "Tennis Court", "ngb_park" => "Park", "ngb_trails" => "Walk/Jog Trails", "ngb_stbles" => "Stables", "ngb_golf" => "Golf Courses", "ngb_med" => "Medical Facilities", "ngb_bike" => "Bike Path", "ngb_cons" => "Conservation Area", "ngb_hgwy" => "Highway Access", "ngb_mar" => "Marina", "ngb_pvtsch" => "Private School", "ngb_pubsch" => "Public School", "school_district" => "School District", "zone" => "Zone", "road_surface" => "Road Surface", "utilities" => "Utilities", "restrictions" => "Restrictions", "ngb_uni" => "University", "cats" => "Cats", "dogs" => "Dogs", "pk_lease" => "Parking Lease", "lease_type" => "Lease Type", "master_bath" => "Master Bath", "area" => "Area", "prop_type" => "Property Type", "prop_name" => "Property Name", "bld_sz" => "Building Size", "max_cont" => "Maximum Contiguous", "min_div" => "Minimum Divisible", "lst_dte" => "List Date", "dom" => "Days on Market", "construction_type" => "Construction Type", "design" => "Construction Type", "floor_desc" => "Construction Type", "heating_desc" => "Construction Type", "parking_description" => "Parking Description", "sewer_desc" => "Sewer Description", "water_desc" => "Water Description", "cooling_desc" => "Cooling Description", "front_exposure" => "Front Exposure", "roof_desc" => "Roof Description", "view" => "View");
     $local_values_dictionary = array("per_ngt" => "per night", "per_mnt" => "per month", "per_yr" => "per year", "per_wk" => "per week", "exstng" => "existing", "und_prop" => "under construction / proposed", "fl_srv" => "full service", "ind_grs" => "industrial gross", "mod_grs" => "modified gross", "mod_net" => "industrial net", "na" => "n/a", "Atch_gar" => "attached garage", "amt_mnt" => "amount/month", "amt_yr" => "amount/year", "sqft_mnt" => "sqft/month", "sqft_yr" => "sqft/year");
     $api_dictionary = PLS_Plugin_API::get_translations();
     $local_dictionary = array_merge($local_dictionary, $api_dictionary);
     global $pls_custom_amenity_dictionary;
     if (isset($pls_custom_amenity_dictionary) && !empty($pls_custom_amenity_dictionary)) {
         $local_dictionary = wp_parse_args($pls_custom_amenity_dictionary, $local_dictionary);
     }
     foreach ($amenities as $key => $value) {
         // if exists in local dictionary, translate value first
         $value = isset($local_values_dictionary[trim($value)]) ? $local_values_dictionary[trim($value)] : $value;
         if ($value == '1') {
             $value = 'Yes';
         } elseif ($value == '0') {
             $value = 'No';
         }
         if (isset($local_dictionary[$key])) {
             if ($key == 'style') {
                 $style_values = array("bungal" => "Bungalow", "cape" => "Cape Cod", "colonial" => "Colonial", "contemp" => "Contemporary", "cott" => "Cottage", "farmh" => "Farmhouse", "fnt_bk_splt" => "Front to Back Split", "gamb_dutc" => "Gambrel/Dutch", "garrison" => "Garrison", "greek_rev" => "Greek Revival", "loft_splt" => "Lofted Split", "mult_lvl" => "Multi-level", "rai_ranch" => "Raised Ranch", "ranch" => "Ranch", "saltb" => "Saltbox", "split_ent" => "Split Entry", "tudor" => "Tudor", "victor" => "Victorian", "antiq" => "antique");
                 if (isset($style_values[$value])) {
                     $value = $style_values[$value];
                 }
             }
             unset($amenities[$key]);
             $amenities[$local_dictionary[$key]] = ucwords($value);
         }
     }
     return $amenities;
 }