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