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:
johnnyq
2026-11-19 00:37:07 -05:00
parent ac4880c3be
commit 527a1c5dd2
40 changed files with 377 additions and 6337 deletions

View File

@@ -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. */