Added feature #5242: IRRE - Storage page for child records
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_recordlist.php
index a6f3603..526911e 100755 (executable)
@@ -2,7 +2,7 @@
 /***************************************************************
 *  Copyright notice
 *
-*  (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
+*  (c) 1999-2006 Kasper Skaarhoj (kasperYYYY@typo3.com)
 *  All rights reserved
 *
 *  This script is part of the TYPO3 project. The TYPO3 project is
  * Revised for TYPO3 3.6 July/2003 by Kasper Skaarhoj
  * XHTML compliant
  *
- * @author     Kasper Skaarhoj <kasper@typo3.com>
+ * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
  */
 /**
  * [CLASS/FUNCTION INDEX of SCRIPT]
  *
  *
  *
- *   78: class t3lib_recordList
- *  119:     function addElement($h,$icon,$data,$tdParams='',$lMargin='',$altLine='')
- *  194:     function writeTop()
- *  202:     function writeBottom()
- *  221:     function fwd_rwd_nav($table='')
- *  254:     function fwd_rwd_HTML($type,$pointer,$table='')
- *  277:     function listURL()
- *  286:     function CBfunctions()
+ *   80: class t3lib_recordList
+ *  123:     function addElement($h,$icon,$data,$tdParams='',$lMargin='',$altLine='')
+ *  198:     function writeTop()
+ *  206:     function writeBottom()
+ *  225:     function fwd_rwd_nav($table='')
+ *  258:     function fwd_rwd_HTML($type,$pointer,$table='')
+ *  284:     function listURL($altId='')
+ *  294:     function CBfunctions()
+ *  344:     function initializeLanguages()
+ *  411:     function languageFlag($sys_language_uid)
  *
- * TOTAL FUNCTIONS: 7
+ * TOTAL FUNCTIONS: 9
  * (This index is automatically created/updated by the extension "extdeveval")
  *
  */
@@ -70,7 +72,7 @@
 /**
  * This class is the base for listing of database records and files in the modules Web>List and File>Filelist
  *
- * @author     Kasper Skaarhoj <kasper@typo3.com>
+ * @author     Kasper Skaarhoj <kasperYYYY@typo3.com>
  * @package TYPO3
  * @subpackage t3lib
  * @see typo3/db_list.php, typo3/file_list.php
@@ -254,21 +256,23 @@ class t3lib_recordList {
         * @access private
         */
        function fwd_rwd_HTML($type,$pointer,$table='') {
+               $content = '';
                $tParam = $table ? '&table='.rawurlencode($table) : '';
                switch($type)   {
                        case 'fwd':
                                $href = $this->listURL().'&pointer='.($pointer-$this->iLimit).$tParam;
-                               return '<a href="'.htmlspecialchars($href).'">'.
+                               $content = '<a href="'.htmlspecialchars($href).'">'.
                                                '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/pilup.gif','width="14" height="14"').' alt="" />'.
                                                '</a> <i>[1 - '.$pointer.']</i>';
                        break;
                        case 'rwd':
                                $href = $this->listURL().'&pointer='.$pointer.$tParam;
-                               return '<a href="'.htmlspecialchars($href).'">'.
+                               $content = '<a href="'.htmlspecialchars($href).'">'.
                                                '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/pildown.gif','width="14" height="14"').' alt="" />'.
                                                '</a> <i>['.($pointer+1).' - '.$this->totalItems.']</i>';
                        break;
                }
+               return $content;
        }
 
        /**
@@ -345,56 +349,16 @@ class t3lib_recordList {
                        '*',
                        'pages_language_overlay',
                        'pid='.intval($this->id).
-                               t3lib_BEfunc::deleteClause('pages_language_overlay'),
+                               t3lib_BEfunc::deleteClause('pages_language_overlay').
+                               t3lib_BEfunc::versioningPlaceholderClause('pages_language_overlay'),
                        '',
                        '',
                        '',
                        'sys_language_uid'
                );
-
-                       // icons and language titles:
-               t3lib_div::loadTCA ('sys_language');
-               $flagAbsPath = t3lib_div::getFileAbsFileName($TCA['sys_language']['columns']['flag']['config']['fileFolder']);
-               $flagIconPath = $this->backPath.'../'.substr($flagAbsPath, strlen(PATH_site));
-
-               $this->modSharedTSconfig = t3lib_BEfunc::getModTSconfig($this->id, 'mod.SHARED');
-               $this->languageIconTitles = array();
-
-                       // Set default:
-               $this->languageIconTitles[0]=array(
-                       'uid' => 0,
-                       'title' => strlen ($this->modSharedTSconfig['properties']['defaultLanguageFlag']) ? $this->modSharedTSconfig['properties']['defaultLanguageLabel'].' ('.$LANG->getLL('defaultLanguage').')' : $LANG->getLL('defaultLanguage'),
-                       'ISOcode' => 'DEF',
-                       'flagIcon' => strlen($this->modSharedTSconfig['properties']['defaultLanguageFlag']) && @is_file($flagAbsPath.$this->modSharedTSconfig['properties']['defaultLanguageFlag']) ? $flagIconPath.$this->modSharedTSconfig['properties']['defaultLanguageFlag'] : null,
-               );
-
-                       // Set "All" language:
-               $this->languageIconTitles[-1]=array(
-                       'uid' => -1,
-                       'title' => $LANG->getLL ('multipleLanguages'),
-                       'ISOcode' => 'DEF',
-                       'flagIcon' => $flagIconPath.'multi-language.gif',
-               );
-
-                       // Find all system languages:
-               $sys_languages = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
-                       '*',
-                       'sys_language',
-                       ''
-               );
-               foreach($sys_languages as $row)         {
-                       $this->languageIconTitles[$row['uid']] = $row;
-
-                       if ($row['static_lang_isocode'])        {
-                               $staticLangRow = t3lib_BEfunc::getRecord('static_languages',$row['static_lang_isocode'],'lg_iso_2');
-                               if ($staticLangRow['lg_iso_2']) {
-                                       $this->languageIconTitles[$row['uid']]['ISOcode'] = $staticLangRow['lg_iso_2'];
-                               }
-                       }
-                       if (strlen ($row['flag'])) {
-                               $this->languageIconTitles[$row['uid']]['flagIcon'] = @is_file($flagAbsPath.$row['flag']) ? $flagIconPath.$row['flag'] : '';
-                       }
-               }
+               
+               $t8Tools = t3lib_div::makeInstance('t3lib_transl8tools');
+               $this->languageIconTitles = $t8Tools->getSystemLanguages($this->id, $this->backPath);
        }
 
        /**