86 public function tree($arr, $depth_in, $depthData) {
90 $depth_in = $depth_in .
'.';
93 foreach ($arr as $key => $value) {
95 $depth = $depth_in . $key;
96 $goto =
'a' . substr(md5($depth), 0, 6);
97 if (is_object($value) && !$value instanceof \Traversable) {
98 $value = (array)$value;
100 $isArray = is_array($value) || $value instanceof \Traversable;
102 $LN = $a == $c ?
'blank' :
'line';
103 $BTM = $a == $c ?
'bottom' :
'';
104 $PM = $isArray ? ($deeper ?
'minus' :
'plus') :
'join';
110 $HTML .= ($this->expAll ?
'' :
'<a id="' . $goto .
'" href="' . htmlspecialchars((\
TYPO3\CMS\Backend\Utility\
BackendUtility::getModuleUrl(\
TYPO3\CMS\Core\Utility\
GeneralUtility::_GP(
'M')) .
'&node[' . $depth .
']=' . ($deeper ? 0 : 1) .
'#' . $goto)) .
'">') . $theIcon . ($this->expAll ?
'' :
'</a>');
113 $HTML .= $this->
wrapArrayKey($label, $depth, !$isArray ? $value :
'');
116 if ($this->fixedLgd) {
117 $imgBlocks = ceil(1 + strlen($depthData) / 77);
118 $lgdChars = 68 - ceil(strlen((
'[' . $key .
']')) * 0.8) - $imgBlocks * 3;
119 $theValue = $this->
fixed_lgd($theValue, $lgdChars);
121 if ($this->searchKeys[$depth]) {
122 $HTML .=
'=<span style="color:red;">' . $this->
wrapValue($theValue, $depth) .
'</span>';
124 $HTML .=
'=' . $this->
wrapValue($theValue, $depth);
129 $HTML .= $this->
tree($value, $depth, $depthData .
'<img' . \
TYPO3\CMS\Backend\Utility\IconUtility::skinImg(
$GLOBALS[
'BACK_PATH'], (
'gfx/ol/' . $LN .
'.gif'),
'width="18" height="16"') .
' align="top" alt="" />');
145 if (strlen($theValue) > 0) {
146 $wrappedValue =
'<strong>' . htmlspecialchars($theValue) .
'</strong>';
148 return $wrappedValue;
162 $label = htmlspecialchars($label);
164 if ($this->varName && !$this->dontLinkVar) {
165 $variableName = $this->varName .
'[\'' . str_replace(
'.',
'\'][\
'', $depth) .
'\'] =
' . (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($theValue) ? '\
'' . addslashes($theValue) .
'\'' : $theValue) .
'; ';
169 return '[' . $label .
']';
182 public function getSearchKeys($keyArr, $depth_in, $searchString, $keyArray) {
185 $depth_in = $depth_in .
'.';
187 foreach ($keyArr as $key => $value) {
188 $depth = $depth_in . $key;
189 $deeper = is_array($keyArr[$key]);
190 if ($this->regexMode) {
191 if (is_scalar($keyArr[$key]) && preg_match(
'/' . $searchString .
'/', $keyArr[$key]) || $this->searchKeysToo && preg_match(
'/' . $searchString .
'/', $key)) {
192 $this->searchKeys[$depth] = 1;
195 if (is_scalar($keyArr[$key]) && stristr($keyArr[$key], $searchString) || $this->searchKeysToo && stristr($key, $searchString)) {
196 $this->searchKeys[$depth] = 1;
200 $cS = count($this->searchKeys);
201 $keyArray = $this->
getSearchKeys($keyArr[$key], $depth, $searchString, $keyArray);
202 if ($cS != count($this->searchKeys)) {
203 $keyArray[$depth] = 1;
220 if (strlen($string) > $chars) {
221 return substr($string, 0, ($chars - 3)) .
'...';
237 $tsbrArray = array();
238 foreach ($arr as $theK => $theV) {
239 $theKeyParts = explode(
'.', $theK);
241 $c = count($theKeyParts);
243 foreach ($theKeyParts as $p) {
245 $depth .= ($depth ?
'.' :
'') . $p;
246 $tsbrArray[$depth] = $c == $a ? $theV : 1;
250 foreach ($tsbrArray as $theK => $theV) {
252 $settings[$theK] = 1;
254 unset($settings[$theK]);
static skinImg($backPath, $src, $wHattribs='', $outputMode=0)
depthKeys($arr, $settings)
fixed_lgd($string, $chars)
tree($arr, $depth_in, $depthData)
getSearchKeys($keyArr, $depth_in, $searchString, $keyArray)
static getModuleUrl($moduleName, $urlParameters=array(), $backPathOverride=FALSE, $returnAbsoluteUrl=FALSE)
wrapValue($theValue, $depth)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
wrapArrayKey($label, $depth, $theValue)