[BUGFIX] File list module headline 06/20906/3
authorFelix Kopp <felix-source@phorax.com>
Sun, 19 May 2013 10:28:29 +0000 (12:28 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 19 May 2013 12:05:05 +0000 (14:05 +0200)
View should guide users and always prompt the current status.
File list has been lacking a main headline - until now.

Change-Id: Id3d2d1963bbedf917d2e8bc8f7756c10a026512e
Resolves: #48380
Releases: 6.2
Reviewed-on: https://review.typo3.org/20906
Reviewed-by: Philipp Gampe
Tested-by: Philipp Gampe
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/filelist/Classes/Controller/FileListController.php
typo3/sysext/t3skin/stylesheets/structure/module_file_list.css

index f895dc4..1651f66 100644 (file)
@@ -299,12 +299,16 @@ class FileListController {
                        // add the folder info to the marker array
                        $otherMarkers['FOLDER_INFO'] = $this->filelist->getFolderInfo();
                        $docHeaderButtons = array_merge($this->getButtons(), $buttons);
+
                        // Build the <body> for the module
+                       $moduleHeadline = $this->getModuleHeadline();
                        // Create output
-                       $pageContent = '';
+                       $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 .= '
@@ -355,6 +359,28 @@ class FileListController {
        }
 
        /**
+        * Get main headline based on active folder or storage for backend module
+        *
+        * Folder names are resolved to their special names like done in the tree view.
+        *
+        * @return string
+        */
+       protected function getModuleHeadline() {
+               $name = $this->folderObject->getName();
+               if ($name === '') {
+                       // Show storage name on storage root
+                       if ($this->folderObject->getIdentifier() === '/') {
+                               $name = $this->folderObject->getStorage()->getName();
+                       }
+               } else {
+                       $name = key(\TYPO3\CMS\Core\Resource\Utility\ListUtility::resolveSpecialFolderNames(
+                               array($name => $this->folderObject)
+                       ));
+               }
+               return $name;
+       }
+
+       /**
         * Outputting the accumulated content to screen
         *
         * @return void
index f249718..535c473 100644 (file)
@@ -4,7 +4,6 @@ File > List
 - - - - - - - - - - - - - - - - - - - - - */
 
 table#typo3-filelist {
-       margin-top: 24px;
        width: 100%;
 }