@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | $this->api_username = false; |
| 217 | 217 | $this->api_password = false; |
| 218 | 218 | |
| 219 | - if(!defined('WETU_API_KEY')) { |
|
| 219 | + if(!defined('WETU_API_KEY')) { |
|
| 220 | 220 | |
| 221 | 221 | if (isset($temp_options['api']['wetu_api_key']) && '' !== $temp_options['api']['wetu_api_key']) { |
| 222 | 222 | $this->api_key = $temp_options['api']['wetu_api_key']; |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | }else{ |
| 231 | 231 | $this->api_key = WETU_API_KEY; |
| 232 | - } |
|
| 232 | + } |
|
| 233 | 233 | |
| 234 | 234 | //Set the tab slug |
| 235 | 235 | if(isset($_GET['tab']) || isset($_POST['type'])) { |
@@ -245,22 +245,22 @@ discard block |
||
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | //Set the scaling options |
| 248 | - if (isset($temp_options[$this->plugin_slug]) && !empty($temp_options[$this->plugin_slug]) && isset($this->options['image_scaling'])) { |
|
| 249 | - $this->scale_images = true; |
|
| 250 | - $width = '1024'; |
|
| 251 | - if (isset($this->options['width']) && '' !== $this->options['width']) { |
|
| 252 | - $width = $this->options['width']; |
|
| 253 | - } |
|
| 254 | - $height = '768'; |
|
| 255 | - if (isset($this->options['height']) && '' !== $this->options['height']) { |
|
| 256 | - $height = $this->options['height']; |
|
| 257 | - } |
|
| 258 | - $cropping = 'w'; |
|
| 259 | - if (isset($this->options['cropping']) && '' !== $this->options['cropping']) { |
|
| 260 | - $cropping = $this->options['cropping']; |
|
| 261 | - } |
|
| 262 | - $this->image_scaling_url = 'https://wetu.com/ImageHandler/' . $cropping . $width . 'x' . $height . '/'; |
|
| 263 | - } |
|
| 248 | + if (isset($temp_options[$this->plugin_slug]) && !empty($temp_options[$this->plugin_slug]) && isset($this->options['image_scaling'])) { |
|
| 249 | + $this->scale_images = true; |
|
| 250 | + $width = '1024'; |
|
| 251 | + if (isset($this->options['width']) && '' !== $this->options['width']) { |
|
| 252 | + $width = $this->options['width']; |
|
| 253 | + } |
|
| 254 | + $height = '768'; |
|
| 255 | + if (isset($this->options['height']) && '' !== $this->options['height']) { |
|
| 256 | + $height = $this->options['height']; |
|
| 257 | + } |
|
| 258 | + $cropping = 'w'; |
|
| 259 | + if (isset($this->options['cropping']) && '' !== $this->options['cropping']) { |
|
| 260 | + $cropping = $this->options['cropping']; |
|
| 261 | + } |
|
| 262 | + $this->image_scaling_url = 'https://wetu.com/ImageHandler/' . $cropping . $width . 'x' . $height . '/'; |
|
| 263 | + } |
|
| 264 | 264 | |
| 265 | 265 | } |
| 266 | 266 | } |
@@ -334,10 +334,10 @@ discard block |
||
| 334 | 334 | |
| 335 | 335 | // DISPLAY FUNCTIONS |
| 336 | 336 | |
| 337 | - /* |
|
| 337 | + /* |
|
| 338 | 338 | * Load the importer class you want to use |
| 339 | 339 | */ |
| 340 | - public function load_class(){ |
|
| 340 | + public function load_class(){ |
|
| 341 | 341 | |
| 342 | 342 | switch($this->tab_slug){ |
| 343 | 343 | case 'accommodation': |
@@ -357,7 +357,7 @@ discard block |
||
| 357 | 357 | break; |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | - } |
|
| 360 | + } |
|
| 361 | 361 | |
| 362 | 362 | /** |
| 363 | 363 | * Registers the admin page which will house the importer form. |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | <?php*/ |
| 414 | 414 | }else{ |
| 415 | 415 | $this->current_importer->display_page(); |
| 416 | - }; ?> |
|
| 416 | + }; ?> |
|
| 417 | 417 | </div> |
| 418 | 418 | <?php |
| 419 | 419 | } |
@@ -813,12 +813,12 @@ discard block |
||
| 813 | 813 | */ |
| 814 | 814 | public function set_featured_image($data,$id) { |
| 815 | 815 | if(is_array($data[0]['content']['images']) && !empty($data[0]['content']['images'])){ |
| 816 | - if('tour' === $this->tab_slug){ |
|
| 817 | - $key = array_rand($data[0]['content']['images']); |
|
| 818 | - $this->featured_image = $this->attach_image($data[0]['content']['images'][$key],$id); |
|
| 819 | - }else{ |
|
| 816 | + if('tour' === $this->tab_slug){ |
|
| 817 | + $key = array_rand($data[0]['content']['images']); |
|
| 818 | + $this->featured_image = $this->attach_image($data[0]['content']['images'][$key],$id); |
|
| 819 | + }else{ |
|
| 820 | 820 | $this->featured_image = $this->attach_image($data[0]['content']['images'][0],$id); |
| 821 | - } |
|
| 821 | + } |
|
| 822 | 822 | |
| 823 | 823 | |
| 824 | 824 | if(false !== $this->featured_image){ |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | */ |
| 839 | 839 | public function set_banner_image($data,$id) { |
| 840 | 840 | if(is_array($data[0]['content']['images']) && !empty($data[0]['content']['images'])){ |
| 841 | - if(isset($data[0]['destination_image']) && is_array($data[0]['destination_image'])) { |
|
| 841 | + if(isset($data[0]['destination_image']) && is_array($data[0]['destination_image'])) { |
|
| 842 | 842 | $temp_banner = $this->attach_image($data[0]['destination_image'], $id, array('width' => '1920', 'height' => '600', 'cropping' => 'c')); |
| 843 | 843 | }else{ |
| 844 | 844 | if ('tour' === $this->tab_slug) { |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | } else { |
| 848 | 848 | $temp_banner = $this->attach_image($data[0]['content']['images'][1], $id, array('width' => '1920', 'height' => '600', 'cropping' => 'c')); |
| 849 | 849 | } |
| 850 | - } |
|
| 850 | + } |
|
| 851 | 851 | |
| 852 | 852 | |
| 853 | 853 | if(false !== $temp_banner){ |
@@ -1059,7 +1059,7 @@ discard block |
||
| 1059 | 1059 | * Run through the accommodation grabbed from the DB. |
| 1060 | 1060 | */ |
| 1061 | 1061 | public function process_ajax_search() { |
| 1062 | - $this->current_importer->process_ajax_search(); |
|
| 1062 | + $this->current_importer->process_ajax_search(); |
|
| 1063 | 1063 | die(); |
| 1064 | 1064 | } |
| 1065 | 1065 | |