(trivial) changed arraybrowser so also array keys are included in the search.
authorKasper Skårhøj <kasper@typo3.org>
Thu, 31 Jan 2008 21:10:07 +0000 (21:10 +0000)
committerKasper Skårhøj <kasper@typo3.org>
Thu, 31 Jan 2008 21:10:07 +0000 (21:10 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2993 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
t3lib/class.t3lib_arraybrowser.php
typo3/sysext/lowlevel/config/index.php

index ab7bd28..61c8e57 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-01-31  Kasper Sk\8crh¿j <kasper2008@typo3.com>
+
+       * - (trivial) changed arraybrowser so also array keys are included in the search. [class.t3lib_arraybrowser.php + lowlevel/config/index.php]
+       
 2008-01-31  Jeff Segars  <jeff@webempoweredchurch.org>
 
        * Fixed bug #7202: Debug renders incomplete table with empty arrays. Thanks to Stefan Geith.
index 01f32be..9d54a0f 100644 (file)
@@ -81,6 +81,7 @@ class t3lib_arrayBrowser      {
        var $searchKeys = array();              // After calling the getSearchKeys function this array is populated with the key-positions in the array which contains values matching the search.
        var $fixedLgd=1;                                // If set, the values are truncated with "..." appended if longer than a certain length.
        var $regexMode=0;                               // If set, search for string with regex, otherwise stristr()
+       var $searchKeysToo=FALSE;               // If set, array keys are subject to the search too.
        var $varName='';                                // Set var name here if you want links to the variable name.
 
        /**
@@ -136,7 +137,7 @@ class t3lib_arrayBrowser    {
                                        $theValue = $this->fixed_lgd($theValue,$lgdChars);
                                }
                                if ($this->searchKeys[$depth])  {
-                                       $HTML.='=<span style="color:red;">'.$this->wrapValue($theValue,$depth).'</font>';
+                                       $HTML.='=<span style="color:red;">'.$this->wrapValue($theValue,$depth).'</span>';
                                } else {
                                        $HTML.='='.$this->wrapValue($theValue,$depth);
                                }
@@ -202,9 +203,9 @@ class t3lib_arrayBrowser    {
                        $deeper = is_array($keyArr[$key]);
 
                        if ($this->regexMode)   {
-                               if (ereg($searchString,$keyArr[$key]))  {       $this->searchKeys[$depth]=1;    }
+                               if (ereg($searchString,$keyArr[$key]) || ($this->searchKeysToo && ereg($searchString,$key)))    {       $this->searchKeys[$depth]=1;    }
                        } else {
-                               if (stristr($keyArr[$key],$searchString)      {       $this->searchKeys[$depth]=1;    }
+                               if (stristr($keyArr[$key],$searchString) || ($this->searchKeysToo && stristr($key,$searchString)))      {       $this->searchKeys[$depth]=1;    }
                        }
 
                        if ($deeper)    {
index 8a79b93..c7b66a6 100755 (executable)
@@ -201,6 +201,7 @@ class SC_mod_tools_config_index {
                $arrayBrowser->depthKeys = $this->MOD_SETTINGS['node_'.$this->MOD_SETTINGS['function']];
                $arrayBrowser->regexMode = $this->MOD_SETTINGS['regexsearch'];
                $arrayBrowser->fixedLgd = $this->MOD_SETTINGS['fixedLgd'];
+               $arrayBrowser->searchKeysToo = TRUE;
 
 
                $search_field = t3lib_div::_GP('search_field');