Commit 6500d6da authored by Kasper Skårhøj's avatar Kasper Skårhøj
Browse files

* Added Page TSconfig option "mod.web_list.listOnlyInSingleTableView = 1" which makes the List module list only the table names by default. You have to click the table name to get the single-table view before records show up. This is useful for pages containing many records from many tables.


git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@222 709f56b5-9817-0410-a4d7-c38de5d9e867
parent b1db41d2
2004-04-23 Kasper Skårhøj,,, <kasper@typo3.com>
* Added Page TSconfig option "mod.web_list.listOnlyInSingleTableView = 1" which makes the List module list only the table names by default. You have to click the table name to get the single-table view before records show up. This is useful for pages containing many records from many tables.
2004-04-23 Kasper Skårhøj,,, <kasper@typo3.com>
* Added refresh button to taskcenter (not in core CVS)
......
......@@ -85,7 +85,7 @@ class t3lib_recordList {
var $oddColumnsTDParams =''; // If set this is <td>-params for odd columns in addElement. Used with db_layout / pages section
var $backPath='';
var $fieldArray = Array(); // Decides the columns shown. Filled with values that refers to the keys of the data-array. $this->fieldArray[0] is the title column.
var $addElement_tdParams=array(); // Keys are fieldnames and values are td-parameters to add in addElement();
var $addElement_tdParams = array(); // Keys are fieldnames and values are td-parameters to add in addElement();
// Not used in this class - but maybe extension classes...
var $fixedL = 50; // Max length of strings
......@@ -150,8 +150,8 @@ class t3lib_recordList {
$lastKey='';
$c=0;
$ccount=0;
$tdP[0]= $this->oddColumnsTDParams ? $this->oddColumnsTDParams : $tdParams;
$tdP[1]=$tdParams;
$tdP[0] = $this->oddColumnsTDParams ? $this->oddColumnsTDParams : $tdParams;
$tdP[1] = $tdParams;
// Traverse field array which contains the data to present:
reset($this->fieldArray);
......
......@@ -103,6 +103,7 @@ class recordList extends t3lib_recordList {
// Internal, static:
var $id; // Page id
var $table=''; // Tablename if single-table mode
var $listOnlyInSingleTableMode=FALSE; // If true, records are listed only if a specific table is selected.
var $firstElementNumber=0; // Pointer for browsing list
var $searchString=''; // Search string
var $searchLevels=''; // Levels to search down.
......
......@@ -364,17 +364,21 @@ class localRecordList extends recordList {
$dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);
}
$LOISmode = $this->listOnlyInSingleTableMode && !$this->table;
// If any records was selected, render the list:
if ($dbCount) {
// Half line is drawn between tables:
$theData = Array();
if (!$this->table && !$rowlist) {
$theData[$titleCol] = '<img src="clear.gif" width="'.($GLOBALS['SOBE']->MOD_SETTINGS['bigControlPanel']?'230':'350').'" height="1" alt="" />';
if (in_array('_CONTROL_',$this->fieldArray)) $theData['_CONTROL_']='';
if (in_array('_CLIPBOARD_',$this->fieldArray)) $theData['_CLIPBOARD_']='';
if (!$LOISmode) {
$theData = Array();
if (!$this->table && !$rowlist) {
$theData[$titleCol] = '<img src="clear.gif" width="'.($GLOBALS['SOBE']->MOD_SETTINGS['bigControlPanel']?'230':'350').'" height="1" alt="" />';
if (in_array('_CONTROL_',$this->fieldArray)) $theData['_CONTROL_']='';
if (in_array('_CLIPBOARD_',$this->fieldArray)) $theData['_CLIPBOARD_']='';
}
$out.=$this->addelement(0,'',$theData,'',$this->leftMargin);
}
$out.=$this->addelement(0,'',$theData,'',$this->leftMargin);
// Header line is drawn
$theData = Array();
......@@ -383,59 +387,81 @@ class localRecordList extends recordList {
} else {
$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="" />');
}
$theUpIcon = ($table=='pages'&&$this->id&&isset($this->pageRow['pid'])) ? '<a href="'.htmlspecialchars($this->listURL($this->pageRow['pid'])).'"><img'.t3lib_iconWorks::skinImg('','gfx/i/pages_up.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel',1).'" alt="" /></a>':'';
$out.=$this->addelement(1,$theUpIcon,$theData,' class="c-headLineTable"','');
// Fixing a order table for sortby tables
$this->currentTable=array();
$currentIdList=array();
$doSort = ($TCA[$table]['ctrl']['sortby'] && !$this->sortField);
$prevUid=0;
$prevPrevUid=0;
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
$currentIdList[] = $row['uid'];
if ($doSort) {
if ($prevUid) {
$this->currentTable['prev'][$row['uid']]=$prevPrevUid;
$this->currentTable['next'][$prevUid]='-'.$row['uid'];
$this->currentTable['prevUid'][$row['uid']]=$prevUid;
if ($LOISmode) {
$out.='
<tr>
<td class="c-headLineTable" style="width:95%;">'.$theData[$titleCol].'</td>
</tr>';
if ($GLOBALS['BE_USER']->uc["edit_showFieldHelp"]) {
$GLOBALS['LANG']->loadSingleTableDescription($table);
if (isset($GLOBALS['TCA_DESCR'][$table]['columns'][''])) {
$onClick = 'vHWin=window.open(\'view_help.php?tfID='.$table.'.\',\'viewFieldHelp\',\'height=300,width=250,status=0,menubar=0,scrollbars=1\');vHWin.focus();return false;';
$out.='
<tr>
<td class="c-tableDescription">'.t3lib_BEfunc::helpTextIcon($table,'',$this->backPath,TRUE).$GLOBALS['TCA_DESCR'][$table]['columns']['']['description'].'</td>
</tr>';
}
$prevPrevUid = isset($this->currentTable['prev'][$row['uid']]) ? -$prevUid : $row['pid'];
$prevUid=$row['uid'];
}
} else {
$theUpIcon = ($table=='pages'&&$this->id&&isset($this->pageRow['pid'])) ? '<a href="'.htmlspecialchars($this->listURL($this->pageRow['pid'])).'"><img'.t3lib_iconWorks::skinImg('','gfx/i/pages_up.gif','width="18" height="16"').' title="'.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.upOneLevel',1).'" alt="" /></a>':'';
$out.=$this->addelement(1,$theUpIcon,$theData,' class="c-headLineTable"','');
}
$GLOBALS['TYPO3_DB']->sql_data_seek($result,0);
// CSV initiated
if ($this->csvOutput) $this->initCSV();
If (!$LOISmode) {
// Fixing a order table for sortby tables
$this->currentTable = array();
$currentIdList = array();
$doSort = ($TCA[$table]['ctrl']['sortby'] && !$this->sortField);
$prevUid = 0;
$prevPrevUid = 0;
$accRows = array(); // Accumulate rows here
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
$accRows[] = $row;
$currentIdList[] = $row['uid'];
if ($doSort) {
if ($prevUid) {
$this->currentTable['prev'][$row['uid']] = $prevPrevUid;
$this->currentTable['next'][$prevUid] = '-'.$row['uid'];
$this->currentTable['prevUid'][$row['uid']] = $prevUid;
}
$prevPrevUid = isset($this->currentTable['prev'][$row['uid']]) ? -$prevUid : $row['pid'];
$prevUid=$row['uid'];
}
}
$GLOBALS['TYPO3_DB']->sql_free_result($result);
// CSV initiated
if ($this->csvOutput) $this->initCSV();
// Render items:
$this->CBnames=array();
$this->duplicateStack=array();
$this->eCounter=$this->firstElementNumber;
// Render items:
$this->CBnames=array();
$this->duplicateStack=array();
$this->eCounter=$this->firstElementNumber;
$iOut='';
$cc=0;
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result)) {
$iOut = '';
$cc = 0;
foreach($accRows as $row) {
// Forward/Backwards navigation links:
list($flag,$code) = $this->fwd_rwd_nav($table);
$iOut.=$code;
// Forward/Backwards navigation links:
list($flag,$code) = $this->fwd_rwd_nav($table);
$iOut.=$code;
// If render item, increment counter and call function
if ($flag) {
$cc++;
$iOut.=$this->renderListRow($table,$row,$cc,$titleCol,$thumbsCol);
// If render item, increment counter and call function
if ($flag) {
$cc++;
$iOut.=$this->renderListRow($table,$row,$cc,$titleCol,$thumbsCol);
}
// Counter of total rows incremented:
$this->eCounter++;
}
// Counter of total rows incremented:
$this->eCounter++;
// The header row for the table is now created:
$out.=$this->renderListHeader($table,$currentIdList);
}
$GLOBALS['TYPO3_DB']->sql_free_result($result);
// The header row for the table is now created:
$out.=$this->renderListHeader($table,$currentIdList);
// The list of records is added after the header:
$out.=$iOut;
......@@ -448,7 +474,7 @@ class localRecordList extends recordList {
<!--
DB listing of elements: "'.htmlspecialchars($table).'"
-->
<table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist">
<table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist'.($LOISmode?' typo3-dblist-overview':'').'">
'.$out.'
</table>';
......
......@@ -212,6 +212,7 @@ class SC_db_list {
$dblist->allFields = ($this->MOD_SETTINGS['bigControlPanel'] || $this->table) ? 1 : 0;
$dblist->showClipboard = 1;
$dblist->disableSingleTableView = $this->modTSconfig['properties']['disableSingleTableView'];
$dblist->listOnlyInSingleTableMode = $this->modTSconfig['properties']['listOnlyInSingleTableView'];
$dblist->alternateBgColors=$this->modTSconfig['properties']['alternateBgColors']?1:0;
$dblist->allowedNewTables = t3lib_div::trimExplode(',',$this->modTSconfig['properties']['allowedNewTables'],1);
$dblist->newWizards=$this->modTSconfig['properties']['newWizards']?1:0;
......
......@@ -321,6 +321,9 @@ TABLE.typo3-dblist TR TD.c-headLineTable A { text-decoration: none;font-weight:
TABLE.typo3-dblist TR TD DIV.typo3-DBctrl { background-color: #C5C1B5; }
TABLE.typo3-dblist TR TD DIV.typo3-clipCtrl {background-color: #ABBBB4; text-align: center; }
TABLE.typo3-dblist TR TD DIV.typo3-clipCtrl IMG, TABLE.typo3-dblist TR TD DIV.typo3-DBctrl IMG { margin-left: 1px; margin-right: 1px; }
TABLE.typo3-dblist-overview { width: 410px; margin-top: 10px; margin-left:1px;}
TABLE.typo3-dblist-overview TD.c-tableDescription {padding-left: 10px; font-style: italic; color: #333333;}
TABLE.typo3-dblist-overview TD.c-tableDescription IMG { margin-right: 10px; }
DIV#typo3-newRecordLink { margin: 5px 0px 5px 0px; font-weight: bold;}
DIV#typo3-newRecordLink IMG { margin-right: 5px; vertical-align: middle; }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment