8561 Checkboxes and labels are aligned badly if in one line
[Packages/TYPO3.CMS.git] / typo3 / class.db_list_extra.inc
index 2c50991..f6813de 100755 (executable)
@@ -103,7 +103,7 @@ class localRecordList extends recordList {
        var $totalRowCount;                                             // count of record rows in view
 
        var $spaceIcon;                                                 // space icon used for alignment
-       
+
                // Internal:
        var $pageRow=array();                                   // Set to the page record (see writeTop())
 
@@ -149,11 +149,11 @@ class localRecordList extends recordList {
 
                        // CSH
                if (!strlen($this->id)) {
-                       $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_noId', $GLOBALS['BACK_PATH']);
+                       $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_noId', $GLOBALS['BACK_PATH'], '', TRUE);
                } elseif(!$this->id) {
-                       $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_root', $GLOBALS['BACK_PATH']);
+                       $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module_root', $GLOBALS['BACK_PATH'], '', TRUE);
                } else {
-                       $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module', $GLOBALS['BACK_PATH']);
+                       $buttons['csh'] = t3lib_BEfunc::cshItem('xMOD_csh_corebe', 'list_module', $GLOBALS['BACK_PATH'], '', TRUE);
                }
 
                if (isset($this->id)) {
@@ -275,12 +275,12 @@ class localRecordList extends recordList {
                $titleCol = $TCA[$table]['ctrl']['label'];
                $thumbsCol = $TCA[$table]['ctrl']['thumbnail'];
                $l10nEnabled = $TCA[$table]['ctrl']['languageField'] && $TCA[$table]['ctrl']['transOrigPointerField'] && !$TCA[$table]['ctrl']['transOrigPointerTable'];
-               
+
                        // prepare space icon
                $iconWidth  = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['iconSizeWidth']  ? $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['iconSizeWidth']  : 12;
                $iconHeight = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['iconSizeHeight'] ? $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['iconSizeHeight'] : 12;
                $this->spaceIcon = '<img src="' . $this->backPath . 'clear.gif" width="' . $iconWidth . '" height="' . $iconHeight . '" title="" alt="" />';
-               
+
                        // Cleaning rowlist for duplicates and place the $titleCol as the first column always!
                $this->fieldArray=array();
                        // title Column
@@ -297,6 +297,7 @@ class localRecordList extends recordList {
                        // Ref
                if (!$this->dontShowClipControlPanels)  {
                        $this->fieldArray[]='_REF_';
+                       $this->fieldArray[]='_AFTERREF_';
                }
                        // Path
                if ($this->searchLevels)        {
@@ -576,14 +577,14 @@ class localRecordList extends recordList {
         */
        function renderListRow($table,$row,$cc,$titleCol,$thumbsCol,$indent=0)  {
                $iOut = '';
-               
+
                if (strlen($this->searchString))        {       // If in search mode, make sure the preview will show the correct page
                        $id_orig = $this->id;
                        $this->id = $row['pid'];
                }
 
                if (is_array($row))     {
-                       
+
                                // add special classes for first and last row
                        $rowSpecial = '';
                        if ($cc == 1 && $indent == 0) {
@@ -615,7 +616,13 @@ class localRecordList extends recordList {
                        foreach($this->fieldArray as $fCol)     {
                                if ($fCol==$titleCol)   {
                                        $recTitle = t3lib_BEfunc::getRecordTitle($table,$row,FALSE,TRUE);
-                                       $theData[$fCol] = $this->linkWrapItems($table,$row['uid'],$recTitle,$row);
+                                               // If the record is edit-locked by another user, we will show a little warning sign:
+                                       if (($lockInfo = t3lib_BEfunc::isRecordLocked($table, $row['uid']))) {
+                                               $warning = '<a href="#" onclick="' . htmlspecialchars('alert(' . $GLOBALS['LANG']->JScharCode($lockInfo['msg']) . '); return false;') . '">' .
+                                                       '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/recordlock_warning3.gif', 'width="17" height="12"') . ' title="' . htmlspecialchars($lockInfo['msg']) . '" alt="" />' .
+                                                       '</a>';
+                                       }
+                                       $theData[$fCol] = $warning . $this->linkWrapItems($table, $row['uid'], $recTitle, $row);
                                } elseif ($fCol == 'pid') {
                                        $theData[$fCol]=$row[$fCol];
                                } elseif ($fCol == '_PATH_') {
@@ -624,7 +631,7 @@ class localRecordList extends recordList {
                                        $theData[$fCol]=$this->makeRef($table,$row['uid']);
                                } elseif ($fCol == '_CONTROL_') {
                                        $theData[$fCol]=$this->makeControl($table,$row);
-                               } elseif ($fCol == '_AFTERCONTROL_') {
+                               } elseif ($fCol == '_AFTERCONTROL_' || $fCol == '_AFTERREF_') {
                                        $theData[$fCol] = '&nbsp;';
                                } elseif ($fCol == '_CLIPBOARD_') {
                                        $theData[$fCol]=$this->makeClip($table,$row);
@@ -652,10 +659,12 @@ class localRecordList extends recordList {
 
                        // Add classes to table cells
                        $this->addElement_tdCssClass[$titleCol]         = 'col-title';
-                       $this->addElement_tdCssClass['_CONTROL_']       = 'col-control';
-                       $this->addElement_tdCssClass['_AFTERCONTROL_']  = 'col-control-space';
+                       if (!$this->dontShowClipControlPanels) {
+                               $this->addElement_tdCssClass['_CONTROL_']       = 'col-control';
+                               $this->addElement_tdCssClass['_AFTERCONTROL_']  = 'col-control-space';
+                               $this->addElement_tdCssClass['_CLIPBOARD_']     = 'col-clipboard';
+                       }
                        $this->addElement_tdCssClass['_PATH_']          = 'col-path';
-                       $this->addElement_tdCssClass['_CLIPBOARD_']     = 'col-clipboard';
                        $this->addElement_tdCssClass['_LOCALIZATION_']  = 'col-localizationa';
                        $this->addElement_tdCssClass['_LOCALIZATION_b'] = 'col-localizationb';
 
@@ -799,7 +808,8 @@ class localRecordList extends recordList {
                                                $theData[$fCol] = '&nbsp;';
                                        }
                                break;
-                               case '_AFTERCONTROL_':  // space column
+                               case '_AFTERCONTROL_':  // space column
+                               case '_AFTERREF_':      // space column
                                        $theData[$fCol] = '&nbsp;';
                                break;
                                default:                        // Regular fields header:
@@ -942,11 +952,11 @@ class localRecordList extends recordList {
                                                        $lab = 'V';
                                                }
 
-                                               $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',1).'" style="'.htmlspecialchars($st).'">'.
+                                               $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',1).'" class="typo3-ctrl-versioning" style="'.htmlspecialchars($st).'">'.
                                                                $lab.
                                                                '</a>';
                                        } elseif(!$this->table) {
-                                               $cells['version'] = '<span style="font-weight: bold; visibility: hidden;">V</span>';
+                                               $cells['version'] = '<span class="typo3-ctrl-versioning" style="font-weight: bold; visibility: hidden;">V</span>';
                                        }
                                }
 
@@ -996,7 +1006,7 @@ class localRecordList extends recordList {
                                        }
                                } elseif(!$this->table) {
                                        $cells['moveUp']  = $this->spaceIcon;
-                                       $cells['moveDow'] = $this->spaceIcon;
+                                       $cells['moveDown'] = $this->spaceIcon;
                                }
 
                                        // "Hide/Unhide" links:
@@ -1021,8 +1031,14 @@ class localRecordList extends recordList {
                                if (
                                        ($table=='pages' && ($localCalcPerms&4)) || ($table!='pages' && ($this->calcPerms&16))
                                        )       {
-                                       $params='&cmd['.$table.']['.$row['uid'].'][delete]=1';
-                                       $cells['delete']='<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;').'">'.
+                                       $titleOrig = t3lib_BEfunc::getRecordTitle($table,$row,FALSE,TRUE);
+                                       $titleLength = $GLOBALS['BE_USER']->uc['titleLen'];
+                                       if (!$titleLength || !t3lib_div::testInt($titleLength) || $titleLength < 0) {
+                                               $titleLength = 30;
+                                       }
+                                       $title = t3lib_div::slashJS(t3lib_div::fixed_lgd_cs($titleOrig, $titleLength),1);
+                                       $params = '&cmd['.$table.']['.$row['uid'].'][delete]=1';
+                                       $cells['delete']='<a href="#" onclick="'.htmlspecialchars('if (confirm('.$LANG->JScharCode($LANG->getLL('deleteWarning').' "'. $title.'" '.t3lib_BEfunc::referenceCount($table,$row['uid'],' (There are %s reference(s) to this record!)')).')) {jumpToUrl(\''.$SOBE->doc->issueCommand($params,-1).'\');} return false;').'">'.
                                                        '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/garbage.gif','width="11" height="12"').' title="'.$LANG->getLL('delete',1).'" alt="" />'.
                                                        '</a>';
                                } elseif(!$this->table) {
@@ -1060,12 +1076,6 @@ class localRecordList extends recordList {
                        }
                }
 
-                       // If the record is edit-locked by another user, we will show a little warning sign:
-               if ($lockInfo=t3lib_BEfunc::isRecordLocked($table,$row['uid'])) {
-                       $cells['locked'] = '<a href="#" onclick="'.htmlspecialchars('alert('.$LANG->JScharCode($lockInfo['msg']).');return false;').'">'.
-                                       '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/recordlock_warning3.gif','width="17" height="12"').' title="'.htmlspecialchars($lockInfo['msg']).'" alt="" />'.
-                                       '</a>';
-               }
 
                /**
                 * @hook                        recStatInfoHooks: Allows to insert HTML before record icons on various places
@@ -1288,11 +1298,9 @@ class localRecordList extends recordList {
                $setFields=is_array($this->setFields[$table]) ? $this->setFields[$table] : array();
 
                        // Request fields from table:
-               $fields = $this->makeFieldList($table);
+               $fields = $this->makeFieldList($table, false, true);
 
                        // Add pseudo "control" fields
-               $fields[]='tstamp';
-               $fields[]='crdate';
                $fields[]='_PATH_';
                $fields[]='_REF_';
                $fields[]='_LOCALIZATION_';