TYPO3 API  SVNRelease
index.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
00006 *  All rights reserved
00007 *
00008 *  This script is part of the TYPO3 project. The TYPO3 project is
00009 *  free software; you can redistribute it and/or modify
00010 *  it under the terms of the GNU General Public License as published by
00011 *  the Free Software Foundation; either version 2 of the License, or
00012 *  (at your option) any later version.
00013 *
00014 *  The GNU General Public License can be found at
00015 *  http://www.gnu.org/copyleft/gpl.html.
00016 *  A copy is found in the textfile GPL.txt and important notices to the license
00017 *  from the author is found in LICENSE.txt distributed with these scripts.
00018 *
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00027 /**
00028  * Module: TypoScript Tools
00029  *
00030  *
00031  *  $TYPO3_CONF_VARS["MODS"]["web_ts"]["onlineResourceDir"]  = Directory of default resources. Eg. "fileadmin/res/" or so.
00032  *
00033  *
00034  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00035  */
00036 
00037 
00038 
00039 unset($MCONF);
00040 require('conf.php');
00041 require($BACK_PATH . 'init.php');
00042 require($BACK_PATH . 'template.php');
00043 $GLOBALS['LANG']->includeLLFile('EXT:tstemplate/ts/locallang.xml');
00044 
00045 $BE_USER->modAccess($MCONF, true);
00046 
00047 
00048 // ***************************
00049 // Script Classes
00050 // ***************************
00051 class SC_mod_web_ts_index extends t3lib_SCbase {
00052     var $perms_clause;
00053     var $e;
00054     var $sObj;
00055     var $edit;
00056     var $textExtensions = 'html,htm,txt,css,tmpl,inc,js';
00057 
00058     var $modMenu_type = '';
00059     var $modMenu_dontValidateList = '';
00060     var $modMenu_setDefaultList = '';
00061 
00062     function init() {
00063 
00064         parent::init();
00065 
00066         $this->id = intval(t3lib_div::_GP('id'));
00067         $this->e = t3lib_div::_GP('e');
00068         $this->sObj = t3lib_div::_GP('sObj');
00069         $this->edit = t3lib_div::_GP('edit');
00070 
00071         $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
00072 
00073         if (t3lib_div::_GP('clear_all_cache')) {
00074             $this->include_once[] = PATH_t3lib . 'class.t3lib_tcemain.php';
00075         }
00076     }
00077 
00078     function clearCache() {
00079         if (t3lib_div::_GP('clear_all_cache')) {
00080             $tce = t3lib_div::makeInstance('t3lib_TCEmain');
00081             /* @var $tce t3lib_TCEmain */
00082             $tce->stripslashes_values = 0;
00083             $tce->start(array(), array());
00084             $tce->clear_cacheCmd('all');
00085         }
00086     }
00087 
00088     function main() {
00089 
00090             // Template markers
00091         $markers = array(
00092             'CSH' => '',
00093             'FUNC_MENU' => '',
00094             'CONTENT' => ''
00095         );
00096 
00097         // Access check...
00098         // The page will show only if there is a valid page and if this page may be viewed by the user
00099         $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);
00100         $this->access = is_array($this->pageinfo) ? 1 : 0;
00101 
00102         $this->doc = t3lib_div::makeInstance('template');
00103         $this->doc->backPath = $GLOBALS['BACK_PATH'];
00104         $this->doc->setModuleTemplate('templates/tstemplate.html');
00105 
00106         if ($this->id && $this->access) {
00107             $this->doc->form = '<form action="index.php?id=' . $this->id . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editForm">';
00108 
00109 
00110                 // JavaScript
00111             $this->doc->JScode = '
00112         <script language="javascript" type="text/javascript">
00113             script_ended = 0;
00114             function jumpToUrl(URL) {
00115                 window.location.href = URL;
00116             }
00117             function uFormUrl(aname) {
00118                 document.forms[0].action = "index.php?id=' . $this->id . '#"+aname;
00119             }
00120             function brPoint(lnumber,t) {
00121                 window.location.href = "index.php?id=' . $this->id . '&SET[function]=tx_tstemplateobjbrowser&SET[ts_browser_type]="+(t?"setup":"const")+"&breakPointLN="+lnumber;
00122                 return false;
00123             }
00124         </script>
00125         ';
00126 
00127             $this->doc->postCode = '
00128         <script language="javascript" type="text/javascript">
00129             script_ended = 1;
00130             if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
00131         </script>
00132         ';
00133 
00134             $this->doc->inDocStylesArray[] = '
00135                 TABLE#typo3-objectBrowser A { text-decoration: none; }
00136                 TABLE#typo3-objectBrowser .comment { color: maroon; font-weight: bold; }
00137                 TABLE#ts-analyzer tr.t3-row-header { background-color: #A2AAB8; }
00138                 TABLE#ts-analyzer tr td {padding: 0 2px;}
00139                 TABLE#ts-analyzer tr.t3-row-header td { padding: 2px 4px; font-weight:bold; color: #fff; }
00140                 .tsob-menu label, .tsob-menu-row2 label, .tsob-conditions label {padding: 0 5px; vertical-align: text-top;}
00141                 .tsob-menu-row2 {margin-top: 10px;}
00142                 .tsob-conditions {padding: 1px 2px;}
00143                 .tsob-search-submit {margin-left: 3px; margin-right: 3px;}
00144                 .tst-analyzer-options { margin:5px 0; }
00145                 .tst-analyzer-options label {padding-left:5px; vertical-align:text-top; }
00146                 .bgColor0 {background-color:#fff; color: #000; }
00147             ';
00148 
00149 
00150                 // Setting up the context sensitive menu:
00151             $this->doc->getContextMenuCode();
00152 
00153                 // Build the modulle content
00154             $this->content = $this->doc->header($GLOBALS['LANG']->getLL('moduleTitle'));
00155             $this->extObjContent();
00156             $this->content .= $this->doc->spacer(10);
00157 
00158                 // Setting up the buttons and markers for docheader
00159             $docHeaderButtons = $this->getButtons();
00160             // $markers['CSH'] = $docHeaderButtons['csh'];
00161             $markers['FUNC_MENU'] = t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']);
00162             $markers['CONTENT'] = $this->content;
00163         } else {
00164                 // If no access or if ID == zero
00165 
00166             $this->doc->inDocStylesArray[] = '
00167                 TABLE#ts-overview tr.t3-row-header { background-color: #A2AAB8; }
00168                 TABLE#ts-overview tr td {padding: 2px;}
00169                 TABLE#ts-overview tr.t3-row-header td { padding: 2px 4px; font-weight:bold; color: #fff; }
00170             ';
00171                 // Template pages:
00172             $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
00173                         'pages.uid, count(*) AS count, max(sys_template.root) AS root_max_val, min(sys_template.root) AS root_min_val',
00174                         'pages,sys_template',
00175                         'pages.uid=sys_template.pid'.
00176                             t3lib_BEfunc::deleteClause('pages').
00177                             t3lib_BEfunc::versioningPlaceholderClause('pages').
00178                             t3lib_BEfunc::deleteClause('sys_template').
00179                             t3lib_BEfunc::versioningPlaceholderClause('sys_template'),
00180                         'pages.uid'
00181                     );
00182             $templateArray = array();
00183             $pArray = array();
00184 
00185             while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
00186                 $this->setInPageArray(
00187                     $pArray,
00188                     t3lib_BEfunc::BEgetRootLine($row['uid'], 'AND 1=1'),
00189                     $row
00190                 );
00191             }
00192 
00193             $lines = array();
00194             $lines[] = '<tr class="t3-row-header">
00195                 <td nowrap>' . $GLOBALS['LANG']->getLL('pageName') . '</td>
00196                 <td nowrap>' . $GLOBALS['LANG']->getLL('templates') . '</td>
00197                 <td nowrap>' . $GLOBALS['LANG']->getLL('isRoot') . '</td>
00198                 <td nowrap>' . $GLOBALS['LANG']->getLL('isExt') . '</td>
00199                 </tr>';
00200             $lines = array_merge($lines, $this->renderList($pArray));
00201 
00202             $table = '<table border="0" cellpadding="0" cellspacing="1" id="ts-overview">' . implode('', $lines) . '</table>';
00203             $this->content = $this->doc->section($GLOBALS['LANG']->getLL('moduleTitle'), '
00204             <br />
00205             ' . $GLOBALS['LANG']->getLL('overview') . '
00206             <br /><br />' . $table);
00207 
00208             // ********************************************
00209             // RENDER LIST of pages with templates, END
00210             // ********************************************
00211 
00212             $this->content .= $this->doc->spacer(10);
00213 
00214                 // Setting up the buttons and markers for docheader
00215             $docHeaderButtons = $this->getButtons();
00216             // $markers['CSH'] = $docHeaderButtons['csh'];
00217             $markers['CONTENT'] = $this->content;
00218         }
00219 
00220             // Build the <body> for the module
00221         $this->content = $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
00222             // Renders the module page
00223         $this->content = $this->doc->render(
00224             'Template Tools',
00225             $this->content
00226         );
00227     }
00228 
00229     function printContent() {
00230         echo $this->content;
00231     }
00232 
00233     /**
00234      * Create the panel of buttons for submitting the form or otherwise perform operations.
00235      *
00236      * @return  array   all available buttons as an assoc. array
00237      */
00238     protected function getButtons() {
00239 
00240         $buttons = array(
00241             'back' => '',
00242             'close' => '',
00243             'new' => '',
00244             'save' => '',
00245             'save_close' => '',
00246             'view' => '',
00247             'record_list' => '',
00248             'shortcut' => '',
00249         );
00250 
00251         if ($this->id && $this->access) {
00252                 // View page
00253             $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) . '">' .
00254                         t3lib_iconWorks::getSpriteIcon('actions-document-view') .
00255                     '</a>';
00256 
00257                 // If access to Web>List for user, then link to that module.
00258             $buttons['record_list'] = t3lib_BEfunc::getListViewLink(
00259                 array(
00260                     'id' => $this->pageinfo['uid'],
00261                     'returnUrl' => t3lib_div::getIndpEnv('REQUEST_URI'),
00262                 ),
00263                 $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList')
00264             );
00265 
00266             if ($this->extClassConf['name'] == 'tx_tstemplateinfo') {
00267                     // NEW button
00268                 $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) . '" />';
00269 
00270                 if (!empty($this->e) && !t3lib_div::_POST('abort') && !t3lib_div::_POST('saveclose')) {
00271                         // no NEW-button while edit
00272                     $buttons['new'] = '';
00273 
00274                         // SAVE button
00275                     $buttons['save'] = t3lib_iconWorks::getSpriteIcon('actions-document-save',
00276                         array(
00277                             'html' => '<input type="image" class="c-inputButton" name="submit" src="clear.gif" ' .
00278                                 'title="'. $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) .'" ' .
00279                                 'value="'. $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) .'" ' .
00280                                 '/>'
00281                         ));
00282 
00283                         // SAVE AND CLOSE button
00284                     $buttons['save_close'] = t3lib_iconWorks::getSpriteIcon('actions-document-save-close',
00285                         array(
00286                             'html' => '<input type="image" class="c-inputButton" name="saveclose" src="clear.gif" '.
00287                                 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', TRUE) . '" ' .
00288                                 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveCloseDoc', TRUE) . '" ' .
00289                                 '/>'
00290                         ));
00291 
00292                         // CLOSE button
00293                     $buttons['close'] = t3lib_iconWorks::getSpriteIcon('actions-document-close',
00294                         array(
00295                             'html' => '<input type="image" class="c-inputButton" name="abort" src="clear.gif" ' .
00296                                 'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE) . '" ' .
00297                                 'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.closeDoc', TRUE) . '" ' .
00298                                 '/>'
00299                         ));
00300 
00301                 }
00302             } elseif($this->extClassConf['name'] == 'tx_tstemplateceditor' && count($this->MOD_MENU['constant_editor_cat'])) {
00303                     // SAVE button
00304                 $buttons['save'] = t3lib_iconWorks::getSpriteIcon('actions-document-save',
00305                     array('html' => '<input type="image" class="c-inputButton" name="submit" src="clear.gif" '.
00306                         'title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) . '" ' .
00307                         'value="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:rm.saveDoc', TRUE) . '" ' .
00308                         '/>'));
00309             } elseif($this->extClassConf['name'] == 'tx_tstemplateobjbrowser') {
00310                 if(!empty($this->sObj)) {
00311                         // BACK
00312                     $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) . '">' .
00313                                     t3lib_iconWorks::getSpriteIcon('actions-view-go-back') .
00314                                 '</a>';
00315                 }
00316             }
00317 
00318                 // Shortcut
00319             if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
00320                 $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']);
00321             }
00322         } else {
00323                 // Shortcut
00324             if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
00325                 $buttons['shortcut'] = $this->doc->makeShortcutIcon('id', '', $this->MCONF['name']);
00326             }
00327         }
00328 
00329         return $buttons;
00330     }
00331 
00332     // ***************************
00333     // OTHER FUNCTIONS:
00334     // ***************************
00335 
00336     function linkWrapTemplateTitle($title, $onlyKey = '') {
00337         if ($onlyKey) {
00338             $title = '<a href="index.php?id=' . htmlspecialchars($GLOBALS['SOBE']->id . '&e[' . $onlyKey . ']=1&SET[function]=tx_tstemplateinfo') . '">' . htmlspecialchars($title) . '</a>';
00339         } else {
00340             $title = '<a href="index.php?id=' . htmlspecialchars($GLOBALS['SOBE']->id . '&e[constants]=1&e[config]=1&SET[function]=tx_tstemplateinfo') . '">' . htmlspecialchars($title) . '</a>';
00341         }
00342         return $title;
00343     }
00344 
00345     function noTemplate($newStandardTemplate = 0) {
00346 
00347         $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');  // Defined global here!
00348         /* @var $tmpl t3lib_tsparser_ext */
00349         $tmpl->tt_track = false;    // Do not log time-performance information
00350         $tmpl->init();
00351 
00352             // No template
00353         $theOutput .= $this->doc->spacer(10);
00354 
00355         $flashMessage = t3lib_div::makeInstance(
00356             't3lib_FlashMessage',
00357             $GLOBALS['LANG']->getLL('noTemplateDescription') . '<br />' . $GLOBALS['LANG']->getLL('createTemplateToEditConfiguration'),
00358             $GLOBALS['LANG']->getLL('noTemplate'),
00359             t3lib_FlashMessage::INFO
00360         );
00361         $theOutput .= $flashMessage->render();
00362 
00363 
00364             // New standard?
00365         if ($newStandardTemplate) {
00366             if (t3lib_extMgm::isLoaded('statictemplates')) { // check wether statictemplates are supported
00367                 $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('title,uid', 'static_template', '', '', 'title');
00368                 $opt = '';
00369                 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
00370                     if (substr(trim($row['title']), 0, 8) == 'template') {
00371                         $opt .= '<option value="' . $row['uid'] . '">' . htmlspecialchars($row['title']) . '</option>';
00372                     }
00373                 }
00374                 $selector = '<select name="createStandard"><option></option>' . $opt . '</select><br />';
00375                 $staticsText = ', optionally based on one of the standard templates';
00376             } else {
00377                 $selector = '<input type="hidden" name="createStandard" value="" />';
00378                 $staticsText = '';
00379             }
00380 
00381                 // Extension?
00382             $theOutput .= $this->doc->spacer(10);
00383             $theOutput .= $this->doc->section($GLOBALS['LANG']->getLL('newWebsite') . $staticsText, $GLOBALS['LANG']->getLL('newWebsiteDescription') . '<br /><br />' .
00384             $selector .
00385             '<input type="Submit" name="newWebsite" value="' . $GLOBALS['LANG']->getLL('newWebsiteAction') . '" />', 0, 1);
00386         }
00387             // Extension?
00388         $theOutput .= $this->doc->spacer(10);
00389         $theOutput .= $this->doc->section($GLOBALS['LANG']->getLL('extTemplate'), $GLOBALS['LANG']->getLL('extTemplateDescription') . '<br /><br />' .
00390             '<input type="submit" name="createExtension" value="' . $GLOBALS['LANG']->getLL('extTemplateAction') . '" />', 0, 1);
00391 
00392             // Go to first appearing...
00393         $first = $tmpl->ext_prevPageWithTemplate($this->id, $this->perms_clause);
00394         if ($first) {
00395             $theOutput .= $this->doc->spacer(10);
00396             $theOutput .= $this->doc->section($GLOBALS['LANG']->getLL('goToClosest'),
00397                     sprintf($GLOBALS['LANG']->getLL('goToClosestDescription') . '<br /><br />%s<strong>' . $GLOBALS['LANG']->getLL('goToClosestAction') . '</strong>%s', htmlspecialchars($first['title']), $first['uid'],
00398                     '<a href="index.php?id=' . $first['uid'] . '">', '</a>'), 0, 1);
00399         }
00400         return $theOutput;
00401     }
00402 
00403     function templateMenu() {
00404         $tmpl = t3lib_div::makeInstance('t3lib_tsparser_ext');  // Defined global here!
00405         /* @var $tmpl t3lib_tsparser_ext */
00406         $tmpl->tt_track = false;    // Do not log time-performance information
00407         $tmpl->init();
00408         $all = $tmpl->ext_getAllTemplates($this->id, $this->perms_clause);
00409         $menu = '';
00410 
00411         if (count($all) > 1) {
00412             $this->MOD_MENU['templatesOnPage'] = array();
00413             foreach ($all as $d) {
00414                 $this->MOD_MENU['templatesOnPage'][$d['uid']] = $d['title'];
00415             }
00416         }
00417 
00418         $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);
00419         $menu = t3lib_BEfunc::getFuncMenu($this->id, 'SET[templatesOnPage]', $this->MOD_SETTINGS['templatesOnPage'], $this->MOD_MENU['templatesOnPage']);
00420 
00421         return $menu;
00422     }
00423 
00424     function createTemplate($id, $actTemplateId = 0) {
00425         if (t3lib_div::_GP('createExtension')) {
00426             $tce = t3lib_div::makeInstance('t3lib_TCEmain');
00427             /* @var $tce t3lib_TCEmain */
00428             $tce->stripslashes_values = 0;
00429             $recData = array();
00430             $recData['sys_template']['NEW'] = array(
00431                 'pid' => $actTemplateId ? -1 * $actTemplateId : $id,
00432                 'title' => "+ext",
00433             );
00434 
00435             $tce->start($recData, array());
00436             $tce->process_datamap();
00437             return $tce->substNEWwithIDs['NEW'];
00438         } elseif (t3lib_div::_GP('newWebsite')) {
00439             $tce = t3lib_div::makeInstance('t3lib_TCEmain');
00440             /* @var $tce t3lib_TCEmain */
00441             $tce->stripslashes_values = 0;
00442             $recData = array();
00443 
00444             if (intval(t3lib_div::_GP('createStandard'))) {
00445                 $staticT = intval(t3lib_div::_GP('createStandard'));
00446                 $recData['sys_template']['NEW'] = array(
00447                     'pid' => $id,
00448                     'title' => $GLOBALS['LANG']->getLL('titleNewSiteStandard'),
00449                     'sorting' => 0,
00450                     'root' => 1,
00451                     'clear' => 3,
00452                     'include_static' => $staticT . ',57',   // 57 is cSet
00453                 );
00454             } else {
00455                 $recData['sys_template']['NEW'] = array(
00456                     'pid' => $id,
00457                     'title' => $GLOBALS['LANG']->getLL('titleNewSite'),
00458                     'sorting' => 0,
00459                     'root' => 1,
00460                     'clear' => 3,
00461                     'config' => '
00462 # Default PAGE object:
00463 page = PAGE
00464 page.10 = TEXT
00465 page.10.value = HELLO WORLD!
00466 ',
00467                 );
00468             }
00469             $tce->start($recData, array());
00470             $tce->process_datamap();
00471             $tce->clear_cacheCmd('all');
00472         }
00473     }
00474 
00475     // ********************************************
00476     // RENDER LIST of pages with templates, BEGIN
00477     // ********************************************
00478     function setInPageArray(&$pArray, $rlArr, $row) {
00479         ksort($rlArr);
00480         reset($rlArr);
00481         if (!$rlArr[0]['uid']) {
00482             array_shift($rlArr);
00483         }
00484 
00485         $cEl = current($rlArr);
00486         $pArray[$cEl['uid']] = htmlspecialchars($cEl['title']);
00487         array_shift($rlArr);
00488         if (count($rlArr)) {
00489             if (!isset($pArray[$cEl['uid'] . '.'])) {
00490                 $pArray[$cEl['uid'] . '.'] = array();
00491             }
00492             $this->setInPageArray($pArray[$cEl['uid'] . '.'], $rlArr, $row);
00493         } else {
00494             $pArray[$cEl['uid'] . '_'] = $row;
00495         }
00496     }
00497 
00498     function renderList($pArray, $lines = array(), $c = 0) {
00499         if (is_array($pArray)) {
00500             reset($pArray);
00501             static $i;
00502             foreach ($pArray as $k => $v) {
00503                 if (t3lib_div::testInt($k)) {
00504                     if (isset($pArray[$k . "_"])) {
00505                         $lines[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
00506                             <td nowrap><img src="clear.gif" width="1" height="1" hspace=' . ($c * 10) . ' align="top">' .
00507                             '<a href="' . t3lib_div::linkThisScript(array('id' => $k)) . '">' .
00508                             t3lib_iconWorks::getSpriteIconForRecord('pages', t3lib_BEfunc::getRecordWSOL('pages', $k), array("title"=>'ID: ' . $k )) .
00509                             t3lib_div::fixed_lgd_cs($pArray[$k], 30) . '</a></td>
00510                             <td align="center">' . $pArray[$k . '_']['count'] . '</td>
00511                             <td align="center" class="bgColor5">' . ($pArray[$k . '_']['root_max_val'] > 0 ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : "&nbsp;") .
00512                             '</td>
00513                             <td align="center">' . ($pArray[$k . '_']['root_min_val'] == 0 ? t3lib_iconWorks::getSpriteIcon('status-status-checked') : "&nbsp;") .
00514                             '</td>
00515                             </tr>';
00516                         } else {
00517                             $lines[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
00518                             <td nowrap ><img src="clear.gif" width="1" height="1" hspace=' . ($c * 10) . ' align=top>' .
00519                             t3lib_iconWorks::getSpriteIconForRecord('pages', t3lib_BEfunc::getRecordWSOL('pages', $k)) .
00520                             t3lib_div::fixed_lgd_cs($pArray[$k], 30) . '</td>
00521                             <td align="center"></td>
00522                             <td align="center" class="bgColor5"></td>
00523                             <td align="center"></td>
00524                             </tr>';
00525                     }
00526                     $lines = $this->renderList($pArray[$k . '.'], $lines, $c + 1);
00527                 }
00528             }
00529         }
00530         return $lines;
00531     }
00532 }
00533 
00534 
00535 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tstemplate/ts/index.php'])) {
00536     include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/tstemplate/ts/index.php']);
00537 }
00538 
00539 
00540 
00541 // Make instance:
00542 $SOBE = t3lib_div::makeInstance('SC_mod_web_ts_index');
00543 /* @var $SOBE SC_mod_web_ts_index */
00544 $SOBE->init();
00545 
00546 // Include files?
00547 foreach($SOBE->include_once as $INC_FILE) {
00548     include_once($INC_FILE);
00549 }
00550 $SOBE->checkExtObj();   // Checking for first level external objects
00551 
00552 $SOBE->clearCache();
00553 $SOBE->main();
00554 $SOBE->printContent();
00555 
00556 ?>