Follow-up to feature #10565: Fixed formatting in t3lib_matchCondition
authorOliver Hader <oliver.hader@typo3.org>
Sun, 8 Mar 2009 12:36:55 +0000 (12:36 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Sun, 8 Mar 2009 12:36:55 +0000 (12:36 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5142 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_matchcondition.php

index efcabf6..c75a5fe 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2009-03-08  Oliver Hader  <oliver@typo3.org>
 
        * Follow-up to feature #10565: Condition PIDinRootline did not work anymore
+       * Follow-up to feature #10565: Fixed formatting in t3lib_matchCondition
 
 2009-03-07  Stanislas Rolland  <typo3@sjbr.ca>
 
@@ -9,7 +10,7 @@
 2009-03-07  Benjamin Mack  <benni@typo3.org>
 
        * Cleanup #10601: Move static dyntabmenu code in external file
-       * #10565: Speedup / Cleanup t3lib_match_condition - make use of trimExplode
+       * Added feature #10565: Speedup & cleanup t3lib_matchCondition - make use of trimExplode
 
 2009-03-07  Ingo Renner  <ingo@typo3.org>
 
index ec1d6a9..6d93d7b 100644 (file)
@@ -188,23 +188,23 @@ class t3lib_matchCondition {
                                                switch (substr($test, 0, 1)) {
                                                        case '=':
                                                                if (doubleval(substr($test, 1)) == $browserInfo['version']) {
-                                                                   return true;
+                                                                       return true;
                                                                }
                                                        break;
                                                        case '<':
                                                                if (doubleval(substr($test, 1)) > $browserInfo['version']) {
-                                                                   return true;
+                                                                       return true;
                                                                }
                                                        break;
                                                        case '>':
                                                                if (doubleval(substr($test, 1)) < $browserInfo['version']) {
-                                                                   return true;
+                                                                       return true;
                                                                }
                                                        break;
                                                }
                                        } else {
                                                if (strpos(' ' . $browserInfo['version'], $test) == 1) {
-                                                   return true;
+                                                       return true;
                                                }
                                        }
                                }
@@ -213,7 +213,7 @@ class t3lib_matchCondition {
                                $values = t3lib_div::trimExplode(',', $value, true);
                                foreach ($values as $test) {
                                        if (strpos(' ' . $browserInfo['system'], $test) == 1) {
-                                           return true;
+                                               return true;
                                        }
                                }
                        break;
@@ -224,7 +224,7 @@ class t3lib_matchCondition {
                                $values = t3lib_div::trimExplode(',', $value, true);
                                foreach ($values as $test) {
                                        if ($this->deviceInfo == $test) {
-                                           return true;
+                                               return true;
                                        }
                                }
                        break;
@@ -240,21 +240,21 @@ class t3lib_matchCondition {
                                        if (preg_match('/^\*.+\*$/', $test)) {
                                                $allLanguages = preg_split('/[,;]/', t3lib_div::getIndpEnv('HTTP_ACCEPT_LANGUAGE'));
                                                if (in_array(substr($test, 1, -1), $allLanguages)) {
-                                                   return true;
+                                                       return true;
                                                }
                                        } else if (t3lib_div::getIndpEnv('HTTP_ACCEPT_LANGUAGE') == $test) {
-                                           return true;
+                                               return true;
                                        }
                                }
                        break;
                        case 'IP':
                                if (t3lib_div::cmpIP(t3lib_div::getIndpEnv('REMOTE_ADDR'), $value)) {
-                                   return true;
+                                       return true;
                                }
                        break;
                        case 'hostname':
                                if (t3lib_div::cmpFQDN(t3lib_div::getIndpEnv('REMOTE_ADDR'), $value)) {
-                                   return true;
+                                       return true;
                                }
                        break;
                                // hour, minute, dayofweek, dayofmonth, month, year, julianday
@@ -280,29 +280,29 @@ class t3lib_matchCondition {
                                $values = t3lib_div::trimExplode(',', $value, true);
                                foreach ($values as $test) {
                                        if (t3lib_div::testInt($test)) {
-                                           $test = '=' . $test;
+                                               $test = '=' . $test;
                                        }
                                        if ($this->testNumber($test, $theTestValue)) {
-                                           return true;
+                                               return true;
                                        }
                                }
                        break;
                        case 'usergroup':
                                if ($GLOBALS['TSFE']->gr_list != '0,-1') {              // '0,-1' is the default usergroups when not logged in!
-                                   $values = t3lib_div::trimExplode(',', $value, true);
-                                   foreach ($values as $test) {
+                                       $values = t3lib_div::trimExplode(',', $value, true);
+                                       foreach ($values as $test) {
                                                if ($test == '*' || t3lib_div::inList($GLOBALS['TSFE']->gr_list, $test)) {
-                                                   return true;
+                                                       return true;
                                                }
                                        }
                                }
                        break;
                        case 'loginUser':
                                if ($GLOBALS['TSFE']->loginUser) {
-                                   $values = t3lib_div::trimExplode(',', $value, true);
-                                   foreach ($values as $test) {
+                                       $values = t3lib_div::trimExplode(',', $value, true);
+                                       foreach ($values as $test) {
                                                if ($test == '*' || !strcmp($GLOBALS['TSFE']->fe_user->user['uid'], $test)) {
-                                                   return true;
+                                                       return true;
                                                }
                                        }
                                }
@@ -316,7 +316,7 @@ class t3lib_matchCondition {
                                        $testValue = substr($test, $point);
 
                                        if ($this->testNumber($testValue, $nv)) {
-                                           return true;
+                                               return true;
                                        }
                                }
                        break;
@@ -329,7 +329,7 @@ class t3lib_matchCondition {
                                        $testValue = substr($test, $point+1);
 
                                        if ($this->matchWild($nv, trim($testValue))) {
-                                           return true;
+                                               return true;
                                        }
                                }
                        break;
@@ -339,7 +339,7 @@ class t3lib_matchCondition {
                                $treeLevel = count($theRootLine)-1;
                                foreach ($values as $test) {
                                        if ($test == $treeLevel) {
-                                           return true;
+                                               return true;
                                        }
                                }
                        break;
@@ -348,10 +348,10 @@ class t3lib_matchCondition {
                                $values = t3lib_div::trimExplode(',', $value, true);
                                if (($key=='PIDinRootline') || (!in_array($GLOBALS['TSFE']->id, $values))) {
                                        $theRootLine = is_array($GLOBALS['TSFE']->tmpl->rootLine) ? $GLOBALS['TSFE']->tmpl->rootLine : $this->altRootLine;
-                                   foreach ($values as $test) {
-                                       foreach ($theRootLine as $rl_dat) {
+                                       foreach ($values as $test) {
+                                               foreach ($theRootLine as $rl_dat) {
                                                        if ($rl_dat['uid'] == $test) {
-                                                           return true;
+                                                               return true;
                                                        }
                                                }
                                        }