From fcef7221cfc60b056dfbe9c7d24c9dbba9e8e377 Mon Sep 17 00:00:00 2001 From: Felix Kopp <felix-source@phorax.com> Date: Sat, 18 Jan 2014 17:59:24 +0100 Subject: [PATCH] [TASK] Make use of .t3-table in EXT: wizard_sortpages Use <table class="t3-table"> in backend module. Also removes few markups and improves CGL compliancy. Change-Id: I4f53affc0a6130965d8c3dc516ed800bc5094f50 Resolves: #55131 Releases: 6.2 Reviewed-on: https://review.typo3.org/26926 Reviewed-by: Philipp Gampe Tested-by: Philipp Gampe Reviewed-by: Wouter Wolters Tested-by: Wouter Wolters --- .../View/SortPagesWizardModuleFunction.php | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/typo3/sysext/wizard_sortpages/Classes/View/SortPagesWizardModuleFunction.php b/typo3/sysext/wizard_sortpages/Classes/View/SortPagesWizardModuleFunction.php index 225c6b212634..06e61aa76e5a 100644 --- a/typo3/sysext/wizard_sortpages/Classes/View/SortPagesWizardModuleFunction.php +++ b/typo3/sysext/wizard_sortpages/Classes/View/SortPagesWizardModuleFunction.php @@ -88,24 +88,26 @@ class SortPagesWizardModuleFunction extends \TYPO3\CMS\Backend\Module\AbstractFu if (count($menuItems)) { $lines = array(); - $lines[] = '<tr class="t3-row-header"> - <td>' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_title'), 'title') . '</td> - ' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms') ? '<td> ' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_subtitle'), 'subtitle') . '</td>' : '') . ' - <td>' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_tChange'), 'tstamp') . '</td> - <td>' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_tCreate'), 'crdate') . '</td> - </tr>'; + $lines[] = '<thead><tr>'; + $lines[] = '<th>' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_title'), 'title') . '</th>'; + $lines[] = (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms') ? '<th> ' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_subtitle'), 'subtitle') . '</th>' : ''); + $lines[] = '<th>' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_tChange'), 'tstamp') . '</th>'; + $lines[] = '<th>' . $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_tCreate'), 'crdate') . '</th>'; + $lines[] = '</tr></thead>'; + foreach ($menuItems as $rec) { $m_perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(2); // edit permissions for that page! $pRec = BackendUtility::getRecord('pages', $rec['uid'], 'uid', ' AND ' . $m_perms_clause); - $lines[] = '<tr class="db_list_normal"><td nowrap="nowrap">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', $rec) . (!is_array($pRec) ? $GLOBALS['TBE_TEMPLATE']->rfw('<strong>' . $GLOBALS['LANG']->getLL('wiz_W', TRUE) . '</strong> ') : '') . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($rec['title'], $GLOBALS['BE_USER']->uc['titleLen'])) . ' </td> - ' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms') ? '<td nowrap="nowrap">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($rec['subtitle'], $GLOBALS['BE_USER']->uc['titleLen'])) . ' </td>' : '') . ' - <td nowrap="nowrap">' . BackendUtility::datetime($rec['tstamp']) . ' </td> - <td nowrap="nowrap">' . BackendUtility::datetime($rec['crdate']) . ' </td> + $lines[] = '<tr class="db_list_normal"><td nowrap="nowrap">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconForRecord('pages', $rec) . (!is_array($pRec) ? $GLOBALS['TBE_TEMPLATE']->rfw('<strong>' . $GLOBALS['LANG']->getLL('wiz_W', TRUE) . '</strong> ') : '') . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($rec['title'], $GLOBALS['BE_USER']->uc['titleLen'])) . '</td> + ' . (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cms') ? '<td nowrap="nowrap">' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($rec['subtitle'], $GLOBALS['BE_USER']->uc['titleLen'])) . '</td>' : '') . ' + <td nowrap="nowrap">' . BackendUtility::datetime($rec['tstamp']) . '</td> + <td nowrap="nowrap">' . BackendUtility::datetime($rec['crdate']) . '</td> </tr>'; } - $theCode .= '<h4>' . $GLOBALS['LANG']->getLL('wiz_currentPageOrder', TRUE) . '</h4> - <table border="0" cellpadding="0" cellspacing="0" class="typo3-dblist">' . implode('', $lines) . '</table><br />'; + $theCode .= '<h2>' . $GLOBALS['LANG']->getLL('wiz_currentPageOrder', TRUE) . '</h2>'; + $theCode .= '<table class="t3-table">' . implode('', $lines) . '</table>'; + // Menu: $lines = array(); $lines[] = $this->wiz_linkOrder($GLOBALS['LANG']->getLL('wiz_changeOrder_title'), 'title'); @@ -139,7 +141,7 @@ class SortPagesWizardModuleFunction extends \TYPO3\CMS\Backend\Module\AbstractFu * @todo Define visibility */ public function wiz_linkOrder($title, $order) { - return ' <a class="t3-link" href="' . htmlspecialchars(('index.php?id=' . $GLOBALS['SOBE']->id . '&sortByField=' . $order)) . '" onclick="return confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('wiz_changeOrder_msg1')) . ')">' . htmlspecialchars($title) . '</a>'; + return '<a class="t3-link" href="' . htmlspecialchars(('index.php?id=' . $GLOBALS['SOBE']->id . '&sortByField=' . $order)) . '" onclick="return confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('wiz_changeOrder_msg1')) . ')">' . htmlspecialchars($title) . '</a>'; } } -- GitLab