8f88befcc81c46aa3bc920657fba841ce0164d7f
[Packages/TYPO3.CMS.git] / typo3 / sysext / tstemplate / ts / index.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2009 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 * 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 Skaarhoj <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;}
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->startPage('Template Tools');
222 $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
223 $this->content .= $this->doc->endPage();
224 $this->content = $this->doc->insertStylesAndJS($this->content);
225 }
226
227 function printContent() {
228 echo $this->content;
229 }
230
231 /**
232 * Create the panel of buttons for submitting the form or otherwise perform operations.
233 *
234 * @return array all available buttons as an assoc. array
235 */
236 protected function getButtons() {
237
238 $buttons = array(
239 'back' => '',
240 'close' => '',
241 'new' => '',
242 'save' => '',
243 'save_close' => '',
244 'view' => '',
245 'record_list' => '',
246 'shortcut' => '',
247 );
248
249 if ($this->id && $this->access) {
250 // View page
251 $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) . '">' .
252 t3lib_iconWorks::getSpriteIcon('actions-document-view') .
253 '</a>';
254
255 // If access to Web>List for user, then link to that module.
256 if ($GLOBALS['BE_USER']->check('modules', 'web_list')) {
257 $href = $GLOBALS['BACK_PATH'] . 'db_list.php?id=' . $this->pageinfo['uid'] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
258 $buttons['record_list'] = '<a href="' . htmlspecialchars($href) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', TRUE) . '">' .
259 t3lib_iconWorks::getSpriteIcon('actions-system-list-open') .
260 '</a>';
261 }
262
263 if ($this->extClassConf['name'] == 'tx_tstemplateinfo') {
264 // NEW button
265 $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) . '" />';
266
267 if (!empty($this->e) && !t3lib_div::_POST('abort') && !t3lib_div::_POST('saveclose')) {
268 // no NEW-button while edit
269 $buttons['new'] = '';
270
271 // SAVE button
272 $buttons['save'] = t3lib_iconWorks::getSpriteIcon('actions-document-save',
273 array(
274 'html' => '<input type="image" class="c-inputButton" name="submit" src="clear.gif" ' .
275 'title="'. $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) .'" ' .
276 'value="'. $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) .'" ' .
277 '/>'
278 ));
279
280 // SAVE AND CLOSE button
281 $buttons['save_close'] = t3lib_iconWorks::getSpriteIcon('actions-document-save-close',
282 array(
283 'html' => '<input type="image" class="c-inputButton" name="saveclose" src="clear.gif" '.
284 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', TRUE) . '" ' .
285 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', TRUE) . '" ' .
286 '/>'
287 ));
288
289 // CLOSE button
290 $buttons['close'] = t3lib_iconWorks::getSpriteIcon('actions-document-close',
291 array(
292 'html' => '<input type="image" class="c-inputButton" name="abort" src="clear.gif" ' .
293 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE) . '" ' .
294 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE) . '" ' .
295 '/>'
296 ));
297
298 }
299 } elseif($this->extClassConf['name'] == 'tx_tstemplateceditor' && count($this->MOD_MENU['constant_editor_cat'])) {
300 // SAVE button
301 $buttons['save'] = t3lib_iconWorks::getSpriteIcon('actions-document-save',
302 array('html' => '<input type="image" class="c-inputButton" name="submit" src="clear.gif" '.
303 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) . '" ' .
304 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) . '" ' .
305 '/>'));
306 } elseif($this->extClassConf['name'] == 'tx_tstemplateobjbrowser') {
307 if(!empty($this->sObj)) {
308 // BACK
309 $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) . '">' .
310 t3lib_iconWorks::getSpriteIcon('actions-view-go-back') .
311 '</a>';
312 }
313 }
314
315 // Shortcut
316 if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
317 $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']);
318 }
319 } else {
320 // Shortcut
321 if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
322 $buttons['shortcut'] = $this->doc->makeShortcutIcon('id', '', $this->MCONF['name']);
323 }
324 }
325
326 return $buttons;
327 }
328
329 // ***************************
330 // OTHER FUNCTIONS:
331 // ***************************
332
333 /**
334 * Counts the records in the system cache_* tables and returns these values.
335 *
336 * @param boolean $humanReadable: Returns human readable string instead of an array
337 * @return mixed The number of records in cache_* tables as array or string
338 * @deprecated since TYPO3 4.2.0
339 */
340 function getCountCacheTables($humanReadable) {
341 $out = array();
342
343 $out['cache_pages'] = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('id', 'cache_pages');
344 $out['cache_pagesection'] = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('id', 'cache_pagesection');
345 $out['cache_hash'] = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('id', 'cache_hash');
346
347 if ($humanReadable) {
348 $newOut = array();
349 foreach ($out as $k => $v) {
350 $newOut[] = $k . ":" . $v;
351 }
352 $out = implode(', ', $newOut);
353 }
354 return $out;
355 }
356
357 function linkWrapTemplateTitle($title, $onlyKey = '') {
358 if ($onlyKey) {
359 $title = '<a href="index.php?id=' . $GLOBALS['SOBE']->id . '&e[' . $onlyKey . ']=1&SET[function]=tx_tstemplateinfo">' . htmlspecialchars($title) . '</a>';
360 } else {
361 $title = '<a href="index.php?id=' . $GLOBALS['SOBE']->id . '&e[constants]=1&e[config]=1&SET[function]=tx_tstemplateinfo">' . htmlspecialchars($title) . '</a>';
362 }
363 return $title;
364 }
365
366 function noTemplate($newStandardTemplate = 0) {
367
368 $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext'); // Defined global here!
369 /* @var $tmpl t3lib_tsparser_ext */
370 $tmpl->tt_track = false; // Do not log time-performance information
371 $tmpl->init();
372
373 $areYouSure = $GLOBALS['LANG']->getLL('areYouSure');
374 $confirm = ' onClick="return confirm(\'' . $areYouSure . '\');"';
375
376 // No template
377 $theOutput .= $this->doc->spacer(10);
378 $theOutput .= $this->doc->section('<span class="typo3-red">' . $GLOBALS['LANG']->getLL('noTemplate') . '</span>', $GLOBALS['LANG']->getLL('noTemplateDescription') . '<br />
379 ' . $GLOBALS['LANG']->getLL('createTemplate'), 0, 0, 0, 1);
380
381 // New standard?
382 if ($newStandardTemplate) {
383 if (t3lib_extMgm::isLoaded('statictemplates')) { // check wether statictemplates are supported
384 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('title,uid', 'static_template', '', '', 'title');
385 $opt = '';
386 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
387 if (substr(trim($row['title']), 0, 8) == 'template') {
388 $opt .= '<option value="' . $row['uid'] . '">' . htmlspecialchars($row['title']) . '</option>';
389 }
390 }
391 $selector = '<select name="createStandard"><option></option>' . $opt . '</select>';
392 $staticsText = ', optionally based on one of the standard templates';
393 } else {
394 $selector = '<input type="hidden" name="createStandard" value="" />';
395 $staticsText = '';
396 }
397
398 // Extension?
399 $theOutput .= $this->doc->spacer(10);
400 $theOutput .= $this->doc->section($GLOBALS['LANG']->getLL('newWebsite') . $staticsText, $GLOBALS['LANG']->getLL('newWebsiteDescription') . '<br />
401 <br />' .
402 $selector . '<br />' .
403 t3lib_iconWorks::getSpriteIcon('status-dialog-warning') .
404 '<input type="Submit" name="newWebsite" value="' . $GLOBALS['LANG']->getLL('newWebsiteAction') . '"' . $confirm . '>', 0, 1);
405 }
406 // Extension?
407 $theOutput .= $this->doc->spacer(10);
408 $theOutput .= $this->doc->section($GLOBALS['LANG']->getLL('extTemplate'), $GLOBALS['LANG']->getLL('extTemplateDescription') . '<br /><br />' .
409 t3lib_iconWorks::getSpriteIcon('status-dialog-warning') .
410 '<input type="submit" name="createExtension" value="' . $GLOBALS['LANG']->getLL('extTemplateAction') . '"' . $confirm . '>', 0, 1);
411
412 // Go to first appearing...
413 $first = $tmpl->ext_prevPageWithTemplate($this->id, $this->perms_clause);
414 if ($first) {
415 $theOutput .= $this->doc->spacer(10);
416 $theOutput .= $this->doc->section($GLOBALS['LANG']->getLL('goToClosest'),
417 sprintf($GLOBALS['LANG']->getLL('goToClosestDescription') . '<br /><br />%s<strong>' . $GLOBALS['LANG']->getLL('goToClosestAction') . '</strong>%s', htmlspecialchars($first['title']), $first['uid'],
418 '<a href="index.php?id=' . $first['uid'] . '">', '</a>'), 0, 1);
419 }
420 return $theOutput;
421 }
422
423 function templateMenu() {
424 $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext'); // Defined global here!
425 /* @var $tmpl t3lib_tsparser_ext */
426 $tmpl->tt_track = false; // Do not log time-performance information
427 $tmpl->init();
428 $all = $tmpl->ext_getAllTemplates($this->id, $this->perms_clause);
429 $menu = '';
430
431 if (count($all) > 1) {
432 $this->MOD_MENU['templatesOnPage'] = array();
433 foreach ($all as $d) {
434 $this->MOD_MENU['templatesOnPage'][$d['uid']] = $d['title'];
435 }
436 }
437
438 $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);
439 $menu = t3lib_BEfunc::getFuncMenu($this->id, 'SET[templatesOnPage]', $this->MOD_SETTINGS['templatesOnPage'], $this->MOD_MENU['templatesOnPage']);
440
441 return $menu;
442 }
443
444 function createTemplate($id, $actTemplateId = 0) {
445 if (t3lib_div::_GP('createExtension')) {
446 $tce = t3lib_div::makeInstance('t3lib_TCEmain');
447 /* @var $tce t3lib_TCEmain */
448 $tce->stripslashes_values = 0;
449 $recData = array();
450 $recData['sys_template']['NEW'] = array(
451 'pid' => $actTemplateId ? -1 * $actTemplateId : $id,
452 'title' => "+ext",
453 );
454
455 $tce->start($recData, array());
456 $tce->process_datamap();
457 return $tce->substNEWwithIDs['NEW'];
458 } elseif (t3lib_div::_GP('newWebsite')) {
459 $tce = t3lib_div::makeInstance('t3lib_TCEmain');
460 /* @var $tce t3lib_TCEmain */
461 $tce->stripslashes_values = 0;
462 $recData = array();
463
464 if (intval(t3lib_div::_GP('createStandard'))) {
465 $staticT = intval(t3lib_div::_GP('createStandard'));
466 $recData['sys_template']['NEW'] = array(
467 'pid' => $id,
468 'title' => $GLOBALS['LANG']->getLL('titleNewSiteStandard'),
469 'sorting' => 0,
470 'root' => 1,
471 'clear' => 3,
472 'include_static' => $staticT . ',57', // 57 is cSet
473 );
474 } else {
475 $recData['sys_template']['NEW'] = array(
476 'pid' => $id,
477 'title' => $GLOBALS['LANG']->getLL('titleNewSite'),
478 'sorting' => 0,
479 'root' => 1,
480 'clear' => 3,
481 'config' => '
482 # Default PAGE object:
483 page = PAGE
484 page.10 = TEXT
485 page.10.value = HELLO WORLD!
486 ',
487 );
488 }
489 $tce->start($recData, array());
490 $tce->process_datamap();
491 $tce->clear_cacheCmd('all');
492 }
493 }
494
495 // ********************************************
496 // RENDER LIST of pages with templates, BEGIN
497 // ********************************************
498 function setInPageArray(&$pArray, $rlArr, $row) {
499 ksort($rlArr);
500 reset($rlArr);
501 if (!$rlArr[0]['uid']) {
502 array_shift($rlArr);
503 }
504
505 $cEl = current($rlArr);
506 $pArray[$cEl['uid']] = htmlspecialchars($cEl['title']);
507 array_shift($rlArr);
508 if (count($rlArr)) {
509 if (!isset($pArray[$cEl['uid'] . '.'])) {
510 $pArray[$cEl['uid'] . '.'] = array();
511 }
512 $this->setInPageArray($pArray[$cEl['uid'] . '.'], $rlArr, $row);
513 } else {
514 $pArray[$cEl['uid'] . '_'] = $row;
515 }
516 }
517
518 function renderList($pArray, $lines = array(), $c = 0) {
519 if (is_array($pArray)) {
520 reset($pArray);
521 static $i;
522 foreach ($pArray as $k => $v) {
523 if (t3lib_div::testInt($k)) {
524 if (isset($pArray[$k . "_"])) {
525 $lines[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
526 <td nowrap><img src="clear.gif" width="1" height="1" hspace=' . ($c * 10) . ' align="top">' .
527 '<a href="' . t3lib_div::linkThisScript(array('id' => $k)) . '">' .
528 t3lib_iconWorks::getSpriteIconForRecord('pages', t3lib_BEfunc::getRecordWSOL('pages', $k), array("title"=>'ID: ' . $k )) .
529 t3lib_div::fixed_lgd_cs($pArray[$k], 30) . '</a></td>
530 <td align="center">' . $pArray[$k . '_']['count'] . '</td>
531 <td align="center" class="bgColor5">' . ($pArray[$k . '_']['root_max_val'] > 0 ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : "&nbsp;") .
532 '</td>
533 <td align="center">' . ($pArray[$k . '_']['root_min_val'] == 0 ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : "&nbsp;") .
534 '</td>
535 </tr>';
536 } else {
537 $lines[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
538 <td nowrap ><img src="clear.gif" width="1" height="1" hspace=' . ($c * 10) . ' align=top>' .
539 t3lib_iconWorks::getSpriteIconForRecord('pages', t3lib_BEfunc::getRecordWSOL('pages', $k)) .
540 t3lib_div::fixed_lgd_cs($pArray[$k], 30) . '</td>
541 <td align="center"></td>
542 <td align="center" class="bgColor5"></td>
543 <td align="center"></td>
544 </tr>';
545 }
546 $lines = $this->renderList($pArray[$k . '.'], $lines, $c + 1);
547 }
548 }
549 }
550 return $lines;
551 }
552 }
553
554
555 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tstemplate/ts/index.php']) {
556 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['ext/tstemplate/ts/index.php']);
557 }
558
559
560
561 // Make instance:
562 $SOBE = t3lib_div::makeInstance('SC_mod_web_ts_index');
563 /* @var $SOBE SC_mod_web_ts_index */
564 $SOBE->init();
565
566 // Include files?
567 foreach($SOBE->include_once as $INC_FILE) {
568 include_once($INC_FILE);
569 }
570 $SOBE->checkExtObj(); // Checking for first level external objects
571
572 $SOBE->clearCache();
573 $SOBE->main();
574 $SOBE->printContent();
575
576 ?>