From 8a51e29824fc2569ac1d0def3070bee7c0552231 Mon Sep 17 00:00:00 2001 From: Fabio Comuni Date: Fri, 2 Mar 2012 17:22:16 +0100 Subject: [PATCH 1/8] template proc: add variable filters --- include/template_processor.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/include/template_processor.php b/include/template_processor.php index 111fc5849a..90c6b2e650 100755 --- a/include/template_processor.php +++ b/include/template_processor.php @@ -160,15 +160,25 @@ private function var_replace($s){ $m = array(); - if (preg_match_all('/\$\[{0,1}([a-zA-Z0-9-_]+\.*)+\]{0,1}/', $s,$m)){ - foreach($m[0] as $var){ - $varn = str_replace(array("[","]"), array("",""), $var); - $val = $this->_get_var($varn, true); + if (preg_match_all('/(\$\[{0,1}([a-zA-Z0-9-_]+\.*)+)(\|[a-zA-Z0-9-_]+)*\]{0,1}/', $s,$m)){ + foreach($m[1] as $id=>$var){ + $var = str_replace("[", "", $var); + $val = $this->_get_var($var, true); + + // apply filters + if ($m[3][$id]!=""){ + $filters = explode("|",trim($m[3][$id],"|")); + foreach($filters as $filter) + if (function_exists($filter)) + $val=$filter($val); + } if ($val!=KEY_NOT_EXISTS) - $s = str_replace($var, $val, $s); + $s = str_replace($m[0][$id], $val, $s); } } + + return $s; } From a406c165810f23a5f8f91d49ede17d7d6b3cd775 Mon Sep 17 00:00:00 2001 From: tommy tomson Date: Mon, 5 Mar 2012 22:31:03 +0100 Subject: [PATCH 2/8] fixes --- view/theme/diabook/icons/community.png | Bin 0 -> 475 bytes view/theme/diabook/icons/globe.png | Bin 875 -> 1361 bytes view/theme/diabook/nav.tpl | 14 +++++++++++++- view/theme/diabook/style.css | 17 +++++++++++++---- 4 files changed, 26 insertions(+), 5 deletions(-) create mode 100644 view/theme/diabook/icons/community.png mode change 100755 => 100644 view/theme/diabook/icons/globe.png diff --git a/view/theme/diabook/icons/community.png b/view/theme/diabook/icons/community.png new file mode 100644 index 0000000000000000000000000000000000000000..7c91e8b756323f2fa9214a63648d51448d6ab90e GIT binary patch literal 475 zcmV<10VMv3P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyY% z5D5ij*btxq00CP`L_t(I%k9)ZOO{a>2JqjTZ-f?vv__~UZ8fw;AHXrersf-4LWgit za>~W1CGNSYe`9@tzJcHpgg6C?L-YqJ;%zzN;py?wpuoWk4(FWfKKJ!p=RP+NC-~p! z9d;ly&*2583iS?mBI0XT-l-#e{B02(lrdGfPV^h@9%8X_;2NmL~?OIEMv8o8aN=>3bwYYP8pIrFWB`_jVgb_rjt*4N8C*&=ee%r`1- zvQ;=UhjFQjjb-L&M0{$hM#Oezj^biPPZW*)dS>Qbtl~n&f5c79;7LRKK3?KIu2c`c zgZYSf-pkC_n66st16HtwrxM`2IKliW3}D{00=IR1cQN R2|EA)002ovPDHLkV1mv3&g}pI literal 0 HcmV?d00001 diff --git a/view/theme/diabook/icons/globe.png b/view/theme/diabook/icons/globe.png old mode 100755 new mode 100644 index bf27a8f3f6f50fc23c2c3a97a12036e219a3b5bb..6bb9bc09d3dfbf6cab80e1cc8e08c8e9720a28df GIT binary patch delta 1281 zcmV+c1^)W$2GI(TV1ES;GbL=NU~2#X1kp)EK~zY`&6Z7wS7j8&f6sr0nbGlslpr~={zkw|G!sr>|+tVa2NNyAJ2Qv`<&+-_>YI~Hh-CASp{eWT7fo6&jYgn z**1Wrv$j704oT{^J)BY+`^SJ;mQ4Xx16w6MY8y!a*KF4TmNaO)IqcZ}SyHF%!zrcy zzXh1*xoppu)M0xqa7oetFw^#!qy%KPM}c>NZIW#J9MB9*mvqqfE}$o+00Q+peVtW7>PATn>w9j@$QlF$Pz|q*-1uW09OydFq^MSoUtL=S~ zUbQ_WX%TQt(mN@o(Fms^jJtqiwif|Iv1gy8R$#BB`F8}&vTTa&4xm-io|MuC+gE_~ z!H=CqQJgF7H9$(~9I!LM*8^8#@1D4LN1o?XZ+XK!&wnexTH6PJen}tO?vu2@_G(}N zI4G&#_H{{{17N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