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 }
00962 }
00963 }
00964
00965
00966 if ($lockInfo=t3lib_BEfunc::isRecordLocked($table,$row['uid'])) {
00967 $cells[]='<a href="#" onclick="'.htmlspecialchars('alert('.$LANG->JScharCode($lockInfo['msg']).');return false;').'">'.
00968 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/recordlock_warning3.gif','width="17" height="12"').' title="'.htmlspecialchars($lockInfo['msg']).'" alt="" />'.
00969 '</a>';
00970 }
00971
00972
00973
00974 return '
00975 <!-- CONTROL PANEL: '.$table.':'.$row['uid'].' -->
00976 <div class="typo3-DBctrl">'.implode('',$cells).'</div>';
00977 }
00978
00986 function makeClip($table,$row) {
00987 global $TCA, $LANG;
00988
00989
00990 if ($this->dontShowClipControlPanels) return '';
00991 $cells=array();
00992
00993
00994
00995
00996 if ($this->clipObj->current=='normal') {
00997
00998
00999 $isSel = (string)$this->clipObj->isSelected($table,$row['uid']);
01000 $cells[]='<a href="#" onclick="'.htmlspecialchars('return jumpSelf(\''.$this->clipObj->selUrlDB($table,$row['uid'],1,($isSel=='copy'),array('returnUrl'=>'')).'\');').'">'.
01001 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_copy'.($isSel=='copy'?'_h':'').'.gif','width="12" height="12"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:cm.copy',1).'" alt="" />'.
01002 '</a>';
01003 $cells[]='<a href="#" onclick="'.htmlspecialchars('return jumpSelf(\''.$this->clipObj->selUrlDB($table,$row['uid'],0,($isSel=='cut'),array('returnUrl'=>'')).'\');').'">'.
01004 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_cut'.($isSel=='cut'?'_h':'').'.gif','width="12" height="12"').' title="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:cm.cut',1).'" alt="" />'.
01005 '</a>';
01006
01007 } else {
01008
01009
01010 $n=$table.'|'.$row['uid'];
01011 $this->CBnames[]=$n;
01012
01013
01014 $checked = ($this->clipObj->isSelected($table,$row['uid'])?' checked="checked"':'');
01015
01016
01017 if ($this->duplicateField && isset($row[$this->duplicateField])) {
01018 $checked='';
01019 if (in_array($row[$this->duplicateField], $this->duplicateStack)) {
01020 $checked=' checked="checked"';
01021 }
01022 $this->duplicateStack[] = $row[$this->duplicateField];
01023 }
01024
01025
01026 $cells[]='<input type="hidden" name="CBH['.$n.']" value="0" /><input type="checkbox" name="CBC['.$n.']" value="1" class="smallCheckboxes"'.$checked.' />';
01027 }
01028
01029
01030 $elFromTable = $this->clipObj->elFromTable($table);
01031 if (count($elFromTable) && $TCA[$table]['ctrl']['sortby']) {
01032 $cells[]='<a href="'.htmlspecialchars($this->clipObj->pasteUrl($table,-$row['uid'])).'" onclick="'.htmlspecialchars('return '.$this->clipObj->confirmMsg($table,$row,'after',$elFromTable)).'">'.
01033 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_pasteafter.gif','width="12" height="12"').' title="'.$LANG->getLL('clip_pasteAfter',1).'" alt="" />'.
01034 '</a>';
01035 }
01036
01037
01038 $elFromTable = $this->clipObj->elFromTable('');
01039 if ($table=='pages' && count($elFromTable)) {
01040 $cells[]='<a href="'.htmlspecialchars($this->clipObj->pasteUrl('',$row['uid'])).'" onclick="'.htmlspecialchars('return '.$this->clipObj->confirmMsg($table,$row,'into',$elFromTable)).'">'.
01041 '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/clip_pasteinto.gif','width="12" height="12"').' title="'.$LANG->getLL('clip_pasteInto',1).'" alt="" />'.
01042 '</a>';
01043 }
01044
01045
01046 return ' <!-- CLIPBOARD PANEL: '.$table.':'.$row['uid'].' -->
01047 <div class="typo3-clipCtrl">'.implode('',$cells).'</div>';
01048 }
01049
01057 function makeRef($table,$uid) {
01058
01059
01060 $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
01061 '*',
01062 'sys_refindex',
01063 'ref_table='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table,'sys_refindex').
01064 ' AND ref_uid='.intval($uid).
01065 ' AND deleted=0'
01066 );
01067
01068
01069 $infoData=array();
01070 if (is_array($rows)) {
01071 foreach($rows as $row) {
01072 $infoData[]=$row['tablename'].':'.$row['recuid'].':'.$row['field'];
01073 }
01074 }
01075
01076 return count($infoData) ? '<a href="#" onclick="'.htmlspecialchars('top.launchView(\''.$table.'\', \''.$uid.'\'); return false;').'" title="'.htmlspecialchars(t3lib_div::fixed_lgd(implode(' / ',$infoData),100)).'">'.count($infoData).'</a>' : '';
01077 }
01078
01086 function makeLocalizationPanel($table,$row) {
01087 global $TCA,$LANG;
01088
01089 $out = array(
01090 0 => '',
01091 1 => '',
01092 );
01093
01094 $t8Tools = t3lib_div::makeInstance('t3lib_transl8tools');
01095 $translations = $t8Tools->translationInfo($table,$row['uid']);
01096
01097
01098 $out[0] = $this->languageFlag($row[$TCA[$table]['ctrl']['languageField']]);
01099
01100 if (is_array($translations)) {
01101
01102
01103 $lNew = '';
01104 foreach($this->pageOverlays as $lUid_OnPage => $lsysRec) {
01105 if (!isset($translations['translations'][$lUid_OnPage]) && $GLOBALS['BE_USER']->checkLanguageAccess($lUid_OnPage)) {
01106 $href = $GLOBALS['TBE_TEMPLATE']->issueCommand(
01107 '&cmd['.$table.']['.$row['uid'].'][localize]='.$lUid_OnPage,
01108 $this->listURL().'&justLocalized='.rawurlencode($table.':'.$row['uid'].':'.$lUid_OnPage)
01109 );
01110
01111 $lC = ($this->languageIconTitles[$lUid_OnPage]['flagIcon'] ? '<img src="'.$this->languageIconTitles[$lUid_OnPage]['flagIcon'].'" class="absmiddle" alt="" />' : $this->languageIconTitles[$lUid_OnPage]['title']);
01112 $lC = '<a href="'.htmlspecialchars($href).'">'.$lC.'</a> ';
01113
01114 $lNew.=$lC;
01115 }
01116 }
01117
01118 if ($lNew) $out[1].= $lNew;
01119 } else {
01120 $out[0] = ' '.$out[0];
01121 }
01122
01123
01124 return $out;
01125 }
01126
01134 function fieldSelectBox($table,$formFields=1) {
01135 global $TCA, $LANG;
01136
01137
01138 t3lib_div::loadTCA($table);
01139 $formElements=array('','');
01140 if ($formFields) {
01141 $formElements=array('<form action="'.htmlspecialchars($this->listURL()).'" method="post">','</form>');
01142 }
01143
01144
01145 $setFields=is_array($this->setFields[$table]) ? $this->setFields[$table] : array();
01146
01147
01148 $fields = $this->makeFieldList($table);
01149
01150
01151 $fields[]='tstamp';
01152 $fields[]='crdate';
01153 $fields[]='_PATH_';
01154 $fields[]='_REF_';
01155 $fields[]='_LOCALIZATION_';
01156 $fields[]='_CONTROL_';
01157 $fields[]='_CLIPBOARD_';
01158
01159
01160 $opt=array();
01161 $opt[] = '<option value=""></option>';
01162 foreach($fields as $fN) {
01163 $fL = is_array($TCA[$table]['columns'][$fN]) ? ereg_replace(':$','',$LANG->sL($TCA[$table]['columns'][$fN]['label'])) : '['.$fN.']';
01164 $opt[] = '
01165 <option value="'.$fN.'"'.(in_array($fN,$setFields)?' selected="selected"':'').'>'.htmlspecialchars($fL).'</option>';
01166 }
01167
01168
01169 $lMenu = '
01170 <select size="'.t3lib_div::intInRange(count($fields)+1,3,20).'" multiple="multiple" name="displayFields['.$table.'][]">'.implode('',$opt).'
01171 </select>
01172 ';
01173
01174
01175 $content.= '
01176 '.$formElements[0].'
01177
01178 <!--
01179 Field selector for extended table view:
01180 -->
01181 <table border="0" cellpadding="0" cellspacing="0" class="bgColor4" id="typo3-dblist-fieldSelect">
01182 <tr>
01183 <td>'.$lMenu.'</td>
01184 <td><input type="submit" name="search" value="'.$LANG->sL('LLL:EXT:lang/locallang_core.php:labels.setFields',1).'" /></td>
01185 </tr>
01186 </table>
01187 '.$formElements[1];
01188 return $content;
01189 }
01190
01191
01192
01193
01194
01195
01196
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01217 function linkClipboardHeaderIcon($string,$table,$cmd,$warning='') {
01218 $onClickEvent = 'document.dblistForm.cmd.value=\''.$cmd.'\';document.dblistForm.cmd_table.value=\''.$table.'\';document.dblistForm.submit();';
01219 if ($warning) $onClickEvent = 'if (confirm('.$GLOBALS['LANG']->JScharCode($warning).')){'.$onClickEvent.'}';
01220 return '<a href="#" onclick="'.htmlspecialchars($onClickEvent.'return false;').'">'.$string.'</a>';
01221 }
01222
01228 function clipNumPane() {
01229 return in_Array('_CLIPBOARD_',$this->fieldArray) && $this->clipObj->current!='normal';
01230 }
01231
01242 function addSortLink($code,$field,$table) {
01243
01244
01245 if ($field=='_CONTROL_' || $field=='_LOCALIZATION_' || $field=='_CLIPBOARD_' || $field=='_REF_' || $this->disableSingleTableView) return $code;
01246
01247
01248 if ($field=='_PATH_') $field=pid;
01249
01250
01251 $sortUrl = $this->listURL('',-1,'sortField,sortRev,table').'&table='.$table.'&sortField='.$field.'&sortRev='.($this->sortRev || ($this->sortField!=$field)?0:1);
01252 $sortArrow = ($this->sortField==$field?'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/red'.($this->sortRev?'up':'down').'.gif','width="7" height="4"').' alt="" />':'');
01253
01254
01255 return '<a href="'.htmlspecialchars($sortUrl).'">'.$code.
01256 $sortArrow.
01257 '</a>';
01258 }
01259
01267 function recPath($pid) {
01268 if (!isset($this->recPath_cache[$pid])) {
01269 $this->recPath_cache[$pid] = t3lib_BEfunc::getRecordPath($pid,$this->perms_clause,20);
01270 }
01271 return $this->recPath_cache[$pid];
01272 }
01273
01280 function showNewRecLink($table) {
01281 return !count($this->allowedNewTables) || in_array($table,$this->allowedNewTables);
01282 }
01283
01290 function makeReturnUrl() {
01291 return '&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'));
01292 }
01293
01294
01295
01296
01297
01298
01299
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01315 function initCSV() {
01316
01317
01318 $this->csvLines=array();
01319
01320
01321 $csvRow=array();
01322 foreach($this->fieldArray as $fN) {
01323 $csvRow[]=$fN;
01324 }
01325
01326
01327 $this->setCsvRow($csvRow);
01328 $this->csvLines[]='';
01329 }
01330
01338 function addToCSV($row,$table) {
01339
01340
01341 $csvRow=array();
01342 foreach($this->fieldArray as $fN) {
01343 if ($fN=='_PATH_') {
01344 $csvRow[]=$this->recPath($row['pid']);
01345 } elseif ($fN=='_REF_') {
01346 $csvRow[]=$this->makeRef($table, $row['uid']);
01347 } else {
01348 $csvRow[]=$row[$fN];
01349 }
01350 }
01351
01352
01353 $this->setCsvRow($csvRow);
01354 }
01355
01362 function setCsvRow($csvRow) {
01363 $this->csvLines[] = t3lib_div::csvValues($csvRow);
01364 }
01365
01373 function outputCSV($prefix) {
01374
01375
01376 $filename=$prefix.'_'.date('dmy-Hi').'.csv';
01377
01378
01379 $mimeType = 'application/octet-stream';
01380 Header('Content-Type: '.$mimeType);
01381 Header('Content-Disposition: attachment; filename='.$filename);
01382
01383
01384 echo implode(chr(13).chr(10),$this->csvLines);
01385
01386
01387 exit;
01388 }
01389 }
01390
01391
01392
01393 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.db_list_extra.inc']) {
01394 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['typo3/class.db_list_extra.inc']);
01395 }
01396 ?>