mirror of
https://github.com/FriendsOfTYPO3/feedit.git
synced 2024-11-09 17:26:09 +01:00
[TASK] Make TYPO3 Core PSR-2 standard compliant
In our efforts to achieve a better interoperability with other PHP projects, the PHP code base of the TYPO3 Core switches to the PHP coding guideline standard PSR-2. See http://www.php-fig.org/psr/psr-2/ for more information. Resolves: #70515 Releases: master Change-Id: I734c0d838af157003decfeb5fc0a11dddcb87bf5 Reviewed-on: http://review.typo3.org/43918 Reviewed-by: TYPO3 Release Team <typo3cms@typo3.org> Tested-by: TYPO3 Release Team <typo3cms@typo3.org>
This commit is contained in:
parent
12c9393fad
commit
851a5d8262
2 changed files with 295 additions and 290 deletions
|
@ -28,8 +28,8 @@ use TYPO3\CMS\Frontend\View\AdminPanelView;
|
||||||
/**
|
/**
|
||||||
* View class for the edit panels in frontend editing.
|
* View class for the edit panels in frontend editing.
|
||||||
*/
|
*/
|
||||||
class FrontendEditPanel {
|
class FrontendEditPanel
|
||||||
|
{
|
||||||
/**
|
/**
|
||||||
* The Content Object Renderer
|
* The Content Object Renderer
|
||||||
*
|
*
|
||||||
|
@ -68,7 +68,8 @@ class FrontendEditPanel {
|
||||||
* @param TypoScriptFrontendController $frontendController
|
* @param TypoScriptFrontendController $frontendController
|
||||||
* @param FrontendBackendUserAuthentication $backendUser
|
* @param FrontendBackendUserAuthentication $backendUser
|
||||||
*/
|
*/
|
||||||
public function __construct(DatabaseConnection $databaseConnection = NULL, TypoScriptFrontendController $frontendController = NULL, FrontendBackendUserAuthentication $backendUser = NULL) {
|
public function __construct(DatabaseConnection $databaseConnection = null, TypoScriptFrontendController $frontendController = null, FrontendBackendUserAuthentication $backendUser = null)
|
||||||
|
{
|
||||||
$this->databaseConnection = $databaseConnection ?: $GLOBALS['TYPO3_DB'];
|
$this->databaseConnection = $databaseConnection ?: $GLOBALS['TYPO3_DB'];
|
||||||
$this->frontendController = $frontendController ?: $GLOBALS['TSFE'];
|
$this->frontendController = $frontendController ?: $GLOBALS['TSFE'];
|
||||||
$this->backendUser = $backendUser ?: $GLOBALS['BE_USER'];
|
$this->backendUser = $backendUser ?: $GLOBALS['BE_USER'];
|
||||||
|
@ -92,11 +93,12 @@ class FrontendEditPanel {
|
||||||
* @param array $hiddenFields
|
* @param array $hiddenFields
|
||||||
* @return string The input content string with the editPanel appended. This function returns only an edit panel appended to the content string if a backend user is logged in (and has the correct permissions). Otherwise the content string is directly returned.
|
* @return string The input content string with the editPanel appended. This function returns only an edit panel appended to the content string if a backend user is logged in (and has the correct permissions). Otherwise the content string is directly returned.
|
||||||
*/
|
*/
|
||||||
public function editPanel($content, array $conf, $currentRecord = '', array $dataArr = array(), $table = '', array $allow = array(), $newUID = 0, array $hiddenFields = array()) {
|
public function editPanel($content, array $conf, $currentRecord = '', array $dataArr = array(), $table = '', array $allow = array(), $newUID = 0, array $hiddenFields = array())
|
||||||
|
{
|
||||||
$hiddenFieldString = $command = '';
|
$hiddenFieldString = $command = '';
|
||||||
|
|
||||||
// Special content is about to be shown, so the cache must be disabled.
|
// Special content is about to be shown, so the cache must be disabled.
|
||||||
$this->frontendController->set_no_cache('Frontend edit panel is shown', TRUE);
|
$this->frontendController->set_no_cache('Frontend edit panel is shown', true);
|
||||||
|
|
||||||
$formName = 'TSFE_EDIT_FORM_' . substr($this->frontendController->uniqueHash(), 0, 4);
|
$formName = 'TSFE_EDIT_FORM_' . substr($this->frontendController->uniqueHash(), 0, 4);
|
||||||
$formTag = '<form name="' . $formName . '" id ="' . $formName . '" action="' . htmlspecialchars(GeneralUtility::getIndpEnv('REQUEST_URI')) . '" method="post" enctype="multipart/form-data" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
|
$formTag = '<form name="' . $formName . '" id ="' . $formName . '" action="' . htmlspecialchars(GeneralUtility::getIndpEnv('REQUEST_URI')) . '" method="post" enctype="multipart/form-data" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
|
||||||
|
@ -212,11 +214,12 @@ class FrontendEditPanel {
|
||||||
* @param string $fieldList
|
* @param string $fieldList
|
||||||
* @return string The input content string, possibly with edit icons added (not necessarily in the end but just after the last string of normal content.
|
* @return string The input content string, possibly with edit icons added (not necessarily in the end but just after the last string of normal content.
|
||||||
*/
|
*/
|
||||||
public function editIcons($content, $params, array $conf = array(), $currentRecord = '', array $dataArr = array(), $addUrlParamStr = '', $table, $editUid, $fieldList) {
|
public function editIcons($content, $params, array $conf = array(), $currentRecord = '', array $dataArr = array(), $addUrlParamStr = '', $table, $editUid, $fieldList)
|
||||||
|
{
|
||||||
// Special content is about to be shown, so the cache must be disabled.
|
// Special content is about to be shown, so the cache must be disabled.
|
||||||
$this->frontendController->set_no_cache('Display frontend edit icons', TRUE);
|
$this->frontendController->set_no_cache('Display frontend edit icons', true);
|
||||||
$iconTitle = $this->cObj->stdWrap($conf['iconTitle'], $conf['iconTitle.']);
|
$iconTitle = $this->cObj->stdWrap($conf['iconTitle'], $conf['iconTitle.']);
|
||||||
$iconImg = '<span title="' . htmlspecialchars($iconTitle, ENT_COMPAT, 'UTF-8', FALSE) . '" class="frontEndEditIcons" style="' . ($conf['styleAttribute'] ? htmlspecialchars($conf['styleAttribute']) : '') . '">'
|
$iconImg = '<span title="' . htmlspecialchars($iconTitle, ENT_COMPAT, 'UTF-8', false) . '" class="frontEndEditIcons" style="' . ($conf['styleAttribute'] ? htmlspecialchars($conf['styleAttribute']) : '') . '">'
|
||||||
. $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render()
|
. $this->iconFactory->getIcon('actions-document-open', Icon::SIZE_SMALL)->render()
|
||||||
. '</span>';
|
. '</span>';
|
||||||
$nV = GeneralUtility::_GP('ADMCMD_view') ? 1 : 0;
|
$nV = GeneralUtility::_GP('ADMCMD_view') ? 1 : 0;
|
||||||
|
@ -258,7 +261,8 @@ class FrontendEditPanel {
|
||||||
* @param int|string $nPid "New pid" - for new records
|
* @param int|string $nPid "New pid" - for new records
|
||||||
* @return string A <a> tag wrapped string.
|
* @return string A <a> tag wrapped string.
|
||||||
*/
|
*/
|
||||||
protected function editPanelLinkWrap($string, $formName, $cmd, $currentRecord = '', $confirm = '', $nPid = '') {
|
protected function editPanelLinkWrap($string, $formName, $cmd, $currentRecord = '', $confirm = '', $nPid = '')
|
||||||
|
{
|
||||||
$nV = GeneralUtility::_GP('ADMCMD_view') ? 1 : 0;
|
$nV = GeneralUtility::_GP('ADMCMD_view') ? 1 : 0;
|
||||||
if ($cmd == 'edit') {
|
if ($cmd == 'edit') {
|
||||||
$rParts = explode(':', $currentRecord);
|
$rParts = explode(':', $currentRecord);
|
||||||
|
@ -276,7 +280,7 @@ class FrontendEditPanel {
|
||||||
} else {
|
} else {
|
||||||
if ($confirm && $this->backendUser->jsConfirmation(JsConfirmation::FE_EDIT)) {
|
if ($confirm && $this->backendUser->jsConfirmation(JsConfirmation::FE_EDIT)) {
|
||||||
// Gets htmlspecialchared later
|
// Gets htmlspecialchared later
|
||||||
$cf1 = 'if (confirm(' . GeneralUtility::quoteJSvalue($confirm, TRUE) . ')) {';
|
$cf1 = 'if (confirm(' . GeneralUtility::quoteJSvalue($confirm, true) . ')) {';
|
||||||
$cf2 = '}';
|
$cf2 = '}';
|
||||||
} else {
|
} else {
|
||||||
$cf1 = ($cf2 = '');
|
$cf1 = ($cf2 = '');
|
||||||
|
@ -294,7 +298,8 @@ class FrontendEditPanel {
|
||||||
* @return string A <a> tag wrapped string.
|
* @return string A <a> tag wrapped string.
|
||||||
* @see editPanelLinkWrap()
|
* @see editPanelLinkWrap()
|
||||||
*/
|
*/
|
||||||
protected function editPanelLinkWrap_doWrap($string, $url) {
|
protected function editPanelLinkWrap_doWrap($string, $url)
|
||||||
|
{
|
||||||
$onclick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue($url . '&returnUrl=sysext/backend/Resources/Private/Templates/Close.html') . ',\'FEquickEditWindow\',\'width=690,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
|
$onclick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue($url . '&returnUrl=sysext/backend/Resources/Private/Templates/Close.html') . ',\'FEquickEditWindow\',\'width=690,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
|
||||||
return '<a href="#" onclick="' . htmlspecialchars($onclick) . '" class="frontEndEditIconLinks">' . $string . '</a>';
|
return '<a href="#" onclick="' . htmlspecialchars($onclick) . '" class="frontEndEditIconLinks">' . $string . '</a>';
|
||||||
}
|
}
|
||||||
|
@ -306,8 +311,9 @@ class FrontendEditPanel {
|
||||||
* @param array $row The data record
|
* @param array $row The data record
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function isDisabled($table, array $row) {
|
protected function isDisabled($table, array $row)
|
||||||
$status = FALSE;
|
{
|
||||||
|
$status = false;
|
||||||
if (
|
if (
|
||||||
$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'] &&
|
$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled'] &&
|
||||||
$row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled']] ||
|
$row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['disabled']] ||
|
||||||
|
@ -320,10 +326,9 @@ class FrontendEditPanel {
|
||||||
$row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime']] &&
|
$row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime']] &&
|
||||||
$row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime']] < $GLOBALS['EXEC_TIME']
|
$row[$GLOBALS['TCA'][$table]['ctrl']['enablecolumns']['endtime']] < $GLOBALS['EXEC_TIME']
|
||||||
) {
|
) {
|
||||||
$status = TRUE;
|
$status = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $status;
|
return $status;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue