Skip to content
Snippets Groups Projects
Verified Commit 8626e205 authored by Kevin Ditscheid's avatar Kevin Ditscheid
Browse files

[BUGFIX] Lighten the ControlViewHelper and remove stuff that's not necessary

parent c6d44867
No related branches found
No related tags found
1 merge request!48[TASK] Require TYPO3 12
...@@ -32,7 +32,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility; ...@@ -32,7 +32,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
/** /**
* Class ControlViewHelper * Class CompanyLabelViewHelper
**/ **/
class CompanyLabelViewHelper extends AbstractViewHelper { class CompanyLabelViewHelper extends AbstractViewHelper {
/** /**
......
...@@ -29,8 +29,6 @@ namespace SGalinski\SgJobs\ViewHelpers\Backend; ...@@ -29,8 +29,6 @@ namespace SGalinski\SgJobs\ViewHelpers\Backend;
use SGalinski\SgJobs\Domain\Model\Job; use SGalinski\SgJobs\Domain\Model\Job;
use TYPO3\CMS\Backend\RecordList\DatabaseRecordList; use TYPO3\CMS\Backend\RecordList\DatabaseRecordList;
use TYPO3\CMS\Backend\Utility\BackendUtility; use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Localization\LanguageService;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Type\Bitmask\Permission; use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper; use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
...@@ -61,19 +59,11 @@ class ControlViewHelper extends AbstractViewHelper { ...@@ -61,19 +59,11 @@ class ControlViewHelper extends AbstractViewHelper {
$row = $this->arguments['row']; $row = $this->arguments['row'];
$row = BackendUtility::getRecord('tx_sgjobs_domain_model_job', $row['uid']); $row = BackendUtility::getRecord('tx_sgjobs_domain_model_job', $row['uid']);
// force reading of core file into $GLOBALS['LANG'], because the ->labels array will be empty otherwise /** @var DatabaseRecordList $databaseRecordList */
$GLOBALS['LANG']->includeLLFile('EXT:core/Resources/Private/Language/locallang_mod_web_list.xlf');
$databaseRecordList = GeneralUtility::makeInstance(DatabaseRecordList::class); $databaseRecordList = GeneralUtility::makeInstance(DatabaseRecordList::class);
$databaseRecordList->setRequest($this->renderingContext->getRequest()); $databaseRecordList->setRequest($this->renderingContext->getRequest());
$pageInfo = BackendUtility::readPageAccess($row['pid'], $GLOBALS['BE_USER']->getPagePermsClause(1)); $pageInfo = BackendUtility::readPageAccess($row['pid'], $GLOBALS['BE_USER']->getPagePermsClause(1));
$databaseRecordList->calcPerms = new Permission( $databaseRecordList->calcPerms = new Permission($GLOBALS['BE_USER']->calcPerms($pageInfo));
$GLOBALS['BE_USER']->calcPerms($pageInfo)
);
/** @var PageRenderer $pageRenderer */
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
$pageRenderer->loadJavaScriptModule('@typo3/backend/ajax-data-handler.js');
$pageRenderer->addInlineLanguageLabelFile('EXT:backend/Resources/Private/Language/locallang_alt_doc.xlf');
// DatabaseRecordList has a $prevPrevUid, which might track back a page. We won't do that, 1st+last record are // DatabaseRecordList has a $prevPrevUid, which might track back a page. We won't do that, 1st+last record are
// not sortable in one direction // not sortable in one direction
......
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