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
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 class localRecordList extends recordList {
00091
00092
00093 var $alternateBgColors=FALSE;
00094 var $allowedNewTables=array();
00095 var $deniedNewTables=array();
00096 var $newWizards=FALSE;
00097
00098 var $dontShowClipControlPanels=FALSE;
00099 var $showClipboard=FALSE;
00100 var $noControlPanels = FALSE;
00101 var $clickMenuEnabled = TRUE;
00102
00103 var $totalRowCount;
00104
00105 var $spaceIcon;
00106
00107
00108 var $pageRow=array();
00109
00110
00111 protected $csvLines = array();
00112
00113 var $csvOutput=FALSE;
00114
00115
00116
00117
00118
00119
00120 var $clipObj;
00121 var $CBnames=array();
00122 var $duplicateStack=array();
00123
00124
00125
00126
00127
00128
00129
00130
00131 public $references;
00132
00133
00134
00135
00136
00137
00138 protected $referenceCount = array();
00139
00140 var $translations;
00141 var $selFieldList;
00142
00143 public function __construct() {
00144 parent::__construct();
00145 }
00146
00147
00148
00149
00150
00151
00152 public function getButtons() {
00153 global $LANG;
00154
00155 $buttons = array(
00156 'csh' => '',
00157 'view' => '',
00158 'edit' => '',
00159 'hide_unhide' => '',
00160 'move' => '',
00161 'new_record' => '',
00162 'paste' => '',
00163 'level_up' => '',
00164 'cache' => '',
00165 'reload' => '',
00166 'shortcut' => '',
00167 'back' => '',
00168 'csv' => '',
00169 'export' => ''
00170 );
00171
00172
00173 $localCalcPerms = $GLOBALS['BE_USER']->calcPerms($this->pageRow);
00174
00175
00176 if (!strlen($this->id)) {
00177 $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_noId', $GLOBALS['BACK_PATH'], '', TRUE);
00178 } elseif(!$this->id) {
00179 $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_root', $GLOBALS['BACK_PATH'], '', TRUE);
00180 } else {
00181 $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module', $GLOBALS['BACK_PATH'], '', TRUE);
00182 }
00183
00184 if (isset($this->id)) {
00185
00186 if (isset($GLOBALS['SOBE']->modTSconfig['properties']['noViewWithDokTypes'])) {
00187 $noViewDokTypes = t3lib_div::trimExplode(',', $GLOBALS['SOBE']->modTSconfig['properties']['noViewWithDokTypes'], true);
00188 } else {
00189
00190 $noViewDokTypes = array('254', '255');
00191 }
00192
00193 if (!in_array($this->pageRow['doktype'], $noViewDokTypes)) {
00194 $buttons['view'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::viewOnClick($this->id, $this->backPath, t3lib_BEfunc::BEgetRootLine($this->id))) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', TRUE) . '">' .
00195 t3lib_iconWorks::getSpriteIcon('actions-document-view') .
00196 '</a>';
00197 }
00198
00199
00200 if (!$GLOBALS['SOBE']->modTSconfig['properties']['noCreateRecordsLink']) {
00201 $buttons['new_record'] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $this->backPath . 'db_new.php?id=' . $this->id . '\');') . '" title="' . $LANG->getLL('newRecordGeneral', TRUE) . '">' .
00202 t3lib_iconWorks::getSpriteIcon('actions-document-new') .
00203 '</a>';
00204 }
00205
00206
00207 if ($localCalcPerms&2 && !empty($this->id)) {
00208
00209
00210 $params = '&edit[pages][' . $this->pageRow['uid'] . ']=edit';
00211 $buttons['edit'] = '<a href="#" onclick="' . htmlspecialchars(t3lib_BEfunc::editOnClick($params, $this->backPath, -1)) . '" title="' . $LANG->getLL('editPage', TRUE) . '">' .
00212 t3lib_iconWorks::getSpriteIcon('actions-document-open') .
00213 '</a>';
00214
00215 if ($this->pageRow['hidden']) {
00216 $params = '&data[pages][' . $this->pageRow['uid'] . '][hidden]=0';
00217 $buttons['hide_unhide'] = '<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '" title="' . $LANG->getLL('unHidePage', TRUE) . '">' .
00218 t3lib_iconWorks::getSpriteIcon('actions-edit-unhide') .
00219 '</a>';
00220
00221 } else {
00222 $params = '&data[pages][' . $this->pageRow['uid'] . '][hidden]=1';
00223 $buttons['hide_unhide'] = '<a href="#" onclick="' . htmlspecialchars('return jumpToUrl(\'' . $GLOBALS['SOBE']->doc->issueCommand($params, -1) . '\');') . '" title="' . $LANG->getLL('hidePage', TRUE) . '">'.
00224 t3lib_iconWorks::getSpriteIcon('actions-edit-hide') .
00225 '</a>';
00226 }
00227
00228
00229 $buttons['move'] = '<a href="#" onclick="' . htmlspecialchars('return jumpExt(\'' . $this->backPath . 'move_el.php?table=pages&uid=' . $this->pageRow['uid'] . '\');') . '" title="' . $LANG->getLL('move_page', TRUE) . '">' .
00230 (($this->table == 'tt_content') ? t3lib_iconWorks::getSpriteIcon('actions-document-move') : t3lib_iconWorks::getSpriteIcon('actions-page-move')) .
00231 '</a>';
00232
00233
00234 $buttons['level_up'] = '<a href="' . htmlspecialchars($this->listURL($this->pageRow['pid'])) . '" onclick="setHighlight(' . $this->pageRow['pid'] . ')" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel', TRUE) . '">' .
00235 t3lib_iconWorks::getSpriteIcon('actions-view-go-up') .
00236 '</a>';
00237
00238 }
00239
00240
00241
00242 if (($localCalcPerms&8) || ($localCalcPerms&16)) {
00243 $elFromTable = $this->clipObj->elFromTable('');
00244 if (count($elFromTable)) {
00245 $buttons['paste'] = '<a href="' . htmlspecialchars($this->clipObj->pasteUrl('', $this->id)) . '" onclick="' . htmlspecialchars('return ' . $this->clipObj->confirmMsg('pages', $this->pageRow, 'into', $elFromTable)) . '" title="' . $LANG->getLL('clip_paste', TRUE) . '">' .
00246 t3lib_iconWorks::getSpriteIcon('actions-document-paste-after') .
00247 '</a>';
00248 }
00249 }
00250
00251
00252 $buttons['cache'] = '<a href="' . htmlspecialchars($this->listURL() . '&clear_cache=1') . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.clear_cache', TRUE) . '">' .
00253 t3lib_iconWorks::getSpriteIcon('actions-system-cache-clear') .
00254 '</a>';
00255
00256 if ($this->table) {
00257
00258
00259 $buttons['csv'] = '<a href="' . htmlspecialchars($this->listURL() . '&csv=1') . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.csv', TRUE) . '">' .
00260 t3lib_iconWorks::getSpriteIcon('mimetypes-text-csv') .
00261 '</a>';
00262
00263
00264 if (t3lib_extMgm::isLoaded('impexp')) {
00265 $url = $this->backPath . t3lib_extMgm::extRelPath('impexp') . 'app/index.php?tx_impexp[action]=export';
00266 $buttons['export'] = '<a href="' . htmlspecialchars($url . '&tx_impexp[list][]=' . rawurlencode($this->table . ':' . $this->id)) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:rm.export', TRUE) . '">' .
00267 t3lib_iconWorks::getSpriteIcon('actions-document-export-t3d') .
00268 '</a>';
00269 }
00270
00271 }
00272
00273
00274 $buttons['reload'] = '<a href="' . htmlspecialchars($this->listURL()) . '" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.reload', TRUE) . '">' .
00275 t3lib_iconWorks::getSpriteIcon('actions-system-refresh') .
00276 '</a>';
00277
00278
00279 if ($GLOBALS['BE_USER']->mayMakeShortcut()) {
00280 $buttons['shortcut'] = $GLOBALS['TBE_TEMPLATE']->makeShortcutIcon('id, imagemode, pointer, table, search_field, search_levels, showLimit, sortField, sortRev', implode(',', array_keys($this->MOD_MENU)), 'web_list');
00281 }
00282
00283
00284 if ($this->returnUrl) {
00285 $buttons['back'] = '<a href="' . htmlspecialchars(t3lib_div::linkThisUrl($this->returnUrl, array('id' => $this->id))) . '" class="typo3-goBack" title="' . $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.goBack', TRUE) . '">' .
00286 t3lib_iconWorks::getSpriteIcon('actions-view-go-back') .
00287 '</a>';
00288 }
00289 }
00290
00291 return $buttons;
00292 }
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302 function getTable($table,$id,$rowlist) {
00303 global $TCA, $TYPO3_CONF_VARS;
00304
00305
00306 t3lib_div::loadTCA($table);
00307
00308
00309 $addWhere = '';
00310 $titleCol = $TCA[$table]['ctrl']['label'];
00311 $thumbsCol = $TCA[$table]['ctrl']['thumbnail'];
00312 $l10nEnabled = $TCA[$table]['ctrl']['languageField'] && $TCA[$table]['ctrl']['transOrigPointerField'] && !$TCA[$table]['ctrl']['transOrigPointerTable'];
00313 $tableCollapsed = (!$this->tablesCollapsed[$table]) ? false : true;
00314
00315
00316 $this->spaceIcon = t3lib_iconWorks::getSpriteIcon('empty-empty', array('style' => 'background-position: 0 10px;'));
00317
00318
00319 $this->fieldArray=array();
00320
00321 $this->fieldArray[] = $titleCol;
00322
00323 if (!t3lib_div::inList($rowlist,'_CONTROL_')) {
00324 $this->fieldArray[] = '_CONTROL_';
00325 $this->fieldArray[] = '_AFTERCONTROL_';
00326 }
00327
00328 if ($this->showClipboard) {
00329 $this->fieldArray[] = '_CLIPBOARD_';
00330 }
00331
00332 if (!$this->dontShowClipControlPanels) {
00333 $this->fieldArray[]='_REF_';
00334 $this->fieldArray[]='_AFTERREF_';
00335 }
00336
00337 if ($this->searchLevels) {
00338 $this->fieldArray[]='_PATH_';
00339 }
00340
00341 if ($this->localizationView && $l10nEnabled) {
00342 $this->fieldArray[] = '_LOCALIZATION_';
00343 $this->fieldArray[] = '_LOCALIZATION_b';
00344 $addWhere.=' AND (
00345 '.$TCA[$table]['ctrl']['languageField'].'<=0
00346 OR
00347 '.$TCA[$table]['ctrl']['transOrigPointerField'].' = 0
00348 )';
00349 }
00350
00351 $this->fieldArray=array_unique(array_merge($this->fieldArray,t3lib_div::trimExplode(',',$rowlist,1)));
00352 if ($this->noControlPanels) {
00353 $tempArray = array_flip($this->fieldArray);
00354 unset($tempArray['_CONTROL_']);
00355 unset($tempArray['_CLIPBOARD_']);
00356 $this->fieldArray = array_keys($tempArray);
00357 }
00358
00359
00360 $selectFields = $this->fieldArray;
00361 $selectFields[] = 'uid';
00362 $selectFields[] = 'pid';
00363 if ($thumbsCol) $selectFields[] = $thumbsCol;
00364 if ($table=='pages') {
00365 if (t3lib_extMgm::isLoaded('cms')) {
00366 $selectFields[] = 'module';
00367 $selectFields[] = 'extendToSubpages';
00368 $selectFields[] = 'nav_hide';
00369 }
00370 $selectFields[] = 'doktype';
00371 }
00372 if (is_array($TCA[$table]['ctrl']['enablecolumns'])) {
00373 $selectFields = array_merge($selectFields,$TCA[$table]['ctrl']['enablecolumns']);
00374 }
00375 if ($TCA[$table]['ctrl']['type']) {
00376 $selectFields[] = $TCA[$table]['ctrl']['type'];
00377 }
00378 if ($TCA[$table]['ctrl']['typeicon_column']) {
00379 $selectFields[] = $TCA[$table]['ctrl']['typeicon_column'];
00380 }
00381 if ($TCA[$table]['ctrl']['versioningWS']) {
00382 $selectFields[] = 't3ver_id';
00383 $selectFields[] = 't3ver_state';
00384 $selectFields[] = 't3ver_wsid';
00385 $selectFields[] = 't3ver_swapmode';
00386 }
00387 if ($l10nEnabled) {
00388 $selectFields[] = $TCA[$table]['ctrl']['languageField'];
00389 $selectFields[] = $TCA[$table]['ctrl']['transOrigPointerField'];
00390 }
00391 if ($TCA[$table]['ctrl']['label_alt']) {
00392 $selectFields = array_merge($selectFields,t3lib_div::trimExplode(',',$TCA[$table]['ctrl']['label_alt'],1));
00393 }
00394 $selectFields = array_unique($selectFields);
00395 $selectFields = array_intersect($selectFields,$this->makeFieldList($table,1));
00396 $selFieldList = implode(',',$selectFields);
00397 $this->selFieldList = $selFieldList;
00398
00399
00400
00401
00402
00403
00404 if(is_array($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'])) {
00405 foreach($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'] as $classData) {
00406 $hookObject = t3lib_div::getUserObj($classData);
00407
00408 if(!($hookObject instanceof t3lib_localRecordListGetTableHook)) {
00409 throw new UnexpectedValueException('$hookObject must implement interface t3lib_localRecordListGetTableHook', 1195114460);
00410 }
00411
00412 $hookObject->getDBlistQuery($table, $id, $addWhere, $selFieldList, $this);
00413 }
00414 }
00415
00416
00417 if ($this->csvOutput) {
00418 $this->iLimit = 0;
00419 }
00420
00421 if ($this->firstElementNumber > 2 && $this->iLimit > 0) {
00422
00423 $this->firstElementNumber = $this->firstElementNumber - 2;
00424 $this->iLimit = $this->iLimit + 2;
00425 $queryParts = $this->makeQueryArray($table, $id,$addWhere,$selFieldList);
00426 $this->firstElementNumber = $this->firstElementNumber + 2;
00427 $this->iLimit = $this->iLimit - 2;
00428 } else {
00429 $queryParts = $this->makeQueryArray($table, $id,$addWhere,$selFieldList);
00430 }
00431
00432 $this->setTotalItems($queryParts);
00433
00434
00435 $dbCount = 0;
00436 $out = '';
00437 $listOnlyInSingleTableMode = $this->listOnlyInSingleTableMode && !$this->table;
00438
00439
00440 if ($this->totalItems) {
00441
00442 if ($listOnlyInSingleTableMode || (!$this->table && $tableCollapsed)) {
00443 $dbCount = $this->totalItems;
00444 } else {
00445
00446 if ($this->csvOutput) {
00447 $this->showLimit = $this->totalItems;
00448 $this->iLimit = $this->totalItems;
00449 }
00450 $result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);
00451 $dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
00452 }
00453 }
00454
00455
00456 if ($dbCount) {
00457
00458
00459 if (!$listOnlyInSingleTableMode) {
00460 $theData = Array();
00461 if (!$this->table && !$rowlist) {
00462 $theData[$titleCol] = '<img src="clear.gif" width="'.($GLOBALS['SOBE']->MOD_SETTINGS['bigControlPanel']?'230':'350').'" height="1" alt="" />';
00463 if (in_array('_CONTROL_',$this->fieldArray)) $theData['_CONTROL_']='';
00464 if (in_array('_CLIPBOARD_',$this->fieldArray)) $theData['_CLIPBOARD_']='';
00465 }
00466 $out.=$this->addelement(0,'',$theData,'class="c-table-row-spacer"',$this->leftMargin);
00467 }
00468
00469
00470 $theData = Array();
00471 if ($this->disableSingleTableView) {
00472 $theData[$titleCol] = '<span class="c-table">'.$GLOBALS['LANG']->sL($TCA[$table]['ctrl']['title'],1).'</span> ('.$this->totalItems.')';
00473 } else {
00474 $theData[$titleCol] = $this->linkWrapTable($table, '<span class="c-table">' . $GLOBALS['LANG']->sL($TCA[$table]['ctrl']['title'], TRUE) . '</span> (' . $this->totalItems . ') ' .
00475 ($this->table ? t3lib_iconWorks::getSpriteIcon('actions-view-table-collapse', array('title' => $GLOBALS['LANG']->getLL('contractView', TRUE))) : t3lib_iconWorks::getSpriteIcon('actions-view-table-expand', array('title' => $GLOBALS['LANG']->getLL('expandView', TRUE))))
00476 );
00477 }
00478
00479
00480 $theData[$titleCol].= t3lib_BEfunc::cshItem($table,'',$this->backPath,'',FALSE,'margin-bottom:0px; white-space: normal;');
00481
00482 if ($listOnlyInSingleTableMode) {
00483 $out.='
00484 <tr>
00485 <td class="t3-row-header" style="width:95%;">' . $theData[$titleCol] . '</td>
00486 </tr>';
00487
00488 if ($GLOBALS['BE_USER']->uc["edit_showFieldHelp"]) {
00489 $GLOBALS['LANG']->loadSingleTableDescription($table);
00490 if (isset($GLOBALS['TCA_DESCR'][$table]['columns'][''])) {
00491 $onClick = 'vHWin=window.open(\'view_help.php?tfID='.$table.'.\',\'viewFieldHelp\',\'height=400,width=600,status=0,menubar=0,scrollbars=1\');vHWin.focus();return false;';
00492 $out.='
00493 <tr>
00494 <td class="c-tableDescription">'.t3lib_BEfunc::helpTextIcon($table,'',$this->backPath,TRUE).$GLOBALS['TCA_DESCR'][$table]['columns']['']['description'].'</td>
00495 </tr>';
00496 }
00497 }
00498 } else {
00499
00500 $collapseIcon = '';
00501 if (!$this->table) {
00502 $collapseIcon = '<a href="' . htmlspecialchars($this->listURL() . '&collapse[' . $table . ']=' . ($tableCollapsed ? '0' : '1')) . '" title="' . ($tableCollapsed ? $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.expandTable', TRUE) : $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.collapseTable', TRUE)) . '">' .
00503 ($tableCollapsed ? t3lib_iconWorks::getSpriteIcon('actions-view-list-expand', array('class' => 'collapseIcon')) : t3lib_iconWorks::getSpriteIcon('actions-view-list-collapse', array('class' => 'collapseIcon'))) .
00504 '</a>';
00505 }
00506 $out .= $this->addElement(1, $collapseIcon, $theData, ' class="t3-row-header"', '');
00507 }
00508
00509
00510 if (!$listOnlyInSingleTableMode && (!$tableCollapsed || $this->table)) {
00511
00512 $this->currentTable = array();
00513 $currentIdList = array();
00514 $doSort = ($TCA[$table]['ctrl']['sortby'] && !$this->sortField);
00515
00516 $prevUid = 0;
00517 $prevPrevUid = 0;
00518
00519
00520 if ($this->firstElementNumber > 2 && $this->iLimit > 0) {
00521 $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
00522 $prevPrevUid = -(int) $row['uid'];
00523 $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result);
00524 $prevUid = $row['uid'];
00525 }
00526
00527 $accRows = array();
00528 while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
00529
00530
00531 t3lib_BEfunc::workspaceOL($table, $row, $GLOBALS['BE_USER']->workspace, TRUE);
00532
00533 if (is_array($row)) {
00534 $accRows[] = $row;
00535 $currentIdList[] = $row['uid'];
00536 if ($doSort) {
00537 if ($prevUid) {
00538 $this->currentTable['prev'][$row['uid']] = $prevPrevUid;
00539 $this->currentTable['next'][$prevUid] = '-'.$row['uid'];
00540 $this->currentTable['prevUid'][$row['uid']] = $prevUid;
00541 }
00542 $prevPrevUid = isset($this->currentTable['prev'][$row['uid']]) ? -$prevUid : $row['pid'];
00543 $prevUid=$row['uid'];
00544 }
00545 }
00546 }
00547 $GLOBALS['TYPO3_DB']->sql_free_result($result);
00548
00549 $this->totalRowCount = count($accRows);
00550
00551
00552 if ($this->csvOutput) $this->initCSV();
00553
00554
00555 $this->CBnames=array();
00556 $this->duplicateStack=array();
00557 $this->eCounter=$this->firstElementNumber;
00558
00559 $iOut = '';
00560 $cc = 0;
00561
00562 foreach($accRows as $row) {
00563
00564 if ($cc < $this->iLimit) {
00565 $cc++;
00566 $this->translations = FALSE;
00567 $iOut.= $this->renderListRow($table,$row,$cc,$titleCol,$thumbsCol);
00568
00569
00570 if ($this->localizationView && $l10nEnabled) {
00571
00572 if (is_array($this->translations)) {
00573 foreach ($this->translations as $lRow) {
00574
00575 if ($row['_MOVE_PLH_uid'] && $row['_MOVE_PLH_pid']) {
00576 $tmpRow = t3lib_BEfunc::getRecordRaw($table, 't3ver_move_id="'.intval($lRow['uid']) . '" AND pid="' . $row['_MOVE_PLH_pid'] . '" AND t3ver_wsid=' . $row['t3ver_wsid'] . t3lib_beFunc::deleteClause($table), $selFieldList);
00577 $lRow = is_array($tmpRow)?$tmpRow:$lRow;
00578 }
00579
00580 t3lib_BEfunc::workspaceOL($table, $lRow, $GLOBALS['BE_USER']->workspace, true);
00581 if (is_array($lRow) && $GLOBALS['BE_USER']->checkLanguageAccess($lRow[$TCA[$table]['ctrl']['languageField']])) {
00582 $currentIdList[] = $lRow['uid'];
00583 $iOut.=$this->renderListRow($table,$lRow,$cc,$titleCol,$thumbsCol,18);
00584 }
00585 }
00586 }
00587 }
00588 }
00589
00590
00591 $this->eCounter++;
00592 }
00593
00594
00595 if ($this->table) {
00596 $pageNavigation = $this->renderListNavigation();
00597 $iOut = $pageNavigation . $iOut . $pageNavigation;
00598 } else {
00599
00600 if ($this->totalItems > $this->itemsLimitPerTable) {
00601 $countOnFirstPage = $this->totalItems > $this->itemsLimitSingleTable ? $this->itemsLimitSingleTable : $this->totalItems;
00602 $hasMore = ($this->totalItems > $this->itemsLimitSingleTable);
00603 $iOut .= '<tr><td colspan="' . count($this->fieldArray) . '" style="padding:5px;">
00604 <a href="'.htmlspecialchars($this->listURL() . '&table=' . rawurlencode($table)) . '">' .
00605 '<img' . t3lib_iconWorks::skinImg($this->backPath,'gfx/pildown.gif', 'width="14" height="14"') .' alt="" />'.
00606 ' <i>[1 - ' . $countOnFirstPage . ($hasMore ? '+' : '') . ']</i></a>
00607 </td></tr>';
00608 }
00609
00610 }
00611
00612
00613 $out .= $this->renderListHeader($table,$currentIdList);
00614 }
00615
00616
00617 $out .= $iOut;
00618 unset($iOut);
00619
00620
00621 $out='
00622
00623
00624
00625 <!--
00626 DB listing of elements: "'.htmlspecialchars($table).'"
00627 -->
00628 <table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist'.($listOnlyInSingleTableMode?' typo3-dblist-overview':'').'">
00629 '.$out.'
00630 </table>';
00631
00632
00633 if ($this->csvOutput) $this->outputCSV($table);
00634 }
00635
00636
00637 return $out;
00638 }
00639
00640
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653 function renderListRow($table,$row,$cc,$titleCol,$thumbsCol,$indent=0) {
00654 $iOut = '';
00655
00656 if (strlen($this->searchString)) {
00657 $id_orig = $this->id;
00658 $this->id = $row['pid'];
00659 }
00660
00661 if (is_array($row)) {
00662
00663 $rowSpecial = '';
00664 if ($cc == 1 && $indent == 0) {
00665 $rowSpecial .= ' firstcol';
00666 }
00667 if ($cc == $this->totalRowCount || $cc == $this->iLimit) {
00668 $rowSpecial .= ' lastcol';
00669 }
00670
00671
00672 if ($this->alternateBgColors) {
00673 $row_bgColor = ($cc%2) ? ' class="db_list_normal'.$rowSpecial.'"' : ' class="db_list_alt'.$rowSpecial.'"';
00674 } else {
00675 $row_bgColor = ' class="db_list_normal'.$rowSpecial.'"';
00676 }
00677
00678 $row_bgColor = $row['_CSSCLASS'] ? ' class="'.$row['_CSSCLASS'].'"' : $row_bgColor;
00679
00680
00681 $this->counter++;
00682
00683
00684 $alttext = t3lib_BEfunc::getRecordIconAltText($row,$table);
00685 $iconImg = t3lib_iconWorks::getSpriteIconForRecord($table, $row, array('title' => htmlspecialchars($alttext), 'style' => ($indent ? ' margin-left: ' . $indent . 'px;' : '')));
00686
00687
00688 $theIcon = $this->clickMenuEnabled ? $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($iconImg,$table,$row['uid']) : $iconImg;
00689
00690
00691 $theData = Array();
00692 foreach($this->fieldArray as $fCol) {
00693 if ($fCol==$titleCol) {
00694 $recTitle = t3lib_BEfunc::getRecordTitle($table,$row,FALSE,TRUE);
00695
00696 if (($lockInfo = t3lib_BEfunc::isRecordLocked($table, $row['uid']))) {
00697 $warning = '<a href="#" onclick="' . htmlspecialchars('alert(' . $GLOBALS['LANG']->JScharCode($lockInfo['msg']) . '); return false;') . '" title="' . htmlspecialchars($lockInfo['msg']) . '">' .
00698 t3lib_iconWorks::getSpriteIcon('status-warning-in-use') .
00699 '</a>';
00700 }
00701 $theData[$fCol] = $warning . $this->linkWrapItems($table, $row['uid'], $recTitle, $row);
00702
00703
00704 if ($this->thumbs && trim($row[$thumbsCol])) {
00705 $theData[$fCol] .= '<br />' . $this->thumbCode($row,$table,$thumbsCol);
00706 }
00707
00708 $localizationMarkerClass = '';
00709 if (isset($GLOBALS['TCA'][$table]['ctrl']['languageField'])
00710 && $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] != 0) {
00711
00712 $localizationMarkerClass = ' localization';
00713 }
00714 } elseif ($fCol == 'pid') {
00715 $theData[$fCol]=$row[$fCol];
00716 } elseif ($fCol == '_PATH_') {
00717 $theData[$fCol]=$this->recPath($row['pid']);
00718 } elseif ($fCol == '_REF_') {
00719 $theData[$fCol] = $this->createReferenceHtml($table, $row['uid']);
00720 } elseif ($fCol == '_CONTROL_') {
00721 $theData[$fCol]=$this->makeControl($table,$row);
00722 } elseif ($fCol == '_AFTERCONTROL_' || $fCol == '_AFTERREF_') {
00723 $theData[$fCol] = ' ';
00724 } elseif ($fCol == '_CLIPBOARD_') {
00725 $theData[$fCol]=$this->makeClip($table,$row);
00726 } elseif ($fCol == '_LOCALIZATION_') {
00727 list($lC1, $lC2) = $this->makeLocalizationPanel($table,$row);
00728 $theData[$fCol] = $lC1;
00729 $theData[$fCol.'b'] = $lC2;
00730 } elseif ($fCol == '_LOCALIZATION_b') {
00731
00732 } else {
00733 $tmpProc = t3lib_BEfunc::getProcessedValueExtra($table, $fCol, $row[$fCol], 100, $row['uid']);
00734 $theData[$fCol] = $this->linkUrlMail(htmlspecialchars($tmpProc), $row[$fCol]);
00735 $row[$fCol] = $tmpProc;
00736 }
00737 }
00738
00739 if (strlen($this->searchString)) {
00740 $this->id = $id_orig;
00741 }
00742
00743
00744 if ($this->csvOutput) {
00745 $this->addToCSV($row,$table);
00746 }
00747
00748
00749 $this->addElement_tdCssClass[$titleCol] = 'col-title' . $localizationMarkerClass;
00750 if (!$this->dontShowClipControlPanels) {
00751 $this->addElement_tdCssClass['_CONTROL_'] = 'col-control';
00752 $this->addElement_tdCssClass['_AFTERCONTROL_'] = 'col-control-space';
00753 $this->addElement_tdCssClass['_CLIPBOARD_'] = 'col-clipboard';
00754 }
00755 $this->addElement_tdCssClass['_PATH_'] = 'col-path';
00756 $this->addElement_tdCssClass['_LOCALIZATION_'] = 'col-localizationa';
00757 $this->addElement_tdCssClass['_LOCALIZATION_b'] = 'col-localizationb';
00758
00759
00760 $iOut.=$this->addelement(1,$theIcon,$theData,$row_bgColor);
00761
00762
00763 return $iOut;
00764 }
00765 }
00766
00767
00768
00769
00770
00771
00772
00773
00774
00775
00776 function setReferences($table, $uid) {
00777 t3lib_div::logDeprecatedFunction();
00778
00779 $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
00780 'tablename, recuid, field',
00781 'sys_refindex',
00782 'ref_table='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table,'sys_refindex').
00783 ' AND ref_uid='.intval($uid).
00784 ' AND deleted=0'
00785 );
00786 $this->references = $rows;
00787 }
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801 protected function getReferenceCount($tableName, $uid) {
00802 if (!isset($this->referenceCount[$tableName][$uid])) {
00803 $numberOfReferences = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows(
00804 '*',
00805 'sys_refindex',
00806 'ref_table = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr(
00807 $tableName, 'sys_refindex'
00808 ) .
00809 ' AND ref_uid = ' . $uid .
00810 ' AND deleted = 0'
00811 );
00812
00813 $this->referenceCount[$tableName][$uid] = $numberOfReferences;
00814 }
00815
00816 return $this->referenceCount[$tableName][$uid];
00817 }
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828 function renderListHeader($table, $currentIdList) {
00829 global $TCA, $LANG, $TYPO3_CONF_VARS;
00830
00831
00832 $theData = Array();
00833
00834
00835 foreach($this->fieldArray as $fCol) {
00836
00837
00838 $permsEdit = $this->calcPerms & ($table=='pages'?2:16);
00839
00840 switch((string)$fCol) {
00841 case '_PATH_':
00842 $theData[$fCol] = '<i>['.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels._PATH_',1).']</i>';
00843 break;
00844 case '_REF_':
00845 $theData[$fCol] = '<i>['.$LANG->sL('LLL:EXT:lang/locallang_mod_file_list.xml:c__REF_',1).']</i>';
00846 break;
00847 case '_LOCALIZATION_':
00848 $theData[$fCol] = '<i>['.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels._LOCALIZATION_',1).']</i>';
00849 break;
00850 case '_LOCALIZATION_b':
00851 $theData[$fCol] = $LANG->getLL('Localize',1);
00852 break;
00853 case '_CLIPBOARD_':
00854 $cells=array();
00855
00856
00857 $elFromTable = $this->clipObj->elFromTable($table);
00858 if (count($elFromTable)) {
00859 $cells['pasteAfter']='<a href="'.htmlspecialchars($this->clipObj->pasteUrl($table,$this->id)).'" onclick="'.htmlspecialchars('return '.$this->clipObj->confirmMsg('pages',$this->pageRow,'into',$elFromTable)).'" title="' . $LANG->getLL('clip_paste', TRUE) . '">' .
00860 t3lib_iconWorks::getSpriteIcon('actions-document-paste-after') .
00861 '</a>';
00862 }
00863
00864
00865 if ($this->clipObj->current!='normal') {
00866
00867
00868 $cells['copyMarked']=$this->linkClipboardHeaderIcon(t3lib_iconWorks::getSpriteIcon('actions-edit-copy', array('title' => $LANG->getLL('clip_selectMarked', TRUE))), $table, 'setCB');
00869
00870
00871 $editIdList = implode(',',$currentIdList);
00872 $editIdList = "'+editList('".$table."','".$editIdList."')+'";
00873 $params='&edit['.$table.']['.$editIdList.']=edit&disHelp=1';
00874 $cells['edit']='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'" title="' . $LANG->getLL('clip_editMarked', TRUE) . '">' .
00875 t3lib_iconWorks::getSpriteIcon('actions-document-open') .
00876 '</a>';
00877
00878
00879 $cells['delete']=$this->linkClipboardHeaderIcon(t3lib_iconWorks::getSpriteIcon('actions-edit-delete', array('title' => $LANG->getLL('clip_deleteMarked', TRUE))), $table,'delete',sprintf($LANG->getLL('clip_deleteMarkedWarning'), $LANG->sL($TCA[$table]['ctrl']['title'])));
00880
00881
00882 $cells['markAll'] = '<a class="cbcCheckAll" rel="" href="#" onclick="' . htmlspecialchars('checkOffCB(\'' . implode(',', $this->CBnames) . '\', this); return false;') . '" title="' . $LANG->getLL('clip_markRecords', TRUE) . '">' .
00883 t3lib_iconWorks::getSpriteIcon('actions-document-select') .
00884 '</a>';
00885 } else {
00886 $cells['empty']='';
00887 }
00888
00889
00890
00891
00892
00893
00894 if(is_array($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {
00895 foreach($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $classData) {
00896 $hookObject = t3lib_div::getUserObj($classData);
00897 if(!($hookObject instanceof localRecordList_actionsHook)) {
00898 throw new UnexpectedValueException('$hookObject must implement interface localRecordList_actionsHook', 1195567850);
00899 }
00900 $cells = $hookObject->renderListHeaderActions($table, $currentIdList, $cells, $this);
00901 }
00902 }
00903 $theData[$fCol]=implode('',$cells);
00904 break;
00905 case '_CONTROL_':
00906 if (!$TCA[$table]['ctrl']['readOnly']) {
00907
00908
00909 if ($this->calcPerms&($table=='pages'?8:16) && $this->showNewRecLink($table)) {
00910 if ($table=="tt_content" && $this->newWizards) {
00911
00912 $tmpTSc = t3lib_BEfunc::getModTSconfig($this->pageinfo['uid'],'mod.web_list');
00913 $tmpTSc = $tmpTSc ['properties']['newContentWiz.']['overrideWithExtension'];
00914 $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';
00915
00916 $icon = '<a href="#" onclick="'.htmlspecialchars('return jumpExt(\''.$newContentWizScriptPath.'?id='.$this->id.'\');').'" title="' . $LANG->getLL('new', TRUE) . '">'.
00917 ($table == 'pages' ? t3lib_iconWorks::getSpriteIcon('actions-page-new') : t3lib_iconWorks::getSpriteIcon('actions-document-new')) .
00918 '</a>';
00919 } elseif ($table=='pages' && $this->newWizards) {
00920 $icon = '<a href="'.htmlspecialchars($this->backPath.'db_new.php?id='.$this->id.'&pagesOnly=1&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'" title="'.$LANG->getLL('new', TRUE).'">'.
00921 ($table=='pages' ? t3lib_iconWorks::getSpriteIcon('actions-page-new') : t3lib_iconWorks::getSpriteIcon('actions-document-new')) .
00922 '</a>';
00923
00924 } else {
00925 $params = '&edit['.$table.']['.$this->id.']=new';
00926 if ($table == 'pages_language_overlay') {
00927 $params .= '&overrideVals[pages_language_overlay][doktype]=' . (int) $this->pageRow['doktype'];
00928 }
00929 $icon = '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'" title="'.$LANG->getLL('new', TRUE).'">'.
00930 ($table=='pages' ? t3lib_iconWorks::getSpriteIcon('actions-page-new') : t3lib_iconWorks::getSpriteIcon('actions-document-new')) .
00931 '</a>';
00932 }
00933 }
00934
00935
00936 if ($permsEdit && $this->table && is_array($currentIdList)) {
00937 $editIdList = implode(',',$currentIdList);
00938 if ($this->clipNumPane()) $editIdList = "'+editList('".$table."','".$editIdList."')+'";
00939 $params = '&edit['.$table.']['.$editIdList.']=edit&columnsOnly='.implode(',',$this->fieldArray).'&disHelp=1';
00940 $icon .= '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'" title="'.$LANG->getLL('editShownColumns', TRUE) . '">'.
00941 t3lib_iconWorks::getSpriteIcon('actions-document-open') .
00942 '</a>';
00943 }
00944
00945 $theData[$fCol] = ' ';
00946 }
00947 break;
00948 case '_AFTERCONTROL_':
00949 case '_AFTERREF_':
00950 $theData[$fCol] = ' ';
00951 break;
00952 default:
00953 $theData[$fCol]='';
00954 if ($this->table && is_array($currentIdList)) {
00955
00956
00957 if ($this->clipNumPane()) {
00958 $theData[$fCol].='<a href="'.htmlspecialchars($this->listURL('',-1).'&duplicateField='.$fCol).'" title="'.$LANG->getLL('clip_duplicates', TRUE) . '">'.
00959 t3lib_iconWorks::getSpriteIcon('actions-document-duplicates-select') .
00960 '</a>';
00961 }
00962
00963
00964 if (!$TCA[$table]['ctrl']['readOnly'] && $permsEdit && $TCA[$table]['columns'][$fCol]) {
00965 $editIdList = implode(',',$currentIdList);
00966 if ($this->clipNumPane()) $editIdList = "'+editList('".$table."','".$editIdList."')+'";
00967 $params='&edit['.$table.']['.$editIdList.']=edit&columnsOnly='.$fCol.'&disHelp=1';
00968 $iTitle = sprintf($LANG->getLL('editThisColumn'),rtrim(trim($LANG->sL(t3lib_BEfunc::getItemLabel($table,$fCol))),':'));
00969 $theData[$fCol].='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'" title="'.htmlspecialchars($iTitle).'">'.
00970 t3lib_iconWorks::getSpriteIcon('actions-document-open') .
00971 '</a>';
00972 }
00973 }
00974 $theData[$fCol].=$this->addSortLink($LANG->sL(t3lib_BEfunc::getItemLabel($table,$fCol,'<i>[|]</i>')),$fCol,$table);
00975 break;
00976 }
00977
00978 }
00979
00980
00981
00982
00983
00984
00985
00986 if(is_array($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {
00987 foreach($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $classData) {
00988 $hookObject = t3lib_div::getUserObj($classData);
00989 if(!($hookObject instanceof localRecordList_actionsHook)) {
00990 throw new UnexpectedValueException('$hookObject must implement interface localRecordList_actionsHook', 1195567855);
00991 }
00992 $theData = $hookObject->renderListHeader($table, $currentIdList, $theData, $this);
00993 }
00994 }
00995
00996
00997 return $this->addelement(1, $icon, $theData, ' class="c-headLine"', '');
00998 }
00999
01000
01001
01002
01003
01004
01005
01006 protected function renderListNavigation() {
01007 $totalPages = ceil($this->totalItems / $this->iLimit);
01008
01009 $content = '';
01010 $returnContent = '';
01011
01012
01013 if ($totalPages > 1) {
01014 $first = $previous = $next = $last = $reload = '';
01015 $listURL = $this->listURL('', $this->table);
01016
01017
01018 $currentPage = floor(($this->firstElementNumber + 1) / $this->iLimit) + 1;
01019
01020
01021 if ($currentPage > 1) {
01022 $labelFirst = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:first');
01023
01024 $first = '<a href="' . $listURL . '&pointer=0">' .
01025 t3lib_iconWorks::getSpriteIcon('actions-view-paging-first', array('title'=> $labelFirst)) .
01026 '</a>';
01027 } else {
01028 $first = t3lib_iconWorks::getSpriteIcon('actions-view-paging-first-disabled');
01029 }
01030
01031 if (($currentPage - 1) > 0) {
01032 $labelPrevious = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:previous');
01033
01034 $previous = '<a href="' . $listURL . '&pointer=' . (($currentPage - 2) * $this->iLimit) . '">' .
01035 t3lib_iconWorks::getSpriteIcon('actions-view-paging-previous', array('title' => $labelPrevious)) .
01036 '</a>';
01037 } else {
01038 $previous = t3lib_iconWorks::getSpriteIcon('actions-view-paging-previous-disabled');
01039 }
01040
01041 if (($currentPage + 1) <= $totalPages) {
01042 $labelNext = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:next');
01043
01044 $next = '<a href="' . $listURL . '&pointer=' . (($currentPage) * $this->iLimit) . '">' .
01045 t3lib_iconWorks::getSpriteIcon('actions-view-paging-next', array('title' => $labelNext)) .
01046 '</a>';
01047 } else {
01048 $next = t3lib_iconWorks::getSpriteIcon('actions-view-paging-next-disabled');
01049 }
01050
01051 if ($currentPage != $totalPages) {
01052 $labelLast = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:last');
01053
01054 $last = '<a href="' . $listURL . '&pointer=' . (($totalPages - 1) * $this->iLimit) . '">' .
01055 t3lib_iconWorks::getSpriteIcon('actions-view-paging-last', array('title' => $labelLast)) .
01056 '</a>';
01057 } else {
01058 $last = t3lib_iconWorks::getSpriteIcon('actions-view-paging-last-disabled');
01059 }
01060
01061 $reload = '<a href="#" onclick="document.dblistForm.action=\''
01062 . $listURL . '&pointer=\'+calculatePointer(); document.dblistForm.submit(); return true;" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xml:reload', TRUE) . '">' .
01063 t3lib_iconWorks::getSpriteIcon('actions-system-refresh') .
01064 '</a>';
01065
01066
01067 $content = '
01068 <script type="text/JavaScript">
01069
01070
01071 function calculatePointer(){
01072 page = document.getElementById(\'jumpPage\').value;
01073
01074 if (page > ' . $totalPages . ') {
01075 page = ' . $totalPages . ';
01076 }
01077
01078 if (page < 1) {
01079 page = 1;
01080 }
01081
01082 pointer = (page - 1) * ' . $this->iLimit . ';
01083
01084 return pointer;
01085 }
01086
01087
01088 </script>
01089 ';
01090
01091 $pageNumberInput = '<span>
01092 <input type="text" value="' . $currentPage
01093 . '" size="3" id="jumpPage" name="jumpPage" onkeyup="if (event.keyCode == Event.KEY_RETURN) { document.dblistForm.action=\'' . $listURL . '&pointer=\'+calculatePointer(); document.dblistForm.submit(); } return true;" />
01094 </span>';
01095 $pageIndicator = '<span class="pageIndicator">'
01096 . sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:pageIndicator'), $pageNumberInput, $totalPages)
01097 . '</span>';
01098
01099 if ($this->totalItems > ($this->firstElementNumber + $this->iLimit)) {
01100 $lastElementNumber = $this->firstElementNumber + $this->iLimit;
01101 } else {
01102 $lastElementNumber = $this->totalItems;
01103 }
01104 $rangeIndicator = '<span class="pageIndicator">'
01105 . sprintf($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:rangeIndicator'), $this->firstElementNumber + 1, $lastElementNumber)
01106 . '</span>';
01107
01108 $content .= '<div id="typo3-dblist-pagination">'
01109 . $first . $previous
01110 . '<span class="bar"> </span>'
01111 . $rangeIndicator . '<span class="bar"> </span>'
01112 . $pageIndicator . '<span class="bar"> </span>'
01113 . $next . $last . '<span class="bar"> </span>'
01114 . $reload
01115 . '</div>';
01116
01117 $data = Array();
01118 $titleColumn = $this->fieldArray[0];
01119 $data[$titleColumn] = $content;
01120
01121 $returnContent = $this->addElement(1, '', $data);
01122 }
01123
01124 return $returnContent;
01125 }
01126
01127
01128
01129
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141
01142
01143
01144
01145 function makeControl($table,$row) {
01146 global $TCA, $LANG, $SOBE, $TYPO3_CONF_VARS;
01147
01148 if ($this->dontShowClipControlPanels) return '';
01149
01150
01151 t3lib_div::loadTCA($table);
01152 $cells=array();
01153
01154
01155 if ($table=='pages') {
01156 $localCalcPerms = $GLOBALS['BE_USER']->calcPerms(t3lib_BEfunc::getRecord('pages',$row['uid']));
01157 }
01158
01159
01160 $permsEdit = ($table=='pages' && ($localCalcPerms&2)) || ($table!='pages' && ($this->calcPerms&16));
01161
01162
01163 if ($table=='pages' || $table=='tt_content') {
01164 $params='&edit['.$table.']['.$row['uid'].']=edit';
01165 $cells['view']='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::viewOnClick($table=='tt_content'?$this->id.'#'.$row['uid']:$row['uid'], $this->backPath)).'" title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.showPage', TRUE).'">'.
01166 t3lib_iconWorks::getSpriteIcon('actions-document-view') .
01167 '</a>';
01168 } elseif(!$this->table) {
01169 $cells['view'] = $this->spaceIcon;
01170 }
01171
01172
01173 if ($permsEdit) {
01174 $params='&edit['.$table.']['.$row['uid'].']=edit';
01175 $cells['edit']='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'" title="'.$LANG->getLL('edit', TRUE).'">'.
01176 ( $TCA[$table]['ctrl']['readOnly'] ? t3lib_iconWorks::getSpriteIcon('actions-document-open-read-only') : t3lib_iconWorks::getSpriteIcon('actions-document-open') ).
01177 '</a>';
01178 } elseif(!$this->table) {
01179 $cells['edit'] = $this->spaceIcon;
01180 }
01181
01182
01183 if (($table=="tt_content" && $permsEdit) || ($table=='pages')) {
01184 $cells['move']='<a href="#" onclick="'.htmlspecialchars('return jumpExt(\''.$this->backPath.'move_el.php?table='.$table.'&uid='.$row['uid'].'\');').'" title="'.$LANG->getLL('move_' . ($table == 'tt_content' ? 'record' : 'page'), TRUE) . '">' .
01185 ($table == 'tt_content' ? t3lib_iconWorks::getSpriteIcon('actions-document-move') : t3lib_iconWorks::getSpriteIcon('actions-page-move')) .
01186 '</a>';
01187 } elseif(!$this->table) {
01188 $cells['move'] = $this->spaceIcon;
01189 }
01190
01191
01192 if ($SOBE->MOD_SETTINGS['bigControlPanel'] || $this->table) {
01193
01194
01195 $cells['viewBig']='<a href="#" onclick="'.htmlspecialchars('top.launchView(\''.$table.'\', \''.$row['uid'].'\'); return false;').'" title="'.$LANG->getLL('showInfo', TRUE).'">'.
01196 t3lib_iconWorks::getSpriteIcon('actions-document-info') .
01197 '</a>';
01198
01199
01200 if (!$TCA[$table]['ctrl']['readOnly']) {
01201
01202
01203 $cells['history']='<a href="#" onclick="'.htmlspecialchars('return jumpExt(\''.$this->backPath.'show_rechis.php?element='.rawurlencode($table.':'.$row['uid']).'\',\'#latest\');').'" title="'.$LANG->getLL('history', TRUE).'">'.
01204 t3lib_iconWorks::getSpriteIcon('actions-document-history-open') .
01205 '</a>';
01206
01207
01208 if (t3lib_extMgm::isLoaded('version')) {
01209 $vers = t3lib_BEfunc::selectVersionsOfRecord($table, $row['uid'], 'uid', $GLOBALS['BE_USER']->workspace, FALSE, $row);
01210 if (is_array($vers)) {
01211 $versionIcon = 'no-version';
01212 if (count($vers) > 1) {
01213 $versionIcon = count($vers) - 1;
01214 }
01215
01216 $cells['version'] = '<a href="' . htmlspecialchars($this->backPath . t3lib_extMgm::extRelPath('version') . 'cm1/index.php?table=' . rawurlencode($table) . '&uid=' . rawurlencode($row['uid'])) . '" title="' . $LANG->getLL('displayVersions', TRUE) . '">' .
01217 t3lib_iconWorks::getSpriteIcon('status-version-' . $versionIcon) .
01218 '</a>';
01219 } elseif(!$this->table) {
01220 $cells['version'] = $this->spaceIcon;
01221 }
01222 }
01223
01224
01225 if ($table=='pages' && $GLOBALS['BE_USER']->check('modules','web_perm')) {
01226 $cells['perms']='<a href="'.htmlspecialchars('mod/web/perm/index.php?id='.$row['uid'].'&return_id='.$row['uid'].'&edit=1').'" title="'.$LANG->getLL('permissions', TRUE).'">'.
01227 t3lib_iconWorks::getSpriteIcon('status-status-locked') .
01228 '</a>';
01229 } elseif(!$this->table && $GLOBALS['BE_USER']->check('modules','web_perm')) {
01230 $cells['perms'] = $this->spaceIcon;
01231 }
01232
01233
01234 if ($TCA[$table]['ctrl']['sortby'] || $TCA[$table]['ctrl']['useColumnsForDefaultValues']) {
01235 if (
01236 ($table!='pages' && ($this->calcPerms&16)) ||
01237 ($table=='pages' && ($this->calcPerms&8))
01238 ) {
01239 if ($this->showNewRecLink($table)) {
01240 $params='&edit['.$table.']['.(-($row['_MOVE_PLH']?$row['_MOVE_PLH_uid']:$row['uid'])).']=new';
01241 $cells['new']='<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,-1)).'" title="'.$LANG->getLL('new'.($table=='pages'?'Page':'Record'), TRUE).'">'.
01242 ($table=='pages' ? t3lib_iconWorks::getSpriteIcon('actions-page-new') : t3lib_iconWorks::getSpriteIcon('actions-document-new')) .
01243 '</a>';
01244 }
01245 }
01246 } elseif(!$this->table) {
01247 $cells['new'] = $this->spaceIcon;
01248 }
01249
01250
01251 if ($permsEdit && $TCA[$table]['ctrl']['sortby'] && !$this->sortField && !$this->searchLevels) {
01252 if (isset($this->currentTable['prev'][$row['uid']])) {
01253 $params='&cmd['.$table.']['.$row['uid'].'][move]='.$this->currentTable['prev'][$row['uid']];
01254 $cells['moveUp']='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'" title="'.$LANG->getLL('moveUp', TRUE) . '">' .
01255 t3lib_iconWorks::getSpriteIcon('actions-move-up') .
01256 '</a>';
01257 } else {
01258 $cells['moveUp'] = $this->spaceIcon;
01259 }
01260 if ($this->currentTable['next'][$row['uid']]) {
01261 $params='&cmd['.$table.']['.$row['uid'].'][move]='.$this->currentTable['next'][$row['uid']];
01262 $cells['moveDown']='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'" title="'.$LANG->getLL('moveDown', TRUE) . '">' .
01263 t3lib_iconWorks::getSpriteIcon('actions-move-down') .
01264 '</a>';
01265 } else {
01266 $cells['moveDown'] = $this->spaceIcon;
01267 }
01268 } elseif(!$this->table) {
01269 $cells['moveUp'] = $this->spaceIcon;
01270 $cells['moveDown'] = $this->spaceIcon;
01271 }
01272
01273
01274 $hiddenField = $TCA[$table]['ctrl']['enablecolumns']['disabled'];
01275 if ($permsEdit && $hiddenField && $TCA[$table]['columns'][$hiddenField] && (!$TCA[$table]['columns'][$hiddenField]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields',$table.':'.$hiddenField))) {
01276 if ($row[$hiddenField]) {
01277 $params='&data['.$table.']['.$row['uid'].']['.$hiddenField.']=0';
01278 $cells['hide']='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'" title="'.$LANG->getLL('unHide' . ($table == 'pages' ? 'Page' : ''), TRUE) . '">' .
01279 t3lib_iconWorks::getSpriteIcon('actions-edit-unhide') .
01280 '</a>';
01281 } else {
01282 $params='&data['.$table.']['.$row['uid'].']['.$hiddenField.']=1';
01283 $cells['hide']='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'" title="'.$LANG->getLL('hide' . ($table == 'pages' ? 'Page' : ''), TRUE) . '">' .
01284 t3lib_iconWorks::getSpriteIcon('actions-edit-hide') .
01285 '</a>';
01286 }
01287 } elseif(!$this->table) {
01288 $cells['hide'] = $this->spaceIcon;
01289 }
01290
01291
01292 if (($table=='pages' && ($localCalcPerms&4)) || ($table!='pages' && ($this->calcPerms&16))) {
01293 $titleOrig = t3lib_BEfunc::getRecordTitle($table,$row,FALSE,TRUE);
01294 $title = t3lib_div::slashJS(t3lib_div::fixed_lgd_cs($titleOrig, $this->fixedL), 1);
01295 $params = '&cmd['.$table.']['.$row['uid'].'][delete]=1';
01296
01297 $refCountMsg = t3lib_BEfunc::referenceCount(
01298 $table,
01299 $row['uid'],
01300 ' ' . $GLOBALS['LANG']->sL(
01301 'LLL:EXT:lang/locallang_core.xml:labels.referencesToRecord'
01302 ),
01303 $this->getReferenceCount($table, $row['uid'])
01304 ) .
01305 t3lib_BEfunc::translationCount($table, $row['uid'], ' ' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.translationsOfRecord'));
01306 $cells['delete']='<a href="#" onclick="'.htmlspecialchars('if (confirm('.$LANG->JScharCode($LANG->getLL('deleteWarning').' "'. $title.'" '.$refCountMsg).')) {jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');} return false;').'" title="' . $LANG->getLL('delete', TRUE) . '">' .
01307 t3lib_iconWorks::getSpriteIcon('actions-edit-delete') .
01308 '</a>';
01309 } elseif(!$this->table) {
01310 $cells['delete'] = $this->spaceIcon;
01311 }
01312
01313
01314 if ($permsEdit && $table=='pages' && !$this->searchLevels) {
01315
01316
01317 if ($this->calcPerms&8) {
01318 $params='&cmd['.$table.']['.$row['uid'].'][move]='.-$this->id;
01319 $cells['moveLeft']='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'" title="'.$LANG->getLL('prevLevel', TRUE).'">'.
01320 t3lib_iconWorks::getSpriteIcon('actions-move-left') .
01321 '</a>';
01322 }
01323
01324 if ($this->currentTable['prevUid'][$row['uid']]) {
01325 $localCalcPerms = $GLOBALS['BE_USER']->calcPerms(t3lib_BEfunc::getRecord('pages',$this->currentTable['prevUid'][$row['uid']]));
01326 if ($localCalcPerms&8) {
01327 $params='&cmd['.$table.']['.$row['uid'].'][move]='.$this->currentTable['prevUid'][$row['uid']];
01328 $cells['moveRight']='<a href="#" onclick="'.htmlspecialchars('return jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');').'" title="'.$LANG->getLL('nextLevel', TRUE).'">'.
01329 t3lib_iconWorks::getSpriteIcon('actions-move-right') .
01330 '</a>';
01331 } else {
01332 $cells['moveRight'] = $this->spaceIcon;
01333 }
01334 } else {
01335 $cells['moveRight'] = $this->spaceIcon;
01336 }
01337 } elseif(!$this->table) {
01338 $cells['moveLeft'] = $this->spaceIcon;
01339 $cells['moveRight'] = $this->spaceIcon;
01340 }
01341 }
01342 }
01343
01344
01345
01346
01347
01348
01349
01350 if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'])) {
01351 $stat='';
01352 $_params = array($table,$row['uid']);
01353 foreach ($TYPO3_CONF_VARS['SC_OPTIONS']['GLOBAL']['recStatInfoHooks'] as $_funcRef) {
01354 $stat.=t3lib_div::callUserFunction($_funcRef,$_params,$this);
01355 }
01356 $cells['stat'] = $stat;
01357 }
01358
01359
01360
01361
01362
01363
01364 if(is_array($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {
01365 foreach($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $classData) {
01366 $hookObject = t3lib_div::getUserObj($classData);
01367 if(!($hookObject instanceof localRecordList_actionsHook)) {
01368 throw new UnexpectedValueException('$hookObject must implement interface localRecordList_actionsHook', 1195567840);
01369 }
01370 $cells = $hookObject->makeControl($table, $row, $cells, $this);
01371 }
01372 }
01373
01374
01375 return '
01376 <!-- CONTROL PANEL: '.$table.':'.$row['uid'].' -->
01377 <div class="typo3-DBctrl">'.implode('',$cells).'</div>';
01378 }
01379
01380
01381
01382
01383
01384
01385
01386
01387 function makeClip($table,$row) {
01388 global $TCA, $LANG, $TYPO3_CONF_VARS;
01389
01390
01391 if ($this->dontShowClipControlPanels) return '';
01392 $cells=array();
01393
01394 $cells['pasteAfter'] = $cells['pasteInto'] = $this->spaceIcon;
01395
01396 $isL10nOverlay = $this->localizationView && $table != 'pages_language_overlay' && $row[$TCA[$table]['ctrl']['transOrigPointerField']] != 0;
01397
01398
01399 if ($this->clipObj->current=='normal') {
01400
01401
01402 $isSel = (string)$this->clipObj->isSelected($table,$row['uid']);
01403 $cells['copy'] = $isL10nOverlay ? $this->spaceIcon : '<a href="#" onclick="'.htmlspecialchars('return jumpSelf(\''.$this->clipObj->selUrlDB($table,$row['uid'],1,($isSel=='copy'),array('returnUrl'=>'')).'\');').'" title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:cm.copy', TRUE).'">'.
01404 ((!$isSel=='copy') ? t3lib_iconWorks::getSpriteIcon('actions-edit-copy') : t3lib_iconWorks::getSpriteIcon('actions-edit-copy-release')) .
01405 '</a>';
01406 $cells['cut'] = $isL10nOverlay ? $this->spaceIcon : '<a href="#" onclick="'.htmlspecialchars('return jumpSelf(\''.$this->clipObj->selUrlDB($table,$row['uid'],0,($isSel=='cut'),array('returnUrl'=>'')).'\');').'" title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:cm.cut', TRUE).'">'.
01407 ((!$isSel=='cut') ? t3lib_iconWorks::getSpriteIcon('actions-edit-cut') : t3lib_iconWorks::getSpriteIcon('actions-edit-cut-release')) .
01408 '</a>';
01409
01410 } else {
01411
01412
01413 $n=$table.'|'.$row['uid'];
01414 $this->CBnames[]=$n;
01415
01416
01417 $checked = ($this->clipObj->isSelected($table,$row['uid'])?' checked="checked"':'');
01418
01419
01420 if ($this->duplicateField && isset($row[$this->duplicateField])) {
01421 $checked='';
01422 if (in_array($row[$this->duplicateField], $this->duplicateStack)) {
01423 $checked=' checked="checked"';
01424 }
01425 $this->duplicateStack[] = $row[$this->duplicateField];
01426 }
01427
01428
01429 $cells['select'] = $isL10nOverlay ? $this->spaceIcon : '<input type="hidden" name="CBH['.$n.']" value="0" /><input type="checkbox" name="CBC['.$n.']" value="1" class="smallCheckboxes"'.$checked.' />';
01430 }
01431
01432
01433 $elFromTable = $this->clipObj->elFromTable($table);
01434 if (count($elFromTable) && $TCA[$table]['ctrl']['sortby']) {
01435 $cells['pasteAfter'] = $isL10nOverlay ? $this->spaceIcon : '<a href="'.htmlspecialchars($this->clipObj->pasteUrl($table,-$row['uid'])).'" onclick="'.htmlspecialchars('return '.$this->clipObj->confirmMsg($table,$row,'after',$elFromTable)).'" title="'.$LANG->getLL('clip_pasteAfter', TRUE).'">'.
01436 t3lib_iconWorks::getSpriteIcon('actions-document-paste-after') .
01437 '</a>';
01438 }
01439
01440
01441 $elFromTable = $this->clipObj->elFromTable('');
01442 if ($table=='pages' && count($elFromTable)) {
01443 $cells['pasteInto']='<a href="'.htmlspecialchars($this->clipObj->pasteUrl('',$row['uid'])).'" onclick="'.htmlspecialchars('return '.$this->clipObj->confirmMsg($table,$row,'into',$elFromTable)).'" title="'.$LANG->getLL('clip_pasteInto', TRUE).'">'.
01444 t3lib_iconWorks::getSpriteIcon('actions-document-paste-into') .
01445 '</a>';
01446 }
01447
01448
01449
01450
01451
01452
01453
01454 if(is_array($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'])) {
01455 foreach($TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'] as $classData) {
01456 $hookObject = t3lib_div::getUserObj($classData);
01457 if(!($hookObject instanceof localRecordList_actionsHook)) {
01458 throw new UnexpectedValueException('$hookObject must implement interface localRecordList_actionsHook', 1195567845);
01459 }
01460 $cells = $hookObject->makeClip($table, $row, $cells, $this);
01461 }
01462 }
01463
01464
01465 return ' <!-- CLIPBOARD PANEL: '.$table.':'.$row['uid'].' -->
01466 <div class="typo3-clipCtrl">'.implode('',$cells).'</div>';
01467 }
01468
01469
01470
01471
01472
01473
01474
01475
01476
01477
01478 function makeRef($table,$uid) {
01479 t3lib_div::logDeprecatedFunction();
01480
01481
01482 $infoData=array();
01483 if (is_array($this->references)) {
01484 foreach ($this->references as $row) {
01485 $infoData[]=$row['tablename'].':'.$row['recuid'].':'.$row['field'];
01486 }
01487 }
01488
01489 return count($infoData) ? '<a href="#" onclick="'.htmlspecialchars('top.launchView(\''.$table.'\', \''.$uid.'\'); return false;').'" title="'.htmlspecialchars(t3lib_div::fixed_lgd_cs(implode(' / ',$infoData),100)).'">'.count($infoData).'</a>' : '';
01490 }
01491
01492
01493
01494
01495
01496
01497
01498
01499
01500
01501
01502
01503
01504 protected function createReferenceHtml($tableName, $uid) {
01505 $referenceCount = $this->getReferenceCount($tableName, $uid);
01506 if ($referenceCount == 0) {
01507 return '';
01508 }
01509
01510 $queryResult = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
01511 'tablename, recuid, field',
01512 'sys_refindex',
01513 'ref_table = ' . $GLOBALS['TYPO3_DB']->fullQuoteStr(
01514 $tableName, 'sys_refindex'
01515 ) .
01516 ' AND ref_uid = ' . $uid .
01517 ' AND deleted = 0',
01518 '',
01519 '',
01520 '0,20'
01521 );
01522
01523 $referenceTitles = array();
01524
01525 while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($queryResult)) {
01526 $referenceTitles[] = $row['tablename'] . ':' . $row['recuid'] .
01527 ':' . $row['field'];
01528 if (strlen(implode(' / ', $referenceTitles)) >= 100) {
01529 break;
01530 }
01531 }
01532 $GLOBALS['TYPO3_DB']->sql_free_result($queryResult);
01533
01534 return '<a href="#" ' .
01535 'onclick="' . htmlspecialchars(
01536 'top.launchView(\'' . $tableName . '\', \'' . $uid .
01537 '\'); return false;'
01538 ) . '" ' .
01539 'title="' . htmlspecialchars(
01540 t3lib_div::fixed_lgd_cs(implode(' / ', $referenceTitles), 100)
01541 ) . '">' . $referenceCount . '</a>';
01542 }
01543
01544
01545
01546
01547
01548
01549
01550
01551 function makeLocalizationPanel($table,$row) {
01552 global $TCA,$LANG;
01553
01554 $out = array(
01555 0 => '',
01556 1 => '',
01557 );
01558
01559 $translations = $this->translateTools->translationInfo($table, $row['uid'], 0, $row, $this->selFieldList);
01560 $this->translations = $translations['translations'];
01561
01562
01563 $out[0] = $this->languageFlag($row[$TCA[$table]['ctrl']['languageField']]);
01564
01565 if (is_array($translations)) {
01566
01567
01568 $lNew = '';
01569 foreach($this->pageOverlays as $lUid_OnPage => $lsysRec) {
01570 if (!isset($translations['translations'][$lUid_OnPage]) && $GLOBALS['BE_USER']->checkLanguageAccess($lUid_OnPage)) {
01571 $href = $this->backPath . $GLOBALS['TBE_TEMPLATE']->issueCommand(
01572 '&cmd['.$table.']['.$row['uid'].'][localize]='.$lUid_OnPage,
01573 $this->listURL().'&justLocalized='.rawurlencode($table.':'.$row['uid'].':'.$lUid_OnPage)
01574 );
01575 $language = t3lib_BEfunc::getRecord('sys_language', $lUid_OnPage, 'title');
01576 $lC = ($this->languageIconTitles[$lUid_OnPage]['flagIcon'] ? '<img src="'.$this->languageIconTitles[$lUid_OnPage]['flagIcon'].'" class="absmiddle" alt="" />' : $this->languageIconTitles[$lUid_OnPage]['title']);
01577 $lC = '<a href="' . htmlspecialchars($href) . '" title="' . htmlspecialchars($language['title']) . '">' . $lC . '</a> ';
01578
01579 $lNew.=$lC;
01580 }
01581 }
01582
01583 if ($lNew) $out[1].= $lNew;
01584 } else {
01585 $out[0] = ' '.$out[0];
01586 }
01587
01588
01589 return $out;
01590 }
01591
01592
01593
01594
01595
01596
01597
01598
01599 function fieldSelectBox($table,$formFields=1) {
01600 global $TCA, $LANG;
01601
01602
01603 t3lib_div::loadTCA($table);
01604 $formElements=array('','');
01605 if ($formFields) {
01606 $formElements=array('<form action="'.htmlspecialchars($this->listURL()).'" method="post">','</form>');
01607 }
01608
01609
01610 $setFields=is_array($this->setFields[$table]) ? $this->setFields[$table] : array();
01611
01612
01613 $fields = $this->makeFieldList($table, false, true);
01614
01615
01616 $fields[]='_PATH_';
01617 $fields[]='_REF_';
01618 $fields[]='_LOCALIZATION_';
01619 $fields[]='_CONTROL_';
01620 $fields[]='_CLIPBOARD_';
01621
01622
01623 $opt=array();
01624 $opt[] = '<option value=""></option>';
01625 foreach($fields as $fN) {
01626 $fL = is_array($TCA[$table]['columns'][$fN]) ? rtrim($LANG->sL($TCA[$table]['columns'][$fN]['label']),':') : '['.$fN.']';
01627 $opt[] = '
01628 <option value="'.$fN.'"'.(in_array($fN,$setFields)?' selected="selected"':'').'>'.htmlspecialchars($fL).'</option>';
01629 }
01630
01631
01632 $lMenu = '
01633 <select size="'.t3lib_div::intInRange(count($fields)+1,3,20).'" multiple="multiple" name="displayFields['.$table.'][]">'.implode('',$opt).'
01634 </select>
01635 ';
01636
01637
01638 $content.= '
01639 '.$formElements[0].'
01640
01641 <!--
01642 Field selector for extended table view:
01643 -->
01644 <table border="0" cellpadding="0" cellspacing="0" class="bgColor4" id="typo3-dblist-fieldSelect">
01645 <tr>
01646 <td>'.$lMenu.'</td>
01647 <td><input type="submit" name="search" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.setFields',1).'" /></td>
01648 </tr>
01649 </table>
01650 '.$formElements[1];
01651 return $content;
01652 }
01653
01654
01655
01656
01657
01658
01659
01660
01661
01662
01663
01664
01665
01666
01667
01668
01669
01670
01671
01672
01673
01674
01675
01676
01677
01678
01679
01680 function linkClipboardHeaderIcon($string,$table,$cmd,$warning='') {
01681 $onClickEvent = 'document.dblistForm.cmd.value=\''.$cmd.'\';document.dblistForm.cmd_table.value=\''.$table.'\';document.dblistForm.submit();';
01682 if ($warning) $onClickEvent = 'if (confirm('.$GLOBALS['LANG']->JScharCode($warning).')){'.$onClickEvent.'}';
01683 return '<a href="#" onclick="'.htmlspecialchars($onClickEvent.'return false;').'">'.$string.'</a>';
01684 }
01685
01686
01687
01688
01689
01690
01691 function clipNumPane() {
01692 return in_Array('_CLIPBOARD_',$this->fieldArray) && $this->clipObj->current!='normal';
01693 }
01694
01695
01696
01697
01698
01699
01700
01701
01702
01703
01704
01705 function addSortLink($code,$field,$table) {
01706
01707
01708 if ($field=='_CONTROL_' || $field=='_LOCALIZATION_' || $field=='_CLIPBOARD_' || $field=='_REF_' || $this->disableSingleTableView) return $code;
01709
01710
01711 if ($field=='_PATH_') $field=pid;
01712
01713
01714 $sortUrl = $this->listURL('',-1,'sortField,sortRev,table').'&table='.$table.'&sortField='.$field.'&sortRev='.($this->sortRev || ($this->sortField!=$field)?0:1);
01715 $sortArrow = ($this->sortField==$field?'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/red'.($this->sortRev?'up':'down').'.gif','width="7" height="4"').' alt="" />':'');
01716
01717
01718 return '<a href="'.htmlspecialchars($sortUrl).'">'.$code.
01719 $sortArrow.
01720 '</a>';
01721 }
01722
01723
01724
01725
01726
01727
01728
01729
01730 function recPath($pid) {
01731 if (!isset($this->recPath_cache[$pid])) {
01732 $this->recPath_cache[$pid] = t3lib_BEfunc::getRecordPath($pid,$this->perms_clause,20);
01733 }
01734 return $this->recPath_cache[$pid];
01735 }
01736
01737
01738
01739
01740
01741
01742
01743
01744 function showNewRecLink($table) {
01745
01746 if (!count($this->allowedNewTables) && !count($this->deniedNewTables)) {
01747 return true;
01748
01749 } elseif (!in_array($table, $this->deniedNewTables) && (!count($this->allowedNewTables) || in_array($table, $this->allowedNewTables))) {
01750 return true;
01751
01752 } else {
01753 return false;
01754 }
01755 }
01756
01757
01758
01759
01760
01761
01762
01763 function makeReturnUrl() {
01764 return '&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
01765 }
01766
01767
01768
01769
01770
01771
01772
01773
01774
01775
01776
01777
01778
01779
01780
01781
01782
01783
01784
01785
01786
01787
01788 protected function initCSV() {
01789 $this->addHeaderRowToCSV();
01790 }
01791
01792
01793
01794
01795
01796
01797 protected function addHeaderRowToCSV() {
01798
01799 $this->addToCSV(array_combine($this->fieldArray, $this->fieldArray));
01800 }
01801
01802
01803
01804
01805
01806
01807
01808
01809 protected function addToCSV(array $row = array(), $table = '') {
01810 $rowReducedByControlFields = self::removeControlFieldsFromFieldRow($row);
01811 $rowReducedToSelectedColumns = array_intersect_key($rowReducedByControlFields, array_flip($this->fieldArray));
01812 $this->setCsvRow($rowReducedToSelectedColumns);
01813 }
01814
01815
01816
01817
01818
01819
01820
01821 protected static function removeControlFieldsFromFieldRow(array $row = array()) {
01822
01823 $controlFields = array(
01824 '_PATH_',
01825 '_REF_',
01826 '_CONTROL_',
01827 '_AFTERCONTROL_',
01828 '_AFTERREF_',
01829 '_CLIPBOARD_',
01830 '_LOCALIZATION_',
01831 '_LOCALIZATION_b',
01832 );
01833 return array_diff_key($row, array_flip($controlFields));
01834 }
01835
01836
01837
01838
01839
01840
01841
01842
01843 function setCsvRow($csvRow) {
01844 $this->csvLines[] = t3lib_div::csvValues($csvRow);
01845 }
01846
01847
01848
01849
01850
01851
01852
01853
01854 function outputCSV($prefix) {
01855
01856
01857 $filename=$prefix.'_'.date('dmy-Hi').'.csv';
01858
01859
01860 $mimeType = 'application/octet-stream';
01861 Header('Content-Type: '.$mimeType);
01862 Header('Content-Disposition: attachment; filename='.$filename);
01863
01864
01865 echo implode(chr(13).chr(10),$this->csvLines);
01866
01867
01868 exit;
01869 }
01870 }
01871
01872
01873
01874 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.db_list_extra.inc']) {
01875 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.db_list_extra.inc']);
01876 }
01877
01878 ?>