Changeset 2450742
- Timestamp:
- 01/05/2021 04:33:30 PM (5 years ago)
- Location:
- ownerrez
- Files:
-
- 6 deleted
- 8 edited
- 1 copied
-
tags/1.1.1 (copied) (copied from ownerrez/trunk)
-
tags/1.1.1/composer.json (deleted)
-
tags/1.1.1/composer.lock (deleted)
-
tags/1.1.1/lib (deleted)
-
tags/1.1.1/ownerrez.php (modified) (2 diffs)
-
tags/1.1.1/public/class-ownerrez-shortcodes.php (modified) (4 diffs)
-
tags/1.1.1/public/css/ownerrez-public.css (modified) (2 diffs)
-
tags/1.1.1/readme.txt (modified) (2 diffs)
-
trunk/composer.json (deleted)
-
trunk/composer.lock (deleted)
-
trunk/lib (deleted)
-
trunk/ownerrez.php (modified) (2 diffs)
-
trunk/public/class-ownerrez-shortcodes.php (modified) (4 diffs)
-
trunk/public/css/ownerrez-public.css (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ownerrez/tags/1.1.1/ownerrez.php
r2444600 r2450742 16 16 * Plugin Name: OwnerRez 17 17 * Plugin URI: https://www.ownerreservations.com/support/wordpress 18 * Description: Integrate your OwnerRez account with your wordpress site.19 * Version: 1. 0.518 * Description: The official WordPress plugin for the OwnerRez API. 19 * Version: 1.1.0 20 20 * Author: OwnerRez, Inc. 21 21 * Author URI: https://www.ownerreservations.com/ … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define('OWNERREZ_VERSION', '1. 0.5');38 define('OWNERREZ_VERSION', '1.1.0'); 39 39 40 40 /** -
ownerrez/tags/1.1.1/public/class-ownerrez-shortcodes.php
r2439293 r2450742 115 115 } 116 116 117 function filter_array ($array, $callback, $args){ 118 if(is_array($array) && count($array)>0) 119 { 120 foreach(array_keys($array) as $key){ 121 $temp[$key] = $array[$key]; 122 123 if ($callback($temp[$key], $args)){ 124 $newarray[count($newarray ?? [])] = $array[$key]; 125 } 126 } 127 } 128 return $newarray ?? null; 129 } 130 117 131 function get_resource($attrs, $resourceName, $id = null, $action = null, $query = null, $verb = null, $body = null) 118 132 { … … 190 204 191 205 if (property_exists($listing, "callOutAmenities")) { 192 $list = "<ul class='ownerrez- amenities-list'>";206 $list = "<ul class='ownerrez-callout-amenities-list'>"; 193 207 194 208 foreach ($listing->callOutAmenities as &$amenity) { … … 216 230 217 231 foreach ($listing->amenities as $category => $amenities) { 218 $tr = "<tr><td class='ownerrez-amenities-table-category-name'>" . $this->camelToTitle(ucfirst($category)) . "</td><td class='ownerrez-amenities-table-category-items'><ul class='ownerrez-amenities-table-list'>"; 219 220 foreach ($amenities as $amenity) { 221 $tr .= "<li class='ownerrez-amenities-table-list-item'>" . $this->camelToTitle(ucfirst($amenity->text)) . "</li>"; 222 } 223 224 $tr .= "</ul></td>"; 225 232 $tr = "<tr><th class='ownerrez-amenities-table-category-name'>" . $this->camelToTitle(ucfirst($category)) . "</th><td class='ownerrez-amenities-table-category-items'>"; 233 $tr .= $this->get_amenities_list($amenities); 234 $tr .= "</td></tr>"; 226 235 $table .= $tr; 227 236 } … … 233 242 234 243 return "[The current ownerrez api does not support type: widget_amenities_table]"; 244 } 245 246 function type_widget_amenities_category($attrs, $content, $additionalArgs) 247 { 248 $category = null; 249 if (array_key_exists("category", $additionalArgs) && is_string($additionalArgs["category"])) 250 $category = strtolower($additionalArgs["category"]); 251 else 252 return '[The "category" attribute is required for this shortcode.]'; 253 254 $listing = $this->get_resource($attrs, "listings", $this->get_id($attrs, "orp"), "summary", ["includeDescriptions"=>"true", "includeAmenities"=>"true"]); 255 256 if (property_exists($listing, "amenityCategories") && is_array($listing->amenityCategories)) 257 { 258 $match = $this->filter_array($listing->amenityCategories, function ($x, $args) { 259 return !strcasecmp($args, $x->type); 260 }, $category); 261 262 if (!empty($match)) { 263 return $this->get_amenities_list($match[0]->amenities); 264 } 265 else { 266 return ""; 267 } 268 } 269 270 return "[The current ownerrez api does not support type: widget_amenities_category]"; 271 } 272 273 function type_widget_listing_details($attrs, $content, $additionalArgs) 274 { 275 $listing = $this->get_resource($attrs, "listings", $this->get_id($attrs, "orp"), "summary", ["includeDescriptions"=>"true", "includeAmenities"=>"true"]); 276 277 if (property_exists($listing, "amenityCategories") && is_array($listing->amenityCategories)) 278 { 279 $output = "<div class='ownerrez-listing-details'>"; 280 281 if (property_exists($listing, "amenitiesAdditionalInfo")) 282 $output .= "<div class='ownerrez-listing-details-additional-info'>" . $listing->amenitiesAdditionalInfo . "</div>"; 283 284 $output .= "<table class='ownerrez-amenities-table'>"; 285 286 foreach ($listing->amenityCategories as $category) 287 { 288 $output .= "<tr><th class='ownerrez-amenities-table-category-name'>" . $category->caption . "</th><td class='ownerrez-amenities-table-category-items'>"; 289 $output .= $this->get_amenities_list($category->amenities); 290 $output .= "</td>"; 291 } 292 293 return $output . "</table></div>"; 294 } 295 296 return "[The current ownerrez api does not support type: widget_listing_details]"; 297 } 298 299 /** 300 * @param $amenities 301 * @return string 302 */ 303 public function get_amenities_list($amenities): string 304 { 305 $ul = "<ul class='ownerrez-amenities-list'>"; 306 307 foreach ($amenities as $amenity) { 308 $ul .= "<li class='ownerrez-amenities-list-item'>" . $this->camelToTitle(ucfirst($amenity->text)); 309 if (!empty($amenity->title)) { 310 $ul .= '<i class="fas fa-info-circle" title="' . $amenity->title . '"></i>'; 311 } 312 $ul .= "</li>"; 313 } 314 315 $ul .= "</ul>"; 316 317 return $ul; 235 318 } 236 319 -
ownerrez/tags/1.1.1/public/css/ownerrez-public.css
r2439293 r2450742 158 158 } 159 159 160 .ownerrez- amenities-list {160 .ownerrez-callout-amenities-list { 161 161 } 162 .ownerrez- amenities-list>li {162 .ownerrez-callout-amenities-list > li { 163 163 list-style: none; 164 164 margin: 0 20px 0 0; 165 165 display: inline-block; 166 166 } 167 .ownerrez-callout-amenities-list .fas { 168 margin-right: 5px; 169 } 170 167 171 .ownerrez-amenities-table { 168 172 border: none; … … 174 178 min-width: 150px; 175 179 } 176 .ownerrez-amenities- table-list {180 .ownerrez-amenities-list { 177 181 margin: 0; 178 182 padding: 0; 179 183 } 180 .ownerrez-amenities- table-list-item {184 .ownerrez-amenities-list-item { 181 185 margin: 0; 182 186 padding: 0; 183 187 list-style: none; 184 188 } 189 .ownerrez-amenities-list-item .fa-info-circle { 190 margin-left: 5px; 191 } -
ownerrez/tags/1.1.1/readme.txt
r2444600 r2450742 4 4 Requires at least: 5.4 5 5 Tested up to: 5.6 6 Stable tag: 1. 0.56 Stable tag: 1.1.0 7 7 License: MIT 8 8 License URI: https://github.com/ownerrez/orez-wp/blob/master/LICENSE … … 32 32 1. Complete the registration information (username and personal access token) under Settings -> OwnerRez 33 33 34 == Frequently Asked Questions ==35 36 37 == Screenshots ==38 39 40 34 == Changelog == 35 = 1.1.0 = 36 - Added two new widget shortcodes. 37 - **Breaking** Modified css classes on existing widget shortcodes. 41 38 42 39 = 1.0.5 = 43 44 40 Fixed a bug that occurred when Wordpress was hosted in a subfolder named /ownerrez 45 41 46 42 == Upgrade Notice == 43 44 After upgrading to 1.1.0, please review any custom css you have added for OwnerRez widgets. -
ownerrez/trunk/ownerrez.php
r2444600 r2450742 16 16 * Plugin Name: OwnerRez 17 17 * Plugin URI: https://www.ownerreservations.com/support/wordpress 18 * Description: Integrate your OwnerRez account with your wordpress site.19 * Version: 1. 0.518 * Description: The official WordPress plugin for the OwnerRez API. 19 * Version: 1.1.0 20 20 * Author: OwnerRez, Inc. 21 21 * Author URI: https://www.ownerreservations.com/ … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define('OWNERREZ_VERSION', '1. 0.5');38 define('OWNERREZ_VERSION', '1.1.0'); 39 39 40 40 /** -
ownerrez/trunk/public/class-ownerrez-shortcodes.php
r2439293 r2450742 115 115 } 116 116 117 function filter_array ($array, $callback, $args){ 118 if(is_array($array) && count($array)>0) 119 { 120 foreach(array_keys($array) as $key){ 121 $temp[$key] = $array[$key]; 122 123 if ($callback($temp[$key], $args)){ 124 $newarray[count($newarray ?? [])] = $array[$key]; 125 } 126 } 127 } 128 return $newarray ?? null; 129 } 130 117 131 function get_resource($attrs, $resourceName, $id = null, $action = null, $query = null, $verb = null, $body = null) 118 132 { … … 190 204 191 205 if (property_exists($listing, "callOutAmenities")) { 192 $list = "<ul class='ownerrez- amenities-list'>";206 $list = "<ul class='ownerrez-callout-amenities-list'>"; 193 207 194 208 foreach ($listing->callOutAmenities as &$amenity) { … … 216 230 217 231 foreach ($listing->amenities as $category => $amenities) { 218 $tr = "<tr><td class='ownerrez-amenities-table-category-name'>" . $this->camelToTitle(ucfirst($category)) . "</td><td class='ownerrez-amenities-table-category-items'><ul class='ownerrez-amenities-table-list'>"; 219 220 foreach ($amenities as $amenity) { 221 $tr .= "<li class='ownerrez-amenities-table-list-item'>" . $this->camelToTitle(ucfirst($amenity->text)) . "</li>"; 222 } 223 224 $tr .= "</ul></td>"; 225 232 $tr = "<tr><th class='ownerrez-amenities-table-category-name'>" . $this->camelToTitle(ucfirst($category)) . "</th><td class='ownerrez-amenities-table-category-items'>"; 233 $tr .= $this->get_amenities_list($amenities); 234 $tr .= "</td></tr>"; 226 235 $table .= $tr; 227 236 } … … 233 242 234 243 return "[The current ownerrez api does not support type: widget_amenities_table]"; 244 } 245 246 function type_widget_amenities_category($attrs, $content, $additionalArgs) 247 { 248 $category = null; 249 if (array_key_exists("category", $additionalArgs) && is_string($additionalArgs["category"])) 250 $category = strtolower($additionalArgs["category"]); 251 else 252 return '[The "category" attribute is required for this shortcode.]'; 253 254 $listing = $this->get_resource($attrs, "listings", $this->get_id($attrs, "orp"), "summary", ["includeDescriptions"=>"true", "includeAmenities"=>"true"]); 255 256 if (property_exists($listing, "amenityCategories") && is_array($listing->amenityCategories)) 257 { 258 $match = $this->filter_array($listing->amenityCategories, function ($x, $args) { 259 return !strcasecmp($args, $x->type); 260 }, $category); 261 262 if (!empty($match)) { 263 return $this->get_amenities_list($match[0]->amenities); 264 } 265 else { 266 return ""; 267 } 268 } 269 270 return "[The current ownerrez api does not support type: widget_amenities_category]"; 271 } 272 273 function type_widget_listing_details($attrs, $content, $additionalArgs) 274 { 275 $listing = $this->get_resource($attrs, "listings", $this->get_id($attrs, "orp"), "summary", ["includeDescriptions"=>"true", "includeAmenities"=>"true"]); 276 277 if (property_exists($listing, "amenityCategories") && is_array($listing->amenityCategories)) 278 { 279 $output = "<div class='ownerrez-listing-details'>"; 280 281 if (property_exists($listing, "amenitiesAdditionalInfo")) 282 $output .= "<div class='ownerrez-listing-details-additional-info'>" . $listing->amenitiesAdditionalInfo . "</div>"; 283 284 $output .= "<table class='ownerrez-amenities-table'>"; 285 286 foreach ($listing->amenityCategories as $category) 287 { 288 $output .= "<tr><th class='ownerrez-amenities-table-category-name'>" . $category->caption . "</th><td class='ownerrez-amenities-table-category-items'>"; 289 $output .= $this->get_amenities_list($category->amenities); 290 $output .= "</td>"; 291 } 292 293 return $output . "</table></div>"; 294 } 295 296 return "[The current ownerrez api does not support type: widget_listing_details]"; 297 } 298 299 /** 300 * @param $amenities 301 * @return string 302 */ 303 public function get_amenities_list($amenities): string 304 { 305 $ul = "<ul class='ownerrez-amenities-list'>"; 306 307 foreach ($amenities as $amenity) { 308 $ul .= "<li class='ownerrez-amenities-list-item'>" . $this->camelToTitle(ucfirst($amenity->text)); 309 if (!empty($amenity->title)) { 310 $ul .= '<i class="fas fa-info-circle" title="' . $amenity->title . '"></i>'; 311 } 312 $ul .= "</li>"; 313 } 314 315 $ul .= "</ul>"; 316 317 return $ul; 235 318 } 236 319 -
ownerrez/trunk/public/css/ownerrez-public.css
r2439293 r2450742 158 158 } 159 159 160 .ownerrez- amenities-list {160 .ownerrez-callout-amenities-list { 161 161 } 162 .ownerrez- amenities-list>li {162 .ownerrez-callout-amenities-list > li { 163 163 list-style: none; 164 164 margin: 0 20px 0 0; 165 165 display: inline-block; 166 166 } 167 .ownerrez-callout-amenities-list .fas { 168 margin-right: 5px; 169 } 170 167 171 .ownerrez-amenities-table { 168 172 border: none; … … 174 178 min-width: 150px; 175 179 } 176 .ownerrez-amenities- table-list {180 .ownerrez-amenities-list { 177 181 margin: 0; 178 182 padding: 0; 179 183 } 180 .ownerrez-amenities- table-list-item {184 .ownerrez-amenities-list-item { 181 185 margin: 0; 182 186 padding: 0; 183 187 list-style: none; 184 188 } 189 .ownerrez-amenities-list-item .fa-info-circle { 190 margin-left: 5px; 191 } -
ownerrez/trunk/readme.txt
r2444600 r2450742 4 4 Requires at least: 5.4 5 5 Tested up to: 5.6 6 Stable tag: 1. 0.56 Stable tag: 1.1.0 7 7 License: MIT 8 8 License URI: https://github.com/ownerrez/orez-wp/blob/master/LICENSE … … 32 32 1. Complete the registration information (username and personal access token) under Settings -> OwnerRez 33 33 34 == Frequently Asked Questions ==35 36 37 == Screenshots ==38 39 40 34 == Changelog == 35 = 1.1.0 = 36 - Added two new widget shortcodes. 37 - **Breaking** Modified css classes on existing widget shortcodes. 41 38 42 39 = 1.0.5 = 43 44 40 Fixed a bug that occurred when Wordpress was hosted in a subfolder named /ownerrez 45 41 46 42 == Upgrade Notice == 43 44 After upgrading to 1.1.0, please review any custom css you have added for OwnerRez widgets.
Note: See TracChangeset
for help on using the changeset viewer.