@@ -216,15 +216,15 @@ discard block |
||
| 216 | 216 | $this->api_username = false; |
| 217 | 217 | $this->api_password = false; |
| 218 | 218 | |
| 219 | - if (isset($temp_options['api']['wetu_api_key']) && '' !== $temp_options['api']['wetu_api_key']) { |
|
| 220 | - $this->api_key = $temp_options['api']['wetu_api_key']; |
|
| 221 | - } |
|
| 222 | - if (isset($temp_options['api']['wetu_api_username']) && '' !== $temp_options['api']['wetu_api_username']) { |
|
| 223 | - $this->api_username = $temp_options['api']['wetu_api_username']; |
|
| 224 | - } |
|
| 225 | - if (isset($temp_options['api']['wetu_api_password']) && '' !== $temp_options['api']['wetu_api_password']) { |
|
| 226 | - $this->api_password = $temp_options['api']['wetu_api_password']; |
|
| 227 | - } |
|
| 219 | + if (isset($temp_options['api']['wetu_api_key']) && '' !== $temp_options['api']['wetu_api_key']) { |
|
| 220 | + $this->api_key = $temp_options['api']['wetu_api_key']; |
|
| 221 | + } |
|
| 222 | + if (isset($temp_options['api']['wetu_api_username']) && '' !== $temp_options['api']['wetu_api_username']) { |
|
| 223 | + $this->api_username = $temp_options['api']['wetu_api_username']; |
|
| 224 | + } |
|
| 225 | + if (isset($temp_options['api']['wetu_api_password']) && '' !== $temp_options['api']['wetu_api_password']) { |
|
| 226 | + $this->api_password = $temp_options['api']['wetu_api_password']; |
|
| 227 | + } |
|
| 228 | 228 | |
| 229 | 229 | //Set the tab slug |
| 230 | 230 | if(isset($_GET['tab']) || isset($_POST['type'])) { |
@@ -240,22 +240,22 @@ discard block |
||
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | //Set the scaling options |
| 243 | - if (isset($temp_options[$this->plugin_slug]) && !empty($temp_options[$this->plugin_slug]) && isset($this->options['image_scaling'])) { |
|
| 244 | - $this->scale_images = true; |
|
| 245 | - $width = '1024'; |
|
| 246 | - if (isset($this->options['width']) && '' !== $this->options['width']) { |
|
| 247 | - $width = $this->options['width']; |
|
| 248 | - } |
|
| 249 | - $height = '768'; |
|
| 250 | - if (isset($this->options['height']) && '' !== $this->options['height']) { |
|
| 251 | - $height = $this->options['height']; |
|
| 252 | - } |
|
| 253 | - $cropping = 'w'; |
|
| 254 | - if (isset($this->options['cropping']) && '' !== $this->options['cropping']) { |
|
| 255 | - $cropping = $this->options['cropping']; |
|
| 256 | - } |
|
| 257 | - $this->image_scaling_url = 'https://wetu.com/ImageHandler/' . $cropping . $width . 'x' . $height . '/'; |
|
| 258 | - } |
|
| 243 | + if (isset($temp_options[$this->plugin_slug]) && !empty($temp_options[$this->plugin_slug]) && isset($this->options['image_scaling'])) { |
|
| 244 | + $this->scale_images = true; |
|
| 245 | + $width = '1024'; |
|
| 246 | + if (isset($this->options['width']) && '' !== $this->options['width']) { |
|
| 247 | + $width = $this->options['width']; |
|
| 248 | + } |
|
| 249 | + $height = '768'; |
|
| 250 | + if (isset($this->options['height']) && '' !== $this->options['height']) { |
|
| 251 | + $height = $this->options['height']; |
|
| 252 | + } |
|
| 253 | + $cropping = 'w'; |
|
| 254 | + if (isset($this->options['cropping']) && '' !== $this->options['cropping']) { |
|
| 255 | + $cropping = $this->options['cropping']; |
|
| 256 | + } |
|
| 257 | + $this->image_scaling_url = 'https://wetu.com/ImageHandler/' . $cropping . $width . 'x' . $height . '/'; |
|
| 258 | + } |
|
| 259 | 259 | |
| 260 | 260 | } |
| 261 | 261 | } |
@@ -329,10 +329,10 @@ discard block |
||
| 329 | 329 | |
| 330 | 330 | // DISPLAY FUNCTIONS |
| 331 | 331 | |
| 332 | - /* |
|
| 332 | + /* |
|
| 333 | 333 | * Load the importer class you want to use |
| 334 | 334 | */ |
| 335 | - public function load_class(){ |
|
| 335 | + public function load_class(){ |
|
| 336 | 336 | |
| 337 | 337 | switch($this->tab_slug){ |
| 338 | 338 | case 'accommodation': |
@@ -352,7 +352,7 @@ discard block |
||
| 352 | 352 | break; |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | - } |
|
| 355 | + } |
|
| 356 | 356 | |
| 357 | 357 | /** |
| 358 | 358 | * Registers the admin page which will house the importer form. |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | <?php*/ |
| 409 | 409 | }else{ |
| 410 | 410 | $this->current_importer->display_page(); |
| 411 | - }; ?> |
|
| 411 | + }; ?> |
|
| 412 | 412 | </div> |
| 413 | 413 | <?php |
| 414 | 414 | } |
@@ -808,12 +808,12 @@ discard block |
||
| 808 | 808 | */ |
| 809 | 809 | public function set_featured_image($data,$id) { |
| 810 | 810 | if(is_array($data[0]['content']['images']) && !empty($data[0]['content']['images'])){ |
| 811 | - if('tour' === $this->tab_slug){ |
|
| 812 | - $key = array_rand($data[0]['content']['images']); |
|
| 813 | - $this->featured_image = $this->attach_image($data[0]['content']['images'][$key],$id); |
|
| 814 | - }else{ |
|
| 811 | + if('tour' === $this->tab_slug){ |
|
| 812 | + $key = array_rand($data[0]['content']['images']); |
|
| 813 | + $this->featured_image = $this->attach_image($data[0]['content']['images'][$key],$id); |
|
| 814 | + }else{ |
|
| 815 | 815 | $this->featured_image = $this->attach_image($data[0]['content']['images'][0],$id); |
| 816 | - } |
|
| 816 | + } |
|
| 817 | 817 | |
| 818 | 818 | |
| 819 | 819 | if(false !== $this->featured_image){ |
@@ -833,7 +833,7 @@ discard block |
||
| 833 | 833 | */ |
| 834 | 834 | public function set_banner_image($data,$id) { |
| 835 | 835 | if(is_array($data[0]['content']['images']) && !empty($data[0]['content']['images'])){ |
| 836 | - if(isset($data[0]['destination_image']) && is_array($data[0]['destination_image'])) { |
|
| 836 | + if(isset($data[0]['destination_image']) && is_array($data[0]['destination_image'])) { |
|
| 837 | 837 | $temp_banner = $this->attach_image($data[0]['destination_image'], $id, array('width' => '1920', 'height' => '600', 'cropping' => 'c')); |
| 838 | 838 | }else{ |
| 839 | 839 | if ('tour' === $this->tab_slug) { |
@@ -842,7 +842,7 @@ discard block |
||
| 842 | 842 | } else { |
| 843 | 843 | $temp_banner = $this->attach_image($data[0]['content']['images'][1], $id, array('width' => '1920', 'height' => '600', 'cropping' => 'c')); |
| 844 | 844 | } |
| 845 | - } |
|
| 845 | + } |
|
| 846 | 846 | |
| 847 | 847 | |
| 848 | 848 | if(false !== $temp_banner){ |
@@ -1054,7 +1054,7 @@ discard block |
||
| 1054 | 1054 | * Run through the accommodation grabbed from the DB. |
| 1055 | 1055 | */ |
| 1056 | 1056 | public function process_ajax_search() { |
| 1057 | - $this->current_importer->process_ajax_search(); |
|
| 1057 | + $this->current_importer->process_ajax_search(); |
|
| 1058 | 1058 | die(); |
| 1059 | 1059 | } |
| 1060 | 1060 | |