1<?php
2
3/**
4 * Plugin barcode: 2D-Barcode Implementation
5 *
6 * @author Enrico Croce & Simona Burzio (staff@eiroca.net)
7 * @copyright Copyright (C) 2009-2019 eIrOcA - Enrico Croce & Simona Burzio
8 * @license GPL >=3 (http://www.gnu.org/licenses/)
9 * @version 19.02
10 * @link http://www.eiroca.net
11 */
12class QR_kawa extends QRProvider {
13
14  // http://qrcode.kaywa.com/
15  function render(&$p) {
16    $first = true;
17    $size = $p['size'];
18    $text = $p['text'];
19    $resultStr = 'http://qrcode.kaywa.com/img.php?';
20    switch ($size) {
21      case 'S' :
22        $resultStr .= $this->addParam($first, 's=4');
23        break;
24      case 'M' :
25        $resultStr .= $this->addParam($first, 's=6');
26        break;
27      case 'L' :
28        $resultStr .= $this->addParam($first, 's=8');
29        break;
30      case 'XL' :
31        $resultStr .= $this->addParam($first, 's=10');
32        break;
33      default :
34        $resultStr .= $this->addParam($first, 's=15');
35        break;
36    }
37    $resultStr .= $this->addParam($first, 'd=' . urlencode($text));
38    return $this->_IMG($resultStr, $p['id'], $p['class']);
39  }
40
41}
42?>