[FEATURE] Show extension keys in documentation list 31/24731/3
authorNicole Cordes <typo3@cordes.co>
Mon, 14 Oct 2013 10:45:32 +0000 (12:45 +0200)
committerWouter Wolters <typo3@wouterwolters.nl>
Tue, 15 Oct 2013 08:56:20 +0000 (10:56 +0200)
Show extension keys in the lists as well.

Resolves: #52782
Releases: 6.2
Change-Id: Idf3d4e4eb1595866de4196c3d71b65619b2031d3
Reviewed-on: https://review.typo3.org/24731
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Nicole Cordes
Tested-by: Nicole Cordes
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
typo3/sysext/documentation/Classes/Domain/Model/Document.php
typo3/sysext/documentation/Classes/Domain/Repository/DocumentRepository.php
typo3/sysext/documentation/Classes/Service/DocumentationService.php
typo3/sysext/documentation/Resources/Private/Language/locallang.xlf
typo3/sysext/documentation/Resources/Private/Templates/Document/List.html
typo3/sysext/documentation/Resources/Private/Templates/Document/Manage.html

index 9de1210..aa1734f 100644 (file)
@@ -41,6 +41,14 @@ class Document extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        protected $packageKey;
 
        /**
+        * extensionKey
+        *
+        * @var string
+        * @validate NotEmpty
+        */
+       protected $extensionKey;
+
+       /**
         * icon
         *
         * @var string
@@ -97,6 +105,26 @@ class Document extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
        }
 
        /**
+        * Returns the extension key.
+        *
+        * @return string $extensionKey
+        */
+       public function getExtensionKey() {
+               return $this->extensionKey;
+       }
+
+       /**
+        * Sets the extension key.
+        *
+        * @param string $extensionKey
+        * @return Document
+        */
+       public function setExtensionKey($extensionKey) {
+               $this->extensionKey = $extensionKey;
+               return $this;
+       }
+
+       /**
         * Returns the icon.
         *
         * @return string $icon
index 0570642..103d012 100644 (file)
@@ -152,6 +152,9 @@ class DocumentRepository {
                        $languages = \TYPO3\CMS\Core\Utility\GeneralUtility::get_dirs(PATH_site . $languagePath);
                        foreach ($languages as $language) {
                                $metadata = $this->getMetadata($documentKey, $language);
+                               if (!empty($metadata['extensionKey'])) {
+                                       $document->setExtensionKey($metadata['extensionKey']);
+                               }
 
                                /** @var \TYPO3\CMS\Documentation\Domain\Model\DocumentTranslation $documentTranslation */
                                $documentTranslation = $this->objectManager->get('TYPO3\\CMS\\Documentation\\Domain\\Model\\DocumentTranslation')
@@ -220,6 +223,7 @@ class DocumentRepository {
                                /** @var \TYPO3\CMS\Documentation\Domain\Model\Document $document */
                                $document = $this->objectManager->get('TYPO3\\CMS\\Documentation\\Domain\\Model\\Document')
                                        ->setPackageKey($documentKey)
+                                       ->setExtensionKey($extensionKey)
                                        ->setIcon($icon);
 
                                $metadata = $this->getMetadata($documentKey, $language);
index bacb0cb..2fb9d5e 100644 (file)
@@ -79,6 +79,7 @@ class DocumentationService {
                                        'icon'    => \TYPO3\CMS\Documentation\Utility\GeneralUtility::getIcon($documentKey),
                                        'type'    => 'Extension',
                                        'key'     => $documentKey,
+                                       'shortcut' => $extensionKey,
                                        'url'     => 'http://docs.typo3.org/typo3cms/extensions/' . $extensionKey . '/',
                                        'version' => $version,
                                );
index ba0a284..41641b2 100644 (file)
@@ -14,6 +14,9 @@
                        <trans-unit id="documentation.type">
                                <source>Type</source>
                        </trans-unit>
+                       <trans-unit id="documentation.shortcut">
+                               <source>Extension key</source>
+                       </trans-unit>
                        <trans-unit id="documentation.actions">
                                <source>Actions</source>
                        </trans-unit>
@@ -27,6 +30,9 @@
                        <trans-unit id="tx_documentation_domain_model_document.package_key">
                                <source>Package Key</source>
                        </trans-unit>
+                       <trans-unit id="tx_documentation_domain_model_document.extension_key">
+                               <source>Extension Key</source>
+                       </trans-unit>
                        <trans-unit id="tx_documentation_domain_model_document.title">
                                <source>Title</source>
                        </trans-unit>
index 23e2a7d..c7cf57d 100644 (file)
@@ -23,6 +23,7 @@
                <thead>
                        <tr>
                                <th><f:translate key="tx_documentation_domain_model_document.title" /></th>
+                               <th><f:translate key="tx_documentation_domain_model_document.extension_key" /></th>
                                <th><f:translate key="tx_documentation_domain_model_documenttranslation.description" /></th>
                                <th><f:translate key="tx_documentation_domain_model_documenttranslation.formats" /></th>
                        </tr>
@@ -35,6 +36,7 @@
                                                        <img src="../{document.icon}" title="{translation.title}" alt="{translation.title}" />
                                                        {translation.title}
                                                </td>
+                                               <td>{document.extensionKey}</td>
                                                <td>{translation.description}</td>
                                                <td class="formats">
                                                        <doc:formats documentTranslation="{translation}" />
index 3364d8f..0c853e1 100644 (file)
@@ -23,6 +23,7 @@
                <tr>
                        <th><f:translate key="documentation.actions" /></th>
                        <th><f:translate key="documentation.title" /></th>
+                       <th><f:translate key="documentation.shortcut" /></th>
                        <th><f:translate key="documentation.type" /></th>
                </tr>
                </thead>
@@ -38,6 +39,7 @@
                                        <img src="../{document.icon}" title="{document.title}" alt="{document.title}" />
                                        {document.title}
                                </td>
+                               <td>{document.shortcut}</td>
                                <td>{document.type}</td>
                        </tr>
                </f:for>