Index: t3lib/class.t3lib_recordlist.php
===================================================================
--- t3lib/class.t3lib_recordlist.php (revision 9397)
+++ t3lib/class.t3lib_recordlist.php (revision )
@@ -1,29 +1,29 @@
List and File>Filelist
*
@@ -80,34 +66,34 @@
class t3lib_recordList {
// Used in this class:
- var $iLimit = 10; // default Max items shown
+ var $iLimit = 10; // default Max items shown
- var $leftMargin = 0; // OBSOLETE - NOT USED ANYMORE. leftMargin
+ var $leftMargin = 0; // OBSOLETE - NOT USED ANYMORE. leftMargin
var $showIcon = 1;
var $no_noWrap = 0;
- var $oddColumnsTDParams = ''; // Deprecated since TYPO3 4.2, remove in 4.4. If set this is
-params for odd columns in addElement. Used with db_layout / pages section
+ var $oddColumnsTDParams = ''; // Deprecated since TYPO3 4.2, remove in 4.4. If set this is | -params for odd columns in addElement. Used with db_layout / pages section
- var $oddColumnsCssClass = ''; // If set this is | CSS-classname for odd columns in addElement. Used with db_layout / pages section
+ var $oddColumnsCssClass = ''; // If set this is | CSS-classname for odd columns in addElement. Used with db_layout / pages section
- var $backPath='';
+ 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 $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(), please use $addElement_tdCSSClass for CSS-classes;
+ var $addElement_tdParams = array(); // Keys are fieldnames and values are td-parameters to add in addElement(), please use $addElement_tdCSSClass for CSS-classes;
- var $addElement_tdCssClass = array(); // Keys are fieldnames and values are td-css-classes to add in addElement();
+ var $addElement_tdCssClass = array(); // Keys are fieldnames and values are td-css-classes to add in addElement();
// Not used in this class - but maybe extension classes...
- var $fixedL = 30; // Max length of strings
+ var $fixedL = 30; // Max length of strings
var $script = '';
var $thumbScript = 'thumbs.php';
- var $setLMargin=1; // Set to zero, if you don't want a left-margin with addElement function
+ var $setLMargin = 1; // Set to zero, if you don't want a left-margin with addElement function
- var $counter=0; // Counter increased for each element. Used to index elements for the JavaScript-code that transfers to the clipboard
+ var $counter = 0; // Counter increased for each element. Used to index elements for the JavaScript-code that transfers to the clipboard
- var $totalItems = ''; // This could be set to the total number of items. Used by the fwd_rew_navigation...
+ var $totalItems = ''; // This could be set to the total number of items. Used by the fwd_rew_navigation...
// Internal (used in this class.)
- var $firstElementNumber=0;
+ var $firstElementNumber = 0;
- var $eCounter=0;
+ var $eCounter = 0;
- var $HTMLcode=''; // String with accumulated HTML content
+ var $HTMLcode = ''; // String with accumulated HTML content
- var $pageOverlays = array(); // Contains page translation languages
+ var $pageOverlays = array(); // Contains page translation languages
- var $languageIconTitles = array(); // Contains sys language icons and titles
+ var $languageIconTitles = array(); // Contains sys language icons and titles
- var $translateTools; // translateTools object
+ var $translateTools; // translateTools object
/**
* constructor for t3lib_recordList
@@ -134,75 +120,84 @@
* @param string $altLine is the HTML -tag for an alternative 'gfx/ol/line.gif'-icon (used in the top)
* @return string HTML content for the table row
*/
- function addElement($h, $icon, $data, $trParams = '', $lMargin = '', $altLine = '') {
+ function addElement($h, $icon, $data, $trParams = '', $lMargin = '', $altLine = '') {
$noWrap = ($this->no_noWrap) ? '' : ' nowrap="nowrap"';
// Start up:
- $out='
+ $out = '
- | ';
+
';
// Show icon and lines
- if ($this->showIcon) {
+ if ($this->showIcon) {
- $out.='
+ $out .= '
';
- if (!$h) {
+ if (!$h) {
- $out.='';
+ $out .= '';
} else {
- for ($a=0;$a<$h;$a++) {
+ for ($a = 0; $a < $h; $a++) {
- if (!$a) {
+ if (!$a) {
- if ($icon) $out.= $icon;
+ if ($icon) {
+ $out .= $icon;
+ }
} else {
}
}
}
- $out.=' |
+ $out .= '
';
}
// Init rendering.
- $colsp='';
+ $colsp = '';
- $lastKey='';
+ $lastKey = '';
- $c=0;
+ $c = 0;
- $ccount=0;
+ $ccount = 0;
// Traverse field array which contains the data to present:
foreach ($this->fieldArray as $vKey) {
- if (isset($data[$vKey])) {
+ if (isset($data[$vKey])) {
- if ($lastKey) {
+ if ($lastKey) {
$cssClass = $this->addElement_tdCssClass[$lastKey];
- if($this->oddColumnsCssClass && $ccount % 2 == 0) {
+ if ($this->oddColumnsCssClass && $ccount % 2 == 0) {
$cssClass = implode(' ', array($this->addElement_tdCssClass[$lastKey], $this->oddColumnsCssClass));
}
- $out.='
+ $out .= '
- addElement_tdParams[$lastKey].
+ $this->addElement_tdParams[$lastKey] .
- '>'.$data[$lastKey].' | ';
+ '>' . $data[$lastKey] . '';
}
- $lastKey=$vKey;
+ $lastKey = $vKey;
- $c=1;
+ $c = 1;
$ccount++;
} else {
- if (!$lastKey) {$lastKey=$vKey;}
+ if (!$lastKey) {
+ $lastKey = $vKey;
+ }
$c++;
}
- if ($c>1) {$colsp=' colspan="'.$c.'"';} else {$colsp='';}
+ if ($c > 1) {
+ $colsp = ' colspan="' . $c . '"';
+ } else {
+ $colsp = '';
- }
+ }
+ }
if ($lastKey) {
$cssClass = $this->addElement_tdCssClass[$lastKey];
- if($this->oddColumnsCssClass) {
+ if ($this->oddColumnsCssClass) {
$cssClass = implode(' ', array($this->addElement_tdCssClass[$lastKey], $this->oddColumnsCssClass));
}
- $out.='
+ $out .= '
- addElement_tdParams[$lastKey].'>'.$data[$lastKey].' | '; }
+ addElement_tdParams[$lastKey] . '>' . $data[$lastKey] . ' | ';
+ }
// End row
- $out.='
+ $out .= '
';
// Return row.
@@ -214,7 +209,7 @@
*
* @return void
*/
- function writeTop() {
+ function writeTop() {
}
/**
@@ -222,16 +217,16 @@
*
* @return void
*/
- function writeBottom() {
+ function writeBottom() {
- $this->HTMLcode.='
+ $this->HTMLcode .= '
';
- $theIcon='backPath,'gfx/ol/stopper.gif','width="18" height="16"').' alt="" />';
+ $theIcon = 'backPath, 'gfx/ol/stopper.gif', 'width="18" height="16"') . ' alt="" />';
- $this->HTMLcode.=$this->addElement(1,'','','',$this->leftMargin,$theIcon);
+ $this->HTMLcode .= $this->addElement(1, '', '', '', $this->leftMargin, $theIcon);
- $this->HTMLcode.='
+ $this->HTMLcode .= '
';
}
@@ -241,23 +236,23 @@
* @param string Table name
* @return array array([boolean], [HTML]) where [boolean] is 1 for reverse element, [HTML] is the table-row code for the element
*/
- function fwd_rwd_nav($table='') {
+ function fwd_rwd_nav($table = '') {
- $code='';
+ $code = '';
- if ($this->eCounter >= $this->firstElementNumber && $this->eCounter < $this->firstElementNumber+$this->iLimit) {
+ if ($this->eCounter >= $this->firstElementNumber && $this->eCounter < $this->firstElementNumber + $this->iLimit) {
- if ($this->firstElementNumber && $this->eCounter==$this->firstElementNumber) {
+ if ($this->firstElementNumber && $this->eCounter == $this->firstElementNumber) {
// reverse
$theData = Array();
- $titleCol=$this->fieldArray[0];
+ $titleCol = $this->fieldArray[0];
- $theData[$titleCol] = $this->fwd_rwd_HTML('fwd',$this->eCounter,$table);
+ $theData[$titleCol] = $this->fwd_rwd_HTML('fwd', $this->eCounter, $table);
$code = $this->addElement(1, '', $theData, 'class="fwd_rwd_nav"');
}
return array(1, $code);
} else {
- if ($this->eCounter==$this->firstElementNumber+$this->iLimit) {
+ if ($this->eCounter == $this->firstElementNumber + $this->iLimit) {
// forward
$theData = Array();
- $titleCol=$this->fieldArray[0];
+ $titleCol = $this->fieldArray[0];
- $theData[$titleCol] = $this->fwd_rwd_HTML('rwd',$this->eCounter,$table);
+ $theData[$titleCol] = $this->fwd_rwd_HTML('rwd', $this->eCounter, $table);
$code = $this->addElement(1, '', $theData, 'class="fwd_rwd_nav"');
}
return array(0, $code);
@@ -274,21 +269,21 @@
* @return string
* @access private
*/
- function fwd_rwd_HTML($type,$pointer,$table='') {
+ function fwd_rwd_HTML($type, $pointer, $table = '') {
$content = '';
- $tParam = $table ? '&table='.rawurlencode($table) : '';
+ $tParam = $table ? '&table=' . rawurlencode($table) : '';
- switch($type) {
+ switch ($type) {
case 'fwd':
- $href = $this->listURL().'&pointer='.($pointer-$this->iLimit).$tParam;
+ $href = $this->listURL() . '&pointer=' . ($pointer - $this->iLimit) . $tParam;
- $content = ''.
+ $content = '' .
- t3lib_iconWorks::getSpriteIcon('actions-move-up').
+ t3lib_iconWorks::getSpriteIcon('actions-move-up') .
- ' [1 - '.$pointer.']';
+ ' [1 - ' . $pointer . ']';
break;
case 'rwd':
- $href = $this->listURL().'&pointer='.$pointer.$tParam;
+ $href = $this->listURL() . '&pointer=' . $pointer . $tParam;
- $content = ''.
+ $content = '' .
- t3lib_iconWorks::getSpriteIcon('actions-move-down').
+ t3lib_iconWorks::getSpriteIcon('actions-move-down') .
- ' ['.($pointer+1).' - '.$this->totalItems.']';
+ ' [' . ($pointer + 1) . ' - ' . $this->totalItems . ']';
break;
}
return $content;
@@ -300,9 +295,9 @@
* @param string Alternative id value. Enter blank string for the current id ($this->id)
* @return string URL
*/
- function listURL($altId='') {
+ function listURL($altId = '') {
- return $this->script.
+ return $this->script .
- '?id='.(strcmp($altId,'')?$altId:$this->id);
+ '?id=' . (strcmp($altId, '') ? $altId : $this->id);
}
/**
@@ -310,7 +305,7 @@
*
* @return string
*/
- function CBfunctions() {
+ function CBfunctions() {
return '
// checkOffCB()
function checkOffCB(listOfCBnames, link) { //
@@ -348,16 +343,16 @@
*
* @return void
*/
- function initializeLanguages() {
+ function initializeLanguages() {
- global $TCA,$LANG;
+ global $TCA, $LANG;
// Look up page overlays:
$this->pageOverlays = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'*',
'pages_language_overlay',
- 'pid='.intval($this->id).
+ 'pid=' . intval($this->id) .
- t3lib_BEfunc::deleteClause('pages_language_overlay').
+ t3lib_BEfunc::deleteClause('pages_language_overlay') .
- t3lib_BEfunc::versioningPlaceholderClause('pages_language_overlay'),
+ t3lib_BEfunc::versioningPlaceholderClause('pages_language_overlay'),
'',
'',
'',
@@ -373,7 +368,7 @@
* @param integer Sys language uid
* @return string Language icon
*/
- function languageFlag($sys_language_uid) {
+ function languageFlag($sys_language_uid) {
$out = '';
if ($this->languageIconTitles[$sys_language_uid]['flagIcon']) {
$out .= t3lib_iconWorks::getSpriteIcon($this->languageIconTitles[$sys_language_uid]['flagIcon']);
@@ -397,7 +392,7 @@
}
-if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_recordlist.php']) {
+if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_recordlist.php']) {
include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_recordlist.php']);
}