From 47a973e402cfcaa87370995d4e073ce5f6f6524f Mon Sep 17 00:00:00 2001 From: Abdulrahman Date: Thu, 2 May 2019 20:02:11 +0300 Subject: [PATCH] fixes bugs --- admin/Masmak/admin_calls.html | 2 +- includes/style.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/admin/Masmak/admin_calls.html b/admin/Masmak/admin_calls.html index 6918028..d3789e9 100755 --- a/admin/Masmak/admin_calls.html +++ b/admin/Masmak/admin_calls.html @@ -3,7 +3,7 @@ diff --git a/includes/style.php b/includes/style.php index 8b3fe93..398a9b4 100755 --- a/includes/style.php +++ b/includes/style.php @@ -180,7 +180,7 @@ class kleeja_style { if(! empty($atts[$attribute])) { - $condition .= $separator . $this->parse_condition($atts[$attribute]); + $condition .= $separator . $this->parse_condition($atts[$attribute], !empty($atts['LOOP'])); } } @@ -200,7 +200,7 @@ class kleeja_style return '' . $matches[2] . '' . $matches[3] . ''; } - protected function parse_condition($condition) + protected function parse_condition($condition, $is_loop) { $char = array(' eq ', ' lt ', ' gt ', ' lte ', ' gte ', ' neq ', '==', '!=', '>=', '<=', '<', '>'); $reps = array('==', '<', '>', '<=', '>=', '!=', '==', '!=', '>=', '<=', '<', '>'); @@ -209,7 +209,7 @@ class kleeja_style if (preg_match('/(.*)(' . implode('|', $char) . ')(.*)/i', $con, $arr)) { $arr[1] = trim($arr[1]); - $var1 = $arr[1][0] != '$' ? call_user_func(array('kleeja_style', '_var_callback'), (!empty($condition) ? '{' . $arr[1] . '}' : '{{' . $arr[1] . '}}')) : $arr[1]; + $var1 = $arr[1][0] != '$' ? call_user_func(array('kleeja_style', '_var_callback'), (! $is_loop ? '{' . $arr[1] . '}' : '{{' . $arr[1] . '}}')) : $arr[1]; $opr = str_replace($char, $reps, $arr[2]); $var2 = trim($arr[3]); @@ -220,7 +220,7 @@ class kleeja_style $con = "$var1 $opr $var2"; } elseif ($con[0] !== '$' && strpos($con, '(') === false) { - $con = call_user_func(array('kleeja_style', '_var_callback'), (!empty($condition) ? '{' . $con . '}' : '{{' . $con . '}}')); + $con = call_user_func(array('kleeja_style', '_var_callback'), (!$is_loop ? '{' . $con . '}' : '{{' . $con . '}}')); } return str_replace('[----this-vars----]', '$this->vars', $con);