Commit 9082bf1e authored by Nicole Cordes's avatar Nicole Cordes Committed by Helmut Hummel
Browse files

[BUGFIX] Make editIconsHook work again

It isn't possible to add icons in filelist extended view easily,
because there is no way to get the current file or folder object nor get
information about it. This patch adds the object to the cells variable
and reset it after hook execution to ensure access to it.

Releases: master, 6.2
Resolves: #67962
Change-Id: I44a4229128bcfdb2ed17900462f50a771ed63fdd
Reviewed-on: http://review.typo3.org/41117


Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez's avatarAndreas Fernandez <typo3@scripting-base.de>
Reviewed-by: default avatarHelmut Hummel <helmut.hummel@typo3.org>
Tested-by: default avatarHelmut Hummel <helmut.hummel@typo3.org>
parent ab3729bb
......@@ -929,6 +929,7 @@ class FileList extends AbstractRecordList {
// Hook for manipulating edit icons.
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'])) {
$cells['__fileOrFolderObject'] = $fileOrFolderObject;
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['fileList']['editIconsHook'] as $classData) {
$hookObject = GeneralUtility::getUserObj($classData);
if (!$hookObject instanceof FileListEditIconHookInterface) {
......@@ -939,6 +940,7 @@ class FileList extends AbstractRecordList {
}
$hookObject->manipulateEditIcons($cells, $this);
}
unset($cells['__fileOrFolderObject']);
}
// Compile items into a DIV-element:
return '<div class="btn-group">' . implode('', $cells) . '</div>';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment