Skip to content
Snippets Groups Projects
Commit ece20533 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Fixing cgl issues

parent 10e9d3bb
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,9 @@ class BackendController extends ActionController {
/** @var QueryResultInterface $categories */
$locations = $this->locationRepository->findByPid($this->rootPageUid);
$locationOptions = [];
/** @var Location $location */
/** @var $locations Location[][] */
foreach ($locations as $location) {
$locationOptions[$location->getUid()] = $location->getCity();
}
......
<?php
namespace SGalinski\SgJobs\Service;
/***************************************************************
* Copyright notice
*
* (c) sgalinski Internet Services (https://www.sgalinski.de)
*
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* The GNU General Public License can be found at
* http://www.gnu.org/copyleft/gpl.html.
*
* This script is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
use TYPO3\CMS\Backend\Template\Components\ButtonBar;
use TYPO3\CMS\Backend\Template\Components\DocHeaderComponent;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
/**
* Helper functions for the ModerationController
*/
class ModerationService {
/**
* create buttons for the backend module header
*
* @param DocHeaderComponent $docHeaderComponent
* @param string $pluginName
* @return DocHeaderComponent
*/
public function makeButtons($docHeaderComponent, $pluginName) {
/** @var ButtonBar $buttonBar */
$buttonBar = $docHeaderComponent->getButtonBar();
/** @var IconFactory $iconFactory */
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
// Refresh
$refreshButton = $buttonBar->makeLinkButton()
->setHref(GeneralUtility::getIndpEnv('REQUEST_URI'))
->setTitle(LocalizationUtility::translate('LLL:EXT:lang/locallang_core.xlf:labels.reload', ''))
->setIcon($iconFactory->getIcon('actions-refresh', Icon::SIZE_SMALL));
$buttonBar->addButton($refreshButton, ButtonBar::BUTTON_POSITION_RIGHT);
// shortcut button
$shortcutButton = $buttonBar->makeShortcutButton()
->setModuleName($pluginName)
->setGetVariables(
[
'id',
'M'
]
)
->setSetVariables([]);
$buttonBar->addButton($shortcutButton, ButtonBar::BUTTON_POSITION_RIGHT);
$docHeaderComponent->getButtonBar($buttonBar);
return $docHeaderComponent;
}
}
......@@ -39,7 +39,7 @@ class AbstractViewHelper extends AbstractBackendViewHelper {
*
* @return string
*/
public function getBaseUrl() {
public function getBaseUrl(): string {
if ($GLOBALS['TSFE']->absRefPrefix !== '') {
$baseUrl = $GLOBALS['TSFE']->absRefPrefix;
} else {
......
......@@ -43,7 +43,7 @@ class ControlViewHelper extends AbstractViewHelper {
* @throws \InvalidArgumentException
* @throws \UnexpectedValueException
*/
public function render($table, $row) {
public function render($table, $row): string {
/** @var DatabaseRecordList $databaseRecordList */
$databaseRecordList = GeneralUtility::makeInstance(DatabaseRecordList::class);
......
......@@ -41,7 +41,7 @@ class EditLinkViewHelper extends AbstractViewHelper {
* @param boolean $new
* @return string
*/
public function render($table, $uid, $new = FALSE) {
public function render($table, $uid, $new = FALSE): string {
return BackendUtility::getModuleUrl('record_edit') . '&edit[' . $table . '][' . $uid . ']=' . ($new ? 'new' : 'edit');
}
}
<?php
namespace SGalinski\SgJobs\ViewHelpers\Backend;
/***************************************************************
......@@ -44,7 +45,7 @@ class IconViewHelper extends AbstractViewHelper {
* @return string
* @throws \InvalidArgumentException
*/
public function render($table, $row, $clickMenu = TRUE) {
public function render($table, $row, $clickMenu = TRUE): string {
if (!is_array($row)) {
$row = BackendUtility::getRecord($table, $row->getUid());
}
......@@ -56,9 +57,8 @@ class IconViewHelper extends AbstractViewHelper {
. '</span>';
if ($clickMenu) {
return BackendUtility::wrapClickMenuOnIcon($iconImg, $table, $row['uid']);
} else {
return $iconImg;
}
return $iconImg;
}
}
\ No newline at end of file
<?php
namespace SGalinski\SgJobs\ViewHelpers\Backend\Widget;
/***************************************************************
......@@ -54,6 +55,7 @@ class PaginateViewHelper extends AbstractWidgetViewHelper {
* @param string $as
* @param array $configuration
* @return string
* @throws \TYPO3\CMS\Fluid\Core\Widget\Exception\MissingControllerException
*/
public function render(
$objects, $as,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment