Skip to content

Commit

Permalink
Version 6.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
luigifab committed Mar 3, 2021
1 parent 3052d65 commit 6c9b851
Show file tree
Hide file tree
Showing 86 changed files with 670 additions and 761 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# apijs

Beautiful javascript popup and slideshow for OpenMage and Magento.
Beautiful javascript popup and slideshow for [OpenMage](https://github.com/OpenMage/magento-lts).

For more information, go to https://www.luigifab.fr/apijs or https://www.luigifab.fr/openmage/apijs or https://www.luigifab.fr/magento/apijs or https://www.luigifab.fr/redmine/apijs (IPv6 is required, it's not a joke). No IPv6? It's possible to get an IPv6 thanks to *Miredo*. Run `sudo apt install miredo` and `sudo service miredo force-start`.
For more information, go to https://www.luigifab.fr/apijs and https://www.luigifab.fr/openmage/apijs (IPv6 is required, it's not a joke). No IPv6? It's possible to get an IPv6 thanks to *Miredo*. Run `sudo apt install miredo` and `sudo service miredo force-start`.

- for the app, go to https://www.github.com/luigifab/apijs
- for the plugin for Redmine, go to https://www.github.com/luigifab/redmine-apijs
- for the bundle for Symfony, go to https://www.github.com/luigifab/symfony-apijs
- for the app, go to [apijs](https://www.github.com/luigifab/apijs)
- for the plugin for Redmine, go to [redmine-apijs](https://www.github.com/luigifab/redmine-apijs)
- for the bundle for Symfony, go to [symfony-apijs](https://www.github.com/luigifab/symfony-apijs)

This repository is a mirror. To install the module, please use the extension key or the composer key available in the documentation.
This repository is a releases mirror. To install the module, please use the composer key available in the documentation.

- Current version: 6.5.0 (12/12/2020)
- Compatibility: OpenMage 19+, Magento Community 1.9+, PHP 7.2 / 7.3 / 7.4 / 8.0
- Client compatibility: Firefox 36+, Chrome 31+, Opera 19+, Edge 16+, Safari 9+
- Current version: 6.6.0 (03/03/2021)
- Compatibility: OpenMage 19.x / 20.x, PHP 7.2 / 7.3 / 7.4 / 8.0, Python 3.3 / 3.4 / 3.5 / 3.6 / 3.7 / 3.8 / 3.9
- Client compatibility: Firefox 36+, Chrome 32+, Opera 19+, Edge 16+, Safari 9+
- Translations: English (en), French (fr-FR/fr-CA), German (de), Italian (it), Portuguese (pt-PT/pt-BR), Spanish (es)
- Other translations: Czech (cs), Dutch (nl), Japanese (ja), Polish (pl), Slovak (sk)
- Other translations: Chinese (zh), Russian (ru), Turkish (tr)
- Other translations: Chinese (zh), Russian (ru), Turkish (tr), Ukrainian (uk)
- License: GNU GPL 2+

If you like, take some of your time to improve the translations, go to https://bit.ly/2HyCCEc.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"type": "magento-module",
"name": "luigifab/openmage-apijs",
"description": "Beautiful javascript popup and slideshow for OpenMage and Magento.",
"description": "Beautiful javascript popup and slideshow for OpenMage.",
"homepage": "https://github.com/luigifab/openmage-apijs",
"license": "GPL-2.0-or-later",
"authors": [
Expand Down Expand Up @@ -53,6 +53,7 @@
["src/app/locale/es_PE/Luigifab_Apijs.csv", "app/locale/es_PE/Luigifab_Apijs.csv"],
["src/app/locale/es_VE/Luigifab_Apijs.csv", "app/locale/es_VE/Luigifab_Apijs.csv"],
["src/app/locale/fr_CA/Luigifab_Apijs.csv", "app/locale/fr_CA/Luigifab_Apijs.csv"],
["src/app/locale/fr_CH/Luigifab_Apijs.csv", "app/locale/fr_CH/Luigifab_Apijs.csv"],
["src/app/locale/fr_FR/Luigifab_Apijs.csv", "app/locale/fr_FR/Luigifab_Apijs.csv"],
["src/app/locale/it_CH/Luigifab_Apijs.csv", "app/locale/it_CH/Luigifab_Apijs.csv"],
["src/app/locale/it_IT/Luigifab_Apijs.csv", "app/locale/it_IT/Luigifab_Apijs.csv"],
Expand All @@ -64,6 +65,7 @@
["src/app/locale/ru_RU/Luigifab_Apijs.csv", "app/locale/ru_RU/Luigifab_Apijs.csv"],
["src/app/locale/sk_SK/Luigifab_Apijs.csv", "app/locale/sk_SK/Luigifab_Apijs.csv"],
["src/app/locale/tr_TR/Luigifab_Apijs.csv", "app/locale/tr_TR/Luigifab_Apijs.csv"],
["src/app/locale/uk_UA/Luigifab_Apijs.csv", "app/locale/uk_UA/Luigifab_Apijs.csv"],
["src/app/locale/zh_CN/Luigifab_Apijs.csv", "app/locale/zh_CN/Luigifab_Apijs.csv"],
["src/app/etc/modules/Luigifab_Apijs.xml", "app/etc/modules/Luigifab_Apijs.xml"],
["src/app/code/community/Luigifab/Apijs/", "app/code/community/Luigifab/Apijs/"],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/**
* Created V/23/05/2014
* Updated D/31/05/2020
* Updated V/12/02/2021
*
* Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://www.luigifab.fr/openmage/apijs
*
* This program is free software, you can redistribute it or modify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created D/20/11/2011
* Updated M/28/02/2017
*
* Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://www.luigifab.fr/openmage/apijs
*
* This program is free software, you can redistribute it or modify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created M/06/10/2020
* Updated M/06/10/2020
*
* Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://www.luigifab.fr/openmage/apijs
*
* This program is free software, you can redistribute it or modify
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/**
* Created L/30/03/2020
* Updated L/30/03/2020
* Updated J/18/02/2021
*
* Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://www.luigifab.fr/openmage/apijs
*
* This program is free software, you can redistribute it or modify
Expand Down Expand Up @@ -33,7 +33,7 @@ public function getElementHtml() {
if ($this->getValue()) {
$url = $this->_getUrl();
$url = (mb_stripos($url, 'http') === 0) ? $url : Mage::getBaseUrl('media').$url;
$html .= sprintf(' <a href="%s" onclick="apijs.dialog.dialogPhoto(this.href, \'false\', \'false\', \'%s\'); return false;" id="%s_image">%s (%s)</a> ', $url, addslashes($this->getValue()), $this->getHtmlId(), Mage::helper('apijs')->__('Preview'), $this->getValue());
$html .= sprintf(' <a href="%s" onclick="apijs.dialog.dialogPhoto(this.href, \'false\', \'false\', \'%s\'); return false;" id="%s_image">%s (%s)</a> ', $url, addslashes($this->getValue()), $this->getHtmlId(), Mage::helper('apijs')->__('Preview'), $this->getValue()); // pas de this->helper ici
}

return $html.$this->_getDeleteCheckbox().'</div>';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/**
* Created L/26/10/2015
* Updated L/30/03/2020
* Updated J/28/01/2021
*
* Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://www.luigifab.fr/openmage/apijs
*
* This program is free software, you can redistribute it or modify
Expand Down Expand Up @@ -33,7 +33,7 @@ public function getElementHtml() {
if ($this->getValue()) {
$url = $this->_getUrl();
$url = (mb_stripos($url, 'http') === 0) ? $url : Mage::getBaseUrl('media').$url;
$html .= sprintf(' <a href="%s" onclick="apijs.dialog.dialogPhoto(this.href, \'false\', \'false\', \'%s\'); return false;" id="%s_image">%s (%s)</a> ', $url, addslashes($this->getValue()), $this->getHtmlId(), Mage::helper('apijs')->__('Preview'), $this->getValue());
$html .= sprintf(' <a href="%s" onclick="apijs.dialog.dialogPhoto(this.href, \'false\', \'false\', \'%s\'); return false;" id="%s_image">%s (%s)</a> ', $url, addslashes($this->getValue()), $this->getHtmlId(), Mage::helper('apijs')->__('Preview'), $this->getValue()); // pas de $this->helper
}

return $html.$this->_getDeleteCheckbox().'</div>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created S/04/10/2014
* Updated L/06/07/2020
*
* Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://www.luigifab.fr/openmage/apijs
*
* This program is free software, you can redistribute it or modify
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created S/04/01/2020
* Updated M/29/09/2020
*
* Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://www.luigifab.fr/openmage/apijs
*
* This program is free software, you can redistribute it or modify
Expand Down
2 changes: 1 addition & 1 deletion src/app/code/community/Luigifab/Apijs/Block/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Created V/11/10/2019
* Updated V/11/10/2019
*
* Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://www.luigifab.fr/openmage/apijs
*
* This program is free software, you can redistribute it or modify
Expand Down
22 changes: 13 additions & 9 deletions src/app/code/community/Luigifab/Apijs/Helper/Data.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php
/**
* Created D/20/11/2011
* Updated D/20/09/2020
* Updated D/21/02/2021
*
* Copyright 2008-2020 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* Copyright 2008-2021 | Fabrice Creuzot (luigifab) <code~luigifab~fr>
* https://www.luigifab.fr/openmage/apijs
*
* This program is free software, you can redistribute it or modify
Expand All @@ -24,7 +24,8 @@ public function getVersion() {
}

public function _(string $data, ...$values) {
return (mb_stripos($txt = $this->__(' '.$data, ...$values), ' ') === 0) ? $this->__($data, ...$values) : $txt;
$text = $this->__(' '.$data, ...$values);
return ($text[0] == ' ') ? $this->__($data, ...$values) : $text;
}

public function escapeEntities($data, bool $quotes = false) {
Expand Down Expand Up @@ -70,23 +71,25 @@ public function getWysiwygImageDir(bool $cache = false, bool $old = false) {
}


public function resizeImage($product, $type, $path, $width, $height, $fixed) {
public function resizeImage($product, $type, $path, int $width, int $height, bool $fixed) {

$resource = Mage::helper('catalog/image')->init($product, $type, $path, $fixed);

if ($fixed)
if (Mage::getStoreConfigFlag('apijs/general/python'))
$resource->resize($width, $height);
else if ($fixed)
$resource->resize($width, $height);
else if ($resource->getOriginalWidth() > $width)
$resource->constrainOnly(true)->keepAspectRatio(true)->keepFrame(false)->resize($width, null);
else if ($resource->getOriginalHeight() > $height)
$resource->constrainOnly(true)->keepAspectRatio(true)->keepFrame(false)->resize(null, $height);
else
$resource->resize($width, $height);
$resource->constrainOnly(true)->keepAspectRatio(true)->keepFrame(false)->resize($width, $height);

return (string) $resource;
}

public function getBaseImage($product, &$default, $images, $total, $id = 0) {
public function getBaseImage($product, &$default, array $images, int $total, int $id = 0) {

$mWidth = (int) Mage::getStoreConfig('apijs/gallery/picture_width');
$mHeight = (int) Mage::getStoreConfig('apijs/gallery/picture_height');
Expand Down Expand Up @@ -151,7 +154,7 @@ public function getBaseImage($product, &$default, $images, $total, $id = 0) {
return $data;
}

public function getThumbnail($product, $default, $image, $id) {
public function getThumbnail($product, $default, object $image, int $id) {

$tWidth = (int) Mage::getStoreConfig('apijs/gallery/thumbnail_width');
$tHeight = (int) Mage::getStoreConfig('apijs/gallery/thumbnail_height');
Expand Down Expand Up @@ -180,6 +183,7 @@ public function getThumbnail($product, $default, $image, $id) {
return $data;
}


public function removeFiles(string $dir, string $file) {

// recherche tous les fichiers avec la commande find
Expand Down Expand Up @@ -236,7 +240,7 @@ public function getTabName($product = null) {
return null;
}

public function renderGalleryBlock(Mage_Catalog_Model_Product $product) {
public function renderGalleryBlock(object $product) {

Mage::register('current_product', $product);

Expand Down
Loading

0 comments on commit 6c9b851

Please sign in to comment.