Template tools (Web>Template) had hard-coded background colours
[Packages/TYPO3.CMS.git] / typo3 / sysext / tstemplate_objbrowser / class.tx_tstemplateobjbrowser.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2005 Kasper Skaarhoj (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 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
29 */
30
31 require_once(PATH_t3lib."class.t3lib_extobjbase.php");
32
33 class tx_tstemplateobjbrowser extends t3lib_extobjbase {
34 function modMenu() {
35 global $LANG;
36
37 $modMenu = array (
38 "ts_browser_type" => array(
39 "setup" => "Setup",
40 "const" => "Constants"
41 ),
42 "ts_browser_toplevel_setup" => array(
43 "0" => "ALL"
44 ),
45 "ts_browser_toplevel_const" => array(
46 "0" => "ALL"
47 ),
48 "ts_browser_const" => array(
49 "0" => "Plain substitution (default)",
50 "subst" => "Substituted constants in green",
51 "const" => "UN-substituted constants in green"
52 ),
53 "ts_browser_regexsearch" => "",
54 "ts_browser_fixedLgd" => "1",
55 "ts_browser_linkObjects" => "1",
56 );
57
58 foreach(array('setup','const') as $bType) {
59 $addKey = t3lib_div::_GET('addKey');
60 if (is_array($addKey)) { // If any plus-signs were clicked, it's registred.
61 reset($addKey);
62 if (current($addKey)) {
63 $this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType][key($addKey)] = key($addKey);
64 } else {
65 unset($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType][key($addKey)]);
66 }
67 $GLOBALS['BE_USER']->pushModuleData($this->pObj->MCONF['name'],$this->pObj->MOD_SETTINGS);
68 }
69
70 if (count($this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType])) {
71 $modMenu['ts_browser_toplevel_'.$bType]['-']='---';
72 $modMenu['ts_browser_toplevel_'.$bType] = $modMenu['ts_browser_toplevel_'.$bType] + $this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType];
73 }
74 }
75
76 return $modMenu;
77 }
78
79 /**
80 * [Describe function...]
81 *
82 * @param [type] $propertyArray: ...
83 * @param [type] $parentType: ...
84 * @param [type] $parentValue: ...
85 * @return [type] ...
86 */
87 function verify_TSobjects($propertyArray,$parentType,$parentValue) {
88 $TSobjTable = array(
89 "PAGE" => array(
90 "prop" => array (
91 "typeNum" => "int",
92 "1,2,3" => "COBJ",
93 "bodyTag" => "string"
94 )
95 ),
96 "TEXT" => array(
97 "prop" => array (
98 "value" => "string"
99 )
100 ),
101 "HTML" => array(
102 "prop" => array (
103 "value" => "stdWrap"
104 )
105 ),
106 "stdWrap" => array(
107 "prop" => array (
108 "field" => "string",
109 "current" => "boolean"
110 )
111 ),
112 );
113 $TSobjDataTypes = array(
114 "COBJ" => "TEXT,CONTENT",
115 "PAGE" => "PAGE",
116 "stdWrap" => ""
117 );
118
119 if ($parentType) {
120 if (isset($TSobjDataTypes[$parentType]) && (!$TSobjDataTypes[$parentType] || t3lib_div::inlist($TSobjDataTypes[$parentType],$parentValue))) {
121 $ObjectKind = $parentValue;
122 } else {
123 $ObjectKind = ""; // Object kind is "" if it should be known.
124 }
125 } else {
126 $ObjectKind = $parentValue; // If parentType is not given, then it can be anything. Free.
127 }
128
129 if ($ObjectKind && is_array($TSobjTable[$ObjectKind])) {
130 $result=array();
131 if (is_array($propertyArray)) {
132 reset($propertyArray);
133 while(list($key,$val)=each($propertyArray)) {
134 if (t3lib_div::testInt($key)) { // If num-arrays
135 $result[$key]=$TSobjTable[$ObjectKind]["prop"]["1,2,3"];
136 } else { // standard
137 $result[$key]=$TSobjTable[$ObjectKind]["prop"][$key];
138 }
139 }
140 }
141 return $result;
142 }
143 }
144
145 /**
146 * [Describe function...]
147 *
148 * @param [type] $pageId: ...
149 * @param [type] $template_uid: ...
150 * @return [type] ...
151 */
152 function initialize_editor($pageId,$template_uid=0) {
153 // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
154 global $tmpl,$tplRow,$theConstants;
155
156 $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext"); // Defined global here!
157 $tmpl->tt_track = 0; // Do not log time-performance information
158 $tmpl->init();
159
160 // Gets the rootLine
161 $sys_page = t3lib_div::makeInstance("t3lib_pageSelect");
162 $rootLine = $sys_page->getRootLine($pageId);
163 $tmpl->runThroughTemplates($rootLine,$template_uid); // This generates the constants/config + hierarchy info for the template.
164
165 $tplRow = $tmpl->ext_getFirstTemplate($pageId,$template_uid); // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
166 if (is_array($tplRow)) { // IF there was a template...
167 return 1;
168 }
169 }
170
171 /**
172 * [Describe function...]
173 *
174 * @return [type] ...
175 */
176 function main() {
177 global $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
178 global $tmpl,$tplRow,$theConstants;
179
180 $POST = t3lib_div::_POST();
181
182 // **************************
183 // Checking for more than one template an if, set a menu...
184 // **************************
185 $manyTemplatesMenu = $this->pObj->templateMenu();
186 $template_uid = 0;
187 if ($manyTemplatesMenu) {
188 $template_uid = $this->pObj->MOD_SETTINGS["templatesOnPage"];
189 }
190
191
192
193
194
195 // **************************
196 // Main
197 // **************************
198
199 // BUGBUG: Should we check if the uset may at all read and write template-records???
200 $bType= $this->pObj->MOD_SETTINGS["ts_browser_type"];
201 $existTemplate = $this->initialize_editor($this->pObj->id,$template_uid); // initialize
202 if ($existTemplate) {
203 $theOutput.=$this->pObj->doc->divider(5);
204 $theOutput.=$this->pObj->doc->section("Current template:",'<img src="'.$BACK_PATH.t3lib_iconWorks::getIcon("sys_template",$tplRow).'" width=18 height=16 align=top><b>'.$this->pObj->linkWrapTemplateTitle($tplRow["title"], ($bType=="setup"?"config":"constants")).'</b>'.htmlspecialchars(trim($tplRow["sitetitle"])?' - ('.$tplRow["sitetitle"].')':''),0,0);
205 if ($manyTemplatesMenu) {
206 $theOutput.=$this->pObj->doc->section("",$manyTemplatesMenu);
207 $theOutput.=$this->pObj->doc->divider(5);
208 }
209
210 if ($POST["add_property"] || $POST["update_value"] || $POST["clear_object"]) {
211 // add property
212 $line="";
213 // debug($POST);
214 if (is_array($POST["data"])) {
215 if ($POST["add_property"]) {
216 reset($POST["data"]);
217 $name = key($POST["data"]);
218 $property = trim($POST["data"][$name]["name"]);
219 if (ereg_replace("[^a-zA-Z0-9_\.]*","",$property)!=$property) {
220 $theOutput.=$this->pObj->doc->spacer(10);
221 $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("BAD PROPERTY!"),'You must enter a property with characters a-z, A-Z and 0-9, no spaces!<BR>Nothing was updated!',0,0,0,1);
222 } else {
223 $pline= $name.".".$property." = ".trim($POST["data"][$name]["propertyValue"]);
224 $theOutput.=$this->pObj->doc->spacer(10);
225 $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("PROPERTY ADDED"),htmlspecialchars($pline),0,0,0,1);
226 $line.=chr(10).$pline;
227 }
228 }
229 if ($POST["update_value"]) {
230 reset($POST["data"]);
231 $name = key($POST["data"]);
232 $pline= $name." = ".trim($POST["data"][$name]["value"]);
233 $theOutput.=$this->pObj->doc->spacer(10);
234 $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("VALUE UPDATED"),htmlspecialchars($pline),0,0,0,1);
235 $line.=chr(10).$pline;
236 }
237 if ($POST["clear_object"]) {
238 reset($POST["data"]);
239 $name = key($POST["data"]);
240 if ($POST["data"][$name]["clearValue"]) {
241 $pline= $name." >";
242 $theOutput.=$this->pObj->doc->spacer(10);
243 $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("Object cleared"),htmlspecialchars($pline),0,0,0,1);
244 $line.=chr(10).$pline;
245 }
246 }
247 }
248 if ($line) {
249 require_once (PATH_t3lib."class.t3lib_tcemain.php");
250 $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
251 // Set the data to be saved
252 $recData=array();
253 $field =$bType=="setup"?"config":"constants";
254 $recData["sys_template"][$saveId][$field] = $tplRow[$field].$line;
255 // Create new tce-object
256 $tce = t3lib_div::makeInstance("t3lib_TCEmain");
257 $tce->stripslashes_values=0;
258 // Initialize
259 $tce->start($recData,Array());
260 // Saved the stuff
261 $tce->process_datamap();
262 // Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
263 $tce->clear_cacheCmd("all");
264
265 // re-read the template ...
266 $this->initialize_editor($this->pObj->id,$template_uid);
267 }
268 }
269 }
270
271 $tsbr = t3lib_div::_GET('tsbr');
272 $update=0;
273 if (is_array($tsbr)) { // If any plus-signs were clicked, it's registred.
274 $this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType] = $tmpl->ext_depthKeys($tsbr, $this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType]);
275 $update=1;
276 }
277
278 if ($POST["Submit"]) { // If any POST-vars are send, update the condition array
279 $this->pObj->MOD_SETTINGS["tsbrowser_conditions"] = $POST["conditions"];
280 $update=1;
281 }
282 if ($update) { $GLOBALS["BE_USER"]->pushModuleData($this->pObj->MCONF["name"],$this->pObj->MOD_SETTINGS); }
283
284
285 $tmpl->matchAlternative = $this->pObj->MOD_SETTINGS['tsbrowser_conditions'];
286 $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.
287
288 $tmpl->constantMode = $this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"] ? "" : $this->pObj->MOD_SETTINGS["ts_browser_const"];
289 if ($this->pObj->sObj && $tmpl->constantMode) {$tmpl->constantMode = "untouched";}
290
291 $tmpl->regexMode = $this->pObj->MOD_SETTINGS["ts_browser_regexsearch"];
292 $tmpl->fixedLgd=$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"];
293 # $tmpl->linkObjects=$this->pObj->MOD_SETTINGS["ts_browser_linkObjects"];
294 $tmpl->linkObjects = TRUE;
295 $tmpl->ext_regLinenumbers = TRUE;
296 $tmpl->bType=$bType;
297 $tmpl->resourceCheck=1;
298 $tmpl->uplPath = PATH_site.$tmpl->uplPath;
299 $tmpl->removeFromGetFilePath = PATH_site;
300 //debug($tmpl->uplPath);
301
302 if ($this->pObj->MOD_SETTINGS["ts_browser_type"]=="const") {
303 $tmpl->ext_constants_BRP=intval(t3lib_div::_GP("breakPointLN"));
304 } else {
305 $tmpl->ext_config_BRP=intval(t3lib_div::_GP("breakPointLN"));
306 }
307 $tmpl->generateConfig();
308
309 if ($bType=="setup") {
310 $theSetup = $tmpl->setup;
311 } else {
312 $theSetup = $tmpl->setup_constants;
313 }
314
315 // EDIT A VALUE:
316 if ($this->pObj->sObj) {
317 list($theSetup,$theSetupValue) = $tmpl->ext_getSetup($theSetup, ($this->pObj->sObj?$this->pObj->sObj:""));
318 $theOutput.=$this->pObj->doc->divider(5);
319 if ($existTemplate) {
320 // Value
321 $out="";
322 $out=$this->pObj->sObj." =<BR>";
323 $out.='<input type="Text" name="data['.$this->pObj->sObj.'][value]" value="'.htmlspecialchars($theSetupValue).'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(40).'>';
324 $out.='<input type="Submit" name="update_value" value="Update">';
325 $theOutput.=$this->pObj->doc->section("Edit object/property value:",$out,0,0);
326
327 // Property
328 if (t3lib_extMgm::isLoaded("tsconfig_help")) {
329 $url=$BACK_PATH."wizard_tsconfig.php?mode=tsref&onlyProperty=1";
330 $params=array();
331 $params["formName"]="editForm";
332 $params["itemName"]="data[".$this->pObj->sObj."][name]";
333 $params["itemValue"]="data[".$this->pObj->sObj."][propertyValue]";
334 $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="TSref reference"></a>';
335 } else $TSicon="";
336 $out="";
337 $out="<nobr>".$this->pObj->sObj.".";
338 $out.='<input type="Text" name="data['.$this->pObj->sObj.'][name]"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'>'.$TSicon.' = </nobr><BR>';
339 $out.='<input type="Text" name="data['.$this->pObj->sObj.'][propertyValue]"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(40).'>';
340 $out.='<input type="Submit" name="add_property" value="Add">';
341
342
343
344 $theOutput.=$this->pObj->doc->spacer(20);
345 $theOutput.=$this->pObj->doc->section("Add object property:",$out,0,0);
346
347 // clear
348 $out="";
349 $out=$this->pObj->sObj." <b>CLEAR?</b> &nbsp;&nbsp;";
350 $out.='<input type="Checkbox" name="data['.$this->pObj->sObj.'][clearValue]" value="1">';
351 $out.='<input type="Submit" name="clear_object" value="Clear">';
352 $theOutput.=$this->pObj->doc->spacer(20);
353 $theOutput.=$this->pObj->doc->section("Clear object:",$out,0,0);
354
355 $theOutput.=$this->pObj->doc->spacer(10);
356 } else {
357 $theOutput.=$this->pObj->doc->section("EDIT:",$GLOBALS["TBE_TEMPLATE"]->rfw("You cannot edit properties and values, if there's no current template."),0,0,0,1);
358 }
359 // Links:
360 $out='';
361 if (!$this->pObj->MOD_SETTINGS['ts_browser_TLKeys_'.$bType][$this->pObj->sObj]) {
362 if (count($theSetup)) {
363 $out = '<a href="index.php?id='.$this->pObj->id.'&addKey['.$this->pObj->sObj.']=1&SET[ts_browser_toplevel_'.$bType.']='.rawurlencode($this->pObj->sObj).'"><b>Add key</b></a> "'.$this->pObj->sObj.'" to Object List (OL)';
364 }
365 } else {
366 $out = '<a href="index.php?id='.$this->pObj->id.'&addKey['.$this->pObj->sObj.']=0&SET[ts_browser_toplevel_'.$bType.']=0"><b>Remove key</b></a> "'.$this->pObj->sObj.'" from Object List (OL)';
367 }
368 if ($out) {
369 $theOutput.=$this->pObj->doc->divider(5);
370 $theOutput.=$this->pObj->doc->section("",$out);
371 }
372
373 // back
374 $out = "< Back";
375 $out = '<a href="index.php?id='.$this->pObj->id.'"><b>'.$out.'</b></a>';
376 $theOutput.=$this->pObj->doc->divider(5);
377 $theOutput.=$this->pObj->doc->section("",$out);
378
379 } else {
380 $tmpl->tsbrowser_depthKeys=$this->pObj->MOD_SETTINGS["tsbrowser_depthKeys_".$bType];
381 // debug($tmpl->tsbrowser_depthKeys);
382
383 if (t3lib_div::_POST('search') && t3lib_div::_POST('search_field')) { // If any POST-vars are send, update the condition array
384 $tmpl->tsbrowser_depthKeys = $tmpl->ext_getSearchKeys($theSetup, '', t3lib_div::_POST('search_field'), array());
385 // debug($tmpl->tsbrowser_depthKeys);
386 // debug($tmpl->tsbrowser_searchKeys);
387 }
388
389
390
391 // Expanding menu
392 /* if (is_array($theSetup)) {
393 reset($theSetup);
394 while(list($tkey,$tval)=each($theSetup)) {
395 if (substr($tkey,-1)==".") {
396 $tkey=substr($tkey,0,-1);
397 }
398 if ($theSetup[$tkey."."] && $tkey!="types" && $tkey!="TSConstantEditor") {
399 $this->pObj->MOD_MENU["ts_browser_toplevel_".$bType][$tkey]=$tkey;
400 }
401 }
402 }*/
403
404 $theOutput.=$this->pObj->doc->spacer(5);
405 $theOutput.=$this->pObj->doc->section('Object tree:','',0,1);
406
407 $menu = 'Browse: '.t3lib_BEfunc::getFuncMenu($this->pObj->id,'SET[ts_browser_type]',$bType,$this->pObj->MOD_MENU['ts_browser_type']);
408 $menu.= '&nbsp;&nbsp;OL: '.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]);
409 $theOutput.=$this->pObj->doc->section('','<NOBR>'.$menu.'</NOBR>');
410
411
412 $theKey=$this->pObj->MOD_SETTINGS["ts_browser_toplevel_".$bType];
413 if (!$theKey || !str_replace("-","",$theKey)) {$theKey="";}
414 list($theSetup,$theSetupValue) = $tmpl->ext_getSetup($theSetup, ($this->pObj->MOD_SETTINGS['ts_browser_toplevel_'.$bType]?$this->pObj->MOD_SETTINGS['ts_browser_toplevel_'.$bType]:''));
415 $tree = $tmpl->ext_getObjTree($theSetup, $theKey, "", "", $theSetupValue);
416 $tree = $tmpl->substituteCMarkers($tree);
417
418
419
420 // Parser Errors:
421 $pEkey = ($bType=="setup"?"config":"constants");
422 if (count($tmpl->parserErrors[$pEkey])) {
423 reset($tmpl->parserErrors[$pEkey]);
424 $errMsg=array();
425 while(list(,$inf)=each($tmpl->parserErrors[$pEkey])) {
426 $errMsg[]=($inf[1]).": &nbsp; &nbsp;".$inf[0];
427 }
428 $theOutput.=$this->pObj->doc->spacer(10);
429 $theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("Errors and warnings"),implode($errMsg,"<br>"),0,1,0,1);
430 }
431
432
433
434 if (isset($this->pObj->MOD_SETTINGS["ts_browser_TLKeys_".$bType][$theKey])) {
435 $remove='<td width="1%" nowrap><a href="index.php?id='.$this->pObj->id.'&addKey['.$theKey.']=0&SET[ts_browser_toplevel_'.$bType.']=0"><b>Remove key from OL</b></a></td>';
436 } else {
437 $remove='';
438 }
439 $label = $theKey ? $theKey : ($bType=="setup"?"SETUP ROOT":"CONSTANTS ROOT");
440 $theOutput.=$this->pObj->doc->spacer(15);
441 $theOutput.=$this->pObj->doc->sectionEnd();
442 $theOutput.='<table border=0 cellpadding=1 cellspacing=0 id="typo3-objectBrowser">
443 <tr>
444 <td><img src=clear.gif width=4 height=1></td>
445 <td class="bgColor2">
446 <table border=0 cellpadding=0 cellspacing=0 class="bgColor5" width="100%"><tr><td nowrap width="99%"><b>'.$label.'</b></td>'.$remove.'</tr></table>
447 </td>
448 </tr>
449 <tr>
450 <td><img src=clear.gif width=4 height=1></td>
451 <td class="bgColor2">
452 <table border=0 cellpadding=0 cellspacing=0 class="bgColor4" width="100%"><tr><td nowrap>'.$tree.'</td></tr></table><img src=clear.gif width=465 height=1></td>
453 </tr>
454 </table>
455 ';
456
457
458 // Conditions:
459 if (is_array($tmpl->sections)) {
460 $theOutput.=$this->pObj->doc->divider(15);
461
462 $out="";
463 reset($tmpl->sections);
464 while(list($key,$val)=each($tmpl->sections)) {
465 $out.='<tr><td><input type="Checkbox" name="conditions['.$key.']" value="'.htmlspecialchars($val).'"'.($this->pObj->MOD_SETTINGS["tsbrowser_conditions"][$key]?" checked":"").'></td><td nowrap>'.$tmpl->substituteCMarkers(htmlspecialchars($val)).'&nbsp;&nbsp;</td></tr>';
466 }
467 $theOutput.='
468 <table border=0 cellpadding=1 cellspacing=0>
469 <tr>
470 <td><img src=clear.gif width=4 height=1></td>
471 <td class="bgColor2">
472 <table border=0 cellpadding=0 cellspacing=0 class="bgColor4">'.$out.'
473 <tr>
474 <td>&nbsp;</td>
475 <td><img src=clear.gif height=10 width=240><BR><input type="Submit" name="Submit" value="Set conditions"><BR></td>
476 </tr>
477 </table>
478 </td>
479 </tr>
480 </table>
481
482 ';
483 }
484
485 // Search:
486 $theOutput.='<br>
487
488 <table border=0 cellpadding=1 cellspacing=0>
489 <tr>
490 <td><img src=clear.gif width=4 height=1></td>
491 <td class="bgColor2">
492 <table border=0 cellpadding=0 cellspacing=0 class="bgColor4">
493 <tr>
494 <td>&nbsp;Enter search phrase:&nbsp;&nbsp;<input type="Text" name="search_field" value="'.htmlspecialchars($POST["search_field"]).'"'.$GLOBALS["TBE_TEMPLATE"]->formWidth(20).'></td>
495 <td><input type="Submit" name="search" value="Search"></td>
496 </tr>
497 <tr>
498 <td>&nbsp;Use ereg(), not stristr():&nbsp;&nbsp;'.t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_regexsearch]",$this->pObj->MOD_SETTINGS["ts_browser_regexsearch"]).'</td>
499 <td>&nbsp;</td>
500 </tr>
501 </table>
502 </td>
503 </tr>
504 </table>
505 <br>
506 ';
507
508 // Menu in the bottom:
509 $menu= "Crop lines".t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_fixedLgd]",$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"]);
510 #$menu.= "&nbsp;&nbsp;Enable object links".t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_linkObjects]",$this->pObj->MOD_SETTINGS["ts_browser_linkObjects"]);
511 if ($bType=="setup" && !$this->pObj->MOD_SETTINGS["ts_browser_fixedLgd"]) {
512 $menu.= "<BR>Constants display: ".t3lib_BEfunc::getFuncMenu($this->pObj->id,"SET[ts_browser_const]",$this->pObj->MOD_SETTINGS["ts_browser_const"],$this->pObj->MOD_MENU["ts_browser_const"]);
513 }
514 $theOutput.=$this->pObj->doc->section("",'<NOBR>'.$menu.'</NOBR>');
515
516 $theOutput.=$this->pObj->doc->spacer(10);
517 $theOutput.=$this->pObj->doc->section("Cache",'Click here to <a href="index.php?id='.$this->pObj->id.'&clear_all_cache=1"><strong>clear all cache</strong></a>',0,1);
518
519 // Ending section:
520 $theOutput.=$this->pObj->doc->sectionEnd();
521 }
522 return $theOutput;
523 }
524 }
525
526 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php"]) {
527 include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php"]);
528 }
529
530 ?>