[TASK] CleanUp CSS Styles of IRRE-Elements
authorSteffen Ritter <info@rs-websystems.de>
Mon, 26 Nov 2012 19:28:19 +0000 (20:28 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Mon, 26 Nov 2012 20:24:53 +0000 (21:24 +0100)
If there are VirtualRecords (e.g. translations) and hidden
elements as IRRE childs the UI is not supporting the user
recognizing these items.

Change-Id: If25715f76c2d79d0ce0873095510a4b1138a9eca
Releases: 6.0
Resolves: #42226
Reviewed-on: http://review.typo3.org/16750
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
t3lib/jsfunc.inline.js
typo3/sysext/backend/Classes/Form/Element/InlineElement.php
typo3/sysext/t3skin/stylesheets/structure/element_tceforms.css
typo3/sysext/t3skin/stylesheets/visual/element_tceforms.css

index 7656279..1583938 100644 (file)
@@ -52,6 +52,11 @@ var inline = {
                this.noTitleString = value;
        },
        toggleEvent: function(event) {
+               var triggerElement = TYPO3.jQuery(event.target);
+               if (triggerElement.parents('.t3-form-field-header-inline-ctrl').length == 1) {
+                       return;
+               }
+
                var recordHeader = TYPO3.jQuery(this);
                inline.expandCollapseRecord(
                        recordHeader.attr('id').replace('_header', ''),
@@ -815,6 +820,8 @@ var inline = {
                var valueObj = document.getElementsByName(elName);
                var icon = $(objectId + '_disabled');
 
+               var $container = TYPO3.jQuery('#' + objectId + '_div');
+
                        // It might be the case that there's no hidden field
                if (formObj.length && valueObj.length) {
                        formObj[0].click();
@@ -826,9 +833,11 @@ var inline = {
                        if (icon.hasClassName('t3-icon-edit-hide')) {
                                icon.removeClassName ('t3-icon-edit-hide');
                                icon.addClassName('t3-icon-edit-unhide');
+                               $container.addClass('t3-form-field-container-inline-hidden');
                        } else {
                                icon.removeClassName ('t3-icon-edit-unhide');
                                icon.addClassName('t3-icon-edit-hide');
+                               $container.removeClass('t3-form-field-container-inline-hidden');
                        }
                }
 
index 97f18c6..883cbc8 100644 (file)
@@ -442,6 +442,12 @@ class InlineElement {
                        $out = $fields . $combination;
                } else {
                        // Set the record container with data for output
+                       if ($isVirtualRecord) {
+                               $class .= ' t3-form-field-container-inline-placeHolder';
+                       }
+                       if (isset($rec['hidden']) && intval($rec['hidden'])) {
+                               $class .= ' t3-form-field-container-inline-hidden';
+                       }
                        $out = '<div class="t3-form-field-record-inline" id="' . $objectId . '_fields" data-expandSingle="' . ($config['appearance']['expandSingle'] ? 1 : 0) . '" data-returnURL="' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI')) . '">' . $fields . $combination . '</div>';
                        $header = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('apps-irre-' . ($class != '' ? 'collapsed' : 'expanded'));
                        $header .= $this->renderForeignRecordHeader($parentUid, $foreign_table, $rec, $config, $isVirtualRecord);
@@ -639,27 +645,28 @@ class InlineElement {
                                $style = $config['inline']['last'] == $rec['uid'] ? 'style="visibility: hidden;"' : '';
                                $cells['sort.down'] = '<a href="#" onclick="' . htmlspecialchars($onClick) . '" class="sortingDown" ' . $style . '>' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-move-down', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:moveDown', TRUE))) . '</a>';
                        }
+                       // "Delete" link:
+                       if ($enabledControls['delete'] && ($isPagesTable && $localCalcPerms & 4 || !$isPagesTable && $calcPerms & 16)) {
+                               $onClick = 'inline.deleteRecord(\'' . $nameObjectFtId . '\');';
+                               $cells['delete'] = '<a href="#" onclick="' . htmlspecialchars(('if (confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('deleteWarning')) . ')) {  ' . $onClick . ' } return false;')) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-delete', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:delete', TRUE))) . '</a>';
+                       }
+
                        // "Hide/Unhide" links:
                        $hiddenField = $tcaTableCtrl['enablecolumns']['disabled'];
                        if ($enabledControls['hide'] && $permsEdit && $hiddenField && $tcaTableCols[$hiddenField] && (!$tcaTableCols[$hiddenField]['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $foreign_table . ':' . $hiddenField))) {
                                $onClick = 'return inline.enableDisableRecord(\'' . $nameObjectFtId . '\')';
                                if ($rec[$hiddenField]) {
-                                       $cells['hide.unhide'] = '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-unhide', array(
+                                       $cells['hide.unhide'] = '<a href="#" class="hiddenHandle" onclick="' . htmlspecialchars($onClick) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-unhide', array(
                                                'title' => $GLOBALS['LANG']->sL(('LLL:EXT:lang/locallang_mod_web_list.xml:unHide' . ($isPagesTable ? 'Page' : '')), 1),
                                                'id' => ($nameObjectFtId . '_disabled')
                                        )) . '</a>';
                                } else {
-                                       $cells['hide.hide'] = '<a href="#" onclick="' . htmlspecialchars($onClick) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-hide', array(
+                                       $cells['hide.hide'] = '<a href="#" class="hiddenHandle" onclick="' . htmlspecialchars($onClick) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-hide', array(
                                                'title' => $GLOBALS['LANG']->sL(('LLL:EXT:lang/locallang_mod_web_list.xml:hide' . ($isPagesTable ? 'Page' : '')), 1),
                                                'id' => ($nameObjectFtId . '_disabled')
                                        )) . '</a>';
                                }
                        }
-                       // "Delete" link:
-                       if ($enabledControls['delete'] && ($isPagesTable && $localCalcPerms & 4 || !$isPagesTable && $calcPerms & 16)) {
-                               $onClick = 'inline.deleteRecord(\'' . $nameObjectFtId . '\');';
-                               $cells['delete'] = '<a href="#" onclick="' . htmlspecialchars(('if (confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('deleteWarning')) . ')) {  ' . $onClick . ' } return false;')) . '">' . \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-edit-delete', array('title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_web_list.xml:delete', TRUE))) . '</a>';
-                       }
                        // Drag&Drop Sorting: Sortable handler for script.aculo.us
                        if ($enabledControls['dragdrop'] && $permsEdit && $enableManualSorting && $config['appearance']['useSortable']) {
                                $cells['dragdrop'] = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('actions-move-move', array('class' => 'sortableHandle', 'title' => $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.move', TRUE)));
index 8672be8..ebd71b9 100644 (file)
@@ -404,7 +404,8 @@ TCEforms Inline-Relational-Record-Editing
        width:100%;
 }
 
-.t3-form-field-container-inline-collapsed  div.t3-form-field-record-inline {
+.t3-form-field-container-inline-placeHolder div.t3-form-field-record-inline,
+.t3-form-field-container-inline-collapsed div.t3-form-field-record-inline {
        display:none !important;
 }
 
@@ -413,6 +414,10 @@ TCEforms Inline-Relational-Record-Editing
        position:relative;
 }
 
+.t3-form-field-container-inline-placeHolder .t3-form-field-header-inline > span {
+       display:none;
+}
+
 .t3-form-field-header-inline > span {
        position:absolute;
        left:4px;
@@ -439,18 +444,29 @@ div.t3-form-field-header-inline td {
 }
 
 .t3-form-field-header-inline td.t3-form-field-header-inline-ctrl > * {
-       display:none;
+       opacity:0;
 }
 
 .t3-form-field-header-inline:hover td.t3-form-field-header-inline-ctrl > * {
-       display:inline-block;
+       opacity:1;
 }
 
 .t3-form-field-header-inline td.t3-form-field-header-inline-ctrl > span.sortableHandle {
        margin-left:16px;
+       opacity:1;
        display:inline-block;
 }
 
+.t3-form-field-container-inline-placeHolder td.t3-form-field-header-inline-ctrl > a {
+       margin-right:32px;
+       display:inline-block;
+       opacity:1;
+}
+
+.t3-form-field-container-inline-hidden td.t3-form-field-header-inline-ctrl > a.hiddenHandle {
+       display:inline-block;
+       opacity:1;
+}
 .t3-form-field-header-inline td.t3-form-field-header-inline-summary {
        text-align:left;
 }
index ffc1413..dc030e1 100644 (file)
@@ -422,6 +422,12 @@ TCEforms Inline-Relational-Record-Editing
        color-stop(1, rgb(192,192,192))
     );
 }
+
+.t3-form-field-container-inline-hidden,
+.t3-form-field-container-inline-placeHolder {
+       opacity:0.3;
+}
+
 .t3-form-field-header-inline table {
     vertical-align:top;
 }