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