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_inigma extends QRProvider {
13
14  // http://encode.i-nigma.com/
15  function render(&$p) {
16    $first = true;
17    if ($p['mode'] == 1) {
18      $mode = 'DMtrx';
19    }
20    else {
21      $mode = 'QRCode';
22    }
23    $size = $p['size'];
24    $text = $p['text'];
25    $caption = $p['caption'];
26    $resultStr = 'http://encode.i-nigma.com/' . $mode . '/img.php?';
27    if ($caption) {
28      $resultStr .= $this->addParam($first, 'c=' . $caption);
29    }
30    switch ($size) {
31      case 'S' :
32        $resultStr .= $this->addParam($first, 's=3');
33        break;
34      case 'M' :
35        $resultStr .= $this->addParam($first, 's=4');
36        break;
37      case 'L' :
38        $resultStr .= $this->addParam($first, 's=5');
39        break;
40      case 'XL' :
41        $resultStr .= $this->addParam($first, 's=6');
42        break;
43      default :
44        $resultStr .= $this->addParam($first, 's=4');
45        break;
46    }
47    $resultStr .= $this->addParam($first, 'd=' . urlencode($text));
48    return $this->_IMG($resultStr, $p['id'], $p['class']);
49  }
50
51}
52?>