[BUGFIX] The newRecordLinkAddTitle text is not understandable 09/23509/11
authorTomita Militaru <militarutomita@gmail.com>
Fri, 8 Nov 2013 15:18:10 +0000 (17:18 +0200)
committerErnesto Baschny <ernst@cron-it.de>
Sun, 2 Feb 2014 09:47:14 +0000 (10:47 +0100)
Separate the create new record label and the foreign table title
with a colon.

Resolves: #17955
Releases: 6.2
Change-Id: I0869f53e1e5ba0b49ded81e1605494fc2b44fdb0
Reviewed-on: https://review.typo3.org/23509
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Ernesto Baschny
Tested-by: Ernesto Baschny
typo3/sysext/backend/Classes/Form/Element/InlineElement.php
typo3/sysext/lang/locallang_core.xlf

index 30bf4e6..787fd84 100644 (file)
@@ -912,12 +912,15 @@ class InlineElement {
                                $className = 'typo3-newRecordLink';
                                $attributes['class'] = 't3-button inlineNewButton ' . $this->inlineData['config'][$nameObject]['md5'];
                                $attributes['onclick'] = 'return inline.createNewRecord(\'' . $objectPrefix . '\')';
-                               if (isset($conf['inline']['inlineNewButtonStyle']) && $conf['inline']['inlineNewButtonStyle']) {
+                               if (!empty($conf['inline']['inlineNewButtonStyle'])) {
                                        $attributes['style'] = $conf['inline']['inlineNewButtonStyle'];
                                }
-                               if (isset($conf['appearance']['newRecordLinkAddTitle']) && $conf['appearance']['newRecordLinkAddTitle']) {
-                                       $titleAddon = ' ' . $GLOBALS['LANG']->sL($GLOBALS['TCA'][$conf['foreign_table']]['ctrl']['title'], TRUE);
-                               } elseif (isset($conf['appearance']['newRecordLinkTitle']) && strlen($conf['appearance']['newRecordLinkTitle'])) {
+                               if (!empty($conf['appearance']['newRecordLinkAddTitle'])) {
+                                       $title = sprintf(
+                                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:cm.createnew.link', TRUE),
+                                               $GLOBALS['LANG']->sL($GLOBALS['TCA'][$conf['foreign_table']]['ctrl']['title'], TRUE)
+                                       );
+                               } elseif (isset($conf['appearance']['newRecordLinkTitle']) && $conf['appearance']['newRecordLinkTitle'] !== '') {
                                        $title = $GLOBALS['LANG']->sL($conf['appearance']['newRecordLinkTitle'], TRUE);
                                }
                                break;
@@ -935,10 +938,14 @@ class InlineElement {
                                $attributes['class'] = 't3-button inlineNewButton ' . $this->inlineData['config'][$nameObject]['md5'];
                                $attributes['onclick'] = 'return inline.synchronizeLocalizeRecords(\'' . $objectPrefix . '\', \'synchronize\')';
                                break;
+                       default:
+                               $title = '';
+                               $icon = '';
+                               $className = '';
                }
                // Create the link:
-               $icon = $icon ? IconUtility::getSpriteIcon($icon, array('title' => htmlspecialchars($title . $titleAddon))) : '';
-               $link = $this->wrapWithAnchor($icon . $title . $titleAddon, '#', $attributes);
+               $icon = $icon ? IconUtility::getSpriteIcon($icon, array('title' => htmlspecialchars($title))) : '';
+               $link = $this->wrapWithAnchor($icon . $title, '#', $attributes);
                return '<div' . ($className ? ' class="' . $className . '"' : '') . '>' . $link . '</div>';
        }
 
index 9f8fca1..9308126 100644 (file)
@@ -811,6 +811,9 @@ Would you like to save now in order to refresh the display?</source>
                        <trans-unit id="cm.createnew" xml:space="preserve">
                                <source>Create new</source>
                        </trans-unit>
+                       <trans-unit id="cm.createnew.link" xml:space="preserve">
+                               <source>Create new %s</source>
+                       </trans-unit>
                        <trans-unit id="cm.tempMountPoint" xml:space="preserve">
                                <source>Mount as treeroot</source>
                        </trans-unit>