Add X13 WebP module for image conversion to next-generation formats

- Implemented the main module class with essential properties and methods.
- Added translation support for various user interface strings.
- Created XML configuration file for module versioning.
- Ensured compatibility with different PHP versions and PrestaShop versions.
This commit is contained in:
2025-10-16 21:30:24 +02:00
parent d220e35c31
commit 3b29a79921
235 changed files with 40220 additions and 189 deletions

View File

@@ -0,0 +1,34 @@
<?php
class X13WebpAjaxModuleFrontController extends ModuleFrontController
{
public function init()
{
parent::init();
if($x13images = (array)Tools::getValue('x13images')){
$this->convertImages($x13images);
}
}
public function convertImages($x13images)
{
if (Configuration::get($this->module->options_prefix . 'OPERATION_MODE') == 0) {
return;
}
foreach($x13images as $img){
$ext = pathinfo($img, PATHINFO_EXTENSION);
if (in_array($ext, $this->module->x13helper->getAvailableExtensions()) && !$this->module->x13helper->checkWebpExistsFromUrl($img)) {
$this->module->x13converter->convertWebpFromUrl($img);
}
}
}
}