Documentation TYPO3 par Ameos

class.tx_cms_layout.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 Kasper Skaarhoj (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 ***************************************************************/
00115 class tx_cms_layout extends recordList {
00116 
00117                 // External, static: For page statistics:
00118         var $stat_select_field='page_id';               // fieldname from sys_stat to select on.
00119         var $stat_codes=array();                                // eg.  "HITS_days:-1"
00120 
00121                 // External, static: Flags of various kinds:
00122         var $pI_showUser=0;                                             // If true, users/groups are shown in the page info box.
00123         var $pI_showStat=1;                                             // If true, hit statistics are shown in the page info box.
00124         var $nextThree = 3;                                             // The number of successive records to edit when showing content elements.
00125         var $pages_noEditColumns=0;                             // If true, disables the edit-column icon for tt_content elements
00126         var $option_showBigButtons=1;                   // If true, shows big buttons for editing page properties, moving, creating elements etc. in the columns view.
00127         var $option_newWizard=1;                                // If true, new-wizards are linked to rather than the regular new-element list.
00128         var $ext_function=0;                                    // If set to "1", will link a big button to content element wizard.
00129         var $doEdit=1;                                                  // If true, elements will have edit icons (probably this is whethere the user has permission to edit the page content). Set externally.
00130         var $agePrefixes = ' min| hrs| days| yrs';      // Age prefixes for displaying times. May be set externally to localized values.
00131         var $externalTables = array();                  // Array of tables which is configured to be listed by the Web > Page module in addition to the default tables.
00132         var $descrTable;                                                // "Pseudo" Description -table name
00133         var $defLangBinding=FALSE;                              // If set true, the language mode of tt_content elements will be rendered with hard binding between default language content elements and their translations!
00134 
00135                 // External, static: Configuration of tt_content element display:
00136         var $tt_contentConfig = Array (
00137                 'showInfo' => 1,                                        // Boolean: Display info-marks or not
00138                 'showCommands' => 1,                            // Boolean: Display up/down arrows and edit icons for tt_content records
00139                 'showCommands_info' => 1,                       // Boolean: Displays infoGif with the command buttons
00140                 'single' => 1,                                          // Boolean: If set, the content of column(s) $this->tt_contentConfig['showSingleCol'] is shown in the total width of the page
00141                 'showSingleCol' => 0,                           // The column(s) to show if single mode (under each other)
00142                 'languageCols' => 0,
00143                 'languageMode' => 0,
00144                 'languageColsPointer' => 0,
00145                 'showHidden' => 1,                                      // Displays hidden records as well
00146                 'sys_language_uid' => 0,                        // Which language
00147                 'cols' => '1,0,2,3'                                     // The order of the rows: Default is left(1), Normal(0), right(2), margin(3)
00148         );
00149 
00150                 // Internal, dynamic:
00151         var $allowedTableNames=array();                 // Will contain a list of tables which can be listed by the user.
00152         var $activeTables = array();                    // Contains icon/title of pages which are listed in the tables menu (see getTableMenu() function )
00153         var $tt_contentData = Array(
00154                 'nextThree' => Array(),
00155                 'prev' => Array(),
00156                 'next' => Array()
00157         );
00158         var $CType_labels=array();                              // Used to store labels for CTypes for tt_content elements
00159         var $itemLabels=array();                                // Used to store labels for the various fields in tt_content elements
00160 
00161 
00162 
00163 
00164 
00165 
00166 
00167         /*****************************************
00168          *
00169          * Renderings
00170          *
00171          *****************************************/
00172 
00180         function getTable($table,$id)   {
00181 
00182                         // Load full table definition:
00183                 t3lib_div::loadTCA($table);
00184 
00185                 if (isset($this->externalTables[$table]))       {
00186                         $fList = $this->externalTables[$table][0]['fList'];     // eg. "name;title;email;company,image"
00187                         $icon = $this->externalTables[$table][0]['icon'];       // Boolean,
00188 
00189                                 // Create listing
00190                         $out = $this->makeOrdinaryList($table, $id, $fList, $icon);
00191                         return $out;
00192                 } else {
00193                                 // Branch out based on table name:
00194                                 // Notice: Most of these tables belongs to other extensions than 'cms'. Each of these tables can be rendered only if the extensions they belong to is loaded.
00195                         switch($table)  {
00196                                 case 'pages':
00197                                         return $this->getTable_pages($id);
00198                                 break;
00199                                 case 'tt_content':
00200                                         return $this->getTable_tt_content($id);
00201                                 break;
00202                                 case 'fe_users':
00203                                         return $this->getTable_fe_users($id);
00204                                 break;
00205                                 case 'sys_note':
00206                                         return $this->getTable_sys_note($id);
00207                                 break;
00208                                 case 'tt_board':
00209                                         return $this->getTable_tt_board($id);
00210                                 break;
00211                                 case 'tt_address':
00212                                         return $this->getTable_tt_address($id);
00213                                 break;
00214                                 case 'tt_links':
00215                                         return $this->getTable_tt_links($id);
00216                                 break;
00217                                 case 'tt_guest':
00218                                         return $this->getTable_tt_guest($id);
00219                                 break;
00220                                 case 'tt_news':
00221                                         return $this->getTable_tt_news($id);
00222                                 break;
00223                                 case 'tt_calender':
00224                                         return $this->getTable_tt_calender($id);
00225                                 break;
00226                                 case 'tt_products':
00227                                         return $this->getTable_tt_products($id);
00228                                 break;
00229                         }
00230                 }
00231         }
00232 
00240         function getTable_pages($id)    {
00241                 global $TCA;
00242 
00243                         // Initializing:
00244                 $out='';
00245                 $delClause = t3lib_BEfunc::deleteClause('pages').' AND '.$GLOBALS['BE_USER']->getPagePermsClause(1);            // Select clause for pages:
00246 
00247                         // Select current page:
00248                 if (!$id)       {
00249                         $row = $GLOBALS['SOBE']->pageinfo;              // The root has a pseudo record in pageinfo...
00250                 } else {
00251                         $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'pages', 'uid='.intval($id).$delClause);
00252                         $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
00253                         t3lib_BEfunc::workspaceOL('pages', $row);
00254                 }
00255 
00256                         // If there was found a page:
00257                 if (is_array($row))     {
00258 
00259                                 // Select which fields to show:
00260                         $pKey = $GLOBALS['SOBE']->MOD_SETTINGS['function']=='tx_cms_webinfo_hits' ? 'hits' : $GLOBALS['SOBE']->MOD_SETTINGS['pages'];
00261                         switch($pKey)   {
00262                                 case 'hits':
00263                                         $this->fieldArray = explode(',','title,'.implode(',',$this->stat_codes));
00264                                 break;
00265                                 case 1:
00266                                         $this->cleanTableNames();
00267                                         $tableNames=$this->allowedTableNames;
00268                                         $this->fieldArray = explode(',','title,uid,'.implode(',',array_keys($tableNames)));
00269                                 break;
00270                                 case 2:
00271                                         $this->fieldArray = explode(',','title,uid,lastUpdated,newUntil,no_cache,cache_timeout,php_tree_stop,TSconfig,storage_pid,is_siteroot,fe_login_mode');
00272                                 break;
00273                                 default:
00274                                         $this->fieldArray = explode(',','title,uid,alias,starttime,endtime,fe_group,target,url,shortcut,shortcut_mode');
00275                                 break;
00276                         }
00277 
00278                                 // Getting select-depth:
00279                         $depth=intval($GLOBALS['SOBE']->MOD_SETTINGS['pages_levels']);
00280 
00281                                 // Half line is drawn
00282                         $theData = Array();
00283                         $theData['subject'] = $this->widthGif;
00284                         $out.=$this->addelement(0,'',$theData);
00285 
00286                                 // Overriding a few things:
00287                         $this->no_noWrap=0;
00288                         $this->oddColumnsTDParams=' class="bgColor3-20"';
00289 
00290                                 // Items
00291                         $this->eCounter=$this->firstElementNumber;
00292 
00293                                 // Creating elements:
00294                         list($flag,$code) = $this->fwd_rwd_nav();
00295                         $out.=$code;
00296                         $editUids=array();
00297                         if ($flag)      {
00298 
00299                                         // Getting children:
00300                                 $theRows = Array();
00301                                 $theRows = $this->pages_getTree($theRows,$row['uid'],$delClause.t3lib_BEfunc::versioningPlaceholderClause('pages'),'',$depth);
00302                                 if ($GLOBALS['BE_USER']->doesUserHaveAccess($row,2))    $editUids[]=$row['uid'];
00303                                 $out.=$this->pages_drawItem($row,$this->fieldArray);
00304 
00305                                         // Traverse all pages selected:
00306                                 foreach($theRows as $n => $sRow)        {
00307                                         if ($GLOBALS['BE_USER']->doesUserHaveAccess($sRow,2))   $editUids[]=$sRow['uid'];
00308                                         $out.=$this->pages_drawItem($sRow,$this->fieldArray);
00309                                 }
00310                                 $this->eCounter++;
00311                         }
00312 
00313                                 // Header line is drawn
00314                         $theData = Array();
00315                         $editIdList = implode(',', $editUids);
00316 
00317                                 // Traverse fields (as set above) in order to create header values:
00318                         foreach($this->fieldArray as $field)    {
00319                                 if ($editIdList && isset($TCA['pages']['columns'][$field]) && $field!='uid' && !$this->pages_noEditColumns)     {
00320                                         $params='&edit[pages]['.$editIdList.']=edit&columnsOnly='.$field.'&disHelp=1';
00321                                         $iTitle = sprintf($GLOBALS['LANG']->getLL('editThisColumn'),ereg_replace(':$','',trim($GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('pages',$field)))));
00322                                         $eI= '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,'')).'">'.
00323                                                         '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.htmlspecialchars($iTitle).'" alt="" />'.
00324                                                         '</a>';
00325                                 } else $eI='';
00326                                 switch($field)  {
00327                                         case 'title':
00328                                                 $theData[$field] = '&nbsp;<b>'.$GLOBALS['LANG']->sL($TCA['pages']['columns'][$field]['label']).'</b>'.$eI;
00329                                         break;
00330                                         case 'uid':
00331                                                 $theData[$field] = '&nbsp;<b>ID:</b>';
00332                                         break;
00333                                         default:
00334                                                 if (substr($field,0,6)=='table_')       {
00335                                                         $f2 = substr($field,6);
00336                                                         if ($TCA[$f2])  {
00337                                                                 $theData[$field] = '&nbsp;'.t3lib_iconWorks::getIconImage($f2,array(),$this->backPath,'title="'.$GLOBALS['LANG']->sL($TCA[$f2]['ctrl']['title'],1).'"');
00338                                                         }
00339                                                 } elseif (substr($field,0,5)=='HITS_')  {
00340                                                         $fParts = explode(':',substr($field,5));
00341                                                         switch($fParts[0])      {
00342                                                                 case 'days':
00343                                                                         $timespan = mktime (0,0,0)+intval($fParts[1])*3600*24;
00344                                                                         $theData[$field]='&nbsp;'.date('d',$timespan);
00345                                                                 break;
00346                                                                 default:
00347                                                                         $theData[$field] = '';
00348                                                                 break;
00349                                                         }
00350                                                 } else {
00351                                                         $theData[$field] = '&nbsp;&nbsp;<b>'.$GLOBALS['LANG']->sL($TCA['pages']['columns'][$field]['label'],1).'</b>'.$eI;
00352                                                 }
00353                                         break;
00354                                 }
00355                         }
00356 
00357                                 // Start table:
00358                         $this->oddColumnsTDParams = '';
00359 
00360                                 // CSH:
00361                         $out = t3lib_BEfunc::cshItem($this->descrTable,'func_'.$pKey,$GLOBALS['BACK_PATH']).
00362                                 '
00363                                 <table border="0" cellpadding="0" cellspacing="0" class="typo3-page-pages">
00364                                         '.$this->addelement(1,'',$theData,' class="c-headLine"',20).
00365                                         $out.'
00366                                 </table>';
00367                 }
00368                 $this->oddColumnsTDParams = '';
00369                 return $out;
00370         }
00371 
00378         function getTable_tt_content($id)       {
00379                 global $TCA;
00380 
00381                 $this->initializeLanguages();
00382 
00383                         // Initialize:
00384                 $RTE = $GLOBALS['BE_USER']->isRTE();
00385                 $lMarg=1;
00386                 $showHidden = $this->tt_contentConfig['showHidden']?'':t3lib_BEfunc::BEenableFields('tt_content');
00387                 $pageTitleParamForAltDoc='&recTitle='.rawurlencode(t3lib_BEfunc::getRecordTitle('pages',t3lib_BEfunc::getRecordWSOL('pages',$id),1));
00388 
00389                         // Get labels for CTypes and tt_content element fields in general:
00390                 $this->CType_labels =array();
00391                 foreach($TCA['tt_content']['columns']['CType']['config']['items'] as $val)              {
00392                         $this->CType_labels[$val[1]]=$GLOBALS['LANG']->sL($val[0]);
00393                 }
00394                 $this->itemLabels =array();
00395                 foreach($TCA['tt_content']['columns'] as $name => $val) {
00396                         $this->itemLabels[$name]=$GLOBALS['LANG']->sL($val['label']);
00397                 }
00398 
00399 
00400                         // Select display mode:
00401                 if (!$this->tt_contentConfig['single']) {               // MULTIPLE column display mode, side by side:
00402 
00403                                 // Setting language list:
00404                         $langList = $this->tt_contentConfig['sys_language_uid'];
00405                         if ($this->tt_contentConfig['languageMode'])    {
00406                                 if ($this->tt_contentConfig['languageColsPointer'])     {
00407                                         $langList='0,'.$this->tt_contentConfig['languageColsPointer'];
00408                                 } else {
00409                                         $langList=implode(',',array_keys($this->tt_contentConfig['languageCols']));
00410                                 }
00411                                 $languageColumn = array();
00412                         }
00413                         $langListArr = explode(',',$langList);
00414                         $defLanguageCount = array();
00415                         $defLangBinding = array();
00416 
00417                                 // For EACH languages... :
00418                         foreach($langListArr as $lP)    {       // If NOT languageMode, then we'll only be through this once.
00419                                 $showLanguage = $this->defLangBinding && $lP==0 ? ' AND sys_language_uid IN (0,-1)' : ' AND sys_language_uid='.$lP;
00420                                 $cList = explode(',',$this->tt_contentConfig['cols']);
00421                                 $content = array();
00422                                 $head = array();
00423 
00424                                         // For EACH column, render the content into a variable:
00425                                 foreach($cList as $key) {
00426                                         if (!$lP) $defLanguageCount[$key] = array();
00427 
00428                                                 // Select content elements from this column/language:
00429                                         $queryParts = $this->makeQueryArray('tt_content', $id, 'AND colPos='.intval($key).$showHidden.$showLanguage);
00430                                         $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
00431 
00432                                                 // If it turns out that there are not content elements in the column, then display a big button which links directly to the wizard script:
00433                                         if ($this->doEdit && $this->option_showBigButtons && !intval($key) && !$GLOBALS['TYPO3_DB']->sql_num_rows($result))     {
00434                                                 $onClick = "window.location.href='db_new_content_el.php?id=".$id.'&colPos='.intval($key).'&sys_language_uid='.$lP.'&uid_pid='.$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';";
00435                                                 $theNewButton = $GLOBALS['SOBE']->doc->t3Button($onClick,$GLOBALS['LANG']->getLL('newPageContent'));
00436                                                 $content[$key].= '<img src="clear.gif" width="1" height="5" alt="" /><br />'.$theNewButton;
00437                                         }
00438 
00439                                                 // Traverse any selected elements and render their display code:
00440                                         $rowArr = $this->getResult($result);
00441 
00442                                         foreach($rowArr as $rKey => $row)       {
00443                                                 t3lib_BEfunc::workspaceOL('tt_content', $row);
00444 
00445                                                 if ((int)$row['t3ver_state']!=2)        {
00446                                                         $singleElementHTML = '';
00447                                                         if (!$lP) $defLanguageCount[$key][] = $row['uid'];
00448 
00449                                                         $editUidList.= $row['uid'].',';
00450                                                         $singleElementHTML.= $this->tt_content_drawHeader($row,$this->tt_contentConfig['showInfo']?15:5, $this->defLangBinding && $lP>0, TRUE);
00451 
00452                                                         $isRTE = $RTE && $this->isRTEforField('tt_content',$row,'bodytext');
00453                                                         $singleElementHTML.= '<div '.($row['_ORIG_uid'] ? ' class="ver-element"' :'').'>'.$this->tt_content_drawItem($row,$isRTE).'</div>';
00454 
00455                                                         if ($this->defLangBinding && $this->tt_contentConfig['languageMode'])   {
00456                                                                 $defLangBinding[$key][$lP][$row[($lP ? 'l18n_parent' : 'uid')]] = $singleElementHTML;
00457                                                         } else {
00458                                                                 $content[$key].= $singleElementHTML;
00459                                                         }
00460                                                 } else { unset($rowArr[$rKey]); }
00461                                         }
00462 
00463                                                 // Add new-icon link, header:
00464                                         $newP = $this->newContentElementOnClick($id,$key,$lP);
00465                                         $head[$key].= $this->tt_content_drawColHeader(t3lib_BEfunc::getProcessedValue('tt_content','colPos',$key), ($this->doEdit&&count($rowArr)?'&edit[tt_content]['.$editUidList.']=edit'.$pageTitleParamForAltDoc:''), $newP);
00466                                         $editUidList = '';
00467                                 }
00468 
00469                                         // For EACH column, fit the rendered content into a table cell:
00470                                 $out='';
00471                                 foreach($cList as $k => $key)   {
00472                                         if (!$k)        {
00473                                                 $out.= '
00474                                                         <td><img src="clear.gif" width="'.$lMarg.'" height="1" alt="" /></td>';
00475                                         } else {
00476                                                 $out.= '
00477                                                         <td><img src="clear.gif" width="4" height="1" alt="" /></td>
00478                                                         <td bgcolor="black"><img src="clear.gif" width="1" height="1" alt="" /></td>
00479                                                         <td><img src="clear.gif" width="4" height="1" alt="" /></td>';
00480                                         }
00481                                         $out.= '
00482                                                         <td valign="top">'.$head[$key].$content[$key].'</td>';
00483 
00484                                                 // Storing content for use if languageMode is set:
00485                                         if ($this->tt_contentConfig['languageMode'])    {
00486                                                 $languageColumn[$key][$lP] = $head[$key].$content[$key];
00487                                                 if (!$this->defLangBinding)     {
00488                                                         $languageColumn[$key][$lP].='<br /><br />'.$this->newLanguageButton($this->getNonTranslatedTTcontentUids($defLanguageCount[$key],$id,$lP),$lP);
00489                                                 }
00490                                         }
00491                                 }
00492 
00493                                         // Wrap the cells into a table row:
00494                                 $out = '
00495                                         <table border="0" cellpadding="0" cellspacing="0" width="480" class="typo3-page-cols">
00496                                                 <tr>'.$out.'
00497                                                 </tr>
00498                                         </table>';
00499 
00500                                         // CSH:
00501                                 $out.= t3lib_BEfunc::cshItem($this->descrTable,'columns_multi',$GLOBALS['BACK_PATH']);
00502                         }
00503 
00504                                 // If language mode, then make another presentation:
00505                                 // Notice that THIS presentation will override the value of $out! But it needs the code above to execute since $languageColumn is filled with content we need!
00506                         if ($this->tt_contentConfig['languageMode'])    {
00507 
00508                                         // Get language selector:
00509                                 $languageSelector = $this->languageSelector($id);
00510 
00511                                         // Reset out - we will make new content here:
00512                                 $out='';
00513                                         // Separator between language columns (black thin line)
00514                                 $midSep = '
00515                                                 <td><img src="clear.gif" width="4" height="1" alt="" /></td>
00516                                                 <td bgcolor="black"><img src="clear.gif" width="1" height="1" alt="" /></td>
00517                                                 <td><img src="clear.gif" width="4" height="1" alt="" /></td>';
00518 
00519                                         // Traverse languages found on the page and build up the table displaying them side by side:
00520                                 $cCont=array();
00521                                 $sCont=array();
00522                                 foreach($langListArr as $lP)    {
00523 
00524                                                 // Header:
00525                                         $cCont[$lP]='
00526                                                 <td valign="top" align="center" class="bgColor6"><strong>'.htmlspecialchars($this->tt_contentConfig['languageCols'][$lP]).'</strong></td>';
00527 
00528                                                 // "View page" icon is added:
00529                                         $viewLink = '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($this->id,$this->backPath,t3lib_BEfunc::BEgetRootLine($this->id),'','','&L='.$lP)).'">'.
00530                                                 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom.gif','width="12" height="12"').' class="absmiddle" title="" alt="" />'.
00531                                                 '</a>';
00532 
00533                                                 // Language overlay page header:
00534                                         if ($lP)        {
00535 
00536                                                 list($lpRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay','pid',$id,'AND sys_language_uid='.intval($lP));
00537                                                 t3lib_BEfunc::workspaceOL('pages_language_overlay',$lpRecord);
00538                                                 $params='&edit[pages_language_overlay]['.$lpRecord['uid'].']=edit&overrideVals[pages_language_overlay][sys_language_uid]='.$lP;
00539                                                 $lPLabel = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon(t3lib_iconWorks::getIconImage('pages_language_overlay',$lpRecord,$this->backPath,'  class="absmiddle"'),'pages_language_overlay',$lpRecord['uid']).
00540                                                         $viewLink.
00541                                                         ($GLOBALS['BE_USER']->check('tables_modify','pages_language_overlay') ? '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath)).'">'.
00542                                                         '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('edit',1).'" class="absmiddle" alt="" />'.
00543                                                         '</a>' : '').
00544                                                         htmlspecialchars(t3lib_div::fixed_lgd_cs($lpRecord['title'],20));
00545                                         } else {
00546                                                 $lPLabel = $viewLink;
00547                                         }
00548                                         $sCont[$lP]='
00549                                                 <td nowrap="nowrap">'.$lPLabel.'</td>';
00550                                 }
00551                                         // Add headers:
00552                                 $out.='
00553                                         <tr>'.implode($midSep,$cCont).'
00554                                         </tr>';
00555                                 $out.='
00556                                         <tr>'.implode($midSep,$sCont).'
00557                                         </tr>';
00558 
00559                                         // Traverse previously built content for the columns:
00560                                 foreach($languageColumn as $cKey => $cCont)     {
00561                                         $out.='
00562                                         <tr>
00563                                                 <td valign="top">'.implode('</td>'.$midSep.'
00564                                                 <td valign="top">',$cCont).'</td>
00565                                         </tr>';
00566 
00567                                         if ($this->defLangBinding)      {
00568                                                         // "defLangBinding" mode
00569                                                 foreach($defLanguageCount[$cKey] as $defUid)    {
00570                                                         $cCont=array();
00571                                                         foreach($langListArr as $lP)    {
00572                                                                 $cCont[] = $defLangBinding[$cKey][$lP][$defUid].
00573                                                                                 '<br/>'.$this->newLanguageButton($this->getNonTranslatedTTcontentUids(array($defUid),$id,$lP),$lP);
00574                                                         }
00575                                                         $out.='
00576                                                         <tr>
00577                                                                 <td valign="top">'.implode('</td>'.$midSep.'
00578                                                                 <td valign="top">',$cCont).'</td>
00579                                                         </tr>';
00580                                                 }
00581 
00582                                                         // Create spacer:
00583                                                 $cCont=array();
00584                                                 foreach($langListArr as $lP)    {
00585                                                         $cCont[] = '&nbsp;';
00586                                                 }
00587                                                 $out.='
00588                                                 <tr>
00589                                                         <td valign="top">'.implode('</td>'.$midSep.'
00590                                                         <td valign="top">',$cCont).'</td>
00591                                                 </tr>';
00592                                         }
00593                                 }
00594 
00595                                         // Finally, wrap it all in a table and add the language selector on top of it:
00596                                 $out = $languageSelector.'
00597                                         <table border="0" cellpadding="0" cellspacing="0" width="480" class="typo3-page-langMode">
00598                                                 '.$out.'
00599                                         </table>';
00600 
00601                                         // CSH:
00602                                 $out.= t3lib_BEfunc::cshItem($this->descrTable,'language_list',$GLOBALS['BACK_PATH']);
00603                         }
00604                 } else {                // SINGLE column mode (columns shown beneath each other):
00605 #debug('single column');
00606                         if ($this->tt_contentConfig['sys_language_uid']==0 || !$this->defLangBinding)   {
00607 
00608                                         // Initialize:
00609                                 if ($this->defLangBinding && $this->tt_contentConfig['sys_language_uid']==0)    {
00610                                         $showLanguage = ' AND sys_language_uid IN (0,-1)';
00611                                         $lP = 0;
00612                                 } else {
00613                                         $showLanguage = ' AND sys_language_uid='.$this->tt_contentConfig['sys_language_uid'];
00614                                         $lP = $this->tt_contentConfig['sys_language_uid'];
00615                                 }
00616 
00617                                 $cList = explode(',',$this->tt_contentConfig['showSingleCol']);
00618                                 $content=array();
00619                                 $out='';
00620 
00621                                         // Expand the table to some preset dimensions:
00622                                 $out.='
00623                                         <tr>
00624                                                 <td><img src="clear.gif" width="'.$lMarg.'" height="1" alt="" /></td>
00625                                                 <td valign="top"><img src="clear.gif" width="150" height="1" alt="" /></td>
00626                                                 <td><img src="clear.gif" width="10" height="1" alt="" /></td>
00627                                                 <td valign="top"><img src="clear.gif" width="300" height="1" alt="" /></td>
00628                                         </tr>';
00629 
00630                                         // Traverse columns to display top-on-top
00631                                 while(list($counter,$key)=each($cList)) {
00632 
00633                                                 // Select content elements:
00634                                         $queryParts = $this->makeQueryArray('tt_content', $id, 'AND colPos='.intval($key).$showHidden.$showLanguage);
00635                                         $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
00636                                         $c = 0;
00637                                         $rowArr = $this->getResult($result);
00638                                         $rowOut = '';
00639 
00640                                                 // If it turns out that there are not content elements in the column, then display a big button which links directly to the wizard script:
00641                                         if ($this->doEdit && $this->option_showBigButtons && !intval($key) && !$GLOBALS['TYPO3_DB']->sql_num_rows($result))     {
00642                                                 $onClick="window.location.href='db_new_content_el.php?id=".$id.'&colPos='.intval($key).'&sys_language_uid='.$lP.'&uid_pid='.$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';";
00643                                                 $theNewButton=$GLOBALS['SOBE']->doc->t3Button($onClick,$GLOBALS['LANG']->getLL('newPageContent'));
00644                                                 $theNewButton='<img src="clear.gif" width="1" height="5" alt="" /><br />'.$theNewButton;
00645                                         } else $theNewButton='';
00646 
00647                                                 // Traverse any selected elements:
00648                                         foreach($rowArr as $rKey => $row)       {
00649                                                 t3lib_BEfunc::workspaceOL('tt_content', $row);
00650 
00651                                                 if ((int)$row['t3ver_state']!=2)        {
00652 
00653                                                         $c++;
00654                                                         $editUidList.=$row['uid'].',';
00655                                                         $isRTE=$RTE && $this->isRTEforField('tt_content',$row,'bodytext');
00656 
00657                                                                 // Create row output:
00658                                                         $rowOut.='
00659                                                                 <tr>
00660                                                                         <td></td>
00661                                                                         <td valign="top">'.$this->tt_content_drawHeader($row).'</td>
00662                                                                         <td>&nbsp;</td>
00663                                                                         <td'.($row['_ORIG_uid'] ? ' class="ver-element"' :'').' valign="top">'.$this->tt_content_drawItem($row,$isRTE).'</td>
00664                                                                 </tr>';
00665 
00666                                                                 // If the element was not the last element, add a divider line:
00667                                                         if ($c != $GLOBALS['TYPO3_DB']->sql_num_rows($result))  {
00668                                                                 $rowOut.='
00669                                                                 <tr>
00670                                                                         <td></td>
00671                                                                         <td colspan="3"><img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/stiblet_medium2.gif','width="468" height="1"').' class="c-divider" alt="" /></td>
00672                                                                 </tr>';
00673                                                         }
00674                                                 } else { unset($rowArr[$rKey]); }
00675                                         }
00676 
00677                                                 // Add spacer between sections in the vertical list
00678                                         if ($counter)   {
00679                                                 $out.='
00680                                                         <tr>
00681                                                                 <td></td>
00682                                                                 <td colspan="3"><br /><br /><br /><br /></td>
00683                                                         </tr>';
00684                                         }
00685 
00686                                                 // Add section header:
00687                                         $newP = $this->newContentElementOnClick($id,$key,$this->tt_contentConfig['sys_language_uid']);
00688                                         $out.='
00689 
00690                                                 <!-- Column header: -->
00691                                                 <tr>
00692                                                         <td></td>
00693                                                         <td valign="top" colspan="3">'.
00694                                                                 $this->tt_content_drawColHeader(t3lib_BEfunc::getProcessedValue('tt_content','colPos',$key), ($this->doEdit&&count($rowArr)?'&edit[tt_content]['.$editUidList.']=edit'.$pageTitleParamForAltDoc:''), $newP).
00695                                                                 $theNewButton.
00696                                                                 '<br /></td>
00697                                                 </tr>';
00698 
00699                                                 // Finally, add the content from the records in this column:
00700                                         $out.=$rowOut;
00701                                 }
00702 
00703                                         // Finally, wrap all table rows in one, big table:
00704                                 $out = '
00705                                         <table border="0" cellpadding="0" cellspacing="0" width="400" class="typo3-page-columnsMode">
00706                                                 '.$out.'
00707                                         </table>';
00708 
00709                                         // CSH:
00710                                 $out.= t3lib_BEfunc::cshItem($this->descrTable,'columns_single',$GLOBALS['BACK_PATH']);
00711                         } else {
00712                                 $out = '<br/><br/>'.$GLOBALS['SOBE']->doc->icons(1).'Sorry, you cannot view a single language in this localization mode (Default Language Binding is enabled)<br/><br/>';
00713                         }
00714                 }
00715 
00716 
00717                         // Add the big buttons to page:
00718                 if ($this->option_showBigButtons)       {
00719                         $bArray=array();
00720 
00721                         if (!$GLOBALS['SOBE']->current_sys_language)    {
00722                                 if ($this->ext_CALC_PERMS&2)    $bArray[0]=$GLOBALS['SOBE']->doc->t3Button(t3lib_BEfunc::editOnClick('&edit[pages]['.$id."]=edit",$this->backPath,''),$GLOBALS['LANG']->getLL('editPageProperties'));
00723                         } else {
00724                                 if ($this->doEdit && $GLOBALS['BE_USER']->check('tables_modify','pages_language_overlay'))      {
00725                                         list($languageOverlayRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay','pid',$id,'AND sys_language_uid='.intval($GLOBALS['SOBE']->current_sys_language));
00726                                         $bArray[0]=$GLOBALS['SOBE']->doc->t3Button(t3lib_BEfunc::editOnClick('&edit[pages_language_overlay]['.$languageOverlayRecord['uid']."]=edit",$this->backPath,''),$GLOBALS['LANG']->getLL('editPageProperties_curLang'));
00727                                 }
00728                         }
00729                         if ($this->ext_CALC_PERMS&4 || $this->ext_CALC_PERMS&2) $bArray[1]=$GLOBALS['SOBE']->doc->t3Button("window.location.href='".$this->backPath."move_el.php?table=pages&uid=".$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';",$GLOBALS['LANG']->getLL('move_page'));
00730                         if ($this->ext_CALC_PERMS&8)    $bArray[2]=$GLOBALS['SOBE']->doc->t3Button("window.location.href='".$this->backPath."db_new.php?id=".$id.'&pagesOnly=1&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';",$GLOBALS['LANG']->getLL('newPage2'));
00731                         if ($this->doEdit && $this->ext_function==1) $bArray[3]=$GLOBALS['SOBE']->doc->t3Button("window.location.href='db_new_content_el.php?id=".$id.'&sys_language_uid='.$GLOBALS['SOBE']->current_sys_language.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';",$GLOBALS['LANG']->getLL('newPageContent2'));
00732                         $out = '
00733                                 <table border="0" cellpadding="4" cellspacing="0" class="typo3-page-buttons">
00734                                         <tr>
00735                                                 <td>'.implode('</td>
00736                                                 <td>',$bArray).'</td>
00737                                         </tr>
00738                                 </table>
00739                                 <img src="clear.gif" width="1" height="5" alt="" /><br />
00740                                 '.t3lib_BEfunc::cshItem($this->descrTable,'button_panel',$GLOBALS['BACK_PATH']).        // CSH
00741                                 $out;
00742                 }
00743 
00744                         // Return content:
00745                 return $out;
00746         }
00747 
00754         function getTable_fe_users($id) {
00755 
00756                 $this->addElement_tdParams=array(
00757                         'username'=>' nowrap="nowrap"',
00758                         'password'=>' nowrap="nowrap"',
00759                         'usergroup'=>' nowrap="nowrap"',
00760                         'name'=>' nowrap="nowrap"',
00761                         'address'=>' nowrap="nowrap"',
00762                         'zip'=>' nowrap="nowrap"',
00763                         'city'=>' nowrap="nowrap"',
00764                         'email'=>' nowrap="nowrap"',
00765                         'telephone'=>' nowrap="nowrap"'
00766                 );
00767                 $fList = 'username,password,usergroup,name,email,telephone,address,zip,city';
00768                 $out = $this->makeOrdinaryList('fe_users',$id, $fList, 1);
00769                 $this->addElement_tdParams=array();
00770                 return $out;
00771         }
00772 
00780         function getTable_sys_note($id) {
00781                 global $TCA;
00782 
00783                 if (!t3lib_extMgm::isLoaded('sys_note'))        return '';
00784 
00785                         // INIT:
00786                 $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
00787                 $tree = $this->getTreeObject($id,intval($GLOBALS['SOBE']->MOD_SETTINGS['pages_levels']),$perms_clause);
00788 
00789                 $this->itemLabels =array();
00790                 foreach($TCA['sys_note']['columns'] as $name => $val)   {
00791                         $this->itemLabels[$name]=$GLOBALS['LANG']->sL($val['label']);
00792                 }
00793 
00794                         // If page ids were found, select all sys_notes from the page ids:
00795                 $out='';
00796                 if (count($tree->ids))          {
00797                         $delClause = t3lib_BEfunc::deleteClause('sys_note').t3lib_BEfunc::versioningPlaceholderClause('sys_note');
00798                         $result = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_note', 'pid IN ('.implode(',',$tree->ids).') AND (personal=0 OR cruser='.intval($GLOBALS['BE_USER']->user['uid']).')'.$delClause);
00799                         $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
00800 
00801                                 // If sys_notes were found, render them:
00802                         if ($dbCount)   {
00803                                 $this->fieldArray = explode(',','__cmds__,info,note');
00804 
00805                                         // header line is drawn
00806                                 $theData = Array();
00807                                 $theData['__cmds__'] ='';
00808                                 $theData['info'] = '<b>Info</b><br /><img src="clear.gif" height="1" width="220" alt="" />';
00809                                 $theData['note'] = '<b>Note</b>';
00810                                 $out.=$this->addelement(1,'',$theData,' class="c-headLine"',20);
00811 
00812                                         // half line is drawn
00813                                 $theData = Array();
00814                                 $theData['info'] = $this->widthGif;
00815                                 $out.=$this->addelement(0,'',$theData);
00816 
00817                                 $this->no_noWrap=1;
00818 
00819                                         // Items
00820                                 $this->eCounter=$this->firstElementNumber;
00821                                 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))   {
00822                                         t3lib_BEfunc::workspaceOL('sys_note', $row);
00823 
00824                                         list($flag,$code) = $this->fwd_rwd_nav();
00825                                         $out.=$code;
00826                                         if ($flag)      {
00827                                                 $color = Array (
00828                                                         0 => '',                // No category
00829                                                         1 => ' class="bgColor4"',               // Instructions
00830                                                         2 => ' class="bgColor2"',               // Template
00831                                                         3 => '',                // Notes
00832                                                         4 => ' class="bgColor5"'                // To-do
00833                                                 );
00834                                                 $tdparams = $color[$row['category']];
00835                                                 $info = Array();;
00836                                                 $theData = Array();
00837                                                 $this->getProcessedValue('sys_note','subject,category,author,email,personal',$row,$info);
00838                                                 $cont=implode('<br />',$info);
00839                                                 $head = '<b>Page:</b> '.t3lib_BEfunc::getRecordPath($row['pid'],$perms_clause,10).'<br />';
00840 
00841                                                 $theData['__cmds__']= $this->getIcon('sys_note',$row);
00842                                                 $theData['info'] = $head.$cont;
00843                                                 $theData['note'] = nl2br($row['message']);
00844 
00845                                                 $out.=$this->addelement(1,'',$theData,$tdparams,20);
00846 
00847 
00848                                                         // half line is drawn
00849                                                 $theData = Array();
00850                                                 $theData['info'] = $this->widthGif;
00851                                                 $out.=$this->addelement(0,'',$theData);
00852                                         }
00853                                         $this->eCounter++;
00854                                 }
00855 
00856                                         // Wrap it all in a table:
00857                                 $out='
00858                                         <table border="0" cellpadding="1" cellspacing="2" width="480" class="typo3-page-sysnote">
00859                                                 '.$out.'
00860                                         </table>';
00861                         }
00862                 }
00863                 return $out;
00864         }
00865 
00873         function getTable_tt_board($id) {
00874 
00875                         // Initialize:
00876                 $delClause = t3lib_BEfunc::deleteClause('tt_board').t3lib_BEfunc::versioningPlaceholderClause('tt_board');
00877                 $queryParts = $this->makeQueryArray('tt_board', $id, 'AND parent=0');
00878                 $this->setTotalItems($queryParts);
00879                 $dbCount = 0;
00880 
00881                         // If items were selected, make query:
00882                 if ($this->totalItems)  {
00883                         $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
00884                         $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
00885                 }
00886 
00887                         // If results came out of that, render the list:
00888                 $out='';
00889                 if ($dbCount)   {
00890 
00891                                 // Setting fields to display first:
00892                         if ($GLOBALS['SOBE']->MOD_SETTINGS['tt_board']=='expand')       {
00893                                 $this->fieldArray = explode(',','subject,author,date,age');
00894                         } else {
00895                                 $this->fieldArray = explode(',','subject,author,date,age,replys');
00896                         }
00897 
00898                                 // Header line is drawn
00899                         $theData = Array();
00900                         $theData['subject'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_subject',1).'</b>';
00901                         $theData['author'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_author',1).'</b>';
00902                         $theData['date'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_date',1).'</b>';
00903                         $theData['age'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_age',1).'</b>';
00904                         if ($GLOBALS['SOBE']->MOD_SETTINGS['tt_board']!='expand') {
00905                                 $theData['replys'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_RE',1).'</b>';
00906                         }
00907                         $out.=$this->addelement(1,'',$theData,' class="c-headLine"',20);
00908 
00909                                 // half line is drawn
00910                         $theData = Array();
00911                         $theData['subject'] = $this->widthGif;
00912                         $out.=$this->addelement(0,'',$theData);
00913 
00914                                 // Items
00915                         $this->eCounter=$this->firstElementNumber;
00916                         while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))   {
00917                                 t3lib_BEfunc::workspaceOL('tt_board', $row);
00918 
00919                                 list($flag,$code) = $this->fwd_rwd_nav();
00920                                 $out.=$code;
00921 
00922                                 if ($flag)      {
00923 
00924                                         $theRows = Array();
00925                                         $theRows = $this->tt_board_getTree ($theRows,$row['uid'],$id,$delClause,'');
00926                                         $out.=$this->tt_board_drawItem('tt_board',$row,count($theRows));
00927 
00928                                         if ($GLOBALS['SOBE']->MOD_SETTINGS['tt_board']=='expand')       {
00929                                                 reset($theRows);
00930                                                 while(list($n,$sRow)=each($theRows))    {
00931                                                         $out.=$this->tt_board_drawItem('tt_board',$sRow,0);
00932                                                 }
00933                                         }
00934                                 }
00935                                 $this->eCounter++;
00936                         }
00937 
00938                                 // Wrap it all in a table:
00939                         $out='
00940                                 <table border="0" cellpadding="0" cellspacing="0" class="typo3-page-listTTboard">
00941                                         '.$out.'
00942                                 </table>';
00943                 }
00944 
00945                 return $out;
00946         }
00947 
00955         function getTable_tt_address($id)       {
00956 
00957                         // Define fieldlist to show:
00958                 switch($GLOBALS['SOBE']->MOD_SETTINGS['tt_address'])    {
00959                         case 1:
00960                                 $icon = 0;
00961                                 $fList = 'name,address,zip,city,country';
00962                         break;
00963                         case 2:
00964                                 $icon = 1;
00965                                 $fList = 'name;title;email;company,image';
00966                         break;
00967                         default:
00968                                 $icon = 0;
00969                                 $fList = 'name,email,www,phone,fax,mobile';
00970                         break;
00971                 }
00972 
00973                         // Create listing
00974                 $out = $this->makeOrdinaryList('tt_address',$id, $fList, $icon);
00975                 return $out;
00976         }
00977 
00985         function getTable_tt_links($id) {
00986 
00987                         // Define fieldlist to show:
00988                 switch($GLOBALS['SOBE']->MOD_SETTINGS['tt_links'])      {
00989                         case 1:
00990                                 $fList = 'title,hidden,url';
00991                         break;
00992                         case 2:
00993                                 $fList = 'title;url,note2';
00994                         break;
00995                         default:
00996                                 $fList = 'title;url,note';
00997                         break;
00998                 }
00999 
01000                 $out = $this->makeOrdinaryList('tt_links',$id, $fList,1);
01001                 return $out;
01002         }
01003 
01011         function getTable_tt_guest($id) {
01012 
01013                         // Define fieldlist to show:
01014                 $fList = 'title;cr_name;cr_email,note';
01015                 $out = $this->makeOrdinaryList('tt_guest',$id, $fList, 1);
01016                 return $out;
01017         }
01018 
01026         function getTable_tt_news($id)  {
01027 
01028                 $this->addElement_tdParams=array(
01029                         'title'=>' nowrap="nowrap"',
01030                         'datetime'=>' nowrap="nowrap"',
01031                         'starttime'=>' nowrap="nowrap"',
01032                         'author'=>' nowrap="nowrap"'
01033                 );
01034                 $fList = 'title,author,author_email,datetime,starttime,category,image';
01035                 $out = $this->makeOrdinaryList('tt_news',$id, $fList, 1);
01036                 $this->addElement_tdParams=array();
01037                 return $out;
01038         }
01039 
01047         function getTable_tt_calender($id)      {
01048 
01049                 $type=$GLOBALS['SOBE']->MOD_SETTINGS['tt_calender'];
01050                 switch($type)   {
01051                         case 'date':
01052                                         // Date default
01053                                 $fList = 'date,title';
01054                                 $icon=0;
01055                                 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=0');
01056                                 return $out;
01057                         break;
01058                         case 'date_ext':
01059                                         // Date extended
01060                                 $fList = 'title;date;time;datetext;link,note';
01061                                 $icon=1;
01062                                 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=0');
01063                                 return $out;
01064                         break;
01065                         case 'todo':
01066                                         // Todo default
01067                                 $fList = 'title,complete,priority,date';
01068                                 $icon=0;
01069                                 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=1');
01070                                 return $out;
01071                         break;
01072                         case 'todo_ext':
01073                                         // Todo extended
01074                                 $fList = 'title;complete;priority;date;workgroup;responsible;category,note';
01075                                 $icon=1;
01076                                 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=1');
01077                                 return $out;
01078                         break;
01079                         default:
01080                                         // Overview, both todo and calender
01081                                 $fList = 'title,date,time,week';
01082                                 $icon=1;
01083                                 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=0');
01084                                 $out.= $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=1');
01085                                 return $out;
01086                         break;
01087                 }
01088         }
01089 
01097         function getTable_tt_products($id)      {
01098 
01099                 $type = $GLOBALS['SOBE']->MOD_SETTINGS['tt_products'];
01100                 switch($type)   {
01101                         case 'ext':
01102                                 $fList = 'title;itemnumber;price;price2;inStock;category,image,note';
01103                                 $icon=1;
01104                                 $out = $this->makeOrdinaryList('tt_products',$id, $fList, $icon);
01105                         break;
01106                         default:
01107                                 $fList = 'title,itemnumber,price,category,image';
01108                                 $icon=1;
01109                                 $out = $this->makeOrdinaryList('tt_products',$id, $fList, $icon);
01110                         break;
01111                 }
01112 
01113                 return $out;
01114         }
01115 
01116 
01117 
01118 
01119 
01120 
01121 
01122 
01123 
01124 
01125 
01126 
01127         /**********************************
01128          *
01129          * Generic listing of items
01130          *
01131          **********************************/
01132 
01143         function makeOrdinaryList($table, $id, $fList, $icon=0, $addWhere='')   {
01144                 global $TCA;
01145 
01146                         // Initialize:
01147                 $out = '';
01148                 $queryParts = $this->makeQueryArray($table, $id, $addWhere);
01149                 $this->setTotalItems($queryParts);
01150                 $dbCount = 0;
01151 
01152                         // Make query for records if there were any records found in the count operation:
01153                 if ($this->totalItems)  {
01154                         $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
01155                         $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
01156                 }
01157 
01158                         // If records were found, render the list:
01159                 $out = '';