mirror of
https://github.com/itflow-org/itflow
synced 2026-11-25 22:07:26 +00:00
Remove five bundled libraries: drop unused DataTables, zapcal and clipboard.js, make QR codes with TCPDF instead of libs/barcode, and replace IMask with own IP and MAC field code that leaves non-MAC text alone
This commit is contained in:
@@ -202,16 +202,9 @@ function shareUrl($item_id, $secret) {
|
||||
return "https://$config_base_url/guest/share.php?id=" . intval($item_id) . "#$secret";
|
||||
}
|
||||
|
||||
/** A QR code of the link, as inline SVG - '' without GD, which libs/barcode needs. */
|
||||
/** A QR code of the link, as inline SVG. */
|
||||
function shareQrSvg($url) {
|
||||
if (!extension_loaded('gd')) {
|
||||
return '';
|
||||
}
|
||||
require_once dirname(__DIR__) . '/libs/barcode/barcode.php';
|
||||
$generator = new barcode_generator();
|
||||
$svg = (string) $generator->render_svg('qr', $url, ['w' => 180, 'h' => 180, 'p' => 0]);
|
||||
$svg = preg_replace('/^<\?xml[^>]*>\s*/', '', $svg);
|
||||
return preg_replace('/<svg /', '<svg class="itflow-share-qr" role="img" aria-label="QR code of the link" ', $svg, 1);
|
||||
return qrCodeSvg($url, 'class="itflow-share-qr" role="img" aria-label="QR code of the link"');
|
||||
}
|
||||
|
||||
/** One link by id, with who made it and the client - raw, or null. */
|
||||
|
||||
Reference in New Issue
Block a user