aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/nav.php9
-rw-r--r--include/template_processor.php20
2 files changed, 25 insertions, 4 deletions
diff --git a/include/nav.php b/include/nav.php
index b37863aa1..238d87035 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -107,10 +107,15 @@ function nav(&$a) {
$nav['settings'] = array('settings', t('Settings'),"");
$nav['profiles'] = array('profiles', t('Profiles'),"");
$nav['contacts'] = array('contacts', t('Contacts'),"");
-
-
}
+ /**
+ * Admin page
+ */
+ if (is_site_admin()){
+ $nav['admin'] = array('admin/', t('Admin'), "");
+ }
+
/**
*
diff --git a/include/template_processor.php b/include/template_processor.php
index d8dfbaedb..a2c24b00b 100644
--- a/include/template_processor.php
+++ b/include/template_processor.php
@@ -41,9 +41,24 @@
* IF node
*
* {{ if <$var> }}...{{ endif }}
+ * {{ if <$var>==<val|$var> }}...{{ endif }}
+ * {{ if <$var>!=<val|$var> }}...{{ endif }}
*/
private function _replcb_if($args){
- $val = $this->_get_var($args[2]);
+
+ if (strpos($args[2],"==")>0){
+ list($a,$b) = array_map("trim",explode("==",$args[2]));
+ $a = $this->_get_var($a);
+ if ($b[0]=="$") $b = $this->_get_var($b);
+ $val = ($a == $b);
+ } else if (strpos($args[2],"!=")>0){
+ list($a,$b) = explode("!=",$args[2]);
+ $a = $this->_get_var($a);
+ if ($b[0]=="$") $b = $this->_get_var($b);
+ $val = ($a != $b);
+ } else {
+ $val = $this->_get_var($args[2]);
+ }
return ($val?$args[3]:"");
}
@@ -58,7 +73,8 @@
list($keyname, $varname) = explode("=>",$m[1]);
if (is_null($varname)) { $varname=$keyname; $keyname=""; }
if ($m[0]=="" || $varname=="" || is_null($varname)) die("template error: 'for ".$m[0]." as ".$varname."'") ;
- $vals = $this->r[$m[0]];
+ //$vals = $this->r[$m[0]];
+ $vals = $this->_get_var($m[0]);
$ret="";
if (!is_array($vals)) return $ret;
foreach ($vals as $k=>$v){