]> git.mxchange.org Git - friendica.git/blobdiff - include/template_processor.php
ensure D* photos only attached once
[friendica.git] / include / template_processor.php
index f64fe4c0fa12b6da7c2be392745178796e9205f6..63d75eaa4eda15fb9dfe2a1e3e01a223bf219179 100644 (file)
                        return $s;
                }
 
-               private function _get_lang(){
-                       if ($this->lang!=null) return $this->lang;
-                       
-                       $a = get_app();
-                       $this->lang=array();
-                       if(is_array($a->strings) && count($a->strings)) {
-                               foreach ($a->strings as $k=>$v){
-                                       $k =  preg_replace("/[^a-z0-9-]/", "", str_replace(" ","-", strtolower($k)));
-                                       $this->lang[$k] = $v;
-                               }
-                       }
-                       return $this->lang;
-               }
-
-               
+       
                public function replace($s, $r) {
-                       if (!x($r,'$lang')){
-                               $r['$lang'] = &$this->_get_lang();
-                       }
                        $this->r = $r;
                        $this->search = array();
                        $this->replace = array();
                                $os=$s; $count++;
                                $s = str_replace($this->search,$this->replace, $s);
                        }
-                       return $s;
+                       return template_unescape($s);
                }
        }
        
        $t = new Template;
+
+
+
+
+function template_escape($s) {
+
+       return str_replace(array('$','{{'),array('!_Doll^Ars1Az_!','!_DoubLe^BraceS4Rw_!'),$s);
+
+
+}
+
+function template_unescape($s) {
+
+       return str_replace(array('!_Doll^Ars1Az_!','!_DoubLe^BraceS4Rw_!'),array('$','{{'),$s);
+
+
+
+}