From 21932c25001db2c92bd883e96bc11ae0d5d0d9ae Mon Sep 17 00:00:00 2001 From: Romain Cazier Date: Thu, 3 Mar 2022 16:46:54 +0100 Subject: [PATCH] v1.0.13 --- FieldtypeQRCode.module | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/FieldtypeQRCode.module b/FieldtypeQRCode.module index c47f7ee..f87fe4f 100644 --- a/FieldtypeQRCode.module +++ b/FieldtypeQRCode.module @@ -40,7 +40,7 @@ class FieldtypeQRCode extends Fieldtype { return [ "title" => "QR Code", "author" => "Romain Cazier", - "version" => "1.0.12", + "version" => "1.0.13", "summary" => "Generates a QR code from the public URL of the page (and more)", "href" => "https://github.com/romaincazier/FieldtypeQRCode", "icon" => "qrcode", @@ -127,6 +127,7 @@ class FieldtypeQRCode extends Fieldtype { $text = $this->getQRText($page); $raw = $this->generateRawQRCode($text, $this->svg, $this->markup); $qr = $this->generateQRCode($raw, $this->svg, $this->markup); + $qr = str_replace(" "URL", "qr" => $qr, @@ -139,6 +140,7 @@ class FieldtypeQRCode extends Fieldtype { $text = $this->getQRText($page, true); $raw = $this->generateRawQRCode($text, $this->svg, $this->markup); $qr = $this->generateQRCode($raw, $this->svg, $this->markup); + $qr = str_replace(" "Admin URL", "qr" => $qr, @@ -151,6 +153,7 @@ class FieldtypeQRCode extends Fieldtype { if(is_string($f)) { $raw = $this->generateRawQRCode($f, $this->svg, $this->markup); $qr = $this->generateQRCode($raw, $this->svg, $this->markup); + $qr = str_replace(" $label, "qr" => $qr, @@ -172,6 +175,7 @@ class FieldtypeQRCode extends Fieldtype { $text = $this->getQRText($p); $raw = $this->generateRawQRCode($text, $this->svg, $this->markup); $qr = $this->generateQRCode($raw, $this->svg, $this->markup); + $qr = str_replace(" "{$label}: {$p->title}", "qr" => $qr, @@ -186,6 +190,7 @@ class FieldtypeQRCode extends Fieldtype { $text = $this->getQRText($file); $raw = $this->generateRawQRCode($text, $this->svg, $this->markup); $qr = $this->generateQRCode($raw, $this->svg, $this->markup); + $qr = str_replace(" "{$label}: {$file->basename()}", "qr" => $qr, @@ -246,6 +251,7 @@ class FieldtypeQRCode extends Fieldtype { } $raw = $this->generateRawQRCode($text, $this->svg, $this->markup); $qr = $this->generateQRCode($raw, $this->svg, $this->markup); + $qr = str_replace(" $l, "qr" => $qr, @@ -277,7 +283,7 @@ class FieldtypeQRCode extends Fieldtype { if($svg && $markup) { $qr = str_replace("svg\">", "svg\">$text", $data); } else { - $qr = "\"$text\""; + $qr = ""; } return $qr;