diff --git a/.gitignore b/.gitignore
index cd531cf..33897d2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,54 +1,5 @@
-# ---> C
-# Prerequisites
-*.d
-
-# Object files
-*.o
-*.ko
-*.obj
-*.elf
-
-# Linker output
-*.ilk
-*.map
-*.exp
-
-# Precompiled Headers
-*.gch
-*.pch
-
-# Libraries
-*.lib
-*.a
-*.la
-*.lo
-
-# Shared objects (inc. Windows DLLs)
-*.dll
-*.so
-*.so.*
-*.dylib
-
-# Executables
-*.exe
-*.out
-*.app
-*.i*86
-*.x86_64
-*.hex
-
-# Debug files
-*.dSYM/
-*.su
-*.idb
-*.pdb
-
-# Kernel Module Compile Results
-*.mod*
-*.cmd
-.tmp_versions/
-modules.order
-Module.symvers
-Mkfile.old
-dkms.conf
+# ---> php
+*~
+templates_c/*
+cache/*
diff --git a/css/leinelab.css b/css/leinelab.css
new file mode 100644
index 0000000..9af036e
--- /dev/null
+++ b/css/leinelab.css
@@ -0,0 +1,8 @@
+/**
+ * some special settings for better display
+ */
+main {
+ display: block;
+ margin: auto 20px;
+}
+
diff --git a/css/leinelab.css~ b/css/leinelab.css~
new file mode 100644
index 0000000..e69de29
diff --git a/css/picnic.min.css b/css/picnic.min.css
new file mode 100644
index 0000000..04a4557
--- /dev/null
+++ b/css/picnic.min.css
@@ -0,0 +1 @@
+html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:0;padding:0}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}*{box-sizing:inherit}html,body{font-family:Arial, Helvetica, sans-serif;box-sizing:border-box;height:100%}body{color:#111;font-size:1.1em;line-height:1.5;background:#fff}main{display:block}h1,h2,h3,h4,h5,h6{margin:0;padding:.6em 0}li{margin:0 0 .3em}a{color:#0074d9;text-decoration:none;box-shadow:none;transition:all 0.3s}code{padding:.3em .6em;font-size:.8em;background:#f5f5f5}pre{text-align:left;padding:.3em .6em;background:#f5f5f5;border-radius:.2em}pre code{padding:0}blockquote{padding:0 0 0 1em;margin:0 0 0 .1em;box-shadow:inset 5px 0 rgba(17,17,17,0.3)}label{cursor:pointer}[class^="icon-"]:before,[class*=" icon-"]:before{margin:0 .6em 0 0}i[class^="icon-"]:before,i[class*=" icon-"]:before{margin:0}.label,[data-tooltip]:after,button,.button,[type=submit],.dropimage{display:inline-block;text-align:center;letter-spacing:inherit;margin:0;padding:.3em .9em;vertical-align:middle;background:#0074d9;color:#fff;border:0;border-radius:.2em;width:auto;-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.success.label,.success[data-tooltip]:after,button.success,.success.button,.success[type=submit],.success.dropimage{background:#2ecc40}.warning.label,.warning[data-tooltip]:after,button.warning,.warning.button,.warning[type=submit],.warning.dropimage{background:#ff851b}.error.label,.error[data-tooltip]:after,button.error,.error.button,.error[type=submit],.error.dropimage{background:#ff4136}.pseudo.label,.pseudo[data-tooltip]:after,button.pseudo,.pseudo.button,.pseudo[type=submit],.pseudo.dropimage{background-color:transparent;color:inherit}.label,[data-tooltip]:after{font-size:.6em;padding:.4em .6em;margin-left:1em;line-height:1}button,.button,[type=submit],.dropimage{margin:.3em 0;cursor:pointer;transition:all 0.3s;border-radius:.2em;height:auto;vertical-align:baseline;box-shadow:0 0 rgba(0,0,0,0) inset}button:hover,.button:hover,:hover[type=submit],.dropimage:hover,button:focus,.button:focus,:focus[type=submit],.dropimage:focus{box-shadow:inset 0 0 0 99em rgba(255,255,255,0.2);border:0}button.pseudo:hover,.pseudo.button:hover,.pseudo:hover[type=submit],.pseudo.dropimage:hover,button.pseudo:focus,.pseudo.button:focus,.pseudo:focus[type=submit],.pseudo.dropimage:focus{box-shadow:inset 0 0 0 99em rgba(17,17,17,0.1)}button.active,.active.button,.active[type=submit],.active.dropimage,button:active,.button:active,:active[type=submit],.dropimage:active,button.pseudo:active,.pseudo.button:active,.pseudo:active[type=submit],.pseudo.dropimage:active{box-shadow:inset 0 0 0 99em rgba(17,17,17,0.2)}button[disabled],.button[disabled],[disabled][type=submit],.dropimage[disabled]{cursor:default;box-shadow:none;background:#bbb}:checked+.toggle,:checked+.toggle:hover{box-shadow:inset 0 0 0 99em rgba(17,17,17,0.2)}[type]+.toggle{padding:.3em .9em;margin-right:0}[type]+.toggle:after,[type]+.toggle:before{display:none}input,textarea,.select select{line-height:1.5;margin:0;height:2.1em;padding:.3em .6em;border:1px solid #ccc;background-color:#fff;border-radius:.2em;transition:all 0.3s;width:100%}input:focus,textarea:focus,.select select:focus{border:1px solid #0074d9;outline:0}textarea{height:auto}[type=file],[type=color]{cursor:pointer}[type=file]{height:auto}select{background:#fff url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyIiBoZWlnaHQ9IjMiPjxwYXRoIGQ9Im0gMCwxIDEsMiAxLC0yIHoiLz48L3N2Zz4=) no-repeat scroll 95% center/10px 15px;background-position:calc(100% - 15px) center;border:1px solid #ccc;border-radius:.2em;cursor:pointer;width:100%;height:2.2em;box-sizing:border-box;padding:.3em .45em;transition:all 0.3s;-moz-appearance:none;-webkit-appearance:none;appearance:none}select::-ms-expand{display:none}select:focus,select:active{border:1px solid #0074d9;transition:outline 0s}select:-moz-focusring{color:transparent;text-shadow:0 0 0 #111}select option{font-size:inherit;padding:.45em}select[multiple]{height:auto;background:none;padding:0}[type=radio],[type=checkbox]{opacity:0;width:0;position:absolute;display:inline-block}[type=radio]+.checkable:hover:before,[type=checkbox]+.checkable:hover:before,:focus[type=radio]+.checkable:before,:focus[type=checkbox]+.checkable:before{border:1px solid #0074d9}[type=radio]+.checkable,[type=checkbox]+.checkable{position:relative;cursor:pointer;padding-left:1.5em;margin-right:.6em}[type=radio]+.checkable:before,[type=checkbox]+.checkable:before,[type=radio]+.checkable:after,[type=checkbox]+.checkable:after{content:'';position:absolute;display:inline-block;left:0;top:50%;transform:translateY(-50%);font-size:1em;line-height:1em;color:transparent;font-family:sans;text-align:center;box-sizing:border-box;width:1em;height:1em;border-radius:50%;transition:all 0.3s}[type=radio]+.checkable:before,[type=checkbox]+.checkable:before{border:1px solid #aaa}:checked[type=radio]+.checkable:after,:checked[type=checkbox]+.checkable:after{background:#555;transform:scale(0.5) translateY(-100%)}[type=checkbox]+.checkable:before{border-radius:.2em}[type=checkbox]+.checkable:after{content:"✔";background:none;transform:scale(2) translateY(-25%);visibility:hidden;opacity:0}:checked[type=checkbox]+.checkable:after{color:#111;background:none;transform:translateY(-50%);transition:all 0.3s;visibility:visible;opacity:1}table{text-align:left}td,th{padding:.3em 2.4em .3em .6em}th{text-align:left;font-weight:900;color:#fff;background-color:#0074d9}.success th{background-color:#2ecc40}.warning th{background-color:#ff851b}.error th{background-color:#ff4136}.dull th{background-color:#aaa}tr:nth-child(even){background:rgba(0,0,0,0.05)}.flex{display:-ms-flexbox;display:flex;margin-left:-.6em;width:calc(100% + .6em);flex-wrap:wrap;transition:all .3s ease}.flex>*{box-sizing:border-box;flex:1 1 auto;padding-left:.6em;padding-bottom:.6em}.flex[class*="one"]>*,.flex[class*="two"]>*,.flex[class*="three"]>*,.flex[class*="four"]>*,.flex[class*="five"]>*,.flex[class*="six"]>*,.flex[class*="seven"]>*,.flex[class*="eight"]>*,.flex[class*="nine"]>*,.flex[class*="ten"]>*,.flex[class*="eleven"]>*,.flex[class*="twelve"]>*{flex-grow:0}.flex.grow>*{flex-grow:1}.center{justify-content:center}.one>*{width:100%}.two>*{width:50%}.three>*{width:33.33333%}.four>*{width:25%}.five>*{width:20%}.six>*{width:16.66666%}.seven>*{width:14.28571%}.eight>*{width:12.5%}.nine>*{width:11.11111%}.ten>*{width:10%}.eleven>*{width:9.09091%}.twelve>*{width:8.33333%}@media all and (min-width: 500px){.one-500>*{width:100%}.two-500>*{width:50%}.three-500>*{width:33.33333%}.four-500>*{width:25%}.five-500>*{width:20%}.six-500>*{width:16.66666%}.seven-500>*{width:14.28571%}.eight-500>*{width:12.5%}.nine-500>*{width:11.11111%}.ten-500>*{width:10%}.eleven-500>*{width:9.09091%}.twelve-500>*{width:8.33333%}}@media all and (min-width: 600px){.one-600>*{width:100%}.two-600>*{width:50%}.three-600>*{width:33.33333%}.four-600>*{width:25%}.five-600>*{width:20%}.six-600>*{width:16.66666%}.seven-600>*{width:14.28571%}.eight-600>*{width:12.5%}.nine-600>*{width:11.11111%}.ten-600>*{width:10%}.eleven-600>*{width:9.09091%}.twelve-600>*{width:8.33333%}}@media all and (min-width: 700px){.one-700>*{width:100%}.two-700>*{width:50%}.three-700>*{width:33.33333%}.four-700>*{width:25%}.five-700>*{width:20%}.six-700>*{width:16.66666%}.seven-700>*{width:14.28571%}.eight-700>*{width:12.5%}.nine-700>*{width:11.11111%}.ten-700>*{width:10%}.eleven-700>*{width:9.09091%}.twelve-700>*{width:8.33333%}}@media all and (min-width: 800px){.one-800>*{width:100%}.two-800>*{width:50%}.three-800>*{width:33.33333%}.four-800>*{width:25%}.five-800>*{width:20%}.six-800>*{width:16.66666%}.seven-800>*{width:14.28571%}.eight-800>*{width:12.5%}.nine-800>*{width:11.11111%}.ten-800>*{width:10%}.eleven-800>*{width:9.09091%}.twelve-800>*{width:8.33333%}}@media all and (min-width: 900px){.one-900>*{width:100%}.two-900>*{width:50%}.three-900>*{width:33.33333%}.four-900>*{width:25%}.five-900>*{width:20%}.six-900>*{width:16.66666%}.seven-900>*{width:14.28571%}.eight-900>*{width:12.5%}.nine-900>*{width:11.11111%}.ten-900>*{width:10%}.eleven-900>*{width:9.09091%}.twelve-900>*{width:8.33333%}}@media all and (min-width: 1000px){.one-1000>*{width:100%}.two-1000>*{width:50%}.three-1000>*{width:33.33333%}.four-1000>*{width:25%}.five-1000>*{width:20%}.six-1000>*{width:16.66666%}.seven-1000>*{width:14.28571%}.eight-1000>*{width:12.5%}.nine-1000>*{width:11.11111%}.ten-1000>*{width:10%}.eleven-1000>*{width:9.09091%}.twelve-1000>*{width:8.33333%}}@media all and (min-width: 1100px){.one-1100>*{width:100%}.two-1100>*{width:50%}.three-1100>*{width:33.33333%}.four-1100>*{width:25%}.five-1100>*{width:20%}.six-1100>*{width:16.66666%}.seven-1100>*{width:14.28571%}.eight-1100>*{width:12.5%}.nine-1100>*{width:11.11111%}.ten-1100>*{width:10%}.eleven-1100>*{width:9.09091%}.twelve-1100>*{width:8.33333%}}@media all and (min-width: 1200px){.one-1200>*{width:100%}.two-1200>*{width:50%}.three-1200>*{width:33.33333%}.four-1200>*{width:25%}.five-1200>*{width:20%}.six-1200>*{width:16.66666%}.seven-1200>*{width:14.28571%}.eight-1200>*{width:12.5%}.nine-1200>*{width:11.11111%}.ten-1200>*{width:10%}.eleven-1200>*{width:9.09091%}.twelve-1200>*{width:8.33333%}}@media all and (min-width: 1300px){.one-1300>*{width:100%}.two-1300>*{width:50%}.three-1300>*{width:33.33333%}.four-1300>*{width:25%}.five-1300>*{width:20%}.six-1300>*{width:16.66666%}.seven-1300>*{width:14.28571%}.eight-1300>*{width:12.5%}.nine-1300>*{width:11.11111%}.ten-1300>*{width:10%}.eleven-1300>*{width:9.09091%}.twelve-1300>*{width:8.33333%}}@media all and (min-width: 1400px){.one-1400>*{width:100%}.two-1400>*{width:50%}.three-1400>*{width:33.33333%}.four-1400>*{width:25%}.five-1400>*{width:20%}.six-1400>*{width:16.66666%}.seven-1400>*{width:14.28571%}.eight-1400>*{width:12.5%}.nine-1400>*{width:11.11111%}.ten-1400>*{width:10%}.eleven-1400>*{width:9.09091%}.twelve-1400>*{width:8.33333%}}@media all and (min-width: 1500px){.one-1500>*{width:100%}.two-1500>*{width:50%}.three-1500>*{width:33.33333%}.four-1500>*{width:25%}.five-1500>*{width:20%}.six-1500>*{width:16.66666%}.seven-1500>*{width:14.28571%}.eight-1500>*{width:12.5%}.nine-1500>*{width:11.11111%}.ten-1500>*{width:10%}.eleven-1500>*{width:9.09091%}.twelve-1500>*{width:8.33333%}}@media all and (min-width: 1600px){.one-1600>*{width:100%}.two-1600>*{width:50%}.three-1600>*{width:33.33333%}.four-1600>*{width:25%}.five-1600>*{width:20%}.six-1600>*{width:16.66666%}.seven-1600>*{width:14.28571%}.eight-1600>*{width:12.5%}.nine-1600>*{width:11.11111%}.ten-1600>*{width:10%}.eleven-1600>*{width:9.09091%}.twelve-1600>*{width:8.33333%}}@media all and (min-width: 1700px){.one-1700>*{width:100%}.two-1700>*{width:50%}.three-1700>*{width:33.33333%}.four-1700>*{width:25%}.five-1700>*{width:20%}.six-1700>*{width:16.66666%}.seven-1700>*{width:14.28571%}.eight-1700>*{width:12.5%}.nine-1700>*{width:11.11111%}.ten-1700>*{width:10%}.eleven-1700>*{width:9.09091%}.twelve-1700>*{width:8.33333%}}@media all and (min-width: 1800px){.one-1800>*{width:100%}.two-1800>*{width:50%}.three-1800>*{width:33.33333%}.four-1800>*{width:25%}.five-1800>*{width:20%}.six-1800>*{width:16.66666%}.seven-1800>*{width:14.28571%}.eight-1800>*{width:12.5%}.nine-1800>*{width:11.11111%}.ten-1800>*{width:10%}.eleven-1800>*{width:9.09091%}.twelve-1800>*{width:8.33333%}}@media all and (min-width: 1900px){.one-1900>*{width:100%}.two-1900>*{width:50%}.three-1900>*{width:33.33333%}.four-1900>*{width:25%}.five-1900>*{width:20%}.six-1900>*{width:16.66666%}.seven-1900>*{width:14.28571%}.eight-1900>*{width:12.5%}.nine-1900>*{width:11.11111%}.ten-1900>*{width:10%}.eleven-1900>*{width:9.09091%}.twelve-1900>*{width:8.33333%}}@media all and (min-width: 2000px){.one-2000>*{width:100%}.two-2000>*{width:50%}.three-2000>*{width:33.33333%}.four-2000>*{width:25%}.five-2000>*{width:20%}.six-2000>*{width:16.66666%}.seven-2000>*{width:14.28571%}.eight-2000>*{width:12.5%}.nine-2000>*{width:11.11111%}.ten-2000>*{width:10%}.eleven-2000>*{width:9.09091%}.twelve-2000>*{width:8.33333%}}.full{width:100%}.half{width:50%}.third{width:33.33333%}.two-third{width:66.66666%}.fourth{width:25%}.three-fourth{width:75%}.fifth{width:20%}.two-fifth{width:40%}.three-fifth{width:60%}.four-fifth{width:80%}.sixth{width:16.66666%}.none{display:none}@media all and (min-width: 500px){.full-500{width:100%;display:block}.half-500{width:50%;display:block}.third-500{width:33.33333%;display:block}.two-third-500{width:66.66666%;display:block}.fourth-500{width:25%;display:block}.three-fourth-500{width:75%;display:block}.fifth-500{width:20%;display:block}.two-fifth-500{width:40%;display:block}.three-fifth-500{width:60%;display:block}.four-fifth-500{width:80%;display:block}.sixth-500{width:16.66666%;display:block}}@media all and (min-width: 600px){.full-600{width:100%;display:block}.half-600{width:50%;display:block}.third-600{width:33.33333%;display:block}.two-third-600{width:66.66666%;display:block}.fourth-600{width:25%;display:block}.three-fourth-600{width:75%;display:block}.fifth-600{width:20%;display:block}.two-fifth-600{width:40%;display:block}.three-fifth-600{width:60%;display:block}.four-fifth-600{width:80%;display:block}.sixth-600{width:16.66666%;display:block}}@media all and (min-width: 700px){.full-700{width:100%;display:block}.half-700{width:50%;display:block}.third-700{width:33.33333%;display:block}.two-third-700{width:66.66666%;display:block}.fourth-700{width:25%;display:block}.three-fourth-700{width:75%;display:block}.fifth-700{width:20%;display:block}.two-fifth-700{width:40%;display:block}.three-fifth-700{width:60%;display:block}.four-fifth-700{width:80%;display:block}.sixth-700{width:16.66666%;display:block}}@media all and (min-width: 800px){.full-800{width:100%;display:block}.half-800{width:50%;display:block}.third-800{width:33.33333%;display:block}.two-third-800{width:66.66666%;display:block}.fourth-800{width:25%;display:block}.three-fourth-800{width:75%;display:block}.fifth-800{width:20%;display:block}.two-fifth-800{width:40%;display:block}.three-fifth-800{width:60%;display:block}.four-fifth-800{width:80%;display:block}.sixth-800{width:16.66666%;display:block}}@media all and (min-width: 900px){.full-900{width:100%;display:block}.half-900{width:50%;display:block}.third-900{width:33.33333%;display:block}.two-third-900{width:66.66666%;display:block}.fourth-900{width:25%;display:block}.three-fourth-900{width:75%;display:block}.fifth-900{width:20%;display:block}.two-fifth-900{width:40%;display:block}.three-fifth-900{width:60%;display:block}.four-fifth-900{width:80%;display:block}.sixth-900{width:16.66666%;display:block}}@media all and (min-width: 1000px){.full-1000{width:100%;display:block}.half-1000{width:50%;display:block}.third-1000{width:33.33333%;display:block}.two-third-1000{width:66.66666%;display:block}.fourth-1000{width:25%;display:block}.three-fourth-1000{width:75%;display:block}.fifth-1000{width:20%;display:block}.two-fifth-1000{width:40%;display:block}.three-fifth-1000{width:60%;display:block}.four-fifth-1000{width:80%;display:block}.sixth-1000{width:16.66666%;display:block}}@media all and (min-width: 1100px){.full-1100{width:100%;display:block}.half-1100{width:50%;display:block}.third-1100{width:33.33333%;display:block}.two-third-1100{width:66.66666%;display:block}.fourth-1100{width:25%;display:block}.three-fourth-1100{width:75%;display:block}.fifth-1100{width:20%;display:block}.two-fifth-1100{width:40%;display:block}.three-fifth-1100{width:60%;display:block}.four-fifth-1100{width:80%;display:block}.sixth-1100{width:16.66666%;display:block}}@media all and (min-width: 1200px){.full-1200{width:100%;display:block}.half-1200{width:50%;display:block}.third-1200{width:33.33333%;display:block}.two-third-1200{width:66.66666%;display:block}.fourth-1200{width:25%;display:block}.three-fourth-1200{width:75%;display:block}.fifth-1200{width:20%;display:block}.two-fifth-1200{width:40%;display:block}.three-fifth-1200{width:60%;display:block}.four-fifth-1200{width:80%;display:block}.sixth-1200{width:16.66666%;display:block}}@media all and (min-width: 1300px){.full-1300{width:100%;display:block}.half-1300{width:50%;display:block}.third-1300{width:33.33333%;display:block}.two-third-1300{width:66.66666%;display:block}.fourth-1300{width:25%;display:block}.three-fourth-1300{width:75%;display:block}.fifth-1300{width:20%;display:block}.two-fifth-1300{width:40%;display:block}.three-fifth-1300{width:60%;display:block}.four-fifth-1300{width:80%;display:block}.sixth-1300{width:16.66666%;display:block}}@media all and (min-width: 1400px){.full-1400{width:100%;display:block}.half-1400{width:50%;display:block}.third-1400{width:33.33333%;display:block}.two-third-1400{width:66.66666%;display:block}.fourth-1400{width:25%;display:block}.three-fourth-1400{width:75%;display:block}.fifth-1400{width:20%;display:block}.two-fifth-1400{width:40%;display:block}.three-fifth-1400{width:60%;display:block}.four-fifth-1400{width:80%;display:block}.sixth-1400{width:16.66666%;display:block}}@media all and (min-width: 1500px){.full-1500{width:100%;display:block}.half-1500{width:50%;display:block}.third-1500{width:33.33333%;display:block}.two-third-1500{width:66.66666%;display:block}.fourth-1500{width:25%;display:block}.three-fourth-1500{width:75%;display:block}.fifth-1500{width:20%;display:block}.two-fifth-1500{width:40%;display:block}.three-fifth-1500{width:60%;display:block}.four-fifth-1500{width:80%;display:block}.sixth-1500{width:16.66666%;display:block}}@media all and (min-width: 1600px){.full-1600{width:100%;display:block}.half-1600{width:50%;display:block}.third-1600{width:33.33333%;display:block}.two-third-1600{width:66.66666%;display:block}.fourth-1600{width:25%;display:block}.three-fourth-1600{width:75%;display:block}.fifth-1600{width:20%;display:block}.two-fifth-1600{width:40%;display:block}.three-fifth-1600{width:60%;display:block}.four-fifth-1600{width:80%;display:block}.sixth-1600{width:16.66666%;display:block}}@media all and (min-width: 1700px){.full-1700{width:100%;display:block}.half-1700{width:50%;display:block}.third-1700{width:33.33333%;display:block}.two-third-1700{width:66.66666%;display:block}.fourth-1700{width:25%;display:block}.three-fourth-1700{width:75%;display:block}.fifth-1700{width:20%;display:block}.two-fifth-1700{width:40%;display:block}.three-fifth-1700{width:60%;display:block}.four-fifth-1700{width:80%;display:block}.sixth-1700{width:16.66666%;display:block}}@media all and (min-width: 1800px){.full-1800{width:100%;display:block}.half-1800{width:50%;display:block}.third-1800{width:33.33333%;display:block}.two-third-1800{width:66.66666%;display:block}.fourth-1800{width:25%;display:block}.three-fourth-1800{width:75%;display:block}.fifth-1800{width:20%;display:block}.two-fifth-1800{width:40%;display:block}.three-fifth-1800{width:60%;display:block}.four-fifth-1800{width:80%;display:block}.sixth-1800{width:16.66666%;display:block}}@media all and (min-width: 1900px){.full-1900{width:100%;display:block}.half-1900{width:50%;display:block}.third-1900{width:33.33333%;display:block}.two-third-1900{width:66.66666%;display:block}.fourth-1900{width:25%;display:block}.three-fourth-1900{width:75%;display:block}.fifth-1900{width:20%;display:block}.two-fifth-1900{width:40%;display:block}.three-fifth-1900{width:60%;display:block}.four-fifth-1900{width:80%;display:block}.sixth-1900{width:16.66666%;display:block}}@media all and (min-width: 2000px){.full-2000{width:100%;display:block}.half-2000{width:50%;display:block}.third-2000{width:33.33333%;display:block}.two-third-2000{width:66.66666%;display:block}.fourth-2000{width:25%;display:block}.three-fourth-2000{width:75%;display:block}.fifth-2000{width:20%;display:block}.two-fifth-2000{width:40%;display:block}.three-fifth-2000{width:60%;display:block}.four-fifth-2000{width:80%;display:block}.sixth-2000{width:16.66666%;display:block}}@media all and (min-width: 500px){.none-500{display:none}}@media all and (min-width: 600px){.none-600{display:none}}@media all and (min-width: 700px){.none-700{display:none}}@media all and (min-width: 800px){.none-800{display:none}}@media all and (min-width: 900px){.none-900{display:none}}@media all and (min-width: 1000px){.none-1000{display:none}}@media all and (min-width: 1100px){.none-1100{display:none}}@media all and (min-width: 1200px){.none-1200{display:none}}@media all and (min-width: 1300px){.none-1300{display:none}}@media all and (min-width: 1400px){.none-1400{display:none}}@media all and (min-width: 1500px){.none-1500{display:none}}@media all and (min-width: 1600px){.none-1600{display:none}}@media all and (min-width: 1700px){.none-1700{display:none}}@media all and (min-width: 1800px){.none-1800{display:none}}@media all and (min-width: 1900px){.none-1900{display:none}}@media all and (min-width: 2000px){.none-2000{display:none}}.off-none{margin-left:0}.off-half{margin-left:50%}.off-third{margin-left:33.33333%}.off-two-third{margin-left:66.66666%}.off-fourth{margin-left:25%}.off-three-fourth{margin-left:75%}.off-fifth{margin-left:20%}.off-two-fifth{margin-left:40%}.off-three-fifth{margin-left:60%}.off-four-fifth{margin-left:80%}.off-sixth{margin-left:16.66666%}@media all and (min-width: 500px){.off-none-500{margin-left:0}.off-half-500{margin-left:50%}.off-third-500{margin-left:33.33333%}.off-two-third-500{margin-left:66.66666%}.off-fourth-500{margin-left:25%}.off-three-fourth-500{margin-left:75%}.off-fifth-500{margin-left:20%}.off-two-fifth-500{margin-left:40%}.off-three-fifth-500{margin-left:60%}.off-four-fifth-500{margin-left:80%}.off-sixth-500{margin-left:16.66666%}}@media all and (min-width: 600px){.off-none-600{margin-left:0}.off-half-600{margin-left:50%}.off-third-600{margin-left:33.33333%}.off-two-third-600{margin-left:66.66666%}.off-fourth-600{margin-left:25%}.off-three-fourth-600{margin-left:75%}.off-fifth-600{margin-left:20%}.off-two-fifth-600{margin-left:40%}.off-three-fifth-600{margin-left:60%}.off-four-fifth-600{margin-left:80%}.off-sixth-600{margin-left:16.66666%}}@media all and (min-width: 700px){.off-none-700{margin-left:0}.off-half-700{margin-left:50%}.off-third-700{margin-left:33.33333%}.off-two-third-700{margin-left:66.66666%}.off-fourth-700{margin-left:25%}.off-three-fourth-700{margin-left:75%}.off-fifth-700{margin-left:20%}.off-two-fifth-700{margin-left:40%}.off-three-fifth-700{margin-left:60%}.off-four-fifth-700{margin-left:80%}.off-sixth-700{margin-left:16.66666%}}@media all and (min-width: 800px){.off-none-800{margin-left:0}.off-half-800{margin-left:50%}.off-third-800{margin-left:33.33333%}.off-two-third-800{margin-left:66.66666%}.off-fourth-800{margin-left:25%}.off-three-fourth-800{margin-left:75%}.off-fifth-800{margin-left:20%}.off-two-fifth-800{margin-left:40%}.off-three-fifth-800{margin-left:60%}.off-four-fifth-800{margin-left:80%}.off-sixth-800{margin-left:16.66666%}}@media all and (min-width: 900px){.off-none-900{margin-left:0}.off-half-900{margin-left:50%}.off-third-900{margin-left:33.33333%}.off-two-third-900{margin-left:66.66666%}.off-fourth-900{margin-left:25%}.off-three-fourth-900{margin-left:75%}.off-fifth-900{margin-left:20%}.off-two-fifth-900{margin-left:40%}.off-three-fifth-900{margin-left:60%}.off-four-fifth-900{margin-left:80%}.off-sixth-900{margin-left:16.66666%}}@media all and (min-width: 1000px){.off-none-1000{margin-left:0}.off-half-1000{margin-left:50%}.off-third-1000{margin-left:33.33333%}.off-two-third-1000{margin-left:66.66666%}.off-fourth-1000{margin-left:25%}.off-three-fourth-1000{margin-left:75%}.off-fifth-1000{margin-left:20%}.off-two-fifth-1000{margin-left:40%}.off-three-fifth-1000{margin-left:60%}.off-four-fifth-1000{margin-left:80%}.off-sixth-1000{margin-left:16.66666%}}@media all and (min-width: 1100px){.off-none-1100{margin-left:0}.off-half-1100{margin-left:50%}.off-third-1100{margin-left:33.33333%}.off-two-third-1100{margin-left:66.66666%}.off-fourth-1100{margin-left:25%}.off-three-fourth-1100{margin-left:75%}.off-fifth-1100{margin-left:20%}.off-two-fifth-1100{margin-left:40%}.off-three-fifth-1100{margin-left:60%}.off-four-fifth-1100{margin-left:80%}.off-sixth-1100{margin-left:16.66666%}}@media all and (min-width: 1200px){.off-none-1200{margin-left:0}.off-half-1200{margin-left:50%}.off-third-1200{margin-left:33.33333%}.off-two-third-1200{margin-left:66.66666%}.off-fourth-1200{margin-left:25%}.off-three-fourth-1200{margin-left:75%}.off-fifth-1200{margin-left:20%}.off-two-fifth-1200{margin-left:40%}.off-three-fifth-1200{margin-left:60%}.off-four-fifth-1200{margin-left:80%}.off-sixth-1200{margin-left:16.66666%}}@media all and (min-width: 1300px){.off-none-1300{margin-left:0}.off-half-1300{margin-left:50%}.off-third-1300{margin-left:33.33333%}.off-two-third-1300{margin-left:66.66666%}.off-fourth-1300{margin-left:25%}.off-three-fourth-1300{margin-left:75%}.off-fifth-1300{margin-left:20%}.off-two-fifth-1300{margin-left:40%}.off-three-fifth-1300{margin-left:60%}.off-four-fifth-1300{margin-left:80%}.off-sixth-1300{margin-left:16.66666%}}@media all and (min-width: 1400px){.off-none-1400{margin-left:0}.off-half-1400{margin-left:50%}.off-third-1400{margin-left:33.33333%}.off-two-third-1400{margin-left:66.66666%}.off-fourth-1400{margin-left:25%}.off-three-fourth-1400{margin-left:75%}.off-fifth-1400{margin-left:20%}.off-two-fifth-1400{margin-left:40%}.off-three-fifth-1400{margin-left:60%}.off-four-fifth-1400{margin-left:80%}.off-sixth-1400{margin-left:16.66666%}}@media all and (min-width: 1500px){.off-none-1500{margin-left:0}.off-half-1500{margin-left:50%}.off-third-1500{margin-left:33.33333%}.off-two-third-1500{margin-left:66.66666%}.off-fourth-1500{margin-left:25%}.off-three-fourth-1500{margin-left:75%}.off-fifth-1500{margin-left:20%}.off-two-fifth-1500{margin-left:40%}.off-three-fifth-1500{margin-left:60%}.off-four-fifth-1500{margin-left:80%}.off-sixth-1500{margin-left:16.66666%}}@media all and (min-width: 1600px){.off-none-1600{margin-left:0}.off-half-1600{margin-left:50%}.off-third-1600{margin-left:33.33333%}.off-two-third-1600{margin-left:66.66666%}.off-fourth-1600{margin-left:25%}.off-three-fourth-1600{margin-left:75%}.off-fifth-1600{margin-left:20%}.off-two-fifth-1600{margin-left:40%}.off-three-fifth-1600{margin-left:60%}.off-four-fifth-1600{margin-left:80%}.off-sixth-1600{margin-left:16.66666%}}@media all and (min-width: 1700px){.off-none-1700{margin-left:0}.off-half-1700{margin-left:50%}.off-third-1700{margin-left:33.33333%}.off-two-third-1700{margin-left:66.66666%}.off-fourth-1700{margin-left:25%}.off-three-fourth-1700{margin-left:75%}.off-fifth-1700{margin-left:20%}.off-two-fifth-1700{margin-left:40%}.off-three-fifth-1700{margin-left:60%}.off-four-fifth-1700{margin-left:80%}.off-sixth-1700{margin-left:16.66666%}}@media all and (min-width: 1800px){.off-none-1800{margin-left:0}.off-half-1800{margin-left:50%}.off-third-1800{margin-left:33.33333%}.off-two-third-1800{margin-left:66.66666%}.off-fourth-1800{margin-left:25%}.off-three-fourth-1800{margin-left:75%}.off-fifth-1800{margin-left:20%}.off-two-fifth-1800{margin-left:40%}.off-three-fifth-1800{margin-left:60%}.off-four-fifth-1800{margin-left:80%}.off-sixth-1800{margin-left:16.66666%}}@media all and (min-width: 1900px){.off-none-1900{margin-left:0}.off-half-1900{margin-left:50%}.off-third-1900{margin-left:33.33333%}.off-two-third-1900{margin-left:66.66666%}.off-fourth-1900{margin-left:25%}.off-three-fourth-1900{margin-left:75%}.off-fifth-1900{margin-left:20%}.off-two-fifth-1900{margin-left:40%}.off-three-fifth-1900{margin-left:60%}.off-four-fifth-1900{margin-left:80%}.off-sixth-1900{margin-left:16.66666%}}@media all and (min-width: 2000px){.off-none-2000{margin-left:0}.off-half-2000{margin-left:50%}.off-third-2000{margin-left:33.33333%}.off-two-third-2000{margin-left:66.66666%}.off-fourth-2000{margin-left:25%}.off-three-fourth-2000{margin-left:75%}.off-fifth-2000{margin-left:20%}.off-two-fifth-2000{margin-left:40%}.off-three-fifth-2000{margin-left:60%}.off-four-fifth-2000{margin-left:80%}.off-sixth-2000{margin-left:16.66666%}}nav{position:fixed;top:0;left:0;right:0;height:3em;padding:0 .6em;background:#fff;box-shadow:0 0 0.2em rgba(17,17,17,0.2);z-index:10000;transition:all .3s;transform-style:preserve-3d}nav .brand,nav .menu,nav .burger{float:right;position:relative;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}nav .brand{font-weight:700;float:left;padding:0 .6em;max-width:50%;white-space:nowrap;color:inherit}nav .brand *{vertical-align:middle}nav .logo{height:2em;margin-right:.3em}nav .select::after{height:calc(100% - 1px);padding:0;line-height:2.4em}nav .menu>*{margin-right:.6em}nav .burger{display:none}@media all and (max-width: 60em){nav .burger{display:inline-block;cursor:pointer;bottom:-1000em;margin:0}nav .burger ~ .menu,nav .show:checked ~ .burger{position:fixed;min-height:100%;top:0;right:0;bottom:-1000em;margin:0;background:#fff;transition:all .5s ease;transform:none}nav .burger ~ .menu{z-index:11}nav .show:checked ~ .burger{color:transparent;width:100%;border-radius:0;background:rgba(0,0,0,0.2);transition:all .5s ease}nav .show ~ .menu{width:70%;max-width:300px;transform-origin:center right;transition:all .25s ease;transform:scaleX(0)}nav .show ~ .menu>*{transform:translateX(100%);transition:all 0s ease .5s}nav .show:checked ~ .menu>*:nth-child(1){transition:all .5s cubic-bezier(0.645, 0.045, 0.355, 1) 0s}nav .show:checked ~ .menu>*:nth-child(2){transition:all .5s cubic-bezier(0.645, 0.045, 0.355, 1) .1s}nav .show:checked ~ .menu>*:nth-child(3){transition:all .5s cubic-bezier(0.645, 0.045, 0.355, 1) .2s}nav .show:checked ~ .menu>*:nth-child(4){transition:all .5s cubic-bezier(0.645, 0.045, 0.355, 1) .3s}nav .show:checked ~ .menu>*:nth-child(5){transition:all .5s cubic-bezier(0.645, 0.045, 0.355, 1) .4s}nav .show:checked ~ .menu>*:nth-child(6){transition:all .5s cubic-bezier(0.645, 0.045, 0.355, 1) .5s}nav .show:checked ~ .menu{transform:scaleX(1)}nav .show:checked ~ .menu>*{transform:translateX(0);transition:all .5s ease-in-out .6s}nav .burger ~ .menu>*{display:block;margin:.3em;text-align:left;max-width:calc(100% - .6em)}nav .burger ~ .menu>a{padding:.3em .9em}}.stack,.stack .toggle{margin-top:0;margin-bottom:0;display:block;width:100%;text-align:left;border-radius:0}.stack:first-child,.stack:first-child .toggle{border-top-left-radius:.2em;border-top-right-radius:.2em}.stack:last-child,.stack:last-child .toggle{border-bottom-left-radius:.2em;border-bottom-right-radius:.2em}input.stack,textarea.stack,select.stack{transition:border-bottom 0 ease 0;border-bottom-width:0}input.stack:last-child,textarea.stack:last-child,select.stack:last-child{border-bottom-width:1px}input.stack:focus+input,input.stack:focus+textarea,input.stack:focus+select,textarea.stack:focus+input,textarea.stack:focus+textarea,textarea.stack:focus+select,select.stack:focus+input,select.stack:focus+textarea,select.stack:focus+select{border-top-color:#0074d9}.card,.modal .overlay ~ *{position:relative;box-shadow:0;border-radius:.2em;border:1px solid #ccc;overflow:hidden;text-align:left;background:#fff;margin-bottom:.6em;padding:0;transition:all .3s ease}.hidden.card,.modal .overlay ~ .hidden,:checked+.card,.modal .overlay ~ :checked+*,.modal .overlay:checked+*{font-size:0;padding:0;margin:0;border:0}.card>*,.modal .overlay ~ *>*{max-width:100%;display:block}.card>*:last-child,.modal .overlay ~ *>*:last-child{margin-bottom:0}.card header,.modal .overlay ~ * header,.card section,.modal .overlay ~ * section,.card>p,.modal .overlay ~ *>p{padding:.6em .8em}.card section,.modal .overlay ~ * section{padding:.6em .8em 0}.card hr,.modal .overlay ~ * hr{border:none;height:1px;background-color:#eee}.card header,.modal .overlay ~ * header{font-weight:bold;position:relative;border-bottom:1px solid #eee}.card header h1,.modal .overlay ~ * header h1,.card header h2,.modal .overlay ~ * header h2,.card header h3,.modal .overlay ~ * header h3,.card header h4,.modal .overlay ~ * header h4,.card header h5,.modal .overlay ~ * header h5,.card header h6,.modal .overlay ~ * header h6{padding:0;margin:0 2em 0 0;line-height:1;display:inline-block;vertical-align:text-bottom}.card header:last-child,.modal .overlay ~ * header:last-child{border-bottom:0}.card footer,.modal .overlay ~ * footer{padding:.8em}.card p,.modal .overlay ~ * p{margin:.3em 0}.card p:first-child,.modal .overlay ~ * p:first-child{margin-top:0}.card p:last-child,.modal .overlay ~ * p:last-child{margin-bottom:0}.card>p,.modal .overlay ~ *>p{margin:0;padding-right:2.5em}.card .close,.modal .overlay ~ * .close{position:absolute;top:.4em;right:.3em;font-size:1.2em;padding:0 .5em;cursor:pointer;width:auto}.card .close:hover,.modal .overlay ~ * .close:hover{color:#ff4136}.card h1+.close,.modal .overlay ~ * h1+.close{margin:.2em}.card h2+.close,.modal .overlay ~ * h2+.close{margin:.1em}.card .dangerous,.modal .overlay ~ * .dangerous{background:#ff4136;float:right}.modal{text-align:center}.modal>input{display:none}.modal>input ~ *{opacity:0;max-height:0;overflow:hidden}.modal .overlay{top:0;left:0;bottom:0;right:0;position:fixed;margin:0;border-radius:0;background:rgba(17,17,17,0.6);transition:all 0.3s;z-index:100000}.modal .overlay:before,.modal .overlay:after{display:none}.modal .overlay ~ *{border:0;position:fixed;top:50%;left:50%;transform:translateX(-50%) translateY(-50%) scale(0.2, 0.2);z-index:1000000;transition:all 0.3s}.modal>input:checked ~ *{display:block;opacity:1;max-height:10000px;transition:all 0.3s}.modal>input:checked ~ .overlay ~ *{max-height:90%;overflow:auto;-webkit-transform:translateX(-50%) translateY(-50%) scale(1, 1);transform:translateX(-50%) translateY(-50%) scale(1, 1)}@media (max-width: 60em){.modal .overlay ~ *{min-width:90%}}.dropimage{position:relative;display:block;padding:0;padding-bottom:56.25%;overflow:hidden;cursor:pointer;border:0;margin:.3em 0;border-radius:.2em;background-color:#ddd;background-size:cover;background-position:center center;background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI2NDAiIGhlaWdodD0iNjQwIiB2ZXJzaW9uPSIxLjEiPjxnIHN0eWxlPSJmaWxsOiMzMzMiPjxwYXRoIGQ9Ik0gMTg3IDIzMCBDIDE3NSAyMzAgMTY1IDI0MCAxNjUgMjUyIEwgMTY1IDMwMCBMIDE2NSA0MDggQyAxNjUgNDIwIDE3NSA0MzAgMTg3IDQzMCBMIDQ2MyA0MzAgQyA0NzUgNDMwIDQ4NSA0MjAgNDg1IDQwOCBMIDQ4NSAzMDAgTCA0ODUgMjUyIEMgNDg1IDI0MCA0NzUgMjMwIDQ2MyAyMzAgTCAxODcgMjMwIHogTSAzNjAgMjU2IEEgNzAgNzIgMCAwIDEgNDMwIDMyOCBBIDcwIDcyIDAgMCAxIDM2MCA0MDAgQSA3MCA3MiAwIDAgMSAyOTAgMzI4IEEgNzAgNzIgMCAwIDEgMzYwIDI1NiB6Ii8+PGNpcmNsZSBjeD0iMzYwIiBjeT0iMzMwIiByPSI0MSIvPjxwYXRoIGQ9Im0yMDUgMjI1IDUtMTAgMjAgMCA1IDEwLTMwIDAiLz48cGF0aCBkPSJNMjg1IDIwMEwyNzAgMjI1IDM3NiAyMjUgMzYxIDIwMCAyODUgMjAwek0zMTAgMjA1TDMzNyAyMDUgMzM3IDIxOCAzMTAgMjE4IDMxMCAyMDV6Ii8+PHBhdGggZD0ibTQwNSAyMjUgNS0xMCAyMCAwIDUgMTAtMzAgMCIvPjwvZz48L3N2Zz4=)}.dropimage input{left:0;width:100%;height:100%;border:0;margin:0;padding:0;opacity:0;cursor:pointer;position:absolute}.tabs{position:relative;overflow:hidden}.tabs>label img{float:left;margin-left:.6em}.tabs>.row{width:calc(100% + 2 * .6em);display:table;table-layout:fixed;position:relative;padding-left:0;transition:all .3s;border-spacing:0;margin:0}.tabs>.row:before,.tabs>.row:after{display:none}.tabs>.row>*,.tabs>.row img{display:table-cell;vertical-align:top;margin:0;width:100%}.tabs>input{display:none}.tabs>input+*{width:100%}.tabs>input+label{width:auto}.two.tabs>.row{width:200%;left:-100%}.two.tabs>input:nth-of-type(1):checked ~ .row{margin-left:100%}.two.tabs>label img{width:48%;margin:4% 0 4% 4%}.three.tabs>.row{width:300%;left:-200%}.three.tabs>input:nth-of-type(1):checked ~ .row{margin-left:200%}.three.tabs>input:nth-of-type(2):checked ~ .row{margin-left:100%}.three.tabs>label img{width:30%;margin:5% 0 5% 5%}.four.tabs>.row{width:400%;left:-300%}.four.tabs>input:nth-of-type(1):checked ~ .row{margin-left:300%}.four.tabs>input:nth-of-type(2):checked ~ .row{margin-left:200%}.four.tabs>input:nth-of-type(3):checked ~ .row{margin-left:100%}.four.tabs>label img{width:22%;margin:4% 0 4% 4%}.tabs>label:first-of-type img{margin-left:0}[data-tooltip]{position:relative}[data-tooltip]:after,[data-tooltip]:before{position:absolute;z-index:10;opacity:0;border-width:0;height:0;padding:0;overflow:hidden;transition:opacity .6s ease, height 0s ease .6s;top:calc(100% - 6px);left:0;margin-top:12px}[data-tooltip]:after{margin-left:0;font-size:.8em;background:#111;content:attr(data-tooltip);white-space:nowrap}[data-tooltip]:before{content:'';width:0;height:0;border-width:0;border-style:solid;border-color:transparent transparent #111;margin-top:0;left:10px}[data-tooltip]:hover:after,[data-tooltip]:focus:after,[data-tooltip]:hover:before,[data-tooltip]:focus:before{opacity:1;border-width:6px;height:auto}[data-tooltip]:hover:after,[data-tooltip]:focus:after{padding:.45em .9em}.tooltip-top:after,.tooltip-top:before{top:auto;bottom:calc(100% - 6px);left:0;margin-bottom:12px}.tooltip-top:before{border-color:#111 transparent transparent;margin-bottom:0;left:10px}.tooltip-right:after,.tooltip-right:before{left:100%;margin-left:6px;margin-top:0;top:0}.tooltip-right:before{border-color:transparent #111 transparent transparent;margin-left:-6px;left:100%;top:7px}.tooltip-left:after,.tooltip-left:before{right:100%;margin-right:6px;left:auto;margin-top:0;top:0}.tooltip-left:before{border-color:transparent transparent transparent #111;margin-right:-6px;right:100%;top:7px}
diff --git a/index.php b/index.php
new file mode 100644
index 0000000..4d2de0e
--- /dev/null
+++ b/index.php
@@ -0,0 +1,48 @@
+
+
+
+ Picnic CSS Testing
+ : mlmmj-webinterface
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/libs/Autoloader.php b/libs/Autoloader.php
new file mode 100644
index 0000000..c09361b
--- /dev/null
+++ b/libs/Autoloader.php
@@ -0,0 +1,110 @@
+ 'Smarty.class.php', 'smartybc' => 'SmartyBC.class.php',);
+
+ /**
+ * Registers Smarty_Autoloader backward compatible to older installations.
+ *
+ * @param bool $prepend Whether to prepend the autoloader or not.
+ */
+ public static function registerBC($prepend = false)
+ {
+ /**
+ * register the class autoloader
+ */
+ if (!defined('SMARTY_SPL_AUTOLOAD')) {
+ define('SMARTY_SPL_AUTOLOAD', 0);
+ }
+ if (SMARTY_SPL_AUTOLOAD
+ && set_include_path(get_include_path() . PATH_SEPARATOR . SMARTY_SYSPLUGINS_DIR) !== false
+ ) {
+ $registeredAutoLoadFunctions = spl_autoload_functions();
+ if (!isset($registeredAutoLoadFunctions[ 'spl_autoload' ])) {
+ spl_autoload_register();
+ }
+ } else {
+ self::register($prepend);
+ }
+ }
+
+ /**
+ * Registers Smarty_Autoloader as an SPL autoloader.
+ *
+ * @param bool $prepend Whether to prepend the autoloader or not.
+ */
+ public static function register($prepend = false)
+ {
+ self::$SMARTY_DIR = defined('SMARTY_DIR') ? SMARTY_DIR : dirname(__FILE__) . DIRECTORY_SEPARATOR;
+ self::$SMARTY_SYSPLUGINS_DIR = defined('SMARTY_SYSPLUGINS_DIR') ? SMARTY_SYSPLUGINS_DIR :
+ self::$SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR;
+ if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
+ spl_autoload_register(array(__CLASS__, 'autoload'), true, $prepend);
+ } else {
+ spl_autoload_register(array(__CLASS__, 'autoload'));
+ }
+ }
+
+ /**
+ * Handles auto loading of classes.
+ *
+ * @param string $class A class name.
+ */
+ public static function autoload($class)
+ {
+ if ($class[ 0 ] !== 'S' || strpos($class, 'Smarty') !== 0) {
+ return;
+ }
+ $_class = strtolower($class);
+ if (isset(self::$rootClasses[ $_class ])) {
+ $file = self::$SMARTY_DIR . self::$rootClasses[ $_class ];
+ if (is_file($file)) {
+ include $file;
+ }
+ } else {
+ $file = self::$SMARTY_SYSPLUGINS_DIR . $_class . '.php';
+ if (is_file($file)) {
+ include $file;
+ }
+ }
+ return;
+ }
+}
diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php
new file mode 100644
index 0000000..44b77a8
--- /dev/null
+++ b/libs/Smarty.class.php
@@ -0,0 +1,1425 @@
+
+ * @author Uwe Tews
+ * @author Rodney Rehm
+ * @package Smarty
+ * @version 3.1.34-dev
+ */
+/**
+ * set SMARTY_DIR to absolute path to Smarty library files.
+ * Sets SMARTY_DIR only if user application has not already defined it.
+ */
+if (!defined('SMARTY_DIR')) {
+ /**
+ *
+ */
+ define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
+}
+/**
+ * set SMARTY_SYSPLUGINS_DIR to absolute path to Smarty internal plugins.
+ * Sets SMARTY_SYSPLUGINS_DIR only if user application has not already defined it.
+ */
+if (!defined('SMARTY_SYSPLUGINS_DIR')) {
+ /**
+ *
+ */
+ define('SMARTY_SYSPLUGINS_DIR', SMARTY_DIR . 'sysplugins' . DIRECTORY_SEPARATOR);
+}
+if (!defined('SMARTY_PLUGINS_DIR')) {
+ /**
+ *
+ */
+ define('SMARTY_PLUGINS_DIR', SMARTY_DIR . 'plugins' . DIRECTORY_SEPARATOR);
+}
+if (!defined('SMARTY_MBSTRING')) {
+ /**
+ *
+ */
+ define('SMARTY_MBSTRING', function_exists('mb_get_info'));
+}
+if (!defined('SMARTY_RESOURCE_CHAR_SET')) {
+ // UTF-8 can only be done properly when mbstring is available!
+ /**
+ * @deprecated in favor of Smarty::$_CHARSET
+ */
+ define('SMARTY_RESOURCE_CHAR_SET', SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1');
+}
+if (!defined('SMARTY_RESOURCE_DATE_FORMAT')) {
+ /**
+ * @deprecated in favor of Smarty::$_DATE_FORMAT
+ */
+ define('SMARTY_RESOURCE_DATE_FORMAT', '%b %e, %Y');
+}
+/**
+ * Load Smarty_Autoloader
+ */
+if (!class_exists('Smarty_Autoloader')) {
+ include dirname(__FILE__) . '/bootstrap.php';
+}
+/**
+ * Load always needed external class files
+ */
+require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_data.php';
+require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_extension_handler.php';
+require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_templatebase.php';
+require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_template.php';
+require_once SMARTY_SYSPLUGINS_DIR . 'smarty_resource.php';
+require_once SMARTY_SYSPLUGINS_DIR . 'smarty_variable.php';
+require_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_source.php';
+require_once SMARTY_SYSPLUGINS_DIR . 'smarty_template_resource_base.php';
+require_once SMARTY_SYSPLUGINS_DIR . 'smarty_internal_resource_file.php';
+
+/**
+ * This is the main Smarty class
+ *
+ * @package Smarty
+ *
+ * The following methods will be dynamically loaded by the extension handler when they are called.
+ * They are located in a corresponding Smarty_Internal_Method_xxxx class
+ *
+ * @method int clearAllCache(int $exp_time = null, string $type = null)
+ * @method int clearCache(string $template_name, string $cache_id = null, string $compile_id = null, int $exp_time = null, string $type = null)
+ * @method int compileAllTemplates(string $extension = '.tpl', bool $force_compile = false, int $time_limit = 0, $max_errors = null)
+ * @method int compileAllConfig(string $extension = '.conf', bool $force_compile = false, int $time_limit = 0, $max_errors = null)
+ * @method int clearCompiledTemplate($resource_name = null, $compile_id = null, $exp_time = null)
+ */
+class Smarty extends Smarty_Internal_TemplateBase
+{
+ /**
+ * smarty version
+ */
+ const SMARTY_VERSION = '3.1.34-dev-7';
+ /**
+ * define variable scopes
+ */
+ const SCOPE_LOCAL = 1;
+ const SCOPE_PARENT = 2;
+ const SCOPE_TPL_ROOT = 4;
+ const SCOPE_ROOT = 8;
+ const SCOPE_SMARTY = 16;
+ const SCOPE_GLOBAL = 32;
+ /**
+ * define caching modes
+ */
+ const CACHING_OFF = 0;
+ const CACHING_LIFETIME_CURRENT = 1;
+ const CACHING_LIFETIME_SAVED = 2;
+ /**
+ * define constant for clearing cache files be saved expiration dates
+ */
+ const CLEAR_EXPIRED = -1;
+ /**
+ * define compile check modes
+ */
+ const COMPILECHECK_OFF = 0;
+ const COMPILECHECK_ON = 1;
+ const COMPILECHECK_CACHEMISS = 2;
+ /**
+ * define debug modes
+ */
+ const DEBUG_OFF = 0;
+ const DEBUG_ON = 1;
+ const DEBUG_INDIVIDUAL = 2;
+ /**
+ * modes for handling of "" tags in templates.
+ */
+ const PHP_PASSTHRU = 0; //-> print tags as plain text
+ const PHP_QUOTE = 1; //-> escape tags as entities
+ const PHP_REMOVE = 2; //-> escape tags as entities
+ const PHP_ALLOW = 3; //-> escape tags as entities
+ /**
+ * filter types
+ */
+ const FILTER_POST = 'post';
+ const FILTER_PRE = 'pre';
+ const FILTER_OUTPUT = 'output';
+ const FILTER_VARIABLE = 'variable';
+ /**
+ * plugin types
+ */
+ const PLUGIN_FUNCTION = 'function';
+ const PLUGIN_BLOCK = 'block';
+ const PLUGIN_COMPILER = 'compiler';
+ const PLUGIN_MODIFIER = 'modifier';
+ const PLUGIN_MODIFIERCOMPILER = 'modifiercompiler';
+
+ /**
+ * assigned global tpl vars
+ */
+ public static $global_tpl_vars = array();
+
+ /**
+ * Flag denoting if Multibyte String functions are available
+ */
+ public static $_MBSTRING = SMARTY_MBSTRING;
+
+ /**
+ * The character set to adhere to (e.g. "UTF-8")
+ */
+ public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET;
+
+ /**
+ * The date format to be used internally
+ * (accepts date() and strftime())
+ */
+ public static $_DATE_FORMAT = SMARTY_RESOURCE_DATE_FORMAT;
+
+ /**
+ * Flag denoting if PCRE should run in UTF-8 mode
+ */
+ public static $_UTF8_MODIFIER = 'u';
+
+ /**
+ * Flag denoting if operating system is windows
+ */
+ public static $_IS_WINDOWS = false;
+
+ /**
+ * auto literal on delimiters with whitespace
+ *
+ * @var boolean
+ */
+ public $auto_literal = true;
+
+ /**
+ * display error on not assigned variables
+ *
+ * @var boolean
+ */
+ public $error_unassigned = false;
+
+ /**
+ * look up relative file path in include_path
+ *
+ * @var boolean
+ */
+ public $use_include_path = false;
+
+ /**
+ * flag if template_dir is normalized
+ *
+ * @var bool
+ */
+ public $_templateDirNormalized = false;
+
+ /**
+ * joined template directory string used in cache keys
+ *
+ * @var string
+ */
+ public $_joined_template_dir = null;
+
+ /**
+ * flag if config_dir is normalized
+ *
+ * @var bool
+ */
+ public $_configDirNormalized = false;
+
+ /**
+ * joined config directory string used in cache keys
+ *
+ * @var string
+ */
+ public $_joined_config_dir = null;
+
+ /**
+ * default template handler
+ *
+ * @var callable
+ */
+ public $default_template_handler_func = null;
+
+ /**
+ * default config handler
+ *
+ * @var callable
+ */
+ public $default_config_handler_func = null;
+
+ /**
+ * default plugin handler
+ *
+ * @var callable
+ */
+ public $default_plugin_handler_func = null;
+
+ /**
+ * flag if template_dir is normalized
+ *
+ * @var bool
+ */
+ public $_compileDirNormalized = false;
+
+ /**
+ * flag if plugins_dir is normalized
+ *
+ * @var bool
+ */
+ public $_pluginsDirNormalized = false;
+
+ /**
+ * flag if template_dir is normalized
+ *
+ * @var bool
+ */
+ public $_cacheDirNormalized = false;
+
+ /**
+ * force template compiling?
+ *
+ * @var boolean
+ */
+ public $force_compile = false;
+
+ /**
+ * use sub dirs for compiled/cached files?
+ *
+ * @var boolean
+ */
+ public $use_sub_dirs = false;
+
+ /**
+ * allow ambiguous resources (that are made unique by the resource handler)
+ *
+ * @var boolean
+ */
+ public $allow_ambiguous_resources = false;
+
+ /**
+ * merge compiled includes
+ *
+ * @var boolean
+ */
+ public $merge_compiled_includes = false;
+
+ /*
+ * flag for behaviour when extends: resource and {extends} tag are used simultaneous
+ * if false disable execution of {extends} in templates called by extends resource.
+ * (behaviour as versions < 3.1.28)
+ *
+ * @var boolean
+ */
+ public $extends_recursion = true;
+
+ /**
+ * force cache file creation
+ *
+ * @var boolean
+ */
+ public $force_cache = false;
+
+ /**
+ * template left-delimiter
+ *
+ * @var string
+ */
+ public $left_delimiter = "{";
+
+ /**
+ * template right-delimiter
+ *
+ * @var string
+ */
+ public $right_delimiter = "}";
+
+ /**
+ * array of strings which shall be treated as literal by compiler
+ *
+ * @var array string
+ */
+ public $literals = array();
+
+ /**
+ * class name
+ * This should be instance of Smarty_Security.
+ *
+ * @var string
+ * @see Smarty_Security
+ */
+ public $security_class = 'Smarty_Security';
+
+ /**
+ * implementation of security class
+ *
+ * @var Smarty_Security
+ */
+ public $security_policy = null;
+
+ /**
+ * controls handling of PHP-blocks
+ *
+ * @var integer
+ */
+ public $php_handling = self::PHP_PASSTHRU;
+
+ /**
+ * controls if the php template file resource is allowed
+ *
+ * @var bool
+ */
+ public $allow_php_templates = false;
+
+ /**
+ * debug mode
+ * Setting this to true enables the debug-console.
+ *
+ * @var boolean
+ */
+ public $debugging = false;
+
+ /**
+ * This determines if debugging is enable-able from the browser.
+ *
+ * - NONE => no debugging control allowed
+ * - URL => enable debugging when SMARTY_DEBUG is found in the URL.
+ *
+ *
+ * @var string
+ */
+ public $debugging_ctrl = 'NONE';
+
+ /**
+ * Name of debugging URL-param.
+ * Only used when $debugging_ctrl is set to 'URL'.
+ * The name of the URL-parameter that activates debugging.
+ *
+ * @var string
+ */
+ public $smarty_debug_id = 'SMARTY_DEBUG';
+
+ /**
+ * Path of debug template.
+ *
+ * @var string
+ */
+ public $debug_tpl = null;
+
+ /**
+ * When set, smarty uses this value as error_reporting-level.
+ *
+ * @var int
+ */
+ public $error_reporting = null;
+
+ /**
+ * Controls whether variables with the same name overwrite each other.
+ *
+ * @var boolean
+ */
+ public $config_overwrite = true;
+
+ /**
+ * Controls whether config values of on/true/yes and off/false/no get converted to boolean.
+ *
+ * @var boolean
+ */
+ public $config_booleanize = true;
+
+ /**
+ * Controls whether hidden config sections/vars are read from the file.
+ *
+ * @var boolean
+ */
+ public $config_read_hidden = false;
+
+ /**
+ * locking concurrent compiles
+ *
+ * @var boolean
+ */
+ public $compile_locking = true;
+
+ /**
+ * Controls whether cache resources should use locking mechanism
+ *
+ * @var boolean
+ */
+ public $cache_locking = false;
+
+ /**
+ * seconds to wait for acquiring a lock before ignoring the write lock
+ *
+ * @var float
+ */
+ public $locking_timeout = 10;
+
+ /**
+ * resource type used if none given
+ * Must be an valid key of $registered_resources.
+ *
+ * @var string
+ */
+ public $default_resource_type = 'file';
+
+ /**
+ * caching type
+ * Must be an element of $cache_resource_types.
+ *
+ * @var string
+ */
+ public $caching_type = 'file';
+
+ /**
+ * config type
+ *
+ * @var string
+ */
+ public $default_config_type = 'file';
+
+ /**
+ * check If-Modified-Since headers
+ *
+ * @var boolean
+ */
+ public $cache_modified_check = false;
+
+ /**
+ * registered plugins
+ *
+ * @var array
+ */
+ public $registered_plugins = array();
+
+ /**
+ * registered objects
+ *
+ * @var array
+ */
+ public $registered_objects = array();
+
+ /**
+ * registered classes
+ *
+ * @var array
+ */
+ public $registered_classes = array();
+
+ /**
+ * registered filters
+ *
+ * @var array
+ */
+ public $registered_filters = array();
+
+ /**
+ * registered resources
+ *
+ * @var array
+ */
+ public $registered_resources = array();
+
+ /**
+ * registered cache resources
+ *
+ * @var array
+ */
+ public $registered_cache_resources = array();
+
+ /**
+ * autoload filter
+ *
+ * @var array
+ */
+ public $autoload_filters = array();
+
+ /**
+ * default modifier
+ *
+ * @var array
+ */
+ public $default_modifiers = array();
+
+ /**
+ * autoescape variable output
+ *
+ * @var boolean
+ */
+ public $escape_html = false;
+
+ /**
+ * start time for execution time calculation
+ *
+ * @var int
+ */
+ public $start_time = 0;
+
+ /**
+ * required by the compiler for BC
+ *
+ * @var string
+ */
+ public $_current_file = null;
+
+ /**
+ * internal flag to enable parser debugging
+ *
+ * @var bool
+ */
+ public $_parserdebug = false;
+
+ /**
+ * This object type (Smarty = 1, template = 2, data = 4)
+ *
+ * @var int
+ */
+ public $_objType = 1;
+
+ /**
+ * Debug object
+ *
+ * @var Smarty_Internal_Debug
+ */
+ public $_debug = null;
+
+ /**
+ * template directory
+ *
+ * @var array
+ */
+ protected $template_dir = array('./templates/');
+
+ /**
+ * flags for normalized template directory entries
+ *
+ * @var array
+ */
+ protected $_processedTemplateDir = array();
+
+ /**
+ * config directory
+ *
+ * @var array
+ */
+ protected $config_dir = array('./configs/');
+
+ /**
+ * flags for normalized template directory entries
+ *
+ * @var array
+ */
+ protected $_processedConfigDir = array();
+
+ /**
+ * compile directory
+ *
+ * @var string
+ */
+ protected $compile_dir = './templates_c/';
+
+ /**
+ * plugins directory
+ *
+ * @var array
+ */
+ protected $plugins_dir = array();
+
+ /**
+ * cache directory
+ *
+ * @var string
+ */
+ protected $cache_dir = './cache/';
+
+ /**
+ * removed properties
+ *
+ * @var string[]
+ */
+ protected $obsoleteProperties = array(
+ 'resource_caching', 'template_resource_caching', 'direct_access_security',
+ '_dir_perms', '_file_perms', 'plugin_search_order',
+ 'inheritance_merge_compiled_includes', 'resource_cache_mode',
+ );
+
+ /**
+ * List of private properties which will call getter/setter on a direct access
+ *
+ * @var string[]
+ */
+ protected $accessMap = array(
+ 'template_dir' => 'TemplateDir', 'config_dir' => 'ConfigDir',
+ 'plugins_dir' => 'PluginsDir', 'compile_dir' => 'CompileDir',
+ 'cache_dir' => 'CacheDir',
+ );
+
+ /**
+ * Initialize new Smarty object
+ */
+ public function __construct()
+ {
+ $this->_clearTemplateCache();
+ parent::__construct();
+ if (is_callable('mb_internal_encoding')) {
+ mb_internal_encoding(Smarty::$_CHARSET);
+ }
+ $this->start_time = microtime(true);
+ if (isset($_SERVER[ 'SCRIPT_NAME' ])) {
+ Smarty::$global_tpl_vars[ 'SCRIPT_NAME' ] = new Smarty_Variable($_SERVER[ 'SCRIPT_NAME' ]);
+ }
+ // Check if we're running on windows
+ Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
+ // let PCRE (preg_*) treat strings as ISO-8859-1 if we're not dealing with UTF-8
+ if (Smarty::$_CHARSET !== 'UTF-8') {
+ Smarty::$_UTF8_MODIFIER = '';
+ }
+ }
+
+ /**
+ * Enable error handler to mute expected messages
+ *
+ * @return boolean
+ * @deprecated
+ */
+ public static function muteExpectedErrors()
+ {
+ return Smarty_Internal_ErrorHandler::muteExpectedErrors();
+ }
+
+ /**
+ * Disable error handler muting expected messages
+ *
+ * @deprecated
+ */
+ public static function unmuteExpectedErrors()
+ {
+ restore_error_handler();
+ }
+
+ /**
+ * Check if a template resource exists
+ *
+ * @param string $resource_name template name
+ *
+ * @return bool status
+ * @throws \SmartyException
+ */
+ public function templateExists($resource_name)
+ {
+ // create source object
+ $source = Smarty_Template_Source::load(null, $this, $resource_name);
+ return $source->exists;
+ }
+
+ /**
+ * Loads security class and enables security
+ *
+ * @param string|Smarty_Security $security_class if a string is used, it must be class-name
+ *
+ * @return Smarty current Smarty instance for chaining
+ * @throws \SmartyException
+ */
+ public function enableSecurity($security_class = null)
+ {
+ Smarty_Security::enableSecurity($this, $security_class);
+ return $this;
+ }
+
+ /**
+ * Disable security
+ *
+ * @return Smarty current Smarty instance for chaining
+ */
+ public function disableSecurity()
+ {
+ $this->security_policy = null;
+ return $this;
+ }
+
+ /**
+ * Add template directory(s)
+ *
+ * @param string|array $template_dir directory(s) of template sources
+ * @param string $key of the array element to assign the template dir to
+ * @param bool $isConfig true for config_dir
+ *
+ * @return Smarty current Smarty instance for chaining
+ */
+ public function addTemplateDir($template_dir, $key = null, $isConfig = false)
+ {
+ if ($isConfig) {
+ $processed = &$this->_processedConfigDir;
+ $dir = &$this->config_dir;
+ $this->_configDirNormalized = false;
+ } else {
+ $processed = &$this->_processedTemplateDir;
+ $dir = &$this->template_dir;
+ $this->_templateDirNormalized = false;
+ }
+ if (is_array($template_dir)) {
+ foreach ($template_dir as $k => $v) {
+ if (is_int($k)) {
+ // indexes are not merged but appended
+ $dir[] = $v;
+ } else {
+ // string indexes are overridden
+ $dir[ $k ] = $v;
+ unset($processed[ $key ]);
+ }
+ }
+ } else {
+ if ($key !== null) {
+ // override directory at specified index
+ $dir[ $key ] = $template_dir;
+ unset($processed[ $key ]);
+ } else {
+ // append new directory
+ $dir[] = $template_dir;
+ }
+ }
+ return $this;
+ }
+
+ /**
+ * Get template directories
+ *
+ * @param mixed $index index of directory to get, null to get all
+ * @param bool $isConfig true for config_dir
+ *
+ * @return array list of template directories, or directory of $index
+ */
+ public function getTemplateDir($index = null, $isConfig = false)
+ {
+ if ($isConfig) {
+ $dir = &$this->config_dir;
+ } else {
+ $dir = &$this->template_dir;
+ }
+ if ($isConfig ? !$this->_configDirNormalized : !$this->_templateDirNormalized) {
+ $this->_normalizeTemplateConfig($isConfig);
+ }
+ if ($index !== null) {
+ return isset($dir[ $index ]) ? $dir[ $index ] : null;
+ }
+ return $dir;
+ }
+
+ /**
+ * Set template directory
+ *
+ * @param string|array $template_dir directory(s) of template sources
+ * @param bool $isConfig true for config_dir
+ *
+ * @return \Smarty current Smarty instance for chaining
+ */
+ public function setTemplateDir($template_dir, $isConfig = false)
+ {
+ if ($isConfig) {
+ $this->config_dir = array();
+ $this->_processedConfigDir = array();
+ } else {
+ $this->template_dir = array();
+ $this->_processedTemplateDir = array();
+ }
+ $this->addTemplateDir($template_dir, null, $isConfig);
+ return $this;
+ }
+
+ /**
+ * Add config directory(s)
+ *
+ * @param string|array $config_dir directory(s) of config sources
+ * @param mixed $key key of the array element to assign the config dir to
+ *
+ * @return Smarty current Smarty instance for chaining
+ */
+ public function addConfigDir($config_dir, $key = null)
+ {
+ return $this->addTemplateDir($config_dir, $key, true);
+ }
+
+ /**
+ * Get config directory
+ *
+ * @param mixed $index index of directory to get, null to get all
+ *
+ * @return array configuration directory
+ */
+ public function getConfigDir($index = null)
+ {
+ return $this->getTemplateDir($index, true);
+ }
+
+ /**
+ * Set config directory
+ *
+ * @param $config_dir
+ *
+ * @return Smarty current Smarty instance for chaining
+ */
+ public function setConfigDir($config_dir)
+ {
+ return $this->setTemplateDir($config_dir, true);
+ }
+
+ /**
+ * Adds directory of plugin files
+ *
+ * @param null|array|string $plugins_dir
+ *
+ * @return Smarty current Smarty instance for chaining
+ */
+ public function addPluginsDir($plugins_dir)
+ {
+ if (empty($this->plugins_dir)) {
+ $this->plugins_dir[] = SMARTY_PLUGINS_DIR;
+ }
+ $this->plugins_dir = array_merge($this->plugins_dir, (array)$plugins_dir);
+ $this->_pluginsDirNormalized = false;
+ return $this;
+ }
+
+ /**
+ * Get plugin directories
+ *
+ * @return array list of plugin directories
+ */
+ public function getPluginsDir()
+ {
+ if (empty($this->plugins_dir)) {
+ $this->plugins_dir[] = SMARTY_PLUGINS_DIR;
+ $this->_pluginsDirNormalized = false;
+ }
+ if (!$this->_pluginsDirNormalized) {
+ if (!is_array($this->plugins_dir)) {
+ $this->plugins_dir = (array)$this->plugins_dir;
+ }
+ foreach ($this->plugins_dir as $k => $v) {
+ $this->plugins_dir[ $k ] = $this->_realpath(rtrim($v, '/\\') . DIRECTORY_SEPARATOR, true);
+ }
+ $this->_cache[ 'plugin_files' ] = array();
+ $this->_pluginsDirNormalized = true;
+ }
+ return $this->plugins_dir;
+ }
+
+ /**
+ * Set plugins directory
+ *
+ * @param string|array $plugins_dir directory(s) of plugins
+ *
+ * @return Smarty current Smarty instance for chaining
+ */
+ public function setPluginsDir($plugins_dir)
+ {
+ $this->plugins_dir = (array)$plugins_dir;
+ $this->_pluginsDirNormalized = false;
+ return $this;
+ }
+
+ /**
+ * Get compiled directory
+ *
+ * @return string path to compiled templates
+ */
+ public function getCompileDir()
+ {
+ if (!$this->_compileDirNormalized) {
+ $this->_normalizeDir('compile_dir', $this->compile_dir);
+ $this->_compileDirNormalized = true;
+ }
+ return $this->compile_dir;
+ }
+
+ /**
+ *
+ * @param string $compile_dir directory to store compiled templates in
+ *
+ * @return Smarty current Smarty instance for chaining
+ */
+ public function setCompileDir($compile_dir)
+ {
+ $this->_normalizeDir('compile_dir', $compile_dir);
+ $this->_compileDirNormalized = true;
+ return $this;
+ }
+
+ /**
+ * Get cache directory
+ *
+ * @return string path of cache directory
+ */
+ public function getCacheDir()
+ {
+ if (!$this->_cacheDirNormalized) {
+ $this->_normalizeDir('cache_dir', $this->cache_dir);
+ $this->_cacheDirNormalized = true;
+ }
+ return $this->cache_dir;
+ }
+
+ /**
+ * Set cache directory
+ *
+ * @param string $cache_dir directory to store cached templates in
+ *
+ * @return Smarty current Smarty instance for chaining
+ */
+ public function setCacheDir($cache_dir)
+ {
+ $this->_normalizeDir('cache_dir', $cache_dir);
+ $this->_cacheDirNormalized = true;
+ return $this;
+ }
+
+ /**
+ * creates a template object
+ *
+ * @param string $template the resource handle of the template file
+ * @param mixed $cache_id cache id to be used with this template
+ * @param mixed $compile_id compile id to be used with this template
+ * @param object $parent next higher level of Smarty variables
+ * @param boolean $do_clone flag is Smarty object shall be cloned
+ *
+ * @return \Smarty_Internal_Template template object
+ * @throws \SmartyException
+ */
+ public function createTemplate($template, $cache_id = null, $compile_id = null, $parent = null, $do_clone = true)
+ {
+ if ($cache_id !== null && (is_object($cache_id) || is_array($cache_id))) {
+ $parent = $cache_id;
+ $cache_id = null;
+ }
+ if ($parent !== null && is_array($parent)) {
+ $data = $parent;
+ $parent = null;
+ } else {
+ $data = null;
+ }
+ if (!$this->_templateDirNormalized) {
+ $this->_normalizeTemplateConfig(false);
+ }
+ $_templateId = $this->_getTemplateId($template, $cache_id, $compile_id);
+ $tpl = null;
+ if ($this->caching && isset(Smarty_Internal_Template::$isCacheTplObj[ $_templateId ])) {
+ $tpl = $do_clone ? clone Smarty_Internal_Template::$isCacheTplObj[ $_templateId ] :
+ Smarty_Internal_Template::$isCacheTplObj[ $_templateId ];
+ $tpl->inheritance = null;
+ $tpl->tpl_vars = $tpl->config_vars = array();
+ } elseif (!$do_clone && isset(Smarty_Internal_Template::$tplObjCache[ $_templateId ])) {
+ $tpl = clone Smarty_Internal_Template::$tplObjCache[ $_templateId ];
+ $tpl->inheritance = null;
+ $tpl->tpl_vars = $tpl->config_vars = array();
+ } else {
+ /* @var Smarty_Internal_Template $tpl */
+ $tpl = new $this->template_class($template, $this, null, $cache_id, $compile_id, null, null);
+ $tpl->templateId = $_templateId;
+ }
+ if ($do_clone) {
+ $tpl->smarty = clone $tpl->smarty;
+ }
+ $tpl->parent = $parent ? $parent : $this;
+ // fill data if present
+ if (!empty($data) && is_array($data)) {
+ // set up variable values
+ foreach ($data as $_key => $_val) {
+ $tpl->tpl_vars[ $_key ] = new Smarty_Variable($_val);
+ }
+ }
+ if ($this->debugging || $this->debugging_ctrl === 'URL') {
+ $tpl->smarty->_debug = new Smarty_Internal_Debug();
+ // check URL debugging control
+ if (!$this->debugging && $this->debugging_ctrl === 'URL') {
+ $tpl->smarty->_debug->debugUrl($tpl->smarty);
+ }
+ }
+ return $tpl;
+ }
+
+ /**
+ * Takes unknown classes and loads plugin files for them
+ * class name format: Smarty_PluginType_PluginName
+ * plugin filename format: plugintype.pluginname.php
+ *
+ * @param string $plugin_name class plugin name to load
+ * @param bool $check check if already loaded
+ *
+ * @return string |boolean filepath of loaded file or false
+ * @throws \SmartyException
+ */
+ public function loadPlugin($plugin_name, $check = true)
+ {
+ return $this->ext->loadPlugin->loadPlugin($this, $plugin_name, $check);
+ }
+
+ /**
+ * Get unique template id
+ *
+ * @param string $template_name
+ * @param null|mixed $cache_id
+ * @param null|mixed $compile_id
+ * @param null $caching
+ * @param \Smarty_Internal_Template $template
+ *
+ * @return string
+ * @throws \SmartyException
+ */
+ public function _getTemplateId(
+ $template_name,
+ $cache_id = null,
+ $compile_id = null,
+ $caching = null,
+ Smarty_Internal_Template $template = null
+ ) {
+ $template_name = (strpos($template_name, ':') === false) ? "{$this->default_resource_type}:{$template_name}" :
+ $template_name;
+ $cache_id = $cache_id === null ? $this->cache_id : $cache_id;
+ $compile_id = $compile_id === null ? $this->compile_id : $compile_id;
+ $caching = (int)($caching === null ? $this->caching : $caching);
+ if ((isset($template) && strpos($template_name, ':.') !== false) || $this->allow_ambiguous_resources) {
+ $_templateId =
+ Smarty_Resource::getUniqueTemplateName((isset($template) ? $template : $this), $template_name) .
+ "#{$cache_id}#{$compile_id}#{$caching}";
+ } else {
+ $_templateId = $this->_joined_template_dir . "#{$template_name}#{$cache_id}#{$compile_id}#{$caching}";
+ }
+ if (isset($_templateId[ 150 ])) {
+ $_templateId = sha1($_templateId);
+ }
+ return $_templateId;
+ }
+
+ /**
+ * Normalize path
+ * - remove /./ and /../
+ * - make it absolute if required
+ *
+ * @param string $path file path
+ * @param bool $realpath if true - convert to absolute
+ * false - convert to relative
+ * null - keep as it is but
+ * remove /./ /../
+ *
+ * @return string
+ */
+ public function _realpath($path, $realpath = null)
+ {
+ $nds = array('/' => '\\', '\\' => '/');
+ preg_match(
+ '%^(?(?:[[:alpha:]]:[\\\\/]|/|[\\\\]{2}[[:alpha:]]+|[[:print:]]{2,}:[/]{2}|[\\\\])?)(?(.*))$%u',
+ $path,
+ $parts
+ );
+ $path = $parts[ 'path' ];
+ if ($parts[ 'root' ] === '\\') {
+ $parts[ 'root' ] = substr(getcwd(), 0, 2) . $parts[ 'root' ];
+ } else {
+ if ($realpath !== null && !$parts[ 'root' ]) {
+ $path = getcwd() . DIRECTORY_SEPARATOR . $path;
+ }
+ }
+ // normalize DIRECTORY_SEPARATOR
+ $path = str_replace($nds[ DIRECTORY_SEPARATOR ], DIRECTORY_SEPARATOR, $path);
+ $parts[ 'root' ] = str_replace($nds[ DIRECTORY_SEPARATOR ], DIRECTORY_SEPARATOR, $parts[ 'root' ]);
+ do {
+ $path = preg_replace(
+ array('#[\\\\/]{2}#', '#[\\\\/][.][\\\\/]#', '#[\\\\/]([^\\\\/.]+)[\\\\/][.][.][\\\\/]#'),
+ DIRECTORY_SEPARATOR,
+ $path,
+ -1,
+ $count
+ );
+ } while ($count > 0);
+ return $realpath !== false ? $parts[ 'root' ] . $path : str_ireplace(getcwd(), '.', $parts[ 'root' ] . $path);
+ }
+
+ /**
+ * Empty template objects cache
+ */
+ public function _clearTemplateCache()
+ {
+ Smarty_Internal_Template::$isCacheTplObj = array();
+ Smarty_Internal_Template::$tplObjCache = array();
+ }
+
+ /**
+ * @param boolean $use_sub_dirs
+ */
+ public function setUseSubDirs($use_sub_dirs)
+ {
+ $this->use_sub_dirs = $use_sub_dirs;
+ }
+
+ /**
+ * @param int $error_reporting
+ */
+ public function setErrorReporting($error_reporting)
+ {
+ $this->error_reporting = $error_reporting;
+ }
+
+ /**
+ * @param boolean $escape_html
+ */
+ public function setEscapeHtml($escape_html)
+ {
+ $this->escape_html = $escape_html;
+ }
+
+ /**
+ * Return auto_literal flag
+ *
+ * @return boolean
+ */
+ public function getAutoLiteral()
+ {
+ return $this->auto_literal;
+ }
+
+ /**
+ * Set auto_literal flag
+ *
+ * @param boolean $auto_literal
+ */
+ public function setAutoLiteral($auto_literal = true)
+ {
+ $this->auto_literal = $auto_literal;
+ }
+
+ /**
+ * @param boolean $force_compile
+ */
+ public function setForceCompile($force_compile)
+ {
+ $this->force_compile = $force_compile;
+ }
+
+ /**
+ * @param boolean $merge_compiled_includes
+ */
+ public function setMergeCompiledIncludes($merge_compiled_includes)
+ {
+ $this->merge_compiled_includes = $merge_compiled_includes;
+ }
+
+ /**
+ * Get left delimiter
+ *
+ * @return string
+ */
+ public function getLeftDelimiter()
+ {
+ return $this->left_delimiter;
+ }
+
+ /**
+ * Set left delimiter
+ *
+ * @param string $left_delimiter
+ */
+ public function setLeftDelimiter($left_delimiter)
+ {
+ $this->left_delimiter = $left_delimiter;
+ }
+
+ /**
+ * Get right delimiter
+ *
+ * @return string $right_delimiter
+ */
+ public function getRightDelimiter()
+ {
+ return $this->right_delimiter;
+ }
+
+ /**
+ * Set right delimiter
+ *
+ * @param string
+ */
+ public function setRightDelimiter($right_delimiter)
+ {
+ $this->right_delimiter = $right_delimiter;
+ }
+
+ /**
+ * @param boolean $debugging
+ */
+ public function setDebugging($debugging)
+ {
+ $this->debugging = $debugging;
+ }
+
+ /**
+ * @param boolean $config_overwrite
+ */
+ public function setConfigOverwrite($config_overwrite)
+ {
+ $this->config_overwrite = $config_overwrite;
+ }
+
+ /**
+ * @param boolean $config_booleanize
+ */
+ public function setConfigBooleanize($config_booleanize)
+ {
+ $this->config_booleanize = $config_booleanize;
+ }
+
+ /**
+ * @param boolean $config_read_hidden
+ */
+ public function setConfigReadHidden($config_read_hidden)
+ {
+ $this->config_read_hidden = $config_read_hidden;
+ }
+
+ /**
+ * @param boolean $compile_locking
+ */
+ public function setCompileLocking($compile_locking)
+ {
+ $this->compile_locking = $compile_locking;
+ }
+
+ /**
+ * @param string $default_resource_type
+ */
+ public function setDefaultResourceType($default_resource_type)
+ {
+ $this->default_resource_type = $default_resource_type;
+ }
+
+ /**
+ * @param string $caching_type
+ */
+ public function setCachingType($caching_type)
+ {
+ $this->caching_type = $caching_type;
+ }
+
+ /**
+ * Test install
+ *
+ * @param null $errors
+ */
+ public function testInstall(&$errors = null)
+ {
+ Smarty_Internal_TestInstall::testInstall($this, $errors);
+ }
+
+ /**
+ * Get Smarty object
+ *
+ * @return Smarty
+ */
+ public function _getSmartyObj()
+ {
+ return $this;
+ }
+
+ /**
+ * <> Generic getter.
+ * Calls the appropriate getter function.
+ * Issues an E_USER_NOTICE if no valid getter is found.
+ *
+ * @param string $name property name
+ *
+ * @return mixed
+ */
+ public function __get($name)
+ {
+ if (isset($this->accessMap[ $name ])) {
+ $method = 'get' . $this->accessMap[ $name ];
+ return $this->{$method}();
+ } elseif (isset($this->_cache[ $name ])) {
+ return $this->_cache[ $name ];
+ } elseif (in_array($name, $this->obsoleteProperties)) {
+ return null;
+ } else {
+ trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE);
+ }
+ return null;
+ }
+
+ /**
+ * <> Generic setter.
+ * Calls the appropriate setter function.
+ * Issues an E_USER_NOTICE if no valid setter is found.
+ *
+ * @param string $name property name
+ * @param mixed $value parameter passed to setter
+ *
+ */
+ public function __set($name, $value)
+ {
+ if (isset($this->accessMap[ $name ])) {
+ $method = 'set' . $this->accessMap[ $name ];
+ $this->{$method}($value);
+ } elseif (in_array($name, $this->obsoleteProperties)) {
+ return;
+ } elseif (is_object($value) && method_exists($value, $name)) {
+ $this->$name = $value;
+ } else {
+ trigger_error('Undefined property: ' . get_class($this) . '::$' . $name, E_USER_NOTICE);
+ }
+ }
+
+ /**
+ * Normalize and set directory string
+ *
+ * @param string $dirName cache_dir or compile_dir
+ * @param string $dir filepath of folder
+ */
+ private function _normalizeDir($dirName, $dir)
+ {
+ $this->{$dirName} = $this->_realpath(rtrim($dir, "/\\") . DIRECTORY_SEPARATOR, true);
+ if (class_exists('Smarty_Internal_ErrorHandler', false)) {
+ if (!isset(Smarty_Internal_ErrorHandler::$mutedDirectories[ $this->{$dirName} ])) {
+ Smarty_Internal_ErrorHandler::$mutedDirectories[ $this->{$dirName} ] = null;
+ }
+ }
+ }
+
+ /**
+ * Normalize template_dir or config_dir
+ *
+ * @param bool $isConfig true for config_dir
+ */
+ private function _normalizeTemplateConfig($isConfig)
+ {
+ if ($isConfig) {
+ $processed = &$this->_processedConfigDir;
+ $dir = &$this->config_dir;
+ } else {
+ $processed = &$this->_processedTemplateDir;
+ $dir = &$this->template_dir;
+ }
+ if (!is_array($dir)) {
+ $dir = (array)$dir;
+ }
+ foreach ($dir as $k => $v) {
+ if (!isset($processed[ $k ])) {
+ $dir[ $k ] = $v = $this->_realpath(rtrim($v, "/\\") . DIRECTORY_SEPARATOR, true);
+ $processed[ $k ] = true;
+ }
+ }
+ $isConfig ? $this->_configDirNormalized = true : $this->_templateDirNormalized = true;
+ $isConfig ? $this->_joined_config_dir = join('#', $this->config_dir) :
+ $this->_joined_template_dir = join('#', $this->template_dir);
+ }
+}
diff --git a/libs/SmartyBC.class.php b/libs/SmartyBC.class.php
new file mode 100644
index 0000000..836f981
--- /dev/null
+++ b/libs/SmartyBC.class.php
@@ -0,0 +1,477 @@
+
+ * @author Uwe Tews
+ * @author Rodney Rehm
+ * @package Smarty
+ */
+/**
+ * @ignore
+ */
+require_once dirname(__FILE__) . '/Smarty.class.php';
+
+/**
+ * Smarty Backward Compatibility Wrapper Class
+ *
+ * @package Smarty
+ */
+class SmartyBC extends Smarty
+{
+ /**
+ * Smarty 2 BC
+ *
+ * @var string
+ */
+ public $_version = self::SMARTY_VERSION;
+
+ /**
+ * This is an array of directories where trusted php scripts reside.
+ *
+ * @var array
+ */
+ public $trusted_dir = array();
+
+ /**
+ * Initialize new SmartyBC object
+ */
+ public function __construct()
+ {
+ parent::__construct();
+ }
+
+ /**
+ * wrapper for assign_by_ref
+ *
+ * @param string $tpl_var the template variable name
+ * @param mixed &$value the referenced value to assign
+ */
+ public function assign_by_ref($tpl_var, &$value)
+ {
+ $this->assignByRef($tpl_var, $value);
+ }
+
+ /**
+ * wrapper for append_by_ref
+ *
+ * @param string $tpl_var the template variable name
+ * @param mixed &$value the referenced value to append
+ * @param boolean $merge flag if array elements shall be merged
+ */
+ public function append_by_ref($tpl_var, &$value, $merge = false)
+ {
+ $this->appendByRef($tpl_var, $value, $merge);
+ }
+
+ /**
+ * clear the given assigned template variable.
+ *
+ * @param string $tpl_var the template variable to clear
+ */
+ public function clear_assign($tpl_var)
+ {
+ $this->clearAssign($tpl_var);
+ }
+
+ /**
+ * Registers custom function to be used in templates
+ *
+ * @param string $function the name of the template function
+ * @param string $function_impl the name of the PHP function to register
+ * @param bool $cacheable
+ * @param mixed $cache_attrs
+ *
+ * @throws \SmartyException
+ */
+ public function register_function($function, $function_impl, $cacheable = true, $cache_attrs = null)
+ {
+ $this->registerPlugin('function', $function, $function_impl, $cacheable, $cache_attrs);
+ }
+
+ /**
+ * Unregister custom function
+ *
+ * @param string $function name of template function
+ */
+ public function unregister_function($function)
+ {
+ $this->unregisterPlugin('function', $function);
+ }
+
+ /**
+ * Registers object to be used in templates
+ *
+ * @param string $object name of template object
+ * @param object $object_impl the referenced PHP object to register
+ * @param array $allowed list of allowed methods (empty = all)
+ * @param boolean $smarty_args smarty argument format, else traditional
+ * @param array $block_methods list of methods that are block format
+ *
+ * @throws SmartyException
+ * @internal param array $block_functs list of methods that are block format
+ */
+ public function register_object(
+ $object,
+ $object_impl,
+ $allowed = array(),
+ $smarty_args = true,
+ $block_methods = array()
+ ) {
+ settype($allowed, 'array');
+ settype($smarty_args, 'boolean');
+ $this->registerObject($object, $object_impl, $allowed, $smarty_args, $block_methods);
+ }
+
+ /**
+ * Unregister object
+ *
+ * @param string $object name of template object
+ */
+ public function unregister_object($object)
+ {
+ $this->unregisterObject($object);
+ }
+
+ /**
+ * Registers block function to be used in templates
+ *
+ * @param string $block name of template block
+ * @param string $block_impl PHP function to register
+ * @param bool $cacheable
+ * @param mixed $cache_attrs
+ *
+ * @throws \SmartyException
+ */
+ public function register_block($block, $block_impl, $cacheable = true, $cache_attrs = null)
+ {
+ $this->registerPlugin('block', $block, $block_impl, $cacheable, $cache_attrs);
+ }
+
+ /**
+ * Unregister block function
+ *
+ * @param string $block name of template function
+ */
+ public function unregister_block($block)
+ {
+ $this->unregisterPlugin('block', $block);
+ }
+
+ /**
+ * Registers compiler function
+ *
+ * @param string $function name of template function
+ * @param string $function_impl name of PHP function to register
+ * @param bool $cacheable
+ *
+ * @throws \SmartyException
+ */
+ public function register_compiler_function($function, $function_impl, $cacheable = true)
+ {
+ $this->registerPlugin('compiler', $function, $function_impl, $cacheable);
+ }
+
+ /**
+ * Unregister compiler function
+ *
+ * @param string $function name of template function
+ */
+ public function unregister_compiler_function($function)
+ {
+ $this->unregisterPlugin('compiler', $function);
+ }
+
+ /**
+ * Registers modifier to be used in templates
+ *
+ * @param string $modifier name of template modifier
+ * @param string $modifier_impl name of PHP function to register
+ *
+ * @throws \SmartyException
+ */
+ public function register_modifier($modifier, $modifier_impl)
+ {
+ $this->registerPlugin('modifier', $modifier, $modifier_impl);
+ }
+
+ /**
+ * Unregister modifier
+ *
+ * @param string $modifier name of template modifier
+ */
+ public function unregister_modifier($modifier)
+ {
+ $this->unregisterPlugin('modifier', $modifier);
+ }
+
+ /**
+ * Registers a resource to fetch a template
+ *
+ * @param string $type name of resource
+ * @param array $functions array of functions to handle resource
+ */
+ public function register_resource($type, $functions)
+ {
+ $this->registerResource($type, $functions);
+ }
+
+ /**
+ * Unregister a resource
+ *
+ * @param string $type name of resource
+ */
+ public function unregister_resource($type)
+ {
+ $this->unregisterResource($type);
+ }
+
+ /**
+ * Registers a prefilter function to apply
+ * to a template before compiling
+ *
+ * @param callable $function
+ *
+ * @throws \SmartyException
+ */
+ public function register_prefilter($function)
+ {
+ $this->registerFilter('pre', $function);
+ }
+
+ /**
+ * Unregister a prefilter function
+ *
+ * @param callable $function
+ */
+ public function unregister_prefilter($function)
+ {
+ $this->unregisterFilter('pre', $function);
+ }
+
+ /**
+ * Registers a postfilter function to apply
+ * to a compiled template after compilation
+ *
+ * @param callable $function
+ *
+ * @throws \SmartyException
+ */
+ public function register_postfilter($function)
+ {
+ $this->registerFilter('post', $function);
+ }
+
+ /**
+ * Unregister a postfilter function
+ *
+ * @param callable $function
+ */
+ public function unregister_postfilter($function)
+ {
+ $this->unregisterFilter('post', $function);
+ }
+
+ /**
+ * Registers an output filter function to apply
+ * to a template output
+ *
+ * @param callable $function
+ *
+ * @throws \SmartyException
+ */
+ public function register_outputfilter($function)
+ {
+ $this->registerFilter('output', $function);
+ }
+
+ /**
+ * Unregister an outputfilter function
+ *
+ * @param callable $function
+ */
+ public function unregister_outputfilter($function)
+ {
+ $this->unregisterFilter('output', $function);
+ }
+
+ /**
+ * load a filter of specified type and name
+ *
+ * @param string $type filter type
+ * @param string $name filter name
+ *
+ * @throws \SmartyException
+ */
+ public function load_filter($type, $name)
+ {
+ $this->loadFilter($type, $name);
+ }
+
+ /**
+ * clear cached content for the given template and cache id
+ *
+ * @param string $tpl_file name of template file
+ * @param string $cache_id name of cache_id
+ * @param string $compile_id name of compile_id
+ * @param string $exp_time expiration time
+ *
+ * @return boolean
+ */
+ public function clear_cache($tpl_file = null, $cache_id = null, $compile_id = null, $exp_time = null)
+ {
+ return $this->clearCache($tpl_file, $cache_id, $compile_id, $exp_time);
+ }
+
+ /**
+ * clear the entire contents of cache (all templates)
+ *
+ * @param string $exp_time expire time
+ *
+ * @return boolean
+ */
+ public function clear_all_cache($exp_time = null)
+ {
+ return $this->clearCache(null, null, null, $exp_time);
+ }
+
+ /**
+ * test to see if valid cache exists for this template
+ *
+ * @param string $tpl_file name of template file
+ * @param string $cache_id
+ * @param string $compile_id
+ *
+ * @return bool
+ * @throws \Exception
+ * @throws \SmartyException
+ */
+ public function is_cached($tpl_file, $cache_id = null, $compile_id = null)
+ {
+ return $this->isCached($tpl_file, $cache_id, $compile_id);
+ }
+
+ /**
+ * clear all the assigned template variables.
+ */
+ public function clear_all_assign()
+ {
+ $this->clearAllAssign();
+ }
+
+ /**
+ * clears compiled version of specified template resource,
+ * or all compiled template files if one is not specified.
+ * This function is for advanced use only, not normally needed.
+ *
+ * @param string $tpl_file
+ * @param string $compile_id
+ * @param string $exp_time
+ *
+ * @return boolean results of {@link smarty_core_rm_auto()}
+ */
+ public function clear_compiled_tpl($tpl_file = null, $compile_id = null, $exp_time = null)
+ {
+ return $this->clearCompiledTemplate($tpl_file, $compile_id, $exp_time);
+ }
+
+ /**
+ * Checks whether requested template exists.
+ *
+ * @param string $tpl_file
+ *
+ * @return bool
+ * @throws \SmartyException
+ */
+ public function template_exists($tpl_file)
+ {
+ return $this->templateExists($tpl_file);
+ }
+
+ /**
+ * Returns an array containing template variables
+ *
+ * @param string $name
+ *
+ * @return array
+ */
+ public function get_template_vars($name = null)
+ {
+ return $this->getTemplateVars($name);
+ }
+
+ /**
+ * Returns an array containing config variables
+ *
+ * @param string $name
+ *
+ * @return array
+ */
+ public function get_config_vars($name = null)
+ {
+ return $this->getConfigVars($name);
+ }
+
+ /**
+ * load configuration values
+ *
+ * @param string $file
+ * @param string $section
+ * @param string $scope
+ */
+ public function config_load($file, $section = null, $scope = 'global')
+ {
+ $this->ConfigLoad($file, $section, $scope);
+ }
+
+ /**
+ * return a reference to a registered object
+ *
+ * @param string $name
+ *
+ * @return object
+ */
+ public function get_registered_object($name)
+ {
+ return $this->getRegisteredObject($name);
+ }
+
+ /**
+ * clear configuration values
+ *
+ * @param string $var
+ */
+ public function clear_config($var = null)
+ {
+ $this->clearConfig($var);
+ }
+
+ /**
+ * trigger Smarty error
+ *
+ * @param string $error_msg
+ * @param integer $error_type
+ */
+ public function trigger_error($error_msg, $error_type = E_USER_WARNING)
+ {
+ trigger_error("Smarty error: $error_msg", $error_type);
+ }
+}
diff --git a/libs/bootstrap.php b/libs/bootstrap.php
new file mode 100644
index 0000000..2c83046
--- /dev/null
+++ b/libs/bootstrap.php
@@ -0,0 +1,16 @@
+
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+/**
+ * Load and register Smarty Autoloader
+ */
+if (!class_exists('Smarty_Autoloader')) {
+ include dirname(__FILE__) . '/Autoloader.php';
+}
+Smarty_Autoloader::register(true);
diff --git a/libs/debug.tpl b/libs/debug.tpl
new file mode 100644
index 0000000..edc7bef
--- /dev/null
+++ b/libs/debug.tpl
@@ -0,0 +1,160 @@
+{capture name='_smarty_debug' assign=debug_output}
+
+
+
+ Smarty Debug Console
+
+
+
+
+ Smarty {Smarty::SMARTY_VERSION} Debug Console
+ - {if isset($template_name)}{$template_name|debug_print_var nofilter} {/if}{if !empty($template_data)}Total Time {$execution_time|string_format:"%.5f"}{/if}
+
+ {if !empty($template_data)}
+ included templates & config files (load time in seconds)
+
+ {foreach $template_data as $template}
+ {$template.name}
+
+ (compile {$template['compile_time']|string_format:"%.5f"}) (render {$template['render_time']|string_format:"%.5f"}) (cache {$template['cache_time']|string_format:"%.5f"})
+
+
+ {/foreach}
+
+ {/if}
+
+ assigned template variables
+
+
+ {foreach $assigned_vars as $vars}
+
+ ${$vars@key}
+ {if isset($vars['nocache'])}Nocache {/if}
+ {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var nofilter}{/if}
+ |
+ Value{$vars['value']|debug_print_var:10:80 nofilter} |
+ {if isset($vars['attributes'])}Attributes{$vars['attributes']|debug_print_var nofilter} {/if} |
+ {/foreach}
+
+
+ assigned config file variables
+
+
+ {foreach $config_vars as $vars}
+
+ #{$vars@key}#
+ {if isset($vars['scope'])}Origin: {$vars['scope']|debug_print_var nofilter}{/if}
+ |
+ {$vars['value']|debug_print_var:10:80 nofilter} |
+
+ {/foreach}
+
+
+
+
+{/capture}
+
diff --git a/libs/plugins/block.textformat.php b/libs/plugins/block.textformat.php
new file mode 100644
index 0000000..5e49463
--- /dev/null
+++ b/libs/plugins/block.textformat.php
@@ -0,0 +1,121 @@
+
+ * @throws \SmartyException
+ */
+function smarty_block_textformat($params, $content, Smarty_Internal_Template $template, &$repeat)
+{
+ if (is_null($content)) {
+ return;
+ }
+ if (Smarty::$_MBSTRING) {
+ $template->_checkPlugins(
+ array(
+ array(
+ 'function' => 'smarty_modifier_mb_wordwrap',
+ 'file' => SMARTY_PLUGINS_DIR . 'modifier.mb_wordwrap.php'
+ )
+ )
+ );
+ }
+ $style = null;
+ $indent = 0;
+ $indent_first = 0;
+ $indent_char = ' ';
+ $wrap = 80;
+ $wrap_char = "\n";
+ $wrap_cut = false;
+ $assign = null;
+ foreach ($params as $_key => $_val) {
+ switch ($_key) {
+ case 'style':
+ case 'indent_char':
+ case 'wrap_char':
+ case 'assign':
+ $$_key = (string)$_val;
+ break;
+ case 'indent':
+ case 'indent_first':
+ case 'wrap':
+ $$_key = (int)$_val;
+ break;
+ case 'wrap_cut':
+ $$_key = (bool)$_val;
+ break;
+ default:
+ trigger_error("textformat: unknown attribute '{$_key}'");
+ }
+ }
+ if ($style === 'email') {
+ $wrap = 72;
+ }
+ // split into paragraphs
+ $_paragraphs = preg_split('![\r\n]{2}!', $content);
+ foreach ($_paragraphs as &$_paragraph) {
+ if (!$_paragraph) {
+ continue;
+ }
+ // convert mult. spaces & special chars to single space
+ $_paragraph =
+ preg_replace(
+ array(
+ '!\s+!' . Smarty::$_UTF8_MODIFIER,
+ '!(^\s+)|(\s+$)!' . Smarty::$_UTF8_MODIFIER
+ ),
+ array(
+ ' ',
+ ''
+ ),
+ $_paragraph
+ );
+ // indent first line
+ if ($indent_first > 0) {
+ $_paragraph = str_repeat($indent_char, $indent_first) . $_paragraph;
+ }
+ // wordwrap sentences
+ if (Smarty::$_MBSTRING) {
+ $_paragraph = smarty_modifier_mb_wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);
+ } else {
+ $_paragraph = wordwrap($_paragraph, $wrap - $indent, $wrap_char, $wrap_cut);
+ }
+ // indent lines
+ if ($indent > 0) {
+ $_paragraph = preg_replace('!^!m', str_repeat($indent_char, $indent), $_paragraph);
+ }
+ }
+ $_output = implode($wrap_char . $wrap_char, $_paragraphs);
+ if ($assign) {
+ $template->assign($assign, $_output);
+ } else {
+ return $_output;
+ }
+}
diff --git a/libs/plugins/function.counter.php b/libs/plugins/function.counter.php
new file mode 100644
index 0000000..a4129e7
--- /dev/null
+++ b/libs/plugins/function.counter.php
@@ -0,0 +1,62 @@
+
+ * @link http://www.smarty.net/manual/en/language.function.counter.php {counter}
+ * (Smarty online manual)
+ *
+ * @param array $params parameters
+ * @param Smarty_Internal_Template $template template object
+ *
+ * @return string|null
+ */
+function smarty_function_counter($params, $template)
+{
+ static $counters = array();
+ $name = (isset($params[ 'name' ])) ? $params[ 'name' ] : 'default';
+ if (!isset($counters[ $name ])) {
+ $counters[ $name ] = array('start' => 1, 'skip' => 1, 'direction' => 'up', 'count' => 1);
+ }
+ $counter =& $counters[ $name ];
+ if (isset($params[ 'start' ])) {
+ $counter[ 'start' ] = $counter[ 'count' ] = (int)$params[ 'start' ];
+ }
+ if (!empty($params[ 'assign' ])) {
+ $counter[ 'assign' ] = $params[ 'assign' ];
+ }
+ if (isset($counter[ 'assign' ])) {
+ $template->assign($counter[ 'assign' ], $counter[ 'count' ]);
+ }
+ if (isset($params[ 'print' ])) {
+ $print = (bool)$params[ 'print' ];
+ } else {
+ $print = empty($counter[ 'assign' ]);
+ }
+ if ($print) {
+ $retval = $counter[ 'count' ];
+ } else {
+ $retval = null;
+ }
+ if (isset($params[ 'skip' ])) {
+ $counter[ 'skip' ] = $params[ 'skip' ];
+ }
+ if (isset($params[ 'direction' ])) {
+ $counter[ 'direction' ] = $params[ 'direction' ];
+ }
+ if ($counter[ 'direction' ] === 'down') {
+ $counter[ 'count' ] -= $counter[ 'skip' ];
+ } else {
+ $counter[ 'count' ] += $counter[ 'skip' ];
+ }
+ return $retval;
+}
diff --git a/libs/plugins/function.cycle.php b/libs/plugins/function.cycle.php
new file mode 100644
index 0000000..07ffcc5
--- /dev/null
+++ b/libs/plugins/function.cycle.php
@@ -0,0 +1,92 @@
+
+ * @author credit to Mark Priatel
+ * @author credit to Gerard
+ * @author credit to Jason Sweat
+ * @version 1.3
+ *
+ * @param array $params parameters
+ * @param Smarty_Internal_Template $template template object
+ *
+ * @return string|null
+ */
+function smarty_function_cycle($params, $template)
+{
+ static $cycle_vars;
+ $name = (empty($params[ 'name' ])) ? 'default' : $params[ 'name' ];
+ $print = (isset($params[ 'print' ])) ? (bool)$params[ 'print' ] : true;
+ $advance = (isset($params[ 'advance' ])) ? (bool)$params[ 'advance' ] : true;
+ $reset = (isset($params[ 'reset' ])) ? (bool)$params[ 'reset' ] : false;
+ if (!isset($params[ 'values' ])) {
+ if (!isset($cycle_vars[ $name ][ 'values' ])) {
+ trigger_error('cycle: missing \'values\' parameter');
+ return;
+ }
+ } else {
+ if (isset($cycle_vars[ $name ][ 'values' ]) && $cycle_vars[ $name ][ 'values' ] !== $params[ 'values' ]) {
+ $cycle_vars[ $name ][ 'index' ] = 0;
+ }
+ $cycle_vars[ $name ][ 'values' ] = $params[ 'values' ];
+ }
+ if (isset($params[ 'delimiter' ])) {
+ $cycle_vars[ $name ][ 'delimiter' ] = $params[ 'delimiter' ];
+ } elseif (!isset($cycle_vars[ $name ][ 'delimiter' ])) {
+ $cycle_vars[ $name ][ 'delimiter' ] = ',';
+ }
+ if (is_array($cycle_vars[ $name ][ 'values' ])) {
+ $cycle_array = $cycle_vars[ $name ][ 'values' ];
+ } else {
+ $cycle_array = explode($cycle_vars[ $name ][ 'delimiter' ], $cycle_vars[ $name ][ 'values' ]);
+ }
+ if (!isset($cycle_vars[ $name ][ 'index' ]) || $reset) {
+ $cycle_vars[ $name ][ 'index' ] = 0;
+ }
+ if (isset($params[ 'assign' ])) {
+ $print = false;
+ $template->assign($params[ 'assign' ], $cycle_array[ $cycle_vars[ $name ][ 'index' ] ]);
+ }
+ if ($print) {
+ $retval = $cycle_array[ $cycle_vars[ $name ][ 'index' ] ];
+ } else {
+ $retval = null;
+ }
+ if ($advance) {
+ if ($cycle_vars[ $name ][ 'index' ] >= count($cycle_array) - 1) {
+ $cycle_vars[ $name ][ 'index' ] = 0;
+ } else {
+ $cycle_vars[ $name ][ 'index' ]++;
+ }
+ }
+ return $retval;
+}
diff --git a/libs/plugins/function.fetch.php b/libs/plugins/function.fetch.php
new file mode 100644
index 0000000..768761b
--- /dev/null
+++ b/libs/plugins/function.fetch.php
@@ -0,0 +1,204 @@
+
+ *
+ * @param array $params parameters
+ * @param Smarty_Internal_Template $template template object
+ *
+ * @throws SmartyException
+ * @return string|null if the assign parameter is passed, Smarty assigns the result to a template variable
+ */
+function smarty_function_fetch($params, $template)
+{
+ if (empty($params[ 'file' ])) {
+ trigger_error('[plugin] fetch parameter \'file\' cannot be empty', E_USER_NOTICE);
+ return;
+ }
+ // strip file protocol
+ if (stripos($params[ 'file' ], 'file://') === 0) {
+ $params[ 'file' ] = substr($params[ 'file' ], 7);
+ }
+ $protocol = strpos($params[ 'file' ], '://');
+ if ($protocol !== false) {
+ $protocol = strtolower(substr($params[ 'file' ], 0, $protocol));
+ }
+ if (isset($template->smarty->security_policy)) {
+ if ($protocol) {
+ // remote resource (or php stream, …)
+ if (!$template->smarty->security_policy->isTrustedUri($params[ 'file' ])) {
+ return;
+ }
+ } else {
+ // local file
+ if (!$template->smarty->security_policy->isTrustedResourceDir($params[ 'file' ])) {
+ return;
+ }
+ }
+ }
+ $content = '';
+ if ($protocol === 'http') {
+ // http fetch
+ if ($uri_parts = parse_url($params[ 'file' ])) {
+ // set defaults
+ $host = $server_name = $uri_parts[ 'host' ];
+ $timeout = 30;
+ $accept = 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*';
+ $agent = 'Smarty Template Engine ' . Smarty::SMARTY_VERSION;
+ $referer = '';
+ $uri = !empty($uri_parts[ 'path' ]) ? $uri_parts[ 'path' ] : '/';
+ $uri .= !empty($uri_parts[ 'query' ]) ? '?' . $uri_parts[ 'query' ] : '';
+ $_is_proxy = false;
+ if (empty($uri_parts[ 'port' ])) {
+ $port = 80;
+ } else {
+ $port = $uri_parts[ 'port' ];
+ }
+ if (!empty($uri_parts[ 'user' ])) {
+ $user = $uri_parts[ 'user' ];
+ }
+ if (!empty($uri_parts[ 'pass' ])) {
+ $pass = $uri_parts[ 'pass' ];
+ }
+ // loop through parameters, setup headers
+ foreach ($params as $param_key => $param_value) {
+ switch ($param_key) {
+ case 'file':
+ case 'assign':
+ case 'assign_headers':
+ break;
+ case 'user':
+ if (!empty($param_value)) {
+ $user = $param_value;
+ }
+ break;
+ case 'pass':
+ if (!empty($param_value)) {
+ $pass = $param_value;
+ }
+ break;
+ case 'accept':
+ if (!empty($param_value)) {
+ $accept = $param_value;
+ }
+ break;
+ case 'header':
+ if (!empty($param_value)) {
+ if (!preg_match('![\w\d-]+: .+!', $param_value)) {
+ trigger_error("[plugin] invalid header format '{$param_value}'", E_USER_NOTICE);
+ return;
+ } else {
+ $extra_headers[] = $param_value;
+ }
+ }
+ break;
+ case 'proxy_host':
+ if (!empty($param_value)) {
+ $proxy_host = $param_value;
+ }
+ break;
+ case 'proxy_port':
+ if (!preg_match('!\D!', $param_value)) {
+ $proxy_port = (int)$param_value;
+ } else {
+ trigger_error("[plugin] invalid value for attribute '{$param_key }'", E_USER_NOTICE);
+ return;
+ }
+ break;
+ case 'agent':
+ if (!empty($param_value)) {
+ $agent = $param_value;
+ }
+ break;
+ case 'referer':
+ if (!empty($param_value)) {
+ $referer = $param_value;
+ }
+ break;
+ case 'timeout':
+ if (!preg_match('!\D!', $param_value)) {
+ $timeout = (int)$param_value;
+ } else {
+ trigger_error("[plugin] invalid value for attribute '{$param_key}'", E_USER_NOTICE);
+ return;
+ }
+ break;
+ default:
+ trigger_error("[plugin] unrecognized attribute '{$param_key}'", E_USER_NOTICE);
+ return;
+ }
+ }
+ if (!empty($proxy_host) && !empty($proxy_port)) {
+ $_is_proxy = true;
+ $fp = fsockopen($proxy_host, $proxy_port, $errno, $errstr, $timeout);
+ } else {
+ $fp = fsockopen($server_name, $port, $errno, $errstr, $timeout);
+ }
+ if (!$fp) {
+ trigger_error("[plugin] unable to fetch: $errstr ($errno)", E_USER_NOTICE);
+ return;
+ } else {
+ if ($_is_proxy) {
+ fputs($fp, 'GET ' . $params[ 'file' ] . " HTTP/1.0\r\n");
+ } else {
+ fputs($fp, "GET $uri HTTP/1.0\r\n");
+ }
+ if (!empty($host)) {
+ fputs($fp, "Host: $host\r\n");
+ }
+ if (!empty($accept)) {
+ fputs($fp, "Accept: $accept\r\n");
+ }
+ if (!empty($agent)) {
+ fputs($fp, "User-Agent: $agent\r\n");
+ }
+ if (!empty($referer)) {
+ fputs($fp, "Referer: $referer\r\n");
+ }
+ if (isset($extra_headers) && is_array($extra_headers)) {
+ foreach ($extra_headers as $curr_header) {
+ fputs($fp, $curr_header . "\r\n");
+ }
+ }
+ if (!empty($user) && !empty($pass)) {
+ fputs($fp, 'Authorization: BASIC ' . base64_encode("$user:$pass") . "\r\n");
+ }
+ fputs($fp, "\r\n");
+ while (!feof($fp)) {
+ $content .= fgets($fp, 4096);
+ }
+ fclose($fp);
+ $csplit = preg_split("!\r\n\r\n!", $content, 2);
+ $content = $csplit[ 1 ];
+ if (!empty($params[ 'assign_headers' ])) {
+ $template->assign($params[ 'assign_headers' ], preg_split("!\r\n!", $csplit[ 0 ]));
+ }
+ }
+ } else {
+ trigger_error("[plugin fetch] unable to parse URL, check syntax", E_USER_NOTICE);
+ return;
+ }
+ } else {
+ $content = @file_get_contents($params[ 'file' ]);
+ if ($content === false) {
+ throw new SmartyException("{fetch} cannot read resource '" . $params[ 'file' ] . "'");
+ }
+ }
+ if (!empty($params[ 'assign' ])) {
+ $template->assign($params[ 'assign' ], $content);
+ } else {
+ return $content;
+ }
+}
diff --git a/libs/plugins/function.html_checkboxes.php b/libs/plugins/function.html_checkboxes.php
new file mode 100644
index 0000000..302358e
--- /dev/null
+++ b/libs/plugins/function.html_checkboxes.php
@@ -0,0 +1,286 @@
+' output=$names}
+ * {html_checkboxes values=$ids checked=$checked separator='
' output=$names}
+ *
+ * Params:
+ *
+ * - name (optional) - string default "checkbox"
+ * - values (required) - array
+ * - options (optional) - associative array
+ * - checked (optional) - array default not set
+ * - separator (optional) - ie
or
+ * - output (optional) - the output next to each checkbox
+ * - assign (optional) - assign the output as an array to this variable
+ * - escape (optional) - escape the content (not value), defaults to true
+ *
+ * @link http://www.smarty.net/manual/en/language.function.html.checkboxes.php {html_checkboxes}
+ * (Smarty online manual)
+ * @author Christopher Kvarme
+ * @author credits to Monte Ohrt
+ * @version 1.0
+ *
+ * @param array $params parameters
+ * @param Smarty_Internal_Template $template template object
+ *
+ * @return string
+ * @uses smarty_function_escape_special_chars()
+ * @throws \SmartyException
+ */
+function smarty_function_html_checkboxes($params, Smarty_Internal_Template $template)
+{
+ $template->_checkPlugins(
+ array(
+ array(
+ 'function' => 'smarty_function_escape_special_chars',
+ 'file' => SMARTY_PLUGINS_DIR . 'shared.escape_special_chars.php'
+ )
+ )
+ );
+ $name = 'checkbox';
+ $values = null;
+ $options = null;
+ $selected = array();
+ $separator = '';
+ $escape = true;
+ $labels = true;
+ $label_ids = false;
+ $output = null;
+ $extra = '';
+ foreach ($params as $_key => $_val) {
+ switch ($_key) {
+ case 'name':
+ case 'separator':
+ $$_key = (string)$_val;
+ break;
+ case 'escape':
+ case 'labels':
+ case 'label_ids':
+ $$_key = (bool)$_val;
+ break;
+ case 'options':
+ $$_key = (array)$_val;
+ break;
+ case 'values':
+ case 'output':
+ $$_key = array_values((array)$_val);
+ break;
+ case 'checked':
+ case 'selected':
+ if (is_array($_val)) {
+ $selected = array();
+ foreach ($_val as $_sel) {
+ if (is_object($_sel)) {
+ if (method_exists($_sel, '__toString')) {
+ $_sel = smarty_function_escape_special_chars((string)$_sel->__toString());
+ } else {
+ trigger_error(
+ 'html_checkboxes: selected attribute contains an object of class \'' .
+ get_class($_sel) . '\' without __toString() method',
+ E_USER_NOTICE
+ );
+ continue;
+ }
+ } else {
+ $_sel = smarty_function_escape_special_chars((string)$_sel);
+ }
+ $selected[ $_sel ] = true;
+ }
+ } elseif (is_object($_val)) {
+ if (method_exists($_val, '__toString')) {
+ $selected = smarty_function_escape_special_chars((string)$_val->__toString());
+ } else {
+ trigger_error(
+ 'html_checkboxes: selected attribute is an object of class \'' . get_class($_val) .
+ '\' without __toString() method',
+ E_USER_NOTICE
+ );
+ }
+ } else {
+ $selected = smarty_function_escape_special_chars((string)$_val);
+ }
+ break;
+ case 'checkboxes':
+ trigger_error(
+ 'html_checkboxes: the use of the "checkboxes" attribute is deprecated, use "options" instead',
+ E_USER_WARNING
+ );
+ $options = (array)$_val;
+ break;
+ case 'assign':
+ break;
+ case 'strict':
+ break;
+ case 'disabled':
+ case 'readonly':
+ if (!empty($params[ 'strict' ])) {
+ if (!is_scalar($_val)) {
+ trigger_error(
+ "html_options: {$_key} attribute must be a scalar, only boolean true or string '{$_key}' will actually add the attribute",
+ E_USER_NOTICE
+ );
+ }
+ if ($_val === true || $_val === $_key) {
+ $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_key) . '"';
+ }
+ break;
+ }
+ // omit break; to fall through!
+ // no break
+ default:
+ if (!is_array($_val)) {
+ $extra .= ' ' . $_key . '="' . smarty_function_escape_special_chars($_val) . '"';
+ } else {
+ trigger_error("html_checkboxes: extra attribute '{$_key}' cannot be an array", E_USER_NOTICE);
+ }
+ break;
+ }
+ }
+ if (!isset($options) && !isset($values)) {
+ return '';
+ } /* raise error here? */
+ $_html_result = array();
+ if (isset($options)) {
+ foreach ($options as $_key => $_val) {
+ $_html_result[] =
+ smarty_function_html_checkboxes_output(
+ $name,
+ $_key,
+ $_val,
+ $selected,
+ $extra,
+ $separator,
+ $labels,
+ $label_ids,
+ $escape
+ );
+ }
+ } else {
+ foreach ($values as $_i => $_key) {
+ $_val = isset($output[ $_i ]) ? $output[ $_i ] : '';
+ $_html_result[] =
+ smarty_function_html_checkboxes_output(
+ $name,
+ $_key,
+ $_val,
+ $selected,
+ $extra,
+ $separator,
+ $labels,
+ $label_ids,
+ $escape
+ );
+ }
+ }
+ if (!empty($params[ 'assign' ])) {
+ $template->assign($params[ 'assign' ], $_html_result);
+ } else {
+ return implode("\n", $_html_result);
+ }
+}
+
+/**
+ * @param $name
+ * @param $value
+ * @param $output
+ * @param $selected
+ * @param $extra
+ * @param $separator
+ * @param $labels
+ * @param $label_ids
+ * @param bool $escape
+ *
+ * @return string
+ */
+function smarty_function_html_checkboxes_output(
+ $name,
+ $value,
+ $output,
+ $selected,
+ $extra,
+ $separator,
+ $labels,
+ $label_ids,
+ $escape = true
+) {
+ $_output = '';
+ if (is_object($value)) {
+ if (method_exists($value, '__toString')) {
+ $value = (string)$value->__toString();
+ } else {
+ trigger_error(
+ 'html_options: value is an object of class \'' . get_class($value) .
+ '\' without __toString() method',
+ E_USER_NOTICE
+ );
+ return '';
+ }
+ } else {
+ $value = (string)$value;
+ }
+ if (is_object($output)) {
+ if (method_exists($output, '__toString')) {
+ $output = (string)$output->__toString();
+ } else {
+ trigger_error(
+ 'html_options: output is an object of class \'' . get_class($output) .
+ '\' without __toString() method',
+ E_USER_NOTICE
+ );
+ return '';
+ }
+ } else {
+ $output = (string)$output;
+ }
+ if ($labels) {
+ if ($label_ids) {
+ $_id = smarty_function_escape_special_chars(
+ preg_replace(
+ '![^\w\-\.]!' . Smarty::$_UTF8_MODIFIER,
+ '_',
+ $name . '_' . $value
+ )
+ );
+ $_output .= '