‪TYPO3CMS  9.5
TYPO3\CMS\Lowlevel\Utility\ArrayBrowser Class Reference

Public Member Functions

string tree ($array, $positionKey)
 
string wrapArrayKey ($label, $depth, $theValue)
 
array getSearchKeys ($keyArr, $depth_in, $searchString, $keyArray)
 
array depthKeys ($arr, $settings)
 

Public Attributes

bool $expAll = false
 
bool $dontLinkVar = false
 
array $depthKeys = array( )
 
array $searchKeys = array( )
 
int $fixedLgd = 1
 
int $regexMode = 0
 
bool $searchKeysToo = false
 
string $varName = ''
 

Detailed Description

Class for displaying an array as a tree See the extension 'lowlevel' /config (Backend module 'Tools > Configuration')

just a helper class for internal usage

Definition at line 25 of file ArrayBrowser.php.

Member Function Documentation

◆ depthKeys()

array TYPO3\CMS\Lowlevel\Utility\ArrayBrowser::depthKeys (   $arr,
  $settings 
)

Function modifying the depthKey array

Parameters
array$arr‪Array with instructions to open/close nodes.
array$settings‪Input depth_key array
Returns
‪array Output depth_key array with entries added/removed based on $arr

Definition at line 205 of file ArrayBrowser.php.

Referenced by TYPO3\CMS\Lowlevel\Utility\ArrayBrowser\tree().

◆ getSearchKeys()

array TYPO3\CMS\Lowlevel\Utility\ArrayBrowser::getSearchKeys (   $keyArr,
  $depth_in,
  $searchString,
  $keyArray 
)

Creates an array with "depthKeys" which will expand the array to show the search results

Parameters
array$keyArr‪The array to search for the value
string$depth_in‪Depth string - blank for first call (will build up during recursive calling creating an id of the position: [key1].[key2].[key3]
string$searchString‪The string to search for
array$keyArray‪Key array, for first call pass empty array
Returns
‪array

Definition at line 164 of file ArrayBrowser.php.

◆ tree()

string TYPO3\CMS\Lowlevel\Utility\ArrayBrowser::tree (   $array,
  $positionKey 
)

Set var name here if you want links to the variable name.

Make browseable tree Before calling this function you may want to set some of the internal vars like depthKeys, regexMode and fixedLgd.

Parameters
array$array‪The array to display
string$positionKey‪Key-position id. Build up during recursive calls - [key1].[key2].[key3] - an so on.
Returns
‪string HTML for the tree

Definition at line 87 of file ArrayBrowser.php.

References TYPO3\CMS\Lowlevel\Utility\ArrayBrowser\$expAll, $output, TYPO3\CMS\Lowlevel\Utility\ArrayBrowser\depthKeys(), and TYPO3\CMS\Lowlevel\Utility\ArrayBrowser\wrapArrayKey().

◆ wrapArrayKey()

string TYPO3\CMS\Lowlevel\Utility\ArrayBrowser::wrapArrayKey (   $label,
  $depth,
  $theValue 
)

Wrapping the value in bold tags etc.

Parameters
string$label‪The title string
string$depth‪Depth path
string$theValue‪The value for the array entry.
Returns
‪string Title string, htmlspecialchars()'ed

Definition at line 134 of file ArrayBrowser.php.

Referenced by TYPO3\CMS\Lowlevel\Utility\ArrayBrowser\tree().

Member Data Documentation

◆ $depthKeys

array TYPO3\CMS\Lowlevel\Utility\ArrayBrowser::$depthKeys = array( )

If set, the variable keys are not linked.

Definition at line 41 of file ArrayBrowser.php.

◆ $dontLinkVar

bool TYPO3\CMS\Lowlevel\Utility\ArrayBrowser::$dontLinkVar = false

If set, will expand all (depthKeys is obsolete then) (and no links are applied)

Definition at line 35 of file ArrayBrowser.php.

◆ $expAll

bool TYPO3\CMS\Lowlevel\Utility\ArrayBrowser::$expAll = false

Definition at line 29 of file ArrayBrowser.php.

Referenced by TYPO3\CMS\Lowlevel\Utility\ArrayBrowser\tree().

◆ $fixedLgd

int TYPO3\CMS\Lowlevel\Utility\ArrayBrowser::$fixedLgd = 1

After calling the getSearchKeys function this array is populated with the key-positions in the array which contains values matching the search.

Definition at line 55 of file ArrayBrowser.php.

◆ $regexMode

int TYPO3\CMS\Lowlevel\Utility\ArrayBrowser::$regexMode = 0

If set, the values are truncated with "..." appended if longer than a certain length.

Definition at line 62 of file ArrayBrowser.php.

◆ $searchKeys

array TYPO3\CMS\Lowlevel\Utility\ArrayBrowser::$searchKeys = array( )

Array defining which keys to expand. Typically set from outside from some session variable - otherwise the array will collapse.

Definition at line 48 of file ArrayBrowser.php.

◆ $searchKeysToo

bool TYPO3\CMS\Lowlevel\Utility\ArrayBrowser::$searchKeysToo = false

If set, search for string with regex, otherwise stristr()

Definition at line 68 of file ArrayBrowser.php.

◆ $varName

string TYPO3\CMS\Lowlevel\Utility\ArrayBrowser::$varName = ''

If set, array keys are subject to the search too.

Definition at line 74 of file ArrayBrowser.php.