Commit bf13b4ad authored by Alexander Schnitzler's avatar Alexander Schnitzler Committed by Stefan Neufeind
Browse files

[TASK] Make sysext filelist an extbase module

Currently the filelist module is not yet an extbase
module. To be able to adjust the module in the future
more easily the module will be based on extbase.

Releases: master
Resolves: #69083
Change-Id: I74884cd554272b68ab80509b7548647ff01632d6
Reviewed-on: http://review.typo3.org/42644


Reviewed-by: default avatarCarsten Bleicker <carsten@bleicker.de>
Tested-by: default avatarCarsten Bleicker <carsten@bleicker.de>
Reviewed-by: default avatarDaniel Goerz <ervaude@gmail.com>
Tested-by: default avatarDaniel Goerz <ervaude@gmail.com>
Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
parent 0341a224
......@@ -118,14 +118,14 @@ class CreateFolderController implements \TYPO3\CMS\Core\Http\ControllerInterface
$this->doc->JScode = $this->doc->wrapScriptTags('
var path = "' . $this->target . '";
function reload(a) { //
function reload(a) {
if (!changed || (changed && confirm(' . GeneralUtility::quoteJSvalue($this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:mess.redraw')) . '))) {
var params = "&target="+encodeURIComponent(path)+"&number="+a+"&returnUrl=' . rawurlencode($this->returnUrl) . '";
window.location.href = ' . GeneralUtility::quoteJSvalue(BackendUtility::getModuleUrl('file_newfolder')) . '+params;
}
}
function backToList() { //
top.goToModule("file_list");
function backToList() {
top.goToModule("file_FilelistList");
}
var changed = 0;
......
......@@ -121,8 +121,8 @@ class EditFileController implements \TYPO3\CMS\Core\Http\ControllerInterface {
$this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/file_edit.html');
$this->doc->JScode = $this->doc->wrapScriptTags('
function backToList() { //
top.goToModule("file_list");
function backToList() {
top.goToModule("file_FilelistList");
}
');
$this->doc->form = '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('tce_file')) . '" method="post" name="editform">';
......
......@@ -25,24 +25,26 @@ use TYPO3\CMS\Core\Http\Response;
*/
class RenameFileController implements \TYPO3\CMS\Core\Http\ControllerInterface {
// Internal, static:
/**
* Document template object
*
* @var \TYPO3\CMS\Backend\Template\DocumentTemplate
* @internal
*/
public $doc;
// Name of the filemount
/**
* Name of the filemount
*
* @var string
*/
public $title;
// Internal, static (GPVar):
// Set with the target path inputted in &target
/**
* Target path
*
* @var string
* @internal
*/
public $target;
......@@ -53,16 +55,18 @@ class RenameFileController implements \TYPO3\CMS\Core\Http\ControllerInterface {
*/
protected $fileOrFolderObject;
// Return URL of list module.
/**
* Return URL of list module.
*
* @var string
*/
public $returnUrl;
// Internal, dynamic:
// Accumulating content
/**
* Accumulating content
*
* @var string
* @internal
*/
public $content;
......@@ -114,8 +118,8 @@ class RenameFileController implements \TYPO3\CMS\Core\Http\ControllerInterface {
$this->doc = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Template\DocumentTemplate::class);
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/file_rename.html');
$this->doc->JScode = $this->doc->wrapScriptTags('
function backToList() { //
top.goToModule("file_list");
function backToList() {
top.goToModule("file_FilelistList");
}
');
}
......
......@@ -124,8 +124,8 @@ class ReplaceFileController implements \TYPO3\CMS\Core\Http\ControllerInterface
$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/file_replace.html');
$this->doc->JScode = $this->doc->wrapScriptTags('
function backToList() { //
top.goToModule("file_list");
function backToList() {
top.goToModule("file_FilelistList");
}
');
}
......
......@@ -22,6 +22,7 @@ use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Page\PageRenderer;
use TYPO3\CMS\Core\Resource\Exception;
use TYPO3\CMS\Core\Resource\Folder;
use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Resource\Utility\ListUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
......@@ -33,14 +34,14 @@ use TYPO3\CMS\Filelist\FileList;
/**
* Script Class for creating the list of files in the File > Filelist module
*/
class FileListController {
class FileListController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionController {
/**
* Module configuration
*
* @var array
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8. The Module gets configured by ExtensionManagementUtility::addModule() in ext_tables.php
*/
* Module configuration
*
* @var array
* @deprecated since TYPO3 CMS 7, will be removed in TYPO3 CMS 8. The Module gets configured by ExtensionManagementUtility::addModule() in ext_tables.php
*/
public $MCONF = array();
/**
......@@ -53,13 +54,6 @@ class FileListController {
*/
public $MOD_SETTINGS = array();
/**
* Accumulated HTML output
*
* @var string
*/
public $content;
/**
* Document template object
*
......@@ -75,7 +69,7 @@ class FileListController {
public $id;
/**
* @var \TYPO3\CMS\Core\Resource\Folder
* @var Folder
*/
protected $folderObject;
......@@ -131,14 +125,6 @@ class FileListController {
*/
protected $moduleName = 'file_list';
/**
* Constructor
*/
public function __construct() {
$this->getLanguageService()->includeLLFile('EXT:lang/locallang_mod_file_list.xlf');
$this->getLanguageService()->includeLLFile('EXT:lang/locallang_misc.xlf');
}
/**
* Initialize variables, file object
* Incoming GET vars include id, pointer, table, imagemode
......@@ -147,7 +133,11 @@ class FileListController {
* @throws \RuntimeException
* @throws Exception\InsufficientFolderAccessPermissionsException
*/
public function init() {
public function initializeObject() {
$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
$this->getLanguageService()->includeLLFile('EXT:lang/locallang_mod_file_list.xlf');
$this->getLanguageService()->includeLLFile('EXT:lang/locallang_misc.xlf');
// Setting GPvars:
$this->id = ($combinedIdentifier = GeneralUtility::_GP('id'));
$this->pointer = GeneralUtility::_GP('pointer');
......@@ -267,48 +257,53 @@ class FileListController {
}
/**
* Main function, creating the listing
*
* @return void
*/
public function main() {
// Initialize the template object
$this->doc = GeneralUtility::makeInstance(DocumentTemplate::class);
$this->doc->setModuleTemplate('EXT:filelist/Resources/Private/Templates/file_list.html');
public function initializeIndexAction() {
// Apply predefined values for hidden checkboxes
// Set predefined value for DisplayBigControlPanel:
$backendUser = $this->getBackendUser();
if ($backendUser->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'activated') {
$this->MOD_SETTINGS['bigControlPanel'] = TRUE;
} elseif ($backendUser->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'deactivated') {
$this->MOD_SETTINGS['bigControlPanel'] = FALSE;
}
// Set predefined value for DisplayThumbnails:
if ($backendUser->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'activated') {
$this->MOD_SETTINGS['displayThumbs'] = TRUE;
} elseif ($backendUser->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'deactivated') {
$this->MOD_SETTINGS['displayThumbs'] = FALSE;
}
// Set predefined value for Clipboard:
if ($backendUser->getTSConfigVal('options.file_list.enableClipBoard') === 'activated') {
$this->MOD_SETTINGS['clipBoard'] = TRUE;
} elseif ($backendUser->getTSConfigVal('options.file_list.enableClipBoard') === 'deactivated') {
$this->MOD_SETTINGS['clipBoard'] = FALSE;
}
// If user never opened the list module, set the value for displayThumbs
if (!isset($this->MOD_SETTINGS['displayThumbs'])) {
$this->MOD_SETTINGS['displayThumbs'] = $backendUser->uc['thumbnailsByDefault'];
}
if (!isset($this->MOD_SETTINGS['sort'])) {
// Set default sorting
$this->MOD_SETTINGS['sort'] = 'file';
$this->MOD_SETTINGS['reverse'] = 0;
}
}
$pageRenderer = $this->getPageRenderer();
$pageRenderer->loadJQuery();
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Filelist/FileListLocalisation');
/**
* @return void
*/
public function indexAction() {
// There there was access to this file path, continue, make the list
if ($this->folderObject) {
$requireJsModules = ['TYPO3/CMS/Filelist/FileListLocalisation'];
$addJsInlineLabels = [];
// Create filelisting object
$this->filelist = GeneralUtility::makeInstance(FileList::class);
// Apply predefined values for hidden checkboxes
// Set predefined value for DisplayBigControlPanel:
$backendUser = $this->getBackendUser();
if ($backendUser->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'activated') {
$this->MOD_SETTINGS['bigControlPanel'] = TRUE;
} elseif ($backendUser->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'deactivated') {
$this->MOD_SETTINGS['bigControlPanel'] = FALSE;
}
// Set predefined value for DisplayThumbnails:
if ($backendUser->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'activated') {
$this->MOD_SETTINGS['displayThumbs'] = TRUE;
} elseif ($backendUser->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'deactivated') {
$this->MOD_SETTINGS['displayThumbs'] = FALSE;
}
// Set predefined value for Clipboard:
if ($backendUser->getTSConfigVal('options.file_list.enableClipBoard') === 'activated') {
$this->MOD_SETTINGS['clipBoard'] = TRUE;
} elseif ($backendUser->getTSConfigVal('options.file_list.enableClipBoard') === 'deactivated') {
$this->MOD_SETTINGS['clipBoard'] = FALSE;
}
// If user never opened the list module, set the value for displayThumbs
if (!isset($this->MOD_SETTINGS['displayThumbs'])) {
$this->MOD_SETTINGS['displayThumbs'] = $backendUser->uc['thumbnailsByDefault'];
}
$this->filelist = GeneralUtility::makeInstance(FileList::class, $this);
$this->filelist->thumbs = $this->MOD_SETTINGS['displayThumbs'];
// Create clipboard object and initialize that
$this->filelist->clipObj = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Clipboard\Clipboard::class);
......@@ -355,20 +350,13 @@ class FileListController {
$fileProcessor->pushErrorMessagesToFlashMessageQueue();
}
}
if (!isset($this->MOD_SETTINGS['sort'])) {
// Set default sorting
$this->MOD_SETTINGS['sort'] = 'file';
$this->MOD_SETTINGS['reverse'] = 0;
}
// Start up filelisting object, include settings.
$this->pointer = MathUtility::forceIntegerInRange($this->pointer, 0, 100000);
$this->filelist->start($this->folderObject, $this->pointer, $this->MOD_SETTINGS['sort'], $this->MOD_SETTINGS['reverse'], $this->MOD_SETTINGS['clipBoard'], $this->MOD_SETTINGS['bigControlPanel']);
// Generate the list
$this->filelist->generateList();
// Set top JavaScript:
$this->doc->JScode = $this->doc->wrapScriptTags('if (top.fsMod) top.fsMod.recentIds["file"] = "' . rawurlencode($this->id) . '";' . $this->filelist->CBfunctions());
// This will return content necessary for the context sensitive clickmenus to work: bodytag events, JavaScript functions and DIV-layers.
$this->doc->getContextMenuCode();
$addJsInline = 'if (top.fsMod) top.fsMod.recentIds["file"] = "' . rawurlencode($this->id) . '";' . $this->filelist->CBfunctions();
// Setting up the buttons and markers for docheader
list($buttons, $otherMarkers) = $this->filelist->getButtonsAndOtherMarkers($this->folderObject);
// add the folder info to the marker array
......@@ -379,86 +367,55 @@ class FileListController {
if ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File')
&& $this->folderObject->checkActionPermission('write')
) {
$pageRenderer->loadRequireJsModule('TYPO3/CMS/Backend/DragUploader');
$pageRenderer->addInlineLanguagelabelFile(
ExtensionManagementUtility::extPath('lang') . 'locallang_core.xlf',
'file_upload'
);
$requireJsModules[] = 'TYPO3/CMS/Backend/DragUploader';
$addJsInlineLabelFiles[] = [
'file' => ExtensionManagementUtility::extPath('lang') . 'locallang_core.xlf',
'prefix' => 'file_upload'
];
}
// Build the <body> for the module
$moduleHeadline = $this->getModuleHeadline();
// Create output
$pageContent = $moduleHeadline !== '' ? '<h1>' . $moduleHeadline . '</h1>' : '';
$pageContent .= '<form action="' . htmlspecialchars($this->filelist->listURL()) . '" method="post" name="dblistForm">';
$pageContent .= $this->filelist->HTMLcode;
$pageContent .= '<input type="hidden" name="cmd" /></form>';
// Making listing options:
if ($this->filelist->HTMLcode) {
$pageContent .= '
<!--
Listing options for extended view, clipboard and thumbnails
-->
<div class="typo3-listOptions">
';
// Add "display bigControlPanel" checkbox:
if ($backendUser->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'selectable') {
$pageContent .= '<div class="checkbox">' .
'<label for="bigControlPanel">' .
BackendUtility::getFuncCheck($this->id, 'SET[bigControlPanel]', $this->MOD_SETTINGS['bigControlPanel'], '', '', 'id="bigControlPanel"') .
$this->getLanguageService()->getLL('bigControlPanel', TRUE) .
'</label>' .
'</div>';
}
// Add "display thumbnails" checkbox:
if ($backendUser->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'selectable') {
$pageContent .= '<div class="checkbox">' .
'<label for="checkDisplayThumbs">' .
BackendUtility::getFuncCheck($this->id, 'SET[displayThumbs]', $this->MOD_SETTINGS['displayThumbs'], '', '', 'id="checkDisplayThumbs"') .
$this->getLanguageService()->getLL('displayThumbs', TRUE) .
'</label>' .
'</div>';
}
// Add "clipboard" checkbox:
if ($backendUser->getTSConfigVal('options.file_list.enableClipBoard') === 'selectable') {
$pageContent .= '<div class="checkbox">' .
'<label for="checkClipBoard">' .
BackendUtility::getFuncCheck($this->id, 'SET[clipBoard]', $this->MOD_SETTINGS['clipBoard'], '', '', 'id="checkClipBoard"') .
$this->getLanguageService()->getLL('clipBoard', TRUE) .
'</label>' .
'</div>';
}
$pageContent .= '
</div>
';
// Set clipboard:
if ($this->MOD_SETTINGS['clipBoard']) {
$pageContent .= $this->filelist->clipObj->printClipboard();
$pageContent .= BackendUtility::cshItem('xMOD_csh_corebe', 'filelist_clipboard');
}
}
$markerArray = array(
'CSH' => $docHeaderButtons['csh'],
'FUNC_MENU' => BackendUtility::getFuncMenu($this->id, 'SET[function]', $this->MOD_SETTINGS['function'], $this->MOD_MENU['function']),
'CONTENT' => ($this->errorMessage ? $this->errorMessage->render() : '') . $pageContent,
'FOLDER_IDENTIFIER' => $this->folderObject->getCombinedIdentifier(),
'FILEDENYPATERN' => $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'],
'MAXFILESIZE' => GeneralUtility::getMaxUploadFileSize() * 1024,
);
$this->content = $this->doc->moduleBody(array(), $docHeaderButtons, array_merge($markerArray, $otherMarkers));
// Renders the module page
$this->content = $this->doc->render($this->getLanguageService()->getLL('files'), $this->content);
$this->view->assign('otherMarkers', $otherMarkers);
$this->view->assign('docHeaderButtons', $docHeaderButtons);
$this->view->assign('pageTitle', $this->getLanguageService()->getLL('files'));
$this->view->assign('requireJsModules', $requireJsModules);
$this->view->assign('addJsInlineLabelFiles', $addJsInlineLabelFiles);
$this->view->assign('addJsInline', $addJsInline);
$this->view->assign('headline', $this->getModuleHeadline());
$this->view->assign('listHtml', $this->filelist->HTMLcode);
$this->view->assign('checkboxes', [
'bigControlPanel' => [
'enabled' => $this->getBackendUser()->getTSConfigVal('options.file_list.enableDisplayBigControlPanel') === 'selectable',
'label' => $this->getLanguageService()->getLL('bigControlPanel', TRUE),
'html' => BackendUtility::getFuncCheck($this->id, 'SET[bigControlPanel]', $this->MOD_SETTINGS['bigControlPanel'], '', '', 'id="bigControlPanel"'),
],
'displayThumbs' => [
'enabled' => $this->getBackendUser()->getTSConfigVal('options.file_list.enableDisplayThumbnails') === 'selectable',
'label' => $this->getLanguageService()->getLL('displayThumbs', TRUE),
'html' => BackendUtility::getFuncCheck($this->id, 'SET[displayThumbs]', $this->MOD_SETTINGS['displayThumbs'], '', '', 'id="checkDisplayThumbs"'),
],
'enableClipBoard' => [
'enabled' => $this->getBackendUser()->getTSConfigVal('options.file_list.enableClipBoard') === 'selectable',
'label' => $this->getLanguageService()->getLL('clipBoard', TRUE),
'html' => BackendUtility::getFuncCheck($this->id, 'SET[clipBoard]', $this->MOD_SETTINGS['clipBoard'], '', '', 'id="checkClipBoard"'),
]
]);
$this->view->assign('showClipBoard', (bool)$this->MOD_SETTINGS['clipBoard']);
$this->view->assign('clipBoardHtml', $this->filelist->clipObj->printClipboard());
$this->view->assign('folderIdentifier', $this->folderObject->getCombinedIdentifier());
$this->view->assign('fileDenyPattern', $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern']);
$this->view->assign('maxFileSize', GeneralUtility::getMaxUploadFileSize() * 1024);
} else {
$content = '';
if ($this->errorMessage) {
$this->errorMessage->setSeverity(FlashMessage::ERROR);
$content = $this->doc->moduleBody(array(), array_merge(array('REFRESH' => '', 'PASTE' => '', 'LEVEL_UP' => ''), $this->getButtons()), array('CSH' => '', 'TITLE' => '', 'FOLDER_INFO' => '', 'PAGE_ICON' => '', 'FUNC_MENU' => '', 'CONTENT' => $this->errorMessage->render()));
}
// Create output - no access (no warning though)
$this->content = $this->doc->render($this->getLanguageService()->getLL('files'), $content);
$this->forward('missingFolder');
}
}
/**
* @return void
*/
public function missingFolderAction() {
if ($this->errorMessage) {
$this->errorMessage->setSeverity(FlashMessage::ERROR);
$this->controllerContext->getFlashMessageQueue('core.template.flashMessages')->addMessage($this->errorMessage);
}
}
......@@ -484,15 +441,6 @@ class FileListController {
return $name;
}
/**
* Outputting the accumulated content to screen
*
* @return void
*/
public function printContent() {
echo $this->content;
}
/**
* Create the panel of buttons for submitting the form or otherwise perform operations.
*
......@@ -558,12 +506,4 @@ class FileListController {
protected function getBackendUser() {
return $GLOBALS['BE_USER'];
}
/**
* @return PageRenderer
*/
protected function getPageRenderer() {
return GeneralUtility::makeInstance(PageRenderer::class);
}
}
......@@ -32,6 +32,7 @@ use TYPO3\CMS\Core\Resource\Utility\ListUtility;
use TYPO3\CMS\Core\Type\Bitmask\JsConfirmation;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Resource\FolderInterface;
use TYPO3\CMS\Filelist\Controller\FileListController;
/**
* Class for rendering of File>Filelist
......@@ -66,11 +67,6 @@ class FileList extends AbstractRecordList {
*/
public $fixedL = 30;
/**
* @var string
*/
public $script = '';
/**
* If TRUE click menus are generated on files and folders
*
......@@ -181,10 +177,16 @@ class FileList extends AbstractRecordList {
*/
protected $iconFactory;
/**
* @var FileListController
*/
protected $fileListController;
/**
* Construct
*/
public function __construct() {
public function __construct(FileListController $fileListController) {
$this->fileListController = $fileListController;
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
}
......@@ -200,7 +202,6 @@ class FileList extends AbstractRecordList {
* @return void
*/
public function start(Folder $folderObject, $pointer, $sort, $sortRev, $clipBoard = FALSE, $bigControlPanel = FALSE) {
$this->script = BackendUtility::getModuleUrl('file_list');
$this->folderObject = $folderObject;
$this->counter = 0;
$this->totalbytes = 0;
......@@ -261,7 +262,7 @@ class FileList extends AbstractRecordList {
$otherMarkers['TITLE'] .= htmlspecialchars(GeneralUtility::fixed_lgd_cs($title, -($this->fixedL + 20)));
}
if ($this->clickMenus) {
$otherMarkers['PAGE_ICON'] = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($otherMarkers['PAGE_ICON'], $folderObject->getCombinedIdentifier());
$otherMarkers['PAGE_ICON'] = $this->fileListController->doc->wrapClickMenuOnIcon($otherMarkers['PAGE_ICON'], $folderObject->getCombinedIdentifier());
}
// Add paste button if clipboard is initialized
if ($this->clipObj instanceof Clipboard && $folderObject->checkActionPermission('write')) {
......@@ -523,7 +524,7 @@ class FileList extends AbstractRecordList {
// The icon with link
$theIcon = IconUtility::getSpriteIconForResource($folderObject, array('title' => $folderName));
if (!$isLocked && $this->clickMenus) {
$theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon, $folderObject->getCombinedIdentifier());
$theIcon = $this->fileListController->doc->wrapClickMenuOnIcon($theIcon, $folderObject->getCombinedIdentifier());
}
// Preparing and getting the data-array
......@@ -584,7 +585,7 @@ class FileList extends AbstractRecordList {
* @return string HTML
*/
public function linkWrapDir($title, Folder $folderObject) {
$href = $this->script . '&id=' . rawurlencode($folderObject->getCombinedIdentifier());
$href = BackendUtility::getModuleUrl('file_FilelistList', ['id' => $folderObject->getCombinedIdentifier()]);
$onclick = ' onclick="' . htmlspecialchars(('top.document.getElementsByName("navigation")[0].contentWindow.Tree.highlightActiveItem("file","folder' . GeneralUtility::md5int($folderObject->getCombinedIdentifier()) . '_"+top.fsMod.currentBank)')) . '"';
// Sometimes $code contains plain HTML tags. In such a case the string should not be modified!
if ((string)$title === strip_tags($title)) {
......@@ -659,7 +660,7 @@ class FileList extends AbstractRecordList {
// The icon with link
$theIcon = IconUtility::getSpriteIconForResource($fileObject, array('title' => $fileName . ' [' . (int)$fileObject->getUid() . ']'));
if ($this->clickMenus) {
$theIcon = $GLOBALS['SOBE']->doc->wrapClickMenuOnIcon($theIcon, $fileObject->getCombinedIdentifier());
$theIcon = $this->fileListController->doc->wrapClickMenuOnIcon($theIcon, $fileObject->getCombinedIdentifier());
}
// Preparing and getting the data-array
$theData = array();
......@@ -708,7 +709,7 @@ class FileList extends AbstractRecordList {
'returnUrl' => $this->listURL()
];
$returnUrl = BackendUtility::getModuleUrl('record_edit', $parameters) . BackendUtility::getUrlToken('editRecord');
$href = $GLOBALS['SOBE']->doc->issueCommand(
$href = $this->fileListController->doc->issueCommand(
'&cmd[sys_file_metadata][' . $metaDataRecord['uid'] . '][localize]=' . $languageId,
$returnUrl
);
......@@ -803,15 +804,17 @@ class FileList extends AbstractRecordList {
* @return string HTML
*/
public function linkWrapSort($code, $folderIdentifier, $col) {
$params = ['id' => $folderIdentifier, 'SET' => [ 'sort' => $col ]];
if ($this->sort === $col) {
// Check reverse sorting
$params = '&SET[sort]=' . $col . '&SET[reverse]=' . ($this->sortRev ? '0' : '1');
$params['SET']['reverse'] = ($this->sortRev ? '0' : '1');
$sortArrow = IconUtility::getSpriteIcon('status-status-sorting-light-' . ($this->sortRev ? 'desc' : 'asc'));
} else {
$params = '&SET[sort]=' . $col . '&SET[reverse]=0';
$params['SET']['reverse'] = 0;
$sortArrow = '';
}
$href = GeneralUtility::resolveBackPath($this->script) . '&id=' . rawurlencode($folderIdentifier) . $params;
$href = BackendUtility::getModuleUrl('file_FilelistList', $params);
return '<a href="' . htmlspecialchars($href) . '">' . $code . ' ' . $sortArrow . '</a>';
}
......@@ -1002,6 +1005,7 @@ class FileList extends AbstractRecordList {
/**
* Returns the database connection
*
* @return DatabaseConnection
*/
protected function getDatabaseConnection() {
......
<?php
/*
* This file is part of the TYPO3 CMS project.
*