[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:
TYPO3 Release Team 2015-10-09 00:08:57 +02:00
parent 12c9393fad
commit 851a5d8262
2 changed files with 295 additions and 290 deletions

View file

@ -28,8 +28,8 @@ use TYPO3\CMS\Frontend\View\AdminPanelView;
/**
* View class for the edit panels in frontend editing.
*/
class FrontendEditPanel {
class FrontendEditPanel
{
/**
* The Content Object Renderer
*
@ -68,7 +68,8 @@ class FrontendEditPanel {
* @param TypoScriptFrontendController $frontendController
* @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->frontendController = $frontendController ?: $GLOBALS['TSFE'];
$this->backendUser = $backendUser ?: $GLOBALS['BE_USER'];
@ -92,11 +93,12 @@ class FrontendEditPanel {
* @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.
*/
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 = '';
// 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);
$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
* @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.
$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.']);
$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()
. '</span>';
$nV = GeneralUtility::_GP('ADMCMD_view') ? 1 : 0;
@ -258,7 +261,8 @@ class FrontendEditPanel {
* @param int|string $nPid "New pid" - for new records
* @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;
if ($cmd == 'edit') {
$rParts = explode(':', $currentRecord);
@ -276,7 +280,7 @@ class FrontendEditPanel {
} else {
if ($confirm && $this->backendUser->jsConfirmation(JsConfirmation::FE_EDIT)) {
// Gets htmlspecialchared later
$cf1 = 'if (confirm(' . GeneralUtility::quoteJSvalue($confirm, TRUE) . ')) {';
$cf1 = 'if (confirm(' . GeneralUtility::quoteJSvalue($confirm, true) . ')) {';
$cf2 = '}';
} else {
$cf1 = ($cf2 = '');
@ -294,7 +298,8 @@ class FrontendEditPanel {
* @return string A <a> tag wrapped string.
* @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;';
return '<a href="#" onclick="' . htmlspecialchars($onclick) . '" class="frontEndEditIconLinks">' . $string . '</a>';
}
@ -306,8 +311,9 @@ class FrontendEditPanel {
* @param array $row The data record
* @return bool
*/
protected function isDisabled($table, array $row) {
$status = FALSE;
protected function isDisabled($table, array $row)
{
$status = false;
if (
$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']] < $GLOBALS['EXEC_TIME']
) {
$status = TRUE;
$status = true;
}
return $status;
}
}