00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00115 class tx_cms_layout extends recordList {
00116
00117
00118 var $stat_select_field='page_id';
00119 var $stat_codes=array();
00120
00121
00122 var $pI_showUser=0;
00123 var $pI_showStat=1;
00124 var $nextThree = 3;
00125 var $pages_noEditColumns=0;
00126 var $option_showBigButtons=1;
00127 var $option_newWizard=1;
00128 var $ext_function=0;
00129 var $doEdit=1;
00130 var $agePrefixes = ' min| hrs| days| yrs';
00131 var $externalTables = array();
00132 var $descrTable;
00133 var $defLangBinding=FALSE;
00134
00135
00136 var $tt_contentConfig = Array (
00137 'showInfo' => 1,
00138 'showCommands' => 1,
00139 'showCommands_info' => 1,
00140 'single' => 1,
00141 'showSingleCol' => 0,
00142 'languageCols' => 0,
00143 'languageMode' => 0,
00144 'languageColsPointer' => 0,
00145 'showHidden' => 1,
00146 'sys_language_uid' => 0,
00147 'cols' => '1,0,2,3'
00148 );
00149
00150
00151 var $allowedTableNames=array();
00152 var $activeTables = array();
00153 var $tt_contentData = Array(
00154 'nextThree' => Array(),
00155 'prev' => Array(),
00156 'next' => Array()
00157 );
00158 var $CType_labels=array();
00159 var $itemLabels=array();
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00180 function getTable($table,$id) {
00181
00182
00183 t3lib_div::loadTCA($table);
00184
00185 if (isset($this->externalTables[$table])) {
00186 $fList = $this->externalTables[$table][0]['fList'];
00187 $icon = $this->externalTables[$table][0]['icon'];
00188
00189
00190 $out = $this->makeOrdinaryList($table, $id, $fList, $icon);
00191 return $out;
00192 } else {
00193
00194
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
00244 $out='';
00245 $delClause = t3lib_BEfunc::deleteClause('pages').' AND '.$GLOBALS['BE_USER']->getPagePermsClause(1);
00246
00247
00248 if (!$id) {
00249 $row = $GLOBALS['SOBE']->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 }
00254
00255
00256 if (is_array($row)) {
00257
00258
00259 $pKey = $GLOBALS['SOBE']->MOD_SETTINGS['function']=='tx_cms_webinfo_hits' ? 'hits' : $GLOBALS['SOBE']->MOD_SETTINGS['pages'];
00260 switch($pKey) {
00261 case 'hits':
00262 $this->fieldArray = explode(',','title,'.implode(',',$this->stat_codes));
00263 break;
00264 case 1:
00265 $this->cleanTableNames();
00266 $tableNames=$this->allowedTableNames;
00267 $this->fieldArray = explode(',','title,uid,'.implode(',',array_keys($tableNames)));
00268 break;
00269 case 2:
00270 $this->fieldArray = explode(',','title,uid,lastUpdated,newUntil,no_cache,cache_timeout,php_tree_stop,TSconfig,storage_pid,is_siteroot,fe_login_mode');
00271 break;
00272 default:
00273 $this->fieldArray = explode(',','title,uid,alias,starttime,endtime,fe_group,target,url,shortcut,shortcut_mode');
00274 break;
00275 }
00276
00277
00278 $depth=intval($GLOBALS['SOBE']->MOD_SETTINGS['pages_levels']);
00279
00280
00281 $theData = Array();
00282 $theData['subject'] = $this->widthGif;
00283 $out.=$this->addelement(0,'',$theData);
00284
00285
00286 $this->no_noWrap=0;
00287 $this->oddColumnsTDParams=' class="bgColor3-20"';
00288
00289
00290 $this->eCounter=$this->firstElementNumber;
00291
00292
00293 list($flag,$code) = $this->fwd_rwd_nav();
00294 $out.=$code;
00295 $editUids=array();
00296 if ($flag) {
00297
00298
00299 $theRows = Array();
00300 $theRows = $this->pages_getTree($theRows,$row['uid'],$delClause,'',$depth);
00301 if ($GLOBALS['BE_USER']->doesUserHaveAccess($row,2)) $editUids[]=$row['uid'];
00302 $out.=$this->pages_drawItem($row,$this->fieldArray);
00303
00304
00305 foreach($theRows as $n => $sRow) {
00306 if ($GLOBALS['BE_USER']->doesUserHaveAccess($sRow,2)) $editUids[]=$sRow['uid'];
00307 $out.=$this->pages_drawItem($sRow,$this->fieldArray);
00308 }
00309 $this->eCounter++;
00310 }
00311
00312
00313 $theData = Array();
00314 $editIdList = implode(',', $editUids);
00315
00316
00317 foreach($this->fieldArray as $field) {
00318 if ($editIdList && isset($TCA['pages']['columns'][$field]) && $field!='uid' && !$this->pages_noEditColumns) {
00319 $params='&edit[pages]['.$editIdList.']=edit&columnsOnly='.$field.'&disHelp=1';
00320 $iTitle = sprintf($GLOBALS['LANG']->getLL('editThisColumn'),ereg_replace(':$','',trim($GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('pages',$field)))));
00321 $eI= '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,'')).'">'.
00322 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.htmlspecialchars($iTitle).'" alt="" />'.
00323 '</a>';
00324 } else $eI='';
00325 switch($field) {
00326 case 'title':
00327 $theData[$field] = ' <b>'.$GLOBALS['LANG']->sL($TCA['pages']['columns'][$field]['label']).'</b>'.$eI;
00328 break;
00329 case 'uid':
00330 $theData[$field] = ' <b>ID:</b>';
00331 break;
00332 default:
00333 if (substr($field,0,6)=='table_') {
00334 $f2 = substr($field,6);
00335 if ($TCA[$f2]) {
00336 $theData[$field] = ' '.t3lib_iconWorks::getIconImage($f2,array(),$this->backPath,'title="'.$GLOBALS['LANG']->sL($TCA[$f2]['ctrl']['title'],1).'"');
00337 }
00338 } elseif (substr($field,0,5)=='HITS_') {
00339 $fParts = explode(':',substr($field,5));
00340 switch($fParts[0]) {
00341 case 'days':
00342 $timespan = mktime (0,0,0)+intval($fParts[1])*3600*24;
00343 $theData[$field]=' '.date('d',$timespan);
00344 break;
00345 default:
00346 $theData[$field] = '';
00347 break;
00348 }
00349 } else {
00350 $theData[$field] = ' <b>'.$GLOBALS['LANG']->sL($TCA['pages']['columns'][$field]['label'],1).'</b>'.$eI;
00351 }
00352 break;
00353 }
00354 }
00355
00356
00357 $this->oddColumnsTDParams = '';
00358
00359
00360 $out = t3lib_BEfunc::cshItem($this->descrTable,'func_'.$pKey,$GLOBALS['BACK_PATH']).
00361 '
00362 <table border="0" cellpadding="0" cellspacing="0" class="typo3-page-pages">
00363 '.$this->addelement(1,'',$theData,' class="c-headLine"',20).
00364 $out.'
00365 </table>';
00366 }
00367 $this->oddColumnsTDParams = '';
00368 return $out;
00369 }
00370
00377 function getTable_tt_content($id) {
00378 global $TCA;
00379
00380 $this->initializeLanguages();
00381
00382
00383 $RTE = $GLOBALS['BE_USER']->isRTE();
00384 $lMarg=1;
00385 $showHidden = $this->tt_contentConfig['showHidden']?'':t3lib_BEfunc::BEenableFields('tt_content');
00386 $pageTitleParamForAltDoc='&recTitle='.rawurlencode(t3lib_BEfunc::getRecordTitle('pages',t3lib_BEfunc::getRecord('pages',$id),1));
00387
00388
00389 $this->CType_labels =array();
00390 foreach($TCA['tt_content']['columns']['CType']['config']['items'] as $val) {
00391 $this->CType_labels[$val[1]]=$GLOBALS['LANG']->sL($val[0]);
00392 }
00393 $this->itemLabels =array();
00394 foreach($TCA['tt_content']['columns'] as $name => $val) {
00395 $this->itemLabels[$name]=$GLOBALS['LANG']->sL($val['label']);
00396 }
00397
00398
00399
00400 if (!$this->tt_contentConfig['single']) {
00401
00402
00403 $langList = $this->tt_contentConfig['sys_language_uid'];
00404 if ($this->tt_contentConfig['languageMode']) {
00405 if ($this->tt_contentConfig['languageColsPointer']) {
00406 $langList='0,'.$this->tt_contentConfig['languageColsPointer'];
00407 } else {
00408 $langList=implode(',',array_keys($this->tt_contentConfig['languageCols']));
00409 }
00410 $languageColumn = array();
00411 }
00412 $langListArr = explode(',',$langList);
00413 $defLanguageCount = array();
00414 $defLangBinding = array();
00415
00416
00417 foreach($langListArr as $lP) {
00418 $showLanguage = $this->defLangBinding && $lP==0 ? ' AND sys_language_uid IN (0,-1)' : ' AND sys_language_uid='.$lP;
00419 $cList = explode(',',$this->tt_contentConfig['cols']);
00420 $content = array();
00421 $head = array();
00422
00423
00424 foreach($cList as $key) {
00425 if (!$lP) $defLanguageCount[$key] = array();
00426
00427
00428 $queryParts = $this->makeQueryArray('tt_content', $id, 'AND colPos='.intval($key).$showHidden.$showLanguage);
00429 $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
00430
00431
00432 if ($this->doEdit && $this->option_showBigButtons && !intval($key) && !$GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
00433 $onClick = "document.location='db_new_content_el.php?id=".$id.'&colPos='.intval($key).'&sys_language_uid='.$lP.'&uid_pid='.$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';";
00434 $theNewButton = $GLOBALS['SOBE']->doc->t3Button($onClick,$GLOBALS['LANG']->getLL('newPageContent'));
00435 $content[$key].= '<img src="clear.gif" width="1" height="5" alt="" /><br />'.$theNewButton;
00436 }
00437
00438
00439 $rowArr = $this->getResult($result);
00440
00441 foreach($rowArr as $row) {
00442 $singleElementHTML = '';
00443 if (!$lP) $defLanguageCount[$key][] = $row['uid'];
00444
00445 $editUidList.= $row['uid'].',';
00446 $singleElementHTML.= $this->tt_content_drawHeader($row,$this->tt_contentConfig['showInfo']?15:5, $this->defLangBinding && $lP>0, TRUE);
00447
00448 $isRTE = $RTE && $this->isRTEforField('tt_content',$row,'bodytext');
00449 $singleElementHTML.= $this->tt_content_drawItem($row,$isRTE);
00450
00451 if ($this->defLangBinding && $this->tt_contentConfig['languageMode']) {
00452 $defLangBinding[$key][$lP][$row[($lP ? 'l18n_parent' : 'uid')]] = $singleElementHTML;
00453 } else {
00454 $content[$key].= $singleElementHTML;
00455 }
00456 }
00457
00458
00459 $newP = $this->newContentElementOnClick($id,$key,$lP);
00460 $head[$key].= $this->tt_content_drawColHeader(t3lib_BEfunc::getProcessedValue('tt_content','colPos',$key), ($this->doEdit&&count($rowArr)?'&edit[tt_content]['.$editUidList.']=edit'.$pageTitleParamForAltDoc:''), $newP);
00461 $editUidList = '';
00462 }
00463
00464
00465 $out='';
00466 foreach($cList as $k => $key) {
00467 if (!$k) {
00468 $out.= '
00469 <td><img src="clear.gif" width="'.$lMarg.'" height="1" alt="" /></td>';
00470 } else {
00471 $out.= '
00472 <td><img src="clear.gif" width="4" height="1" alt="" /></td>
00473 <td bgcolor="black"><img src="clear.gif" width="1" height="1" alt="" /></td>
00474 <td><img src="clear.gif" width="4" height="1" alt="" /></td>';
00475 }
00476 $out.= '
00477 <td valign="top">'.$head[$key].$content[$key].'</td>';
00478
00479
00480 if ($this->tt_contentConfig['languageMode']) {
00481 $languageColumn[$key][$lP] = $head[$key].$content[$key];
00482 if (!$this->defLangBinding) {
00483 $languageColumn[$key][$lP].='<br /><br />'.$this->newLanguageButton($this->getNonTranslatedTTcontentUids($defLanguageCount[$key],$id,$lP),$lP);
00484 }
00485 }
00486 }
00487
00488
00489 $out = '
00490 <table border="0" cellpadding="0" cellspacing="0" width="480" class="typo3-page-cols">
00491 <tr>'.$out.'
00492 </tr>
00493 </table>';
00494
00495
00496 $out.= t3lib_BEfunc::cshItem($this->descrTable,'columns_multi',$GLOBALS['BACK_PATH']);
00497 }
00498
00499
00500
00501 if ($this->tt_contentConfig['languageMode']) {
00502
00503
00504 $languageSelector = $this->languageSelector($id);
00505
00506
00507 $out='';
00508
00509 $midSep = '
00510 <td><img src="clear.gif" width="4" height="1" alt="" /></td>
00511 <td bgcolor="black"><img src="clear.gif" width="1" height="1" alt="" /></td>
00512 <td><img src="clear.gif" width="4" height="1" alt="" /></td>';
00513
00514
00515 $cCont=array();
00516 $sCont=array();
00517 foreach($langListArr as $lP) {
00518
00519
00520 $cCont[$lP]='
00521 <td valign="top" align="center" class="bgColor6"><strong>'.htmlspecialchars($this->tt_contentConfig['languageCols'][$lP]).'</strong></td>';
00522
00523
00524 $viewLink = '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($this->id,$this->backPath,t3lib_BEfunc::BEgetRootLine($this->id),'','','&L='.$lP)).'">'.
00525 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom.gif','width="12" height="12"').' class="absmiddle" title="" alt="" />'.
00526 '</a>';
00527
00528
00529 if ($lP) {
00530
00531 list($lpRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay','pid',$id,'AND sys_language_uid='.intval($lP));
00532 $params='&edit[pages_language_overlay]['.$lpRecord['uid'].']=edit&overrideVals[pages_language_overlay][sys_language_uid]='.$lP;
00533 $lPLabel = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon(t3lib_iconWorks::getIconImage('pages_language_overlay',$lpRecord,$this->backPath,' class="absmiddle"'),'pages_language_overlay',$lpRecord['uid']).
00534 $viewLink.
00535 ($GLOBALS['BE_USER']->check('tables_modify','pages_language_overlay') ? '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath)).'">'.
00536 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('edit',1).'" class="absmiddle" alt="" />'.
00537 '</a>' : '').
00538 htmlspecialchars(t3lib_div::fixed_lgd_cs($lpRecord['title'],20));
00539 } else {
00540 $lPLabel = $viewLink;
00541 }
00542 $sCont[$lP]='
00543 <td nowrap="nowrap">'.$lPLabel.'</td>';
00544 }
00545
00546 $out.='
00547 <tr>'.implode($midSep,$cCont).'
00548 </tr>';
00549 $out.='
00550 <tr>'.implode($midSep,$sCont).'
00551 </tr>';
00552
00553
00554 foreach($languageColumn as $cKey => $cCont) {
00555 $out.='
00556 <tr>
00557 <td valign="top">'.implode('</td>'.$midSep.'
00558 <td valign="top">',$cCont).'</td>
00559 </tr>';
00560
00561 if ($this->defLangBinding) {
00562
00563 foreach($defLanguageCount[$cKey] as $defUid) {
00564 $cCont=array();
00565 foreach($langListArr as $lP) {
00566 $cCont[] = $defLangBinding[$cKey][$lP][$defUid].
00567 '<br/>'.$this->newLanguageButton($this->getNonTranslatedTTcontentUids(array($defUid),$id,$lP),$lP);
00568 }
00569 $out.='
00570 <tr>
00571 <td valign="top">'.implode('</td>'.$midSep.'
00572 <td valign="top">',$cCont).'</td>
00573 </tr>';
00574 }
00575
00576
00577 $cCont=array();
00578 foreach($langListArr as $lP) {
00579 $cCont[] = ' ';
00580 }
00581 $out.='
00582 <tr>
00583 <td valign="top">'.implode('</td>'.$midSep.'
00584 <td valign="top">',$cCont).'</td>
00585 </tr>';
00586 }
00587 }
00588
00589
00590 $out = $languageSelector.'
00591 <table border="0" cellpadding="0" cellspacing="0" width="480" class="typo3-page-langMode">
00592 '.$out.'
00593 </table>';
00594
00595
00596 $out.= t3lib_BEfunc::cshItem($this->descrTable,'language_list',$GLOBALS['BACK_PATH']);
00597 }
00598 } else {
00599 #debug('single column');
00600 if ($this->tt_contentConfig['sys_language_uid']==0 || !$this->defLangBinding) {
00601
00602
00603 $showLanguage = $this->defLangBinding && $this->tt_contentConfig['sys_language_uid']==0 ? ' AND sys_language_uid IN (0,-1)' : ' AND sys_language_uid='.$this->tt_contentConfig['sys_language_uid'];
00604
00605 $cList = explode(',',$this->tt_contentConfig['showSingleCol']);
00606 $content=array();
00607 $out='';
00608
00609
00610 $out.='
00611 <tr>
00612 <td><img src="clear.gif" width="'.$lMarg.'" height="1" alt="" /></td>
00613 <td valign="top"><img src="clear.gif" width="150" height="1" alt="" /></td>
00614 <td><img src="clear.gif" width="10" height="1" alt="" /></td>
00615 <td valign="top"><img src="clear.gif" width="300" height="1" alt="" /></td>
00616 </tr>';
00617
00618
00619 while(list($counter,$key)=each($cList)) {
00620
00621
00622 $queryParts = $this->makeQueryArray('tt_content', $id, 'AND colPos='.intval($key).$showHidden.$showLanguage);
00623 $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
00624 $c = 0;
00625 $rowArr = $this->getResult($result);
00626 $rowOut = '';
00627
00628
00629 if ($this->doEdit && $this->option_showBigButtons && !intval($key) && !$GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
00630 $onClick="document.location='db_new_content_el.php?id=".$id.'&colPos='.intval($key).'&sys_language_uid='.$lP.'&uid_pid='.$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';";
00631 $theNewButton=$GLOBALS['SOBE']->doc->t3Button($onClick,$GLOBALS['LANG']->getLL('newPageContent'));
00632 $theNewButton='<img src="clear.gif" width="1" height="5" alt="" /><br />'.$theNewButton;
00633 } else $theNewButton='';
00634
00635
00636 foreach($rowArr as $row) {
00637 $c++;
00638 $editUidList.=$row['uid'].',';
00639 $isRTE=$RTE && $this->isRTEforField('tt_content',$row,'bodytext');
00640
00641
00642 $rowOut.='
00643 <tr>
00644 <td></td>
00645 <td valign="top">'.$this->tt_content_drawHeader($row).'</td>
00646 <td></td>
00647 <td valign="top">'.$this->tt_content_drawItem($row,$isRTE).'</td>
00648 </tr>';
00649
00650
00651 if ($c != $GLOBALS['TYPO3_DB']->sql_num_rows($result)) {
00652 $rowOut.='
00653 <tr>
00654 <td></td>
00655 <td colspan="3"><img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/stiblet_medium2.gif','width="468" height="1"').' class="c-divider" alt="" /></td>
00656 </tr>';
00657 }
00658 }
00659
00660
00661 if ($counter) {
00662 $out.='
00663 <tr>
00664 <td></td>
00665 <td colspan="3"><br /><br /><br /><br /></td>
00666 </tr>';
00667 }
00668
00669
00670 $newP = $this->newContentElementOnClick($id,$key,$this->tt_contentConfig['sys_language_uid']);
00671 $out.='
00672
00673 <!-- Column header: -->
00674 <tr>
00675 <td></td>
00676 <td valign="top" colspan="3">'.
00677 $this->tt_content_drawColHeader(t3lib_BEfunc::getProcessedValue('tt_content','colPos',$key), ($this->doEdit&&count($rowArr)?'&edit[tt_content]['.$editUidList.']=edit'.$pageTitleParamForAltDoc:''), $newP).
00678 $theNewButton.
00679 '<br /></td>
00680 </tr>';
00681
00682
00683 $out.=$rowOut;
00684 }
00685
00686
00687 $out = '
00688 <table border="0" cellpadding="0" cellspacing="0" width="400" class="typo3-page-columnsMode">
00689 '.$out.'
00690 </table>';
00691
00692
00693 $out.= t3lib_BEfunc::cshItem($this->descrTable,'columns_single',$GLOBALS['BACK_PATH']);
00694 } else {
00695 $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/>';
00696 }
00697 }
00698
00699
00700
00701 if ($this->option_showBigButtons) {
00702 $bArray=array();
00703
00704 if (!$GLOBALS['SOBE']->current_sys_language) {
00705 if ($this->ext_CALC_PERMS&2) $bArray[0]=$GLOBALS['SOBE']->doc->t3Button(t3lib_BEfunc::editOnClick('&edit[pages]['.$id."]=edit",$this->backPath,''),$GLOBALS['LANG']->getLL('editPageTitle'));
00706 } else {
00707 if ($this->doEdit && $GLOBALS['BE_USER']->check('tables_modify','pages_language_overlay')) {
00708 list($languageOverlayRecord) = t3lib_BEfunc::getRecordsByField('pages_language_overlay','pid',$id,'AND sys_language_uid='.intval($GLOBALS['SOBE']->current_sys_language));
00709 $bArray[0]=$GLOBALS['SOBE']->doc->t3Button(t3lib_BEfunc::editOnClick('&edit[pages_language_overlay]['.$languageOverlayRecord['uid']."]=edit",$this->backPath,''),$GLOBALS['LANG']->getLL('editPageTitle_curLang'));
00710 }
00711 }
00712 if ($this->ext_CALC_PERMS&4 || $this->ext_CALC_PERMS&2) $bArray[1]=$GLOBALS['SOBE']->doc->t3Button("document.location='".$this->backPath."move_el.php?table=pages&uid=".$id.'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';",$GLOBALS['LANG']->getLL('move_page'));
00713 if ($this->ext_CALC_PERMS&8) $bArray[2]=$GLOBALS['SOBE']->doc->t3Button("document.location='".$this->backPath."db_new.php?id=".$id.'&pagesOnly=1&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))."';",$GLOBALS['LANG']->getLL('newPage2'));
00714 if ($this->doEdit && $this->ext_function==1) $bArray[3]=$GLOBALS['SOBE']->doc->t3Button("document.location='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'));
00715 $out = '
00716 <table border="0" cellpadding="4" cellspacing="0" class="typo3-page-buttons">
00717 <tr>
00718 <td>'.implode('</td>
00719 <td>',$bArray).'</td>
00720 </tr>
00721 </table>
00722 <img src="clear.gif" width="1" height="5" alt="" /><br />
00723 '.t3lib_BEfunc::cshItem($this->descrTable,'button_panel',$GLOBALS['BACK_PATH']).
00724 $out;
00725 }
00726
00727
00728 return $out;
00729 }
00730
00737 function getTable_fe_users($id) {
00738
00739 $this->addElement_tdParams=array(
00740 'username'=>' nowrap="nowrap"',
00741 'password'=>' nowrap="nowrap"',
00742 'usergroup'=>' nowrap="nowrap"',
00743 'name'=>' nowrap="nowrap"',
00744 'address'=>' nowrap="nowrap"',
00745 'zip'=>' nowrap="nowrap"',
00746 'city'=>' nowrap="nowrap"',
00747 'email'=>' nowrap="nowrap"',
00748 'telephone'=>' nowrap="nowrap"'
00749 );
00750 $fList = 'username,password,usergroup,name,email,telephone,address,zip,city';
00751 $out = $this->makeOrdinaryList('fe_users',$id, $fList, 1);
00752 $this->addElement_tdParams=array();
00753 return $out;
00754 }
00755
00763 function getTable_sys_note($id) {
00764 global $TCA;
00765
00766 if (!t3lib_extMgm::isLoaded('sys_note')) return '';
00767
00768
00769 $perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
00770 $tree = $this->getTreeObject($id,intval($GLOBALS['SOBE']->MOD_SETTINGS['pages_levels']),$perms_clause);
00771
00772 $this->itemLabels =array();
00773 foreach($TCA['sys_note']['columns'] as $name => $val) {
00774 $this->itemLabels[$name]=$GLOBALS['LANG']->sL($val['label']);
00775 }
00776
00777
00778 $out='';
00779 if (count($tree->ids)) {
00780 $delClause = t3lib_BEfunc::deleteClause('sys_note');
00781 $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);
00782 $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
00783
00784
00785 if ($dbCount) {
00786 $this->fieldArray = explode(',','__cmds__,info,note');
00787
00788
00789 $theData = Array();
00790 $theData['__cmds__'] ='';
00791 $theData['info'] = '<b>Info</b><br /><img src="clear.gif" height="1" width="220" alt="" />';
00792 $theData['note'] = '<b>Note</b>';
00793 $out.=$this->addelement(1,'',$theData,' class="c-headLine"',20);
00794
00795
00796 $theData = Array();
00797 $theData['info'] = $this->widthGif;
00798 $out.=$this->addelement(0,'',$theData);
00799
00800 $this->no_noWrap=1;
00801
00802
00803 $this->eCounter=$this->firstElementNumber;
00804 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
00805 list($flag,$code) = $this->fwd_rwd_nav();
00806 $out.=$code;
00807 if ($flag) {
00808 $color = Array (
00809 0 => '',
00810 1 => ' class="bgColor4"',
00811 2 => ' class="bgColor2"',
00812 3 => '',
00813 4 => ' class="bgColor5"'
00814 );
00815 $tdparams = $color[$row['category']];
00816 $info = Array();;
00817 $theData = Array();
00818 $this->getProcessedValue('sys_note','subject,category,author,email,personal',$row,$info);
00819 $cont=implode('<br />',$info);
00820 $head = '<b>Page:</b> '.t3lib_BEfunc::getRecordPath($row['pid'],$perms_clause,10).'<br />';
00821
00822 $theData['__cmds__']= $this->getIcon('sys_note',$row);
00823 $theData['info'] = $head.$cont;
00824 $theData['note'] = nl2br($row['message']);
00825
00826 $out.=$this->addelement(1,'',$theData,$tdparams,20);
00827
00828
00829
00830 $theData = Array();
00831 $theData['info'] = $this->widthGif;
00832 $out.=$this->addelement(0,'',$theData);
00833 }
00834 $this->eCounter++;
00835 }
00836
00837
00838 $out='
00839 <table border="0" cellpadding="1" cellspacing="2" width="480" class="typo3-page-sysnote">
00840 '.$out.'
00841 </table>';
00842 }
00843 }
00844 return $out;
00845 }
00846
00854 function getTable_tt_board($id) {
00855
00856
00857 $delClause = t3lib_BEfunc::deleteClause('tt_board');
00858 $queryParts = $this->makeQueryArray('tt_board', $id, 'AND parent=0');
00859 $this->setTotalItems($queryParts);
00860 $dbCount = 0;
00861
00862
00863 if ($this->totalItems) {
00864 $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
00865 $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
00866 }
00867
00868
00869 $out='';
00870 if ($dbCount) {
00871
00872
00873 if ($GLOBALS['SOBE']->MOD_SETTINGS['tt_board']=='expand') {
00874 $this->fieldArray = explode(',','subject,author,date,age');
00875 } else {
00876 $this->fieldArray = explode(',','subject,author,date,age,replys');
00877 }
00878
00879
00880 $theData = Array();
00881 $theData['subject'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_subject',1).'</b>';
00882 $theData['author'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_author',1).'</b>';
00883 $theData['date'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_date',1).'</b>';
00884 $theData['age'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_age',1).'</b>';
00885 if ($GLOBALS['SOBE']->MOD_SETTINGS['tt_board']!='expand') {
00886 $theData['replys'] = '<b>'.$GLOBALS['LANG']->getLL('tt_board_RE',1).'</b>';
00887 }
00888 $out.=$this->addelement(1,'',$theData,' class="c-headLine"',20);
00889
00890
00891 $theData = Array();
00892 $theData['subject'] = $this->widthGif;
00893 $out.=$this->addelement(0,'',$theData);
00894
00895
00896 $this->eCounter=$this->firstElementNumber;
00897 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
00898 list($flag,$code) = $this->fwd_rwd_nav();
00899 $out.=$code;
00900
00901 if ($flag) {
00902
00903 $theRows = Array();
00904 $theRows = $this->tt_board_getTree ($theRows,$row['uid'],$id,$delClause,'');
00905 $out.=$this->tt_board_drawItem('tt_board',$row,count($theRows));
00906
00907 if ($GLOBALS['SOBE']->MOD_SETTINGS['tt_board']=='expand') {
00908 reset($theRows);
00909 while(list($n,$sRow)=each($theRows)) {
00910 $out.=$this->tt_board_drawItem('tt_board',$sRow,0);
00911 }
00912 }
00913 }
00914 $this->eCounter++;
00915 }
00916
00917
00918 $out='
00919 <table border="0" cellpadding="0" cellspacing="0" class="typo3-page-listTTboard">
00920 '.$out.'
00921 </table>';
00922 }
00923
00924 return $out;
00925 }
00926
00934 function getTable_tt_address($id) {
00935
00936
00937 switch($GLOBALS['SOBE']->MOD_SETTINGS['tt_address']) {
00938 case 1:
00939 $icon = 0;
00940 $fList = 'name,address,zip,city,country';
00941 break;
00942 case 2:
00943 $icon = 1;
00944 $fList = 'name;title;email;company,image';
00945 break;
00946 default:
00947 $icon = 0;
00948 $fList = 'name,email,www,phone,fax,mobile';
00949 break;
00950 }
00951
00952
00953 $out = $this->makeOrdinaryList('tt_address',$id, $fList, $icon);
00954 return $out;
00955 }
00956
00964 function getTable_tt_links($id) {
00965
00966
00967 switch($GLOBALS['SOBE']->MOD_SETTINGS['tt_links']) {
00968 case 1:
00969 $fList = 'title,hidden,url';
00970 break;
00971 case 2:
00972 $fList = 'title;url,note2';
00973 break;
00974 default:
00975 $fList = 'title;url,note';
00976 break;
00977 }
00978
00979 $out = $this->makeOrdinaryList('tt_links',$id, $fList,1);
00980 return $out;
00981 }
00982
00990 function getTable_tt_guest($id) {
00991
00992
00993 $fList = 'title;cr_name;cr_email,note';
00994 $out = $this->makeOrdinaryList('tt_guest',$id, $fList, 1);
00995 return $out;
00996 }
00997
01005 function getTable_tt_news($id) {
01006
01007 $this->addElement_tdParams=array(
01008 'title'=>' nowrap="nowrap"',
01009 'datetime'=>' nowrap="nowrap"',
01010 'starttime'=>' nowrap="nowrap"',
01011 'author'=>' nowrap="nowrap"'
01012 );
01013 $fList = 'title,author,author_email,datetime,starttime,category,image';
01014 $out = $this->makeOrdinaryList('tt_news',$id, $fList, 1);
01015 $this->addElement_tdParams=array();
01016 return $out;
01017 }
01018
01026 function getTable_tt_calender($id) {
01027
01028 $type=$GLOBALS['SOBE']->MOD_SETTINGS['tt_calender'];
01029 switch($type) {
01030 case 'date':
01031
01032 $fList = 'date,title';
01033 $icon=0;
01034 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=0');
01035 return $out;
01036 break;
01037 case 'date_ext':
01038
01039 $fList = 'title;date;time;datetext;link,note';
01040 $icon=1;
01041 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=0');
01042 return $out;
01043 break;
01044 case 'todo':
01045
01046 $fList = 'title,complete,priority,date';
01047 $icon=0;
01048 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=1');
01049 return $out;
01050 break;
01051 case 'todo_ext':
01052
01053 $fList = 'title;complete;priority;date;workgroup;responsible;category,note';
01054 $icon=1;
01055 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=1');
01056 return $out;
01057 break;
01058 default:
01059
01060 $fList = 'title,date,time,week';
01061 $icon=1;
01062 $out = $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=0');
01063 $out.= $this->makeOrdinaryList('tt_calender',$id, $fList, $icon, ' AND type=1');
01064 return $out;
01065 break;
01066 }
01067 }
01068
01076 function getTable_tt_products($id) {
01077
01078 $type = $GLOBALS['SOBE']->MOD_SETTINGS['tt_products'];
01079 switch($type) {
01080 case 'ext':
01081 $fList = 'title;itemnumber;price;price2;inStock;category,image,note';
01082 $icon=1;
01083 $out = $this->makeOrdinaryList('tt_products',$id, $fList, $icon);
01084 break;
01085 default:
01086 $fList = 'title,itemnumber,price,category,image';
01087 $icon=1;
01088 $out = $this->makeOrdinaryList('tt_products',$id, $fList, $icon);
01089 break;
01090 }
01091
01092 return $out;
01093 }
01094
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01122 function makeOrdinaryList($table, $id, $fList, $icon=0, $addWhere='') {
01123 global $TCA;
01124
01125
01126 $out = '';
01127 $queryParts = $this->makeQueryArray($table, $id, $addWhere);
01128 $this->setTotalItems($queryParts);
01129 $dbCount = 0;
01130
01131
01132 if ($this->totalItems) {
01133 $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
01134 $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
01135 }
01136
01137
01138 $out = '';
01139 if ($dbCount) {
01140
01141
01142 $this->fieldArray = explode(',','__cmds__,'.$fList);
01143
01144
01145 $theData = array();
01146 $theData = $this->headerFields($this->fieldArray,$table,$theData);
01147 $out.= $this->addelement(1,'',$theData,' class="c-headLine"',15);
01148
01149
01150 $this->eCounter = $this->firstElementNumber;
01151 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
01152 list($flag,$code) = $this->fwd_rwd_nav();
01153 $out.= $code;
01154 if ($flag) {
01155 $params = '&edit['.$table.']['.$row['uid'].']=edit';
01156 $Nrow = array();
01157
01158
01159 if ($icon) {
01160 $Nrow['__cmds__']= $this->getIcon($table,$row);
01161 }
01162 if ($this->doEdit) {
01163 $Nrow['__cmds__'].= '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath)).'">'.
01164 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$GLOBALS['LANG']->getLL('edit',1).'"