public
Last active

added image resize type to image part of setting/setting. added product option image size config to image part of setting/setting. added the same options to settings/store. For opencart

  • Download Gist
my1.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524
commit b72d71d36f0e851b82d0486f19013ffda5b48a5d
Author: Haydar Kulekci <haydar.kulekci@reformo.net>
Date: Sun Jan 6 04:20:15 2013 +0200
 
added image resize type to image part of setting/setting.
added product option image size config to image part of setting/setting.
i will add the same options to settings/store.
 
diff --git a/upload/admin/controller/setting/setting.php b/upload/admin/controller/setting/setting.php
index dbfc32c..d58a2a7 100644
--- a/upload/admin/controller/setting/setting.php
+++ b/upload/admin/controller/setting/setting.php
@@ -45,6 +45,10 @@ class ControllerSettingSetting extends Controller {
$this->data['text_payment'] = $this->language->get('text_payment');
$this->data['text_mail'] = $this->language->get('text_mail');
$this->data['text_smtp'] = $this->language->get('text_smtp');
+
+ $this->data['img_resize_type_d'] = $this->language->get('img_resize_type_d');
+ $this->data['img_resize_type_w'] = $this->language->get('img_resize_type_w');
+ $this->data['img_resize_type_h'] = $this->language->get('img_resize_type_h');
$this->data['entry_name'] = $this->language->get('entry_name');
$this->data['entry_owner'] = $this->language->get('entry_owner');
@@ -103,6 +107,7 @@ class ControllerSettingSetting extends Controller {
$this->data['entry_image_product'] = $this->language->get('entry_image_product');
$this->data['entry_image_additional'] = $this->language->get('entry_image_additional');
$this->data['entry_image_related'] = $this->language->get('entry_image_related');
+ $this->data['entry_image_option'] = $this->language->get('entry_image_option');
$this->data['entry_image_compare'] = $this->language->get('entry_image_compare');
$this->data['entry_image_wishlist'] = $this->language->get('entry_image_wishlist');
$this->data['entry_image_cart'] = $this->language->get('entry_image_cart');
@@ -274,6 +279,12 @@ class ControllerSettingSetting extends Controller {
$this->data['error_image_related'] = '';
}
+ if (isset($this->error['image_option'])) {
+ $this->data['error_image_option'] = $this->error['image_option'];
+ } else {
+ $this->data['error_image_option'] = '';
+ }
+
if (isset($this->error['image_compare'])) {
$this->data['error_image_compare'] = $this->error['image_compare'];
} else {
@@ -737,6 +748,12 @@ class ControllerSettingSetting extends Controller {
} else {
$this->data['config_image_category_height'] = $this->config->get('config_image_category_height');
}
+
+ if (isset($this->request->post['config_image_category_resize_type'])) {
+ $this->data['config_image_category_resize_type'] = $this->request->post['config_image_category_resize_type'];
+ } else {
+ $this->data['config_image_category_resize_type'] = $this->config->get('config_image_category_resize_type');
+ }
if (isset($this->request->post['config_image_thumb_width'])) {
$this->data['config_image_thumb_width'] = $this->request->post['config_image_thumb_width'];
@@ -750,6 +767,12 @@ class ControllerSettingSetting extends Controller {
$this->data['config_image_thumb_height'] = $this->config->get('config_image_thumb_height');
}
+ if (isset($this->request->post['config_image_thumb_resize_type'])) {
+ $this->data['config_image_thumb_resize_type'] = $this->request->post['config_image_thumb_resize_type'];
+ } else {
+ $this->data['config_image_thumb_resize_type'] = $this->config->get('config_image_thumb_resize_type');
+ }
+
if (isset($this->request->post['config_image_popup_width'])) {
$this->data['config_image_popup_width'] = $this->request->post['config_image_popup_width'];
} else {
@@ -762,6 +785,12 @@ class ControllerSettingSetting extends Controller {
$this->data['config_image_popup_height'] = $this->config->get('config_image_popup_height');
}
+ if (isset($this->request->post['config_image_popup_resize_type'])) {
+ $this->data['config_image_popup_resize_type'] = $this->request->post['config_image_popup_resize_type'];
+ } else {
+ $this->data['config_image_popup_resize_type'] = $this->config->get('config_image_popup_resize_type');
+ }
+
if (isset($this->request->post['config_image_product_width'])) {
$this->data['config_image_product_width'] = $this->request->post['config_image_product_width'];
} else {
@@ -773,6 +802,12 @@ class ControllerSettingSetting extends Controller {
} else {
$this->data['config_image_product_height'] = $this->config->get('config_image_product_height');
}
+
+ if (isset($this->request->post['config_image_product_resize_type'])) {
+ $this->data['config_image_product_resize_type'] = $this->request->post['config_image_product_resize_type'];
+ } else {
+ $this->data['config_image_product_resize_type'] = $this->config->get('config_image_product_resize_type');
+ }
if (isset($this->request->post['config_image_additional_width'])) {
$this->data['config_image_additional_width'] = $this->request->post['config_image_additional_width'];
@@ -786,6 +821,12 @@ class ControllerSettingSetting extends Controller {
$this->data['config_image_additional_height'] = $this->config->get('config_image_additional_height');
}
+ if (isset($this->request->post['config_image_additional_resize_type'])) {
+ $this->data['config_image_additional_resize_type'] = $this->request->post['config_image_additional_resize_type'];
+ } else {
+ $this->data['config_image_additional_resize_type'] = $this->config->get('config_image_additional_resize_type');
+ }
+
if (isset($this->request->post['config_image_related_width'])) {
$this->data['config_image_related_width'] = $this->request->post['config_image_related_width'];
} else {
@@ -798,6 +839,30 @@ class ControllerSettingSetting extends Controller {
$this->data['config_image_related_height'] = $this->config->get('config_image_related_height');
}
+ if (isset($this->request->post['config_image_related_resize_type'])) {
+ $this->data['config_image_related_resize_type'] = $this->request->post['config_image_related_resize_type'];
+ } else {
+ $this->data['config_image_related_resize_type'] = $this->config->get('config_image_related_resize_type');
+ }
+
+ if (isset($this->request->post['config_image_option_width'])) {
+ $this->data['config_image_option_width'] = $this->request->post['config_image_option_width'];
+ } else {
+ $this->data['config_image_option_width'] = $this->config->get('config_image_option_width');
+ }
+
+ if (isset($this->request->post['config_image_option_height'])) {
+ $this->data['config_image_option_height'] = $this->request->post['config_image_option_height'];
+ } else {
+ $this->data['config_image_option_height'] = $this->config->get('config_image_option_height');
+ }
+
+ if (isset($this->request->post['config_image_option_resize_type'])) {
+ $this->data['config_image_option_resize_type'] = $this->request->post['config_image_option_resize_type'];
+ } else {
+ $this->data['config_image_option_resize_type'] = $this->config->get('config_image_option_resize_type');
+ }
+
if (isset($this->request->post['config_image_compare_width'])) {
$this->data['config_image_compare_width'] = $this->request->post['config_image_compare_width'];
} else {
@@ -810,6 +875,12 @@ class ControllerSettingSetting extends Controller {
$this->data['config_image_compare_height'] = $this->config->get('config_image_compare_height');
}
+ if (isset($this->request->post['config_image_compare_resize_type'])) {
+ $this->data['config_image_compare_resize_type'] = $this->request->post['config_image_compare_resize_type'];
+ } else {
+ $this->data['config_image_compare_resize_type'] = $this->config->get('config_image_compare_resize_type');
+ }
+
if (isset($this->request->post['config_image_wishlist_width'])) {
$this->data['config_image_wishlist_width'] = $this->request->post['config_image_wishlist_width'];
} else {
@@ -821,6 +892,12 @@ class ControllerSettingSetting extends Controller {
} else {
$this->data['config_image_wishlist_height'] = $this->config->get('config_image_wishlist_height');
}
+
+ if (isset($this->request->post['config_image_wishlist_resize_type'])) {
+ $this->data['config_image_wishlist_resize_type'] = $this->request->post['config_image_wishlist_resize_type'];
+ } else {
+ $this->data['config_image_wishlist_resize_type'] = $this->config->get('config_image_wishlist_resize_type');
+ }
if (isset($this->request->post['config_image_cart_width'])) {
$this->data['config_image_cart_width'] = $this->request->post['config_image_cart_width'];
@@ -832,6 +909,12 @@ class ControllerSettingSetting extends Controller {
$this->data['config_image_cart_height'] = $this->request->post['config_image_cart_height'];
} else {
$this->data['config_image_cart_height'] = $this->config->get('config_image_cart_height');
+ }
+
+ if (isset($this->request->post['config_image_cart_resize_type'])) {
+ $this->data['config_image_cart_resize_type'] = $this->request->post['config_image_cart_resize_type'];
+ } else {
+ $this->data['config_image_cart_resize_type'] = $this->config->get('config_image_cart_resize_type');
}
if (isset($this->request->post['config_ftp_host'])) {
@@ -1120,6 +1203,10 @@ class ControllerSettingSetting extends Controller {
$this->error['image_related'] = $this->language->get('error_image_related');
}
+ if (!$this->request->post['config_image_related_width'] || !$this->request->post['config_image_option_height']) {
+ $this->error['image_option'] = $this->language->get('error_image_option');
+ }
+
if (!$this->request->post['config_image_compare_width'] || !$this->request->post['config_image_compare_height']) {
$this->error['image_compare'] = $this->language->get('error_image_compare');
}
diff --git a/upload/admin/language/english/setting/setting.php b/upload/admin/language/english/setting/setting.php
index 569264f..4ea0064 100644
--- a/upload/admin/language/english/setting/setting.php
+++ b/upload/admin/language/english/setting/setting.php
@@ -79,6 +79,7 @@ $_['entry_image_popup'] = 'Product Image Popup Size:';
$_['entry_image_product'] = 'Product Image List Size:';
$_['entry_image_additional'] = 'Additional Product Image Size:';
$_['entry_image_related'] = 'Related Product Image Size:';
+$_['entry_image_option'] = 'Product Option Image Size:';
$_['entry_image_compare'] = 'Compare Image Size:';
$_['entry_image_wishlist'] = 'Wish List Image Size:';
$_['entry_image_cart'] = 'Cart Image Size:';
@@ -136,6 +137,7 @@ $_['error_image_product'] = 'Product List Size dimensions required!';
$_['error_image_category'] = 'Category List Size dimensions required!';
$_['error_image_additional'] = 'Additional Product Image Size dimensions required!';
$_['error_image_related'] = 'Related Product Image Size dimensions required!';
+$_['error_image_option'] = 'Product Option Image Size dimensions required!';
$_['error_image_compare'] = 'Compare Image Size dimensions required!';
$_['error_image_wishlist'] = 'Wish List Image Size dimensions required!';
$_['error_image_cart'] = 'Cart Image Size dimensions required!';
diff --git a/upload/admin/view/template/setting/setting.tpl b/upload/admin/view/template/setting/setting.tpl
index 112341a..fd82c22 100644
--- a/upload/admin/view/template/setting/setting.tpl
+++ b/upload/admin/view/template/setting/setting.tpl
@@ -623,6 +623,11 @@
<td><input type="text" name="config_image_category_width" value="<?php echo $config_image_category_width; ?>" size="3" />
x
<input type="text" name="config_image_category_height" value="<?php echo $config_image_category_height; ?>" size="3" />
+ <select name="config_image_category_resize_type">
+ <option value="default"<?php echo ( ($config_image_category_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_category_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_category_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_category) { ?>
<span class="error"><?php echo $error_image_category; ?></span>
<?php } ?></td>
@@ -632,6 +637,11 @@
<td><input type="text" name="config_image_thumb_width" value="<?php echo $config_image_thumb_width; ?>" size="3" />
x
<input type="text" name="config_image_thumb_height" value="<?php echo $config_image_thumb_height; ?>" size="3" />
+ <select name="config_image_thumb_resize_type">
+ <option value="default"<?php echo ( ($config_image_thumb_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_thumb_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_thumb_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_thumb) { ?>
<span class="error"><?php echo $error_image_thumb; ?></span>
<?php } ?></td>
@@ -641,6 +651,11 @@
<td><input type="text" name="config_image_popup_width" value="<?php echo $config_image_popup_width; ?>" size="3" />
x
<input type="text" name="config_image_popup_height" value="<?php echo $config_image_popup_height; ?>" size="3" />
+ <select name="config_image_popup_resize_type">
+ <option value="default"<?php echo ( ($config_image_popup_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_popup_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_popup_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_popup) { ?>
<span class="error"><?php echo $error_image_popup; ?></span>
<?php } ?></td>
@@ -650,6 +665,11 @@
<td><input type="text" name="config_image_product_width" value="<?php echo $config_image_product_width; ?>" size="3" />
x
<input type="text" name="config_image_product_height" value="<?php echo $config_image_product_height; ?>" size="3" />
+ <select name="config_image_product_resize_type">
+ <option value="default"<?php echo ( ($config_image_product_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_product_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_product_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_product) { ?>
<span class="error"><?php echo $error_image_product; ?></span>
<?php } ?></td>
@@ -659,6 +679,11 @@
<td><input type="text" name="config_image_additional_width" value="<?php echo $config_image_additional_width; ?>" size="3" />
x
<input type="text" name="config_image_additional_height" value="<?php echo $config_image_additional_height; ?>" size="3" />
+ <select name="config_image_additional_resize_type">
+ <option value="default"<?php echo ( ($config_image_additional_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_additional_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_additional_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_additional) { ?>
<span class="error"><?php echo $error_image_additional; ?></span>
<?php } ?></td>
@@ -668,15 +693,39 @@
<td><input type="text" name="config_image_related_width" value="<?php echo $config_image_related_width; ?>" size="3" />
x
<input type="text" name="config_image_related_height" value="<?php echo $config_image_related_height; ?>" size="3" />
+ <select name="config_image_related_resize_type">
+ <option value="default"<?php echo ( ($config_image_related_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_related_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_related_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_related) { ?>
<span class="error"><?php echo $error_image_related; ?></span>
<?php } ?></td>
</tr>
<tr>
+ <td><span class="required">*</span> <?php echo $entry_image_option; ?></td>
+ <td><input type="text" name="config_image_option_width" value="<?php echo $config_image_option_width; ?>" size="3" />
+ x
+ <input type="text" name="config_image_option_height" value="<?php echo $config_image_option_height; ?>" size="3" />
+ <select name="config_image_option_resize_type">
+ <option value="default"<?php echo ( ($config_image_option_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_option_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_option_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
+ <?php if ($error_image_option) { ?>
+ <span class="error"><?php echo $error_image_option; ?></span>
+ <?php } ?></td>
+ </tr>
+ <tr>
<td><span class="required">*</span> <?php echo $entry_image_compare; ?></td>
<td><input type="text" name="config_image_compare_width" value="<?php echo $config_image_compare_width; ?>" size="3" />
x
<input type="text" name="config_image_compare_height" value="<?php echo $config_image_compare_height; ?>" size="3" />
+ <select name="config_image_compare_resize_type">
+ <option value="default"<?php echo ( ($config_image_compare_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_compare_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_compare_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_compare) { ?>
<span class="error"><?php echo $error_image_compare; ?></span>
<?php } ?></td>
@@ -686,6 +735,11 @@
<td><input type="text" name="config_image_wishlist_width" value="<?php echo $config_image_wishlist_width; ?>" size="3" />
x
<input type="text" name="config_image_wishlist_height" value="<?php echo $config_image_wishlist_height; ?>" size="3" />
+ <select name="config_image_wishlist_resize_type">
+ <option value="default"<?php echo ( ($config_image_wishlist_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_wishlist_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_wishlist_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_wishlist) { ?>
<span class="error"><?php echo $error_image_wishlist; ?></span>
<?php } ?></td>
@@ -695,6 +749,11 @@
<td><input type="text" name="config_image_cart_width" value="<?php echo $config_image_cart_width; ?>" size="3" />
x
<input type="text" name="config_image_cart_height" value="<?php echo $config_image_cart_height; ?>" size="3" />
+ <select name="config_image_cart_resize_type">
+ <option value="default"<?php echo ( ($config_image_cart_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_cart_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_cart_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_cart) { ?>
<span class="error"><?php echo $error_image_cart; ?></span>
<?php } ?></td>
diff --git a/upload/catalog/controller/account/wishlist.php b/upload/catalog/controller/account/wishlist.php
index 4d6f299..f9c4e4b 100644
--- a/upload/catalog/controller/account/wishlist.php
+++ b/upload/catalog/controller/account/wishlist.php
@@ -81,7 +81,7 @@ class ControllerAccountWishList extends Controller {
if ($product_info) {
if ($product_info['image']) {
- $image = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_wishlist_width'), $this->config->get('config_image_wishlist_height'));
+ $image = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_wishlist_width'), $this->config->get('config_image_wishlist_height'), $this->config->get('config_image_wishlist_resize_type'));
} else {
$image = false;
}
diff --git a/upload/catalog/controller/checkout/cart.php b/upload/catalog/controller/checkout/cart.php
index e1d0330..e6f3aaa 100644
--- a/upload/catalog/controller/checkout/cart.php
+++ b/upload/catalog/controller/checkout/cart.php
@@ -195,7 +195,7 @@ class ControllerCheckoutCart extends Controller {
}
if ($product['image']) {
- $image = $this->model_tool_image->resize($product['image'], $this->config->get('config_image_cart_width'), $this->config->get('config_image_cart_height'));
+ $image = $this->model_tool_image->resize($product['image'], $this->config->get('config_image_cart_width'), $this->config->get('config_image_cart_height'), $this->config->get('config_image_cart_resize_type'));
} else {
$image = '';
}
diff --git a/upload/catalog/controller/module/cart.php b/upload/catalog/controller/module/cart.php
index caf628f..b612406 100644
--- a/upload/catalog/controller/module/cart.php
+++ b/upload/catalog/controller/module/cart.php
@@ -62,7 +62,7 @@ class ControllerModuleCart extends Controller {
foreach ($this->cart->getProducts() as $product) {
if ($product['image']) {
- $image = $this->model_tool_image->resize($product['image'], $this->config->get('config_image_cart_width'), $this->config->get('config_image_cart_height'));
+ $image = $this->model_tool_image->resize($product['image'], $this->config->get('config_image_cart_width'), $this->config->get('config_image_cart_height'), $this->config->get('config_image_cart_resize_type'));
} else {
$image = '';
}
diff --git a/upload/catalog/controller/product/category.php b/upload/catalog/controller/product/category.php
index bf27588..8e2e1cf 100644
--- a/upload/catalog/controller/product/category.php
+++ b/upload/catalog/controller/product/category.php
@@ -145,7 +145,7 @@ class ControllerProductCategory extends Controller {
);
if ($category_info['image']) {
- $this->data['thumb'] = $this->model_tool_image->resize($category_info['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'));
+ $this->data['thumb'] = $this->model_tool_image->resize($category_info['image'], $this->config->get('config_image_category_width'), $this->config->get('config_image_category_height'), $this->config->get('config_image_category_resize_type'));
} else {
$this->data['thumb'] = '';
}
@@ -206,7 +206,7 @@ class ControllerProductCategory extends Controller {
foreach ($results as $result) {
if ($result['image']) {
- $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
+ $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'), $this->config->get('config_image_product_resize_type'));
} else {
$image = false;
}
diff --git a/upload/catalog/controller/product/compare.php b/upload/catalog/controller/product/compare.php
index e7af1bd..2c2f370 100644
--- a/upload/catalog/controller/product/compare.php
+++ b/upload/catalog/controller/product/compare.php
@@ -77,7 +77,7 @@ class ControllerProductCompare extends Controller {
if ($product_info) {
if ($product_info['image']) {
- $image = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_compare_width'), $this->config->get('config_image_compare_height'));
+ $image = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_compare_width'), $this->config->get('config_image_compare_height'), $this->config->get('config_image_compare_resize_type'));
} else {
$image = false;
}
diff --git a/upload/catalog/controller/product/manufacturer.php b/upload/catalog/controller/product/manufacturer.php
index f732cc2..ac02f46 100644
--- a/upload/catalog/controller/product/manufacturer.php
+++ b/upload/catalog/controller/product/manufacturer.php
@@ -193,7 +193,7 @@ class ControllerProductManufacturer extends Controller {
foreach ($results as $result) {
if ($result['image']) {
- $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
+ $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'), $this->config->get('config_image_product_resize_type'));
} else {
$image = false;
}
diff --git a/upload/catalog/controller/product/product.php b/upload/catalog/controller/product/product.php
index a18f7de..972b281 100644
--- a/upload/catalog/controller/product/product.php
+++ b/upload/catalog/controller/product/product.php
@@ -289,13 +289,13 @@ class ControllerProductProduct extends Controller {
$this->load->model('tool/image');
if ($product_info['image']) {
- $this->data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'));
+ $this->data['popup'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'), $this->config->get('config_image_popup_resize_type'));
} else {
$this->data['popup'] = '';
}
if ($product_info['image']) {
- $this->data['thumb'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'));
+ $this->data['thumb'] = $this->model_tool_image->resize($product_info['image'], $this->config->get('config_image_thumb_width'), $this->config->get('config_image_thumb_height'), $this->config->get('config_image_thumb_resize_type'));
} else {
$this->data['thumb'] = '';
}
@@ -306,8 +306,8 @@ class ControllerProductProduct extends Controller {
foreach ($results as $result) {
$this->data['images'][] = array(
- 'popup' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height')),
- 'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height'))
+ 'popup' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_popup_width'), $this->config->get('config_image_popup_height'), $this->config->get('config_image_popup_resize_type')),
+ 'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get('config_image_additional_width'), $this->config->get('config_image_additional_height'), $this->config->get('config_image_additional_resize_type'))
);
}
@@ -358,7 +358,7 @@ class ControllerProductProduct extends Controller {
'product_option_value_id' => $option_value['product_option_value_id'],
'option_value_id' => $option_value['option_value_id'],
'name' => $option_value['name'],
- 'image' => $this->model_tool_image->resize($option_value['image'], 50, 50),
+ 'image' => $this->model_tool_image->resize($option_value['image'], $this->config->get('config_image_option_width'), $this->config->get('config_image_option_height'), $this->config->get('config_image_option_resize_type')),
'price' => $price,
'price_prefix' => $option_value['price_prefix']
);
@@ -403,7 +403,7 @@ class ControllerProductProduct extends Controller {
foreach ($results as $result) {
if ($result['image']) {
- $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height'));
+ $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_related_width'), $this->config->get('config_image_related_height'), $this->config->get('config_image_related_resize_type'));
} else {
$image = false;
}
diff --git a/upload/catalog/controller/product/search.php b/upload/catalog/controller/product/search.php
index 13a7d0a..d652f51 100644
--- a/upload/catalog/controller/product/search.php
+++ b/upload/catalog/controller/product/search.php
@@ -219,7 +219,7 @@ class ControllerProductSearch extends Controller {
foreach ($results as $result) {
if ($result['image']) {
- $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
+ $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'), $this->config->get('config_image_product_resize_type'));
} else {
$image = false;
}
diff --git a/upload/catalog/controller/product/special.php b/upload/catalog/controller/product/special.php
index 22ba5a1..b2ad788 100644
--- a/upload/catalog/controller/product/special.php
+++ b/upload/catalog/controller/product/special.php
@@ -103,7 +103,7 @@ class ControllerProductSpecial extends Controller {
foreach ($results as $result) {
if ($result['image']) {
- $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'));
+ $image = $this->model_tool_image->resize($result['image'], $this->config->get('config_image_product_width'), $this->config->get('config_image_product_height'), $this->config->get('config_image_product_resize_type'));
} else {
$image = false;
}
diff --git a/upload/install/opencart.sql b/upload/install/opencart.sql
index c297457..05b32dc 100644
--- a/upload/install/opencart.sql
+++ b/upload/install/opencart.sql
@@ -3087,7 +3087,18 @@ INSERT INTO `oc_setting` (`setting_id`, `store_id`, `group`, `key`, `value`, `se
(127, 0, 'config', 'config_customer_group_display', 'a:1:{i:0;s:1:\"1\";}', 1),
(128, 0, 'config', 'config_robots', 'abot\r\ndbot\r\nebot\r\nhbot\r\nkbot\r\nlbot\r\nmbot\r\nnbot\r\nobot\r\npbot\r\nrbot\r\nsbot\r\ntbot\r\nvbot\r\nybot\r\nzbot\r\nbot.\r\nbot/\r\n_bot\r\n.bot\r\n/bot\r\n-bot\r\n:bot\r\n(bot\r\ncrawl\r\nslurp\r\nspider\r\nseek\r\naccoona\r\nacoon\r\nadressendeutschland\r\nah-ha.com\r\nahoy\r\naltavista\r\nananzi\r\nanthill\r\nappie\r\narachnophilia\r\narale\r\naraneo\r\naranha\r\narchitext\r\naretha\r\narks\r\nasterias\r\natlocal\r\natn\r\natomz\r\naugurfind\r\nbackrub\r\nbannana_bot\r\nbaypup\r\nbdfetch\r\nbig brother\r\nbiglotron\r\nbjaaland\r\nblackwidow\r\nblaiz\r\nblog\r\nblo.\r\nbloodhound\r\nboitho\r\nbooch\r\nbradley\r\nbutterfly\r\ncalif\r\ncassandra\r\nccubee\r\ncfetch\r\ncharlotte\r\nchurl\r\ncienciaficcion\r\ncmc\r\ncollective\r\ncomagent\r\ncombine\r\ncomputingsite\r\ncsci\r\ncurl\r\ncusco\r\ndaumoa\r\ndeepindex\r\ndelorie\r\ndepspid\r\ndeweb\r\ndie blinde kuh\r\ndigger\r\nditto\r\ndmoz\r\ndocomo\r\ndownload express\r\ndtaagent\r\ndwcp\r\nebiness\r\nebingbong\r\ne-collector\r\nejupiter\r\nemacs-w3 search engine\r\nesther\r\nevliya celebi\r\nezresult\r\nfalcon\r\nfelix ide\r\nferret\r\nfetchrover\r\nfido\r\nfindlinks\r\nfireball\r\nfish search\r\nfouineur\r\nfunnelweb\r\ngazz\r\ngcreep\r\ngenieknows\r\ngetterroboplus\r\ngeturl\r\nglx\r\ngoforit\r\ngolem\r\ngrabber\r\ngrapnel\r\ngralon\r\ngriffon\r\ngromit\r\ngrub\r\ngulliver\r\nhamahakki\r\nharvest\r\nhavindex\r\nhelix\r\nheritrix\r\nhku www octopus\r\nhomerweb\r\nhtdig\r\nhtml index\r\nhtml_analyzer\r\nhtmlgobble\r\nhubater\r\nhyper-decontextualizer\r\nia_archiver\r\nibm_planetwide\r\nichiro\r\niconsurf\r\niltrovatore\r\nimage.kapsi.net\r\nimagelock\r\nincywincy\r\nindexer\r\ninfobee\r\ninformant\r\ningrid\r\ninktomisearch.com\r\ninspector web\r\nintelliagent\r\ninternet shinchakubin\r\nip3000\r\niron33\r\nisraeli-search\r\nivia\r\njack\r\njakarta\r\njavabee\r\njetbot\r\njumpstation\r\nkatipo\r\nkdd-explorer\r\nkilroy\r\nknowledge\r\nkototoi\r\nkretrieve\r\nlabelgrabber\r\nlachesis\r\nlarbin\r\nlegs\r\nlibwww\r\nlinkalarm\r\nlink validator\r\nlinkscan\r\nlockon\r\nlwp\r\nlycos\r\nmagpie\r\nmantraagent\r\nmapoftheinternet\r\nmarvin/\r\nmattie\r\nmediafox\r\nmediapartners\r\nmercator\r\nmerzscope\r\nmicrosoft url control\r\nminirank\r\nmiva\r\nmj12\r\nmnogosearch\r\nmoget\r\nmonster\r\nmoose\r\nmotor\r\nmultitext\r\nmuncher\r\nmuscatferret\r\nmwd.search\r\nmyweb\r\nnajdi\r\nnameprotect\r\nnationaldirectory\r\nnazilla\r\nncsa beta\r\nnec-meshexplorer\r\nnederland.zoek\r\nnetcarta webmap engine\r\nnetmechanic\r\nnetresearchserver\r\nnetscoop\r\nnewscan-online\r\nnhse\r\nnokia6682/\r\nnomad\r\nnoyona\r\nnutch\r\nnzexplorer\r\nobjectssearch\r\noccam\r\nomni\r\nopen text\r\nopenfind\r\nopenintelligencedata\r\norb search\r\nosis-project\r\npack rat\r\npageboy\r\npagebull\r\npage_verifier\r\npanscient\r\nparasite\r\npartnersite\r\npatric\r\npear.\r\npegasus\r\nperegrinator\r\npgp key agent\r\nphantom\r\nphpdig\r\npicosearch\r\npiltdownman\r\npimptrain\r\npinpoint\r\npioneer\r\npiranha\r\nplumtreewebaccessor\r\npogodak\r\npoirot\r\npompos\r\npoppelsdorf\r\npoppi\r\npopular iconoclast\r\npsycheclone\r\npublisher\r\npython\r\nrambler\r\nraven search\r\nroach\r\nroad runner\r\nroadhouse\r\nrobbie\r\nrobofox\r\nrobozilla\r\nrules\r\nsalty\r\nsbider\r\nscooter\r\nscoutjet\r\nscrubby\r\nsearch.\r\nsearchprocess\r\nsemanticdiscovery\r\nsenrigan\r\nsg-scout\r\nshai''hulud\r\nshark\r\nshopwiki\r\nsidewinder\r\nsift\r\nsilk\r\nsimmany\r\nsite searcher\r\nsite valet\r\nsitetech-rover\r\nskymob.com\r\nsleek\r\nsmartwit\r\nsna-\r\nsnappy\r\nsnooper\r\nsohu\r\nspeedfind\r\nsphere\r\nsphider\r\nspinner\r\nspyder\r\nsteeler/\r\nsuke\r\nsuntek\r\nsupersnooper\r\nsurfnomore\r\nsven\r\nsygol\r\nszukacz\r\ntach black widow\r\ntarantula\r\ntempleton\r\n/teoma\r\nt-h-u-n-d-e-r-s-t-o-n-e\r\ntheophrastus\r\ntitan\r\ntitin\r\ntkwww\r\ntoutatis\r\nt-rex\r\ntutorgig\r\ntwiceler\r\ntwisted\r\nucsd\r\nudmsearch\r\nurl check\r\nupdated\r\nvagabondo\r\nvalkyrie\r\nverticrawl\r\nvictoria\r\nvision-search\r\nvolcano\r\nvoyager/\r\nvoyager-hc\r\nw3c_validator\r\nw3m2\r\nw3mir\r\nwalker\r\nwallpaper\r\nwanderer\r\nwauuu\r\nwavefire\r\nweb core\r\nweb hopper\r\nweb wombat\r\nwebbandit\r\nwebcatcher\r\nwebcopy\r\nwebfoot\r\nweblayers\r\nweblinker\r\nweblog monitor\r\nwebmirror\r\nwebmonkey\r\nwebquest\r\nwebreaper\r\nwebsitepulse\r\nwebsnarf\r\nwebstolperer\r\nwebvac\r\nwebwalk\r\nwebwatch\r\nwebwombat\r\nwebzinger\r\nwget\r\nwhizbang\r\nwhowhere\r\nwild ferret\r\nworldlight\r\nwwwc\r\nwwwster\r\nxenu\r\nxget\r\nxift\r\nxirq\r\nyandex\r\nyanga\r\nyeti\r\nyodao\r\nzao\r\nzippp\r\nzyborg', 0),
(129, 0, 'config', 'config_password', '1', 0),
-(130, 0, 'config', 'config_product_count', '1', 0);
+(130, 0, 'config', 'config_product_count', '1', 0)
+(131, 0, 'config', 'config_image_option_width','50',0),
+(132, 0, 'config', 'config_image_option_height','50',0),
+(133, 0, 'config', 'config_image_option_resize_type','default',0),
+(134, 0, 'config', 'config_image_thumb_resize_type', 'default', 0),
+(135, 0, 'config', 'config_image_popup_resize_type', 'default', 0),
+(136, 0, 'config', 'config_image_category_resize_type', 'default', 0),
+(137, 0, 'config', 'config_image_related_resize_type', 'default', 0),
+(138, 0, 'config', 'config_image_compare_resize_type', 'default', 0),
+(139, 0, 'config', 'config_image_wishlist_resize_type', 'default', 0),
+(140, 0, 'config', 'config_image_additional_resize_type', 'default', 0),
+(141, 0, 'config', 'config_image_cart_resize_type', 'default', 0);
-- --------------------------------------------------------
my2.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604
commit d8ea5cbc98ffe38e2d3c0207f30b6c95b6980888
Author: Haydar Kulekci <haydar.kulekci@reformo.net>
Date: Fri Jan 4 03:49:13 2013 +0200
 
added resize_type to default installed modules on sql
 
diff --git a/upload/install/opencart.sql b/upload/install/opencart.sql
index 62f50a9..6a10061 100644
--- a/upload/install/opencart.sql
+++ b/upload/install/opencart.sql
@@ -2994,9 +2994,9 @@ INSERT INTO `oc_setting` (`setting_id`, `store_id`, `group`, `key`, `value`, `se
(35, 0, 'flat', 'flat_status', '1', 0),
(36, 0, 'flat', 'flat_geo_zone_id', '0', 0),
(37, 0, 'flat', 'flat_tax_class_id', '9', 0),
-(38, 0, 'carousel', 'carousel_module', 'a:1:{i:0;a:9:{s:9:"banner_id";s:1:"8";s:5:"limit";s:1:"5";s:6:"scroll";s:1:"3";s:5:"width";s:2:"80";s:6:"height";s:2:"80";s:9:"layout_id";s:1:"1";s:8:"position";s:14:"content_bottom";s:6:"status";s:1:"1";s:10:"sort_order";s:2:"-1";}}', 1),
+(38, 0, 'carousel', 'carousel_module', 'a:1:{i:0;a:10:{s:9:"banner_id";s:1:"8";s:5:"limit";s:1:"5";s:6:"scroll";s:1:"3";s:5:"width";s:2:"80";s:6:"height";s:2:"80";s:11:"resize_type";s:7:"default";s:9:"layout_id";s:1:"1";s:8:"position";s:14:"content_bottom";s:6:"status";s:1:"1";s:10:"sort_order";s:2:"-1";}}', 1),
(39, 0, 'featured', 'featured_product', '43,40,42,49,46,47,28', 0),
-(40, 0, 'featured', 'featured_module', 'a:1:{i:0;a:7:{s:5:"limit";s:1:"6";s:11:"image_width";s:2:"80";s:12:"image_height";s:2:"80";s:9:"layout_id";s:1:"1";s:8:"position";s:11:"content_top";s:6:"status";s:1:"1";s:10:"sort_order";s:1:"2";}}', 1),
+(40, 0, 'featured', 'featured_module', 'a:1:{i:0;a:8:{s:5:"limit";s:1:"6";s:11:"image_width";s:2:"80";s:12:"image_height";s:2:"80";s:11:"resize_type";s:7:"default";s:9:"layout_id";s:1:"1";s:8:"position";s:11:"content_top";s:6:"status";s:1:"1";s:10:"sort_order";s:1:"2";}}', 1),
(41, 0, 'flat', 'flat_cost', '5.00', 0),
(42, 0, 'credit', 'credit_sort_order', '7', 0),
(43, 0, 'credit', 'credit_status', '1', 0),
@@ -3064,8 +3064,8 @@ INSERT INTO `oc_setting` (`setting_id`, `store_id`, `group`, `key`, `value`, `se
(105, 0, 'config', 'config_weight_class_id', '1', 0),
(106, 0, 'config', 'config_currency_auto', '1', 0),
(107, 0, 'config', 'config_currency', 'USD', 0),
-(108, 0, 'slideshow', 'slideshow_module', 'a:1:{i:0;a:7:{s:9:"banner_id";s:1:"7";s:5:"width";s:3:"980";s:6:"height";s:3:"280";s:9:"layout_id";s:1:"1";s:8:"position";s:11:"content_top";s:6:"status";s:1:"1";s:10:"sort_order";s:1:"1";}}', 1),
-(109, 0, 'banner', 'banner_module', 'a:1:{i:0;a:7:{s:9:"banner_id";s:1:"6";s:5:"width";s:3:"182";s:6:"height";s:3:"182";s:9:"layout_id";s:1:"3";s:8:"position";s:11:"column_left";s:6:"status";s:1:"1";s:10:"sort_order";s:1:"3";}}', 1),
+(108, 0, 'slideshow', 'slideshow_module', 'a:1:{i:0;a:8:{s:9:"banner_id";s:1:"7";s:5:"width";s:3:"980";s:6:"height";s:3:"280";s:11:"resize_type";s:7:"default";s:9:"layout_id";s:1:"1";s:8:"position";s:11:"content_top";s:6:"status";s:1:"1";s:10:"sort_order";s:1:"1";}}', 1),
+(109, 0, 'banner', 'banner_module', 'a:1:{i:0;a:8:{s:9:"banner_id";s:1:"6";s:5:"width";s:3:"182";s:6:"height";s:3:"182";s:11:"resize_type";s:7:"default";s:9:"layout_id";s:1:"3";s:8:"position";s:11:"column_left";s:6:"status";s:1:"1";s:10:"sort_order";s:1:"3";}}', 1),
(110, 0, 'config', 'config_name', 'Your Store', 0),
(111, 0, 'config', 'config_owner', 'Your Name', 0),
(112, 0, 'config', 'config_address', 'Address 1', 0),
 
commit b8f5190a1d6f3463d2c9e5710abb2bee1b7ac6e8
Author: Haydar Kulekci <haydar.kulekci@reformo.net>
Date: Fri Jan 4 03:35:35 2013 +0200
 
added resize type to bestseller modules
 
diff --git a/upload/admin/controller/module/bestseller.php b/upload/admin/controller/module/bestseller.php
index 1eba43d..0bb95df 100644
--- a/upload/admin/controller/module/bestseller.php
+++ b/upload/admin/controller/module/bestseller.php
@@ -27,6 +27,10 @@ class ControllerModuleBestSeller extends Controller {
21 $this->data['text_content_bottom'] = $this->language->get('text_content_bottom');
$this->data['text_column_left'] = $this->language->get('text_column_left');
$this->data['text_column_right'] = $this->language->get('text_column_right');
+
+ $this->data['img_resize_type_d'] = $this->language->get('img_resize_type_d');
+ $this->data['img_resize_type_w'] = $this->language->get('img_resize_type_w');
+ $this->data['img_resize_type_h'] = $this->language->get('img_resize_type_h');
$this->data['entry_limit'] = $this->language->get('entry_limit');
$this->data['entry_image'] = $this->language->get('entry_image');
diff --git a/upload/admin/language/english/module/bestseller.php b/upload/admin/language/english/module/bestseller.php
index 23b0311..1a60710 100644
--- a/upload/admin/language/english/module/bestseller.php
+++ b/upload/admin/language/english/module/bestseller.php
@@ -12,7 +12,7 @@ $_['text_column_right'] = 'Column Right';
// Entry
$_['entry_limit'] = 'Limit:';
-$_['entry_image'] = 'Image (W x H):';
+$_['entry_image'] = 'Image (W x H) and Resize Type:';
$_['entry_layout'] = 'Layout:';
$_['entry_position'] = 'Position:';
$_['entry_status'] = 'Status:';
diff --git a/upload/admin/view/template/module/bestseller.tpl b/upload/admin/view/template/module/bestseller.tpl
index 1cc66ff..b130420 100644
--- a/upload/admin/view/template/module/bestseller.tpl
+++ b/upload/admin/view/template/module/bestseller.tpl
@@ -34,6 +34,11 @@
<td class="left"><input type="text" name="bestseller_module[<?php echo $module_row; ?>][limit]" value="<?php echo $module['limit']; ?>" size="1" /></td>
<td class="left"><input type="text" name="bestseller_module[<?php echo $module_row; ?>][image_width]" value="<?php echo $module['image_width']; ?>" size="3" />
<input type="text" name="bestseller_module[<?php echo $module_row; ?>][image_height]" value="<?php echo $module['image_height']; ?>" size="3" />
+ <select name="bestseller_module[<?php echo $module_row; ?>][resize_type]">
+ <option value="default"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if (isset($error_image[$module_row])) { ?>
<span class="error"><?php echo $error_image[$module_row]; ?></span>
<?php } ?></td>
@@ -101,7 +106,12 @@ function addModule() {
html = '<tbody id="module-row' + module_row + '">';
html += ' <tr>';
html += ' <td class="left"><input type="text" name="bestseller_module[' + module_row + '][limit]" value="5" size="1" /></td>';
- html += ' <td class="left"><input type="text" name="bestseller_module[' + module_row + '][image_width]" value="80" size="3" /> <input type="text" name="bestseller_module[' + module_row + '][image_height]" value="80" size="3" /></td>';
+ html += ' <td class="left"><input type="text" name="bestseller_module[' + module_row + '][image_width]" value="80" size="3" /> <input type="text" name="bestseller_module[' + module_row + '][image_height]" value="80" size="3" />';
+ html += ' <select name="bestseller_module[' + module_row + '][resize_type]">';
+ html += ' <option value="default"><?php echo $img_resize_type_d; ?></option>';
+ html += ' <option value="w"><?php echo $img_resize_type_w; ?></option>';
+ html += ' <option value="h"><?php echo $img_resize_type_h; ?></option>';
+ html += ' </select></td>';
html += ' <td class="left"><select name="bestseller_module[' + module_row + '][layout_id]">';
<?php foreach ($layouts as $layout) { ?>
html += ' <option value="<?php echo $layout['layout_id']; ?>"><?php echo addslashes($layout['name']); ?></option>';
diff --git a/upload/catalog/controller/module/bestseller.php b/upload/catalog/controller/module/bestseller.php
index 48bb2f3..7bb6ad3 100644
--- a/upload/catalog/controller/module/bestseller.php
+++ b/upload/catalog/controller/module/bestseller.php
@@ -17,7 +17,7 @@ class ControllerModuleBestSeller extends Controller {
foreach ($results as $result) {
if ($result['image']) {
- $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']);
+ $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height'], $setting['resize_type']);
} else {
$image = false;
}
 
commit 3dfb2e5ce1543f263184b7f231702bfe3b316f27
Author: Haydar Kulekci <haydar.kulekci@reformo.net>
Date: Fri Jan 4 03:27:56 2013 +0200
 
added resize type to latest and special modules
 
diff --git a/upload/admin/controller/module/latest.php b/upload/admin/controller/module/latest.php
index 4197b08..8f02cfc 100644
--- a/upload/admin/controller/module/latest.php
+++ b/upload/admin/controller/module/latest.php
@@ -27,6 +27,10 @@ class ControllerModuleLatest extends Controller {
$this->data['text_content_bottom'] = $this->language->get('text_content_bottom');
$this->data['text_column_left'] = $this->language->get('text_column_left');
$this->data['text_column_right'] = $this->language->get('text_column_right');
+
+ $this->data['img_resize_type_d'] = $this->language->get('img_resize_type_d');
+ $this->data['img_resize_type_w'] = $this->language->get('img_resize_type_w');
+ $this->data['img_resize_type_h'] = $this->language->get('img_resize_type_h');
$this->data['entry_limit'] = $this->language->get('entry_limit');
$this->data['entry_image'] = $this->language->get('entry_image');
diff --git a/upload/admin/controller/module/special.php b/upload/admin/controller/module/special.php
index 4c057ff..012063b 100644
--- a/upload/admin/controller/module/special.php
+++ b/upload/admin/controller/module/special.php
@@ -1,4 +1,8 @@
-<?php
+
+
+ $this->data['img_resize_type_d'] = $this->language->get('img_resize_type_d');
+ $this->data['img_resize_type_w'] = $this->language->get('img_resize_type_w');
+ $this->data['img_resize_type_h'] = $this->language->get('img_resize_type_h');<?php
class ControllerModulespecial extends Controller {
private $error = array();
@@ -27,6 +31,10 @@ class ControllerModulespecial extends Controller {
$this->data['text_content_bottom'] = $this->language->get('text_content_bottom');
$this->data['text_column_left'] = $this->language->get('text_column_left');
$this->data['text_column_right'] = $this->language->get('text_column_right');
+
+ $this->data['img_resize_type_d'] = $this->language->get('img_resize_type_d');
+ $this->data['img_resize_type_w'] = $this->language->get('img_resize_type_w');
+ $this->data['img_resize_type_h'] = $this->language->get('img_resize_type_h');
$this->data['entry_limit'] = $this->language->get('entry_limit');
$this->data['entry_image'] = $this->language->get('entry_image');
diff --git a/upload/admin/language/english/module/latest.php b/upload/admin/language/english/module/latest.php
index 804dd35..2adff35 100644
--- a/upload/admin/language/english/module/latest.php
+++ b/upload/admin/language/english/module/latest.php
@@ -12,7 +12,7 @@ $_['text_column_right'] = 'Column Right';
// Entry
$_['entry_limit'] = 'Limit:';
-$_['entry_image'] = 'Image (W x H):';
+$_['entry_image'] = 'Image (W x H) and Resize Type:';
$_['entry_layout'] = 'Layout:';
$_['entry_position'] = 'Position:';
$_['entry_status'] = 'Status:';
diff --git a/upload/admin/language/english/module/special.php b/upload/admin/language/english/module/special.php
index 9e43d6f..e331124 100644
--- a/upload/admin/language/english/module/special.php
+++ b/upload/admin/language/english/module/special.php
@@ -12,7 +12,7 @@ $_['text_column_right'] = 'Column Right';
// Entry
$_['entry_limit'] = 'Limit:';
-$_['entry_image'] = 'Image (W x H):';
+$_['entry_image'] = 'Image (W x H) and Resize Type:';
$_['entry_layout'] = 'Layout:';
$_['entry_position'] = 'Position:';
$_['entry_status'] = 'Status:';
diff --git a/upload/admin/view/template/module/latest.tpl b/upload/admin/view/template/module/latest.tpl
index c6695fc..605115c 100644
--- a/upload/admin/view/template/module/latest.tpl
+++ b/upload/admin/view/template/module/latest.tpl
@@ -34,6 +34,11 @@
<td class="left"><input type="text" name="latest_module[<?php echo $module_row; ?>][limit]" value="<?php echo $module['limit']; ?>" size="1" /></td>
<td class="left"><input type="text" name="latest_module[<?php echo $module_row; ?>][image_width]" value="<?php echo $module['image_width']; ?>" size="3" />
<input type="text" name="latest_module[<?php echo $module_row; ?>][image_height]" value="<?php echo $module['image_height']; ?>" size="3" />
+ <select name="latest_module[<?php echo $module_row; ?>][resize_type]">
+ <option value="default"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if (isset($error_image[$module_row])) { ?>
<span class="error"><?php echo $error_image[$module_row]; ?></span>
<?php } ?></td>
@@ -101,7 +106,12 @@ function addModule() {
html = '<tbody id="module-row' + module_row + '">';
html += ' <tr>';
html += ' <td class="left"><input type="text" name="latest_module[' + module_row + '][limit]" value="5" size="1" /></td>';
- html += ' <td class="left"><input type="text" name="latest_module[' + module_row + '][image_width]" value="80" size="3" /> <input type="text" name="latest_module[' + module_row + '][image_height]" value="80" size="3" /></td>';
+ html += ' <td class="left"><input type="text" name="latest_module[' + module_row + '][image_width]" value="80" size="3" /> <input type="text" name="latest_module[' + module_row + '][image_height]" value="80" size="3" />';
+ html += ' <select name="latest_module[' + module_row + '][resize_type]">';
+ html += ' <option value="default"><?php echo $img_resize_type_d; ?></option>';
+ html += ' <option value="w"><?php echo $img_resize_type_w; ?></option>';
+ html += ' <option value="h"><?php echo $img_resize_type_h; ?></option>';
+ html += ' </select></td>';
html += ' <td class="left"><select name="latest_module[' + module_row + '][layout_id]">';
<?php foreach ($layouts as $layout) { ?>
html += ' <option value="<?php echo $layout['layout_id']; ?>"><?php echo addslashes($layout['name']); ?></option>';
diff --git a/upload/admin/view/template/module/special.tpl b/upload/admin/view/template/module/special.tpl
index d158006..edf3603 100644
--- a/upload/admin/view/template/module/special.tpl
+++ b/upload/admin/view/template/module/special.tpl
@@ -34,6 +34,11 @@
<td class="left"><input type="text" name="special_module[<?php echo $module_row; ?>][limit]" value="<?php echo $module['limit']; ?>" size="1" /></td>
<td class="left"><input type="text" name="special_module[<?php echo $module_row; ?>][image_width]" value="<?php echo $module['image_width']; ?>" size="3" />
<input type="text" name="special_module[<?php echo $module_row; ?>][image_height]" value="<?php echo $module['image_height']; ?>" size="3" />
+ <select name="special_module[<?php echo $module_row; ?>][resize_type]">
+ <option value="default"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if (isset($error_image[$module_row])) { ?>
<span class="error"><?php echo $error_image[$module_row]; ?></span>
<?php } ?></td>
@@ -101,7 +106,12 @@ function addModule() {
html = '<tbody id="module-row' + module_row + '">';
html += ' <tr>';
html += ' <td class="left"><input type="text" name="special_module[' + module_row + '][limit]" value="5" size="1" /></td>';
- html += ' <td class="left"><input type="text" name="special_module[' + module_row + '][image_width]" value="80" size="3" /> <input type="text" name="special_module[' + module_row + '][image_height]" value="80" size="3" /></td>';
+ html += ' <td class="left"><input type="text" name="special_module[' + module_row + '][image_width]" value="80" size="3" /> <input type="text" name="special_module[' + module_row + '][image_height]" value="80" size="3" />';
+ html += ' <select name="special_module[' + module_row + '][resize_type]">';
+ html += ' <option value="default"><?php echo $img_resize_type_d; ?></option>';
+ html += ' <option value="w"><?php echo $img_resize_type_w; ?></option>';
+ html += ' <option value="h"><?php echo $img_resize_type_h; ?></option>';
+ html += ' </select></td>';
html += ' <td class="left"><select name="special_module[' + module_row + '][layout_id]">';
<?php foreach ($layouts as $layout) { ?>
html += ' <option value="<?php echo $layout['layout_id']; ?>"><?php echo addslashes($layout['name']); ?></option>';
diff --git a/upload/catalog/controller/module/latest.php b/upload/catalog/controller/module/latest.php
index df650f8..2c062c9 100644
--- a/upload/catalog/controller/module/latest.php
+++ b/upload/catalog/controller/module/latest.php
@@ -24,7 +24,7 @@ class ControllerModuleLatest extends Controller {
foreach ($results as $result) {
if ($result['image']) {
- $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']);
+ $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height'], $setting['resize_type']);
} else {
$image = false;
}
diff --git a/upload/catalog/controller/module/special.php b/upload/catalog/controller/module/special.php
index 08b65b7..ea9ee99 100644
--- a/upload/catalog/controller/module/special.php
+++ b/upload/catalog/controller/module/special.php
@@ -24,7 +24,7 @@ class ControllerModuleSpecial extends Controller {
foreach ($results as $result) {
if ($result['image']) {
- $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height']);
+ $image = $this->model_tool_image->resize($result['image'], $setting['image_width'], $setting['image_height'], $setting['resize_type']);
} else {
$image = false;
}
 
commit bbc533eee57f847eb1542017db92f653e1119a10
Author: Haydar Kulekci <haydar.kulekci@reformo.net>
Date: Fri Jan 4 03:17:31 2013 +0200
 
added resize type to slideshow and carousel modules
 
diff --git a/upload/admin/controller/module/carousel.php b/upload/admin/controller/module/carousel.php
index 38c33d6..4a0f653 100644
--- a/upload/admin/controller/module/carousel.php
+++ b/upload/admin/controller/module/carousel.php
@@ -26,6 +26,10 @@ class ControllerModuleCarousel extends Controller {
$this->data['text_column_left'] = $this->language->get('text_column_left');
$this->data['text_column_right'] = $this->language->get('text_column_right');
+ $this->data['img_resize_type_d'] = $this->language->get('img_resize_type_d');
+ $this->data['img_resize_type_w'] = $this->language->get('img_resize_type_w');
+ $this->data['img_resize_type_h'] = $this->language->get('img_resize_type_h');
+
$this->data['entry_banner'] = $this->language->get('entry_banner');
$this->data['entry_limit'] = $this->language->get('entry_limit');
$this->data['entry_scroll'] = $this->language->get('entry_scroll');
diff --git a/upload/admin/controller/module/slideshow.php b/upload/admin/controller/module/slideshow.php
index 31c6457..5217682 100644
--- a/upload/admin/controller/module/slideshow.php
+++ b/upload/admin/controller/module/slideshow.php
@@ -25,6 +25,10 @@ class ControllerModuleSlideshow extends Controller {
$this->data['text_content_bottom'] = $this->language->get('text_content_bottom');
$this->data['text_column_left'] = $this->language->get('text_column_left');
$this->data['text_column_right'] = $this->language->get('text_column_right');
+
+ $this->data['img_resize_type_d'] = $this->language->get('img_resize_type_d');
+ $this->data['img_resize_type_w'] = $this->language->get('img_resize_type_w');
+ $this->data['img_resize_type_h'] = $this->language->get('img_resize_type_h');
$this->data['entry_banner'] = $this->language->get('entry_banner');
$this->data['entry_dimension'] = $this->language->get('entry_dimension');
diff --git a/upload/admin/language/english/module/carousel.php b/upload/admin/language/english/module/carousel.php
index b21916b..26e6825 100644
--- a/upload/admin/language/english/module/carousel.php
+++ b/upload/admin/language/english/module/carousel.php
@@ -14,7 +14,7 @@ $_['text_column_right'] = 'Column Right';
$_['entry_banner'] = 'Banner:';
$_['entry_limit'] = 'Limit:';
$_['entry_scroll'] = 'Scroll:';
-$_['entry_image'] = 'Image (W x H):';
+$_['entry_image'] = 'Image (W x H) and Resize Type:';
$_['entry_layout'] = 'Layout:';
$_['entry_position'] = 'Position:';
$_['entry_status'] = 'Status:';
diff --git a/upload/admin/language/english/module/slideshow.php b/upload/admin/language/english/module/slideshow.php
index 5462c96..70a44cb 100644
--- a/upload/admin/language/english/module/slideshow.php
+++ b/upload/admin/language/english/module/slideshow.php
@@ -12,7 +12,7 @@ $_['text_column_right'] = 'Column Right';
// Entry
$_['entry_banner'] = 'Banner:';
-$_['entry_dimension'] = 'Dimension (W x H):';
+$_['entry_dimension'] = 'Dimension (W x H) and Resize Type:';
$_['entry_layout'] = 'Layout:';
$_['entry_position'] = 'Position:';
$_['entry_status'] = 'Status:';
diff --git a/upload/admin/view/template/module/carousel.tpl b/upload/admin/view/template/module/carousel.tpl
index bd8edfb..7824bf3 100644
--- a/upload/admin/view/template/module/carousel.tpl
+++ b/upload/admin/view/template/module/carousel.tpl
@@ -46,6 +46,11 @@
<td class="left"><input type="text" name="carousel_module[<?php echo $module_row; ?>][scroll]" value="<?php echo $module['scroll']; ?>" size="3" /></td>
<td class="left"><input type="text" name="carousel_module[<?php echo $module_row; ?>][width]" value="<?php echo $module['width']; ?>" size="3" />
<input type="text" name="carousel_module[<?php echo $module_row; ?>][height]" value="<?php echo $module['height']; ?>" size="3" />
+ <select name="carousel_module[<?php echo $module_row; ?>][resize_type]">
+ <option value="default"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if (isset($error_image[$module_row])) { ?>
<span class="error"><?php echo $error_image[$module_row]; ?></span>
<?php } ?></td>
@@ -119,7 +124,12 @@ function addModule() {
html += ' </select></td>';
html += ' <td class="left"><input type="text" name="carousel_module[' + module_row + '][limit]" value="5" size="1" /></td>';
html += ' <td class="left"><input type="text" name="carousel_module[' + module_row + '][scroll]" value="3" size="1" /></td>';
- html += ' <td class="left"><input type="text" name="carousel_module[' + module_row + '][width]" value="80" size="3" /> <input type="text" name="carousel_module[' + module_row + '][height]" value="80" size="3" /></td>';
+ html += ' <td class="left"><input type="text" name="carousel_module[' + module_row + '][width]" value="80" size="3" /> <input type="text" name="carousel_module[' + module_row + '][height]" value="80" size="3" />';
+ html += ' <select name="carousel_module[' + module_row + '][resize_type]">';
+ html += ' <option value="default"><?php echo $img_resize_type_d; ?></option>';
+ html += ' <option value="w"><?php echo $img_resize_type_w; ?></option>';
+ html += ' <option value="h"><?php echo $img_resize_type_h; ?></option>';
+ html += ' </select></td>';
html += ' <td class="left"><select name="carousel_module[' + module_row + '][layout_id]">';
<?php foreach ($layouts as $layout) { ?>
html += ' <option value="<?php echo $layout['layout_id']; ?>"><?php echo addslashes($layout['name']); ?></option>';
diff --git a/upload/admin/view/template/module/slideshow.tpl b/upload/admin/view/template/module/slideshow.tpl
index aa4194f..42ccf72 100644
--- a/upload/admin/view/template/module/slideshow.tpl
+++ b/upload/admin/view/template/module/slideshow.tpl
@@ -42,6 +42,11 @@
</select></td>
<td class="left"><input type="text" name="slideshow_module[<?php echo $module_row; ?>][width]" value="<?php echo $module['width']; ?>" size="3" />
<input type="text" name="slideshow_module[<?php echo $module_row; ?>][height]" value="<?php echo $module['height']; ?>" size="3"/>
+ <select name="slideshow_module[<?php echo $module_row; ?>][resize_type]">
+ <option value="default"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if (isset($error_dimension[$module_row])) { ?>
<span class="error"><?php echo $error_dimension[$module_row]; ?></span>
<?php } ?></td>
@@ -113,7 +118,12 @@ function addModule() {
html += ' <option value="<?php echo $banner['banner_id']; ?>"><?php echo addslashes($banner['name']); ?></option>';
<?php } ?>
html += ' </select></td>';
- html += ' <td class="left"><input type="text" name="slideshow_module[' + module_row + '][width]" value="" size="3" /> <input type="text" name="slideshow_module[' + module_row + '][height]" value="" size="3" /></td>';
+ html += ' <td class="left"><input type="text" name="slideshow_module[' + module_row + '][width]" value="" size="3" /> <input type="text" name="slideshow_module[' + module_row + '][height]" value="" size="3" />';
+ html += ' <select name="slideshow_module[' + module_row + '][resize_type]">';
+ html += ' <option value="default"><?php echo $img_resize_type_d; ?></option>';
+ html += ' <option value="w"><?php echo $img_resize_type_w; ?></option>';
+ html += ' <option value="h"><?php echo $img_resize_type_h; ?></option>';
+ html += ' </select></td>';
html += ' <td class="left"><select name="slideshow_module[' + module_row + '][layout_id]">';
<?php foreach ($layouts as $layout) { ?>
html += ' <option value="<?php echo $layout['layout_id']; ?>"><?php echo addslashes($layout['name']); ?></option>';
diff --git a/upload/catalog/controller/module/carousel.php b/upload/catalog/controller/module/carousel.php
index e35f805..5785785 100644
--- a/upload/catalog/controller/module/carousel.php
+++ b/upload/catalog/controller/module/carousel.php
@@ -26,7 +26,7 @@ class ControllerModuleCarousel extends Controller {
$this->data['banners'][] = array(
'title' => $result['title'],
'link' => $result['link'],
- 'image' => $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height'])
+ 'image' => $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height'], $setting['resize_type'])
);
}
}
diff --git a/upload/catalog/controller/module/slideshow.php b/upload/catalog/controller/module/slideshow.php
index 745b579..cb78771 100644
--- a/upload/catalog/controller/module/slideshow.php
+++ b/upload/catalog/controller/module/slideshow.php
@@ -27,7 +27,7 @@ class ControllerModuleSlideshow extends Controller {
$this->data['banners'][] = array(
'title' => $result['title'],
'link' => $result['link'],
- 'image' => $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height'])
+ 'image' => $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height'], $setting['resize_type'])
);
}
}
 
commit 9de07b668d73b02885cce6c782544963d8f247ba
Author: Haydar Kulekci <haydar.kulekci@reformo.net>
Date: Fri Jan 4 02:58:26 2013 +0200
 
added resize type to banner module
 
diff --git a/upload/admin/controller/module/banner.php b/upload/admin/controller/module/banner.php
index 5422a57..96f3d64 100644
--- a/upload/admin/controller/module/banner.php
+++ b/upload/admin/controller/module/banner.php
@@ -25,6 +25,10 @@ class ControllerModuleBanner extends Controller {
$this->data['text_content_bottom'] = $this->language->get('text_content_bottom');
$this->data['text_column_left'] = $this->language->get('text_column_left');
$this->data['text_column_right'] = $this->language->get('text_column_right');
+
+ $this->data['img_resize_type_d'] = $this->language->get('img_resize_type_d');
+ $this->data['img_resize_type_w'] = $this->language->get('img_resize_type_w');
+ $this->data['img_resize_type_h'] = $this->language->get('img_resize_type_h');
$this->data['entry_banner'] = $this->language->get('entry_banner');
$this->data['entry_dimension'] = $this->language->get('entry_dimension');
diff --git a/upload/admin/language/english/module/banner.php b/upload/admin/language/english/module/banner.php
index 697f209..10fdc19 100644
--- a/upload/admin/language/english/module/banner.php
+++ b/upload/admin/language/english/module/banner.php
@@ -12,7 +12,7 @@ $_['text_column_right'] = 'Column Right';
// Entry
$_['entry_banner'] = 'Banner:';
-$_['entry_dimension'] = 'Dimension (W x H):';
+$_['entry_dimension'] = 'Dimension (W x H) and Resize Type:';
$_['entry_layout'] = 'Layout:';
$_['entry_position'] = 'Position:';
$_['entry_status'] = 'Status:';
diff --git a/upload/admin/view/template/module/banner.tpl b/upload/admin/view/template/module/banner.tpl
index c759caa..3b255e4 100644
--- a/upload/admin/view/template/module/banner.tpl
+++ b/upload/admin/view/template/module/banner.tpl
@@ -42,6 +42,11 @@
</select></td>
<td class="left"><input type="text" name="banner_module[<?php echo $module_row; ?>][width]" value="<?php echo $module['width']; ?>" size="3" />
<input type="text" name="banner_module[<?php echo $module_row; ?>][height]" value="<?php echo $module['height']; ?>" size="3" />
+ <select name="banner_module[<?php echo $module_row; ?>][resize_type]">
+ <option value="default"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if (isset($error_dimension[$module_row])) { ?>
<span class="error"><?php echo $error_dimension[$module_row]; ?></span>
<?php } ?></td>
@@ -113,7 +118,12 @@ function addModule() {
html += ' <option value="<?php echo $banner['banner_id']; ?>"><?php echo addslashes($banner['name']); ?></option>';
<?php } ?>
html += ' </select></td>';
- html += ' <td class="left"><input type="text" name="banner_module[' + module_row + '][width]" value="" size="3" /> <input type="text" name="banner_module[' + module_row + '][height]" value="" size="3" /></td>';
+ html += ' <td class="left"><input type="text" name="banner_module[' + module_row + '][width]" value="" size="3" /> <input type="text" name="banner_module[' + module_row + '][height]" value="" size="3" />';
+ html += ' <select name="banner_module[' + module_row + '][resize_type]">';
+ html += ' <option value="default"><?php echo $img_resize_type_d; ?></option>';
+ html += ' <option value="w"><?php echo $img_resize_type_w; ?></option>';
+ html += ' <option value="h"><?php echo $img_resize_type_h; ?></option>';
+ html += ' </select></td>';
html += ' <td class="left"><select name="banner_module[' + module_row + '][layout_id]">';
<?php foreach ($layouts as $layout) { ?>
html += ' <option value="<?php echo $layout['layout_id']; ?>"><?php echo addslashes($layout['name']); ?></option>';
diff --git a/upload/admin/view/template/module/featured.tpl b/upload/admin/view/template/module/featured.tpl
index 2d50253..946090a 100644
--- a/upload/admin/view/template/module/featured.tpl
+++ b/upload/admin/view/template/module/featured.tpl
@@ -178,7 +178,7 @@ function addModule() {
html += ' <td class="left"><input type="text" name="featured_module[' + module_row + '][limit]" value="5" size="1" /></td>';
html += ' <td class="left"><input type="text" name="featured_module[' + module_row + '][image_width]" value="80" size="3" /> <input type="text" name="featured_module[' + module_row + '][image_height]" value="80" size="3" />';
html += ' <select name="featured_module[' + module_row + '][resize_type]">';
- html += ' <option value=""><?php echo $img_resize_type_d; ?></option>';
+ html += ' <option value="default"><?php echo $img_resize_type_d; ?></option>';
html += ' <option value="w"><?php echo $img_resize_type_w; ?></option>';
html += ' <option value="h"><?php echo $img_resize_type_h; ?></option>';
html += ' </select></td>';
diff --git a/upload/catalog/controller/module/banner.php b/upload/catalog/controller/module/banner.php
index 65d49ce..e3838d5 100644
--- a/upload/catalog/controller/module/banner.php
+++ b/upload/catalog/controller/module/banner.php
@@ -17,7 +17,7 @@ class ControllerModuleBanner extends Controller {
$this->data['banners'][] = array(
'title' => $result['title'],
'link' => $result['link'],
- 'image' => $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height'])
+ 'image' => $this->model_tool_image->resize($result['image'], $setting['width'], $setting['height'], $setting['resize_type'])
);
}
}
 
commit d9d2c50bf8986a892a3bd34e15c73e8edd22713d
Author: Haydar Kulekci <haydar.kulekci@reformo.net>
Date: Fri Jan 4 02:49:58 2013 +0200
 
added resize type to featured module
 
diff --git a/upload/admin/controller/module/featured.php b/upload/admin/controller/module/featured.php
index 9270666..89f5766 100644
--- a/upload/admin/controller/module/featured.php
+++ b/upload/admin/controller/module/featured.php
@@ -25,6 +25,10 @@ class ControllerModuleFeatured extends Controller {
$this->data['text_content_bottom'] = $this->language->get('text_content_bottom');
$this->data['text_column_left'] = $this->language->get('text_column_left');
$this->data['text_column_right'] = $this->language->get('text_column_right');
+
+ $this->data['img_resize_type_d'] = $this->language->get('img_resize_type_d');
+ $this->data['img_resize_type_w'] = $this->language->get('img_resize_type_w');
+ $this->data['img_resize_type_h'] = $this->language->get('img_resize_type_h');
$this->data['entry_product'] = $this->language->get('entry_product');
$this->data['entry_limit'] = $this->language->get('entry_limit');
diff --git a/upload/admin/language/english/english.php b/upload/admin/language/english/english.php
index e567db9..1eab85e 100644
--- a/upload/admin/language/english/english.php
+++ b/upload/admin/language/english/english.php
@@ -103,6 +103,11 @@ $_['tab_transaction'] = 'Transactions';
$_['tab_voucher'] = 'Vouchers';
$_['tab_voucher_history'] = 'Voucher History';
+// Image Resize Type
+$_['img_resize_type_d'] = 'Resize according to default';
+$_['img_resize_type_w'] = 'Resize according to width';
+$_['img_resize_type_h'] = 'Resize according to height';
+
// Error
$_['error_upload_1'] = 'Warning: The uploaded file exceeds the upload_max_filesize directive in php.ini!';
$_['error_upload_2'] = 'Warning: The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form!';
diff --git a/upload/admin/language/english/module/featured.php b/upload/admin/language/english/module/featured.php
index b49ee08..12d5a59 100644
--- a/upload/admin/language/english/module/featured.php
+++ b/upload/admin/language/english/module/featured.php
@@ -13,7 +13,7 @@ $_['text_column_right'] = 'Column Right';
// Entry
$_['entry_product'] = 'Products:<br /><span class="help">(Autocomplete)</span>';
$_['entry_limit'] = 'Limit:';
-$_['entry_image'] = 'Image (W x H):';
+$_['entry_image'] = 'Image (W x H) and Resize Type:';
$_['entry_layout'] = 'Layout:';
$_['entry_position'] = 'Position:';
$_['entry_status'] = 'Status:';
diff --git a/upload/admin/view/template/module/featured.tpl b/upload/admin/view/template/module/featured.tpl
index a4e980d..2d50253 100644
--- a/upload/admin/view/template/module/featured.tpl
+++ b/upload/admin/view/template/module/featured.tpl
@@ -53,6 +53,11 @@
<td class="left"><input type="text" name="featured_module[<?php echo $module_row; ?>][limit]" value="<?php echo $module['limit']; ?>" size="1" /></td>
<td class="left"><input type="text" name="featured_module[<?php echo $module_row; ?>][image_width]" value="<?php echo $module['image_width']; ?>" size="3" />
<input type="text" name="featured_module[<?php echo $module_row; ?>][image_height]" value="<?php echo $module['image_height']; ?>" size="3" />
+ <select name="featured_module[<?php echo $module_row; ?>][resize_type]">
+ <option value="default"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( (isset($module['resize_type']) && $module['resize_type'] == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if (isset($error_image[$module_row])) { ?>
<span class="error"><?php echo $error_image[$module_row]; ?></span>
<?php } ?></td>
@@ -171,7 +176,12 @@ function addModule() {
html = '<tbody id="module-row' + module_row + '">';
html += ' <tr>';
html += ' <td class="left"><input type="text" name="featured_module[' + module_row + '][limit]" value="5" size="1" /></td>';
- html += ' <td class="left"><input type="text" name="featured_module[' + module_row + '][image_width]" value="80" size="3" /> <input type="text" name="featured_module[' + module_row + '][image_height]" value="80" size="3" /></td>';
+ html += ' <td class="left"><input type="text" name="featured_module[' + module_row + '][image_width]" value="80" size="3" /> <input type="text" name="featured_module[' + module_row + '][image_height]" value="80" size="3" />';
+ html += ' <select name="featured_module[' + module_row + '][resize_type]">';
+ html += ' <option value=""><?php echo $img_resize_type_d; ?></option>';
+ html += ' <option value="w"><?php echo $img_resize_type_w; ?></option>';
+ html += ' <option value="h"><?php echo $img_resize_type_h; ?></option>';
+ html += ' </select></td>';
html += ' <td class="left"><select name="featured_module[' + module_row + '][layout_id]">';
<?php foreach ($layouts as $layout) { ?>
html += ' <option value="<?php echo $layout['layout_id']; ?>"><?php echo addslashes($layout['name']); ?></option>';
diff --git a/upload/catalog/controller/module/featured.php b/upload/catalog/controller/module/featured.php
index 0ef3dd7..728dcc8 100644
--- a/upload/catalog/controller/module/featured.php
+++ b/upload/catalog/controller/module/featured.php
@@ -26,7 +26,7 @@ class ControllerModuleFeatured extends Controller {
if ($product_info) {
if ($product_info['image']) {
- $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height']);
+ $image = $this->model_tool_image->resize($product_info['image'], $setting['image_width'], $setting['image_height'], $setting['resize_type']);
} else {
$image = false;
}
my3.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389
commit afc2eff60837abffc1011101c163912386f4f03c
Author: Haydar Kulekci <haydar.kulekci@reformo.net>
Date: Thu Jan 10 16:49:49 2013 +0200
 
added image resize_type to setting/store. i guess, image resize_type patch is finished
 
diff --git a/upload/admin/controller/setting/store.php b/upload/admin/controller/setting/store.php
index a0bf152..0af1765 100644
--- a/upload/admin/controller/setting/store.php
+++ b/upload/admin/controller/setting/store.php
@@ -193,6 +193,10 @@ class ControllerSettingStore extends Controller {
21 $this->data['text_clear'] = $this->language->get('text_clear');
$this->data['text_shipping'] = $this->language->get('text_shipping');
$this->data['text_payment'] = $this->language->get('text_payment');
+
+ $this->data['img_resize_type_d'] = $this->language->get('img_resize_type_d');
+ $this->data['img_resize_type_w'] = $this->language->get('img_resize_type_w');
+ $this->data['img_resize_type_h'] = $this->language->get('img_resize_type_h');
$this->data['entry_url'] = $this->language->get('entry_url');
$this->data['entry_ssl'] = $this->language->get('entry_ssl');
@@ -233,6 +237,7 @@ class ControllerSettingStore extends Controller {
$this->data['entry_image_product'] = $this->language->get('entry_image_product');
$this->data['entry_image_additional'] = $this->language->get('entry_image_additional');
$this->data['entry_image_related'] = $this->language->get('entry_image_related');
+ $this->data['entry_image_option'] = $this->language->get('entry_image_option');
$this->data['entry_image_compare'] = $this->language->get('entry_image_compare');
$this->data['entry_image_wishlist'] = $this->language->get('entry_image_wishlist');
$this->data['entry_image_cart'] = $this->language->get('entry_image_cart');
@@ -337,6 +342,12 @@ class ControllerSettingStore extends Controller {
} else {
$this->data['error_image_related'] = '';
}
+
+ if (isset($this->error['image_option'])) {
+ $this->data['error_image_option'] = $this->error['image_option'];
+ } else {
+ $this->data['error_image_option'] = '';
+ }
if (isset($this->error['image_compare'])) {
$this->data['error_image_compare'] = $this->error['image_compare'];
@@ -708,13 +719,6 @@ class ControllerSettingStore extends Controller {
$this->data['no_image'] = $this->model_tool_image->resize('no_image.jpg', 100, 100);
- if (isset($this->request->post['config_image_category_height'])) {
- $this->data['config_image_category_height'] = $this->request->post['config_image_category_height'];
- } elseif (isset($store_info['config_image_category_height'])) {
- $this->data['config_image_category_height'] = $store_info['config_image_category_height'];
- } else {
- $this->data['config_image_category_height'] = 80;
- }
if (isset($this->request->post['config_image_thumb_width'])) {
$this->data['config_image_thumb_width'] = $this->request->post['config_image_thumb_width'];
@@ -723,6 +727,14 @@ class ControllerSettingStore extends Controller {
} else {
$this->data['config_image_thumb_width'] = 228;
}
+
+ if (isset($this->request->post['config_image_thumb_resize_type'])) {
+ $this->data['config_image_thumb_resize_type'] = $this->request->post['config_image_thumb_resize_type'];
+ } elseif (isset($store_info['config_image_thumb_resize_type'])) {
+ $this->data['config_image_thumb_resize_type'] = $store_info['config_image_thumb_resize_type'];
+ } else {
+ $this->data['config_image_thumb_resize_type'] = 'default';
+ }
if (isset($this->request->post['config_image_thumb_height'])) {
$this->data['config_image_thumb_height'] = $this->request->post['config_image_thumb_height'];
@@ -739,6 +751,14 @@ class ControllerSettingStore extends Controller {
} else {
$this->data['config_image_popup_width'] = 500;
}
+
+ if (isset($this->request->post['config_image_popup_resize_type'])) {
+ $this->data['config_image_popup_resize_type'] = $this->request->post['config_image_popup_resize_type'];
+ } elseif (isset($store_info['config_image_popup_resize_type'])) {
+ $this->data['config_image_popup_resize_type'] = $store_info['config_image_popup_resize_type'];
+ } else {
+ $this->data['config_image_popup_resize_type'] = 'default';
+ }
if (isset($this->request->post['config_image_popup_height'])) {
$this->data['config_image_popup_height'] = $this->request->post['config_image_popup_height'];
@@ -755,6 +775,14 @@ class ControllerSettingStore extends Controller {
} else {
$this->data['config_image_product_width'] = 80;
}
+
+ if (isset($this->request->post['config_image_product_resize_type'])) {
+ $this->data['config_image_product_resize_type'] = $this->request->post['config_image_product_resize_type'];
+ } elseif (isset($store_info['config_image_product_resize_type'])) {
+ $this->data['config_image_product_resize_type'] = $store_info['config_image_product_resize_type'];
+ } else {
+ $this->data['config_image_product_resize_type'] = 'default';
+ }
if (isset($this->request->post['config_image_product_height'])) {
$this->data['config_image_product_height'] = $this->request->post['config_image_product_height'];
@@ -764,6 +792,14 @@ class ControllerSettingStore extends Controller {
$this->data['config_image_product_height'] = 80;
}
+ if (isset($this->request->post['config_image_category_height'])) {
+ $this->data['config_image_category_height'] = $this->request->post['config_image_category_height'];
+ } elseif (isset($store_info['config_image_category_height'])) {
+ $this->data['config_image_category_height'] = $store_info['config_image_category_height'];
+ } else {
+ $this->data['config_image_category_height'] = 80;
+ }
+
if (isset($this->request->post['config_image_category_width'])) {
$this->data['config_image_category_width'] = $this->request->post['config_image_category_width'];
} elseif (isset($store_info['config_image_category_width'])) {
@@ -772,6 +808,14 @@ class ControllerSettingStore extends Controller {
$this->data['config_image_category_width'] = 80;
}
+ if (isset($this->request->post['config_image_category_resize_type'])) {
+ $this->data['config_image_category_resize_type'] = $this->request->post['config_image_category_resize_type'];
+ } elseif (isset($store_info['config_image_category_resize_type'])) {
+ $this->data['config_image_category_resize_type'] = $store_info['config_image_category_resize_type'];
+ } else {
+ $this->data['config_image_category_resize_type'] = 'default';
+ }
+
if (isset($this->request->post['config_image_additional_width'])) {
$this->data['config_image_additional_width'] = $this->request->post['config_image_additional_width'];
} elseif (isset($store_info['config_image_additional_width'])) {
@@ -787,6 +831,14 @@ class ControllerSettingStore extends Controller {
} else {
$this->data['config_image_additional_height'] = 74;
}
+
+ if (isset($this->request->post['config_image_additional_resize_type'])) {
+ $this->data['config_image_additional_resize_type'] = $this->request->post['config_image_additional_resize_type'];
+ } elseif (isset($store_info['config_image_additional_resize_type'])) {
+ $this->data['config_image_additional_resize_type'] = $store_info['config_image_additional_resize_type'];
+ } else {
+ $this->data['config_image_additional_resize_type'] = 'default';
+ }
if (isset($this->request->post['config_image_related_width'])) {
$this->data['config_image_related_width'] = $this->request->post['config_image_related_width'];
@@ -803,6 +855,38 @@ class ControllerSettingStore extends Controller {
} else {
$this->data['config_image_related_height'] = 80;
}
+
+ if (isset($this->request->post['config_image_related_resize_type'])) {
+ $this->data['config_image_related_resize_type'] = $this->request->post['config_image_related_resize_type'];
+ } elseif (isset($store_info['config_image_related_resize_type'])) {
+ $this->data['config_image_related_resize_type'] = $store_info['config_image_related_resize_type'];
+ } else {
+ $this->data['config_image_related_resize_type'] = 'default';
+ }
+
+ if (isset($this->request->post['config_image_option_width'])) {
+ $this->data['config_image_option_width'] = $this->request->post['config_image_option_width'];
+ } elseif (isset($store_info['config_image_option_width'])) {
+ $this->data['config_image_option_width'] = $store_info['config_image_option_width'];
+ } else {
+ $this->data['config_image_option_width'] = 50;
+ }
+
+ if (isset($this->request->post['config_image_option_height'])) {
+ $this->data['config_image_option_height'] = $this->request->post['config_image_option_height'];
+ } elseif (isset($store_info['config_image_option_height'])) {
+ $this->data['config_image_option_height'] = $store_info['config_image_option_height'];
+ } else {
+ $this->data['config_image_option_height'] = 50;
+ }
+
+ if (isset($this->request->post['config_image_option_resize_type'])) {
+ $this->data['config_image_option_resize_type'] = $this->request->post['config_image_option_resize_type'];
+ } elseif (isset($store_info['config_image_option_resize_type'])) {
+ $this->data['config_image_option_resize_type'] = $store_info['config_image_option_resize_type'];
+ } else {
+ $this->data['config_image_option_resize_type'] = 'default';
+ }
if (isset($this->request->post['config_image_compare_width'])) {
$this->data['config_image_compare_width'] = $this->request->post['config_image_compare_width'];
@@ -819,6 +903,14 @@ class ControllerSettingStore extends Controller {
} else {
$this->data['config_image_compare_height'] = 90;
}
+
+ if (isset($this->request->post['config_image_compare_resize_type'])) {
+ $this->data['config_image_compare_resize_type'] = $this->request->post['config_image_compare_resize_type'];
+ } elseif (isset($store_info['config_image_compare_resize_type'])) {
+ $this->data['config_image_compare_resize_type'] = $store_info['config_image_compare_resize_type'];
+ } else {
+ $this->data['config_image_compare_resize_type'] = 'default';
+ }
if (isset($this->request->post['config_image_wishlist_width'])) {
$this->data['config_image_wishlist_width'] = $this->request->post['config_image_wishlist_width'];
@@ -835,6 +927,14 @@ class ControllerSettingStore extends Controller {
} else {
$this->data['config_image_wishlist_height'] = 50;
}
+
+ if (isset($this->request->post['config_image_wishlist_resize_type'])) {
+ $this->data['config_image_wishlist_resize_type'] = $this->request->post['config_image_wishlist_resize_type'];
+ } elseif (isset($store_info['config_image_wishlist_resize_type'])) {
+ $this->data['config_image_wishlist_resize_type'] = $store_info['config_image_wishlist_resize_type'];
+ } else {
+ $this->data['config_image_wishlist_resize_type'] = 'default';
+ }
if (isset($this->request->post['config_image_cart_width'])) {
$this->data['config_image_cart_width'] = $this->request->post['config_image_cart_width'];
@@ -852,6 +952,14 @@ class ControllerSettingStore extends Controller {
$this->data['config_image_cart_height'] = 80;
}
+ if (isset($this->request->post['config_image_cart_resize_type'])) {
+ $this->data['config_image_cart_resize_type'] = $this->request->post['config_image_cart_resize_type'];
+ } elseif (isset($store_info['config_image_cart_resize_type'])) {
+ $this->data['config_image_cart_resize_type'] = $store_info['config_image_cart_resize_type'];
+ } else {
+ $this->data['config_image_cart_resize_type'] = 'default';
+ }
+
if (isset($this->request->post['config_secure'])) {
$this->data['config_secure'] = $this->request->post['config_secure'];
} elseif (isset($store_info['config_secure'])) {
@@ -930,6 +1038,10 @@ class ControllerSettingStore extends Controller {
$this->error['image_related'] = $this->language->get('error_image_related');
}
+ if (!$this->request->post['config_image_option_width'] || !$this->request->post['config_image_option_height']) {
+ $this->error['image_option'] = $this->language->get('error_image_option');
+ }
+
if (!$this->request->post['config_image_compare_width'] || !$this->request->post['config_image_compare_height']) {
$this->error['image_compare'] = $this->language->get('error_image_compare');
}
diff --git a/upload/admin/language/english/setting/store.php b/upload/admin/language/english/setting/store.php
index 4ba0277..c99e8ca 100644
--- a/upload/admin/language/english/setting/store.php
+++ b/upload/admin/language/english/setting/store.php
@@ -59,6 +59,7 @@ $_['entry_image_popup'] = 'Product Image Popup Size:';
$_['entry_image_product'] = 'Product Image List Size:';
$_['entry_image_additional'] = 'Additional Product Image Size:';
$_['entry_image_related'] = 'Related Product Image Size:';
+$_['entry_image_option'] = 'Product Option Image Size:';
$_['entry_image_compare'] = 'Compare Image Size:';
$_['entry_image_wishlist'] = 'Wish List Image Size:';
$_['entry_image_cart'] = 'Cart Image Size:';
@@ -82,6 +83,7 @@ $_['error_image_product'] = 'Product List Size dimensions required!';
$_['error_image_category'] = 'Category List Size dimensions required!';
$_['error_image_additional'] = 'Additional Product Image Size dimensions required!';
$_['error_image_related'] = 'Related Product Image Size dimensions required!';
+$_['error_image_option'] = 'Product Option Image Size dimensions required!';
$_['error_image_compare'] = 'Compare Image Size dimensions required!';
$_['error_image_wishlist'] = 'Wish List Image Size dimensions required!';
$_['error_image_cart'] = 'Cart Image Size dimensions required!';
diff --git a/upload/admin/view/template/setting/store_form.tpl b/upload/admin/view/template/setting/store_form.tpl
index 3701db9..29bd927 100644
--- a/upload/admin/view/template/setting/store_form.tpl
+++ b/upload/admin/view/template/setting/store_form.tpl
@@ -393,6 +393,11 @@
<td><input type="text" name="config_image_category_width" value="<?php echo $config_image_category_width; ?>" size="3" />
x
<input type="text" name="config_image_category_height" value="<?php echo $config_image_category_height; ?>" size="3" />
+ <select name="config_image_category_resize_type">
+ <option value="default"<?php echo ( ($config_image_category_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_category_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_category_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_category) { ?>
<span class="error"><?php echo $error_image_category; ?></span>
<?php } ?></td>
@@ -402,6 +407,11 @@
<td><input type="text" name="config_image_thumb_width" value="<?php echo $config_image_thumb_width; ?>" size="3" />
x
<input type="text" name="config_image_thumb_height" value="<?php echo $config_image_thumb_height; ?>" size="3" />
+ <select name="config_image_thumb_resize_type">
+ <option value="default"<?php echo ( ($config_image_thumb_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_thumb_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_thumb_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_thumb) { ?>
<span class="error"><?php echo $error_image_thumb; ?></span>
<?php } ?></td>
@@ -411,6 +421,11 @@
<td><input type="text" name="config_image_popup_width" value="<?php echo $config_image_popup_width; ?>" size="3" />
x
<input type="text" name="config_image_popup_height" value="<?php echo $config_image_popup_height; ?>" size="3" />
+ <select name="config_image_popup_resize_type">
+ <option value="default"<?php echo ( ($config_image_popup_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_popup_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_popup_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_popup) { ?>
<span class="error"><?php echo $error_image_popup; ?></span>
<?php } ?></td>
@@ -420,6 +435,11 @@
<td><input type="text" name="config_image_product_width" value="<?php echo $config_image_product_width; ?>" size="3" />
x
<input type="text" name="config_image_product_height" value="<?php echo $config_image_product_height; ?>" size="3" />
+ <select name="config_image_product_resize_type">
+ <option value="default"<?php echo ( ($config_image_product_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_product_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_product_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_product) { ?>
<span class="error"><?php echo $error_image_product; ?></span>
<?php } ?></td>
@@ -429,6 +449,11 @@
<td><input type="text" name="config_image_additional_width" value="<?php echo $config_image_additional_width; ?>" size="3" />
x
<input type="text" name="config_image_additional_height" value="<?php echo $config_image_additional_height; ?>" size="3" />
+ <select name="config_image_additional_resize_type">
+ <option value="default"<?php echo ( ($config_image_additional_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_additional_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_additional_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_additional) { ?>
<span class="error"><?php echo $error_image_additional; ?></span>
<?php } ?></td>
@@ -438,15 +463,39 @@
<td><input type="text" name="config_image_related_width" value="<?php echo $config_image_related_width; ?>" size="3" />
x
<input type="text" name="config_image_related_height" value="<?php echo $config_image_related_height; ?>" size="3" />
+ <select name="config_image_related_resize_type">
+ <option value="default"<?php echo ( ($config_image_related_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_related_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_related_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_related) { ?>
<span class="error"><?php echo $error_image_related; ?></span>
<?php } ?></td>
</tr>
<tr>
+ <td><span class="required">*</span> <?php echo $entry_image_option; ?></td>
+ <td><input type="text" name="config_image_option_width" value="<?php echo $config_image_option_width; ?>" size="3" />
+ x
+ <input type="text" name="config_image_option_height" value="<?php echo $config_image_option_height; ?>" size="3" />
+ <select name="config_image_option_resize_type">
+ <option value="default"<?php echo ( ($config_image_option_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_option_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_option_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
+ <?php if ($error_image_option) { ?>
+ <span class="error"><?php echo $error_image_option; ?></span>
+ <?php } ?></td>
+ </tr>
+ <tr>
<td><span class="required">*</span> <?php echo $entry_image_compare; ?></td>
<td><input type="text" name="config_image_compare_width" value="<?php echo $config_image_compare_width; ?>" size="3" />
x
<input type="text" name="config_image_compare_height" value="<?php echo $config_image_compare_height; ?>" size="3" />
+ <select name="config_image_compare_resize_type">
+ <option value="default"<?php echo ( ($config_image_compare_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_compare_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_compare_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_compare) { ?>
<span class="error"><?php echo $error_image_compare; ?></span>
<?php } ?></td>
@@ -456,6 +505,11 @@
<td><input type="text" name="config_image_wishlist_width" value="<?php echo $config_image_wishlist_width; ?>" size="3" />
x
<input type="text" name="config_image_wishlist_height" value="<?php echo $config_image_wishlist_height; ?>" size="3" />
+ <select name="config_image_wishlist_resize_type">
+ <option value="default"<?php echo ( ($config_image_wishlist_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_wishlist_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_wishlist_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_wishlist) { ?>
<span class="error"><?php echo $error_image_wishlist; ?></span>
<?php } ?></td>
@@ -465,6 +519,11 @@
<td><input type="text" name="config_image_cart_width" value="<?php echo $config_image_cart_width; ?>" size="3" />
x
<input type="text" name="config_image_cart_height" value="<?php echo $config_image_cart_height; ?>" size="3" />
+ <select name="config_image_cart_resize_type">
+ <option value="default"<?php echo ( ($config_image_cart_resize_type == 'default')?(' selected'):('') ); ?>><?php echo $img_resize_type_d; ?></option>
+ <option value="w"<?php echo ( ($config_image_cart_resize_type == 'w')?(' selected'):('') ); ?>><?php echo $img_resize_type_w; ?></option>
+ <option value="h"<?php echo ( ($config_image_cart_resize_type == 'h')?(' selected'):('') ); ?>><?php echo $img_resize_type_h; ?></option>
+ </select>
<?php if ($error_image_cart) { ?>
<span class="error"><?php echo $error_image_cart; ?></span>
<?php } ?></td>
my4.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
commit a47c88d71769504c271849f97719b6d1a87c5165
Author: Haydar Kulekci <haydar.kulekci@reformo.net>
Date: Mon Dec 31 15:18:58 2012 +0200
 
image tool improvement about scale according to width, height, default
 
diff --git a/upload/catalog/model/tool/image.php b/upload/catalog/model/tool/image.php
index a0f0211..8e6c4d4 100644
--- a/upload/catalog/model/tool/image.php
+++ b/upload/catalog/model/tool/image.php
@@ -1,6 +1,17 @@
<?php
class ModelToolImage extends Model {
-21public function resize($filename, $width, $height) {
+ /**
+ *
+ * @param filename string
+ * @param width
+ * @param height
+ * @param type char [default, w, h]
+ * default = scale with white space,
+ * w = fill according to width,
+ * h = fill according to height
+ *
+ */
+ public function resize($filename, $width, $height, $type = "") {
if (!file_exists(DIR_IMAGE . $filename) || !is_file(DIR_IMAGE . $filename)) {
return;
}
@@ -10,7 +21,7 @@ class ModelToolImage extends Model {
$extension = $info['extension'];
$old_image = $filename;
- $new_image = 'cache/' . utf8_substr($filename, 0, utf8_strrpos($filename, '.')) . '-' . $width . 'x' . $height . '.' . $extension;
+ $new_image = 'cache/' . utf8_substr($filename, 0, utf8_strrpos($filename, '.')) . '-' . $width . 'x' . $height . $type .'.' . $extension;
if (!file_exists(DIR_IMAGE . $new_image) || (filemtime(DIR_IMAGE . $old_image) > filemtime(DIR_IMAGE . $new_image))) {
$path = '';
@@ -29,7 +40,7 @@ class ModelToolImage extends Model {
if ($width_orig != $width || $height_orig != $height) {
$image = new Image(DIR_IMAGE . $old_image);
- $image->resize($width, $height);
+ $image->resize($width, $height, $type);
$image->save(DIR_IMAGE . $new_image);
} else {
copy(DIR_IMAGE . $old_image, DIR_IMAGE . $new_image);
diff --git a/upload/system/library/image.php b/upload/system/library/image.php
index a7e220a..cdd7c7f 100644
--- a/upload/system/library/image.php
+++ b/upload/system/library/image.php
@@ -51,25 +51,49 @@ class Image {
imagedestroy($this->image);
}
- }
-
- public function resize($width = 0, $height = 0) {
+ }
+
+
+ /**
+ *
+ * @param width
+ * @param height
+ * @param type char [default, w, h]
+ * default = scale with white space,
+ * w = fill according to width,
+ * h = fill according to height
+ *
+ */
+ public function resize($width = 0, $height = 0, $type = "") {
if (!$this->info['width'] || !$this->info['height']) {
return;
}
$xpos = 0;
$ypos = 0;
-
+ $scale = 1;
+
$scale_w = $width / $this->info['width'];
$scale_h = $height / $this->info['height'];
- $scale = min($scale_w, $scale_h);
-
- if ($scale == 1 && $scale_h == $scale_w && $this->info['mime'] != 'image/png') {
+ if ($type == "w"){
+
+ $scale = $scale_w;
+
+ }else if ($type == "h"){
+
+ $scale = $scale_h;
+
+ }else{
+
+ $scale = min($scale_w, $scale_h);
+
+ }
+
+ if ( $scale == 1 && $scale_h == $scale_w && $this->info['mime'] != 'image/png' ) {
return;
}
-
+
$new_width = (int)($this->info['width'] * $scale);
$new_height = (int)($this->info['height'] * $scale);
$xpos = (int)(($width - $new_width) / 2);
my5.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
commit a110b0237d3bb68fea13789bdefb1e6ff341f7f2
Author: Daniel <webmaster@opencart.com>
Date: Thu Jan 3 22:32:37 2013 +0800
 
image class update some var names
 
diff --git a/upload/system/library/image.php b/upload/system/library/image.php
index cdd7c7f..d3eb471 100644
--- a/upload/system/library/image.php
+++ b/upload/system/library/image.php
@@ -53,18 +53,17 @@ class Image {
21 }
}
-
/**
*
* @param width
* @param height
- * @param type char [default, w, h]
- * default = scale with white space,
- * w = fill according to width,
- * h = fill according to height
+ * @param default char [default, w, h]
+ * default = scale with white space,
+ * w = fill according to width,
+ * h = fill according to height
*
*/
- public function resize($width = 0, $height = 0, $type = "") {
+ public function resize($width = 0, $height = 0, $default = '') {
if (!$this->info['width'] || !$this->info['height']) {
return;
}
@@ -76,21 +75,15 @@ class Image {
$scale_w = $width / $this->info['width'];
$scale_h = $height / $this->info['height'];
- if ($type == "w"){
-
+ if ($default == 'w') {
$scale = $scale_w;
-
- }else if ($type == "h"){
-
+ } elseif ($default == 'h'){
$scale = $scale_h;
-
- }else{
-
+ } else {
$scale = min($scale_w, $scale_h);
-
}
- if ( $scale == 1 && $scale_h == $scale_w && $this->info['mime'] != 'image/png' ) {
+ if ($scale == 1 && $scale_h == $scale_w && $this->info['mime'] != 'image/png') {
return;
}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.