Fixed bug #15686: Call the list module through the dispatcher instead directly (Thank...
[Packages/TYPO3.CMS.git] / typo3 / sysext / tstemplate / ts / index.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2010 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 * Module: TypoScript Tools
29 *
30 *
31 * $TYPO3_CONF_VARS["MODS"]["web_ts"]["onlineResourceDir"] = Directory of default resources. Eg. "fileadmin/res/" or so.
32 *
33 *
34 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
35 */
36
37
38
39 unset($MCONF);
40 require('conf.php');
41 require($BACK_PATH . 'init.php');
42 require($BACK_PATH . 'template.php');
43 $GLOBALS['LANG']->includeLLFile('EXT:tstemplate/ts/locallang.xml');
44
45 $BE_USER->modAccess($MCONF, true);
46
47
48 // ***************************
49 // Script Classes
50 // ***************************
51 class SC_mod_web_ts_index extends t3lib_SCbase {
52 var $perms_clause;
53 var $e;
54 var $sObj;
55 var $edit;
56 var $textExtensions = 'html,htm,txt,css,tmpl,inc,js';
57
58 var $modMenu_type = '';
59 var $modMenu_dontValidateList = '';
60 var $modMenu_setDefaultList = '';
61
62 function init() {
63
64 parent::init();
65
66 $this->id = intval(t3lib_div::_GP('id'));
67 $this->e = t3lib_div::_GP('e');
68 $this->sObj = t3lib_div::_GP('sObj');
69 $this->edit = t3lib_div::_GP('edit');
70
71 $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
72
73 if (t3lib_div::_GP('clear_all_cache')) {
74 $this->include_once[] = PATH_t3lib . 'class.t3lib_tcemain.php';
75 }
76 }
77
78 function clearCache() {
79 if (t3lib_div::_GP('clear_all_cache')) {
80 $tce = t3lib_div::makeInstance('t3lib_TCEmain');
81 /* @var $tce t3lib_TCEmain */
82 $tce->stripslashes_values = 0;
83 $tce->start(array(), array());
84 $tce->clear_cacheCmd('all');
85 }
86 }
87
88 function main() {
89
90 // Template markers
91 $markers = array(
92 'CSH' => '',
93 'FUNC_MENU' => '',
94 'CONTENT' => ''
95 );
96
97 // Access check...
98 // The page will show only if there is a valid page and if this page may be viewed by the user
99 $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
100 $this->access = is_array($this->pageinfo) ? 1 : 0;
101
102 $this->doc = t3lib_div::makeInstance('template');
103 $this->doc->backPath = $GLOBALS['BACK_PATH'];
104 $this->doc->setModuleTemplate('templates/tstemplate.html');
105
106 if ($this->id && $this->access) {
107 $this->doc->form = '<form action="index.php?id=' . $this->id . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editForm">';
108
109
110 // JavaScript
111 $this->doc->JScode = '
112 <script language="javascript" type="text/javascript">
113 script_ended = 0;
114 function jumpToUrl(URL) {
115 window.location.href = URL;
116 }
117 function uFormUrl(aname) {
118 document.forms[0].action = "index.php?id=' . $this->id . '#"+aname;
119 }
120 function brPoint(lnumber,t) {
121 window.location.href = "index.php?id=' . $this->id . '&SET[function]=tx_tstemplateobjbrowser&SET[ts_browser_type]="+(t?"setup":"const")+"&breakPointLN="+lnumber;
122 return false;
123 }
124 </script>
125 ';
126
127 $this->doc->postCode = '
128 <script language="javascript" type="text/javascript">
129 script_ended = 1;
130 if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
131 </script>
132 ';
133
134 $this->doc->inDocStylesArray[] = '
135 TABLE#typo3-objectBrowser A { text-decoration: none; }
136 TABLE#typo3-objectBrowser .comment { color: maroon; font-weight: bold; }
137 TABLE#ts-analyzer tr.t3-row-header { background-color: #A2AAB8; }
138 TABLE#ts-analyzer tr td {padding: 0 2px;}
139 TABLE#ts-analyzer tr.t3-row-header td { padding: 2px 4px; font-weight:bold; color: #fff; }
140 .tsob-menu label, .tsob-menu-row2 label, .tsob-conditions label {padding: 0 5px; vertical-align: text-top;}
141 .tsob-menu-row2 {margin-top: 10px;}
142 .tsob-conditions {padding: 1px 2px;}
143 .tsob-search-submit {margin-left: 3px; margin-right: 3px;}
144 .tst-analyzer-options { margin:5px 0; }
145 .tst-analyzer-options label {padding-left:5px; vertical-align:text-top; }
146 .bgColor0 {background-color:#fff; color: #000; }
147 ';
148
149
150 // Setting up the context sensitive menu:
151 $this->doc->getContextMenuCode();
152
153 // Build the modulle content
154 $this->content = $this->doc->header($GLOBALS['LANG']->getLL('moduleTitle'));
155 $this->extObjContent();
156 $this->content .= $this->doc->spacer(10);
157
158 // Setting up the buttons and markers for docheader
159 $docHeaderButtons = $this->getButtons();
160 // $markers['CSH'] = $docHeaderButtons['csh'];
161 $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
162 $markers['CONTENT'] = $this->content;
163 } else {
164 // If no access or if ID == zero
165
166 $this->doc->inDocStylesArray[] = '
167 TABLE#ts-overview tr.t3-row-header { background-color: #A2AAB8; }
168 TABLE#ts-overview tr td {padding: 2px;}
169 TABLE#ts-overview tr.t3-row-header td { padding: 2px 4px; font-weight:bold; color: #fff; }
170 ';
171 // Template pages:
172 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
173 'pages.uid, count(*) AS count, max(sys_template.root) AS root_max_val, min(sys_template.root) AS root_min_val',
174 'pages,sys_template',
175 'pages.uid=sys_template.pid'.
176 t3lib_BEfunc::deleteClause('pages').
177 t3lib_BEfunc::versioningPlaceholderClause('pages').
178 t3lib_BEfunc::deleteClause('sys_template').
179 t3lib_BEfunc::versioningPlaceholderClause('sys_template'),
180 'pages.uid'
181 );
182 $templateArray = array();
183 $pArray = array();
184
185 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
186 $this->setInPageArray(
187 $pArray,
188 t3lib_BEfunc::BEgetRootLine($row['uid'], 'AND 1=1'),
189 $row
190 );
191 }
192
193 $lines = array();
194 $lines[] = '<tr class="t3-row-header">
195 <td nowrap>' . $GLOBALS['LANG']->getLL('pageName') . '</td>
196 <td nowrap>' . $GLOBALS['LANG']->getLL('templates') . '</td>
197 <td nowrap>' . $GLOBALS['LANG']->getLL('isRoot') . '</td>
198 <td nowrap>' . $GLOBALS['LANG']->getLL('isExt') . '</td>
199 </tr>';
200 $lines = array_merge($lines, $this->renderList($pArray));
201
202 $table = '<table border="0" cellpadding="0" cellspacing="1" id="ts-overview">' . implode('', $lines) . '</table>';
203 $this->content = $this->doc->section($GLOBALS['LANG']->getLL('moduleTitle'), '
204 <br />
205 ' . $GLOBALS['LANG']->getLL('overview') . '
206 <br /><br />' . $table);
207
208 // ********************************************
209 // RENDER LIST of pages with templates, END
210 // ********************************************
211
212 $this->content .= $this->doc->spacer(10);
213
214 // Setting up the buttons and markers for docheader
215 $docHeaderButtons = $this->getButtons();
216 // $markers['CSH'] = $docHeaderButtons['csh'];
217 $markers['CONTENT'] = $this->content;
218 }
219
220 // Build the <body> for the module
221 $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
222 // Renders the module page
223 $this->content = $this->doc->render(
224 'Template Tools',
225 $this->content
226 );
227 }
228
229 function printContent() {
230 echo $this->content;
231 }
232
233 /**
234 * Create the panel of buttons for submitting the form or otherwise perform operations.
235 *
236 * @return array all available buttons as an assoc. array
237 */
238 protected function getButtons() {
239
240 $buttons = array(
241 'back' => '',
242 'close' => '',
243 'new' => '',
244 'save' => '',
245 'save_close' => '',
246 'view' => '',
247 'record_list' => '',
248 'shortcut' => '',
249 );
250
251 if ($this->id && $this->access) {
252 // View page
253 $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->pageinfo['uid'], $GLOBALS['BACK_PATH'], t3lib_BEfunc::BEgetRootLine($this->pageinfo['uid']))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', TRUE) . '">' .
254 t3lib_iconWorks::getSpriteIcon('actions-document-view') .
255 '</a>';
256
257 // If access to Web>List for user, then link to that module.
258 $buttons['record_list'] = t3lib_BEfunc::getListViewLink(
259 array(
260 'id' => $this->pageinfo['uid'],
261 'returnUrl' => t3lib_div::getIndpEnv('REQUEST_URI'),
262 ),
263 $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList')
264 );
265
266 if ($this->extClassConf['name'] == 'tx_tstemplateinfo') {
267 // NEW button
268 $buttons['new'] = '<input type="image" class="c-inputButton" name="createExtension" value="New"' . t3lib_iconWorks::skinImg($GLOBALS['BACK_PATH'], 'gfx/new_el.gif', '') . ' title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:db_new.php.pagetitle', TRUE) . '" />';
269
270 if (!empty($this->e) && !t3lib_div::_POST('abort') && !t3lib_div::_POST('saveclose')) {
271 // no NEW-button while edit
272 $buttons['new'] = '';
273
274 // SAVE button
275 $buttons['save'] = t3lib_iconWorks::getSpriteIcon('actions-document-save',
276 array(
277 'html' => '<input type="image" class="c-inputButton" name="submit" src="clear.gif" ' .
278 'title="'. $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) .'" ' .
279 'value="'. $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) .'" ' .
280 '/>'
281 ));
282
283 // SAVE AND CLOSE button
284 $buttons['save_close'] = t3lib_iconWorks::getSpriteIcon('actions-document-save-close',
285 array(
286 'html' => '<input type="image" class="c-inputButton" name="saveclose" src="clear.gif" '.
287 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', TRUE) . '" ' .
288 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', TRUE) . '" ' .
289 '/>'
290 ));
291
292 // CLOSE button
293 $buttons['close'] = t3lib_iconWorks::getSpriteIcon('actions-document-close',
294 array(
295 'html' => '<input type="image" class="c-inputButton" name="abort" src="clear.gif" ' .
296 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE) . '" ' .
297 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE) . '" ' .
298 '/>'
299 ));
300
301 }
302 } elseif($this->extClassConf['name'] == 'tx_tstemplateceditor' && count($this->MOD_MENU['constant_editor_cat'])) {
303 // SAVE button
304 $buttons['save'] = t3lib_iconWorks::getSpriteIcon('actions-document-save',
305 array('html' => '<input type="image" class="c-inputButton" name="submit" src="clear.gif" '.
306 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) . '" ' .
307 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) . '" ' .
308 '/>'));
309 } elseif($this->extClassConf['name'] == 'tx_tstemplateobjbrowser') {
310 if(!empty($this->sObj)) {
311 // BACK
312 $buttons['back'] = '<a href="index.php?id=' . $this->id . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', TRUE) . '">' .
313 t3lib_iconWorks::getSpriteIcon('actions-view-go-back') .
314 '</a>';
315 }
316 }
317
318 // Shortcut
319 if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
320 $buttons['shortcut'] = $this->doc->makeShortcutIcon('id, edit_record, pointer, new_unique_uid, search_field, search_levels, showLimit', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']);
321 }
322 } else {
323 // Shortcut
324 if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
325 $buttons['shortcut'] = $this->doc->makeShortcutIcon('id', '', $this->MCONF['name']);
326 }
327 }
328
329 return $buttons;
330 }
331
332 // ***************************
333 // OTHER FUNCTIONS:
334 // ***************************
335
336 /**
337 * Counts the records in the system cache_* tables and returns these values.
338 *
339 * @param boolean $humanReadable: Returns human readable string instead of an array
340 * @return mixed The number of records in cache_* tables as array or string
341 * @deprecated since TYPO3 4.2.0, will be removed in TYPO3 4.6
342 */
343 function getCountCacheTables($humanReadable) {
344 t3lib_div::logDeprecatedFunction();
345
346 $out = array();
347
348 $out['cache_pages'] = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('id', 'cache_pages');
349 $out['cache_pagesection'] = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('id', 'cache_pagesection');
350 $out['cache_hash'] = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('id', 'cache_hash');
351
352 if ($humanReadable) {
353 $newOut = array();
354 foreach ($out as $k => $v) {
355 $newOut[] = $k . ":" . $v;
356 }
357 $out = implode(', ', $newOut);
358 }
359 return $out;
360 }
361
362 function linkWrapTemplateTitle($title, $onlyKey = '') {
363 if ($onlyKey) {
364 $title = '<a href="index.php?id=' . htmlspecialchars($GLOBALS['SOBE']->id . '&e[' . $onlyKey . ']=1&SET[function]=tx_tstemplateinfo') . '">' . htmlspecialchars($title) . '</a>';
365 } else {
366 $title = '<a href="index.php?id=' . htmlspecialchars($GLOBALS['SOBE']->id . '&e[constants]=1&e[config]=1&SET[function]=tx_tstemplateinfo') . '">' . htmlspecialchars($title) . '</a>';
367 }
368 return $title;
369 }
370
371 function noTemplate($newStandardTemplate = 0) {
372
373 $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext'); // Defined global here!
374 /* @var $tmpl t3lib_tsparser_ext */
375 $tmpl->tt_track = false; // Do not log time-performance information
376 $tmpl->init();
377
378 // No template
379 $theOutput .= $this->doc->spacer(10);
380
381 $flashMessage = t3lib_div::makeInstance(
382 't3lib_FlashMessage',
383 $GLOBALS['LANG']->getLL('noTemplateDescription') . '<br />' . $GLOBALS['LANG']->getLL('createTemplateToEditConfiguration'),
384 $GLOBALS['LANG']->getLL('noTemplate'),
385 t3lib_FlashMessage::INFO
386 );
387 $theOutput .= $flashMessage->render();
388
389
390 // New standard?
391 if ($newStandardTemplate) {
392 if (t3lib_extMgm::isLoaded('statictemplates')) { // check wether statictemplates are supported
393 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('title,uid', 'static_template', '', '', 'title');
394 $opt = '';
395 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
396 if (substr(trim($row['title']), 0, 8) == 'template') {
397 $opt .= '<option value="' . $row['uid'] . '">' . htmlspecialchars($row['title']) . '</option>';
398 }
399 }
400 $selector = '<select name="createStandard"><option></option>' . $opt . '</select><br />';
401 $staticsText = ', optionally based on one of the standard templates';
402 } else {
403 $selector = '<input type="hidden" name="createStandard" value="" />';
404 $staticsText = '';
405 }
406
407 // Extension?
408 $theOutput .= $this->doc->spacer(10);
409 $theOutput .= $this->doc->section($GLOBALS['LANG']->getLL('newWebsite') . $staticsText, $GLOBALS['LANG']->getLL('newWebsiteDescription') . '<br /><br />' .
410 $selector .
411 '<input type="Submit" name="newWebsite" value="' . $GLOBALS['LANG']->getLL('newWebsiteAction') . '" />', 0, 1);
412 }
413 // Extension?
414 $theOutput .= $this->doc->spacer(10);
415 $theOutput .= $this->doc->section($GLOBALS['LANG']->getLL('extTemplate'), $GLOBALS['LANG']->getLL('extTemplateDescription') . '<br /><br />' .
416 '<input type="submit" name="createExtension" value="' . $GLOBALS['LANG']->getLL('extTemplateAction') . '" />', 0, 1);
417
418 // Go to first appearing...
419 $first = $tmpl->ext_prevPageWithTemplate($this->id, $this->perms_clause);
420 if ($first) {
421 $theOutput .= $this->doc->spacer(10);
422 $theOutput .= $this->doc->section($GLOBALS['LANG']->getLL('goToClosest'),
423 sprintf($GLOBALS['LANG']->getLL('goToClosestDescription') . '<br /><br />%s<strong>' . $GLOBALS['LANG']->getLL('goToClosestAction') . '</strong>%s', htmlspecialchars($first['title']), $first['uid'],
424 '<a href="index.php?id=' . $first['uid'] . '">', '</a>'), 0, 1);
425 }
426 return $theOutput;
427 }
428
429 function templateMenu() {
430 $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext'); // Defined global here!
431 /* @var $tmpl t3lib_tsparser_ext */
432 $tmpl->tt_track = false; // Do not log time-performance information
433 $tmpl->init();
434 $all = $tmpl->ext_getAllTemplates($this->id, $this->perms_clause);
435 $menu = '';
436
437 if (count($all) > 1) {
438 $this->MOD_MENU['templatesOnPage'] = array();
439 foreach ($all as $d) {
440 $this->MOD_MENU['templatesOnPage'][$d['uid']] = $d['title'];
441 }
442 }
443
444 $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList);
445 $menu = t3lib_BEfunc::getFuncMenu($this->id, 'SET[templatesOnPage]', $this->MOD_SETTINGS['templatesOnPage'], $this->MOD_MENU['templatesOnPage']);
446
447 return $menu;
448 }
449
450 function createTemplate($id, $actTemplateId = 0) {
451 if (t3lib_div::_GP('createExtension')) {
452 $tce = t3lib_div::makeInstance('t3lib_TCEmain');
453 /* @var $tce t3lib_TCEmain */
454 $tce->stripslashes_values = 0;
455 $recData = array();
456 $recData['sys_template']['NEW'] = array(
457 'pid' => $actTemplateId ? -1 * $actTemplateId : $id,
458 'title' => "+ext",
459 );
460
461 $tce->start($recData, array());
462 $tce->process_datamap();
463 return $tce->substNEWwithIDs['NEW'];
464 } elseif (t3lib_div::_GP('newWebsite')) {
465 $tce = t3lib_div::makeInstance('t3lib_TCEmain');
466 /* @var $tce t3lib_TCEmain */
467 $tce->stripslashes_values = 0;
468 $recData = array();
469
470 if (intval(t3lib_div::_GP('createStandard'))) {
471 $staticT = intval(t3lib_div::_GP('createStandard'));
472 $recData['sys_template']['NEW'] = array(
473 'pid' => $id,
474 'title' => $GLOBALS['LANG']->getLL('titleNewSiteStandard'),
475 'sorting' => 0,
476 'root' => 1,
477 'clear' => 3,
478 'include_static' => $staticT . ',57', // 57 is cSet
479 );
480 } else {
481 $recData['sys_template']['NEW'] = array(
482 'pid' => $id,
483 'title' => $GLOBALS['LANG']->getLL('titleNewSite'),
484 'sorting' => 0,
485 'root' => 1,
486 'clear' => 3,
487 'config' => '
488 # Default PAGE object:
489 page = PAGE
490 page.10 = TEXT
491 page.10.value = HELLO WORLD!
492 ',
493 );
494 }
495 $tce->start($recData, array());
496 $tce->process_datamap();
497 $tce->clear_cacheCmd('all');
498 }
499 }
500
501 // ********************************************
502 // RENDER LIST of pages with templates, BEGIN
503 // ********************************************
504 function setInPageArray(&$pArray, $rlArr, $row) {
505 ksort($rlArr);
506 reset($rlArr);
507 if (!$rlArr[0]['uid']) {
508 array_shift($rlArr);
509 }
510
511 $cEl = current($rlArr);
512 $pArray[$cEl['uid']] = htmlspecialchars($cEl['title']);
513 array_shift($rlArr);
514 if (count($rlArr)) {
515 if (!isset($pArray[$cEl['uid'] . '.'])) {
516 $pArray[$cEl['uid'] . '.'] = array();
517 }
518 $this->setInPageArray($pArray[$cEl['uid'] . '.'], $rlArr, $row);
519 } else {
520 $pArray[$cEl['uid'] . '_'] = $row;
521 }
522 }
523
524 function renderList($pArray, $lines = array(), $c = 0) {
525 if (is_array($pArray)) {
526 reset($pArray);
527 static $i;
528 foreach ($pArray as $k => $v) {
529 if (t3lib_div::testInt($k)) {
530 if (isset($pArray[$k . "_"])) {
531 $lines[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
532 <td nowrap><img src="clear.gif" width="1" height="1" hspace=' . ($c * 10) . ' align="top">' .
533 '<a href="' . t3lib_div::linkThisScript(array('id' => $k)) . '">' .
534 t3lib_iconWorks::getSpriteIconForRecord('pages', t3lib_BEfunc::getRecordWSOL('pages', $k), array("title"=>'ID: ' . $k )) .
535 t3lib_div::fixed_lgd_cs($pArray[$k], 30) . '</a></td>
536 <td align="center">' . $pArray[$k . '_']['count'] . '</td>
537 <td align="center" class="bgColor5">' . ($pArray[$k . '_']['root_max_val'] > 0 ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : "&nbsp;") .
538 '</td>
539 <td align="center">' . ($pArray[$k . '_']['root_min_val'] == 0 ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : "&nbsp;") .
540 '</td>
541 </tr>';
542 } else {
543 $lines[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
544 <td nowrap ><img src="clear.gif" width="1" height="1" hspace=' . ($c * 10) . ' align=top>' .
545 t3lib_iconWorks::getSpriteIconForRecord('pages', t3lib_BEfunc::getRecordWSOL('pages', $k)) .
546 t3lib_div::fixed_lgd_cs($pArray[$k], 30) . '</td>
547 <td align="center"></td>
548 <td align="center" class="bgColor5"></td>
549 <td align="center"></td>
550 </tr>';
551 }
552 $lines = $this->renderList($pArray[$k . '.'], $lines, $c + 1);
553 }
554 }
555 }
556 return $lines;
557 }
558 }
559
560
561 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tstemplate/ts/index.php'])) {
562 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tstemplate/ts/index.php']);
563 }
564
565
566
567 // Make instance:
568 $SOBE = t3lib_div::makeInstance('SC_mod_web_ts_index');
569 /* @var $SOBE SC_mod_web_ts_index */
570 $SOBE->init();
571
572 // Include files?
573 foreach($SOBE->include_once as $INC_FILE) {
574 include_once($INC_FILE);
575 }
576 $SOBE->checkExtObj(); // Checking for first level external objects
577
578 $SOBE->clearCache();
579 $SOBE->main();
580 $SOBE->printContent();
581
582 ?>