136 lines
6.4 KiB
PHP
136 lines
6.4 KiB
PHP
<?php
|
|
|
|
if (!defined('_PS_VERSION_')) {
|
|
exit;
|
|
}
|
|
|
|
if (!defined('X13_ION_LB_VERSION')) {
|
|
if (PHP_VERSION_ID >= 80100) {
|
|
$x13IonVer = '-81';
|
|
$x13IonFolder = 'php81';
|
|
} else if (PHP_VERSION_ID >= 70100) {
|
|
$x13IonVer = '-71';
|
|
$x13IonFolder = 'php71';
|
|
} else if (PHP_VERSION_ID >= 70000) {
|
|
$x13IonVer = '-7';
|
|
$x13IonFolder = 'php70';
|
|
} else {
|
|
$x13IonVer = '';
|
|
$x13IonFolder = 'php5';
|
|
}
|
|
|
|
if (file_exists(_PS_MODULE_DIR_ . 'x13webp/dev')) {
|
|
$x13IonVer = '';
|
|
$x13IonFolder = 'php5';
|
|
}
|
|
|
|
define('X13_ION_LB_VERSION', $x13IonVer);
|
|
define('X13_ION_LB_FOLDER', $x13IonFolder);
|
|
}
|
|
|
|
require_once _PS_MODULE_DIR_ . 'x13webp/x13webp.core' . X13_ION_LB_VERSION . '.php';
|
|
|
|
|
|
class X13Webp extends X13WebpCore
|
|
{
|
|
public $modernBackOfficeLayout = false;
|
|
|
|
public function __construct()
|
|
{
|
|
$this->name = 'x13webp';
|
|
$this->tab = 'front_office_features';
|
|
$this->version = '1.1.2';
|
|
$this->author = 'X13.pl';
|
|
$this->need_instance = 0;
|
|
$this->is_configurable = 0;
|
|
$this->ps_version = substr(_PS_VERSION_, 0, 3);
|
|
$this->ps_versions_compliancy['min'] = '1.6';
|
|
$this->ps_versions_compliancy['max'] = _PS_VERSION_;
|
|
$this->secure_key = Tools::encrypt($this->name);
|
|
$this->bootstrap = true;
|
|
|
|
parent::__construct();
|
|
|
|
$this->initTranslations();
|
|
|
|
$this->setOptionsPrefix($this->name);
|
|
|
|
$this->initClasses();
|
|
|
|
$this->confirmUninstall = $this->l('Before uninstalling the module, make sure that all images WebP have been deleted');
|
|
|
|
$this->displayName = $this->l('WebP - image converter to next-generation formats photos');
|
|
$this->description = $this->l('An advanced module that allows you to quickly convert photos to new generation formats. The module allows you to convert all photos from the store to WebP format using AJAXA, CRON tasks or creating photos on the fly.');
|
|
|
|
if (version_compare(_PS_VERSION_, '1.7.6', '>=')) {
|
|
$this->modernBackOfficeLayout = true;
|
|
}
|
|
}
|
|
|
|
public function initTranslations()
|
|
{
|
|
static::$x13Translations = array(
|
|
'Settings' => $this->l('Settings'),
|
|
'Enabled' => $this->l('Enabled'),
|
|
'Disabled' => $this->l('Disabled'),
|
|
'Save' => $this->l('Save'),
|
|
'%s product images has been deleted' => $this->l('%s product images has been deleted'),
|
|
'There are no images to delete' => $this->l('There are no images to delete'),
|
|
'Tmp folder has been cleaned, %s photos deleted' => $this->l('Tmp folder has been cleaned, %s photos deleted'),
|
|
'A problem occured' => $this->l('A problem occured'),
|
|
'%s unnecessary images has been deleted' => $this->l('%s unnecessary images has been deleted'),
|
|
'The new version of the module %s is now available! - download it from x13.pl' => $this->l('The new version of the module %s is now available! - download it from x13.pl'),
|
|
'Product' => $this->l('Product'),
|
|
'An error occurred while adding image to database' => $this->l('An error occurred while adding image to database'),
|
|
'An error occurred while getting next image' => $this->l('An error occurred while getting next image'),
|
|
'Category' => $this->l('Category'),
|
|
'Manufacturer' => $this->l('Manufacturer'),
|
|
'Supplier' => $this->l('Supplier'),
|
|
'Store' => $this->l('Store'),
|
|
'CMS image' => $this->l('CMS image'),
|
|
'Module image' => $this->l('Module image'),
|
|
'Theme image' => $this->l('Theme image'),
|
|
'Logo' => $this->l('Logo'),
|
|
'Others' => $this->l('Others'),
|
|
'Are you sure you want to re-generate all the images?' => $this->l('Are you sure you want to re-generate all the images?'),
|
|
'You cannot do this until the conversion progress is complete.' => $this->l('You cannot do this until conversion progress is done'),
|
|
'Active' => $this->l('Active'),
|
|
'No active' => $this->l('No active'),
|
|
'If you want to generate images you must first enable the module' => $this->l('If you want to generate images you must first enable the module'),
|
|
'No image in this folder' => $this->l('No image in this folder'),
|
|
'Something goes wrong' => $this->l('Something goes wrong'),
|
|
'Products' => $this->l('Products'),
|
|
'Categories' => $this->l('Categories'),
|
|
'Manufacturers' => $this->l('Manufacturers'),
|
|
'Suppliers' => $this->l('Suppliers'),
|
|
'Stores' => $this->l('Stores'),
|
|
'CMS images' => $this->l('CMS images'),
|
|
'All images in the /img/cms/ folder' => $this->l('All images in the /img/cms/ folder'),
|
|
'Module images' => $this->l('Module images'),
|
|
'All images in the /modules/ folder' => $this->l('All images in the /modules/ folder'),
|
|
'Theme images' => $this->l('Theme images'),
|
|
'All images in theme' => $this->l('All images in theme'),
|
|
'Store logo' => $this->l('Store logo'),
|
|
'Done' => $this->l('Done'),
|
|
'You cannot do this until other process is complete' => $this->l('You cannot do this until other process is complete'),
|
|
'Success' => $this->l('Success'),
|
|
'Product image' => $this->l('Product image'),
|
|
'Category image' => $this->l('Category image'),
|
|
'Manufacturers image' => $this->l('Manufacturers image'),
|
|
'Suppliers image' => $this->l('Suppliers image'),
|
|
'Stores image' => $this->l('Stores image'),
|
|
'Others image' => $this->l('Others image'),
|
|
'Product images' => $this->l('Product images'),
|
|
'Category images' => $this->l('Category images'),
|
|
'Manufacturers images' => $this->l('Manufacturers images'),
|
|
'Suppliers images' => $this->l('Suppliers images'),
|
|
'Stores images' => $this->l('Stores images'),
|
|
'Others images' => $this->l('Others images'),
|
|
'Invalid license, contact us for more details.' => $this->l('Invalid license, contact us for more details.'),
|
|
'Invalid license.' => $this->l('Invalid license.'),
|
|
'Invalid license or domain.' => $this->l('Invalid license or domain.'),
|
|
'The license has expired.' => $this->l('The license has expired.')
|
|
);
|
|
}
|
|
}
|