From 42e19e948ca2d69ed968dc76dcf3c1bcec5d307a Mon Sep 17 00:00:00 2001
From: Felix Kopp <felix-source@phorax.com>
Date: Sat, 29 Nov 2014 03:07:01 +0100
Subject: [PATCH] [TASK] Wrap very wide t3-tables in table-fit

Wide table listings are wrapped in table-fit.

Resolves: #63417
Releases: master
Change-Id: Idc50242b7c3124c7e17da07d25ba3e2af03eeaed
Reviewed-on: http://review.typo3.org/34760
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
---
 .../backend/Classes/View/PageLayoutView.php   |  18 +--
 .../Private/Templates/BackendUser/Index.html  |  48 +++----
 .../Private/Templates/Permission/Index.html   | 120 +++++++++---------
 .../TranslationStatusController.php           |  23 ++--
 ...mplateAnalyzerModuleFunctionController.php |   2 +-
 ...ateInformationModuleFunctionController.php |   2 +-
 .../TypoScriptTemplateModuleController.php    |   4 +-
 ...atePagesWizardModuleFunctionController.php |   2 +-
 .../View/SortPagesWizardModuleFunction.php    |   2 +-
 9 files changed, 115 insertions(+), 106 deletions(-)

diff --git a/typo3/sysext/backend/Classes/View/PageLayoutView.php b/typo3/sysext/backend/Classes/View/PageLayoutView.php
index fc1b02e8d61f..1ce212d3ed38 100644
--- a/typo3/sysext/backend/Classes/View/PageLayoutView.php
+++ b/typo3/sysext/backend/Classes/View/PageLayoutView.php
@@ -372,14 +372,16 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
 			}
 			// CSH:
 			$out = BackendUtility::cshItem($this->descrTable, ('func_' . $pKey)) . '
-				<table class="t3-table typo3-page-pages">' .
-					'<thead>' .
-						$this->addelement(1, '', $theData) .
-					'</thead>' .
-					'<tbody>' .
-						$out .
-					'</tbody>' .
-				'</table>';
+				<div class="table-fit">
+					<table class="t3-table typo3-page-pages">' .
+						'<thead>' .
+							$this->addelement(1, '', $theData) .
+						'</thead>' .
+						'<tbody>' .
+							$out .
+						'</tbody>' .
+					'</table>
+				</div>';
 		}
 		return $out;
 	}
diff --git a/typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Index.html b/typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Index.html
index 742e67d19eb7..941b324f6dbe 100644
--- a/typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Index.html
+++ b/typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Index.html
@@ -51,28 +51,30 @@
 	</f:comment>
 
 	<f:be.widget.paginate objects="{backendUsers}" as="paginatedBackendUsers" configuration="{itemsPerPage: 50, insertAbove: 1, insertBelow: 1}">
-		<table class="t3-table">
-			<thead>
-				<tr>
-					<th class="col-icon"></th>
-					<th class="col-title"><f:translate key="userName" /> / <f:translate key="realName" /></th>
-					<th class="col-control"></th>
-					<th><f:translate key="lastLogin" /></th>
-				</tr>
-			</thead>
-			<tbody>
-				<f:for each="{paginatedBackendUsers}" as="backendUser">
-					<f:render partial="BackendUser/IndexListRow" arguments="{demand: demand, backendUser: backendUser, dateFormat: dateFormat, timeFormat: timeFormat, returnUrl: returnUrl}" />
-				</f:for>
-				<f:comment>
-					Footer row: no officially defined style yet
-				</f:comment>
-				<tr>
-					<td colspan="4">
-						<f:count subject="{backendUsers}" /> <f:translate key="users" />
-					</td>
-				</tr>
-			</tbody>
-		</table>
+		<div class="table-fit">
+			<table class="t3-table">
+				<thead>
+					<tr>
+						<th class="col-icon"></th>
+						<th class="col-title"><f:translate key="userName" /> / <f:translate key="realName" /></th>
+						<th class="col-control"></th>
+						<th><f:translate key="lastLogin" /></th>
+					</tr>
+				</thead>
+				<tbody>
+					<f:for each="{paginatedBackendUsers}" as="backendUser">
+						<f:render partial="BackendUser/IndexListRow" arguments="{demand: demand, backendUser: backendUser, dateFormat: dateFormat, timeFormat: timeFormat, returnUrl: returnUrl}" />
+					</f:for>
+					<f:comment>
+						Footer row: no officially defined style yet
+					</f:comment>
+					<tr>
+						<td colspan="4">
+							<f:count subject="{backendUsers}" /> <f:translate key="users" />
+						</td>
+					</tr>
+				</tbody>
+			</table>
+		</div>
 	</f:be.widget.paginate>
 </f:section>
diff --git a/typo3/sysext/beuser/Resources/Private/Templates/Permission/Index.html b/typo3/sysext/beuser/Resources/Private/Templates/Permission/Index.html
index 641c1f513069..07243278451e 100644
--- a/typo3/sysext/beuser/Resources/Private/Templates/Permission/Index.html
+++ b/typo3/sysext/beuser/Resources/Private/Templates/Permission/Index.html
@@ -16,67 +16,69 @@
 		<f:form.select id="depth" value="{depth}" options="{depthOptions}" additionalAttributes="{onchange: 'jumpToUrl(\'{depthBaseUrl}\'.replace(\'__DEPTH__\', this.options[this.selectedIndex].value), this);'}" />
 	</div>
 
-	<table class="t3-table" id="typo3-permissionList">
-		<thead>
-		<tr>
-			<th colspan="2">&nbsp;</th>
-			<th><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Owner" /></th>
-			<th align="center"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Group" /></th>
-			<th align="center"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Everybody" /></th>
-			<th align="center"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:EditLock" /></th>
-		</tr>
-		</thead>
-		<f:for each="{viewTree}" as="data">
+	<div class="table-fit">
+		<table class="t3-table" id="typo3-permissionList">
+			<thead>
 			<tr>
-				<f:if condition="{data.cellAttrib}">
-					<f:then>
-						<td align="left" nowrap="nowrap" {data.cellAttrib}>
-							<f:format.raw>{data.html}</f:format.raw>
-						</td>
-					</f:then>
-					<f:else>
-						<td align="left" nowrap="nowrap" {data.groupName}>
-							<f:format.raw>{data.html}</f:format.raw>
-						</td>
-					</f:else>
-				</f:if>
-				<f:if condition="{data.editPermsAllowed}">
-					<f:then>
-						<td>
-							<f:if condition="{data.id} > 0">
-								<f:link.action action="edit" arguments="{id: data.id, depth: depth}" title="{f:translate(key: 'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:ch_permissions')}">
-									<bu:spriteManagerIcon iconName="actions-document-open" />
-								</f:link.action>
-							</f:if>
-						</td>
-					</f:then>
-					<f:else>
-						<td></td>
-					</f:else>
-				</f:if>
-				<td nowrap="nowrap"><f:format.raw>{data.userPermissions}</f:format.raw></td>
-				<td nowrap="nowrap"><f:format.raw>{data.groupPermissions}</f:format.raw></td>
-				<td nowrap="nowrap"><f:format.raw>{data.otherPermissions}</f:format.raw></td>
-				<td nowrap="nowrap">
-				<f:if condition="{data.id} > 0">
-					<span id="el_{data.id}">
-						<f:if condition="{data.editLock}">
-							<f:then>
-								<a class="editlock" data-page="{data.pageId}" data-lockstate="1" title="{f:translate(key: 'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:EditLock_descr')}">
-									<bu:spriteManagerIcon iconName="status-warning-lock" />
-								</a>
-							</f:then>
-							<f:else>
-								<a class="editlock" data-page="{data.pageId}" data-lockstate="0" title="Enable the &raquo;Admin-only&laquo; edit lock for this page">
-									[+]
-								</a>
-							</f:else>
-						</f:if>
-					</span>
-				</f:if>
+				<th colspan="2">&nbsp;</th>
+				<th><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Owner" /></th>
+				<th align="center"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Group" /></th>
+				<th align="center"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:Everybody" /></th>
+				<th align="center"><f:translate key="LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:EditLock" /></th>
 			</tr>
-		</f:for>
-	</table>
+			</thead>
+			<f:for each="{viewTree}" as="data">
+				<tr>
+					<f:if condition="{data.cellAttrib}">
+						<f:then>
+							<td align="left" nowrap="nowrap" {data.cellAttrib}>
+								<f:format.raw>{data.html}</f:format.raw>
+							</td>
+						</f:then>
+						<f:else>
+							<td align="left" nowrap="nowrap" {data.groupName}>
+								<f:format.raw>{data.html}</f:format.raw>
+							</td>
+						</f:else>
+					</f:if>
+					<f:if condition="{data.editPermsAllowed}">
+						<f:then>
+							<td>
+								<f:if condition="{data.id} > 0">
+									<f:link.action action="edit" arguments="{id: data.id, depth: depth}" title="{f:translate(key: 'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:ch_permissions')}">
+										<bu:spriteManagerIcon iconName="actions-document-open" />
+									</f:link.action>
+								</f:if>
+							</td>
+						</f:then>
+						<f:else>
+							<td></td>
+						</f:else>
+					</f:if>
+					<td nowrap="nowrap"><f:format.raw>{data.userPermissions}</f:format.raw></td>
+					<td nowrap="nowrap"><f:format.raw>{data.groupPermissions}</f:format.raw></td>
+					<td nowrap="nowrap"><f:format.raw>{data.otherPermissions}</f:format.raw></td>
+					<td nowrap="nowrap">
+					<f:if condition="{data.id} > 0">
+						<span id="el_{data.id}">
+							<f:if condition="{data.editLock}">
+								<f:then>
+									<a class="editlock" data-page="{data.pageId}" data-lockstate="1" title="{f:translate(key: 'LLL:EXT:beuser/Resources/Private/Language/locallang_mod_permission.xlf:EditLock_descr')}">
+										<bu:spriteManagerIcon iconName="status-warning-lock" />
+									</a>
+								</f:then>
+								<f:else>
+									<a class="editlock" data-page="{data.pageId}" data-lockstate="0" title="Enable the &raquo;Admin-only&laquo; edit lock for this page">
+										[+]
+									</a>
+								</f:else>
+							</f:if>
+						</span>
+					</f:if>
+				</tr>
+			</f:for>
+		</table>
+	</div>
 
 	<br />
 	<f:format.raw>{cshItem}</f:format.raw>
diff --git a/typo3/sysext/frontend/Classes/Controller/TranslationStatusController.php b/typo3/sysext/frontend/Classes/Controller/TranslationStatusController.php
index c67011b3f29a..946c809105c7 100644
--- a/typo3/sysext/frontend/Classes/Controller/TranslationStatusController.php
+++ b/typo3/sysext/frontend/Classes/Controller/TranslationStatusController.php
@@ -250,16 +250,19 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
 			}
 		}
 
-		$output = '<table id="langTable" class="t3-table">' .
-			'<thead>' .
-				'<tr>' .
-					implode('', $tCells) .
-				'</tr>' .
-				'</thead>' .
-				'<tbody>' .
-					$output .
-				'</tbody>' .
-			'</table>';
+		$output =
+			'<div class="table-fit">' .
+				'<table id="langTable" class="t3-table">' .
+					'<thead>' .
+						'<tr>' .
+							implode('', $tCells) .
+						'</tr>' .
+					'</thead>' .
+					'<tbody>' .
+						$output .
+					'</tbody>' .
+				'</table>' .
+			'</div>';
 		return $output;
 	}
 
diff --git a/typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerModuleFunctionController.php b/typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerModuleFunctionController.php
index f9b247df9bbd..1e60b9fa3a18 100644
--- a/typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerModuleFunctionController.php
+++ b/typo3/sysext/tstemplate/Classes/Controller/TemplateAnalyzerModuleFunctionController.php
@@ -121,7 +121,7 @@ class TemplateAnalyzerModuleFunctionController extends \TYPO3\CMS\Backend\Module
 		$head .= '<th>' . $GLOBALS['LANG']->getLL('nextLevel', TRUE) . '</th>';
 		$head .= '</tr></thead>';
 		$hierar = implode(array_reverse($GLOBALS['tmpl']->ext_getTemplateHierarchyArr($hierarchyInfo, '', array(), 1)), '');
-		$hierar = '<table class="t3-table" id="ts-analyzer">' . $head . $hierar . '</table>';
+		$hierar = '<div class="table-fit"><table class="t3-table" id="ts-analyzer">' . $head . $hierar . '</table></div>';
 		$theOutput .= $this->pObj->doc->spacer(5);
 		$theOutput .= $this->pObj->doc->section($GLOBALS['LANG']->getLL('templateHierarchy', TRUE), $hierar, 0, 1);
 		$urlParameters = array(
diff --git a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php
index f7bf2d0821d3..a63aa142e2df 100644
--- a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php
+++ b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateInformationModuleFunctionController.php
@@ -267,7 +267,7 @@ class TypoScriptTemplateInformationModuleFunctionController extends AbstractFunc
 			$outCode .= $this->tableRow($lang->getLL('description'), nl2br(htmlspecialchars($tplRow['description'])), 'description', $tplRow['uid']);
 			$outCode .= $this->tableRow($lang->getLL('constants'), sprintf($lang->getLL('editToView'), trim($tplRow['constants']) ? count(explode(LF, $tplRow['constants'])) : 0), 'constants', $tplRow['uid']);
 			$outCode .= $this->tableRow($lang->getLL('setup'), sprintf($lang->getLL('editToView'), trim($tplRow['config']) ? count(explode(LF, $tplRow['config'])) : 0), 'config', $tplRow['uid']);
-			$outCode = '<table class="t3-table">' . $outCode . '</table>';
+			$outCode = '<div class="table-fit"><table class="t3-table">' . $outCode . '</table></div>';
 
 			// Edit all icon:
 			$editOnClick = BackendUtility::editOnClick(rawurlencode('&createExtension=0') . '&amp;edit[sys_template][' . $tplRow['uid'] . ']=edit', $GLOBALS['BACK_PATH'], '');
diff --git a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php
index fea070180ebd..1e75e07a3d6b 100644
--- a/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php
+++ b/typo3/sysext/tstemplate/Classes/Controller/TypoScriptTemplateModuleController.php
@@ -191,7 +191,7 @@ class TypoScriptTemplateModuleController extends \TYPO3\CMS\Backend\Module\BaseS
 			}
 			$GLOBALS['TYPO3_DB']->sql_free_result($res);
 
-			$table = '<table class="t3-table" id="ts-overview">' .
+			$table = '<div class="table-fit"><table class="t3-table" id="ts-overview">' .
 					'<thead>' .
 					'<tr>' .
 					'<th>' . $GLOBALS['LANG']->getLL('pageName') . '</th>' .
@@ -201,7 +201,7 @@ class TypoScriptTemplateModuleController extends \TYPO3\CMS\Backend\Module\BaseS
 					'</tr>' .
 					'</thead>' .
 					'<tbody>' . implode('', $this->renderList($pArray)) . '</tbody>' .
-					'</table>';
+					'</table></div>';
 
 			$this->content = $this->doc->header($GLOBALS['LANG']->getLL('moduleTitle'));
 			$this->content .= $this->doc->section('', '<p class="lead">' . $GLOBALS['LANG']->getLL('overview') . '</p>' . $table);
diff --git a/typo3/sysext/wizard_crpages/Classes/Controller/CreatePagesWizardModuleFunctionController.php b/typo3/sysext/wizard_crpages/Classes/Controller/CreatePagesWizardModuleFunctionController.php
index 811b3157abc5..5d03f840c432 100644
--- a/typo3/sysext/wizard_crpages/Classes/Controller/CreatePagesWizardModuleFunctionController.php
+++ b/typo3/sysext/wizard_crpages/Classes/Controller/CreatePagesWizardModuleFunctionController.php
@@ -127,7 +127,7 @@ class CreatePagesWizardModuleFunctionController extends \TYPO3\CMS\Backend\Modul
 				for ($a = 0; $a < 9; $a++) {
 					$tableData[] = $this->getFormLine($a);
 				}
-				$lines[] = '<table id="formFieldContainer" class="t3-table"><tbody id="formFieldContainerBody">' . implode(LF, $tableData) . '</tbody></table>';
+				$lines[] = '<div class="table-fit"><table id="formFieldContainer" class="t3-table"><tbody id="formFieldContainerBody">' . implode(LF, $tableData) . '</tbody></table></div>';
 				$theCode .= '<h4>' . $GLOBALS['LANG']->getLL('wiz_newPages') . ':</h4>' . implode('', $lines) . '<br class="clearLeft" />' . '<input type="button" id="createNewFormFields" value="' . $GLOBALS['LANG']->getLL('wiz_newPages_addMoreLines') . '" />' . '<br /><br />';
 				$theCode .= '<div class="checkbox"><label for="createInListEnd"><input type="checkbox" name="createInListEnd" id="createInListEnd" value="1" />' . $GLOBALS['LANG']->getLL('wiz_newPages_listEnd') . '</label></div>';
 				$theCode .= '<div class="checkbox"><label for="hidePages"><input type="checkbox" name="hidePages" id="hidePages" value="1" />' . $GLOBALS['LANG']->getLL('wiz_newPages_hidePages') . '</label></div>';
diff --git a/typo3/sysext/wizard_sortpages/Classes/View/SortPagesWizardModuleFunction.php b/typo3/sysext/wizard_sortpages/Classes/View/SortPagesWizardModuleFunction.php
index ff9a8c853648..6473466649e9 100644
--- a/typo3/sysext/wizard_sortpages/Classes/View/SortPagesWizardModuleFunction.php
+++ b/typo3/sysext/wizard_sortpages/Classes/View/SortPagesWizardModuleFunction.php
@@ -80,7 +80,7 @@ class SortPagesWizardModuleFunction extends \TYPO3\CMS\Backend\Module\AbstractFu
 					</tr>';
 				}
 				$theCode .= '<h2>' . $GLOBALS['LANG']->getLL('wiz_currentPageOrder', TRUE) . '</h2>';
-				$theCode .= '<table class="t3-table">' . implode('', $lines) . '</table>';
+				$theCode .= '<div class="table-fit"><table class="t3-table">' . implode('', $lines) . '</table></div>';
 
 				// Menu:
 				$lines = array();
-- 
GitLab