[-FEATURE] Remove restricted class prefixes
[Packages/TYPO3.CMS.git] / typo3 / sysext / tstemplate_objbrowser / class.tx_tstemplateobjbrowser.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27
28 $GLOBALS['LANG']->includeLLFile('EXT:tstemplate_objbrowser/locallang.xml');
29
30 /**
31 * This class displays the submodule "TypoScript Object Browser" inside the Web > Template module
32 *
33 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
34 * @package TYPO3
35 * @subpackage tx_tstemplateobjbrowser
36 */
37 class tx_tstemplateobjbrowser extends t3lib_extobjbase {
38
39 /**
40 * Init
41 *
42 * @param object $pObj
43 * @param array $conf
44 * @return void
45 */
46 function init(&$pObj, $conf) {
47 parent::init($pObj, $conf);
48
49 $this->pObj->modMenu_dontValidateList .= ',ts_browser_toplevel_setup,ts_browser_toplevel_const,ts_browser_TLKeys_setup,ts_browser_TLKeys_const';
50 $this->pObj->modMenu_setDefaultList .= ',ts_browser_fixedLgd,ts_browser_showComments';
51 }
52
53 /**
54 * Mod menu
55 *
56 * @return array
57 */
58 function modMenu() {
59 $modMenu = array (
60 'ts_browser_type' => array(
61 'const' => $GLOBALS['LANG']->getLL('constants'),
62 'setup' => $GLOBALS['LANG']->getLL('setup')
63 ),
64 'ts_browser_toplevel_setup' => array(
65 '0' => $GLOBALS['LANG']->csConvObj->conv_case(
66 $GLOBALS['LANG']->charSet, $GLOBALS['LANG']->getLL('all'), 'toUpper'
67 )
68 ),
69 'ts_browser_toplevel_const' => array(
70 '0' => $GLOBALS['LANG']->csConvObj->conv_case(
71 $GLOBALS['LANG']->charSet, $GLOBALS['LANG']->getLL('all'), 'toUpper'
72 )
73 ),
74 'ts_browser_const' => array(
75 '0' => $GLOBALS['LANG']->getLL('plainSubstitution'),
76 'subst' => $GLOBALS['LANG']->getLL('substitutedGreen'),
77 'const' => $GLOBALS['LANG']->getLL('unsubstitutedGreen')
78 ),
79 'ts_browser_regexsearch' => '1',
80 'ts_browser_fixedLgd' => '1',
81 'ts_browser_showComments' => '1',
82 'ts_browser_alphaSort' => '1',
83 );
84
85 foreach (array('setup', 'const') as $bType) {
86 $addKey = t3lib_div::_GET('addKey');
87 // If any plus-signs were clicked, it's registred.
88 if (is_array($addKey)) {
89 reset($addKey);
90 if (current($addKey)) {
91 $this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][key($addKey)] = key($addKey);
92 } else {
93 unset($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][key($addKey)]);
94 }
95 $GLOBALS['BE_USER']->pushModuleData($this->pObj->MCONF['name'], $this->pObj->MOD_SETTINGS);
96 }
97
98 if (count($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType])) {
99 $modMenu['ts_browser_toplevel_'.$bType]['-']='---';
100 $modMenu['ts_browser_toplevel_'.$bType] = $modMenu['ts_browser_toplevel_'.$bType] + $this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType];
101 }
102 }
103
104 return $modMenu;
105 }
106
107 /**
108 * Verify TS objects
109 *
110 * @param array $propertyArray
111 * @param string $parentType
112 * @param string $parentValue
113 * @return array
114 */
115 function verify_TSobjects($propertyArray, $parentType, $parentValue) {
116 $TSobjTable = array(
117 'PAGE' => array(
118 'prop' => array (
119 'typeNum' => 'int',
120 '1,2,3' => 'COBJ',
121 'bodyTag' => 'string'
122 )
123 ),
124 'TEXT' => array(
125 'prop' => array (
126 'value' => 'string'
127 )
128 ),
129 'HTML' => array(
130 'prop' => array (
131 'value' => 'stdWrap'
132 )
133 ),
134 'stdWrap' => array(
135 'prop' => array (
136 'field' => 'string',
137 'current' => 'boolean'
138 )
139 ),
140 );
141 $TSobjDataTypes = array(
142 'COBJ' => 'TEXT,CONTENT',
143 'PAGE' => 'PAGE',
144 'stdWrap' => ''
145 );
146
147 if ($parentType) {
148 if (isset($TSobjDataTypes[$parentType]) && (!$TSobjDataTypes[$parentType] || t3lib_div::inlist($TSobjDataTypes[$parentType], $parentValue))) {
149 $ObjectKind = $parentValue;
150 } else {
151 // Object kind is "" if it should be known.
152 $ObjectKind = '';
153 }
154 } else {
155 // If parentType is not given, then it can be anything. Free.
156 $ObjectKind = $parentValue;
157 }
158
159 if ($ObjectKind && is_array($TSobjTable[$ObjectKind])) {
160 $result = array();
161 if (is_array($propertyArray)) {
162 foreach ($propertyArray as $key => $val) {
163 if (t3lib_utility_Math::canBeInterpretedAsInteger($key)) { // If num-arrays
164 $result[$key] = $TSobjTable[$ObjectKind]['prop']['1,2,3'];
165 } else { // standard
166 $result[$key] = $TSobjTable[$ObjectKind]['prop'][$key];
167 }
168 }
169 }
170 return $result;
171 }
172 }
173
174 /**
175 * Initialize editor
176 *
177 * @param integer $pageId
178 * @param integer $template_uid
179 * @return integer
180 */
181 function initialize_editor($pageId, $template_uid=0) {
182 // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
183 global $tmpl,$tplRow,$theConstants;
184 // Defined global here!
185 $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');
186 // Do not log time-performance information
187 $tmpl->tt_track = 0;
188 $tmpl->init();
189
190 // Gets the rootLine
191 $sys_page = t3lib_div::makeInstance('t3lib_pageSelect');
192 $rootLine = $sys_page->getRootLine($pageId);
193 // This generates the constants/config + hierarchy info for the template.
194 $tmpl->runThroughTemplates($rootLine, $template_uid);
195 // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
196 $tplRow = $tmpl->ext_getFirstTemplate($pageId, $template_uid);
197 // IF there was a template...
198 if (is_array($tplRow)) {
199 return 1;
200 }
201 }
202
203 /**
204 * Main
205 *
206 * @return string
207 */
208 function main() {
209 global $BACK_PATH;
210 global $tmpl,$tplRow,$theConstants;
211
212 $POST = t3lib_div::_POST();
213
214 // Checking for more than one template an if, set a menu...
215 $manyTemplatesMenu = $this->pObj->templateMenu();
216 $template_uid = 0;
217 if ($manyTemplatesMenu) {
218 $template_uid = $this->pObj->MOD_SETTINGS['templatesOnPage'];
219 }
220
221 // BUGBUG: Should we check if the uset may at all read and write template-records???
222 $bType = $this->pObj->MOD_SETTINGS['ts_browser_type'];
223 $existTemplate = $this->initialize_editor($this->pObj->id, $template_uid); // initialize
224 if ($existTemplate) {
225 $theOutput .= $this->pObj->doc->section(
226 $GLOBALS['LANG']->getLL('currentTemplate'),
227 ' <img ' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], t3lib_iconWorks::getIcon('sys_template', $tplRow)) . ' align="top" /> <strong>' .
228 $this->pObj->linkWrapTemplateTitle($tplRow['title'], ($bType == 'setup' ? 'config' : 'constants')) . '</strong>' .
229 htmlspecialchars(trim($tplRow['sitetitle']) ? ' (' . $tplRow['sitetitle'] . ')' : '')
230 );
231 if ($manyTemplatesMenu) {
232 $theOutput.=$this->pObj->doc->section('', $manyTemplatesMenu);
233 }
234 $theOutput .= $this->pObj->doc->spacer(10);
235
236 if ($POST['add_property'] || $POST['update_value'] || $POST['clear_object']) {
237 // add property
238 $line = '';
239 if (is_array($POST['data'])) {
240 $name = key($POST['data']);
241 if ($POST['data'][$name]['name'] !== '') {
242 // Workaround for this special case: User adds a key and submits by pressing the return key. The form however will use "add_property" which is the name of the first submit button in this form.
243 unset($POST['update_value']);
244 $POST['add_property'] = 'Add';
245 }
246 if ($POST['add_property']) {
247 $property = trim($POST['data'][$name]['name']);
248 if (preg_replace('/[^a-zA-Z0-9_\.]*/', '', $property) != $property) {
249 $badPropertyMessage = t3lib_div::makeInstance(
250 't3lib_FlashMessage',
251 $GLOBALS['LANG']->getLL('noSpaces') . '<br />'
252 . $GLOBALS['LANG']->getLL('nothingUpdated'),
253 $GLOBALS['LANG']->getLL('badProperty'),
254 t3lib_FlashMessage::ERROR
255 );
256 t3lib_FlashMessageQueue::addMessage($badPropertyMessage);
257 } else {
258 $pline = $name . '.' . $property . ' = '
259 . trim($POST['data'][$name]['propertyValue']);
260
261 $propertyAddedMessage = t3lib_div::makeInstance(
262 't3lib_FlashMessage',
263 htmlspecialchars($pline),
264 $GLOBALS['LANG']->getLL('propertyAdded')
265 );
266 t3lib_FlashMessageQueue::addMessage($propertyAddedMessage);
267
268 $line.=LF.$pline;
269 }
270 } elseif ($POST['update_value']) {
271 $pline = $name . ' = ' . trim($POST['data'][$name]['value']);
272
273 $updatedMessage = t3lib_div::makeInstance(
274 't3lib_FlashMessage',
275 htmlspecialchars($pline),
276 $GLOBALS['LANG']->getLL('valueUpdated')
277 );
278 t3lib_FlashMessageQueue::addMessage($updatedMessage);
279
280 $line .= LF . $pline;
281 } elseif ($POST['clear_object']) {
282 if ($POST['data'][$name]['clearValue']) {
283 $pline = $name . ' >';
284
285 $objectClearedMessage = t3lib_div::makeInstance(
286 't3lib_FlashMessage',
287 htmlspecialchars($pline),
288 $GLOBALS['LANG']->getLL('objectCleared')
289 );
290 t3lib_FlashMessageQueue::addMessage($objectClearedMessage);
291
292 $line .= LF . $pline;
293 }
294 }
295 }
296 if ($line) {
297 $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
298 // Set the data to be saved
299 $recData = array();
300 $field = $bType == 'setup' ? 'config' : 'constants';
301 $recData['sys_template'][$saveId][$field] = $tplRow[$field] . $line;
302 // Create new tce-object
303 $tce = t3lib_div::makeInstance('t3lib_TCEmain');
304 $tce->stripslashes_values = 0;
305 // Initialize
306 $tce->start($recData, Array());
307 // Saved the stuff
308 $tce->process_datamap();
309 // Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
310 $tce->clear_cacheCmd('all');
311
312 // re-read the template ...
313 $this->initialize_editor($this->pObj->id, $template_uid);
314 }
315 }
316 }
317
318 $tsbr = t3lib_div::_GET('tsbr');
319 $update=0;
320 if (is_array($tsbr)) { // If any plus-signs were clicked, it's registred.
321 $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType] = $tmpl->ext_depthKeys($tsbr, $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType]);
322 $update=1;
323 }
324
325 if ($POST['Submit']) { // If any POST-vars are send, update the condition array
326 $this->pObj->MOD_SETTINGS['tsbrowser_conditions'] = $POST['conditions'];
327 $update=1;
328 }
329 if ($update) {
330 $GLOBALS['BE_USER']->pushModuleData($this->pObj->MCONF['name'], $this->pObj->MOD_SETTINGS);
331 }
332
333 $tmpl->matchAlternative = $this->pObj->MOD_SETTINGS['tsbrowser_conditions'];
334 $tmpl->matchAlternative[] = 'dummydummydummydummydummydummydummydummydummydummydummy'; // This is just here to make sure that at least one element is in the array so that the tsparser actually uses this array to match.
335
336 $tmpl->constantMode = $this->pObj->MOD_SETTINGS['ts_browser_const'];
337 if ($this->pObj->sObj && $tmpl->constantMode) {
338 $tmpl->constantMode = 'untouched';
339 }
340
341 $tmpl->regexMode = $this->pObj->MOD_SETTINGS['ts_browser_regexsearch'];
342 $tmpl->fixedLgd = $this->pObj->MOD_SETTINGS['ts_browser_fixedLgd'];
343 $tmpl->linkObjects = TRUE;
344 $tmpl->ext_regLinenumbers = TRUE;
345 $tmpl->ext_regComments = $this->pObj->MOD_SETTINGS['ts_browser_showComments'];
346 $tmpl->bType = $bType;
347 $tmpl->resourceCheck = 1;
348 $tmpl->removeFromGetFilePath = PATH_site;
349
350 if ($this->pObj->MOD_SETTINGS['ts_browser_type'] == 'const') {
351 $tmpl->ext_constants_BRP = intval(t3lib_div::_GP('breakPointLN'));
352 } else {
353 $tmpl->ext_config_BRP = intval(t3lib_div::_GP('breakPointLN'));
354 }
355 $tmpl->generateConfig();
356
357 if ($bType == 'setup') {
358 $theSetup = $tmpl->setup;
359 } else {
360 $theSetup = $tmpl->setup_constants;
361 }
362
363 // EDIT A VALUE:
364 if ($this->pObj->sObj) {
365 list($theSetup, $theSetupValue) = $tmpl->ext_getSetup($theSetup, ($this->pObj->sObj ? $this->pObj->sObj : ''));
366
367 if ($existTemplate) {
368 // Value
369 $out = '';
370 $out .= htmlspecialchars($this->pObj->sObj) . ' =<br />';
371 $out .= '<input type="Text" name="data[' . htmlspecialchars($this->pObj->sObj) . '][value]" value="' . htmlspecialchars($theSetupValue) . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(40) . ' />';
372 $out .= '<input type="Submit" name="update_value" value="' . $GLOBALS['LANG']->getLL('updateButton') . '" />';
373 $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('editProperty'), $out, 0, 0);
374
375 // Property
376 if (t3lib_extMgm::isLoaded('tsconfig_help')) {
377 $url = $BACK_PATH . 'wizard_tsconfig.php?mode=tsref&onlyProperty=1';
378 $params = array();
379 $params['formName'] = 'editForm';
380 $params['itemName'] = 'data[' . htmlspecialchars($this->pObj->sObj) . '][name]';
381 $params['itemValue'] = 'data[' . htmlspecialchars($this->pObj->sObj) . '][propertyValue]';
382 $TSicon = '<a href="#" onClick="vHWin=window.open(\'' . $url . t3lib_div::implodeArrayForUrl('', array('P'=>$params)) . '\',\'popUp' . $md5ID . '\',\'height=500,width=780,status=0,menubar=0,scrollbars=1\');vHWin.focus();return false;"><img src="' . $BACK_PATH . 'gfx/wizard_tsconfig_s.gif" width="22" height="16" border="0" class="absmiddle" hspace=2 title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:tsRef') . '"></a>';
383 } else {
384 $TSicon = '';
385 }
386 $out = '';
387 $out = '<nobr>' . htmlspecialchars($this->pObj->sObj) . '.';
388 $out .= '<input type="Text" name="data[' . htmlspecialchars($this->pObj->sObj) . '][name]"' . $GLOBALS['TBE_TEMPLATE']->formWidth(20) . ' />' . $TSicon . ' = </nobr><br />';
389 $out .= '<input type="Text" name="data[' . htmlspecialchars($this->pObj->sObj) . '][propertyValue]"' . $GLOBALS['TBE_TEMPLATE']->formWidth(40) . ' />';
390 $out .= '<input type="Submit" name="add_property" value="' . $GLOBALS['LANG']->getLL('addButton') . '" />';
391
392 $theOutput .= $this->pObj->doc->spacer(20);
393 $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('addProperty'), $out, 0, 0);
394
395 // clear
396 $out = '';
397 $out = htmlspecialchars($this->pObj->sObj) . ' <strong>' .
398 $GLOBALS['LANG']->csConvObj->conv_case(
399 $GLOBALS['LANG']->charSet, $GLOBALS['LANG']->getLL('clear'), 'toUpper'
400 ) . '</strong> &nbsp;&nbsp;';
401 $out .= '<input type="Checkbox" name="data[' . htmlspecialchars($this->pObj->sObj) . '][clearValue]" value="1" />';
402 $out .= '<input type="Submit" name="clear_object" value="' . $GLOBALS['LANG']->getLL('clearButton') . '" />';
403 $theOutput .= $this->pObj->doc->spacer(20);
404 $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('clearObject'), $out, 0, 0);
405
406 $theOutput .= $this->pObj->doc->spacer(10);
407 } else {
408 $noTemplateMessage = t3lib_div::makeInstance(
409 't3lib_FlashMessage',
410 $GLOBALS['LANG']->getLL('noCurrentTemplate'),
411 $GLOBALS['LANG']->getLL('edit'),
412 t3lib_FlashMessage::ERROR
413 );
414
415 t3lib_FlashMessageQueue::addMessage($noTemplateMessage);
416 }
417 // Links:
418 $out = '';
419 $urlParameters = array(
420 'id' => $this->pObj->id,
421 );
422 $aHref = t3lib_BEfunc::getModuleUrl('web_ts', $urlParameters);
423 if (!$this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType][$this->pObj->sObj]) {
424 if (count($theSetup)) {
425 $out = '<a href="' . htmlspecialchars($aHref . '&addKey[' . rawurlencode($this->pObj->sObj) . ']=1&SET[ts_browser_toplevel_' . $bType . ']=' . rawurlencode($this->pObj->sObj)) . '">';
426 $out .= sprintf($GLOBALS['LANG']->getLL('addKey'), htmlspecialchars($this->pObj->sObj));
427 }
428 } else {
429 $out = '<a href="' . htmlspecialchars($aHref . '&addKey[' . rawurlencode($this->pObj->sObj) . ']=0&SET[ts_browser_toplevel_' . $bType . ']=0') . '">';
430 $out .= sprintf($GLOBALS['LANG']->getLL('removeKey'), htmlspecialchars($this->pObj->sObj));
431 }
432 if ($out) {
433 $theOutput .= $this->pObj->doc->divider(5);
434 $theOutput .= $this->pObj->doc->section('', $out);
435 }
436
437 // back
438 $out = $GLOBALS['LANG']->getLL('back');
439 $out = '<a href="' . htmlspecialchars($aHref) . '"><strong>' . $out . '</strong></a>';
440 $theOutput .= $this->pObj->doc->divider(5);
441 $theOutput .= $this->pObj->doc->section('', $out);
442
443 } else {
444 $tmpl->tsbrowser_depthKeys = $this->pObj->MOD_SETTINGS['tsbrowser_depthKeys_' . $bType];
445
446 if (t3lib_div::_POST('search') && t3lib_div::_POST('search_field')) { // If any POST-vars are send, update the condition array
447 $tmpl->tsbrowser_depthKeys = $tmpl->ext_getSearchKeys($theSetup, '', t3lib_div::_POST('search_field'), array());
448 }
449
450 $menu = '<div class="tsob-menu"><label>' . $GLOBALS['LANG']->getLL('browse') . '</label>';
451 $menu .= t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[ts_browser_type]', $bType, $this->pObj->MOD_MENU['ts_browser_type']);
452 $menu .= '<label for="ts_browser_toplevel_' . $bType . '">' . $GLOBALS['LANG']->getLL('objectList') . '</label>';
453 $menu .= t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[ts_browser_toplevel_' . $bType . ']', $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType], $this->pObj->MOD_MENU['ts_browser_toplevel_' . $bType]);
454
455 //search
456 $menu .= '<label for="search_field">' . $GLOBALS['LANG']->getLL('search') .'</label>';
457 $menu .= '<input type="Text" name="search_field" id="search_field" value="' . htmlspecialchars($POST['search_field']) . '"' . $GLOBALS['TBE_TEMPLATE']->formWidth(20) . '/>';
458 $menu .= '<input type="Submit" name="search" class="tsob-search-submit" value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:search') . '" />';
459 $menu .= t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[ts_browser_regexsearch]', $this->pObj->MOD_SETTINGS['ts_browser_regexsearch'], '', '', 'id="checkTs_browser_regexsearch"');
460 $menu .= '<label for="checkTs_browser_regexsearch">' . $GLOBALS['LANG']->getLL('regExp') . '</label>';
461 $menu .= '</div>';
462
463 $theOutput .= $this->pObj->doc->section('', '<nobr>' . $menu . '</nobr>');
464 $theKey = $this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType];
465 if (!$theKey || !str_replace('-', '', $theKey)) {$theKey = '';}
466 list($theSetup,$theSetupValue) = $tmpl->ext_getSetup($theSetup, ($this->pObj->MOD_SETTINGS['ts_browser_toplevel_' . $bType] ? $this->pObj->MOD_SETTINGS['ts_browser_toplevel_'.$bType] : ''));
467 $tree = $tmpl->ext_getObjTree($theSetup, $theKey, '', '', $theSetupValue, $this->pObj->MOD_SETTINGS['ts_browser_alphaSort']);
468 $tree = $tmpl->substituteCMarkers($tree);
469
470 $urlParameters = array(
471 'id' => $this->pObj->id,
472 );
473 $aHref = t3lib_BEfunc::getModuleUrl('web_ts', $urlParameters);
474
475 // Parser Errors:
476 $pEkey = ($bType == 'setup' ? 'config' : 'constants');
477 if (count($tmpl->parserErrors[$pEkey])) {
478 $errMsg=array();
479 $templateAnalyzerInstalled = t3lib_extMgm::isLoaded('tstemplate_analyzer');
480
481 foreach ($tmpl->parserErrors[$pEkey] as $inf) {
482 $errorLink = '';
483 if ($templateAnalyzerInstalled) {
484 $errorLink = ' <a href="' . htmlspecialchars($aHref . '&SET[function]=tx_tstemplateanalyzer&template=all&SET[ts_analyzer_checkLinenum]=1#line-' . $inf[2]) . '">'
485 . $GLOBALS['LANG']->getLL('errorShowDetails')
486 . '</a>';
487 }
488
489 $errMsg[] = ($inf[1]) . ': &nbsp; &nbsp;' . $inf[0] . $errorLink;
490 }
491 $theOutput .= $this->pObj->doc->spacer(10);
492
493 $flashMessage = t3lib_div::makeInstance(
494 't3lib_FlashMessage',
495 implode($errMsg, '<br />'),
496 $GLOBALS['LANG']->getLL('errorsWarnings'),
497 t3lib_FlashMessage::ERROR
498 );
499 $theOutput .= $flashMessage->render();
500 }
501
502 if (isset($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_' . $bType][$theKey])) {
503 $remove = '<td width="1%" nowrap><a href="' . htmlspecialchars($aHref . '&addKey[' . $theKey . ']=0&SET[ts_browser_toplevel_' . $bType . ']=0') . '"><strong>' . $GLOBALS['LANG']->getLL('removeKey') . '</strong></a></td>';
504 } else {
505 $remove = '';
506 }
507 $label = $theKey ? $theKey :
508 ($bType == 'setup' ?
509 $GLOBALS['LANG']->csConvObj->conv_case($GLOBALS['LANG']->charSet, $GLOBALS['LANG']->getLL('setupRoot'), 'toUpper') :
510 $GLOBALS['LANG']->csConvObj->conv_case($GLOBALS['LANG']->charSet, $GLOBALS['LANG']->getLL('constantRoot'), 'toUpper')
511 );
512 $theOutput .= $this->pObj->doc->spacer(15);
513 $theOutput .= $this->pObj->doc->sectionEnd();
514 $theOutput .= '<table border="0" id="typo3-objectBrowser">
515 <tr class="t3-row-header">
516 <td nowrap="nowrap" width="99%"><strong>' . $label . '</strong></td>' . $remove . '
517 </tr>
518 <tr>
519 <td class="bgColor4" nowrap="nowrap">' . $tree . '</td>' . ($remove ? '<td></td>' : '') . '
520 </tr>
521 </table>
522 ';
523
524 // second row options
525 $menu = '<div class="tsob-menu-row2">';
526 $menu .= t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[ts_browser_showComments]', $this->pObj->MOD_SETTINGS['ts_browser_showComments'], '', '', 'id="checkTs_browser_showComments"');
527 $menu .= '<label for="checkTs_browser_showComments">' . $GLOBALS['LANG']->getLL('displayComments') . '</label>';
528 $menu .= t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[ts_browser_alphaSort]', $this->pObj->MOD_SETTINGS['ts_browser_alphaSort'], '', '', 'id="checkTs_browser_alphaSort"');
529 $menu .= '<label for="checkTs_browser_alphaSort">' . $GLOBALS['LANG']->getLL('sortAlphabetically') . '</label>';
530 $menu .= t3lib_BEfunc::getFuncCheck($this->pObj->id, 'SET[ts_browser_fixedLgd]', $this->pObj->MOD_SETTINGS['ts_browser_fixedLgd'], '', '', 'id="checkTs_browser_fixedLgd"');
531 $menu .= '<label for="checkTs_browser_fixedLgd">' . $GLOBALS['LANG']->getLL('cropLines') . '</label>';
532 if ($bType == 'setup' && !$this->pObj->MOD_SETTINGS['ts_browser_fixedLgd']) {
533 $menu .= '<br /><br /><label>' . $GLOBALS['LANG']->getLL('displayConstants') . '</label>';
534 $menu .= t3lib_BEfunc::getFuncMenu($this->pObj->id, 'SET[ts_browser_const]', $this->pObj->MOD_SETTINGS['ts_browser_const'], $this->pObj->MOD_MENU['ts_browser_const']);
535
536 }
537 $menu .= '</div>';
538
539 $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('displayOptions'), '<nobr>' . $menu . '</nobr>', 0, 1);
540
541 // Conditions:
542 if (is_array($tmpl->sections)) {
543 $theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('conditions'), '', 0, 1);
544
545 $out = '';
546 foreach ($tmpl->sections as $key => $val) {
547 $out .= '<tr><td nowrap class="tsob-conditions"><input type="checkbox" name="conditions[' . $key . ']" id="check' . $key . '" value="' . htmlspecialchars($val) . '"' . ($this->pObj->MOD_SETTINGS['tsbrowser_conditions'][$key] ? ' checked' : '') . ' />';
548 $out .= '<label for="check' .$key . '">' . $tmpl->substituteCMarkers(htmlspecialchars($val)) . '</label></td></tr>';
549 }
550 $theOutput .= '
551 <table border="0" cellpadding="0" cellspacing="0" class="bgColor4">'.$out.'
552 <td><br /><input type="Submit" name="Submit" value="' . $GLOBALS['LANG']->getLL('setConditions') . '" /></td>
553 </table>
554
555 ';
556 }
557
558 // Ending section:
559 $theOutput .= $this->pObj->doc->sectionEnd();
560 }
561 return $theOutput;
562 }
563 }
564 ?>