Commit 6e0acecf authored by Benni Mack's avatar Benni Mack Committed by Wouter Wolters
Browse files

[TASK] Cleanup CSH calls

Due to a BackendUtility cleanup
there were some methods related to help
texts that were broken and unstructured.

Additionally, some methods are deprecated
for removal as they haven't been used since
TYPO3 CMS 4.5.

Resolves: #62864
Releases: master
Change-Id: I3e51e25d74b282aa698df493fa4f87a54d87f823
Reviewed-on: http://review.typo3.org/33987

Reviewed-by: default avatarChristian Buelter <buelter@kennziffer.com>
Tested-by: default avatarChristian Buelter <buelter@kennziffer.com>
Reviewed-by: default avatarFrank Nägler <typo3@naegler.net>
Tested-by: default avatarFrank Nägler <typo3@naegler.net>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent cb7f35fc
......@@ -101,7 +101,7 @@ class ElementHistoryController {
'back' => ''
);
// CSH
$buttons['csh'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'history_log', $GLOBALS['BACK_PATH'], '', TRUE);
$buttons['csh'] = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'history_log');
// Start history object
$historyObj = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\History\RecordHistory::class);
if ($historyObj->returnUrl) {
......
......@@ -246,9 +246,9 @@ class MoveElementController {
);
if ($this->page_id) {
if ((string)$this->table == 'pages') {
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'move_el_pages', $GLOBALS['BACK_PATH'], '', TRUE);
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'move_el_pages');
} elseif ((string)$this->table == 'tt_content') {
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'move_el_cs', $GLOBALS['BACK_PATH'], '', TRUE);
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'move_el_cs');
}
if ($this->R_URI) {
$buttons['back'] = '<a href="' . htmlspecialchars($this->R_URI) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->getLL('goBack', TRUE) . '">' . IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
......
......@@ -312,7 +312,7 @@ class NewContentElementController {
'back' => ''
);
if ($this->id && $this->access) {
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'new_ce', $GLOBALS['BACK_PATH'], '', TRUE);
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'new_ce');
if ($this->R_URI) {
$buttons['back'] = '<a href="' . htmlspecialchars($this->R_URI) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->getLL('goBack', TRUE) . '">' . IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
}
......
......@@ -1052,7 +1052,7 @@ class EditDocumentController {
}
}
// add the CSH icon
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'TCEforms', $GLOBALS['BACK_PATH'], '', TRUE);
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'TCEforms');
$buttons['shortcut'] = $this->shortCutLink();
$buttons['open_in_new_window'] = $this->openInNewWindowLink();
return $buttons;
......
......@@ -184,7 +184,7 @@ class CreateFolderController {
</div>
';
// CSH:
$code .= BackendUtility::cshItem('xMOD_csh_corebe', 'file_newfolder', $GLOBALS['BACK_PATH'], '<br />');
$code .= BackendUtility::cshItem('xMOD_csh_corebe', 'file_newfolder', NULL, '<br />');
$pageContent .= $code;
// Add spacer:
$pageContent .= $this->doc->spacer(10);
......@@ -220,7 +220,7 @@ class CreateFolderController {
</div>
';
// CSH:
$code .= BackendUtility::cshItem('xMOD_csh_corebe', 'file_newfile', $GLOBALS['BACK_PATH'], '<br />');
$code .= BackendUtility::cshItem('xMOD_csh_corebe', 'file_newfile', NULL, '<br />');
$pageContent .= $this->doc->section($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfile'), $code);
$pageContent .= $this->doc->sectionEnd();
$pageContent .= '</form>';
......
......@@ -221,7 +221,7 @@ class EditFileController {
public function getButtons() {
$buttons = array();
// CSH button
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_edit', $GLOBALS['BACK_PATH'], '', TRUE);
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_edit');
// Save button
$theIcon = IconUtility::getSpriteIcon('actions-document-save');
$buttons['SAVE'] = '<a href="#" onclick="document.editform.submit();" title="' . $GLOBALS['LANG']->makeEntities($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_edit.php.submit', TRUE)) . '">' . $theIcon . '</a>';
......
......@@ -125,7 +125,7 @@ class FileUploadController {
$pageContent = $this->doc->header($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:file_upload.php.pagetitle')) . $this->doc->section('', $form);
// Header Buttons
$docHeaderButtons = array(
'csh' => BackendUtility::cshItem('xMOD_csh_corebe', 'file_upload', $GLOBALS['BACK_PATH']),
'csh' => BackendUtility::cshItem('xMOD_csh_corebe', 'file_upload'),
'back' => ''
);
$markerArray = array(
......
......@@ -162,7 +162,7 @@ class RenameFileController {
$docHeaderButtons = array(
'back' => ''
);
$docHeaderButtons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_rename', $GLOBALS['BACK_PATH']);
$docHeaderButtons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'file_rename');
// Back
if ($this->returnUrl) {
$docHeaderButtons['back'] = '<a href="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::linkThisUrl($this->returnUrl)) . '" class="typo3-goBack" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.goBack', TRUE) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-view-go-back') . '</a>';
......
......@@ -201,7 +201,7 @@ class FileSystemNavigationFrameController {
// Refresh
$buttons['refresh'] = '<a href="' . htmlspecialchars(GeneralUtility::getIndpEnv('REQUEST_URI')) . '">' . IconUtility::getSpriteIcon('actions-system-refresh') . '</a>';
// CSH
$buttons['csh'] = str_replace('typo3-csh-inline', 'typo3-csh-inline show-right', \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'filetree', $GLOBALS['BACK_PATH']));
$buttons['csh'] = str_replace('typo3-csh-inline', 'typo3-csh-inline show-right', \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem('xMOD_csh_corebe', 'filetree'));
return $buttons;
}
......
......@@ -284,11 +284,11 @@ class NewRecordController {
$buttons['new_page'] = '<a href="' . htmlspecialchars(GeneralUtility::linkThisScript(array('pagesOnly' => '1'))) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xlf:newPage', TRUE) . '">' . IconUtility::getSpriteIcon('actions-page-new') . '</a>';
}
// CSH
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'new_regular', $GLOBALS['BACK_PATH'], '', TRUE);
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'new_regular');
} elseif ($this->showNewRecLink('pages')) {
// Pages only wizard
// CSH
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'new_pages', $GLOBALS['BACK_PATH'], '', TRUE);
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'new_pages');
}
// Back
if ($this->R_URI) {
......
......@@ -631,7 +631,7 @@ class PageLayoutController {
'history_record' => '',
'edit_language' => ''
);
$this->markers['CSH'] = BackendUtility::cshItem($this->descrTable, '', $GLOBALS['BACK_PATH'], '', TRUE);
$this->markers['CSH'] = '';
$this->markers['TOP_FUNCTION_MENU'] = '';
$this->markers['LANGSELECTOR'] = '';
$this->markers['CONTENT'] = $body;
......@@ -882,7 +882,7 @@ class PageLayoutController {
$posMap->cur_sys_language = $this->current_sys_language;
$HTMLcode = '';
// CSH:
$HTMLcode .= BackendUtility::cshItem($this->descrTable, 'quickEdit_selElement', $GLOBALS['BACK_PATH'], '|<br />');
$HTMLcode .= BackendUtility::cshItem($this->descrTable, 'quickEdit_selElement', NULL, '|<br />');
$HTMLcode .= $posMap->printContentElementColumns($this->id, $this->eRParts[1], $this->colPosList, $this->MOD_SETTINGS['tt_content_showHidden'], $this->R_URI);
$content .= $this->doc->spacer(20);
$content .= $this->doc->section($GLOBALS['LANG']->getLL('CEonThisPage'), $HTMLcode, 0, 1);
......@@ -1157,9 +1157,9 @@ class PageLayoutController {
// Add CSH (Context Sensitive Help) icon to tool bar
if ($function == 'quickEdit') {
$buttons['csh'] = BackendUtility::cshItem($this->descrTable, 'quickEdit', $GLOBALS['BACK_PATH'], '', TRUE, 'margin-top: 0px; margin-bottom: 0px;');
$buttons['csh'] = BackendUtility::cshItem($this->descrTable, 'quickEdit');
} else {
$buttons['csh'] = BackendUtility::cshItem($this->descrTable, 'columns_' . $this->MOD_SETTINGS['function'], $GLOBALS['BACK_PATH'], '', TRUE, 'margin-top: 0px; margin-bottom: 0px;');
$buttons['csh'] = BackendUtility::cshItem($this->descrTable, 'columns_' . $this->MOD_SETTINGS['function']);
}
if ($function == 'quickEdit') {
// Save record
......
......@@ -253,7 +253,7 @@ class PageTreeNavigationController {
// Refresh
$buttons['refresh'] = '<a href="' . htmlspecialchars(GeneralUtility::getIndpEnv('REQUEST_URI')) . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.refresh', TRUE) . '">' . IconUtility::getSpriteIcon('actions-system-refresh') . '</a>';
// CSH
$buttons['csh'] = str_replace('typo3-csh-inline', 'typo3-csh-inline show-right', BackendUtility::cshItem('xMOD_csh_corebe', 'pagetree', $GLOBALS['BACK_PATH'], '', TRUE));
$buttons['csh'] = str_replace('typo3-csh-inline', 'typo3-csh-inline show-right', BackendUtility::cshItem('xMOD_csh_corebe', 'pagetree'));
// Filter
if ($this->hasFilterBox) {
$buttons['filter'] = '<a href="#" id="tree-toolbar-filter-item">' . IconUtility::getSpriteIcon('actions-system-tree-search-open', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xlf:labels.filter', TRUE))) . '</a>';
......
......@@ -238,9 +238,9 @@ class FormsController {
);
if ($this->P['table'] && $this->P['field'] && $this->P['uid']) {
// CSH
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz', $GLOBALS['BACK_PATH'], '');
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz');
// CSH Buttons
$buttons['csh_buttons'] = BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz_buttons', $GLOBALS['BACK_PATH'], '');
$buttons['csh_buttons'] = BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz_buttons');
// Close
$buttons['close'] = '<a href="#" onclick="' . htmlspecialchars(('jumpToUrl(unescape(\'' . rawurlencode(GeneralUtility::sanitizeLocalUrl($this->P['returnUrl'])) . '\')); return false;')) . '">' . IconUtility::getSpriteIcon('actions-document-close', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.closeDoc', TRUE))) . '</a>';
// Save
......@@ -503,7 +503,7 @@ class FormsController {
$tRows[] = '
<tr>
<td colspan="2" class="bgColor2">&nbsp;</td>
<td colspan="2" class="bgColor2"><strong>' . $GLOBALS['LANG']->getLL('forms_special_eform', TRUE) . ':</strong>' . BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz_formmail_info', $GLOBALS['BACK_PATH'], '') . '</td>
<td colspan="2" class="bgColor2"><strong>' . $GLOBALS['LANG']->getLL('forms_special_eform', TRUE) . ':</strong>' . BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz_formmail_info') . '</td>
</tr>';
// "FORM type":
$tRows[] = '
......
......@@ -182,9 +182,9 @@ class TableController {
);
if ($this->P['table'] && $this->P['field'] && $this->P['uid']) {
// CSH
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_table_wiz', $GLOBALS['BACK_PATH'], '');
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_table_wiz');
// CSH Buttons
$buttons['csh_buttons'] = BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_table_wiz_buttons', $GLOBALS['BACK_PATH'], '');
$buttons['csh_buttons'] = BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_table_wiz_buttons');
// Close
$buttons['close'] = '<a href="#" onclick="' . htmlspecialchars(('jumpToUrl(unescape(\'' . rawurlencode(GeneralUtility::sanitizeLocalUrl($this->P['returnUrl'])) . '\')); return false;')) . '">' . IconUtility::getSpriteIcon('actions-document-close', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:rm.closeDoc', TRUE))) . '</a>';
// Save
......
......@@ -2465,8 +2465,10 @@ class BackendUtility {
* @param string $BACK_PATH UNUSED
* @param bool $force Force display of icon no matter BE_USER setting for help
* @return string HTML content for a help icon/text
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8, use cshItem() instead
*/
static public function helpTextIcon($table, $field, $BACK_PATH = '', $force = FALSE) {
GeneralUtility::logDeprecatedFunction();
if (
is_array($GLOBALS['TCA_DESCR'][$table]) && is_array($GLOBALS['TCA_DESCR'][$table]['columns'][$field])
&& (isset(static::getBackendUserAuthentication()->uc['edit_showFieldHelp']) || $force)
......@@ -2516,7 +2518,7 @@ class BackendUtility {
* @param string $table Table name
* @param string $field Field name
* @return string HTML content for help text
* @see wrapInHelp()
* @see cshItem()
*/
static public function helpText($table, $field) {
$helpTextArray = self::helpTextArray($table, $field);
......@@ -2589,19 +2591,17 @@ class BackendUtility {
*
* @param string $table Table name ('_MOD_'+module name)
* @param string $field Field name (CSH locallang main key)
* @param string $BACK_PATH Back path
* @param string $BACK_PATH Back path, not needed anymore, don't use
* @param string $wrap Wrap code for icon-mode, splitted by "|". Not used for full-text mode.
* @return string HTML content for help text
* @see helpTextIcon()
*/
static public function cshItem($table, $field, $BACK_PATH, $wrap = '') {
if (!static::getBackendUserAuthentication()->uc['edit_showFieldHelp']) {
return '';
}
static public function cshItem($table, $field, $BACK_PATH = NULL, $wrap = '') {
static::getLanguageService()->loadSingleTableDescription($table);
if (is_array($GLOBALS['TCA_DESCR'][$table])) {
// Creating CSH icon and short description:
$output = self::helpTextIcon($table, $field, $BACK_PATH);
if (is_array($GLOBALS['TCA_DESCR'][$table])
&& is_array($GLOBALS['TCA_DESCR'][$table]['columns'][$field])) {
// Creating short description
$output = self::wrapInHelp($table, $field);
if ($output && $wrap) {
$wrParts = explode('|', $wrap);
$output = $wrParts[0] . $output . $wrParts[1];
......
......@@ -378,7 +378,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
// Start table:
$this->oddColumnsCssClass = '';
// CSH:
$out = BackendUtility::cshItem($this->descrTable, ('func_' . $pKey), $GLOBALS['BACK_PATH']) . '
$out = BackendUtility::cshItem($this->descrTable, ('func_' . $pKey)) . '
<table class="t3-table typo3-page-pages">' .
'<thead>' .
$this->addelement(1, '', $theData) .
......@@ -651,7 +651,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
$out .= $grid . '</table></div>';
}
// CSH:
$out .= BackendUtility::cshItem($this->descrTable, 'columns_multi', $GLOBALS['BACK_PATH']);
$out .= BackendUtility::cshItem($this->descrTable, 'columns_multi');
}
// If language mode, then make another presentation:
// Notice that THIS presentation will override the value of $out!
......@@ -739,7 +739,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
</table>
</div>';
// CSH:
$out .= BackendUtility::cshItem($this->descrTable, 'language_list', $GLOBALS['BACK_PATH']);
$out .= BackendUtility::cshItem($this->descrTable, 'language_list');
}
} else {
// SINGLE column mode (columns shown beneath each other):
......@@ -844,7 +844,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
' . $out . '
</table>';
// CSH:
$out .= BackendUtility::cshItem($this->descrTable, 'columns_single', $GLOBALS['BACK_PATH']);
$out .= BackendUtility::cshItem($this->descrTable, 'columns_single');
} else {
$out = '<br/><br/>' . $this->getPageLayoutController()->doc->icons(1)
. 'Sorry, you cannot view a single language in this localization mode (Default Language Binding is enabled)<br/><br/>';
......@@ -902,7 +902,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
<tr>
<td>' . implode('</td>
<td>', $bArray) . '</td>
<td>' . BackendUtility::cshItem($this->descrTable, 'button_panel', $GLOBALS['BACK_PATH']) . '</td>
<td>' . BackendUtility::cshItem($this->descrTable, 'button_panel') . '</td>
</tr>
</table>
<br />
......
=============================================================
Deprecation: #62864 - BackendUtility->helpTextIcon deprecated
=============================================================
Description
===========
The function helpTextIcon in BackendUtility is deprecated.
Impact
======
The core does not use this functionality anymore.
Affected installations
======================
All installations which use the function helpTextIcon.
Migration
=========
Use BackendUtility::cshItem instead.
......@@ -374,7 +374,7 @@ class FileListController {
// Set clipboard:
if ($this->MOD_SETTINGS['clipBoard']) {
$pageContent .= $this->filelist->clipObj->printClipboard();
$pageContent .= BackendUtility::cshItem('xMOD_csh_corebe', 'filelist_clipboard', $GLOBALS['BACK_PATH']);
$pageContent .= BackendUtility::cshItem('xMOD_csh_corebe', 'filelist_clipboard');
}
}
$markerArray = array(
......@@ -447,7 +447,7 @@ class FileListController {
$buttons['shortcut'] = $this->doc->makeShortcutIcon('pointer,id,target,table', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']);
}
// FileList Module CSH:
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'filelist_module', $GLOBALS['BACK_PATH'], '', TRUE);
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'filelist_module');
// Upload button (only if upload to this directory is allowed)
if ($this->folderObject && $this->folderObject->getStorage()->checkUserActionPermission('add', 'File') && $this->folderObject->checkActionPermission('write')) {
$buttons['upload'] = '<a href="' . htmlspecialchars($GLOBALS['BACK_PATH']
......@@ -475,4 +475,4 @@ class FileListController {
return $buttons;
}
}
\ No newline at end of file
}
......@@ -60,7 +60,7 @@ class CshViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Be\AbstractBackendViewH
$moduleName = $currentRequest->getPluginName();
$table = '_MOD_' . $moduleName;
}
$cshButton = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem($table, $field, $GLOBALS['BACK_PATH'], '', $iconOnly, $styleAttributes);
$cshButton = \TYPO3\CMS\Backend\Utility\BackendUtility::cshItem($table, $field);
return '<div class="docheader-csh">' . $cshButton . '</div>';
}
}
......@@ -319,9 +319,9 @@ class WizardView extends \TYPO3\CMS\Form\View\Wizard\AbstractWizardView {
'reload' => ''
);
// CSH
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz', $GLOBALS['BACK_PATH'], '');
$buttons['csh'] = BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz');
// CSH Buttons
$buttons['csh_buttons'] = BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz_buttons', $GLOBALS['BACK_PATH'], '');
$buttons['csh_buttons'] = BackendUtility::cshItem('xMOD_csh_corebe', 'wizard_forms_wiz_buttons');
// Close
$getPostVariables = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('P');
$buttons['close'] = '<a href="#" onclick="' . htmlspecialchars(('jumpToUrl(unescape(\'' . rawurlencode(\TYPO3\CMS\Core\Utility\GeneralUtility::sanitizeLocalUrl($getPostVariables['returnUrl'])) . '\')); return false;')) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-document-close', array(
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment