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
00090 class localRecordList extends recordList {
00091
00092
00093 var $alternateBgColors=FALSE;
00094 var $allowedNewTables=array();
00095 var $newWizards=FALSE;
00096
00097 var $dontShowClipControlPanels=FALSE;
00098 var $showClipboard=FALSE;
00099 var $noControlPanels = FALSE;
00100 var $clickMenuEnabled = TRUE;
00101
00102
00103
00104
00105
00106 var $pageRow=array();
00107
00108 var $csvLines=array();
00109 var $csvOutput=FALSE;
00110
00111 var $clipObj;
00112 var $CBnames=array();
00113 var $duplicateStack=array();
00114
00115
00122 function writeTop($row) {
00123 global $LANG;
00124
00125
00126 $this->pageRow = $row;
00127 $this->counter++;
00128 $alttext = t3lib_BEfunc::getRecordIconAltText($row,'pages');
00129 $iconImg = t3lib_iconWorks::getIconImage('pages',$row,$this->backPath,'class="absmiddle" title="'.htmlspecialchars($alttext).'"');
00130 $titleCol = 'test';
00131 $this->fieldArray = Array($titleCol,'up');
00132
00133
00134
00135 $theData = Array();
00136 $theData[$titleCol] = $this->widthGif;
00137
00138
00139 $localCalcPerms = $GLOBALS['BE_USER']->calcPerms($row);
00140
00141 $theData['up']=array();
00142
00143
00144
00145 $theCtrlPanel =array();
00146
00147
00148 $theCtrlPanel[]='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($this->id,$this->backPath,t3lib_BEfunc::BEgetRootLine($this->id))).'">'.
00149 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom.gif','width="12" height="12"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPage',1).'" alt="" />'.
00150 '</a>';
00151
00152
00153 if ($localCalcPerms&2) {
00154
00155
00156 if ($this->id) {
00157 $params='&edit[pages]['.$row['uid'].']=edit';
00158 $theCtrlPanel[]='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'">'.
00159 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$LANG->getLL('editPage',1).'" alt="" />'.
00160 '</a>';
00161 }
00162
00163
00164 if (!$GLOBALS['SOBE']->modTSconfig['properties']['noCreateRecordsLink']) {
00165 $theCtrlPanel[]='<a href="#" onclick="'.htmlspecialchars('return jumpExt(\'' . htmlspecialchars($this->backPath . 'db_new.php?id='.$this->id).'\');').'">'.
00166 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_el.gif','width="11" height="12"').' title="'.$LANG->getLL('newRecordGeneral',1).'" alt="" />'.
00167 '</a>';
00168 }
00169
00170
00171 if ($this->id) {
00172 if ($row['hidden']) {
00173 $params='&data[pages]['.$row['uid'].'][hidden]=0';
00174 $theCtrlPanel[]='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$GLOBALS['SOBE']->doc->issueCommand($params,-1).'\');').'">'.
00175 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_unhide.gif','width="11" height="10"').' title="'.$LANG->getLL('unHidePage',1).'" alt="" />'.
00176 '</a>';
00177 } else {
00178 $params='&data[pages]['.$row['uid'].'][hidden]=1';
00179 $theCtrlPanel[]='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$GLOBALS['SOBE']->doc->issueCommand($params,-1).'\');').'">'.
00180 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_hide.gif','width="11" height="10"').' title="'.$LANG->getLL('hidePage',1).'" alt="" />'.
00181 '</a>';
00182 }
00183 }
00184
00185
00186 if ($this->id) {
00187 $theCtrlPanel[]='<a href="#" onclick="'.htmlspecialchars('return jumpExt(\''.$this->backPath.'move_el.php?table=pages&uid='.$row['uid'].'\');').'">'.
00188 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/move_'.($this->table=='tt_content'?'record':'page').'.gif','width="11" height="12"').' title="'.$LANG->getLL('move_page',1).'" alt="" />'.
00189 '</a>';
00190 }
00191 }
00192
00193
00194 if (($localCalcPerms&8) || ($localCalcPerms&16)) {
00195 $elFromTable = $this->clipObj->elFromTable('');
00196 if (count($elFromTable)) {
00197 $theCtrlPanel[]='<a href="'.htmlspecialchars($this->clipObj->pasteUrl('',$this->id)).'" onclick="'.htmlspecialchars('return '.$this->clipObj->confirmMsg('pages',$this->pageRow,'into',$elFromTable)).'">'.
00198 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_pasteafter.gif','width="12" height="12"').' title="'.$LANG->getLL('clip_paste',1).'" alt="" />'.
00199 '</a>';
00200 }
00201 }
00202
00203
00204 if (count($theCtrlPanel)) {
00205 $theData['up'][]='
00206
00207 <!--
00208 Control panel for page
00209 -->
00210 <table border="0" cellpadding="0" cellspacing="0" class="bgColor4" id="typo3-dblist-ctrltop">
00211 <tr>
00212 <td>'.implode('</td>
00213 <td>',$theCtrlPanel).'</td>
00214 </tr>
00215 </table>';
00216 }
00217
00218
00219
00220 $theData['up'][]='<a href="'.htmlspecialchars($this->listURL().'&clear_cache=1').'">'.
00221 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clear_cache.gif','width="14" height="14"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.clear_cache',1).'" alt="" />'.
00222 '</a>';
00223
00224
00225 if ($this->table) {
00226 $theData['up'][]='<a href="'.htmlspecialchars($this->listURL().'&csv=1').'">'.
00227 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/csv.gif','width="27" height="14"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.csv',1).'" alt="" />'.
00228 '</a>';
00229 }
00230
00231
00232 if ($this->table && t3lib_extMgm::isLoaded('impexp')) {
00233 $theData['up'][]='<a href="'.htmlspecialchars($this->backPath.'mod.php?M=xMOD_tximpexp&tx_impexp[action]=export&tx_impexp[list][]='.rawurlencode($this->table.':'.$this->id)).'">'.
00234 '<img'.t3lib_iconWorks::skinImg($this->backPath,t3lib_extMgm::extRelPath('impexp').'export.gif',' width="18" height="16"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:rm.export',1).'" alt="" />'.
00235 '</a>';
00236 }
00237
00238
00239 $theData['up'][]='<a href="'.htmlspecialchars($this->listURL()).'">'.
00240 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/refresh_n.gif','width="14" height="14"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.reload',1).'" alt="" />'.
00241 '</a>';
00242
00243
00244
00245 if ($this->id) {
00246
00247
00248 $theData[$titleCol].='<br /><span title="'.htmlspecialchars($row['_thePathFull']).'">'.htmlspecialchars(t3lib_div::fixed_lgd_cs($row['_thePath'],-$this->fixedL)).'</span>';
00249 $theData['up'][]='<a href="'.htmlspecialchars($this->listURL($row['pid'])).'" onclick="setHighlight('.$row['pid'].')">'.
00250 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/i/pages_up.gif','width="18" height="16"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel',1).'" alt="" />'.
00251 '</a>';
00252
00253
00254 $theIcon = $this->clickMenuEnabled ? $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg,'pages',$this->id) : $iconImg;
00255 } else {
00256
00257
00258 $theData[$titleCol].='<br />'.htmlspecialchars(t3lib_div::fixed_lgd_cs($GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'],-$this->fixedL));
00259
00260
00261 $theIcon = '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/i/_icon_website.gif','width="18" height="16"').' alt="" />';
00262 }
00263
00264
00265 if ($this->returnUrl) {
00266 $theData['up'][]='<a href="'.htmlspecialchars(t3lib_div::linkThisUrl($this->returnUrl,array('id'=>$this->id))).'" class="typo3-goBack">'.
00267 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/goback.gif','width="14" height="14"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.goBack',1).'" alt="" />'.
00268 '</a>';
00269 }
00270
00271
00272 $theData['up']='
00273 <table border="0" cellpadding="0" cellspacing="0">
00274 <tr>
00275 <td>'.implode('</td>
00276 <td>',$theData['up']).'</td>
00277 </tr>
00278 </table>';
00279
00280
00281 $out.=$this->addelement(1,$theIcon,$theData,'',$this->leftMargin);
00282
00283
00284 $this->HTMLcode.='
00285
00286
00287 <!--
00288 Page header for db_list:
00289 -->
00290 <table border="0" cellpadding="0" cellspacing="0" id="typo3-dblist-top">
00291 '.$out.'
00292 </table>';
00293 }
00294
00303 function getTable($table,$id,$rowlist) {
00304 global $TCA;
00305
00306
00307 t3lib_div::loadTCA($table);
00308
00309
00310 $addWhere = '';
00311 $titleCol = $TCA[$table]['ctrl']['label'];
00312 $thumbsCol = $TCA[$table]['ctrl']['thumbnail'];
00313 $l10nEnabled = $TCA[$table]['ctrl']['languageField'] && $TCA[$table]['ctrl']['transOrigPointerField'] && !$TCA[$table]['ctrl']['transOrigPointerTable'];
00314
00315
00316 $this->fieldArray=array();
00317 $this->fieldArray[] = $titleCol;
00318 if ($this->localizationView && $l10nEnabled) {
00319 $this->fieldArray[] = '_LOCALIZATION_';
00320 $this->fieldArray[] = '_LOCALIZATION_b';
00321 $addWhere.=' AND (
00322 '.$TCA[$table]['ctrl']['languageField'].'<=0
00323 OR
00324 '.$TCA[$table]['ctrl']['transOrigPointerField'].' = 0
00325 )';
00326 }
00327 if (!t3lib_div::inList($rowlist,'_CONTROL_')) {
00328 $this->fieldArray[] = '_CONTROL_';
00329 }
00330 if ($this->showClipboard) {
00331 $this->fieldArray[] = '_CLIPBOARD_';
00332 }
00333 if (!$this->dontShowClipControlPanels) {
00334 $this->fieldArray[]='_REF_';
00335 }
00336 if ($this->searchLevels) {
00337 $this->fieldArray[]='_PATH_';
00338 }
00339
00340 $this->fieldArray=array_unique(array_merge($this->fieldArray,t3lib_div::trimExplode(',',$rowlist,1)));
00341 if ($this->noControlPanels) {
00342 $tempArray = array_flip($this->fieldArray);
00343 unset($tempArray['_CONTROL_']);
00344 unset($tempArray['_CLIPBOARD_']);
00345 $this->fieldArray = array_keys($tempArray);
00346 }
00347
00348
00349 $selectFields = $this->fieldArray;
00350 $selectFields[] = 'uid';
00351 $selectFields[] = 'pid';
00352 if ($thumbsCol) $selectFields[] = $thumbsCol;
00353 if ($table=='pages') {
00354 if (t3lib_extMgm::isLoaded('cms')) {
00355 $selectFields[] = 'module';
00356 $selectFields[] = 'extendToSubpages';
00357 }
00358 $selectFields[] = 'doktype';
00359 }
00360 if (is_array($TCA[$table]['ctrl']['enablecolumns'])) {
00361 $selectFields = array_merge($selectFields,$TCA[$table]['ctrl']['enablecolumns']);
00362 }
00363 if ($TCA[$table]['ctrl']['type']) {
00364 $selectFields[] = $TCA[$table]['ctrl']['type'];
00365 }
00366 if ($TCA[$table]['ctrl']['typeicon_column']) {
00367 $selectFields[] = $TCA[$table]['ctrl']['typeicon_column'];
00368 }
00369 if ($TCA[$table]['ctrl']['versioningWS']) {
00370 $selectFields[] = 't3ver_id';
00371 $selectFields[] = 't3ver_state';
00372 $selectFields[] = 't3ver_wsid';
00373 $selectFields[] = 't3ver_swapmode';
00374 }
00375 if ($l10nEnabled) {
00376 $selectFields[] = $TCA[$table]['ctrl']['languageField'];
00377 $selectFields[] = $TCA[$table]['ctrl']['transOrigPointerField'];
00378 }
00379 if ($TCA[$table]['ctrl']['label_alt']) {
00380 $selectFields = array_merge($selectFields,t3lib_div::trimExplode(',',$TCA[$table]['ctrl']['label_alt'],1));
00381 }
00382 $selectFields = array_unique($selectFields);
00383 $selectFields = array_intersect($selectFields,$this->makeFieldList($table,1));
00384 $selFieldList = implode(',',$selectFields);
00385
00386
00387 $queryParts = $this->makeQueryArray($table, $id,$addWhere,$selFieldList);
00388 $this->setTotalItems($queryParts);
00389
00390
00391 $dbCount = 0;
00392 $out = '';
00393
00394
00395 if ($this->totalItems) {
00396 $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
00397 $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
00398 }
00399
00400 $LOISmode = $this->listOnlyInSingleTableMode && !$this->table;
00401
00402
00403 if ($dbCount) {
00404
00405
00406 if (!$LOISmode) {
00407 $theData = Array();
00408 if (!$this->table && !$rowlist) {
00409 $theData[$titleCol] = '<img src="clear.gif" width="'.($GLOBALS['SOBE']->MOD_SETTINGS['bigControlPanel']?'230':'350').'" height="1" alt="" />';
00410 if (in_array('_CONTROL_',$this->fieldArray)) $theData['_CONTROL_']='';
00411 if (in_array('_CLIPBOARD_',$this->fieldArray)) $theData['_CLIPBOARD_']='';
00412 }
00413 $out.=$this->addelement(0,'',$theData,'class="c-table-row-spacer"',$this->leftMargin);
00414 }
00415
00416
00417 $theData = Array();
00418 if ($this->disableSingleTableView) {
00419 $theData[$titleCol] = '<span class="c-table">'.$GLOBALS['LANG']->sL($TCA[$table]['ctrl']['title'],1).'</span> ('.$this->totalItems.')';
00420 } else {
00421 $theData[$titleCol] = $this->linkWrapTable($table,'<span class="c-table">'.$GLOBALS['LANG']->sL($TCA[$table]['ctrl']['title'],1).'</span> ('.$this->totalItems.') <img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/'.($this->table?'minus':'plus').'bullet_list.gif','width="18" height="12"').' hspace="10" class="absmiddle" title="'.$GLOBALS['LANG']->getLL(!$this->table?'expandView':'contractView',1).'" alt="" />');
00422 }
00423
00424
00425 $theData[$titleCol].= t3lib_BEfunc::cshItem($table,'',$this->backPath,'',FALSE,'margin-bottom:0px; white-space: normal;');
00426
00427 if ($LOISmode) {
00428 $out.='
00429 <tr>
00430 <td class="c-headLineTable" style="width:95%;">'.$theData[$titleCol].'</td>
00431 </tr>';
00432
00433 if ($GLOBALS['BE_USER']->uc["edit_showFieldHelp"]) {
00434 $GLOBALS['LANG']->loadSingleTableDescription($table);
00435 if (isset($GLOBALS['TCA_DESCR'][$table]['columns'][''])) {
00436 $onClick = 'vHWin=window.open(\'view_help.php?tfID='.$table.'.\',\'viewFieldHelp\',\'height=400,width=600,status=0,menubar=0,scrollbars=1\');vHWin.focus();return false;';
00437 $out.='
00438 <tr>
00439 <td class="c-tableDescription">'.t3lib_BEfunc::helpTextIcon($table,'',$this->backPath,TRUE).$GLOBALS['TCA_DESCR'][$table]['columns']['']['description'].'</td>
00440 </tr>';
00441 }
00442 }
00443 } else {
00444 $theUpIcon = ($table=='pages'&&$this->id&&isset($this->pageRow['pid'])) ? '<a href="'.htmlspecialchars($this->listURL($this->pageRow['pid'])).'" onclick="setHighlight('.$this->pageRow['pid'].')"><img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/i/pages_up.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel',1).'" alt="" /></a>':'';
00445 $out.=$this->addelement(1,$theUpIcon,$theData,' class="c-headLineTable"','');
00446 }
00447
00448 If (!$LOISmode) {
00449
00450 $this->currentTable = array();
00451 $currentIdList = array();
00452 $doSort = ($TCA[$table]['ctrl']['sortby'] && !$this->sortField);
00453
00454 $prevUid = 0;
00455 $prevPrevUid = 0;
00456 $accRows = array();
00457 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
00458 $accRows[] = $row;
00459 $currentIdList[] = $row['uid'];
00460 if ($doSort) {
00461 if ($prevUid) {
00462 $this->currentTable['prev'][$row['uid']] = $prevPrevUid;
00463 $this->currentTable['next'][$prevUid] = '-'.$row['uid'];
00464 $this->currentTable['prevUid'][$row['uid']] = $prevUid;
00465 }
00466 $prevPrevUid = isset($this->currentTable['prev'][$row['uid']]) ? -$prevUid : $row['pid'];
00467 $prevUid=$row['uid'];
00468 }
00469 }
00470 $GLOBALS['TYPO3_DB']->sql_free_result($result);
00471
00472
00473 if ($this->csvOutput) $this->initCSV();
00474
00475
00476 $this->CBnames=array();
00477 $this->duplicateStack=array();
00478 $this->eCounter=$this->firstElementNumber;
00479
00480 $iOut = '';
00481 $cc = 0;
00482 foreach($accRows as $row) {
00483
00484
00485 list($flag,$code) = $this->fwd_rwd_nav($table);
00486 $iOut.=$code;
00487
00488
00489 if ($flag) {
00490 $cc++;
00491 $iOut.= $this->renderListRow($table,$row,$cc,$titleCol,$thumbsCol);
00492
00493
00494 if ($this->localizationView && $l10nEnabled) {
00495
00496
00497 $translations = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
00498 $selFieldList,
00499 $table,
00500 'pid='.$row['pid'].
00501 ' AND '.$TCA[$table]['ctrl']['languageField'].'>0'.
00502 ' AND '.$TCA[$table]['ctrl']['transOrigPointerField'].'='.intval($row['uid']).
00503 t3lib_BEfunc::deleteClause($table).
00504 t3lib_BEfunc::versioningPlaceholderClause($table)
00505 );
00506
00507
00508 if (is_array($translations)) {
00509 foreach($translations as $lRow) {
00510 if ($GLOBALS['BE_USER']->checkLanguageAccess($lRow[$TCA[$table]['ctrl']['languageField']])) {
00511 $currentIdList[] = $lRow['uid'];
00512 $iOut.=$this->renderListRow($table,$lRow,$cc,$titleCol,$thumbsCol,18);
00513 }
00514 }
00515 }
00516 }
00517 }
00518
00519
00520 $this->eCounter++;
00521 }
00522
00523
00524 $out.=$this->renderListHeader($table,$currentIdList);
00525 }
00526
00527
00528 $out.=$iOut;
00529
00530
00531 $out='
00532
00533
00534
00535 <!--
00536 DB listing of elements: "'.htmlspecialchars($table).'"
00537 -->
00538 <table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist'.($LOISmode?' typo3-dblist-overview':'').'">
00539 '.$out.'
00540 </table>';
00541
00542
00543 if ($this->csvOutput) $this->outputCSV($table);
00544 }
00545
00546
00547 return $out;
00548 }
00549
00563 function renderListRow($table,$row,$cc,$titleCol,$thumbsCol,$indent=0) {
00564 $iOut = '';
00565
00566 if (strlen($this->searchString)) {
00567 $id_orig = $this->id;
00568 $this->id = $row['pid'];
00569 }
00570
00571
00572 t3lib_BEfunc::workspaceOL($table, $row, $GLOBALS['BE_USER']->workspace);
00573
00574
00575 $row_bgColor=
00576 $this->alternateBgColors ?
00577 (($cc%2)?'' :' class="db_list_alt"') :
00578 '';
00579
00580
00581 $row_bgColor = $row['_CSSCLASS'] ? ' class="'.$row['_CSSCLASS'].'"' : $row_bgColor;
00582
00583
00584 $this->counter++;
00585
00586
00587 $alttext = t3lib_BEfunc::getRecordIconAltText($row,$table);
00588 $iconImg = t3lib_iconWorks::getIconImage($table,$row,$this->backPath,'title="'.htmlspecialchars($alttext).'"'.($indent ? ' style="margin-left: '.$indent.'px;"' : ''));
00589 $theIcon = $this->clickMenuEnabled ? $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg,$table,$row['uid']) : $iconImg;
00590
00591
00592 $theData = Array();
00593 foreach($this->fieldArray as $fCol) {
00594 if ($fCol==$titleCol) {
00595 $recTitle = t3lib_BEfunc::getRecordTitle($table,$row,FALSE,TRUE);
00596 $theData[$fCol] = $this->linkWrapItems($table,$row['uid'],$recTitle,$row);
00597 } elseif ($fCol=='pid') {
00598 $theData[$fCol]=$row[$fCol];
00599 } elseif ($fCol=='_PATH_') {
00600 $theData[$fCol]=$this->recPath($row['pid']);
00601 } elseif ($fCol=='_REF_') {
00602 $theData[$fCol]=$this->makeRef($table,$row['uid']);
00603 } elseif ($fCol=='_CONTROL_') {
00604 $theData[$fCol]=$this->makeControl($table,$row);
00605 } elseif ($fCol=='_CLIPBOARD_') {
00606 $theData[$fCol]=$this->makeClip($table,$row);
00607 # $t3lib_transl8tools = new t3lib_transl8tools;
00608 # $theData[$fCol].=t3lib_div::view_array($t3lib_transl8tools->translationInfo($table,$row['uid']));
00609 } elseif ($fCol=='_LOCALIZATION_') {
00610 list($lC1, $lC2) = $this->makeLocalizationPanel($table,$row);
00611 $theData[$fCol] = $lC1;
00612 $theData[$fCol.'b'] = $lC2;
00613 } elseif ($fCol=='_LOCALIZATION_b') {
00614
00615 } else {
00616 $theData[$fCol] = $this->linkUrlMail(htmlspecialchars(t3lib_BEfunc::getProcessedValueExtra($table,$fCol,$row[$fCol],100,$row['uid'])),$row[$fCol]);
00617 }
00618 }
00619
00620 if (strlen($this->searchString)) {
00621 $this->id = $id_orig;
00622 }
00623
00624
00625 if ($this->csvOutput) $this->addToCSV($row,$table);
00626
00627
00628 $iOut.=$this->addelement(1,$theIcon,$theData,$row_bgColor);
00629
00630
00631 if ($this->thumbs && trim($row[$thumbsCol])) {
00632 $iOut.=$this->addelement(4,'', Array($titleCol=>$this->thumbCode($row,$table,$thumbsCol)),$row_bgColor);
00633 }
00634
00635
00636 return $iOut;
00637 }
00638
00648 function renderListHeader($table,$currentIdList) {
00649 global $TCA, $LANG;
00650
00651
00652 $theData = Array();
00653
00654
00655 foreach($this->fieldArray as $fCol) {
00656
00657
00658 $permsEdit = $this->calcPerms & ($table=='pages'?2:16);
00659
00660 switch((string)$fCol) {
00661 case '_PATH_':
00662 $theData[$fCol] = '<i>['.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels._PATH_',1).']</i>';
00663 break;
00664 case '_REF_':
00665 $theData[$fCol] = '<i>['.$LANG->sL('LLL:EXT:lang/locallang_mod_file_list.xml:c__REF_',1).']</i>';
00666 break;
00667 case '_LOCALIZATION_':
00668 $theData[$fCol] = '<i>['.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels._LOCALIZATION_',1).']</i>';
00669 break;
00670 case '_LOCALIZATION_b':
00671 $theData[$fCol] = $LANG->getLL('Localize',1);
00672 break;
00673 case '_CLIPBOARD_':
00674 $cells=array();
00675
00676
00677 $elFromTable = $this->clipObj->elFromTable($table);
00678 if (count($elFromTable)) {
00679 $cells[]='<a href="'.htmlspecialchars($this->clipObj->pasteUrl($table,$this->id)).'" onclick="'.htmlspecialchars('return '.$this->clipObj->confirmMsg('pages',$this->pageRow,'into',$elFromTable)).'">'.
00680 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_pasteafter.gif','width="12" height="12"').' title="'.$LANG->getLL('clip_paste',1).'" alt="" />'.
00681 '</a>';
00682 }
00683
00684
00685 if ($this->clipObj->current!='normal') {
00686
00687
00688 $cells[]=$this->linkClipboardHeaderIcon('<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_copy.gif','width="12" height="12"').' title="'.$LANG->getLL('clip_selectMarked',1).'" alt="" />',$table,'setCB');
00689
00690
00691 $editIdList = implode(',',$currentIdList);
00692 $editIdList = "'+editList('".$table."','".$editIdList."')+'";
00693 $params='&edit['.$table.']['.$editIdList.']=edit&disHelp=1';
00694 $cells[]='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'">'.
00695 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$LANG->getLL('clip_editMarked',1).'" alt="" />'.
00696 '</a>';
00697
00698
00699 $cells[]=$this->linkClipboardHeaderIcon('<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/garbage.gif','width="11" height="12"').' title="'.$LANG->getLL('clip_deleteMarked',1).'" alt="" />',$table,'delete',sprintf($LANG->getLL('clip_deleteMarkedWarning'),$LANG->sL($TCA[$table]['ctrl']['title'])));
00700
00701
00702 $cells[]='<a href="#" onclick="'.htmlspecialchars('checkOffCB(\''.implode(',',$this->CBnames).'\'); return false;').'">'.
00703 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_select.gif','width="12" height="12"').' title="'.$LANG->getLL('clip_markRecords',1).'" alt="" />'.
00704 '</a>';
00705 } else {
00706 $cells[]='';
00707 }
00708 $theData[$fCol]=implode('',$cells);
00709 break;
00710 case '_CONTROL_':
00711 if (!$TCA[$table]['ctrl']['readOnly']) {
00712
00713
00714 if ($this->calcPerms&($table=='pages'?8:16) && $this->showNewRecLink($table)) {
00715 if ($table=="tt_content" && $this->newWizards) {
00716
00717 $tmpTSc = t3lib_BEfunc::getModTSconfig($this->pageinfo['uid'],'mod.web_list');
00718 $tmpTSc = $tmpTSc ['properties']['newContentWiz.']['overrideWithExtension'];
00719 $newContentWizScriptPath = $this->backPath.t3lib_extMgm::isLoaded($tmpTSc) ? (t3lib_extMgm::extRelPath($tmpTSc).'mod1/db_new_content_el.php') : 'sysext/cms/layout/db_new_content_el.php';
00720
00721 $theData[$fCol]='<a href="#" onclick="'.htmlspecialchars('return jumpExt(\''.$newContentWizScriptPath.'?id='.$this->id.'\');').'">'.
00722 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_'.($table=='pages'?'page':'el').'.gif','width="'.($table=='pages'?13:11).'" height="12"').' title="'.$LANG->getLL('new',1).'" alt="" />'.
00723 '</a>';
00724 } elseif ($table=='pages' && $this->newWizards) {
00725 $theData[$fCol]='<a href="'.htmlspecialchars($this->backPath.'db_new.php?id='.$this->id.'&pagesOnly=1&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'.
00726 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_'.($table=='pages'?'page':'el').'.gif','width="'.($table=='pages'?13:11).'" height="12"').' title="'.$LANG->getLL('new',1).'" alt="" />'.
00727 '</a>';
00728 } else {
00729 $params='&edit['.$table.']['.$this->id.']=new';
00730 $theData[$fCol]='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'">'.
00731 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_'.($table=='pages'?'page':'el').'.gif','width="'.($table=='pages'?13:11).'" height="12"').' title="'.$LANG->getLL('new',1).'" alt="" />'.
00732 '</a>';
00733 }
00734 }
00735
00736
00737 if ($permsEdit && $this->table && is_array($currentIdList)) {
00738 $editIdList = implode(',',$currentIdList);
00739 if ($this->clipNumPane()) $editIdList = "'+editList('".$table."','".$editIdList."')+'";
00740 $params='&edit['.$table.']['.$editIdList.']=edit&columnsOnly='.implode(',',$this->fieldArray).'&disHelp=1';
00741 $theData[$fCol].='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'">'.
00742 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.$LANG->getLL('editShownColumns',1).'" alt="" />'.
00743 '</a>';
00744 }
00745 }
00746 break;
00747 default:
00748 $theData[$fCol]='';
00749 if ($this->table && is_array($currentIdList)) {
00750
00751
00752 if ($this->clipNumPane()) {
00753 $theData[$fCol].='<a href="'.htmlspecialchars($this->listURL('',-1).'&duplicateField='.$fCol).'">'.
00754 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/select_duplicates.gif','width="11" height="11"').' title="'.$LANG->getLL('clip_duplicates',1).'" alt="" />'.
00755 '</a>';
00756 }
00757
00758
00759 if (!$TCA[$table]['ctrl']['readOnly'] && $permsEdit && $TCA[$table]['columns'][$fCol]) {
00760 $editIdList = implode(',',$currentIdList);
00761 if ($this->clipNumPane()) $editIdList = "'+editList('".$table."','".$editIdList."')+'";
00762 $params='&edit['.$table.']['.$editIdList.']=edit&columnsOnly='.$fCol.'&disHelp=1';
00763 $iTitle = sprintf($LANG->getLL('editThisColumn'),ereg_replace(':$','',trim($LANG->sL(t3lib_BEfunc::getItemLabel($table,$fCol)))));
00764 $theData[$fCol].='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'">'.
00765 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.htmlspecialchars($iTitle).'" alt="" />'.
00766 '</a>';
00767 }
00768 }
00769 $theData[$fCol].=$this->addSortLink($LANG->sL(t3lib_BEfunc::getItemLabel($table,$fCol,'<i>[|]</i>')),$fCol,$table);
00770 break;
00771 }
00772 }
00773
00774
00775 return $this->addelement(1,'',$theData,' class="c-headLine"','');
00776 }
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00796 function makeControl($table,$row) {
00797 global $TCA, $LANG, $SOBE;
00798 if ($this->dontShowClipControlPanels) return '';
00799
00800
00801 t3lib_div::loadTCA($table);
00802 $cells=array();
00803
00804
00805 if ($table=='pages') {
00806 $localCalcPerms = $GLOBALS['BE_USER']->calcPerms(t3lib_BEfunc::getRecord('pages',$row['uid']));
00807 }
00808
00809
00810 $permsEdit = ($table=='pages' && ($localCalcPerms&2)) || ($table!='pages' && ($this->calcPerms&16));
00811
00812
00813 if ($table=='pages' || $table=='tt_content') {
00814 $params='&edit['.$table.']['.$row['uid'].']=edit';
00815 $cells[]='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($table=='tt_content'?$this->id.'#'.$row['uid']:$row['uid'], $this->backPath)).'">'.
00816 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom.gif','width="12" height="12"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPage',1).'" alt="" />'.
00817 '</a>';
00818 }
00819
00820
00821 if ($permsEdit) {
00822 $params='&edit['.$table.']['.$row['uid'].']=edit';
00823 $cells[]='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'">'.
00824 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2'.(!$TCA[$table]['ctrl']['readOnly']?'':'_d').'.gif','width="11" height="12"').' title="'.$LANG->getLL('edit',1).'" alt="" />'.
00825 '</a>';
00826 }
00827
00828
00829 if (($table=="tt_content" && $permsEdit) || ($table=='pages')) {
00830 $cells[]='<a href="#" onclick="'.htmlspecialchars('return jumpExt(\''.$this->backPath.'move_el.php?table='.$table.'&uid='.$row['uid'].'\');').'">'.
00831 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/move_'.($table=='tt_content'?'record':'page').'.gif','width="11" height="12"').' title="'.$LANG->getLL('move_'.($table=='tt_content'?'record':'page'),1).'" alt="" />'.
00832 '</a>';
00833 }
00834
00835
00836 if ($SOBE->MOD_SETTINGS['bigControlPanel'] || $this->table) {
00837
00838
00839 $cells[]='<a href="#" onclick="'.htmlspecialchars('top.launchView(\''.$table.'\', \''.$row['uid'].'\'); return false;').'">'.
00840 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/zoom2.gif','width="12" height="12"').' title="'.$LANG->getLL('showInfo',1).'" alt="" />'.
00841 '</a>';
00842
00843
00844 if (!$TCA[$table]['ctrl']['readOnly']) {
00845
00846
00847 $cells[]='<a href="#" onclick="'.htmlspecialchars('return jumpExt(\''.$this->backPath.'show_rechis.php?element='.rawurlencode($table.':'.$row['uid']).'\',\'#latest\');').'">'.
00848 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/history2.gif','width="13" height="12"').' title="'.$LANG->getLL('history',1).'" alt="" />'.
00849 '</a>';
00850
00851
00852 if (t3lib_extMgm::isLoaded('version')) {
00853 $vers = t3lib_BEfunc::selectVersionsOfRecord($table, $row['uid'], 'uid', $GLOBALS['BE_USER']->workspace);
00854 if (is_array($vers)) {
00855 if (count($vers)>1) {
00856 $st = 'background-color: #FFFF00; font-weight: bold;';
00857 $lab = count($vers)-1;
00858 } else {
00859 $st = 'background-color: #9999cc; font-weight: bold;';
00860 $lab = 'V';
00861 }
00862
00863 $cells[]='<a href="'.htmlspecialchars($this->backPath.t3lib_extMgm::extRelPath('version')).'cm1/index.php?table='.rawurlencode($table).'&uid='.rawurlencode($row['uid']).'" style="'.htmlspecialchars($st).'">'.
00864 $lab.
00865 '</a>';
00866 }
00867 }
00868
00869
00870 if ($table=='pages' && $GLOBALS['BE_USER']->check('modules','web_perm')) {
00871 $cells[]='<a href="'.htmlspecialchars('mod/web/perm/index.php?id='.$row['uid'].'&return_id='.$row['uid'].'&edit=1').'">'.
00872 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/perm.gif','width="7" height="12"').' title="'.$LANG->getLL('permissions',1).'" alt="" />'.
00873 '</a>';
00874 }
00875
00876
00877 if ($TCA[$table]['ctrl']['sortby'] || $TCA[$table]['ctrl']['useColumnsForDefaultValues']) {
00878 if (
00879 ($table!='pages' && ($this->calcPerms&16)) ||
00880 ($table=='pages' && ($this->calcPerms&8))
00881 ) {
00882 if ($this->showNewRecLink($table)) {
00883 $params='&edit['.$table.']['.(-$row['uid']).']=new';
00884 $cells[]='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'">'.
00885 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/new_'.($table=='pages'?'page':'el').'.gif','width="'.($table=='pages'?13:11).'" height="12"').' title="'.$LANG->getLL('new'.($table=='pages'?'Page':'Record'),1).'" alt="" />'.
00886 '</a>';
00887 }
00888 }
00889 }
00890
00891
00892 if ($permsEdit && $TCA[$table]['ctrl']['sortby'] && !$this->sortField && !$this->searchLevels) {
00893 if (isset($this->currentTable['prev'][$row['uid']])) {
00894 $params='&cmd['.$table.']['.$row['uid'].'][move]='.$this->currentTable['prev'][$row['uid']];
00895 $cells[]='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'">'.
00896 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_up.gif','width="11" height="10"').' title="'.$LANG->getLL('moveUp',1).'" alt="" />'.
00897 '</a>';
00898 } else {
00899 $cells[]='<img src="clear.gif" '.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_up.gif','width="11" height="10"',2).' alt="" />';
00900 }
00901 if ($this->currentTable['next'][$row['uid']]) {
00902 $params='&cmd['.$table.']['.$row['uid'].'][move]='.$this->currentTable['next'][$row['uid']];
00903 $cells[]='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'">'.
00904 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_down.gif','width="11" height="10"').' title="'.$LANG->getLL('moveDown',1).'" alt="" />'.
00905 '</a>';
00906 } else {
00907 $cells[]='<img src="clear.gif" '.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_down.gif','width="11" height="10"',2).' alt="" />';
00908 }
00909 }
00910
00911
00912 $hiddenField = $TCA[$table]['ctrl']['enablecolumns']['disabled'];
00913 if ($permsEdit && $hiddenField && $TCA[$table]['columns'][$hiddenField] && (!$TCA[$table]['columns'][$hiddenField]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields',$table.':'.$hiddenField))) {
00914 if ($row[$hiddenField]) {
00915 $params='&data['.$table.']['.$row['uid'].']['.$hiddenField.']=0';
00916 $cells[]='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'">'.
00917 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_unhide.gif','width="11" height="10"').' title="'.$LANG->getLL('unHide'.($table=='pages'?'Page':''),1).'" alt="" />'.
00918 '</a>';
00919 } else {
00920 $params='&data['.$table.']['.$row['uid'].']['.$hiddenField.']=1';
00921 $cells[]='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'">'.
00922 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_hide.gif','width="11" height="10"').' title="'.$LANG->getLL('hide'.($table=='pages'?'Page':''),1).'" alt="" />'.
00923 '</a>';
00924 }
00925 }
00926
00927
00928 if (
00929 ($table=='pages' && ($localCalcPerms&4)) || ($table!='pages' && ($this->calcPerms&16))
00930 ) {
00931 $params='&cmd['.$table.']['.$row['uid'].'][delete]=1';
00932 $cells[]='<a href="#" onclick="'.htmlspecialchars('if (confirm('.$LANG->JScharCode($LANG->getLL('deleteWarning').t3lib_BEfunc::referenceCount($table,$row['uid'],' (There are %s reference(s) to this record!)')).')) {jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');} return false;').'">'.
00933 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/garbage.gif','width="11" height="12"').' title="'.$LANG->getLL('delete',1).'" alt="" />'.
00934 '</a>';
00935 }
00936
00937
00938 if ($permsEdit && $table=='pages' && !$this->searchLevels) {
00939
00940
00941 if ($this->calcPerms&8) {
00942 $params='&cmd['.$table.']['.$row['uid'].'][move]='.-$this->id;
00943 $cells[]='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'">'.
00944 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_left.gif','width="11" height="10"').' title="'.$LANG->getLL('prevLevel',1).'" alt="" />'.
00945 '</a>';
00946 }
00947
00948 if ($this->currentTable['prevUid'][$row['uid']]) {
00949 $localCalcPerms = $GLOBALS['BE_USER']->calcPerms(t3lib_BEfunc::getRecord('pages',$this->currentTable['prevUid'][$row['uid']]));
00950 if ($localCalcPerms&8) {
00951 $params='&cmd['.$table.']['.$row['uid'].'][move]='.$this->currentTable['prevUid'][$row['uid']];
00952 $cells[]='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'">'.
00953 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_right.gif','width="11" height="10"').' title="'.$LANG->getLL('nextLevel',1).'" alt="" />'.
00954 '</a>';
00955 } else {
00956 $cells[]='<img src="clear.gif" '.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_right.gif','width="11" height="10"',2).' alt="" />';
00957 }
00958 } else {
00959 $cells[]='<img src="clear.gif" '.t3lib_iconWorks::skinImg($this->backPath,'gfx/button_right.gif','width="11" height="10"',2).' alt="" />';
00960 }
00961