mirror of
https://github.com/friendica/friendica
synced 2025-04-22 17:50:11 +00:00
Continued a bit:
- converted some else if to elseif (only PHP) - converted some space -> tab (intending) Signed-off-by: Roland Häder <roland@mxchange.org>
This commit is contained in:
parent
c2d8738285
commit
d9c22c7f3e
6 changed files with 42 additions and 30 deletions
|
@ -53,8 +53,9 @@ class Template implements ITemplateEngine {
|
|||
|
||||
private function _get_var($name, $retNoKey = false) {
|
||||
$keys = array_map('trim', explode(".", $name));
|
||||
if ($retNoKey && !array_key_exists($keys[0], $this->r))
|
||||
if ($retNoKey && !array_key_exists($keys[0], $this->r)) {
|
||||
return KEY_NOT_EXISTS;
|
||||
}
|
||||
$val = $this->r;
|
||||
foreach ($keys as $k) {
|
||||
$val = (isset($val[$k]) ? $val[$k] : null);
|
||||
|
@ -73,14 +74,16 @@ class Template implements ITemplateEngine {
|
|||
if (strpos($args[2], "==") > 0) {
|
||||
list($a, $b) = array_map("trim", explode("==", $args[2]));
|
||||
$a = $this->_get_var($a);
|
||||
if ($b[0] == "$")
|
||||
if ($b[0] == "$") {
|
||||
$b = $this->_get_var($b);
|
||||
}
|
||||
$val = ($a == $b);
|
||||
} else if (strpos($args[2], "!=") > 0) {
|
||||
} elseif (strpos($args[2], "!=") > 0) {
|
||||
list($a, $b) = array_map("trim", explode("!=", $args[2]));
|
||||
$a = $this->_get_var($a);
|
||||
if ($b[0] == "$")
|
||||
if ($b[0] == "$") {
|
||||
$b = $this->_get_var($b);
|
||||
}
|
||||
$val = ($a != $b);
|
||||
} else {
|
||||
$val = $this->_get_var($args[2]);
|
||||
|
@ -138,8 +141,9 @@ class Template implements ITemplateEngine {
|
|||
$newctx = null;
|
||||
}
|
||||
|
||||
if ($tplfile[0] == "$")
|
||||
if ($tplfile[0] == "$") {
|
||||
$tplfile = $this->_get_var($tplfile);
|
||||
}
|
||||
|
||||
$this->_push_stack();
|
||||
$r = $this->r;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue