added beta glue code for t3editor
[Packages/TYPO3.CMS.git] / typo3 / sysext / tstemplate_info / class.tx_tstemplateinfo.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_tstemplateinfo extends t3lib_extobjbase {
34
35 /* <beta-code TYPO3 4.2-dev> */
36 private $tce_processed = false; // indicator for t3editor, whether data is stored
37 /* </beta-code> */
38
39 function modMenu() {
40 global $LANG;
41
42 return Array (
43 #"ts_template_editor_TArows" => ""
44 );
45 }
46 function tableRow($label,$data,$field) {
47 $ret='<tr><td class="bgColor4" width="1%">';
48 $ret.='<a href="index.php?id='.$this->pObj->id.'&e['.$field.']=1"><img '.t3lib_iconWorks::skinImg($GLOBALS["BACK_PATH"],'gfx/edit2.gif').' width=11 height=12 hspace=3 border=0 title="Edit field"></a>';
49 $ret.='</td><td class="bgColor4" width="1%"><b>'.$label.'&nbsp;&nbsp;</b></td><td class="bgColor4" width="99%">'.$data.'&nbsp;</td></tr>';
50 return $ret;
51 }
52 function procesResources($resources,$func=0) {
53 $arr = t3lib_div::trimExplode(",",$resources.",,",1);
54 $out="";
55 if ($func) {$bgcol=' class="bgColor4"';} else {$bgcol="";}
56 while(list($k,$v)=each($arr)) {
57 $path = PATH_site.$GLOBALS["TCA"]["sys_template"]["columns"]["resources"]["config"]["uploadfolder"]."/".$v;
58 $functions="";
59 if ($func) {
60 $functions='<td bgcolor=red nowrap>Delete: <input type="Checkbox" name="data[remove_resource]['.$k.']" value="'.htmlspecialchars($v).'"></td>';
61 $functions.='<td'.$bgcol.' nowrap>To top: <input type="Checkbox" name="data[totop_resource]['.$k.']" value="'.htmlspecialchars($v).'"></td>';
62 $functions.='<td'.$bgcol.' nowrap>';
63 $fI=t3lib_div::split_fileref($v);
64 if (t3lib_div::inList($this->pObj->textExtensions,$fI["fileext"])) {
65 $functions.='<a href="index.php?id='.$this->pObj->id.'&e[file]='.rawurlencode($v).'"><img '.t3lib_iconWorks::skinImg($GLOBALS["BACK_PATH"],'gfx/edit2.gif').' width=11 height=12 hspace=3 border=0 title="Edit file"></a>';
66 }
67 $functions.='</td>';
68 }
69 $thumb=t3lib_BEfunc::thumbCode(array("resources"=>$v),"sys_template","resources",$GLOBALS["BACK_PATH"],"");
70 $out.='<tr><td'.$bgcol.' nowrap>'.$v.'&nbsp;&nbsp;</td><td'.$bgcol.' nowrap>&nbsp;'.t3lib_div::formatSize(@filesize($path)).'&nbsp;</td>'.$functions.'<td'.$bgcol.'>'.trim($thumb).'</td></tr>';
71 }
72 if ($out) {
73 if ($func) {
74 $out = '<table border=0 cellpadding=1 cellspacing=1 width="100%">'.$out.'</table>';
75 $out='<table border=0 cellpadding=0 cellspacing=0>
76 <tr><td class="bgColor2">'.$out.'<img src=clear.gif width=465 height=1></td></tr>
77 </table>';
78 } else {
79 $out = '<table border=0 cellpadding=0 cellspacing=0>'.$out.'</table>';
80 }
81 }
82 return $out;
83 }
84 function resourceListForCopy($id,$template_uid) {
85 global $tmpl;
86 $sys_page = t3lib_div::makeInstance("t3lib_pageSelect");
87 $rootLine = $sys_page->getRootLine($id);
88 $tmpl->runThroughTemplates($rootLine,$template_uid); // This generates the constants/config + hierarchy info for the template.
89 $theResources = t3lib_div::trimExplode(",",$tmpl->resources,1);
90 reset($theResources);
91 while(list($k,$v)=each($theResources)) {
92 $fI=pathinfo($v);
93 if (t3lib_div::inList($this->pObj->textExtensions,strtolower($fI["extension"]))) {
94 $path = PATH_site.$GLOBALS["TCA"]["sys_template"]["columns"]["resources"]["config"]["uploadfolder"]."/".$v;
95 $thumb=t3lib_BEfunc::thumbCode(array("resources"=>$v),"sys_template","resources",$GLOBALS["BACK_PATH"],"");
96 $out.='<tr><td'.$bgcol.' nowrap>'.$v.'&nbsp;&nbsp;</td><td'.$bgcol.' nowrap>&nbsp;'.t3lib_div::formatSize(@filesize($path)).'&nbsp;</td><td'.$bgcol.'>'.trim($thumb).'</td><td><input type="Checkbox" name="data[makecopy_resource]['.$k.']" value="'.htmlspecialchars($v).'"></td></tr>';
97 }
98 }
99 $out = $out ? '<table border=0 cellpadding=0 cellspacing=0>'.$out.'</table>' : "";
100 return $out;
101 }
102 function initialize_editor($pageId,$template_uid=0) {
103 // Initializes the module. Done in this function because we may need to re-initialize if data is submitted!
104 global $tmpl,$tplRow,$theConstants;
105
106 $tmpl = t3lib_div::makeInstance("t3lib_tsparser_ext"); // Defined global here!
107 $tmpl->tt_track = 0; // Do not log time-performance information
108 $tmpl->init();
109
110 $tplRow = $tmpl->ext_getFirstTemplate($pageId,$template_uid); // Get the row of the first VISIBLE template of the page. whereclause like the frontend.
111 if (is_array($tplRow)) {
112 return 1;
113 }
114 }
115 function main() {
116 global $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;
117 global $tmpl,$tplRow,$theConstants;
118
119 $edit = $this->pObj->edit;
120 $e = $this->pObj->e;
121
122 t3lib_div::loadTCA("sys_template");
123
124 // **************************
125 // Create extension template
126 // **************************
127 $this->pObj->createTemplate($this->pObj->id);
128
129
130 // **************************
131 // Checking for more than one template an if, set a menu...
132 // **************************
133 $manyTemplatesMenu = $this->pObj->templateMenu();
134 $template_uid = 0;
135 if ($manyTemplatesMenu) {
136 $template_uid = $this->pObj->MOD_SETTINGS["templatesOnPage"];
137 }
138
139
140
141
142
143 // **************************
144 // Initialize
145 // **************************
146 $existTemplate = $this->initialize_editor($this->pObj->id,$template_uid); // initialize
147 if ($existTemplate) {
148 $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
149
150 // Update template ?
151 $POST = t3lib_div::_POST();
152 if ($POST["submit"]) {
153 require_once (PATH_t3lib."class.t3lib_tcemain.php");
154 // Set the data to be saved
155 $recData=array();
156 $alternativeFileName=array();
157 $resList = $tplRow["resources"];
158
159 $tmp_upload_name = '';
160 $tmp_newresource_name = ''; // Set this to blank
161
162 if (is_array($POST["data"])) {
163 while(list($field,$val)=each($POST["data"])) {
164 switch($field) {
165 case "constants":
166 case "config":
167 case "title":
168 case "sitetitle":
169 case "description":
170 $recData["sys_template"][$saveId][$field] = $val;
171 break;
172 case "resources":
173 $tmp_upload_name = t3lib_div::upload_to_tempfile($_FILES["resources"]["tmp_name"]); // If there is an uploaded file, move it for the sake of safe_mode.
174 if ($tmp_upload_name) {
175 if ($tmp_upload_name!="none" && $_FILES["resources"]["name"]) {
176 $alternativeFileName[$tmp_upload_name] = trim($_FILES["resources"]["name"]);
177 $resList = $tmp_upload_name.",".$resList;
178 }
179 }
180 break;
181 case "new_resource":
182 $newName = trim(t3lib_div::_GP("new_resource"));
183 if ($newName) {
184 $newName.=".".t3lib_div::_GP("new_resource_ext");
185 $tmp_newresource_name = t3lib_div::tempnam("new_resource_");
186 $alternativeFileName[$tmp_newresource_name] = $newName;
187 $resList = $tmp_newresource_name.",".$resList;
188 }
189 break;
190 case "makecopy_resource":
191 if (is_array($val)) {
192 reset($val);
193 $resList=",".$resList.",";
194 while(list($k,$file)=each($val)) {
195 $tmp_name = PATH_site.$TCA["sys_template"]["columns"]["resources"]["config"]["uploadfolder"]."/".$file;
196 // debug($tmp_name);
197 $resList = $tmp_name.",".$resList;
198 }
199 }
200 break;
201 case "remove_resource":
202 if (is_array($val)) {
203 reset($val);
204 $resList=",".$resList.",";
205 while(list($k,$file)=each($val)) {
206 $resList = str_replace(",".$file.",", ",", $resList);
207 }
208 }
209 break;
210 case "totop_resource":
211 if (is_array($val)) {
212 reset($val);
213 $resList=",".$resList.",";
214 while(list($k,$file)=each($val)) {
215 $resList = str_replace(",".$file.",", ",", $resList);
216 $resList = ",".$file.$resList;
217 }
218 }
219 // debug($resList);
220 break;
221 }
222 }
223 }
224 $resList=implode(t3lib_div::trimExplode(",",$resList,1),",");
225 if (strcmp($resList,$tplRow["resources"])) {
226 $recData["sys_template"][$saveId]["resources"] = $resList;
227 // debug("update resource - ".$resList);
228 }
229 if (count($recData)) {
230 // Create new tce-object
231 $tce = t3lib_div::makeInstance("t3lib_TCEmain");
232 $tce->stripslashes_values=0;
233 $tce->alternativeFileName = $alternativeFileName;
234 // Initialize
235 // debug($recData);
236 $tce->start($recData,Array());
237 // Saved the stuff
238 $tce->process_datamap();
239 // Clear the cache (note: currently only admin-users can clear the cache in tce_main.php)
240 $tce->clear_cacheCmd("all");
241
242 /* <beta-code TYPO3 4.2-dev> */
243 $this->tce_processed = true;
244 /* </beta-code> */
245
246 // re-read the template ...
247 $this->initialize_editor($this->pObj->id,$template_uid);
248 }
249
250 // Unlink any uploaded/new temp files there was:
251 t3lib_div::unlink_tempfile($tmp_upload_name);
252 t3lib_div::unlink_tempfile($tmp_newresource_name);
253
254 // If files has been edited:
255 if (is_array($edit)) {
256 if ($edit["filename"] && $tplRow["resources"] && t3lib_div::inList($tplRow["resources"], $edit["filename"])) { // Check if there are resources, and that the file is in the resourcelist.
257 $path = PATH_site.$TCA["sys_template"]["columns"]["resources"]["config"]["uploadfolder"]."/".$edit["filename"];
258 $fI=t3lib_div::split_fileref($edit["filename"]);
259 if (@is_file($path) && t3lib_div::getFileAbsFileName($path) && t3lib_div::inList($this->pObj->textExtensions,$fI["fileext"])) { // checks that have already been done.. Just to make sure
260 if (filesize($path)<(30*1024)) { // checks that have already been done.. Just to make sure
261 t3lib_div::writeFile($path,$edit['file']);
262
263 $theOutput.=$this->pObj->doc->spacer(10);
264 $theOutput.=$this->pObj->doc->section("<font color=red>FILE CHANGED</font>","Resource '".$edit["filename"]."' has been updated.",0,0,0,1);
265
266 // Clear cache - the file has probably affected the template setup
267 $tce = t3lib_div::makeInstance("t3lib_TCEmain");
268 $tce->stripslashes_values=0;
269 $tce->start(Array(),Array());
270 $tce->clear_cacheCmd("all");
271 }
272 }
273 }
274 }
275 }
276
277 /* <beta-code TYPO3 4.2-dev> */
278
279 // if TSEditor is enabled and this POST request is an Ajax-Request
280 if(is_object($GLOBALS['T3_VAR']['t3editorObj'])
281 && $GLOBALS['T3_VAR']['t3editorObj']->isEnabled
282 && t3lib_div::_POST('submitAjax')) {
283
284 $GLOBALS['T3_VAR']['t3editorObj']->setBEUCdisableT3Editor(false);
285
286 // abort request here and return message
287 // @TODO: Json or other response here!?
288 if ($this->tce_processed) {
289 echo "OK";
290 } else {
291 echo "ERROR";
292 }
293 exit();
294 }
295
296 /* </beta-code> */
297
298 $theOutput.=$this->pObj->doc->spacer(5);
299 $theOutput.=$this->pObj->doc->section("Template information:",'<img src="'.$BACK_PATH.t3lib_iconWorks::getIcon("sys_template",$tplRow).'" width=18 height=16 align=top><b>'.htmlspecialchars($tplRow["title"]).'</b>'.htmlspecialchars(trim($tplRow["sitetitle"])?' - ('.$tplRow["sitetitle"].')':''),0,1);
300 if ($manyTemplatesMenu) {
301 $theOutput.=$this->pObj->doc->section("",$manyTemplatesMenu);
302 $theOutput.=$this->pObj->doc->divider(5);
303 }
304
305 /* $e[constants]=1;
306 $e[config]=1;
307 $e[title]=1;
308 $e[sitetitle]=1;
309 */
310 #$numberOfRows= t3lib_div::intInRange($this->pObj->MOD_SETTINGS["ts_template_editor_TArows"],0,150);
311 #if (!$numberOfRows)
312 $numberOfRows = 35;
313
314 if (t3lib_div::_POST('abort')) {unset($e);} // If abort pressed, nothing should be edited.
315
316 if (is_array($e)) {
317 $theOutput.=$this->pObj->doc->section("",'<BR><input type="Submit" name="submit" value="Update"> <input type="Submit" name="abort" value="Cancel">');
318 }
319 if ($e["title"]) {
320 $outCode='<input type="Text" name="data[title]" value="'.htmlspecialchars($tplRow[title]).'"'.$this->pObj->doc->formWidth().'>';
321 $outCode.='<input type="Hidden" name="e[title]" value="1">';
322 $theOutput.=$this->pObj->doc->spacer(15);
323 $theOutput.=$this->pObj->doc->section("Title:",$outCode);
324 }
325 if ($e["sitetitle"]) {
326 $outCode='<input type="Text" name="data[sitetitle]" value="'.htmlspecialchars($tplRow[sitetitle]).'"'.$this->pObj->doc->formWidth().'>';
327 $outCode.='<input type="Hidden" name="e[sitetitle]" value="1">';
328 $theOutput.=$this->pObj->doc->spacer(15);
329 $theOutput.=$this->pObj->doc->section("Sitetitle:",$outCode);
330 }
331 if ($e["description"]) {
332 $outCode='<textarea name="data[description]" rows="5" class="fixed-font enable-tab"'.$this->pObj->doc->formWidthText(48,"","").'>'.t3lib_div::formatForTextarea($tplRow[description]).'</textarea>';
333 $outCode.='<input type="Hidden" name="e[description]" value="1">';
334 $theOutput.=$this->pObj->doc->spacer(15);
335 $theOutput.=$this->pObj->doc->section("Description:",$outCode);
336 }
337 if ($e["resources"]) {
338 // Upload
339 $outCode='<input type="File" name="resources"'.$this->pObj->doc->formWidth().' size="50">';
340 $outCode.='<input type="Hidden" name="data[resources]" value="1">';
341 $outCode.='<input type="Hidden" name="e[resources]" value="1">';
342 $outCode.='<BR>Allowed extensions: <b>'.$TCA["sys_template"]["columns"]["resources"]["config"]["allowed"].'</b>';
343 $outCode.='<BR>Max file size: <b>'.t3lib_div::formatSize($TCA["sys_template"]["columns"]["resources"]["config"]["max_size"]*1024).'</b>';
344 $theOutput.=$this->pObj->doc->spacer(15);
345 $theOutput.=$this->pObj->doc->section("Upload resource:",$outCode);
346
347 // New
348 $opt=explode(",",$this->pObj->textExtensions);
349 $optTags="";
350 while(list(,$extVal)=each($opt)) {
351 $optTags.='<option value="'.$extVal.'">.'.$extVal.'</option>';
352 }
353 $outCode='<input type="text" name="new_resource"'.$this->pObj->doc->formWidth(20).'>
354 <select name="new_resource_ext">'.$optTags.'</select>';
355 $outCode.='<input type="Hidden" name="data[new_resource]" value="1">';
356 $theOutput.=$this->pObj->doc->spacer(15);
357 $theOutput.=$this->pObj->doc->section("New text resource (enter name):",$outCode);
358
359 // Make copy
360 $rL = $this->resourceListForCopy($this->pObj->id,$template_uid);
361 if ($rL) {
362 $theOutput.=$this->pObj->doc->spacer(20);
363 $theOutput.=$this->pObj->doc->section("Make a copy of resource:",$rL);
364 }
365
366 // Update resource list
367 $rL = $this->procesResources($tplRow["resources"],1);
368 if ($rL) {
369 $theOutput.=$this->pObj->doc->spacer(20);
370 $theOutput.=$this->pObj->doc->section("Update resource list:",$rL);
371 }
372 }
373 if ($e["constants"]) {
374 $outCode='<textarea name="data[constants]" rows="'.$numberOfRows.'" wrap="off" class="fixed-font enable-tab"'.$this->pObj->doc->formWidthText(48,"width:98%;height:70%","off").' class="fixed-font">'.t3lib_div::formatForTextarea($tplRow["constants"]).'</textarea>';
375 $outCode.='<input type="Hidden" name="e[constants]" value="1">';
376 $theOutput.=$this->pObj->doc->spacer(15);
377 $theOutput.=$this->pObj->doc->section("Constants:","");
378 $theOutput.=$this->pObj->doc->sectionEnd().$outCode;
379 }
380 if ($e["file"]) {
381 $path = PATH_site.$TCA["sys_template"]["columns"]["resources"]["config"]["uploadfolder"]."/".$e[file];
382
383 $fI=t3lib_div::split_fileref($e[file]);
384 if (@is_file($path) && t3lib_div::inList($this->pObj->textExtensions,$fI["fileext"])) {
385 if (filesize($path)<($TCA['sys_template']['columns']['resources']['config']['max_size']*1024)) {
386 $fileContent = t3lib_div::getUrl($path);
387 $outCode='File: <b>'.$e[file].'</b><BR>';
388 $outCode.='<textarea name="edit[file]" rows="'.$numberOfRows.'" wrap="off" class="fixed-font enable-tab"'.$this->pObj->doc->formWidthText(48,"width:98%;height:70%","off").' class="fixed-font">'.t3lib_div::formatForTextarea($fileContent).'</textarea>';
389 $outCode.='<input type="Hidden" name="edit[filename]" value="'.$e[file].'">';
390 $outCode.='<input type="Hidden" name="e[file]" value="'.htmlspecialchars($e[file]).'">';
391 $theOutput.=$this->pObj->doc->spacer(15);
392 $theOutput.=$this->pObj->doc->section("Edit Resource:","");
393 $theOutput.=$this->pObj->doc->sectionEnd().$outCode;
394 } else {
395 $theOutput.=$this->pObj->doc->spacer(15);
396 $theOutput.=$this->pObj->doc->section('<font color=red>Filesize exceeded '.$TCA['sys_template']['columns']['resources']['config']['max_size'].' Kbytes</font>','Files larger than '.$TCA['sys_template']['columns']['resources']['config']['max_size'].' KByes are not allowed to be edited.',0,0,0,1);
397 }
398 }
399 }
400 if ($e["config"]) {
401
402 /* <beta-code TYPO3 4.2-dev> */
403
404 if(is_object($GLOBALS['T3_VAR']['t3editorObj'])
405 && $GLOBALS['T3_VAR']['t3editorObj']->isEnabled) {
406 $outCode = $GLOBALS['T3_VAR']['t3editorObj']->getCodeEditor(
407 'data[config]', // name
408 'fixed-font', // class
409 t3lib_div::formatForTextarea($tplRow["config"]), // content
410 'rows="'.$numberOfRows.'" wrap="off" '.$this->pObj->doc->formWidthText(48,"width:98%;height:60%","off"),
411 'Template: '.htmlspecialchars($tplRow["title"]).': Setup'
412 );
413 } else {
414 $outCode = '<textarea name="data[config]" rows="'.$numberOfRows.'" wrap="off" class="fixed-font enable-tab"'.$this->pObj->doc->formWidthText(48,"width:98%;height:70%","off").' class="fixed-font">'.t3lib_div::formatForTextarea($tplRow["config"]).'</textarea>';
415 }
416
417 /* </beta-code> */
418
419 /*
420 <original-code>
421 $outCode='<textarea name="data[config]" rows="'.$numberOfRows.'" wrap="off" class="fixed-font enable-tab"'.$this->pObj->doc->formWidthText(48,"width:98%;height:70%","off").' class="fixed-font">'.t3lib_div::formatForTextarea($tplRow["config"]).'</textarea>';
422 </original-code>
423 */
424
425 if (t3lib_extMgm::isLoaded("tsconfig_help")) {
426 $url=$BACK_PATH."wizard_tsconfig.php?mode=tsref";
427 $params=array();
428 $params["formName"]="editForm";
429 $params["itemName"]="data[config]";
430 $outCode.='<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 '.t3lib_iconWorks::skinImg($BACK_PATH,'gfx/wizard_tsconfig.gif').' width="22" height="27" border="0" title="TSref reference"></a>';
431 }
432
433 $outCode.='<input type="Hidden" name="e[config]" value="1">';
434 $theOutput.=$this->pObj->doc->spacer(15);
435 $theOutput.=$this->pObj->doc->section("Setup:","");
436 $theOutput.=$this->pObj->doc->sectionEnd().$outCode;
437 }
438 if (is_array($e)) {
439 $theOutput.=$this->pObj->doc->section("",'<BR><input type="Submit" name="submit" value="Update"> <input type="Submit" name="abort" value="Cancel">');
440 }
441
442 // Processing:
443 // debug($tplRow);
444 $outCode="";
445 $outCode.=$this->tableRow("Title:",htmlspecialchars($tplRow["title"]),"title");
446 $outCode.=$this->tableRow("Sitetitle:",htmlspecialchars($tplRow["sitetitle"]),"sitetitle");
447 $outCode.=$this->tableRow("Description:",nl2br(htmlspecialchars($tplRow["description"])),"description");
448 $outCode.=$this->tableRow("Resources:",$this->procesResources($tplRow["resources"]),"resources");
449 $outCode.=$this->tableRow("Constants:","(edit to view, ".(trim($tplRow[constants]) ? count(explode(chr(10), $tplRow[constants])):0)." lines)","constants");
450 $outCode.=$this->tableRow("Setup:","(edit to view, ".(trim($tplRow[config]) ? count(explode(chr(10), $tplRow[config])):0)." lines)","config");
451 $outCode='<table border=0 cellpadding=1 cellspacing=1 width="100%">'.$outCode.'</table>';
452
453 $outCode='<table border=0 cellpadding=0 cellspacing=0>
454 <tr><td class="bgColor2">'.$outCode.'<img src=clear.gif width=465 height=1></td></tr>
455 </table>';
456
457 // Edit all icon:
458 $outCode.='<BR><a href="#" onClick="'.t3lib_BEfunc::editOnClick(rawurlencode('&createExtension=0').'&edit[sys_template]['.$tplRow['uid'].']=edit',$BACK_PATH,'').'"><strong>Click here to edit whole template record</strong></a>';
459
460 $theOutput.=$this->pObj->doc->spacer(25);
461 $theOutput.=$this->pObj->doc->section("",$outCode);
462
463 $theOutput.=$this->pObj->doc->spacer(10);
464 $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>.<BR><br>
465 Status: '.$this->pObj->getCountCacheTables(1),0,1);
466
467 // $theOutput.=$this->pObj->doc->divider(5);
468 # $menu = htmlspecialchars("Rows in <TEXTAREA> fields: ").t3lib_BEfunc::getFuncInput($this->pObj->id,"SET[ts_template_editor_TArows]",$this->pObj->MOD_SETTINGS["ts_template_editor_TArows"]);
469 # $theOutput.=$this->pObj->doc->section("CONFIG:",$menu,0,1);
470 } else {
471 $theOutput.=$this->pObj->noTemplate(1);
472 }
473 return $theOutput;
474 }
475 }
476
477 if (defined("TYPO3_MODE") && $TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_info/class.tx_tstemplateinfo.php"]) {
478 include_once($TYPO3_CONF_VARS[TYPO3_MODE]["XCLASS"]["ext/tstemplate_info/class.tx_tstemplateinfo.php"]);
479 }
480
481 ?>