Skip to content

Commit

Permalink
v1.0.13
Browse files Browse the repository at this point in the history
  • Loading branch information
romaincazier committed Mar 3, 2022
1 parent 5342ebc commit 21932c2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions FieldtypeQRCode.module
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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("<img", "<img alt=\"$text\"", $qr);
$qrcodes[] = [
"label" => "URL",
"qr" => $qr,
Expand All @@ -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("<img", "<img alt=\"$text\"", $qr);
$qrcodes[] = [
"label" => "Admin URL",
"qr" => $qr,
Expand All @@ -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("<img", "<img alt=\"$f\"", $qr);
$qrcodes[] = [
"label" => $label,
"qr" => $qr,
Expand All @@ -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("<img", "<img alt=\"$text\"", $qr);
$qrcodes[] = [
"label" => "{$label}: {$p->title}",
"qr" => $qr,
Expand All @@ -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("<img", "<img alt=\"$text\"", $qr);
$qrcodes[] = [
"label" => "{$label}: {$file->basename()}",
"qr" => $qr,
Expand Down Expand Up @@ -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("<img", "<img alt=\"$text\"", $qr);
$qrcodes[] = [
"label" => $l,
"qr" => $qr,
Expand Down Expand Up @@ -277,7 +283,7 @@ class FieldtypeQRCode extends Fieldtype {
if($svg && $markup) {
$qr = str_replace("svg\">", "svg\"><title>$text</title>", $data);
} else {
$qr = "<img src=\"$data\" alt=\"$text\" />";
$qr = "<img src=\"$data\" />";
}

return $qr;
Expand Down

0 comments on commit 21932c2

Please sign in to comment.