From d4e812cb3d2416b2bd4303e5d616fb8b72be1801 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 5 May 2023 10:01:37 +0200 Subject: [PATCH] fix #5408 @2 --- app/Console/Commands/FluidbookCompile.php | 2 +- .../Commands/FluidbookLinksFromPDF.php | 6 +- app/Fluidbook/Compiler/Cart.php | 574 +++++++++++ app/Fluidbook/{ => Compiler}/Compiler.php | 950 +----------------- app/Fluidbook/Compiler/Links.php | 394 ++++++++ app/Fluidbook/Link/Custom/InpesPopinLink.php | 2 +- .../{Links.php => Link/LinksData.php} | 8 +- app/Fluidbook/Packager/Packager.php | 2 +- app/Fluidbook/SEO/Document.php | 2 +- app/Fluidbook/SearchIndex.php | 1 + .../FluidbookPublication/LinksOperation.php | 37 +- .../FluidbookPublication/PreviewOperation.php | 2 +- .../Operations/Tools/FluidbookCopyLinks.php | 4 +- app/Jobs/FluidbookDocumentUpload.php | 1 - app/Jobs/FluidbookImagesPreprocess.php | 2 +- app/Models/FluidbookPublication.php | 7 +- app/SubForms/Link/Anchor.php | 4 +- app/SubForms/Link/Article.php | 3 +- app/SubForms/Link/ArticleOpen.php | 3 +- app/SubForms/Link/Audio.php | 3 +- app/SubForms/Link/Audiodescription.php | 3 +- app/SubForms/Link/Base.php | 129 +-- app/SubForms/Link/BookmarkGroup.php | 3 +- app/SubForms/Link/Cart.php | 3 +- app/SubForms/Link/Color.php | 4 +- app/SubForms/Link/Custom.php | 3 +- app/SubForms/Link/DownloadPortion.php | 3 +- app/SubForms/Link/Email.php | 4 +- app/SubForms/Link/EventOverlay.php | 4 +- app/SubForms/Link/File.php | 3 +- app/SubForms/Link/Flipcard.php | 3 +- app/SubForms/Link/IFrame.php | 3 +- app/SubForms/Link/Image.php | 3 +- app/SubForms/Link/Internal.php | 3 +- app/SubForms/Link/Layer.php | 3 +- app/SubForms/Link/Like.php | 3 +- app/SubForms/Link/LockContents.php | 3 +- app/SubForms/Link/Multimedia.php | 3 +- app/SubForms/Link/PDF.php | 3 + app/SubForms/Link/Phone.php | 4 +- app/SubForms/Link/ShowLink.php | 3 +- app/SubForms/Link/Slideshow.php | 3 +- app/SubForms/Link/StatsTag.php | 4 +- app/SubForms/Link/Text.php | 3 +- app/SubForms/Link/Tooltip.php | 4 + app/SubForms/Link/TriggerLink.php | 3 +- app/SubForms/Link/Video.php | 3 +- app/SubForms/Link/Web.php | 3 +- app/SubForms/Link/WebInfos.php | 4 +- app/SubForms/Link/WebVideo.php | 3 +- app/SubForms/Link/ZoomArea.php | 3 +- app/SubForms/Link/ZoomHD.php | 4 +- composer.lock | 320 +++--- 53 files changed, 1290 insertions(+), 1267 deletions(-) create mode 100644 app/Fluidbook/Compiler/Cart.php rename app/Fluidbook/{ => Compiler}/Compiler.php (74%) create mode 100644 app/Fluidbook/Compiler/Links.php rename app/Fluidbook/{Links.php => Link/LinksData.php} (99%) diff --git a/app/Console/Commands/FluidbookCompile.php b/app/Console/Commands/FluidbookCompile.php index 6339d4914..a52dc5b7f 100644 --- a/app/Console/Commands/FluidbookCompile.php +++ b/app/Console/Commands/FluidbookCompile.php @@ -2,7 +2,7 @@ namespace App\Console\Commands; -use App\Fluidbook\Compiler; +use App\Fluidbook\Compiler\Compiler; use App\Models\FluidbookPublication; use Cubist\Backpack\Console\Commands\CubistCommand; use Cubist\Util\PHP; diff --git a/app/Console/Commands/FluidbookLinksFromPDF.php b/app/Console/Commands/FluidbookLinksFromPDF.php index 3a5eae929..61767997a 100644 --- a/app/Console/Commands/FluidbookLinksFromPDF.php +++ b/app/Console/Commands/FluidbookLinksFromPDF.php @@ -2,10 +2,8 @@ namespace App\Console\Commands; -use App\Fluidbook\Links; -use App\Models\Traits\FluidbookPlayerBranches; +use App\Fluidbook\Link\LinksData; use Cubist\Backpack\Console\Commands\CubistCommand; -use Cubist\Util\PHP; class FluidbookLinksFromPDF extends CubistCommand { @@ -14,7 +12,7 @@ class FluidbookLinksFromPDF extends CubistCommand public function handle() { - Links::addLinksFromPDF($this->argument('id')); + LinksData::addLinksFromPDF($this->argument('id')); } } diff --git a/app/Fluidbook/Compiler/Cart.php b/app/Fluidbook/Compiler/Cart.php new file mode 100644 index 000000000..17cbef8e5 --- /dev/null +++ b/app/Fluidbook/Compiler/Cart.php @@ -0,0 +1,574 @@ +lessVariables['import-cart-styles'] = 'grandvision'; + + $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); + $this->addJsLib('grandvision', 'js/libs/fluidbook/cart/fluidbook.cart.grandvision.js'); + $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js'); + $this->addJsLib('multiselect', 'js/libs/jquery/jquery.multi-select.js'); + $this->addJsLib('jqueryui', 'js/libs/jquery/jquery-ui.min.js'); + $this->addJsLib('exceljs', 'js/libs/exceljs.min.js'); + $this->svgfiles[] = $this->assets . '/images/symbols/grandvision.svg'; + + $cdir = $this->wdir . '/commerce/'; + $file = $cdir . $this->fluidbookSettings->basketReferences; + $refs = ExcelToArray::excelToArrayKeyVars($file, 'Excel2007', true); + $this->config->basketReferences = []; + foreach ($refs as $ean => $ref) { + $this->config->basketReferences[$ean] = $ref; + $this->config->basketReferences[$ean]['angle_url'] = base64_encode(file_get_contents($this->wdir . '/commerce/opt/' . $ean . '-angle.jpg')); + } + + $odir = $cdir . '/opt/'; + if (!file_exists($odir)) { + mkdir($odir, 0777, true); + } + + $it = Files::getDirectoryIterator($cdir); + $exts = ['png', 'jpg', 'tif', 'mp4']; + foreach ($it as $file) { + + /** @var $file SplFileInfo */ + if ($file->isDir()) { + continue; + } + $ext = $file->getExtension(); + if (!in_array($ext, $exts)) { + continue; + } + + $e = Text::multiExplode('_-.', mb_strtolower($file->getFilename())); + $ean = $this->findEAN($e); + if (!$ean) { + continue; + } + if (!isset($this->config->basketReferences[$ean])) { + continue; + } + $f = $file->getPathname(); + + if ($ext === 'mp4') { + $n = $ean . '-360.mp4'; + $this->config->basketReferences[$ean]['360'] = true; + $opt = $odir . '/' . $n; + if (!file_exists($opt) || !filesize($opt) || filemtime($opt) < filemtime($f)) { + // Optimize original video + `ffmpeg -i $f -filter:v scale=360:-2 -vcodec libx264 -an $opt`; + touch($opt, filemtime($f)); + } + } else { + if (in_array('front', $e)) { + $type = 'front'; + } else if (in_array('angle', $e)) { + $type = 'angle'; + } else { + continue; + } + + $n = $ean . '-' . $type . '.jpg'; + $this->config->basketReferences[$ean][$type] = true; + $opt = $odir . '/' . $n; + if (!file_exists($opt) || !filesize($opt) || filemtime($opt) < filemtime($f)) { + // Optimize original image + $convert = new Resizer(); + $convert->loadImage($f); + $convert->resize(1080, null, 'ratio', false, 'C', 'M', 'white'); + $convert->output('jpg', $opt, 75); + touch($opt, filemtime($f)); + } + } + $this->vdir->copy($opt, 'data/commerce/' . $n); + } + } + + public function findEAN($array) + { + foreach ($array as $item) { + if (strlen($item) === 13 && preg_match('/^\d{13}$/', $item)) { + return $item; + } + } + return false; + } + + public function writeFlexipanCart() + { + $this->lessVariables['import-cart-styles'] = 'flexipan'; + + $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); + $this->addJsLib('flexipan', 'js/libs/fluidbook/cart/fluidbook.cart.flexipan.js'); + $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js'); + + $cdir = $this->wdir . '/commerce/'; + + + $file = $cdir . $this->fluidbookSettings->basketReferences; + $this->config->basketReferences = ExcelToArray::excelToArrayKeyVars($file); + + $this->getLinksAndRulers($links, $rulers); + + foreach ($links as $link) { + if ($link['type'] == '12') { + + } + } + + $this->config->product_zoom_references = []; + foreach ($this->config->basketReferences as $ref => $data) { + $this->config->product_zoom_references[$ref] = [$ref]; + } + } + + + + public function writeMIFCart() + { + $this->lessVariables['import-cart-styles'] = 'mif'; + + $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); + $this->addJsLib('mif', 'js/libs/fluidbook/cart/fluidbook.cart.mif.js'); + $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js'); + + $cdir = $this->wdir . '/commerce/'; + $odir = $cdir . '/opt/'; + if (!file_exists($odir)) { + mkdir($odir, 0777, true); + } + + $file = $cdir . $this->fluidbookSettings->basketReferences; + $this->config->basketReferences = ExcelToArray::excelToArrayKeyVars($file); + + $this->getLinksAndRulers($links, $rulers); + + foreach ($this->config->basketReferences as $ref => $data) { + $source = $cdir . '/' . $data['Image']; + if (!file_exists($source)) { + continue; + } + $d = Text::str2URL($ref) . '.jpg'; + $dest = $odir . '/' . $d; + if (!file_exists($dest) || !filesize($dest) || filemtime($dest) < filemtime($source)) { + $convert = new Resizer(); + $convert->loadImage($source); + $convert->resize(500, 500, 'ratio', false, 'C', 'M', 'ffffff'); + $convert->output('jpg', $dest, 80); + } + $vdest = 'data/commerce/opt/' . $d; + $this->vdir->copy($dest, $vdest); + $this->config->basketReferences[$ref]['Image'] = $vdest; + } + + foreach ($links as $link) { + if ($link['type'] == '12') { + + } + } + +// $this->config->product_zoom_references = []; +// foreach ($this->config->basketReferences as $ref => $data) { +// $r = [$data['Lien']]; +// $this->config->product_zoom_references[$ref] = $r; +// } + } + + public function writeJoueClub2021Cart() + { + $this->lessVariables['import-cart-styles'] = 'joueclub2021'; + $extra = Link::parseExtras($this->fluidbookSettings->cartExtraSettings, true); + + /** + * buttonColor=#d7b646 + * buttonTextColor=#ffffff + * headerBackgroundColor=#0e1a3c + * headerTextColor=#ffffff + */ + $this->lessVariables['cart-button-color'] = $extra['buttoncolor'] ?? '#e30613'; + $this->lessVariables['cart-button-text-color'] = $extra['buttontextcolor'] ?? '#ffffff'; + $this->lessVariables['cart-button-radius'] = $extra['buttonradius'] ?? '50%'; + $this->lessVariables['cart-header-background-color'] = $extra['headerbackgroundcolor'] ?? '#26348b'; + $this->lessVariables['cart-header-text-color'] = $extra['headertextcolor'] ?? '#ffffff'; + $this->lessVariables['cart-close-color'] = $extra['closecolor'] ?? '#ffffff'; + $this->lessVariables['cart-close-background-color'] = $extra['closebackgroundcolor'] ?? '#e30613'; + $this->lessVariables['cart-close-radius'] = $extra['closeradius'] ?? '50%'; + $this->lessVariables['cart-actions-radius'] = $extra['actionsradius'] ?? '8px'; + $this->lessVariables['cart-actions-background-color'] = $extra['actionsbackgroundcolor'] ?? '#26348b'; + $this->lessVariables['cart-actions-text-color'] = $extra['actionstextcolor'] ?? '#ffffff'; + $this->lessVariables['cart-scrollbar-color'] = $extra['scrollbarcolor'] ?? '#26348b'; + + $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); + $this->addJsLib('joueclub2021', 'js/libs/fluidbook/cart/fluidbook.cart.joueclub2021.js'); + $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js'); + + $cdir = $this->wdir . '/commerce/'; + + $file = $cdir . $this->fluidbookSettings->basketReferences; + $this->config->basketReferences = ExcelToArray::excelToArrayKeyVars($file); + + foreach ($this->config->basketReferences as $ref => $data) { + $dest = $cdir . $ref . '.jpg'; + if (!file_exists($dest)) { + copy($data['img'], $dest); + } + $this->vdir->copy($dest, 'data/commerce/' . $ref . '.jpg'); + } + $addFiles = [$this->config->cartHeaderImage, $this->config->cartHeaderMobileImage]; + foreach ($addFiles as $f) { + if (!$f) { + return; + } + + $this->vdir->copy($cdir . $f, 'data/commerce/' . $f); + } + + $this->getLinksAndRulers($links, $rulers); + } + + public function writeGrandPavoisCart() + { + $this->lessVariables['import-cart-styles'] = 'grandpavois'; + + $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); + $this->addJsLib('grandpavois', 'js/libs/fluidbook/cart/fluidbook.cart.grandpavois.js'); + $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js'); + + $cdir = $this->wdir . '/commerce/'; + $odir = $cdir . '/opt/'; + if (!file_exists($odir)) { + mkdir($odir, 0777, true); + } + + $file = $cdir . $this->fluidbookSettings->basketReferences; + $this->config->basketReferences = ExcelToArray::excelToArrayKeyVars($file); + + $this->getLinksAndRulers($links, $rulers); + } + + + public function writePumaCart() + { + $this->lessVariables['import-cart-styles'] = 'puma'; + + $this->addJsLib('parsley', 'js/libs/parsley.min.js'); + $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); + $this->addJsLib('puma', 'js/libs/fluidbook/cart/fluidbook.cart.puma.js'); + $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js'); + $this->addJsLib('exceljs', 'js/libs/exceljs.min.js'); + $this->addVideoJs(); + + $this->config->basketReferences = ExcelToArray::excelToArrayKeyVars($this->wdir . 'commerce/' . $this->fluidbookSettings->basketReferences); + $eanFile = $this->wdir . 'commerce/ean.xlsx'; + if (file_exists($eanFile)) { + $this->config->eanReferences = ExcelToArray::excelToArrayIndexKeyVars($eanFile); + } + + $this->getLinksAndRulers($links, $rulers); + foreach ($links as $link) { + if ($link['type'] == '12' && isset($this->config->basketReferences[$link['to']])) { + $this->config->basketReferences[$link['to']]['zoom_image'] = 'data/links/zoom_' . $link['uid'] . '.jpg'; + $this->config->basketReferences[$link['to']]['zoom_url'] = base64_encode(file_get_contents($this->dir . '/data/links/zoom_' . $link['uid'] . '.jpg')); + $this->config->basketReferences[$link['to']]['zoom_image_ratio'] = $link['width'] / $link['height']; + } + } + + $this->config->product_zoom_references = []; + $files = ['360°', 'Image supplémentaire', 'Fiche technique']; + foreach ($this->config->basketReferences as $ref => $data) { + $r = []; + foreach ($files as $file) { + if (!isset($data[$file])) { + $data[$file] = ''; + } + $fname = trim($data[$file]); + if ($fname !== '') { + $fname = str_replace(' ', '-', $fname); + $wfile = $this->wdir . 'commerce/' . $fname; + if (file_exists($wfile)) { + $fname = 'data/commerce/' . $fname; + $this->vdir->copy($wfile, $fname); + } else { + $fname = ''; + } + } + $r[] = $fname; + } + $this->config->product_zoom_references[$ref] = $r; + } + } + + + public function writeThirietCart() + { + $this->config->cartLinkAppearance = 'overlay'; + $this->svgfiles[] = $this->assets . '/images/symbols/cart-overlay.svg'; + $this->addJsLib('thiriet', 'js/libs/fluidbook/cart/fluidbook.cart.thiriet.js'); + } + + public function writeCFOCCart() + { + + $this->lessVariables['import-cart-styles'] = 'cfoc'; + + $this->addJsLib('cfoc', 'js/libs/fluidbook/cart/fluidbook.cart.cfoc.js'); + + if (!empty($this->config->basketReferences) && is_string($this->config->basketReferences)) { + if (file_exists($this->config->basketReferences) || Url::isDistant($this->config->basketReferences)) { + $referencesFile = $this->config->basketReferences; + } else { + $referencesFile = $this->wdir . 'commerce/' . $this->config->basketReferences; + } + } + + $references = []; + + if (file_exists($referencesFile) || Url::isDistant($referencesFile)) { + $rows = ExcelToArray::excelToArrayFirstSheet($referencesFile); + + + // Expected headings are: EXCLU, LIGNE, EAN, REF, DESIGNATION, COULEUR, QTE MINI, PRIX TTC + $column_headings = array_shift($rows); // We assume the first row will be the headings, so we slice it off + $column_headings = array_map(function ($heading) { // Clean the headings a bit + return trim(strtoupper($heading)); + }, $column_headings); + + foreach ($rows as $row) { + + // First, trim values in case there are any stray spaces + $row = array_map('trim', $row); + + // Next, set the headings as keys to make it easier to refer to the row values by name + $row = array_combine($column_headings, $row); + + // For the 'EXCLU' field, this should be converted to a boolean + $row['EXCLU'] = ('exclu boutique' === $row['EXCLU']); + + // Make sure the PRIX TTC field doesn't have any stray commas or spaces in the numbers + // because this will cause unexpected problems for the calculations + $row['PRIX TTC'] = str_replace([',', ' '], '', $row['PRIX TTC']); + + // The EAN and REF are required, so if they don't exist, we can assume it's not a valid row + if (empty($row['EAN']) || empty($row['REF'])) { + continue; + } + + $references[$row['REF']][$row['EAN']] = $row; + } + + } + + $this->config->basketReferences = $references; + + // It's possible to use the cartExtraSettings field in the parameters to define publication specific settings, + // such as the subject line used in the e-mail that is sent from the cart validation + $extra = Link::parseExtras($this->fluidbookSettings->cartExtraSettings, true); + + $this->config->cartEmailSubject = $extra['email_subject'] ?? 'Récapitulatif de votre commande CFOC'; + } + + /** + * @throws \Exception + */ + public function writeBastideCart() + { + + $this->lessVariables['import-cart-styles'] = 'bastide'; + + $this->addJsLib('bastide', 'js/libs/fluidbook/cart/fluidbook.cart.bastide.js'); + + + if (!empty($this->config->basketReferences)) { + if (file_exists($this->config->basketReferences) || Url::isDistant($this->config->basketReferences)) { + $referencesFile = $this->config->basketReferences; + } else { + $referencesFile = $this->wdir . 'commerce/' . $this->config->basketReferences; + } + } + + $references = []; + + if (file_exists($referencesFile) || Url::isDistant($referencesFile)) { + $rows = ExcelToArray::excelToArrayFirstSheet($referencesFile); + + // Expected headings are: n° page, Chapitre, Article Code, Article, Conditionnement + $column_headings = array_shift($rows); // We assume the first row will be the headings, so we slice it off + $column_headings = array_map(function ($heading) { // Normalise the headings, removing extra spaces and line breaks + return trim(strtoupper(preg_replace('/\s+/', ' ', $heading))); + }, $column_headings); + + foreach ($rows as $row) { + + // First, trim values in case there are any stray spaces + $row = array_map('trim', $row); + + // Next, set the headings as keys to make it easier to refer to the row values by name + $row = array_combine($column_headings, $row); + + // The ARTICLE CODE is required, so if it doesn't exist, we can assume it's not a valid row + if (empty($row['ARTICLE CODE'])) { + continue; + } + + $references[$row['ARTICLE CODE']] = $row; + } + + } + + $this->config->basketReferences = $references; + + // Allow individual Fluidbooks to override the columns shown in the cart + $extra = Link::parseExtras($this->config->cartExtraSettings, true); + + if (!empty($extra['cart_columns'])) { + // In the "Paramètres panier" field (cartExtraSettings), the cart columns can be defined in this format: + // cart_columns=XLS COL NAME|Display name,XLS COL 2|Display name 2 + // This setting needs to be trimmed and converted into an associative array with column_name => display_name + // Split by commas, then by pipes | + $columns = array_map(function ($heading) { + return explode('|', $heading); + }, explode(',', $extra['cart_columns'])); + $processed_columns = []; + foreach ($columns as $column) { + $processed_columns[strtoupper(trim($column[0]))] = trim($column[1] ?? ''); + } + + // Ensure that special QUANTITY and DELETE columns are present (see getColumns() in fluidbook.cart.bastide.js) + $processed_columns['QUANTITY'] = $processed_columns['QUANTITY'] ?? 'Quantité'; + $processed_columns['DELETE'] = ''; + + $this->config->cartColumns = $processed_columns; + } + } + + public function writeCartConfig() + { + if ($this->fluidbookSettings->cartLinkAppearance == 'overlay') { + $this->svgfiles[] = $this->assets . '/images/symbols/cart-overlay.svg'; + } + + if ($this->config->basket) { + $this->addJsLib('cart', 'js/libs/fluidbook/fluidbook.cart.js'); + switch ($this->config->basketManager) { + case 'Thiriet': + $this->writeThirietCart(); + return; + case 'Flexipan': + $this->writeFlexipanCart(); + return; + case 'Puma': + $this->writePumaCart(); + return; + case 'MIF': + $this->writeMIFCart(); + return; + case 'GrandVision': + $this->writeGrandVisionCart(); + return; + case 'GrandPavois': + $this->writeGrandPavoisCart(); + return; + case 'JoueclubWishlist2021': + $this->writeJoueClub2021Cart(); + return; + case 'Remarkable': + $this->addJsLib('parsley', 'js/libs/parsley.min.js'); + $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); + $this->addJsLib('remarkable', 'js/libs/fluidbook/cart/fluidbook.cart.remarkable.js'); + break; + case 'Mopec': + $this->addJsLib('parsley', 'js/libs/parsley.min.js'); + $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); + $this->addJsLib('mopec', 'js/libs/fluidbook/cart/fluidbook.cart.mopec.js'); + break; + case 'CFOC': + $this->writeCFOCCart(); + break; + case 'Bastide': + $this->writeBastideCart(); + break; + default: + break; + } + } + if (!$this->config->product_zoom_references && $this->config->basketReferences && $this->config->basketManager == "ZoomProductLink") { + $this->config->product_zoom_references = $this->config->basketReferences; + $this->config->basketReferences = ''; + } + + if ($this->config->product_zoom_references) { + if (file_exists($this->config->product_zoom_references) || Url::isDistant($this->config->product_zoom_references)) { + $referencesFile = $this->config->product_zoom_references; + } else { + $referencesFile = $this->wdir . '/commerce/' . $this->config->product_zoom_references; + } + if (file_exists($referencesFile) || Url::isDistant($referencesFile)) { + $this->config->product_zoom_references = ExcelToArray::excelToArrayKeyValMulti($referencesFile, 'Excel2007', true); + } + } + + if ($this->config->basketReferences && is_string($this->config->basketReferences)) { + if (file_exists($this->config->basketReferences) || Url::isDistant($this->config->basketReferences)) { + $referencesFile = $this->config->basketReferences; + } else { + $referencesFile = $this->wdir . '/commerce/' . $this->config->basketReferences; + } + + if (file_exists($referencesFile) || Url::isDistant($referencesFile)) { + $ext = Files::getExtension($referencesFile); + if ($ext == 'xlsx') { + if ($this->config->basketManager == "ZoomProductLink") { + $function = 'excelToArrayKeyVal'; + } else { + $function = 'excelToArray'; + } + $this->config->basketReferences = ExcelToArray::$function($referencesFile); + if ($this->fluidbookSettings->customLinkClass == 'AtlanticDownloadLink') { + $this->config->basketReferences = self::atlanticReferences($this->config->basketReferences, 'local/', array($this, 'log'), array($this->vdir, "copy")); + } + } + $this->log("Done cart references"); + } + } + } + + public static function atlanticReferences($references, $dir, $log = null, $copy = 'copy') + { + foreach ($references as $i => $sheet) { + foreach ($sheet as $j => $line) { + foreach ($line as $k => $v) { + if (preg_match('|^http:\/\/atlantic-international-book-com\.com\/files\/(.*)$|', $v, $matches)) { + $local = $dir . '/' . $matches[1]; + $url = str_replace(' ', '%20', $v); + $cache = protected_path('fluidbookpublication/atlantic') . md5($url); + if (!file_exists($cache) || filemtime($url) > filemtime($cache)) { + copy($url, $cache); + $copylog = ' (copy) '; + } else { + $copylog = ' '; + } + call_user_func($copy, $cache, $dir . '/' . $matches[1]); + $references[$i][$j][$k] = 'local/' . $matches[1]; + if (null !== $log) { + call_user_func($log, 'Done' . $copylog . $matches[1]); + } + } + } + } + } + + return $references; + } + +} diff --git a/app/Fluidbook/Compiler.php b/app/Fluidbook/Compiler/Compiler.php similarity index 74% rename from app/Fluidbook/Compiler.php rename to app/Fluidbook/Compiler/Compiler.php index 5461ab701..b0af8244b 100644 --- a/app/Fluidbook/Compiler.php +++ b/app/Fluidbook/Compiler/Compiler.php @@ -1,17 +1,16 @@ config->seoArticles = $this->seoArticles; } - public function writeGrandVisionCart() - { - $this->lessVariables['import-cart-styles'] = 'grandvision'; - - $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); - $this->addJsLib('grandvision', 'js/libs/fluidbook/cart/fluidbook.cart.grandvision.js'); - $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js'); - $this->addJsLib('multiselect', 'js/libs/jquery/jquery.multi-select.js'); - $this->addJsLib('jqueryui', 'js/libs/jquery/jquery-ui.min.js'); - $this->addJsLib('exceljs', 'js/libs/exceljs.min.js'); - $this->svgfiles[] = $this->assets . '/images/symbols/grandvision.svg'; - - $cdir = $this->wdir . '/commerce/'; - $file = $cdir . $this->fluidbookSettings->basketReferences; - $refs = ExcelToArray::excelToArrayKeyVars($file, 'Excel2007', true); - $this->config->basketReferences = []; - foreach ($refs as $ean => $ref) { - $this->config->basketReferences[$ean] = $ref; - $this->config->basketReferences[$ean]['angle_url'] = base64_encode(file_get_contents($this->wdir . '/commerce/opt/' . $ean . '-angle.jpg')); - } - - $odir = $cdir . '/opt/'; - if (!file_exists($odir)) { - mkdir($odir, 0777, true); - } - - $it = Files::getDirectoryIterator($cdir); - $exts = ['png', 'jpg', 'tif', 'mp4']; - foreach ($it as $file) { - - /** @var $file SplFileInfo */ - if ($file->isDir()) { - continue; - } - $ext = $file->getExtension(); - if (!in_array($ext, $exts)) { - continue; - } - - $e = Text::multiExplode('_-.', mb_strtolower($file->getFilename())); - $ean = $this->findEAN($e); - if (!$ean) { - continue; - } - if (!isset($this->config->basketReferences[$ean])) { - continue; - } - $f = $file->getPathname(); - - if ($ext === 'mp4') { - $n = $ean . '-360.mp4'; - $this->config->basketReferences[$ean]['360'] = true; - $opt = $odir . '/' . $n; - if (!file_exists($opt) || !filesize($opt) || filemtime($opt) < filemtime($f)) { - // Optimize original video - `ffmpeg -i $f -filter:v scale=360:-2 -vcodec libx264 -an $opt`; - touch($opt, filemtime($f)); - } - } else { - if (in_array('front', $e)) { - $type = 'front'; - } else if (in_array('angle', $e)) { - $type = 'angle'; - } else { - continue; - } - - $n = $ean . '-' . $type . '.jpg'; - $this->config->basketReferences[$ean][$type] = true; - $opt = $odir . '/' . $n; - if (!file_exists($opt) || !filesize($opt) || filemtime($opt) < filemtime($f)) { - // Optimize original image - $convert = new Resizer(); - $convert->loadImage($f); - $convert->resize(1080, null, 'ratio', false, 'C', 'M', 'white'); - $convert->output('jpg', $opt, 75); - touch($opt, filemtime($f)); - } - } - $this->vdir->copy($opt, 'data/commerce/' . $n); - } - } - - public function findEAN($array) - { - foreach ($array as $item) { - if (strlen($item) === 13 && preg_match('/^\d{13}$/', $item)) { - return $item; - } - } - return false; - } - - public function writeFlexipanCart() - { - $this->lessVariables['import-cart-styles'] = 'flexipan'; - - $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); - $this->addJsLib('flexipan', 'js/libs/fluidbook/cart/fluidbook.cart.flexipan.js'); - $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js'); - - $cdir = $this->wdir . '/commerce/'; - - - $file = $cdir . $this->fluidbookSettings->basketReferences; - $this->config->basketReferences = ExcelToArray::excelToArrayKeyVars($file); - - $this->getLinksAndRulers($links, $rulers); - - foreach ($links as $link) { - if ($link['type'] == '12') { - - } - } - - $this->config->product_zoom_references = []; - foreach ($this->config->basketReferences as $ref => $data) { - $this->config->product_zoom_references[$ref] = [$ref]; - } - } - - public function getLinksAndRulers(&$links, &$rulers) - { - Links::getLinksAndRulers($this->book_id, $links, $rulers, 'latest', true); - } - - public function writeMIFCart() - { - $this->lessVariables['import-cart-styles'] = 'mif'; - - $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); - $this->addJsLib('mif', 'js/libs/fluidbook/cart/fluidbook.cart.mif.js'); - $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js'); - - $cdir = $this->wdir . '/commerce/'; - $odir = $cdir . '/opt/'; - if (!file_exists($odir)) { - mkdir($odir, 0777, true); - } - - $file = $cdir . $this->fluidbookSettings->basketReferences; - $this->config->basketReferences = ExcelToArray::excelToArrayKeyVars($file); - - $this->getLinksAndRulers($links, $rulers); - - foreach ($this->config->basketReferences as $ref => $data) { - $source = $cdir . '/' . $data['Image']; - if (!file_exists($source)) { - continue; - } - $d = Text::str2URL($ref) . '.jpg'; - $dest = $odir . '/' . $d; - if (!file_exists($dest) || !filesize($dest) || filemtime($dest) < filemtime($source)) { - $convert = new Resizer(); - $convert->loadImage($source); - $convert->resize(500, 500, 'ratio', false, 'C', 'M', 'ffffff'); - $convert->output('jpg', $dest, 80); - } - $vdest = 'data/commerce/opt/' . $d; - $this->vdir->copy($dest, $vdest); - $this->config->basketReferences[$ref]['Image'] = $vdest; - } - - foreach ($links as $link) { - if ($link['type'] == '12') { - - } - } - -// $this->config->product_zoom_references = []; -// foreach ($this->config->basketReferences as $ref => $data) { -// $r = [$data['Lien']]; -// $this->config->product_zoom_references[$ref] = $r; -// } - } - - public function writeJoueClub2021Cart() - { - $this->lessVariables['import-cart-styles'] = 'joueclub2021'; - $extra = Link::parseExtras($this->fluidbookSettings->cartExtraSettings, true); - - /** - * buttonColor=#d7b646 - * buttonTextColor=#ffffff - * headerBackgroundColor=#0e1a3c - * headerTextColor=#ffffff - */ - $this->lessVariables['cart-button-color'] = $extra['buttoncolor'] ?? '#e30613'; - $this->lessVariables['cart-button-text-color'] = $extra['buttontextcolor'] ?? '#ffffff'; - $this->lessVariables['cart-button-radius'] = $extra['buttonradius'] ?? '50%'; - $this->lessVariables['cart-header-background-color'] = $extra['headerbackgroundcolor'] ?? '#26348b'; - $this->lessVariables['cart-header-text-color'] = $extra['headertextcolor'] ?? '#ffffff'; - $this->lessVariables['cart-close-color'] = $extra['closecolor'] ?? '#ffffff'; - $this->lessVariables['cart-close-background-color'] = $extra['closebackgroundcolor'] ?? '#e30613'; - $this->lessVariables['cart-close-radius'] = $extra['closeradius'] ?? '50%'; - $this->lessVariables['cart-actions-radius'] = $extra['actionsradius'] ?? '8px'; - $this->lessVariables['cart-actions-background-color'] = $extra['actionsbackgroundcolor'] ?? '#26348b'; - $this->lessVariables['cart-actions-text-color'] = $extra['actionstextcolor'] ?? '#ffffff'; - $this->lessVariables['cart-scrollbar-color'] = $extra['scrollbarcolor'] ?? '#26348b'; - - $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); - $this->addJsLib('joueclub2021', 'js/libs/fluidbook/cart/fluidbook.cart.joueclub2021.js'); - $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js'); - - $cdir = $this->wdir . '/commerce/'; - - $file = $cdir . $this->fluidbookSettings->basketReferences; - $this->config->basketReferences = ExcelToArray::excelToArrayKeyVars($file); - - foreach ($this->config->basketReferences as $ref => $data) { - $dest = $cdir . $ref . '.jpg'; - if (!file_exists($dest)) { - copy($data['img'], $dest); - } - $this->vdir->copy($dest, 'data/commerce/' . $ref . '.jpg'); - } - $addFiles = [$this->config->cartHeaderImage, $this->config->cartHeaderMobileImage]; - foreach ($addFiles as $f) { - if (!$f) { - return; - } - - $this->vdir->copy($cdir . $f, 'data/commerce/' . $f); - } - - $this->getLinksAndRulers($links, $rulers); - } - - public function writeGrandPavoisCart() - { - $this->lessVariables['import-cart-styles'] = 'grandpavois'; - - $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); - $this->addJsLib('grandpavois', 'js/libs/fluidbook/cart/fluidbook.cart.grandpavois.js'); - $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js'); - - $cdir = $this->wdir . '/commerce/'; - $odir = $cdir . '/opt/'; - if (!file_exists($odir)) { - mkdir($odir, 0777, true); - } - - $file = $cdir . $this->fluidbookSettings->basketReferences; - $this->config->basketReferences = ExcelToArray::excelToArrayKeyVars($file); - - $this->getLinksAndRulers($links, $rulers); - } - - - public function writePumaCart() - { - $this->lessVariables['import-cart-styles'] = 'puma'; - - $this->addJsLib('parsley', 'js/libs/parsley.min.js'); - $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); - $this->addJsLib('puma', 'js/libs/fluidbook/cart/fluidbook.cart.puma.js'); - $this->addJsLib('html2pdf', 'js/libs/html2pdf/html2pdf.min.js'); - $this->addJsLib('exceljs', 'js/libs/exceljs.min.js'); - $this->addVideoJs(); - - $this->config->basketReferences = ExcelToArray::excelToArrayKeyVars($this->wdir . 'commerce/' . $this->fluidbookSettings->basketReferences); - $eanFile = $this->wdir . 'commerce/ean.xlsx'; - if (file_exists($eanFile)) { - $this->config->eanReferences = ExcelToArray::excelToArrayIndexKeyVars($eanFile); - } - - $this->getLinksAndRulers($links, $rulers); - foreach ($links as $link) { - if ($link['type'] == '12' && isset($this->config->basketReferences[$link['to']])) { - $this->config->basketReferences[$link['to']]['zoom_image'] = 'data/links/zoom_' . $link['uid'] . '.jpg'; - $this->config->basketReferences[$link['to']]['zoom_url'] = base64_encode(file_get_contents($this->dir . '/data/links/zoom_' . $link['uid'] . '.jpg')); - $this->config->basketReferences[$link['to']]['zoom_image_ratio'] = $link['width'] / $link['height']; - } - } - - $this->config->product_zoom_references = []; - $files = ['360°', 'Image supplémentaire', 'Fiche technique']; - foreach ($this->config->basketReferences as $ref => $data) { - $r = []; - foreach ($files as $file) { - if (!isset($data[$file])) { - $data[$file] = ''; - } - $fname = trim($data[$file]); - if ($fname !== '') { - $fname = str_replace(' ', '-', $fname); - $wfile = $this->wdir . 'commerce/' . $fname; - if (file_exists($wfile)) { - $fname = 'data/commerce/' . $fname; - $this->vdir->copy($wfile, $fname); - } else { - $fname = ''; - } - } - $r[] = $fname; - } - $this->config->product_zoom_references[$ref] = $r; - } - } - - - public function writeThirietCart() - { - $this->config->cartLinkAppearance = 'overlay'; - $this->svgfiles[] = $this->assets . '/images/symbols/cart-overlay.svg'; - $this->addJsLib('thiriet', 'js/libs/fluidbook/cart/fluidbook.cart.thiriet.js'); - } - - public function writeCFOCCart() - { - - $this->lessVariables['import-cart-styles'] = 'cfoc'; - - $this->addJsLib('cfoc', 'js/libs/fluidbook/cart/fluidbook.cart.cfoc.js'); - - if (!empty($this->config->basketReferences) && is_string($this->config->basketReferences)) { - if (file_exists($this->config->basketReferences) || Url::isDistant($this->config->basketReferences)) { - $referencesFile = $this->config->basketReferences; - } else { - $referencesFile = $this->wdir . 'commerce/' . $this->config->basketReferences; - } - } - - $references = []; - - if (file_exists($referencesFile) || Url::isDistant($referencesFile)) { - $rows = ExcelToArray::excelToArrayFirstSheet($referencesFile); - - - // Expected headings are: EXCLU, LIGNE, EAN, REF, DESIGNATION, COULEUR, QTE MINI, PRIX TTC - $column_headings = array_shift($rows); // We assume the first row will be the headings, so we slice it off - $column_headings = array_map(function ($heading) { // Clean the headings a bit - return trim(strtoupper($heading)); - }, $column_headings); - - foreach ($rows as $row) { - - // First, trim values in case there are any stray spaces - $row = array_map('trim', $row); - - // Next, set the headings as keys to make it easier to refer to the row values by name - $row = array_combine($column_headings, $row); - - // For the 'EXCLU' field, this should be converted to a boolean - $row['EXCLU'] = ('exclu boutique' === $row['EXCLU']); - - // Make sure the PRIX TTC field doesn't have any stray commas or spaces in the numbers - // because this will cause unexpected problems for the calculations - $row['PRIX TTC'] = str_replace([',', ' '], '', $row['PRIX TTC']); - - // The EAN and REF are required, so if they don't exist, we can assume it's not a valid row - if (empty($row['EAN']) || empty($row['REF'])) { - continue; - } - - $references[$row['REF']][$row['EAN']] = $row; - } - - } - - $this->config->basketReferences = $references; - - // It's possible to use the cartExtraSettings field in the parameters to define publication specific settings, - // such as the subject line used in the e-mail that is sent from the cart validation - $extra = Link::parseExtras($this->fluidbookSettings->cartExtraSettings, true); - - $this->config->cartEmailSubject = $extra['email_subject'] ?? 'Récapitulatif de votre commande CFOC'; - } - - /** - * @throws \Exception - */ - public function writeBastideCart() - { - - $this->lessVariables['import-cart-styles'] = 'bastide'; - - $this->addJsLib('bastide', 'js/libs/fluidbook/cart/fluidbook.cart.bastide.js'); - - - if (!empty($this->config->basketReferences)) { - if (file_exists($this->config->basketReferences) || Url::isDistant($this->config->basketReferences)) { - $referencesFile = $this->config->basketReferences; - } else { - $referencesFile = $this->wdir . 'commerce/' . $this->config->basketReferences; - } - } - - $references = []; - - if (file_exists($referencesFile) || Url::isDistant($referencesFile)) { - $rows = ExcelToArray::excelToArrayFirstSheet($referencesFile); - - // Expected headings are: n° page, Chapitre, Article Code, Article, Conditionnement - $column_headings = array_shift($rows); // We assume the first row will be the headings, so we slice it off - $column_headings = array_map(function ($heading) { // Normalise the headings, removing extra spaces and line breaks - return trim(strtoupper(preg_replace('/\s+/', ' ', $heading))); - }, $column_headings); - - foreach ($rows as $row) { - - // First, trim values in case there are any stray spaces - $row = array_map('trim', $row); - - // Next, set the headings as keys to make it easier to refer to the row values by name - $row = array_combine($column_headings, $row); - - // The ARTICLE CODE is required, so if it doesn't exist, we can assume it's not a valid row - if (empty($row['ARTICLE CODE'])) { - continue; - } - - $references[$row['ARTICLE CODE']] = $row; - } - - } - - $this->config->basketReferences = $references; - - // Allow individual Fluidbooks to override the columns shown in the cart - $extra = Link::parseExtras($this->config->cartExtraSettings, true); - - if (!empty($extra['cart_columns'])) { - // In the "Paramètres panier" field (cartExtraSettings), the cart columns can be defined in this format: - // cart_columns=XLS COL NAME|Display name,XLS COL 2|Display name 2 - // This setting needs to be trimmed and converted into an associative array with column_name => display_name - // Split by commas, then by pipes | - $columns = array_map(function ($heading) { - return explode('|', $heading); - }, explode(',', $extra['cart_columns'])); - $processed_columns = []; - foreach ($columns as $column) { - $processed_columns[strtoupper(trim($column[0]))] = trim($column[1] ?? ''); - } - - // Ensure that special QUANTITY and DELETE columns are present (see getColumns() in fluidbook.cart.bastide.js) - $processed_columns['QUANTITY'] = $processed_columns['QUANTITY'] ?? 'Quantité'; - $processed_columns['DELETE'] = ''; - - $this->config->cartColumns = $processed_columns; - } - } - - public function writeCartConfig() - { - if ($this->fluidbookSettings->cartLinkAppearance == 'overlay') { - $this->svgfiles[] = $this->assets . '/images/symbols/cart-overlay.svg'; - } - - if ($this->config->basket) { - $this->addJsLib('cart', 'js/libs/fluidbook/fluidbook.cart.js'); - switch ($this->config->basketManager) { - case 'Thiriet': - $this->writeThirietCart(); - return; - case 'Flexipan': - $this->writeFlexipanCart(); - return; - case 'Puma': - $this->writePumaCart(); - return; - case 'MIF': - $this->writeMIFCart(); - return; - case 'GrandVision': - $this->writeGrandVisionCart(); - return; - case 'GrandPavois': - $this->writeGrandPavoisCart(); - return; - case 'JoueclubWishlist2021': - $this->writeJoueClub2021Cart(); - return; - case 'Remarkable': - $this->addJsLib('parsley', 'js/libs/parsley.min.js'); - $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); - $this->addJsLib('remarkable', 'js/libs/fluidbook/cart/fluidbook.cart.remarkable.js'); - break; - case 'Mopec': - $this->addJsLib('parsley', 'js/libs/parsley.min.js'); - $this->addJsLib('cookie', 'js/libs/jquery/jquery.cookie.js'); - $this->addJsLib('mopec', 'js/libs/fluidbook/cart/fluidbook.cart.mopec.js'); - break; - case 'CFOC': - $this->writeCFOCCart(); - break; - case 'Bastide': - $this->writeBastideCart(); - break; - default: - break; - } - } - if (!$this->config->product_zoom_references && $this->config->basketReferences && $this->config->basketManager == "ZoomProductLink") { - $this->config->product_zoom_references = $this->config->basketReferences; - $this->config->basketReferences = ''; - } - - if ($this->config->product_zoom_references) { - if (file_exists($this->config->product_zoom_references) || Url::isDistant($this->config->product_zoom_references)) { - $referencesFile = $this->config->product_zoom_references; - } else { - $referencesFile = $this->wdir . '/commerce/' . $this->config->product_zoom_references; - } - if (file_exists($referencesFile) || Url::isDistant($referencesFile)) { - $this->config->product_zoom_references = ExcelToArray::excelToArrayKeyValMulti($referencesFile, 'Excel2007', true); - } - } - - if ($this->config->basketReferences && is_string($this->config->basketReferences)) { - if (file_exists($this->config->basketReferences) || Url::isDistant($this->config->basketReferences)) { - $referencesFile = $this->config->basketReferences; - } else { - $referencesFile = $this->wdir . '/commerce/' . $this->config->basketReferences; - } - - if (file_exists($referencesFile) || Url::isDistant($referencesFile)) { - $ext = Files::getExtension($referencesFile); - if ($ext == 'xlsx') { - if ($this->config->basketManager == "ZoomProductLink") { - $function = 'excelToArrayKeyVal'; - } else { - $function = 'excelToArray'; - } - $this->config->basketReferences = ExcelToArray::$function($referencesFile); - if ($this->fluidbookSettings->customLinkClass == 'AtlanticDownloadLink') { - $this->config->basketReferences = self::atlanticReferences($this->config->basketReferences, 'local/', array($this, 'log'), array($this->vdir, "copy")); - } - } - $this->log("Done cart references"); - } - } - } - - public static function atlanticReferences($references, $dir, $log = null, $copy = 'copy') - { - foreach ($references as $i => $sheet) { - foreach ($sheet as $j => $line) { - foreach ($line as $k => $v) { - if (preg_match('|^http:\/\/atlantic-international-book-com\.com\/files\/(.*)$|', $v, $matches)) { - $local = $dir . '/' . $matches[1]; - $url = str_replace(' ', '%20', $v); - $cache = protected_path('fluidbookpublication/atlantic') . md5($url); - if (!file_exists($cache) || filemtime($url) > filemtime($cache)) { - copy($url, $cache); - $copylog = ' (copy) '; - } else { - $copylog = ' '; - } - call_user_func($copy, $cache, $dir . '/' . $matches[1]); - $references[$i][$j][$k] = 'local/' . $matches[1]; - if (null !== $log) { - call_user_func($log, 'Done' . $copylog . $matches[1]); - } - } - } - } - } - - return $references; - } public function log($step) { @@ -2129,381 +1567,7 @@ height="0" width="0" style="display:none;visibility:hidden"> $this->_svgSymbols[$symbolName] = '' . $this->SimpleXMLElement_innerXML($xml) . ''; } - protected function writeLinks() - { - - switch ($this->fluidbookSettings->customLinkClass) { - case 'WescoSalesLink': - $this->specialJsFiles[] = 'js/libs/interact.min.js'; - $this->specialJsFiles[] = 'js/libs/fluidbook/special/wescosales.js'; - $this->specialCSS[] = 'wescosales'; - break; - case 'AtlanticDownloadLink': - $this->specialJsFiles[] = 'js/libs/fluidbook/special/atlanticdownload.js'; - $this->specialCSS[] = 'atlanticdownload'; - break; - case 'MiraklEaster2021': - $this->specialJsFiles[] = 'js/libs/fluidbook/special/mirakleaster2021.js'; - $this->specialCSS[] = 'mirakleaster2021'; - break; - } - - $this->config->links = array(); - $this->config->clinks = array(); - $this->config->bookmarkGroups = array(); - - $ignore = $this->fluidbookSettings->ignoreLinksTypes; - if (!$ignore) { - $ignore = array(); - } else { - $ignore = explode(',', $ignore); - } - - if ($this->fluidbookSettings->externalChaptersHTML != '') { - $d = $this->unzipFile($this->fluidbookSettings->externalChaptersHTML, false, 'data/chapters/'); - $meta = $this->getConfigZIP($d['dir']); - $this->config->externalChaptersSize = new \stdClass(); - $this->config->externalChaptersSize->width = $meta['width']; - $this->config->externalChaptersSize->height = $meta['height']; - $this->vdir->copyDirectory($d['dir'], $d['fdir']); - } - - $this->getLinksAndRulers($links, $rulers); - $this->_fluidbook->normalizeLinks($links); - - if ($this->fluidbookSettings->basketManager === 'Puma') { - foreach ($links as $k => $init) { - if ($init['type'] == 12 && isset($this->config->product_zoom_references[$init['to']]) && count($this->config->product_zoom_references[$init['to']]) > 0 && implode('', $this->config->product_zoom_references[$init['to']]) != '') { - $init['infobulle'] = 'Digital information'; - $init['animation'] = 'reflet-anim.html'; - $links[$k] = $init; - } - if ($init['type'] == 7) { - $init['image'] = ''; - $init['display_area'] = false; - $links[$k] = $init; - } - } - - } - // Custom landing page content - if ($this->fluidbookSettings->landingPage != '') { - $d = $this->unzipFile($this->fluidbookSettings->landingPage, false, 'data/landing-page/'); - $this->vdir->copyDirectory($d['dir'], $d['fdir']); - } - - if ($this->fluidbookSettings->tabsHTML5 != '' && file_exists($this->wdir . '/' . $this->fluidbookSettings->tabsHTML5)) { - $ext = Files::getExtension($this->fluidbookSettings->tabsHTML5); - if ($ext === 'zip') { - $links['tabs'] = [ - 'page' => 'background', - 'top' => 0, - 'left' => 0, - 'width' => 100, - 'height' => 100, - 'type' => 6, - 'to' => $this->fluidbookSettings->tabsHTML5, - 'image' => '', - 'inline' => 1, - 'interactive' => 1, - 'class' => 'tabslink', - 'uid' => 'tabs', - ]; - } else if ($ext === 'svg') { - $this->vdir->copy($this->wdir . '/' . $this->fluidbookSettings->tabsHTML5, 'data/tabs.svg'); - $this->config->svgTabs = true; - $pagesLists = ['tabsPages', 'tabsSections']; - - foreach ($pagesLists as $pagesList) { - $e = explode(',', $this->fluidbookSettings->$pagesList); - $list = []; - foreach ($e as $k => $v) { - $v = trim($v); - if ($v === '') { - continue; - } - if ($v !== '-') { - if ($this->fluidbookSettings->tabsPagesNumbers === 'virtual') { - $v = $this->virtualToPhysical($v); - } - } - $list[] = $v; - } - $this->config->$pagesList = $list; - } - } - } - - $pagesOfCustomLinks = []; - $hiddenLinks = []; - $anchorExists = []; - $closedLinks = []; - - $linksCopy = $links; - - - foreach ($linksCopy as $k => $linkData) { - if ($this->fluidbookSettings->PDFRendererIframe === 'svg' && (($linkData['type'] == 31 && stristr($linkData['to'], '.pdf')) || ($linkData['type'] == 6 && stristr($linkData['alternative'], '.pdf')))) { - $ofile = $this->wdir . '/' . $linkData['to']; - $dfile = $this->wdir . '/' . $linkData['to'] . '.svg'; - if (!file_exists($dfile) || filemtime($dfile) < filemtime($ofile)) { - $cmd = "pdftocairo -svg -f 1 -l 1 $ofile $dfile"; - `$cmd`; - } - $linkData['type'] = 6; - $linkData['to'] = $linkData['to'] . '.svg'; - $linkData['backgroundColor'] = '#fff'; - $links[$k] = $linkData; - } - if ($linkData['type'] == 26 || $linkData == 40) { - $linkData['to'] = AnchorLink::normalizeAnchor($linkData['to']); - $anchorExists[$linkData['to']] = $linkData; - } - if ($linkData['type'] == 35 || $linkData['type'] == 15 || $linkData['type'] == 39) { - $linkData = Link::decryptLink($linkData); - $animations = ContentLink::parseAnimations($linkData['image_rollover']); - foreach ($animations as $animation) { - if (isset($animation['backgroundcolor']) && $animation['backgroundcolor'] !== 'transparent') { - $dupData = $linkData; - $dupData['type'] = 14; - $dupData['to'] = $animation['backgroundcolor']; - - $dupData['uid'] = 'b_' . $linkData['uid']; - $dupData['addzindex'] = -1; - $dupData['image_rollover'] = ''; - array_push($links, $dupData); - array_push($links, $linkData); - unset($links[$k]); - } - } - } - if (isset($linkData['image']) && $linkData['image'] && $linkData['type'] != 28 && $linkData['type'] != 35) { - $dupData = $linkData; - $dupData['image'] = ''; - $dupData['animation'] = ''; - $dupData['to'] = self::_SVGCleanAsset($linkData['image']); - if ($dupData['image_rollover'] != 'none' && !stristr($dupData['image_rollover'], '=')) { - $dupData['rollover'] = $dupData['image_rollover']; - } - $dupData['image_rollover'] = ''; - $dupData['type'] = 15; - $dupData['uid'] = 'i_' . $linkData['uid']; - if (Link::isScorm($linkData)) { - $dupData['scorm'] = true; - } - array_push($links, $dupData); - } - if (isset($linkData['animation']) && $linkData['animation']) { - $dupData = $linkData; - $dupData['image'] = ''; - $dupData['animation'] = ''; - $dupData['inline'] = true; - $dupData['interactive'] = false; - $dupData['to'] = $linkData['animation']; - $dupData['type'] = 6; - $linkData['relatedAnimation'] = $dupData['uid'] = 'a_' . $linkData['uid']; - $dupData['video_width'] = $dupData['video_height'] = 0; - if (Link::isScorm($linkData)) { - $dupData['scorm'] = true; - } - $links[$k] = $linkData; - array_push($links, $dupData); - } - if ($linkData['type'] == 7) { - $k = $linkData['to']; - $e = explode(':', $k); - if (count($e) > 1) { - $k = $e[1]; - } - if (!isset($pagesOfCustomLinks[$k])) { - $pagesOfCustomLinks[$k] = []; - } - if (!in_array($linkData['page'], $pagesOfCustomLinks[$k])) { - $pagesOfCustomLinks[$k][] = $linkData['page']; - } - } - - if ($linkData['type'] == 32 && $linkData['target'] !== 'hide') { - $ids = explode(',', $linkData['to']); - $close = ($linkData['video_service'] && $linkData['video_service'] !== 'none'); - foreach ($ids as $id) { - $id = trim($id); - if ($id === 'tabs') { - $this->config->tabsHiddenAtStartup = true; - } else { - if ($close) { - $closedLinks[] = $id; - $closedLinks[] = 'i_' . $id; - } - $hiddenLinks[] = $id; - $hiddenLinks[] = 'i_' . $id; - } - } - } - } - - if ($this->fluidbookSettings->anchorsAliases && file_exists($this->fluidbookSettings->anchorsAliases)) { - $aliases = []; - $anchors = []; - for ($i = 0; $i <= 2; $i++) { - $lines = Text::explodeNewLines(file_get_contents($this->fluidbookSettings->anchorsAliases)); - foreach ($lines as $line) { - $e = explode("\t", $line); - $from = AnchorLink::normalizeAnchor($e[0]); - $to = AnchorLink::normalizeAnchor($e[1]); - $aliases[$from] = $to; - if (is_numeric($to) && !isset($anchorExists[$from])) { - $anchor = [ - 'page' => $to, - 'top' => 0, - 'left' => 0, - 'width' => 100, - 'height' => 100, - 'type' => 26, - 'to' => $from, - 'uid' => Links::generateUID() - ]; - $anchorExists[$from] = $anchor; - $links[] = $anchor; - } else { - if (!isset($anchorExists[$from]) && isset($anchorExists[$to])) { - $anchor = $anchorExists[$to]; - $anchor['to'] = $from; - $anchor['uid'] = Links::generateUID(); - $anchorExists[$from] = $anchor; - $links[] = $anchor; - } - } - } - } - } - - - $this->config->pagesOfCustomLinks = $pagesOfCustomLinks; - - $i = 1; - $pages = array(); - $cpages = array(); - $ctpages = array(); - $css = array(); - $linkPages = []; - $allLinksData = []; - $gamifyCoins = []; - - usort($links, array($this, '_sortLinks')); - - foreach ($links as $linkData) { - if (in_array($linkData['type'], $ignore)) { - continue; - } - if ($linkData['uid'] === 'slider') { - $linkData['page'] = 'background'; - } - - $linkData['hidden'] = in_array($linkData['uid'], $hiddenLinks); - if (isset($linkData['zindex']) && $linkData['zindex'] < 50 && in_array($linkData['uid'], $closedLinks)) { - $linkData['zindex'] = 50; - } - if ($linkData['type'] == 28) { - $this->addSEOArticle('#/page/' . $linkData['page'], $linkData['to'], $linkData['extra'], $linkData['image']); - continue; - } - - $link = Link::getInstance($this->base62($i), $linkData, $this); - if (is_null($link) || $link->ignore()) { - continue; - } - - - $linksToAdd = [$link]; - if ($link->overlapDoublePage() && !$this->isOnePage()) { - $linksToAdd[] = $link->getRightClone(); - } - - - foreach ($linksToAdd as $lta) { - try { - /** @var $lta Link */ - // Keep this line because some properties of the link (like blend mode) are parsed with this function - $c = $lta->getHTMLContainer(); - - - $css[] = $lta->getCSSContainer(); - if (!isset($pages[$lta->page])) { - $pages[$lta->page] = ['normal' => []]; - $cpages[$lta->page] = ['normal' => []]; - $ctpages[$lta->page] = ['normal' => []]; - } - - - $d = $lta->getDepth(); - if ($d < 30) { - $v = 'ctpages'; - } else if ($d < 50) { - $v = 'cpages'; - } else { - $v = 'pages'; - } - - $lta->setInitialOrder($i); - if (!isset($$v[$lta->page][$lta->blendmode])) { - $$v[$lta->page][$lta->blendmode] = []; - } - - array_push($$v[$lta->page][$lta->blendmode], $lta); - $i++; - } catch (\Exception $e) { - $this->triggerLinkError($e, $lta); - } - } - - - // Make old "aftersearch" link compatible with new "extra" menu option by extracting link URL - if ($link->page == 'aftersearch') { - $this->config->afterSearchLink = $link->to; - $this->config->afterSearchTooltip = $link->infobulle; - } - - if (strpos($link->page, 'link_') === 0) { - $linkPages[$link->page] = true; - } - - if ($link->gamifyCoins) { - $gamifyCoins[$linkData['uid']] = $link->gamifyCoins; - } - - $allLinksData[$linkData['uid']] = $linkData; - - if ($link->keep()) { - $this->hiddenContents[] = $link->getHTMLContainer(); - } - } - - $allpages = range(0, $this->getFluidbook()->getPagesNumber() + 1); - if ($this->fluidbookSettings->themeEnableAfterSearch) { - $allpages[] = 'aftersearch'; - } - $allpages[] = 'background'; - $allpages[] = 'archives'; - $allpages[] = 'slider'; - foreach ($linkPages as $linkPage => $true) { - $allpages[] = $linkPage; - } - - foreach ($allpages as $i) { - $this->config->set('links.' . $i, $this->_htmlLinkList($pages[$i] ?? [])); - $this->config->set('clinks.' . $i, $this->_htmlLinkList($cpages[$i] ?? [])); - $this->config->set('ctlinks.' . $i, $this->_htmlLinkList($ctpages[$i] ?? [])); - } - - if ($this->writeLinksData) { - $this->config->linksData = $allLinksData; - } - $this->config->gamifyCoins = $gamifyCoins; - - return $css; - } /** * @return bool diff --git a/app/Fluidbook/Compiler/Links.php b/app/Fluidbook/Compiler/Links.php new file mode 100644 index 000000000..bca5aeb99 --- /dev/null +++ b/app/Fluidbook/Compiler/Links.php @@ -0,0 +1,394 @@ +book_id, $links, $rulers, 'latest', true); + } + + /** + * @throws \SodiumException + */ + protected function writeLinks() + { + + switch ($this->fluidbookSettings->customLinkClass) { + case 'WescoSalesLink': + $this->specialJsFiles[] = 'js/libs/interact.min.js'; + $this->specialJsFiles[] = 'js/libs/fluidbook/special/wescosales.js'; + $this->specialCSS[] = 'wescosales'; + break; + case 'AtlanticDownloadLink': + $this->specialJsFiles[] = 'js/libs/fluidbook/special/atlanticdownload.js'; + $this->specialCSS[] = 'atlanticdownload'; + break; + case 'MiraklEaster2021': + $this->specialJsFiles[] = 'js/libs/fluidbook/special/mirakleaster2021.js'; + $this->specialCSS[] = 'mirakleaster2021'; + break; + } + + $this->config->links = array(); + $this->config->clinks = array(); + $this->config->bookmarkGroups = array(); + + $ignore = $this->fluidbookSettings->ignoreLinksTypes; + if (!$ignore) { + $ignore = array(); + } else { + $ignore = explode(',', $ignore); + } + + if ($this->fluidbookSettings->externalChaptersHTML != '') { + $d = $this->unzipFile($this->fluidbookSettings->externalChaptersHTML, false, 'data/chapters/'); + $meta = $this->getConfigZIP($d['dir']); + $this->config->externalChaptersSize = new \stdClass(); + $this->config->externalChaptersSize->width = $meta['width']; + $this->config->externalChaptersSize->height = $meta['height']; + $this->vdir->copyDirectory($d['dir'], $d['fdir']); + } + + $this->getLinksAndRulers($links, $rulers); + $this->_fluidbook->normalizeLinks($links); + + if ($this->fluidbookSettings->basketManager === 'Puma') { + foreach ($links as $k => $init) { + if ($init['type'] == Link::CART && isset($this->config->product_zoom_references[$init['to']]) && count($this->config->product_zoom_references[$init['to']]) > 0 && implode('', $this->config->product_zoom_references[$init['to']]) != '') { + $init['infobulle'] = 'Digital information'; + $init['animation'] = 'reflet-anim.html'; + $links[$k] = $init; + } + if ($init['type'] == Link::CUSTOM) { + $init['image'] = ''; + $init['display_area'] = false; + $links[$k] = $init; + } + } + + } + + // Custom landing page content + if ($this->fluidbookSettings->landingPage != '') { + $d = $this->unzipFile($this->fluidbookSettings->landingPage, false, 'data/landing-page/'); + $this->vdir->copyDirectory($d['dir'], $d['fdir']); + } + + if ($this->fluidbookSettings->tabsHTML5 != '' && file_exists($this->wdir . '/' . $this->fluidbookSettings->tabsHTML5)) { + $ext = Files::getExtension($this->fluidbookSettings->tabsHTML5); + if ($ext === 'zip') { + $links['tabs'] = [ + 'page' => 'background', + 'top' => 0, + 'left' => 0, + 'width' => 100, + 'height' => 100, + 'type' => Link::MULTIMEDIA, + 'to' => $this->fluidbookSettings->tabsHTML5, + 'image' => '', + 'inline' => 1, + 'interactive' => 1, + 'class' => 'tabslink', + 'uid' => 'tabs', + ]; + } else if ($ext === 'svg') { + $this->vdir->copy($this->wdir . '/' . $this->fluidbookSettings->tabsHTML5, 'data/tabs.svg'); + $this->config->svgTabs = true; + $pagesLists = ['tabsPages', 'tabsSections']; + + foreach ($pagesLists as $pagesList) { + $e = explode(',', $this->fluidbookSettings->$pagesList); + $list = []; + foreach ($e as $k => $v) { + $v = trim($v); + if ($v === '') { + continue; + } + if ($v !== '-') { + if ($this->fluidbookSettings->tabsPagesNumbers === 'virtual') { + $v = $this->virtualToPhysical($v); + } + } + $list[] = $v; + } + $this->config->$pagesList = $list; + } + } + } + + $pagesOfCustomLinks = []; + $hiddenLinks = []; + $anchorExists = []; + $closedLinks = []; + + $linksCopy = $links; + + + foreach ($linksCopy as $k => $linkData) { + if ($this->fluidbookSettings->PDFRendererIframe === 'svg' && (($linkData['type'] == Link::IFRAME && stristr($linkData['to'], '.pdf')) || ($linkData['type'] == Link::MULTIMEDIA && stristr($linkData['alternative'], '.pdf')))) { + $ofile = $this->wdir . '/' . $linkData['to']; + $dfile = $this->wdir . '/' . $linkData['to'] . '.svg'; + if (!file_exists($dfile) || filemtime($dfile) < filemtime($ofile)) { + $cmd = "pdftocairo -svg -f 1 -l 1 $ofile $dfile"; + `$cmd`; + } + $linkData['type'] = Link::MULTIMEDIA; + $linkData['to'] = $linkData['to'] . '.svg'; + $linkData['backgroundColor'] = '#fff'; + $links[$k] = $linkData; + } + if ($linkData['type'] == Link::PAGE_LABEL || $linkData == Link::ANCHOR) { + $linkData['to'] = AnchorLink::normalizeAnchor($linkData['to']); + $anchorExists[$linkData['to']] = $linkData; + } + if ($linkData['type'] == Link::TEXT || $linkData['type'] == Link::IMAGE || $linkData['type'] == Link::LAYER) { + $linkData = Link::decryptLink($linkData); + $animations = ContentLink::parseAnimations($linkData['image_rollover']); + foreach ($animations as $animation) { + if (isset($animation['backgroundcolor']) && $animation['backgroundcolor'] !== 'transparent') { + $dupData = $linkData; + $dupData['type'] = Link::COLOR; + $dupData['to'] = $animation['backgroundcolor']; + + $dupData['uid'] = 'b_' . $linkData['uid']; + $dupData['addzindex'] = -1; + $dupData['image_rollover'] = ''; + array_push($links, $dupData); + array_push($links, $linkData); + unset($links[$k]); + } + } + } + if (isset($linkData['image']) && $linkData['image'] && $linkData['type'] != Link::ARTICLE && $linkData['type'] != Link::TEXT && $linkData['type'] != Link::COLOR) { + $dupData = $linkData; + $dupData['image'] = ''; + $dupData['animation'] = ''; + $dupData['to'] = self::_SVGCleanAsset($linkData['image']); + if ($dupData['image_rollover'] != 'none' && !stristr($dupData['image_rollover'], '=')) { + $dupData['rollover'] = $dupData['image_rollover']; + } + $dupData['image_rollover'] = ''; + $dupData['type'] = Link::IMAGE; + $dupData['uid'] = 'i_' . $linkData['uid']; + if (Link::isScorm($linkData)) { + $dupData['scorm'] = true; + } + array_push($links, $dupData); + } + if (isset($linkData['animation']) && $linkData['animation']) { + $dupData = $linkData; + $dupData['image'] = ''; + $dupData['animation'] = ''; + $dupData['inline'] = true; + $dupData['interactive'] = false; + $dupData['to'] = $linkData['animation']; + $dupData['type'] = Link::MULTIMEDIA; + $linkData['relatedAnimation'] = $dupData['uid'] = 'a_' . $linkData['uid']; + $dupData['video_width'] = $dupData['video_height'] = 0; + if (Link::isScorm($linkData)) { + $dupData['scorm'] = true; + } + $links[$k] = $linkData; + array_push($links, $dupData); + } + if ($linkData['type'] == Link::CUSTOM) { + $k = $linkData['to']; + $e = explode(':', $k); + if (count($e) > 1) { + $k = $e[1]; + } + if (!isset($pagesOfCustomLinks[$k])) { + $pagesOfCustomLinks[$k] = []; + } + if (!in_array($linkData['page'], $pagesOfCustomLinks[$k])) { + $pagesOfCustomLinks[$k][] = $linkData['page']; + } + } + + if ($linkData['type'] == Link::SHOWLINK && $linkData['target'] !== 'hide') { + $ids = explode(',', $linkData['to']); + $close = ($linkData['video_service'] && $linkData['video_service'] !== 'none'); + foreach ($ids as $id) { + $id = trim($id); + if ($id === 'tabs') { + $this->config->tabsHiddenAtStartup = true; + } else { + if ($close) { + $closedLinks[] = $id; + $closedLinks[] = 'i_' . $id; + } + $hiddenLinks[] = $id; + $hiddenLinks[] = 'i_' . $id; + } + } + } + } + + if ($this->fluidbookSettings->anchorsAliases && file_exists($this->fluidbookSettings->anchorsAliases)) { + $aliases = []; + for ($i = 0; $i <= 2; $i++) { + $lines = Text::explodeNewLines(file_get_contents($this->fluidbookSettings->anchorsAliases)); + foreach ($lines as $line) { + $e = explode("\t", $line); + $from = AnchorLink::normalizeAnchor($e[0]); + $to = AnchorLink::normalizeAnchor($e[1]); + $aliases[$from] = $to; + if (is_numeric($to) && !isset($anchorExists[$from])) { + $anchor = [ + 'page' => $to, + 'top' => 0, + 'left' => 0, + 'width' => 100, + 'height' => 100, + 'type' => 26, + 'to' => $from, + 'uid' => LinksData::generateUID() + ]; + $anchorExists[$from] = $anchor; + $links[] = $anchor; + } else { + if (!isset($anchorExists[$from]) && isset($anchorExists[$to])) { + $anchor = $anchorExists[$to]; + $anchor['to'] = $from; + $anchor['uid'] = LinksData::generateUID(); + $anchorExists[$from] = $anchor; + $links[] = $anchor; + } + } + } + } + } + + + $this->config->pagesOfCustomLinks = $pagesOfCustomLinks; + + $i = 1; + $pages = array(); + $cpages = array(); + $ctpages = array(); + $css = array(); + $linkPages = []; + $allLinksData = []; + $gamifyCoins = []; + + usort($links, array($this, '_sortLinks')); + + foreach ($links as $linkData) { + if (in_array($linkData['type'], $ignore)) { + continue; + } + if ($linkData['uid'] === 'slider') { + $linkData['page'] = 'background'; + } + + $linkData['hidden'] = in_array($linkData['uid'], $hiddenLinks); + if (isset($linkData['zindex']) && $linkData['zindex'] < 50 && in_array($linkData['uid'], $closedLinks)) { + $linkData['zindex'] = 50; + } + if ($linkData['type'] == Link::ARTICLE) { + $this->addSEOArticle('#/page/' . $linkData['page'], $linkData['to'], $linkData['extra'], $linkData['image']); + continue; + } + + $link = Link::getInstance($this->base62($i), $linkData, $this); + if (is_null($link) || $link->ignore()) { + continue; + } + + $linksToAdd = [$link]; + if ($link->overlapDoublePage() && !$this->isOnePage()) { + $linksToAdd[] = $link->getRightClone(); + } + + foreach ($linksToAdd as $lta) { + try { + /** @var $lta Link */ + // Keep this line because some properties of the link (like blend mode) are parsed with this function + $c = $lta->getHTMLContainer(); + + + $css[] = $lta->getCSSContainer(); + if (!isset($pages[$lta->page])) { + $pages[$lta->page] = ['normal' => []]; + $cpages[$lta->page] = ['normal' => []]; + $ctpages[$lta->page] = ['normal' => []]; + } + + + $d = $lta->getDepth(); + if ($d < 30) { + $v = 'ctpages'; + } else if ($d < 50) { + $v = 'cpages'; + } else { + $v = 'pages'; + } + + $lta->setInitialOrder($i); + if (!isset($$v[$lta->page][$lta->blendmode])) { + $$v[$lta->page][$lta->blendmode] = []; + } + + array_push($$v[$lta->page][$lta->blendmode], $lta); + $i++; + } catch (\Exception $e) { + $this->triggerLinkError($e, $lta); + } + } + + + // Make old "aftersearch" link compatible with new "extra" menu option by extracting link URL + if ($link->page == 'aftersearch') { + $this->config->afterSearchLink = $link->to; + $this->config->afterSearchTooltip = $link->infobulle; + } + + if (strpos($link->page, 'link_') === 0) { + $linkPages[$link->page] = true; + } + + if ($link->gamifyCoins) { + $gamifyCoins[$linkData['uid']] = $link->gamifyCoins; + } + + $allLinksData[$linkData['uid']] = $linkData; + + if ($link->keep()) { + $this->hiddenContents[] = $link->getHTMLContainer(); + } + } + + $allpages = range(0, $this->getFluidbook()->getPagesNumber() + 1); + if ($this->fluidbookSettings->themeEnableAfterSearch) { + $allpages[] = 'aftersearch'; + } + $allpages[] = 'background'; + $allpages[] = 'archives'; + $allpages[] = 'slider'; + foreach ($linkPages as $linkPage => $true) { + $allpages[] = $linkPage; + } + + foreach ($allpages as $i) { + $this->config->set('links.' . $i, $this->_htmlLinkList($pages[$i] ?? [])); + $this->config->set('clinks.' . $i, $this->_htmlLinkList($cpages[$i] ?? [])); + $this->config->set('ctlinks.' . $i, $this->_htmlLinkList($ctpages[$i] ?? [])); + } + + if ($this->writeLinksData) { + $this->config->linksData = $allLinksData; + } + $this->config->gamifyCoins = $gamifyCoins; + + return $css; + } +} diff --git a/app/Fluidbook/Link/Custom/InpesPopinLink.php b/app/Fluidbook/Link/Custom/InpesPopinLink.php index 2f2a6806d..b7077f70a 100644 --- a/app/Fluidbook/Link/Custom/InpesPopinLink.php +++ b/app/Fluidbook/Link/Custom/InpesPopinLink.php @@ -2,7 +2,7 @@ namespace App\Fluidbook\Link\Custom; -use App\Fluidbook\Compiler; +use App\Fluidbook\Compiler\Compiler; use Fluidbook\Tools\Links\HTMLMultimediaLink; class InpesPopinLink extends HTMLMultimediaLink diff --git a/app/Fluidbook/Links.php b/app/Fluidbook/Link/LinksData.php similarity index 99% rename from app/Fluidbook/Links.php rename to app/Fluidbook/Link/LinksData.php index 7491afea1..515848847 100644 --- a/app/Fluidbook/Links.php +++ b/app/Fluidbook/Link/LinksData.php @@ -1,6 +1,6 @@ load($path); - Links::getLinksFromExcel($xls, $links, $rulers); + LinksData::getLinksFromExcel($xls, $links, $rulers); } public static function generateUID() diff --git a/app/Fluidbook/Packager/Packager.php b/app/Fluidbook/Packager/Packager.php index e095c533b..7047dc6b7 100644 --- a/app/Fluidbook/Packager/Packager.php +++ b/app/Fluidbook/Packager/Packager.php @@ -2,7 +2,7 @@ namespace App\Fluidbook\Packager; -use App\Fluidbook\Compiler; +use App\Fluidbook\Compiler\Compiler; use App\Models\FluidbookPublication; use App\Models\FluidbookTheme; use Cubist\Util\CommandLine; diff --git a/app/Fluidbook/SEO/Document.php b/app/Fluidbook/SEO/Document.php index 73e7da2e8..112d128fe 100644 --- a/app/Fluidbook/SEO/Document.php +++ b/app/Fluidbook/SEO/Document.php @@ -2,7 +2,7 @@ namespace App\Fluidbook\SEO; -use App\Fluidbook\Compiler; +use App\Fluidbook\Compiler\Compiler; use App\Models\FluidbookDocument; use Cubist\Excel\ExcelToArray; use Cubist\Util\Text; diff --git a/app/Fluidbook/SearchIndex.php b/app/Fluidbook/SearchIndex.php index d82296f55..ab3636764 100644 --- a/app/Fluidbook/SearchIndex.php +++ b/app/Fluidbook/SearchIndex.php @@ -2,6 +2,7 @@ namespace App\Fluidbook; +use App\Fluidbook\Compiler\Compiler; use App\Models\FluidbookDocument; use Cubist\Util\Gzip; diff --git a/app/Http/Controllers/Admin/Operations/FluidbookPublication/LinksOperation.php b/app/Http/Controllers/Admin/Operations/FluidbookPublication/LinksOperation.php index 6434090b2..5007fb2b0 100644 --- a/app/Http/Controllers/Admin/Operations/FluidbookPublication/LinksOperation.php +++ b/app/Http/Controllers/Admin/Operations/FluidbookPublication/LinksOperation.php @@ -4,8 +4,7 @@ namespace App\Http\Controllers\Admin\Operations\FluidbookPublication; // __('!!Paramètres des fluidbooks') -use App\Fluidbook\Farm; -use App\Fluidbook\Links; +use App\Fluidbook\Link\LinksData; use App\Models\FluidbookPublication; use Cubist\Backpack\Http\Controllers\Base\XSendFileController; use Cubist\Util\Files\Files; @@ -51,7 +50,7 @@ trait LinksOperation abort(401); } - Links::saveLinksInFile($fluidbook_id, + LinksData::saveLinksInFile($fluidbook_id, backpack_user()->id, request('message'), json_decode(request('links', '[]'), true), @@ -59,7 +58,7 @@ trait LinksOperation ); $fb = FluidbookPublication::find($fluidbook_id); - return response()->json(['assets' => $fb->getLinksAssetsDimensions(), 'versions' => Links::getLinksVersions($fluidbook_id)]); + return response()->json(['assets' => $fb->getLinksAssetsDimensions(), 'versions' => LinksData::getLinksVersions($fluidbook_id)]); } protected function moveLinks($fluidbook_id) @@ -80,7 +79,7 @@ trait LinksOperation $width = $fb->getPageWidth(); $isOnePage = $fb->isOnePage(); - Links::getLinksAndRulers($fluidbook_id, $links, $rulers); + LinksData::getLinksAndRulers($fluidbook_id, $links, $rulers); $rlinks = array(); foreach ($links as $k => $link) { @@ -128,7 +127,7 @@ trait LinksOperation $rrulers[$k] = $ruler; } - Links::saveLinksInFile($fluidbook_id, backpack_user()->id, __('Décalage de :nb pages à partir de la page :page', ['nb' => $offset, 'page' => $from]), $rlinks, $rrulers); + LinksData::saveLinksInFile($fluidbook_id, backpack_user()->id, __('Décalage de :nb pages à partir de la page :page', ['nb' => $offset, 'page' => $from]), $rlinks, $rrulers); return response()->json(['success' => 'ok']); } @@ -168,7 +167,7 @@ trait LinksOperation if (!FluidbookPublication::hasPermission($fluidbook_id)) { abort(401); } - $links = Links::getLinksVersions($fluidbook_id); + $links = LinksData::getLinksVersions($fluidbook_id); return response()->json($links); } @@ -177,8 +176,8 @@ trait LinksOperation if (!FluidbookPublication::hasPermission($fluidbook_id)) { abort(401); } - Links::getLinksAndRulers($fluidbook_id, $links, $rulers, $version); - $xlsx = Links::linksToExcel($links, $rulers); + LinksData::getLinksAndRulers($fluidbook_id, $links, $rulers, $version); + $xlsx = LinksData::linksToExcel($links, $rulers); $tmpfile = Files::tempnam() . '.xlsx'; $writer = new Xlsx($xlsx); $writer->save($tmpfile); @@ -191,8 +190,8 @@ trait LinksOperation abort(401); } - Links::getLinksAndRulers($fluidbook_id, $links, $rulers, $version); - Links::saveLinksInFile($fluidbook_id, backpack_user()->id, __('Restaurer la sauvegarde des liens :date', ['date' => date('Y-m-d H:i:s', $version)]), $links, $rulers, [], []); + LinksData::getLinksAndRulers($fluidbook_id, $links, $rulers, $version); + LinksData::saveLinksInFile($fluidbook_id, backpack_user()->id, __('Restaurer la sauvegarde des liens :date', ['date' => date('Y-m-d H:i:s', $version)]), $links, $rulers, [], []); return response()->json(['success' => 'ok']); } @@ -204,8 +203,8 @@ trait LinksOperation /** @var UploadedFile $uploadedFile */ $uploadedFile = request()->file('file'); - Links::getLinksAndRulersFromExcelFile($uploadedFile->getPathname(), $links, $rulers); - Links::saveLinksInFile($fluidbook_id, backpack_user()->id, __("Remplacer les liens à partir du fichier :file", ['file' => $uploadedFile->getClientOriginalName()]), $links, $rulers, [], []); + LinksData::getLinksAndRulersFromExcelFile($uploadedFile->getPathname(), $links, $rulers); + LinksData::saveLinksInFile($fluidbook_id, backpack_user()->id, __("Remplacer les liens à partir du fichier :file", ['file' => $uploadedFile->getClientOriginalName()]), $links, $rulers, [], []); return response()->json(['success' => 'ok']); } @@ -218,8 +217,8 @@ trait LinksOperation /** @var UploadedFile $uploadedFile */ $uploadedFile = request()->file('file'); - Links::getLinksAndRulers($fluidbook_id, $merged_links, $merged_rulers); - Links::getLinksAndRulersFromExcelFile($uploadedFile->getPathname(), $links, $rulers); + LinksData::getLinksAndRulers($fluidbook_id, $merged_links, $merged_rulers); + LinksData::getLinksAndRulersFromExcelFile($uploadedFile->getPathname(), $links, $rulers); $existing_uids = []; foreach ($merged_links as $merged_link) { $existing_uids[$merged_link['uid']] = true; @@ -227,7 +226,7 @@ trait LinksOperation foreach ($links as $link) { if (isset($existing_uids[$link['uid']])) { - $link['uid'] = Links::generateUID(); + $link['uid'] = LinksData::generateUID(); $existing_uids[$link['uid']] = true; } $merged_links[] = $link; @@ -235,7 +234,7 @@ trait LinksOperation $merged_rulers = array_merge($merged_rulers, $rulers); - Links::saveLinksInFile($fluidbook_id, backpack_user()->id, __("Ajouter les liens à partir du fichier :file", ['file' => $uploadedFile->getClientOriginalName()]) . ' ', $merged_links, $merged_rulers, [], []); + LinksData::saveLinksInFile($fluidbook_id, backpack_user()->id, __("Ajouter les liens à partir du fichier :file", ['file' => $uploadedFile->getClientOriginalName()]) . ' ', $merged_links, $merged_rulers, [], []); return response()->json(['success' => 'ok']); } @@ -267,7 +266,7 @@ trait LinksOperation $book = FluidbookPublication::find($fluidbook_id); $w = $book->getPageWidth(); $w2 = $w * 2; - Links::getLinksAndRulers($fluidbook_id, $links, $rulers); + LinksData::getLinksAndRulers($fluidbook_id, $links, $rulers); foreach ($links as $i => $link) { $change = false; while (true) { @@ -286,6 +285,6 @@ trait LinksOperation $links[$i] = $link; } } - Links::saveLinksInFile($fluidbook_id, backpack_user()->id, __("Corriger la dérive des liens"), $links, $rulers, [], []); + LinksData::saveLinksInFile($fluidbook_id, backpack_user()->id, __("Corriger la dérive des liens"), $links, $rulers, [], []); } } diff --git a/app/Http/Controllers/Admin/Operations/FluidbookPublication/PreviewOperation.php b/app/Http/Controllers/Admin/Operations/FluidbookPublication/PreviewOperation.php index bf8f7af1b..04e86eb86 100644 --- a/app/Http/Controllers/Admin/Operations/FluidbookPublication/PreviewOperation.php +++ b/app/Http/Controllers/Admin/Operations/FluidbookPublication/PreviewOperation.php @@ -2,7 +2,7 @@ namespace App\Http\Controllers\Admin\Operations\FluidbookPublication; -use App\Fluidbook\Compiler; +use App\Fluidbook\Compiler\Compiler; use App\Http\Controllers\Admin\Operations\FluidbookPreviewOperation; use App\Http\Middleware\CheckIfAdmin; use App\Models\FluidbookPublication; diff --git a/app/Http/Controllers/Admin/Operations/Tools/FluidbookCopyLinks.php b/app/Http/Controllers/Admin/Operations/Tools/FluidbookCopyLinks.php index c0169492d..ef5b5a25d 100644 --- a/app/Http/Controllers/Admin/Operations/Tools/FluidbookCopyLinks.php +++ b/app/Http/Controllers/Admin/Operations/Tools/FluidbookCopyLinks.php @@ -3,7 +3,7 @@ namespace App\Http\Controllers\Admin\Operations\Tools; use App\Fields\FluidbookID; -use App\Fluidbook\Links; +use App\Fluidbook\Link\LinksData; use App\Models\FluidbookPublication; use Cubist\Backpack\Magic\Fields\Checkbox; use Cubist\Backpack\Magic\Fields\SelectFromArray; @@ -48,7 +48,7 @@ trait FluidbookCopyLinks } if (request('links')) { - Links::copy(request('from'), request('to')); + LinksData::copy(request('from'), request('to')); } if (request('assets', 'no') !== 'no') { diff --git a/app/Jobs/FluidbookDocumentUpload.php b/app/Jobs/FluidbookDocumentUpload.php index 73b9ee505..a8f286a50 100644 --- a/app/Jobs/FluidbookDocumentUpload.php +++ b/app/Jobs/FluidbookDocumentUpload.php @@ -2,7 +2,6 @@ namespace App\Jobs; -use App\Fluidbook\Links; use App\Models\FluidbookDocument; use App\Models\User; use Illuminate\Support\Facades\Cache; diff --git a/app/Jobs/FluidbookImagesPreprocess.php b/app/Jobs/FluidbookImagesPreprocess.php index cbddf5267..8ffe401ab 100644 --- a/app/Jobs/FluidbookImagesPreprocess.php +++ b/app/Jobs/FluidbookImagesPreprocess.php @@ -2,7 +2,7 @@ namespace App\Jobs; -use App\Fluidbook\Compiler; +use App\Fluidbook\Compiler\Compiler; use App\Models\FluidbookPublication; use Cubist\Util\ArrayUtil; diff --git a/app/Models/FluidbookPublication.php b/app/Models/FluidbookPublication.php index 9e0d41ca3..00afd8062 100644 --- a/app/Models/FluidbookPublication.php +++ b/app/Models/FluidbookPublication.php @@ -10,7 +10,7 @@ use App\Fields\FluidbookLocale; use App\Fields\FluidbookStatus; use App\Fields\User; use App\Fluidbook\Farm; -use App\Fluidbook\Links; +use App\Fluidbook\Link\LinksData; use App\Http\Controllers\Admin\Operations\ChangeownerOperation; use App\Http\Controllers\Admin\Operations\FluidbookPublication\CloneOperation; use App\Http\Controllers\Admin\Operations\FluidbookPublication\CompositionOperation; @@ -28,7 +28,6 @@ use App\Models\Traits\CheckHash; use App\Models\Traits\PublicationSettings; use App\Models\Traits\SCORMVersionTrait; use App\Slack\Slack; -use Backpack\CRUD\app\Library\Widget; use Cubist\Backpack\Magic\Fields\FormBigSection; use Cubist\Backpack\Magic\Fields\FormSuperSection; use Cubist\Backpack\Magic\Fields\Hidden; @@ -498,7 +497,7 @@ class FluidbookPublication extends ToolboxSettingsModel public function getLinksAndRulers(&$links, &$rulers) { - Links::getLinksAndRulers($this->id, $links, $rulers); + LinksData::getLinksAndRulers($this->id, $links, $rulers); } public function getLinksAssetsDimensions() @@ -661,7 +660,7 @@ class FluidbookPublication extends ToolboxSettingsModel $new->save(); // Copy links & assets - Links::copy($this->id, $new->id); + LinksData::copy($this->id, $new->id); $this->_replicateMedia($new->id); return $new; diff --git a/app/SubForms/Link/Anchor.php b/app/SubForms/Link/Anchor.php index a292faf95..de6ceab76 100644 --- a/app/SubForms/Link/Anchor.php +++ b/app/SubForms/Link/Anchor.php @@ -2,9 +2,11 @@ namespace App\SubForms\Link; // __('!! Editeur de liens') +use App\Fluidbook\Link\Link; + class Anchor extends Meta { - public $type = self::ANCHOR; + public $type = Link::ANCHOR; protected $_extra = false; diff --git a/app/SubForms/Link/Article.php b/app/SubForms/Link/Article.php index e183814dc..4496c49d6 100644 --- a/app/SubForms/Link/Article.php +++ b/app/SubForms/Link/Article.php @@ -2,12 +2,13 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\FilesOrURL; use Cubist\Backpack\Magic\Fields\Textarea; // __('!! Editeur de liens') class Article extends Meta { - public $type = self::ARTICLE; + public $type = Link::ARTICLE; public function addDestinationField() { diff --git a/app/SubForms/Link/ArticleOpen.php b/app/SubForms/Link/ArticleOpen.php index af2d7408f..3e3805a1b 100644 --- a/app/SubForms/Link/ArticleOpen.php +++ b/app/SubForms/Link/ArticleOpen.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\FilesOrURL; // __('!! Editeur de liens') class ArticleOpen extends Base { - public $type = self::ARTICLE_OPEN; + public $type = Link::ARTICLE_OPEN; public function addDestinationField() { diff --git a/app/SubForms/Link/Audio.php b/app/SubForms/Link/Audio.php index d5fc894f7..d478a44c1 100644 --- a/app/SubForms/Link/Audio.php +++ b/app/SubForms/Link/Audio.php @@ -2,12 +2,13 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\CheckboxBasic; use Cubist\Backpack\Magic\Fields\FilesOrURL; // __('!! Editeur de liens') class Audio extends Base { - public $type = self::AUDIO; + public $type = Link::AUDIO; public $_integration = true; public $_multimedia = true; diff --git a/app/SubForms/Link/Audiodescription.php b/app/SubForms/Link/Audiodescription.php index ea5b09f07..e01a10295 100644 --- a/app/SubForms/Link/Audiodescription.php +++ b/app/SubForms/Link/Audiodescription.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\FilesOrURL; // __('!! Editeur de liens') class Audiodescription extends Meta { - public $type = self::AUDIODESCRIPTION; + public $type = Link::AUDIODESCRIPTION; public function addDestinationField() { diff --git a/app/SubForms/Link/Base.php b/app/SubForms/Link/Base.php index f01ecface..b2418b29d 100644 --- a/app/SubForms/Link/Base.php +++ b/app/SubForms/Link/Base.php @@ -6,7 +6,7 @@ use App\Fields\FluidbookLinkEditor\Depth; use App\Fields\FluidbookLinkEditor\LinkType; use App\Fields\FluidbookLinkEditor\MultimediaIntegration; use App\Fields\FluidbookLinkEditor\RolloverAnimation; -use App\Fluidbook\Compiler; +use App\Fluidbook\Compiler\Compiler; use App\Fluidbook\Link\Link; use App\Models\FluidbookPublication; use Cubist\Backpack\Magic\Fields\Checkbox; @@ -25,53 +25,6 @@ use Cubist\Backpack\Magic\Form; // __('!! Editeur de liens') class Base extends Form { - const WEB_INFOS = 1; - const PRODUCT = 1; - const WEB = 2; - const GENERAL = 2; - const EMAIL = 3; - const VIDEO = 4; - const INTERNAL = 5; - const MULTIMEDIA = 6; - const PERSO = 7; - const CUSTOM = 7; - const PAGE_CORNER = 8; - const OBJECT3D = 9; - const WEBVIDEO = 10; - const ACTION = 11; - const CART = 12; - const BASKET = 12; - const ZOOM = 13; - const COLOR = 14; - const IMAGE = 15; - const FILE = 16; - const AUDIO = 17; - const TOOLTIP = 18; - const CALL = 19; - const BOOKMARKGROUP = 20; - const HTML5MULTIMEDIA = 21; - const BOOKMARK_CORNER = 22; - const STATSTAG = 23; - const PHONE = 24; - const AUDIODESCRIPTION = 25; - const PAGE_LABEL = 26; - const EVENT_OVERLAY = 27; - const ARTICLE = 28; - const LIKE = 29; - const SLIDESHOW = 30; - const IFRAME = 31; - const SHOWLINK = 32; - const ZOOMHD = 33; - const LOCK_CONTENTS = 34; - const TEXT = 35; - const ARTICLE_OPEN = 36; - const DOWNLOAD_PORTION = 37; - const TRIGGERSLINK = 38; - const LAYER = 39; - const ANCHOR = 40; - const FLIPCARD = 41; - - const PDF=42; /** @@ -111,47 +64,47 @@ class Base extends Form public static function types() { $res = [ - ['type' => self::WEB, 'label' => __('Adresse Web (URL)'), 'color' => '#3399cc', 'class' => Web::class, 'order' => 1], - ['type' => self::INTERNAL, 'label' => __('Lien vers une page'), 'color' => '#c7b405', 'class' => Internal::class, 'order' => 2], - ['type' => self::EMAIL, 'label' => __('Adresse e-mail'), 'color' => '#6c6360', 'class' => Email::class, 'order' => 3], - ['type' => self::VIDEO, 'label' => __('Vidéo'), 'color' => '#33ff00', 'class' => Video::class, 'order' => 4], + ['type' => \Fluidbook\Tools\Links\Link::WEB, 'label' => __('Adresse Web (URL)'), 'color' => '#3399cc', 'class' => Web::class, 'order' => 1], + ['type' => \Fluidbook\Tools\Links\Link::INTERNAL, 'label' => __('Lien vers une page'), 'color' => '#c7b405', 'class' => Internal::class, 'order' => 2], + ['type' => \Fluidbook\Tools\Links\Link::EMAIL, 'label' => __('Adresse e-mail'), 'color' => '#6c6360', 'class' => Email::class, 'order' => 3], + ['type' => \Fluidbook\Tools\Links\Link::VIDEO, 'label' => __('Vidéo'), 'color' => '#33ff00', 'class' => Video::class, 'order' => 4], ['type' => 'separator', 'order' => 5], - ['type' => self::COLOR, 'label' => __('Couleur'), 'color' => '#8C5E24', 'class' => Color::class], - ['type' => self::IMAGE, 'label' => __('Image'), 'color' => '#BE418D', 'class' => Image::class], - ['type' => self::LAYER, 'label' => __('Animation de calque'), 'color' => '#3D0254', 'class' => Layer::class], - ['type' => self::TEXT, 'label' => __('Texte'), 'color' => '#9090FF', 'class' => \App\SubForms\Link\Text::class], - ['type' => self::MULTIMEDIA, 'label' => __('Multimédia'), 'color' => '#ff00ff', 'class' => Multimedia::class], - ['type' => self::WEB_INFOS, 'label' => __('Adresse web « plus d\'infos »'), 'color' => '#ff0000', 'class' => WebInfos::class], - ['type' => self::CUSTOM, 'label' => __('Personnalisé'), 'color' => '#14511a', 'class' => Custom::class], - ['type' => self::WEBVIDEO, 'label' => __('Vidéo web'), 'color' => '#ffff00', 'class' => WebVideo::class], - ['type' => self::CART, 'label' => __('Panier'), 'color' => '#F2A4B7', 'class' => Cart::class], - ['type' => self::ZOOM, 'label' => __('Zone de zoom'), 'color' => '#322280', 'class' => ZoomArea::class], - ['type' => self::FILE, 'label' => __('Fichier'), 'color' => '#F19043', 'class' => File::class], - ['type' => self::AUDIO, 'label' => __('Audio'), 'color' => '#0065AE', 'class' => Audio::class], - ['type' => self::TOOLTIP, 'label' => __('Infobulle / Texte'), 'color' => '#20c45b', 'class' => Tooltip::class], - ['type' => self::BOOKMARKGROUP, 'label' => __('Groupe de marque-pages'), 'color' => '#d6520f', 'class' => BookmarkGroup::class], - ['type' => self::STATSTAG, 'label' => __('Tag statistique'), 'color' => '#dddddd', 'class' => StatsTag::class], - ['type' => self::PHONE, 'label' => __('Téléphone'), 'color' => '#333333', 'class' => Phone::class], - ['type' => self::AUDIODESCRIPTION, 'label' => __('Audiodescription'), 'color' => '#00535b', 'class' => Audiodescription::class], - ['type' => self::ANCHOR, 'label' => __('Ancre / Label de page'), 'color' => '#00E6D7', 'class' => Anchor::class, 'aliases' => self::PAGE_LABEL], - ['type' => self::EVENT_OVERLAY, 'label' => __('Capter les évenements'), 'color' => '#ffcc00', 'class' => EventOverlay::class], - ['type' => self::ARTICLE, 'label' => __('Article (définition)'), 'color' => '#ACC152', 'class' => Article::class], - ['type' => self::LIKE, 'label' => __('Like'), 'color' => '#4267B2', 'class' => Like::class], - ['type' => self::SLIDESHOW, 'label' => __('Diaporama'), 'color' => '#07b57a', 'class' => Slideshow::class], - ['type' => self::IFRAME, 'label' => __('iFrame'), 'color' => '#fcae25', 'class' => IFrame::class], - ['type' => self::SHOWLINK, 'label' => __('Afficher un lien'), 'color' => '#125C70', 'class' => ShowLink::class], - ['type' => self::ZOOMHD, 'label' => __('Zoom HD'), 'color' => '#E80C95', 'class' => ZoomHD::class], - ['type' => self::LOCK_CONTENTS, 'label' => __('Blocage des contenus'), 'color' => '#69D670', 'class' => LockContents::class], - ['type' => self::ARTICLE_OPEN, 'label' => __('Article (afficher)'), 'color' => '#ffcc00', 'class' => ArticleOpen::class], - ['type' => self::DOWNLOAD_PORTION, 'label' => __('Télécharger un extrait'), 'color' => '#AAAAAA', 'class' => DownloadPortion::class], - ['type' => self::TRIGGERSLINK, 'label' => __('Déclencher un lien'), 'color' => '#cc0000', 'class' => TriggerLink::class], - ['type' => self::FLIPCARD, 'label' => __('Flipcard'), 'color' => '#460e3f', 'class' => Flipcard::class], - ['type' => self::PDF, 'label' => __('PDF'), 'color' => '#af48d1', 'class' => PDF::class], - //['type' => self::ACTION, 'label' => __('Action'), 'color' => '#880000', 'class' => Action::class], - //['type' => self::HTML5MULTIMEDIA, 'label' => __('Lien Multimédia (HTML)'), 'color' => '#34A853', 'disabled' => true, 'class' => Web::class], - //['type' => self::BOOKMARK_CORNER, 'label' => __('Lien marque-page sur coin de page'), 'color' => '#000000', 'disabled' => true, 'class' => Web::class], - //['type' => self::PAGE_CORNER, 'label' => __('Coin de page'), 'color' => '#f19043', 'disabled' => true, 'class' => Web::class], - //['type' => self::OBJECT3D, 'label' => __('Objet 3D'), 'color' => '#00ffff', 'disabled' => true, 'class' => Web::class], + ['type' => \Fluidbook\Tools\Links\Link::COLOR, 'label' => __('Couleur'), 'color' => '#8C5E24', 'class' => Color::class], + ['type' => \Fluidbook\Tools\Links\Link::IMAGE, 'label' => __('Image'), 'color' => '#BE418D', 'class' => Image::class], + ['type' => \Fluidbook\Tools\Links\Link::LAYER, 'label' => __('Animation de calque'), 'color' => '#3D0254', 'class' => Layer::class], + ['type' => \Fluidbook\Tools\Links\Link::TEXT, 'label' => __('Texte'), 'color' => '#9090FF', 'class' => \App\SubForms\Link\Text::class], + ['type' => \Fluidbook\Tools\Links\Link::MULTIMEDIA, 'label' => __('Multimédia'), 'color' => '#ff00ff', 'class' => Multimedia::class], + ['type' => \Fluidbook\Tools\Links\Link::WEB_INFOS, 'label' => __('Adresse web « plus d\'infos »'), 'color' => '#ff0000', 'class' => WebInfos::class], + ['type' => \Fluidbook\Tools\Links\Link::CUSTOM, 'label' => __('Personnalisé'), 'color' => '#14511a', 'class' => Custom::class], + ['type' => \Fluidbook\Tools\Links\Link::WEBVIDEO, 'label' => __('Vidéo web'), 'color' => '#ffff00', 'class' => WebVideo::class], + ['type' => \Fluidbook\Tools\Links\Link::CART, 'label' => __('Panier'), 'color' => '#F2A4B7', 'class' => Cart::class], + ['type' => \Fluidbook\Tools\Links\Link::ZOOM, 'label' => __('Zone de zoom'), 'color' => '#322280', 'class' => ZoomArea::class], + ['type' => \Fluidbook\Tools\Links\Link::FILE, 'label' => __('Fichier'), 'color' => '#F19043', 'class' => File::class], + ['type' => \Fluidbook\Tools\Links\Link::AUDIO, 'label' => __('Audio'), 'color' => '#0065AE', 'class' => Audio::class], + ['type' => \Fluidbook\Tools\Links\Link::TOOLTIP, 'label' => __('Infobulle / Texte'), 'color' => '#20c45b', 'class' => Tooltip::class], + ['type' => \Fluidbook\Tools\Links\Link::BOOKMARKGROUP, 'label' => __('Groupe de marque-pages'), 'color' => '#d6520f', 'class' => BookmarkGroup::class], + ['type' => \Fluidbook\Tools\Links\Link::STATSTAG, 'label' => __('Tag statistique'), 'color' => '#dddddd', 'class' => StatsTag::class], + ['type' => \Fluidbook\Tools\Links\Link::PHONE, 'label' => __('Téléphone'), 'color' => '#333333', 'class' => Phone::class], + ['type' => \Fluidbook\Tools\Links\Link::AUDIODESCRIPTION, 'label' => __('Audiodescription'), 'color' => '#00535b', 'class' => Audiodescription::class], + ['type' => \Fluidbook\Tools\Links\Link::ANCHOR, 'label' => __('Ancre / Label de page'), 'color' => '#00E6D7', 'class' => Anchor::class, 'aliases' => \Fluidbook\Tools\Links\Link::PAGE_LABEL], + ['type' => \Fluidbook\Tools\Links\Link::EVENT_OVERLAY, 'label' => __('Capter les évenements'), 'color' => '#ffcc00', 'class' => EventOverlay::class], + ['type' => \Fluidbook\Tools\Links\Link::ARTICLE, 'label' => __('Article (définition)'), 'color' => '#ACC152', 'class' => Article::class], + ['type' => \Fluidbook\Tools\Links\Link::LIKE, 'label' => __('Like'), 'color' => '#4267B2', 'class' => Like::class], + ['type' => \Fluidbook\Tools\Links\Link::SLIDESHOW, 'label' => __('Diaporama'), 'color' => '#07b57a', 'class' => Slideshow::class], + ['type' => \Fluidbook\Tools\Links\Link::IFRAME, 'label' => __('iFrame'), 'color' => '#fcae25', 'class' => IFrame::class], + ['type' => \Fluidbook\Tools\Links\Link::SHOWLINK, 'label' => __('Afficher un lien'), 'color' => '#125C70', 'class' => ShowLink::class], + ['type' => \Fluidbook\Tools\Links\Link::ZOOMHD, 'label' => __('Zoom HD'), 'color' => '#E80C95', 'class' => ZoomHD::class], + ['type' => \Fluidbook\Tools\Links\Link::LOCK_CONTENTS, 'label' => __('Blocage des contenus'), 'color' => '#69D670', 'class' => LockContents::class], + ['type' => \Fluidbook\Tools\Links\Link::ARTICLE_OPEN, 'label' => __('Article (afficher)'), 'color' => '#ffcc00', 'class' => ArticleOpen::class], + ['type' => \Fluidbook\Tools\Links\Link::DOWNLOAD_PORTION, 'label' => __('Télécharger un extrait'), 'color' => '#AAAAAA', 'class' => DownloadPortion::class], + ['type' => \Fluidbook\Tools\Links\Link::TRIGGERSLINK, 'label' => __('Déclencher un lien'), 'color' => '#cc0000', 'class' => TriggerLink::class], + ['type' => \Fluidbook\Tools\Links\Link::FLIPCARD, 'label' => __('Flipcard'), 'color' => '#460e3f', 'class' => Flipcard::class], + ['type' => \Fluidbook\Tools\Links\Link::PDF, 'label' => __('PDF'), 'color' => '#af48d1', 'class' => PDF::class], + //['type' => \Fluidbook\Tools\Links\Link::ACTION, 'label' => __('Action'), 'color' => '#880000', 'class' => Action::class], + //['type' => \Fluidbook\Tools\Links\Link::HTML5MULTIMEDIA, 'label' => __('Lien Multimédia (HTML)'), 'color' => '#34A853', 'disabled' => true, 'class' => Web::class], + //['type' => \Fluidbook\Tools\Links\Link::BOOKMARK_CORNER, 'label' => __('Lien marque-page sur coin de page'), 'color' => '#000000', 'disabled' => true, 'class' => Web::class], + //['type' => \Fluidbook\Tools\Links\Link::PAGE_CORNER, 'label' => __('Coin de page'), 'color' => '#f19043', 'disabled' => true, 'class' => Web::class], + //['type' => \Fluidbook\Tools\Links\Link::OBJECT3D, 'label' => __('Objet 3D'), 'color' => '#00ffff', 'disabled' => true, 'class' => Web::class], ]; usort($res, function ($a, $b) { diff --git a/app/SubForms/Link/BookmarkGroup.php b/app/SubForms/Link/BookmarkGroup.php index c8565ca08..305e694e2 100644 --- a/app/SubForms/Link/BookmarkGroup.php +++ b/app/SubForms/Link/BookmarkGroup.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\Integer; // __('!! Editeur de liens') class BookmarkGroup extends Meta { - public $type = self::BOOKMARKGROUP; + public $type = Link::BOOKMARKGROUP; public function addDestinationField() { diff --git a/app/SubForms/Link/Cart.php b/app/SubForms/Link/Cart.php index 930ed5568..c0cc31a93 100644 --- a/app/SubForms/Link/Cart.php +++ b/app/SubForms/Link/Cart.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\Text; // __('!! Editeur de liens') class Cart extends Base { - public $type = self::CART; + public $type = Link::CART; public function addDestinationField() { diff --git a/app/SubForms/Link/Color.php b/app/SubForms/Link/Color.php index 52681b892..19abd8182 100644 --- a/app/SubForms/Link/Color.php +++ b/app/SubForms/Link/Color.php @@ -3,9 +3,11 @@ namespace App\SubForms\Link; // __('!! Editeur de liens') +use App\Fluidbook\Link\Link; + class Color extends Animated { - public $type = self::COLOR; + public $type = Link::COLOR; public function addDestinationField() { diff --git a/app/SubForms/Link/Custom.php b/app/SubForms/Link/Custom.php index 628b1b743..abc8a1640 100644 --- a/app/SubForms/Link/Custom.php +++ b/app/SubForms/Link/Custom.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\FilesOrURL; // __('!! Editeur de liens') class Custom extends Base { - public $type = self::CUSTOM; + public $type = Link::CUSTOM; public function addDestinationField() { diff --git a/app/SubForms/Link/DownloadPortion.php b/app/SubForms/Link/DownloadPortion.php index 865d69ee3..b133624c8 100644 --- a/app/SubForms/Link/DownloadPortion.php +++ b/app/SubForms/Link/DownloadPortion.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\Text; // __('!! Editeur de liens') class DownloadPortion extends Base { - public $type = self::DOWNLOAD_PORTION; + public $type = Link::DOWNLOAD_PORTION; public function addDestinationField() { diff --git a/app/SubForms/Link/Email.php b/app/SubForms/Link/Email.php index bef8cb90e..fc3b00f55 100644 --- a/app/SubForms/Link/Email.php +++ b/app/SubForms/Link/Email.php @@ -3,9 +3,11 @@ namespace App\SubForms\Link; // __('!! Editeur de liens') +use App\Fluidbook\Link\Link; + class Email extends Web { - public $type = self::EMAIL; + public $type = Link::EMAIL; public function addDestinationField() { diff --git a/app/SubForms/Link/EventOverlay.php b/app/SubForms/Link/EventOverlay.php index d8a8905f5..45126a135 100644 --- a/app/SubForms/Link/EventOverlay.php +++ b/app/SubForms/Link/EventOverlay.php @@ -2,7 +2,9 @@ namespace App\SubForms\Link; // __('!! Editeur de liens') +use App\Fluidbook\Link\Link; + class EventOverlay extends Meta { - public $type = self::EVENT_OVERLAY; + public $type = Link::EVENT_OVERLAY; } diff --git a/app/SubForms/Link/File.php b/app/SubForms/Link/File.php index 41c6ff0f8..de571714b 100644 --- a/app/SubForms/Link/File.php +++ b/app/SubForms/Link/File.php @@ -3,11 +3,12 @@ namespace App\SubForms\Link; use App\Fields\FluidbookLinkEditor\Target; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\FilesOrURL; // __('!! Editeur de liens') class File extends Web { - public $type = self::FILE; + public $type = Link::FILE; public function addDestinationField() { diff --git a/app/SubForms/Link/Flipcard.php b/app/SubForms/Link/Flipcard.php index fb2218c41..aedc16b8d 100644 --- a/app/SubForms/Link/Flipcard.php +++ b/app/SubForms/Link/Flipcard.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\FilesOrURL; // __('!! Editeur de liens') class Flipcard extends Base { - public $type = self::FLIPCARD; + public $type = Link::FLIPCARD; protected $_addedContents = false; diff --git a/app/SubForms/Link/IFrame.php b/app/SubForms/Link/IFrame.php index f113d83c9..fccc4265f 100644 --- a/app/SubForms/Link/IFrame.php +++ b/app/SubForms/Link/IFrame.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\FilesOrURL; // __('!! Editeur de liens') class IFrame extends Web { - public $type = self::IFRAME; + public $type = Link::IFRAME; protected $_integration = true; diff --git a/app/SubForms/Link/Image.php b/app/SubForms/Link/Image.php index 5309c62ea..320459f8b 100644 --- a/app/SubForms/Link/Image.php +++ b/app/SubForms/Link/Image.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\FilesOrURL; // __('!! Editeur de liens') class Image extends Animated { - public $type = self::IMAGE; + public $type = Link::IMAGE; public function addDestinationField() { diff --git a/app/SubForms/Link/Internal.php b/app/SubForms/Link/Internal.php index 9e132fd1a..27bb4a556 100644 --- a/app/SubForms/Link/Internal.php +++ b/app/SubForms/Link/Internal.php @@ -3,11 +3,12 @@ namespace App\SubForms\Link; use App\Fields\FluidbookLinkEditor\NumberingType; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\Text; // __('!! Editeur de liens') class Internal extends Web { - public $type = self::INTERNAL; + public $type = Link::INTERNAL; public function addDestinationField() { diff --git a/app/SubForms/Link/Layer.php b/app/SubForms/Link/Layer.php index fb0ee0d97..88a78224a 100644 --- a/app/SubForms/Link/Layer.php +++ b/app/SubForms/Link/Layer.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\Hidden; // __('!! Editeur de liens') class Layer extends Animated { - public $type = self::LAYER; + public $type = Link::LAYER; public function addDestinationField() { diff --git a/app/SubForms/Link/Like.php b/app/SubForms/Link/Like.php index b10b419c9..8a40b4608 100644 --- a/app/SubForms/Link/Like.php +++ b/app/SubForms/Link/Like.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\URL; // __('!! Editeur de liens') class Like extends Base { - public $type = self::LIKE; + public $type = Link::LIKE; protected $_extra = false; protected $_addedContents = false; diff --git a/app/SubForms/Link/LockContents.php b/app/SubForms/Link/LockContents.php index 0f3747fd6..ed4ca0637 100644 --- a/app/SubForms/Link/LockContents.php +++ b/app/SubForms/Link/LockContents.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\Textarea; // __('!! Editeur de liens') class LockContents extends Meta { - public $type = self::LOCK_CONTENTS; + public $type = Link::LOCK_CONTENTS; public function addDestinationField() { diff --git a/app/SubForms/Link/Multimedia.php b/app/SubForms/Link/Multimedia.php index 94724797b..f21a82e07 100644 --- a/app/SubForms/Link/Multimedia.php +++ b/app/SubForms/Link/Multimedia.php @@ -2,12 +2,13 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\CheckboxBasic; use Cubist\Backpack\Magic\Fields\FilesOrURL; // __('!! Editeur de liens') class Multimedia extends Base { - public $type = self::MULTIMEDIA; + public $type = Link::MULTIMEDIA; public $_integration = true; public $_multimedia = true; diff --git a/app/SubForms/Link/PDF.php b/app/SubForms/Link/PDF.php index d96d11d62..242cff0ef 100644 --- a/app/SubForms/Link/PDF.php +++ b/app/SubForms/Link/PDF.php @@ -4,11 +4,14 @@ namespace App\SubForms\Link; use App\Fields\FluidbookLinkEditor\PDFJSType; use App\Fields\FluidbookLinkEditor\Target; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\FilesOrURL; use Cubist\Backpack\Magic\Fields\SelectFromArray; class PDF extends File { + public $type = Link::PDF; + public function addDestinationField() { $this->addField('to', FilesOrURL::class, __('Fichier'), $this->getFilesOrURLEntry()); diff --git a/app/SubForms/Link/Phone.php b/app/SubForms/Link/Phone.php index 7ded88063..11b1add8a 100644 --- a/app/SubForms/Link/Phone.php +++ b/app/SubForms/Link/Phone.php @@ -2,9 +2,11 @@ namespace App\SubForms\Link; // __('!! Editeur de liens') +use App\Fluidbook\Link\Link; + class Phone extends Web { - public $type = self::PHONE; + public $type = Link::PHONE; public function addDestinationField() { diff --git a/app/SubForms/Link/ShowLink.php b/app/SubForms/Link/ShowLink.php index ffe9b0605..0fc851a32 100644 --- a/app/SubForms/Link/ShowLink.php +++ b/app/SubForms/Link/ShowLink.php @@ -4,11 +4,12 @@ namespace App\SubForms\Link; use App\Fields\FluidbookLinkEditor\ShowLinkCloseMode; use App\Fields\FluidbookLinkEditor\ShowLinkMode; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\Text; // __('!! Editeur de liens') class ShowLink extends Base { - public $type = self::SHOWLINK; + public $type = Link::SHOWLINK; public function addDestinationField() { diff --git a/app/SubForms/Link/Slideshow.php b/app/SubForms/Link/Slideshow.php index c29aa6834..7849c267a 100644 --- a/app/SubForms/Link/Slideshow.php +++ b/app/SubForms/Link/Slideshow.php @@ -2,12 +2,13 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\FilesOrURL; use Cubist\Backpack\Magic\Fields\Integer; // __('!! Editeur de liens') class Slideshow extends Web { - public $type = self::SLIDESHOW; + public $type = Link::SLIDESHOW; public function addDestinationField() { diff --git a/app/SubForms/Link/StatsTag.php b/app/SubForms/Link/StatsTag.php index ce0fd8d7a..0d3b4830b 100644 --- a/app/SubForms/Link/StatsTag.php +++ b/app/SubForms/Link/StatsTag.php @@ -2,13 +2,15 @@ namespace App\SubForms\Link; // __('!! Editeur de liens') +use App\Fluidbook\Link\Link; + class StatsTag extends Base { protected $_tooltip = false; protected $_addedContents = false; protected $_extra=false; - public $type = self::STATSTAG; + public $type = Link::STATSTAG; public function addDestinationField() { diff --git a/app/SubForms/Link/Text.php b/app/SubForms/Link/Text.php index b07aebe88..5cd84e1bd 100644 --- a/app/SubForms/Link/Text.php +++ b/app/SubForms/Link/Text.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\FilesOrURL; // __('!! Editeur de liens') class Text extends Animated { - public $type = self::TEXT; + public $type = Link::TEXT; public function addDestinationField() { diff --git a/app/SubForms/Link/Tooltip.php b/app/SubForms/Link/Tooltip.php index f06307a38..dbd7e3872 100644 --- a/app/SubForms/Link/Tooltip.php +++ b/app/SubForms/Link/Tooltip.php @@ -2,12 +2,16 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\CheckboxBasic; use Cubist\Backpack\Magic\Fields\FormSection; use Cubist\Backpack\Magic\Fields\Textarea; + // __('!! Editeur de liens') class Tooltip extends Base { + public $type = Link::TOOLTIP; + public function initForm() { $this->addTypeField(); diff --git a/app/SubForms/Link/TriggerLink.php b/app/SubForms/Link/TriggerLink.php index 481146dbd..d3fff2144 100644 --- a/app/SubForms/Link/TriggerLink.php +++ b/app/SubForms/Link/TriggerLink.php @@ -3,11 +3,12 @@ namespace App\SubForms\Link; use App\Fields\FluidbookLinkEditor\TriggerLinkEvent; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\Text; // __('!! Editeur de liens') class TriggerLink extends Base { - public $type = self::TRIGGERSLINK; + public $type = Link::TRIGGERSLINK; public function addDestinationField() { diff --git a/app/SubForms/Link/Video.php b/app/SubForms/Link/Video.php index e797d244b..5de4ca721 100644 --- a/app/SubForms/Link/Video.php +++ b/app/SubForms/Link/Video.php @@ -2,12 +2,13 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\CheckboxBasic; use Cubist\Backpack\Magic\Fields\FilesOrURL; // __('!! Editeur de liens') class Video extends Base { - public $type = self::VIDEO; + public $type = Link::VIDEO; public $_integration = true; public $_multimedia = true; diff --git a/app/SubForms/Link/Web.php b/app/SubForms/Link/Web.php index 09bfabe57..c256b86b9 100644 --- a/app/SubForms/Link/Web.php +++ b/app/SubForms/Link/Web.php @@ -3,12 +3,13 @@ namespace App\SubForms\Link; use App\Fields\FluidbookLinkEditor\Target; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\SelectFromArray; use Cubist\Backpack\Magic\Fields\URL; // __('!! Editeur de liens') class Web extends Base { - public $type = self::WEB; + public $type = Link::WEB; public function addDestinationField() { diff --git a/app/SubForms/Link/WebInfos.php b/app/SubForms/Link/WebInfos.php index 6516bab03..bf4412d31 100644 --- a/app/SubForms/Link/WebInfos.php +++ b/app/SubForms/Link/WebInfos.php @@ -2,7 +2,9 @@ namespace App\SubForms\Link; // __('!! Editeur de liens') +use App\Fluidbook\Link\Link; + class WebInfos extends Web { - public $type = self::WEB_INFOS; + public $type = Link::WEB_INFOS; } diff --git a/app/SubForms/Link/WebVideo.php b/app/SubForms/Link/WebVideo.php index 7e80ccc68..713ff9350 100644 --- a/app/SubForms/Link/WebVideo.php +++ b/app/SubForms/Link/WebVideo.php @@ -3,11 +3,12 @@ namespace App\SubForms\Link; use App\Fields\FluidbookLinkEditor\WebvideoService; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\Text; // __('!! Editeur de liens') class WebVideo extends Video { - public $type = self::WEBVIDEO; + public $type = Link::WEBVIDEO; public function addDestinationField() { diff --git a/app/SubForms/Link/ZoomArea.php b/app/SubForms/Link/ZoomArea.php index c0375aa01..77b16a2d5 100644 --- a/app/SubForms/Link/ZoomArea.php +++ b/app/SubForms/Link/ZoomArea.php @@ -2,11 +2,12 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\Number; // __('!! Editeur de liens') class ZoomArea extends Base { - public $type = self::ZOOM; + public $type = Link::ZOOM; public function addDestinationField() { diff --git a/app/SubForms/Link/ZoomHD.php b/app/SubForms/Link/ZoomHD.php index 650500a98..fc5fca4b9 100644 --- a/app/SubForms/Link/ZoomHD.php +++ b/app/SubForms/Link/ZoomHD.php @@ -2,11 +2,13 @@ namespace App\SubForms\Link; +use App\Fluidbook\Link\Link; use Cubist\Backpack\Magic\Fields\FilesOrURL; + // __('!! Editeur de liens') class ZoomHD extends Base { - public $type = self::ZOOMHD; + public $type = Link::ZOOMHD; public function addDestinationField() { diff --git a/composer.lock b/composer.lock index abd32b0b0..91c235ca7 100644 --- a/composer.lock +++ b/composer.lock @@ -1505,13 +1505,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/cubedesigners_userdatabase.git", - "reference": "de3c655c9aa77497f2f33e7e80a8e98b2eb84899" + "reference": "457ac69e6f98888c441ba2c9150909088357dd86" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/cubedesigners/userdatabase/cubedesigners-userdatabase-dev-backpack4.1-97755b.tar", - "reference": "de3c655c9aa77497f2f33e7e80a8e98b2eb84899", - "shasum": "ffd64cccf8471c59b7c834526920f9fbd39436fc" + "url": "https://composer.cubedesigners.com/dist/cubedesigners/userdatabase/cubedesigners-userdatabase-dev-backpack4.1-336bca.tar", + "reference": "457ac69e6f98888c441ba2c9150909088357dd86", + "shasum": "3ca991e7ef3ce6d2c082504d506f5972c1d07cd2" }, "require": { "cubist/cms-back": "dev-backpack4.1" @@ -1542,7 +1542,7 @@ } ], "description": "Cubedesigners common users database", - "time": "2023-04-24T12:30:51+00:00" + "time": "2023-04-24T15:24:16+00:00" }, { "name": "cubist/azuretts", @@ -2098,13 +2098,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/cubist_util.git", - "reference": "8b554594188f73f0b31010cc0bf4f16c11cad2e4" + "reference": "18676401c228bfd48a6fc74c24f602e36a143bd2" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-a5ed91.tar", - "reference": "8b554594188f73f0b31010cc0bf4f16c11cad2e4", - "shasum": "11dec95916b83c846368e4cee3bb70658403a3a3" + "url": "https://composer.cubedesigners.com/dist/cubist/util/cubist-util-dev-master-a551df.tar", + "reference": "18676401c228bfd48a6fc74c24f602e36a143bd2", + "shasum": "675fd965b43b7bf9d3bce9bef535aeaca0224b0a" }, "require": { "cubist/net": "dev-master", @@ -2137,7 +2137,7 @@ } ], "description": "Utilities class", - "time": "2023-04-21T17:02:35+00:00" + "time": "2023-05-04T13:49:10+00:00" }, { "name": "cviebrock/eloquent-sluggable", @@ -3427,13 +3427,13 @@ "source": { "type": "git", "url": "git://git.cubedesigners.com/fluidbook_tools.git", - "reference": "6aeaba834555ae729c6da5868390546fc51ffed7" + "reference": "d417ed09949a2861885219dbd4c3bedecb6d3cbe" }, "dist": { "type": "tar", - "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-55ea59.tar", - "reference": "6aeaba834555ae729c6da5868390546fc51ffed7", - "shasum": "d9d17aba915b0c582301c0d543402401a2414838" + "url": "https://composer.cubedesigners.com/dist/fluidbook/tools/fluidbook-tools-dev-master-82474b.tar", + "reference": "d417ed09949a2861885219dbd4c3bedecb6d3cbe", + "shasum": "c74e93ca33ad6361d39be0ab1838d4fd2e6d4ac7" }, "require": { "barryvdh/laravel-debugbar": "*", @@ -3467,7 +3467,7 @@ } ], "description": "Fluidbook Tools", - "time": "2023-04-21T17:23:49+00:00" + "time": "2023-05-05T06:50:25+00:00" }, { "name": "genealabs/laravel-model-caching", @@ -4242,7 +4242,7 @@ }, { "name": "jane-php/json-schema-runtime", - "version": "v7.4.4", + "version": "v7.5.0", "source": { "type": "git", "url": "https://github.com/janephp/json-schema-runtime.git", @@ -4298,13 +4298,13 @@ ], "description": "Jane runtime Library", "support": { - "source": "https://github.com/janephp/json-schema-runtime/tree/v7.4.4" + "source": "https://github.com/janephp/json-schema-runtime/tree/v7.5.0" }, "time": "2023-01-24T07:25:29+00:00" }, { "name": "jane-php/open-api-runtime", - "version": "v7.4.4", + "version": "v7.5.0", "source": { "type": "git", "url": "https://github.com/janephp/open-api-runtime.git", @@ -4361,7 +4361,7 @@ ], "description": "Jane OpenAPI Runtime Library, dependencies and utility class for a library generated by jane/openapi", "support": { - "source": "https://github.com/janephp/open-api-runtime/tree/v7.4.4" + "source": "https://github.com/janephp/open-api-runtime/tree/v7.5.0" }, "time": "2021-12-16T13:26:58+00:00" }, @@ -6614,21 +6614,20 @@ }, { "name": "nyholm/psr7", - "version": "1.7.0", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/Nyholm/psr7.git", - "reference": "ed7cf98f6562831dbc3c962406b5e49dc8179c8c" + "reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Nyholm/psr7/zipball/ed7cf98f6562831dbc3c962406b5e49dc8179c8c", - "reference": "ed7cf98f6562831dbc3c962406b5e49dc8179c8c", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/3cb4d163b58589e47b35103e8e5e6a6a475b47be", + "reference": "3cb4d163b58589e47b35103e8e5e6a6a475b47be", "shasum": "" }, "require": { "php": ">=7.2", - "php-http/message-factory": "^1.0", "psr/http-factory": "^1.0", "psr/http-message": "^1.1 || ^2.0" }, @@ -6639,14 +6638,15 @@ }, "require-dev": { "http-interop/http-factory-tests": "^0.9", - "php-http/psr7-integration-tests": "^1.0@dev", - "phpunit/phpunit": "^7.5 || 8.5 || 9.4", + "php-http/message-factory": "^1.0", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", "symfony/error-handler": "^4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.8-dev" } }, "autoload": { @@ -6676,7 +6676,7 @@ ], "support": { "issues": "https://github.com/Nyholm/psr7/issues", - "source": "https://github.com/Nyholm/psr7/tree/1.7.0" + "source": "https://github.com/Nyholm/psr7/tree/1.8.0" }, "funding": [ { @@ -6688,7 +6688,7 @@ "type": "github" } ], - "time": "2023-04-20T08:38:48+00:00" + "time": "2023-05-02T11:26:24+00:00" }, { "name": "opis/closure", @@ -6983,16 +6983,16 @@ }, { "name": "php-http/discovery", - "version": "1.15.3", + "version": "1.18.0", "source": { "type": "git", "url": "https://github.com/php-http/discovery.git", - "reference": "3ccd28dd9fb34b52db946abea1b538568e34eae8" + "reference": "29ae6fae35f4116bbfe4c8b96ccc3f687eb07cd9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/discovery/zipball/3ccd28dd9fb34b52db946abea1b538568e34eae8", - "reference": "3ccd28dd9fb34b52db946abea1b538568e34eae8", + "url": "https://api.github.com/repos/php-http/discovery/zipball/29ae6fae35f4116bbfe4c8b96ccc3f687eb07cd9", + "reference": "29ae6fae35f4116bbfe4c8b96ccc3f687eb07cd9", "shasum": "" }, "require": { @@ -7000,7 +7000,8 @@ "php": "^7.1 || ^8.0" }, "conflict": { - "nyholm/psr7": "<1.0" + "nyholm/psr7": "<1.0", + "zendframework/zend-diactoros": "*" }, "provide": { "php-http/async-client-implementation": "*", @@ -7025,7 +7026,10 @@ "autoload": { "psr-4": { "Http\\Discovery\\": "src/" - } + }, + "exclude-from-classmap": [ + "src/Composer/Plugin.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -7051,9 +7055,9 @@ ], "support": { "issues": "https://github.com/php-http/discovery/issues", - "source": "https://github.com/php-http/discovery/tree/1.15.3" + "source": "https://github.com/php-http/discovery/tree/1.18.0" }, - "time": "2023-03-31T14:40:37+00:00" + "time": "2023-05-03T14:49:12+00:00" }, { "name": "php-http/httplug", @@ -7237,36 +7241,30 @@ }, { "name": "php-http/multipart-stream-builder", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/php-http/multipart-stream-builder.git", - "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e" + "reference": "f5938fd135d9fa442cc297dc98481805acfe2b6a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/11c1d31f72e01c738bbce9e27649a7cca829c30e", - "reference": "11c1d31f72e01c738bbce9e27649a7cca829c30e", + "url": "https://api.github.com/repos/php-http/multipart-stream-builder/zipball/f5938fd135d9fa442cc297dc98481805acfe2b6a", + "reference": "f5938fd135d9fa442cc297dc98481805acfe2b6a", "shasum": "" }, "require": { "php": "^7.1 || ^8.0", - "php-http/discovery": "^1.7", - "php-http/message-factory": "^1.0.2", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.0" + "php-http/discovery": "^1.15", + "psr/http-factory-implementation": "^1.0" }, "require-dev": { "nyholm/psr7": "^1.0", "php-http/message": "^1.5", + "php-http/message-factory": "^1.0.2", "phpunit/phpunit": "^7.5.15 || ^8.5 || ^9.3" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, "autoload": { "psr-4": { "Http\\Message\\MultipartStream\\": "src/" @@ -7293,9 +7291,9 @@ ], "support": { "issues": "https://github.com/php-http/multipart-stream-builder/issues", - "source": "https://github.com/php-http/multipart-stream-builder/tree/1.2.0" + "source": "https://github.com/php-http/multipart-stream-builder/tree/1.3.0" }, - "time": "2021-05-21T08:32:01+00:00" + "time": "2023-04-28T14:10:22+00:00" }, { "name": "php-http/promise", @@ -8295,23 +8293,23 @@ }, { "name": "react/promise", - "version": "v2.9.0", + "version": "v2.10.0", "source": { "type": "git", "url": "https://github.com/reactphp/promise.git", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910" + "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910", - "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910", + "url": "https://api.github.com/repos/reactphp/promise/zipball/f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", + "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38", "shasum": "" }, "require": { "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36" + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36" }, "type": "library", "autoload": { @@ -8355,19 +8353,15 @@ ], "support": { "issues": "https://github.com/reactphp/promise/issues", - "source": "https://github.com/reactphp/promise/tree/v2.9.0" + "source": "https://github.com/reactphp/promise/tree/v2.10.0" }, "funding": [ { - "url": "https://github.com/WyriHaximus", - "type": "github" - }, - { - "url": "https://github.com/clue", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-02-11T10:27:51+00:00" + "time": "2023-05-02T15:15:43+00:00" }, { "name": "rodneyrehm/plist", @@ -8492,16 +8486,16 @@ }, { "name": "spatie/db-dumper", - "version": "3.3.0", + "version": "3.3.1", "source": { "type": "git", "url": "https://github.com/spatie/db-dumper.git", - "reference": "129b8254b2c9f10881a754a692bd9507b09a1893" + "reference": "3b9fd47899bf6a59d3452392121c9ce675d55d34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/db-dumper/zipball/129b8254b2c9f10881a754a692bd9507b09a1893", - "reference": "129b8254b2c9f10881a754a692bd9507b09a1893", + "url": "https://api.github.com/repos/spatie/db-dumper/zipball/3b9fd47899bf6a59d3452392121c9ce675d55d34", + "reference": "3b9fd47899bf6a59d3452392121c9ce675d55d34", "shasum": "" }, "require": { @@ -8509,7 +8503,7 @@ "symfony/process": "^5.0|^6.0" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "pestphp/pest": "^1.22" }, "type": "library", "autoload": { @@ -8539,7 +8533,7 @@ "spatie" ], "support": { - "source": "https://github.com/spatie/db-dumper/tree/3.3.0" + "source": "https://github.com/spatie/db-dumper/tree/3.3.1" }, "funding": [ { @@ -8551,7 +8545,7 @@ "type": "github" } ], - "time": "2022-09-01T20:20:26+00:00" + "time": "2023-05-02T11:05:31+00:00" }, { "name": "spatie/image", @@ -9382,16 +9376,16 @@ }, { "name": "spatie/temporary-directory", - "version": "2.1.1", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/spatie/temporary-directory.git", - "reference": "e2818d871783d520b319c2d38dc37c10ecdcde20" + "reference": "0c804873f6b4042aa8836839dca683c7d0f71831" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/e2818d871783d520b319c2d38dc37c10ecdcde20", - "reference": "e2818d871783d520b319c2d38dc37c10ecdcde20", + "url": "https://api.github.com/repos/spatie/temporary-directory/zipball/0c804873f6b4042aa8836839dca683c7d0f71831", + "reference": "0c804873f6b4042aa8836839dca683c7d0f71831", "shasum": "" }, "require": { @@ -9427,7 +9421,7 @@ ], "support": { "issues": "https://github.com/spatie/temporary-directory/issues", - "source": "https://github.com/spatie/temporary-directory/tree/2.1.1" + "source": "https://github.com/spatie/temporary-directory/tree/2.1.2" }, "funding": [ { @@ -9439,7 +9433,7 @@ "type": "github" } ], - "time": "2022-08-23T07:15:15+00:00" + "time": "2023-04-28T07:47:42+00:00" }, { "name": "spomky-labs/base64url", @@ -9764,16 +9758,16 @@ }, { "name": "symfony/cache", - "version": "v6.2.8", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "76babfd82f6bfd8f6cbe851a153b95dd074ffc53" + "reference": "1ce7ed8e7ca6948892b6a3a52bb60cf2b04f7c94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/76babfd82f6bfd8f6cbe851a153b95dd074ffc53", - "reference": "76babfd82f6bfd8f6cbe851a153b95dd074ffc53", + "url": "https://api.github.com/repos/symfony/cache/zipball/1ce7ed8e7ca6948892b6a3a52bb60cf2b04f7c94", + "reference": "1ce7ed8e7ca6948892b6a3a52bb60cf2b04f7c94", "shasum": "" }, "require": { @@ -9782,7 +9776,7 @@ "psr/log": "^1.1|^2|^3", "symfony/cache-contracts": "^1.1.7|^2|^3", "symfony/service-contracts": "^1.1|^2|^3", - "symfony/var-exporter": "^6.2.7" + "symfony/var-exporter": "^6.2.10" }, "conflict": { "doctrine/dbal": "<2.13.1", @@ -9840,7 +9834,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v6.2.8" + "source": "https://github.com/symfony/cache/tree/v6.2.10" }, "funding": [ { @@ -9856,7 +9850,7 @@ "type": "tidelift" } ], - "time": "2023-03-30T07:37:32+00:00" + "time": "2023-04-21T15:42:15+00:00" }, { "name": "symfony/cache-contracts", @@ -9939,16 +9933,16 @@ }, { "name": "symfony/console", - "version": "v5.4.22", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "3cd51fd2e6c461ca678f84d419461281bd87a0a8" + "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/3cd51fd2e6c461ca678f84d419461281bd87a0a8", - "reference": "3cd51fd2e6c461ca678f84d419461281bd87a0a8", + "url": "https://api.github.com/repos/symfony/console/zipball/90f21e27d0d88ce38720556dd164d4a1e4c3934c", + "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c", "shasum": "" }, "require": { @@ -10018,7 +10012,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.22" + "source": "https://github.com/symfony/console/tree/v5.4.23" }, "funding": [ { @@ -10034,7 +10028,7 @@ "type": "tidelift" } ], - "time": "2023-03-25T09:27:28+00:00" + "time": "2023-04-24T18:47:29+00:00" }, { "name": "symfony/css-selector", @@ -10170,16 +10164,16 @@ }, { "name": "symfony/error-handler", - "version": "v5.4.21", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/error-handler.git", - "reference": "56a94aa8cb5a5fbc411551d8d014a296b5456549" + "reference": "218206b4772d9f412d7d277980c020d06e9d8a4e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/error-handler/zipball/56a94aa8cb5a5fbc411551d8d014a296b5456549", - "reference": "56a94aa8cb5a5fbc411551d8d014a296b5456549", + "url": "https://api.github.com/repos/symfony/error-handler/zipball/218206b4772d9f412d7d277980c020d06e9d8a4e", + "reference": "218206b4772d9f412d7d277980c020d06e9d8a4e", "shasum": "" }, "require": { @@ -10221,7 +10215,7 @@ "description": "Provides tools to manage errors and ease debugging PHP code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/error-handler/tree/v5.4.21" + "source": "https://github.com/symfony/error-handler/tree/v5.4.23" }, "funding": [ { @@ -10237,7 +10231,7 @@ "type": "tidelift" } ], - "time": "2023-02-14T08:03:56+00:00" + "time": "2023-04-17T10:03:27+00:00" }, { "name": "symfony/event-dispatcher", @@ -10466,16 +10460,16 @@ }, { "name": "symfony/http-client", - "version": "v6.2.9", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "7daf5d24c21a683164688b95bb73b7a4bd3b32fc" + "reference": "3f5545a91c8e79dedd1a06c4b04e1682c80c42f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/7daf5d24c21a683164688b95bb73b7a4bd3b32fc", - "reference": "7daf5d24c21a683164688b95bb73b7a4bd3b32fc", + "url": "https://api.github.com/repos/symfony/http-client/zipball/3f5545a91c8e79dedd1a06c4b04e1682c80c42f9", + "reference": "3f5545a91c8e79dedd1a06c4b04e1682c80c42f9", "shasum": "" }, "require": { @@ -10534,7 +10528,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v6.2.9" + "source": "https://github.com/symfony/http-client/tree/v6.2.10" }, "funding": [ { @@ -10550,7 +10544,7 @@ "type": "tidelift" } ], - "time": "2023-04-11T16:03:19+00:00" + "time": "2023-04-20T13:12:48+00:00" }, { "name": "symfony/http-client-contracts", @@ -10635,16 +10629,16 @@ }, { "name": "symfony/http-foundation", - "version": "v5.4.22", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "05cd1acdd0e3ce8473aaba1d86c188321d85f313" + "reference": "af9fbb378f5f956c8f29d4886644c84c193780ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/05cd1acdd0e3ce8473aaba1d86c188321d85f313", - "reference": "05cd1acdd0e3ce8473aaba1d86c188321d85f313", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/af9fbb378f5f956c8f29d4886644c84c193780ac", + "reference": "af9fbb378f5f956c8f29d4886644c84c193780ac", "shasum": "" }, "require": { @@ -10691,7 +10685,7 @@ "description": "Defines an object-oriented layer for the HTTP specification", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-foundation/tree/v5.4.22" + "source": "https://github.com/symfony/http-foundation/tree/v5.4.23" }, "funding": [ { @@ -10707,20 +10701,20 @@ "type": "tidelift" } ], - "time": "2023-03-28T07:28:17+00:00" + "time": "2023-04-18T06:30:11+00:00" }, { "name": "symfony/http-kernel", - "version": "v5.4.22", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "2d3a8be2c756353627398827c409af6f126c096d" + "reference": "48ea17a7c65ef1ede0c3b2dbc35adace99071810" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/2d3a8be2c756353627398827c409af6f126c096d", - "reference": "2d3a8be2c756353627398827c409af6f126c096d", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/48ea17a7c65ef1ede0c3b2dbc35adace99071810", + "reference": "48ea17a7c65ef1ede0c3b2dbc35adace99071810", "shasum": "" }, "require": { @@ -10803,7 +10797,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v5.4.22" + "source": "https://github.com/symfony/http-kernel/tree/v5.4.23" }, "funding": [ { @@ -10819,20 +10813,20 @@ "type": "tidelift" } ], - "time": "2023-03-31T11:54:37+00:00" + "time": "2023-04-28T13:29:52+00:00" }, { "name": "symfony/mime", - "version": "v5.4.21", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "ef57d9fb9cdd5e6b2ffc567d109865d10b6920cd" + "reference": "ae0a1032a450a3abf305ee44fc55ed423fbf16e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/ef57d9fb9cdd5e6b2ffc567d109865d10b6920cd", - "reference": "ef57d9fb9cdd5e6b2ffc567d109865d10b6920cd", + "url": "https://api.github.com/repos/symfony/mime/zipball/ae0a1032a450a3abf305ee44fc55ed423fbf16e3", + "reference": "ae0a1032a450a3abf305ee44fc55ed423fbf16e3", "shasum": "" }, "require": { @@ -10887,7 +10881,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v5.4.21" + "source": "https://github.com/symfony/mime/tree/v5.4.23" }, "funding": [ { @@ -10903,7 +10897,7 @@ "type": "tidelift" } ], - "time": "2023-02-21T19:46:44+00:00" + "time": "2023-04-19T09:49:13+00:00" }, { "name": "symfony/options-resolver", @@ -11712,16 +11706,16 @@ }, { "name": "symfony/process", - "version": "v5.4.22", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "4b850da0cc3a2a9181c1ed407adbca4733dc839b" + "reference": "4b842fc4b61609e0a155a114082bd94e31e98287" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4b850da0cc3a2a9181c1ed407adbca4733dc839b", - "reference": "4b850da0cc3a2a9181c1ed407adbca4733dc839b", + "url": "https://api.github.com/repos/symfony/process/zipball/4b842fc4b61609e0a155a114082bd94e31e98287", + "reference": "4b842fc4b61609e0a155a114082bd94e31e98287", "shasum": "" }, "require": { @@ -11754,7 +11748,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v5.4.22" + "source": "https://github.com/symfony/process/tree/v5.4.23" }, "funding": [ { @@ -11770,7 +11764,7 @@ "type": "tidelift" } ], - "time": "2023-03-06T21:29:33+00:00" + "time": "2023-04-18T13:50:24+00:00" }, { "name": "symfony/routing", @@ -11864,16 +11858,16 @@ }, { "name": "symfony/serializer", - "version": "v6.2.8", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/serializer.git", - "reference": "db9d36470bf0990990fda9320b8b001bb582f075" + "reference": "0732edf0ad28dd3faacde4f1200ab9d7a4d5f40d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/serializer/zipball/db9d36470bf0990990fda9320b8b001bb582f075", - "reference": "db9d36470bf0990990fda9320b8b001bb582f075", + "url": "https://api.github.com/repos/symfony/serializer/zipball/0732edf0ad28dd3faacde4f1200ab9d7a4d5f40d", + "reference": "0732edf0ad28dd3faacde4f1200ab9d7a4d5f40d", "shasum": "" }, "require": { @@ -11945,7 +11939,7 @@ "description": "Handles serializing and deserializing data structures, including object graphs, into array structures or other formats like XML and JSON.", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/serializer/tree/v6.2.8" + "source": "https://github.com/symfony/serializer/tree/v6.2.10" }, "funding": [ { @@ -11961,7 +11955,7 @@ "type": "tidelift" } ], - "time": "2023-03-31T09:14:44+00:00" + "time": "2023-04-18T13:57:49+00:00" }, { "name": "symfony/service-contracts", @@ -12313,16 +12307,16 @@ }, { "name": "symfony/var-dumper", - "version": "v5.4.22", + "version": "v5.4.23", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "e2edac9ce47e6df07e38143c7cfa6bdbc1a6dcc4" + "reference": "9a8a5b6d6508928174ded2109e29328a55342a42" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e2edac9ce47e6df07e38143c7cfa6bdbc1a6dcc4", - "reference": "e2edac9ce47e6df07e38143c7cfa6bdbc1a6dcc4", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/9a8a5b6d6508928174ded2109e29328a55342a42", + "reference": "9a8a5b6d6508928174ded2109e29328a55342a42", "shasum": "" }, "require": { @@ -12382,7 +12376,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v5.4.22" + "source": "https://github.com/symfony/var-dumper/tree/v5.4.23" }, "funding": [ { @@ -12398,20 +12392,20 @@ "type": "tidelift" } ], - "time": "2023-03-25T09:27:28+00:00" + "time": "2023-04-18T09:26:27+00:00" }, { "name": "symfony/var-exporter", - "version": "v6.2.8", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "8302bb670204500d492c6b8c595ee9a27da62cd6" + "reference": "9a07920c2058bafee921ce4d90aeef2193837d63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/8302bb670204500d492c6b8c595ee9a27da62cd6", - "reference": "8302bb670204500d492c6b8c595ee9a27da62cd6", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/9a07920c2058bafee921ce4d90aeef2193837d63", + "reference": "9a07920c2058bafee921ce4d90aeef2193837d63", "shasum": "" }, "require": { @@ -12456,7 +12450,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v6.2.8" + "source": "https://github.com/symfony/var-exporter/tree/v6.2.10" }, "funding": [ { @@ -12472,20 +12466,20 @@ "type": "tidelift" } ], - "time": "2023-03-14T15:48:45+00:00" + "time": "2023-04-21T08:33:05+00:00" }, { "name": "symfony/yaml", - "version": "v6.2.7", + "version": "v6.2.10", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e8e6a1d59e050525f27a1f530aa9703423cb7f57" + "reference": "61916f3861b1e9705b18cfde723921a71dd1559d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e8e6a1d59e050525f27a1f530aa9703423cb7f57", - "reference": "e8e6a1d59e050525f27a1f530aa9703423cb7f57", + "url": "https://api.github.com/repos/symfony/yaml/zipball/61916f3861b1e9705b18cfde723921a71dd1559d", + "reference": "61916f3861b1e9705b18cfde723921a71dd1559d", "shasum": "" }, "require": { @@ -12530,7 +12524,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v6.2.7" + "source": "https://github.com/symfony/yaml/tree/v6.2.10" }, "funding": [ { @@ -12546,7 +12540,7 @@ "type": "tidelift" } ], - "time": "2023-02-16T09:57:23+00:00" + "time": "2023-04-28T13:25:36+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -14587,16 +14581,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.20.2", + "version": "1.20.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "90490bd8fd8530a272043c4950c180b6d0cf5f81" + "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/90490bd8fd8530a272043c4950c180b6d0cf5f81", - "reference": "90490bd8fd8530a272043c4950c180b6d0cf5f81", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", + "reference": "7d568c87a9df9c5f7e8b5f075fc469aa8cb0a4cd", "shasum": "" }, "require": { @@ -14626,9 +14620,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.20.2" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.20.4" }, - "time": "2023-04-22T12:59:35+00:00" + "time": "2023-05-02T09:19:37+00:00" }, { "name": "phpunit/php-code-coverage", @@ -15026,16 +15020,16 @@ }, { "name": "psy/psysh", - "version": "v0.11.15", + "version": "v0.11.16", "source": { "type": "git", "url": "https://github.com/bobthecow/psysh.git", - "reference": "5350ce0ec8ecf2c5b5cf554cd2496f97b444af85" + "reference": "151b145906804eea8e5d71fea23bfb470c904bfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/5350ce0ec8ecf2c5b5cf554cd2496f97b444af85", - "reference": "5350ce0ec8ecf2c5b5cf554cd2496f97b444af85", + "url": "https://api.github.com/repos/bobthecow/psysh/zipball/151b145906804eea8e5d71fea23bfb470c904bfb", + "reference": "151b145906804eea8e5d71fea23bfb470c904bfb", "shasum": "" }, "require": { @@ -15096,9 +15090,9 @@ ], "support": { "issues": "https://github.com/bobthecow/psysh/issues", - "source": "https://github.com/bobthecow/psysh/tree/v0.11.15" + "source": "https://github.com/bobthecow/psysh/tree/v0.11.16" }, - "time": "2023-04-07T21:57:09+00:00" + "time": "2023-04-26T12:53:57+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", -- 2.39.5