‪TYPO3CMS  ‪main
TYPO3\CMS\Backend\View\ArrayBrowser Class Reference

Public Member Functions

 __construct (Route $route=null)
 
string tree ($array, $positionKey)
 
array getSearchKeys ($keyArr, $depth_in, $searchString, $keyArray)
 
array depthKeys ($arr, $settings)
 

Public Attributes

bool $expAll = false
 
array $depthKeys = array( )
 
array $searchKeys = array( )
 
bool $regexMode = false
 
bool $searchKeysToo = true
 

Protected Attributes

UriBuilder $uriBuilder
 
Route null $route
 

Detailed Description

Class for displaying an array as a tree which can collapse / expand.

See the extension 'lowlevel' / config (Backend module 'Tools > Configuration')

just a helper class for internal usage.

Definition at line 32 of file ArrayBrowser.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Backend\View\ArrayBrowser::__construct ( Route  $route = null)

Definition at line 74 of file ArrayBrowser.php.

References TYPO3\CMS\Backend\View\ArrayBrowser\$route.

Member Function Documentation

◆ depthKeys()

array TYPO3\CMS\Backend\View\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 190 of file ArrayBrowser.php.

Referenced by TYPO3\CMS\Backend\View\ArrayBrowser\tree().

◆ getSearchKeys()

array TYPO3\CMS\Backend\View\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 149 of file ArrayBrowser.php.

◆ tree()

string TYPO3\CMS\Backend\View\ArrayBrowser::tree (   $array,
  $positionKey 
)

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

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

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

Definition at line 91 of file ArrayBrowser.php.

References TYPO3\CMS\Backend\View\ArrayBrowser\$expAll, $output, TYPO3\CMS\Backend\View\ArrayBrowser\depthKeys(), and TYPO3\CMS\Core\Imaging\Icon\SIZE_SMALL.

Member Data Documentation

◆ $depthKeys

array TYPO3\CMS\Backend\View\ArrayBrowser::$depthKeys = array( )

If set, the variable keys are not linked.

Definition at line 42 of file ArrayBrowser.php.

◆ $expAll

bool TYPO3\CMS\Backend\View\ArrayBrowser::$expAll = false

Definition at line 36 of file ArrayBrowser.php.

Referenced by TYPO3\CMS\Backend\View\ArrayBrowser\tree().

◆ $regexMode

bool TYPO3\CMS\Backend\View\ArrayBrowser::$regexMode = false

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

Definition at line 56 of file ArrayBrowser.php.

◆ $route

Route null TYPO3\CMS\Backend\View\ArrayBrowser::$route
protected

If null then there are no links set.

Definition at line 72 of file ArrayBrowser.php.

Referenced by TYPO3\CMS\Backend\View\ArrayBrowser\__construct().

◆ $searchKeys

array TYPO3\CMS\Backend\View\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 49 of file ArrayBrowser.php.

◆ $searchKeysToo

bool TYPO3\CMS\Backend\View\ArrayBrowser::$searchKeysToo = true

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

Definition at line 62 of file ArrayBrowser.php.

◆ $uriBuilder

UriBuilder TYPO3\CMS\Backend\View\ArrayBrowser::$uriBuilder
protected

Definition at line 66 of file ArrayBrowser.php.