[TASK] Add editing of file metadata to ClickMenu 11/25811/5
authorSteffen Ritter <info@rs-websystems.de>
Sat, 30 Nov 2013 18:56:29 +0000 (19:56 +0100)
committerSteffen Ritter <info@rs-websystems.de>
Sat, 7 Dec 2013 08:50:46 +0000 (09:50 +0100)
The Context-Menu of files misses the editing pen allowing
to directly edit the metadata of the file. Currently it
only shows the edit-content possibility in case it is a
text file.

This patch adds the missing option.

Resolves: #52835
Releases: 6.2
Change-Id: I869d8a57d2cacc04455df5189b5cc7af02c2e9cf
Reviewed-on: https://review.typo3.org/25811
Reviewed-by: Steffen Müller
Tested-by: Steffen Müller
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/filelist/Classes/FileList.php
typo3/sysext/lang/locallang_core.xlf

index 4d38147..aa92c7d 100644 (file)
@@ -780,8 +780,12 @@ class ClickMenu {
                        }
                        // Edit
                        if (!in_array('edit', $this->disabledItems)) {
+                               if (!$folder && !$isStorageRoot) {
+                                       $metaData = $fileObject->_getMetaData();
+                                       $menuItems['edit2'] = $this->DB_edit('sys_file_metadata', $metaData['uid']);
+                               }
                                if (!$folder && GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'], $fileObject->getExtension())) {
-                                       $menuItems['edit'] = $this->FILE_launch($identifier, 'file_edit.php', 'edit', 'edit_file.gif');
+                                       $menuItems['edit'] = $this->FILE_launch($identifier, 'file_edit.php', 'editcontent', 'edit_file.gif');
                                } elseif ($isStorageRoot && $userMayEditStorage) {
                                        $menuItems['edit'] = $this->DB_edit('sys_file_storage', $fileObject->getStorage()->getUid());
                                }
index 08bfff0..24442f1 100644 (file)
@@ -827,7 +827,7 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
                // Edit file content (if editable)
                if (is_a($fileOrFolderObject, 'TYPO3\\CMS\\Core\\Resource\\File') && $fileOrFolderObject->checkActionPermission('write') && GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['SYS']['textfile_ext'], $fileOrFolderObject->getExtension())) {
                        $editOnClick = 'top.content.list_frame.location.href=top.TS.PATH_typo3+\'file_edit.php?target=' . rawurlencode($fullIdentifier) . '&returnUrl=\'+top.rawurlencode(top.content.list_frame.document.location.pathname+top.content.list_frame.document.location.search);return false;';
-                       $cells['edit'] = '<a href="#" onclick="' . $editOnClick . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.edit') . '">' . IconUtility::getSpriteIcon('actions-page-open') . '</a>';
+                       $cells['edit'] = '<a href="#" onclick="' . $editOnClick . '" title="' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.editcontent') . '">' . IconUtility::getSpriteIcon('actions-page-open') . '</a>';
                } else {
                        $cells['edit'] = IconUtility::getSpriteIcon('empty-empty');
                }
index 521ccad..2e4d145 100644 (file)
@@ -736,6 +736,9 @@ Would you like to save now in order to refresh the display?</source>
                        <trans-unit id="cm.edit" xml:space="preserve">
                                <source>Edit</source>
                        </trans-unit>
+                       <trans-unit id="cm.editcontent" xml:space="preserve">
+                               <source>Edit content</source>
+                       </trans-unit>
                        <trans-unit id="cm.new" xml:space="preserve">
                                <source>New</source>
                        </trans-unit>