(no commit message)
authorAnja <aleichsenring@ab-softlab.de>
Wed, 29 May 2013 09:11:50 +0000 (02:11 -0700)
committerAnja <aleichsenring@ab-softlab.de>
Wed, 29 May 2013 09:11:50 +0000 (02:11 -0700)
gistfile1.txt

index db6a32f70644d8015d3f802eb86f54078518598b..42d75c54c1ec9d51306e72f159df932ac5a76413 100644 (file)
@@ -4,63 +4,62 @@ images int(11) unsigned DEFAULT '0',
 TCA
 ....
 'images' => array(
-      'exclude' => 0,
-                       'label' => 'images',
+       'exclude' => 0,
+       'label' => 'images',
+       'config' => array(
+               'type' => 'inline',
+               'foreign_table' => 'sys_file_reference',
+               'foreign_field' => 'uid_foreign',
+               'foreign_sortby' => 'sorting_foreign',
+               'foreign_table_field' => 'tablenames',
+               'foreign_match_fields' => array(
+                       'fieldname' => 'image'
+               ),
+               'foreign_label' => 'uid_local',
+               'foreign_selector' => 'uid_local',
+               'foreign_selector_fieldTcaOverride' => array(
                        'config' => array(
-                               'type' => 'inline',
-                               'foreign_table' => 'sys_file_reference',
-                               'foreign_field' => 'uid_foreign',
-                               'foreign_sortby' => 'sorting_foreign',
-                               'foreign_table_field' => 'tablenames',
-                               'foreign_match_fields' => array(
-                                       'fieldname' => 'image'
-                               ),
-                               'foreign_label' => 'uid_local',
-                               'foreign_selector' => 'uid_local',
-                               'foreign_selector_fieldTcaOverride' => array(
-                                       'config' => array(
-                                               'appearance' => array(
-                                                       'elementBrowserType' => 'file',
-                                                       'elementBrowserAllowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
-                                               )
-                                       )
-                               ),
-                               'filter' => array(
-                                       array(
-                                               'userFunc' => 'TYPO3\\CMS\\Core\\Resource\\Filter\\FileExtensionFilter->filterInlineChildren',
-                                               'parameters' => array(
-                                                       'allowedFileExtensions' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
-                                                       'disallowedFileExtensions' => ''
-                                               )
-                                       )
-                               ),
                                'appearance' => array(
-                                       'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference',
-                                       'useSortable' => TRUE,
-                                       'headerThumbnail' => array(
-                                               'field' => 'uid_local',
-                                               'width' => '64',
-                                               'height' => '64',
-                                       ),
-                                       'showPossibleLocalizationRecords' => TRUE,
-                                       'showRemovedLocalizationRecords' => TRUE,
-                                       'showSynchronizationLink' => TRUE,
-                                       'enabledControls' => array(
-                                               'info' => FALSE,
-                                               'new' => FALSE,
-                                               'dragdrop' => TRUE,
-                                               'sort' => FALSE,
-                                               'hide' => TRUE,
-                                               'delete' => TRUE,
-                                               'localize' => TRUE,
-                                       ),
-                               ),
-                               'behaviour' => array(
-                                       'localizationMode' => 'select',
-                                       'localizeChildrenAtParentLocalization' => TRUE,
-                               ),
+                                       'elementBrowserType' => 'file',
+                                       'elementBrowserAllowed' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
+                               )
+                       )
+               ),
+               'filter' => array(
+                       array(
+                               'userFunc' => 'TYPO3\\CMS\\Core\\Resource\\Filter\\FileExtensionFilter->filterInlineChildren,   'parameters' => array(
+                                       'allowedFileExtensions' => $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'],
+                                                       'disallowedFileExtensions' => ''
+                               )
+                       )
+               ),
+               'appearance' => array(
+                       'createNewRelationLinkTitle' => 'LLL:EXT:cms/locallang_ttc.xlf:images.addFileReference',
+                       'useSortable' => TRUE,
+                       'headerThumbnail' => array(
+                               'field' => 'uid_local',
+                               'width' => '64',
+                               'height' => '64',
+                       ),
+                       'showPossibleLocalizationRecords' => TRUE,
+                       'showRemovedLocalizationRecords' => TRUE,
+                       'showSynchronizationLink' => TRUE,
+                       'enabledControls' => array(
+                               'info' => FALSE,
+                               'new' => FALSE,
+                               'dragdrop' => TRUE,
+                               'sort' => FALSE,
+                               'hide' => TRUE,
+                               'delete' => TRUE,
+                               'localize' => TRUE,
                        ),
                ),
+               'behaviour' => array(
+                       'localizationMode' => 'select',
+                       'localizeChildrenAtParentLocalization' => TRUE,
+               ),
+       ),
+),
 ...
 
 Model:
@@ -102,18 +101,13 @@ public function getImages() {
        if ($this->images instanceof LazyLoadingProxy) {
                $this->images->_loadRealInstance();
        }
-       $images = array();
-       /** @var \TYPO3\CMS\Extbase\Domain\Model\FileReference $fileReference */
-       foreach ($this->images as $fileReference) {
-               $images[] = $fileReference->getOriginalResource();
-       }
-       return $images;
+       return $this->images;
 }
 
 Fluid View (this is a Partial, providing all images with a link to open it in a lightbox, classic clickenlarge):
 
 <f:for each="{images}" as="image" >
-       <a href="{f:uri.image(src:image.uid,treatIdAsReference:1)}" class="lightbox" rel="gallery">
-               <f:image src="{image.uid}" alt="" width='101' height="67" treatIdAsReference="1"/>
+       <a href="{f:uri.image(src:image.originalResource,treatIdAsReference:1)}" class="lightbox" rel="gallery">
+               <f:image src="{image.originalResource}" alt="" width='101' height="67" treatIdAsReference="1"/>
        </a >
 </f:for >
\ No newline at end of file