Initial commit - Typo3 11.5.41
3
typo3conf/ext/fs_media_gallery/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
Documentation/_make
|
||||
# ignore PhpStorm's IDE settings
|
||||
.idea
|
||||
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
|
||||
namespace MiniFranske\FsMediaGallery\ContextMenu\ItemProviders;
|
||||
|
||||
use MiniFranske\FsMediaGallery\Service\Utility;
|
||||
use TYPO3\CMS\Backend\ContextMenu\ItemProviders\AbstractProvider;
|
||||
use TYPO3\CMS\Core\Resource\Folder;
|
||||
use TYPO3\CMS\Core\Resource\FolderInterface;
|
||||
use TYPO3\CMS\Core\Resource\ResourceFactory;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
class FsMediaGalleryProvider extends AbstractProvider
|
||||
{
|
||||
protected $itemsConfiguration = [];
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function canHandle(): bool
|
||||
{
|
||||
return $this->table === 'sys_file';
|
||||
}
|
||||
|
||||
/**
|
||||
* @var Folder
|
||||
*/
|
||||
protected $folder;
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getPriority(): int
|
||||
{
|
||||
return 90;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize file object
|
||||
*/
|
||||
protected function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
$resource = GeneralUtility::makeInstance(ResourceFactory::class)
|
||||
->retrieveFileOrFolderObject($this->identifier);
|
||||
if ($resource instanceof Folder
|
||||
&& in_array(
|
||||
$resource->getRole(),
|
||||
[FolderInterface::ROLE_DEFAULT, FolderInterface::ROLE_USERUPLOAD],
|
||||
true
|
||||
)
|
||||
) {
|
||||
$this->folder = $resource;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the media album add/edit menu items
|
||||
*
|
||||
* @param array $items
|
||||
* @return array
|
||||
*/
|
||||
public function addItems(array $items): array
|
||||
{
|
||||
$this->initialize();
|
||||
if (!($this->folder instanceof Folder)) {
|
||||
return $items;
|
||||
}
|
||||
|
||||
/** @var \MiniFranske\FsMediaGallery\Service\Utility $utility */
|
||||
$utility = GeneralUtility::makeInstance(Utility::class);
|
||||
$mediaFolders = $utility->getStorageFolders();
|
||||
|
||||
if (count($mediaFolders) === 0) {
|
||||
|
||||
$this->itemsConfiguration['add-media-gallery'] = [
|
||||
'label' => $this->sL('module.buttons.createAlbum'),
|
||||
'iconIdentifier' => 'action-add-album',
|
||||
'callbackAction' => 'missingMediaFolder',
|
||||
'title' => $this->sL('module.alerts.firstCreateStorageFolder')
|
||||
];
|
||||
}
|
||||
|
||||
if (count($mediaFolders) > 0) {
|
||||
|
||||
$collections = $utility->findFileCollectionRecordsForFolder(
|
||||
$this->folder->getStorage()->getUid(),
|
||||
$this->folder->getIdentifier(),
|
||||
array_keys($mediaFolders)
|
||||
);
|
||||
|
||||
foreach ($collections as $collection) {
|
||||
$this->itemsConfiguration['edit-media-gallery-' . $collection['uid']] = [
|
||||
'label' => sprintf($this->sL('module.buttons.editAlbum'), $collection['title']),
|
||||
'iconIdentifier' => 'action-edit-album',
|
||||
'callbackAction' => 'mediaAlbum',
|
||||
'uid' => $collection['uid'],
|
||||
];
|
||||
}
|
||||
|
||||
if (!count($collections)) {
|
||||
foreach ($mediaFolders as $uid => $title) {
|
||||
|
||||
// Find parent album for auto setting parent album
|
||||
$parentUid = 0;
|
||||
$parents = $utility->findFileCollectionRecordsForFolder(
|
||||
$this->folder->getStorage()->getUid(),
|
||||
$this->folder->getParentFolder()->getIdentifier(),
|
||||
[$uid]
|
||||
);
|
||||
|
||||
// If parent(s) found we take the first one
|
||||
if (count($parents)) {
|
||||
$parentUid = $parents[0]['uid'];
|
||||
}
|
||||
|
||||
$this->itemsConfiguration['add-media-gallery-' . $uid] = [
|
||||
'label' => sprintf($this->sL('module.buttons.createAlbumIn'), $title),
|
||||
'iconIdentifier' => 'action-add-album',
|
||||
'callbackAction' => 'mediaAlbum',
|
||||
'pid' => $uid,
|
||||
'parentUid' => $parentUid,
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->itemsConfiguration !== []) {
|
||||
$items += $this->prepareItems(
|
||||
['media_gallery_divider' => ['type' => 'divider']]
|
||||
+ $this->itemsConfiguration
|
||||
);
|
||||
}
|
||||
|
||||
return $items;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $itemName
|
||||
* @return array
|
||||
*/
|
||||
protected function getAdditionalAttributes(string $itemName): array
|
||||
{
|
||||
$itemInfo = $this->itemsConfiguration[$itemName] ?? [];
|
||||
|
||||
return [
|
||||
'data-callback-module' => 'TYPO3/CMS/FsMediaGallery/ContextMenuActions',
|
||||
'data-album-record-uid' => $itemInfo['uid'] ?? 0,
|
||||
'data-pid' => $itemInfo['pid'] ?? 0,
|
||||
'data-parent-uid' => $itemInfo['parentUid'] ?? 0,
|
||||
'data-title' => $itemInfo['title'] ?? ucfirst(trim(str_replace('_', ' ', $this->folder->getName()))),
|
||||
'data-storage' => $this->folder->getStorage()->getUid(),
|
||||
'data-folder' => $this->folder->getIdentifier(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get language string
|
||||
*
|
||||
* @param string $key
|
||||
* @param string $languageFile
|
||||
* @return string
|
||||
*/
|
||||
protected function sL($key, $languageFile = 'LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf')
|
||||
{
|
||||
return $this->languageService->sL($languageFile . ':' . $key);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,458 @@
|
||||
<?php
|
||||
|
||||
namespace MiniFranske\FsMediaGallery\Controller;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Frans Saris <franssaris@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use GeorgRinger\NumberedPagination\NumberedPagination;
|
||||
use MiniFranske\FsMediaGallery\Pagination\ExtendedArrayPaginator;
|
||||
use MiniFranske\FsMediaGallery\Utility\TypoScriptUtility;
|
||||
use MiniFranske\FsMediaGallery\Domain\Repository\MediaAlbumRepository;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
use TYPO3\CMS\Core\Pagination\ArrayPaginator;
|
||||
use TYPO3\CMS\Core\Pagination\SimplePagination;
|
||||
use TYPO3\CMS\Extbase\Http\ForwardResponse;
|
||||
use TYPO3\CMS\Frontend\Controller\ErrorController;
|
||||
use TYPO3\CMS\Core\Http\ImmediateResponseException;
|
||||
use MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
|
||||
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController;
|
||||
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
|
||||
|
||||
/**
|
||||
* MediaAlbumController
|
||||
*/
|
||||
class MediaAlbumController extends ActionController
|
||||
{
|
||||
|
||||
/**
|
||||
* mediaAlbumRepository
|
||||
*
|
||||
* @var \MiniFranske\FsMediaGallery\Domain\Repository\MediaAlbumRepository
|
||||
*/
|
||||
protected $mediaAlbumRepository;
|
||||
|
||||
/**
|
||||
* Injects the Configuration Manager
|
||||
*
|
||||
* @param ConfigurationManagerInterface $configurationManager Instance of the Configuration Manager
|
||||
* @return void
|
||||
*/
|
||||
public function injectConfigurationManager(ConfigurationManagerInterface $configurationManager)
|
||||
{
|
||||
$this->configurationManager = $configurationManager;
|
||||
|
||||
$frameworkSettings = $this->configurationManager->getConfiguration(
|
||||
ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK,
|
||||
'fsmediagallery',
|
||||
'fsmediagallery_mediagallery'
|
||||
);
|
||||
$flexformSettings = $this->configurationManager->getConfiguration(
|
||||
ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS
|
||||
);
|
||||
|
||||
// merge Framework (TypoScript) and Flexform settings
|
||||
if (isset($frameworkSettings['settings']['overrideFlexformSettingsIfEmpty'])) {
|
||||
/** @var $typoScriptUtility \MiniFranske\FsMediaGallery\Utility\TypoScriptUtility */
|
||||
$typoScriptUtility = GeneralUtility::makeInstance(TypoScriptUtility::class);
|
||||
$mergedSettings = $typoScriptUtility->override($flexformSettings, $frameworkSettings);
|
||||
$this->settings = $mergedSettings;
|
||||
} else {
|
||||
$this->settings = $flexformSettings;
|
||||
}
|
||||
|
||||
/**
|
||||
* sync persistence.storagePid=settings.startingpoint and persistence.recursive=settings.recursive
|
||||
*/
|
||||
// overwrite persistence.storagePid if settings.startingpoint is defined in flexform
|
||||
if (!empty($this->settings['startingpoint'])) {
|
||||
$frameworkSettings['persistence']['storagePid'] = $this->settings['startingpoint'];
|
||||
// if settings.startingpoint is not set in flexform, use persistence.storagePid from TS
|
||||
} elseif (!empty($frameworkSettings['persistence']['storagePid'])) {
|
||||
$this->settings['startingpoint'] = $frameworkSettings['persistence']['storagePid'];
|
||||
// startingpoint/storagePid is not set via TS nor flexforms > fallback to current pid
|
||||
} else {
|
||||
$this->settings['startingpoint'] = $frameworkSettings['persistence']['storagePid'] = $GLOBALS['TSFE']->id;
|
||||
}
|
||||
|
||||
// set persistence.recursive if settings.recursive is defined in flexform
|
||||
if (!empty($this->settings['recursive'])) {
|
||||
$frameworkSettings['persistence']['recursive'] = $this->settings['recursive'];
|
||||
// if settings.recursive is not set in flexform, use persistence.recursive from TS
|
||||
} elseif (!empty($frameworkSettings['persistence']['recursive'])) {
|
||||
$this->settings['recursive'] = $frameworkSettings['persistence']['recursive'];
|
||||
// recursive is not set via TS nor flexforms
|
||||
} else {
|
||||
$this->settings['recursive'] = $frameworkSettings['persistence']['recursive'] = 0;
|
||||
}
|
||||
|
||||
// write back altered configuration
|
||||
$this->configurationManager->setConfiguration($frameworkSettings);
|
||||
|
||||
// check some settings
|
||||
if (!isset($this->settings['list']['pagination']['itemsPerPage']) || $this->settings['list']['pagination']['itemsPerPage'] < 1) {
|
||||
$this->settings['list']['pagination']['itemsPerPage'] = 12;
|
||||
}
|
||||
if (!isset($this->settings['album']['pagination']['itemsPerPage']) || $this->settings['album']['pagination']['itemsPerPage'] < 1) {
|
||||
$this->settings['album']['pagination']['itemsPerPage'] = 12;
|
||||
}
|
||||
// correct resizeMode 's' set in flexforms (flexforms value '' is used for inherit/definition by TS)
|
||||
if (isset($this->settings['list']['thumb']['resizeMode']) && $this->settings['list']['thumb']['resizeMode'] == 's') {
|
||||
$this->settings['list']['thumb']['resizeMode'] = '';
|
||||
}
|
||||
if (isset($this->settings['album']['thumb']['resizeMode']) && $this->settings['album']['thumb']['resizeMode'] == 's') {
|
||||
$this->settings['album']['thumb']['resizeMode'] = '';
|
||||
}
|
||||
if (isset($this->settings['detail']['asset']['resizeMode']) && $this->settings['detail']['asset']['resizeMode'] == 's') {
|
||||
$this->settings['detail']['asset']['resizeMode'] = '';
|
||||
}
|
||||
if (isset($this->settings['random']['thumb']['resizeMode']) && $this->settings['random']['thumb']['resizeMode'] == 's') {
|
||||
$this->settings['random']['thumb']['resizeMode'] = '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Injects the MediaAlbumRepository
|
||||
*
|
||||
* @param \MiniFranske\FsMediaGallery\Domain\Repository\MediaAlbumRepository $mediaAlbumRepository
|
||||
* @return void
|
||||
*/
|
||||
public function injectMediaAlbumRepository(
|
||||
MediaAlbumRepository $mediaAlbumRepository
|
||||
)
|
||||
{
|
||||
$this->mediaAlbumRepository = $mediaAlbumRepository;
|
||||
if (!empty($this->settings['allowedAssetMimeTypes'])) {
|
||||
$this->mediaAlbumRepository->setAllowedAssetMimeTypes(GeneralUtility::trimExplode(',',
|
||||
$this->settings['allowedAssetMimeTypes']));
|
||||
}
|
||||
if (isset($this->settings['album']['assets']['orderBy'])) {
|
||||
$this->mediaAlbumRepository->setAssetsOrderBy($this->settings['album']['assets']['orderBy']);
|
||||
}
|
||||
if (isset($this->settings['album']['assets']['orderDirection'])) {
|
||||
$this->mediaAlbumRepository->setAssetsOrderDirection($this->settings['album']['assets']['orderDirection']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set album uid restrictions as defined in settings
|
||||
* By setting this in the repository also the MediaAlbum::getAlbums()
|
||||
* and MediaAlbum::getRandomAlbum() is restricted to these uids.
|
||||
*/
|
||||
protected function setAlbumUidRestrictions()
|
||||
{
|
||||
$mediaAlbumsUids = GeneralUtility::trimExplode(',', $this->settings['mediaAlbumsUids'], true);
|
||||
$this->mediaAlbumRepository->setAlbumUids($mediaAlbumsUids);
|
||||
$this->mediaAlbumRepository->setUseAlbumUidsAsExclude(!empty($this->settings['useAlbumFilterAsExclude']));
|
||||
}
|
||||
|
||||
/**
|
||||
* Index Action
|
||||
* As switchableControllerActions can be limited in EM this function
|
||||
* is needed as default action (with no output).
|
||||
* It is set as default action in flexform to make sure the
|
||||
* correct tabs/fields are shown when a new plugin is added.
|
||||
*/
|
||||
public function indexAction(): ResponseInterface
|
||||
{
|
||||
return $this->htmlResponse('<i>Please select a display mode in the plugin.</i>');
|
||||
}
|
||||
|
||||
/**
|
||||
* NestedList Action
|
||||
* Displays a (nested) list of albums; default/show action in fs_media_gallery <= 1.0.0
|
||||
*
|
||||
* @param int $mediaAlbum (this is not directly mapped to an object to handle 404 on our own)
|
||||
*/
|
||||
public function nestedListAction(int $mediaAlbum = 0): ResponseInterface
|
||||
{
|
||||
$mediaAlbums = null;
|
||||
$mediaAlbum = (int)$mediaAlbum ?: null;
|
||||
$showBackLink = true;
|
||||
|
||||
$this->setAlbumUidRestrictions();
|
||||
|
||||
// Single view
|
||||
if ($mediaAlbum) {
|
||||
/** @var MediaAlbum $mediaAlbum */
|
||||
$mediaAlbum = $this->mediaAlbumRepository->findByUid($mediaAlbum);
|
||||
if (!$mediaAlbum) {
|
||||
return $this->pageNotFound(LocalizationUtility::translate('no_album_found', 'fs_media_gallery'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* No album selected and album restriction set, find all "root" albums
|
||||
* Albums without parent or with parent not selected as allowed
|
||||
*/
|
||||
if ($mediaAlbum === null && $this->mediaAlbumRepository->getAlbumUids() !== []) {
|
||||
$mediaAlbums = [];
|
||||
$all = $this->mediaAlbumRepository->findAll((bool)$this->settings['list']['hideEmptyAlbums'], $this->settings['list']['orderBy'], $this->settings['list']['orderDirection']);
|
||||
/** @var MediaAlbum $album */
|
||||
foreach ($all as $album) {
|
||||
$parent = $album->getParentalbum();
|
||||
if ($parent === null
|
||||
|| (!$this->mediaAlbumRepository->getUseAlbumUidsAsExclude() && !in_array($parent->getUid(),
|
||||
$this->mediaAlbumRepository->getAlbumUids()))
|
||||
|| ($this->mediaAlbumRepository->getUseAlbumUidsAsExclude() && in_array($parent->getUid(),
|
||||
$this->mediaAlbumRepository->getAlbumUids()))
|
||||
) {
|
||||
$mediaAlbums[] = $album;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$mediaAlbums = $this->mediaAlbumRepository->findByParentalbum($mediaAlbum,
|
||||
$this->settings['list']['hideEmptyAlbums'], $this->settings['list']['orderBy'],
|
||||
$this->settings['list']['orderDirection']);
|
||||
}
|
||||
|
||||
// when only 1 album skip gallery view
|
||||
if ($mediaAlbum === null && !empty($this->settings['list']['skipListWhenOnlyOneAlbum']) && count($mediaAlbums) === 1) {
|
||||
$mediaAlbum = $mediaAlbums[0];
|
||||
$mediaAlbums = $this->mediaAlbumRepository->findByParentalbum($mediaAlbum,
|
||||
$this->settings['list']['hideEmptyAlbums'], $this->settings['list']['orderBy'],
|
||||
$this->settings['list']['orderDirection']);
|
||||
$showBackLink = false;
|
||||
}
|
||||
|
||||
if ($mediaAlbum && $mediaAlbum->getParentalbum() && (
|
||||
$this->mediaAlbumRepository->getAlbumUids() === []
|
||||
||
|
||||
(!$this->mediaAlbumRepository->getUseAlbumUidsAsExclude() && in_array($mediaAlbum->getParentalbum()->getUid(),
|
||||
$this->mediaAlbumRepository->getAlbumUids()))
|
||||
||
|
||||
($this->mediaAlbumRepository->getUseAlbumUidsAsExclude() && !in_array($mediaAlbum->getParentalbum()->getUid(),
|
||||
$this->mediaAlbumRepository->getAlbumUids()))
|
||||
)
|
||||
) {
|
||||
$this->view->assign('parentAlbum', $mediaAlbum->getParentalbum());
|
||||
}
|
||||
|
||||
$this->view->assign('showBackLink', $showBackLink);
|
||||
$this->view->assign('mediaAlbums', $mediaAlbums);
|
||||
$this->view->assign('mediaAlbum', $mediaAlbum);
|
||||
|
||||
if ($mediaAlbums) {
|
||||
$this->view->assign('mediaAlbumsPagination', $this->getAlbumsPagination($mediaAlbums));
|
||||
}
|
||||
if ($mediaAlbum) {
|
||||
$this->view->assign('mediaAlbumPagination', $this->getAlbumPagination($mediaAlbum));
|
||||
}
|
||||
|
||||
return $this->htmlResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* FlatList Action
|
||||
* Displays a (one-dimensional, flattened) list of albums
|
||||
*
|
||||
* @param int $mediaAlbum (this is not directly mapped to an object to handle 404 on our own)
|
||||
*/
|
||||
public function flatListAction(int $mediaAlbum = 0): ResponseInterface
|
||||
{
|
||||
$showBackLink = true;
|
||||
if ($mediaAlbum) {
|
||||
// if an album is given, display it
|
||||
$mediaAlbum = $this->mediaAlbumRepository->findByUid($mediaAlbum);
|
||||
if (!$mediaAlbum) {
|
||||
return $this->pageNotFound(LocalizationUtility::translate('no_album_found', 'fs_media_gallery'));
|
||||
}
|
||||
$this->view->assign('displayMode', 'album');
|
||||
$this->view->assign('mediaAlbum', $mediaAlbum);
|
||||
} else {
|
||||
// display the album list
|
||||
$mediaAlbums = $this->mediaAlbumRepository->findAll($this->settings['list']['hideEmptyAlbums'],
|
||||
$this->settings['list']['orderBy'], $this->settings['list']['orderDirection']);
|
||||
$this->view->assign('displayMode', 'flatList');
|
||||
$this->view->assign('mediaAlbums', $mediaAlbums);
|
||||
$showBackLink = false;
|
||||
}
|
||||
$this->view->assign('showBackLink', $showBackLink);
|
||||
|
||||
if ($mediaAlbum) {
|
||||
$this->view->assign('mediaAlbumPagination', $this->getAlbumPagination($mediaAlbum));
|
||||
}
|
||||
|
||||
return $this->htmlResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show single Album (defined in FlexForm/TS) Action
|
||||
* As showAlbumAction() displays any album by the given param this function gets its value from TS/Felxform
|
||||
* This could be merged with showAlbumAction() if there is a way to determine which switchableControllerActions is defined in Felxform.
|
||||
*/
|
||||
public function showAlbumByConfigAction(): ResponseInterface
|
||||
{
|
||||
// get all request arguments (e.g. pagination widget)
|
||||
$arguments = $this->request->getArguments();
|
||||
// set album id from settings
|
||||
$arguments['mediaAlbum'] = $this->settings['mediaAlbum'];
|
||||
|
||||
return (new ForwardResponse('showAlbum'))->withArguments($arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show single Album Action
|
||||
*
|
||||
* @param int $mediaAlbum (this is not directly mapped to an object to handle 404 on our own)
|
||||
*/
|
||||
public function showAlbumAction(int $mediaAlbum = null): ResponseInterface
|
||||
{
|
||||
$mediaAlbum = (int)$mediaAlbum ?: null;
|
||||
if (empty($mediaAlbum)) {
|
||||
$mediaAlbum = (int)$this->settings['mediaAlbum'];
|
||||
}
|
||||
// if album uid is set through settings (typoscript or flexform) we skip the storage check
|
||||
$respectStorage = true;
|
||||
if ((int)$this->settings['mediaAlbum'] === (int)$mediaAlbum) {
|
||||
$respectStorage = false;
|
||||
}
|
||||
$mediaAlbum = $this->mediaAlbumRepository->findByUid($mediaAlbum, $respectStorage);
|
||||
$this->view->assign('mediaAlbum', $mediaAlbum);
|
||||
$this->view->assign('showBackLink', false);
|
||||
$this->view->assign('mediaAlbumPagination', $this->getAlbumPagination($mediaAlbum));
|
||||
|
||||
return $this->htmlResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show single media asset from album
|
||||
*
|
||||
* @param \MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum $mediaAlbum
|
||||
* @param int $mediaAssetUid
|
||||
* @TYPO3\CMS\Extbase\Annotation\IgnoreValidation("")
|
||||
*/
|
||||
public function showAssetAction(MediaAlbum $mediaAlbum, int $mediaAssetUid): ResponseInterface
|
||||
{
|
||||
|
||||
if (isset($this->settings['album']['assets']['orderBy'])) {
|
||||
$mediaAlbum->setAssetsOrderBy($this->settings['album']['assets']['orderBy']);
|
||||
}
|
||||
|
||||
if (isset($this->settings['album']['assets']['orderDirection'])) {
|
||||
$mediaAlbum->setAssetsOrderDirection($this->settings['album']['assets']['orderDirection']);
|
||||
}
|
||||
|
||||
list($previousAsset, $mediaAsset, $nextAsset) = $mediaAlbum->getPreviousCurrentAndNext($mediaAssetUid);
|
||||
if (!$mediaAsset) {
|
||||
$message = LocalizationUtility::translate('asset_not_found', 'fs_media_gallery');
|
||||
return $this->pageNotFound((empty($message) ? 'Asset not found.' : $message));
|
||||
}
|
||||
$this->view->assign('previousAsset', $previousAsset);
|
||||
$this->view->assign('nextAsset', $nextAsset);
|
||||
$this->view->assign('mediaAsset', $mediaAsset);
|
||||
$this->view->assign('mediaAlbum', $mediaAlbum);
|
||||
|
||||
return $this->htmlResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show random media asset
|
||||
*/
|
||||
public function randomAssetAction(): ResponseInterface
|
||||
{
|
||||
|
||||
$this->setAlbumUidRestrictions();
|
||||
|
||||
$mediaAlbum = $this->mediaAlbumRepository->findRandom();
|
||||
$this->view->assign('mediaAlbum', $mediaAlbum);
|
||||
|
||||
return $this->htmlResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* If there were validation errors, we don't want to write details like
|
||||
* "An error occurred while trying to call Tx_Community_Controller_UserController->updateAction()"
|
||||
*
|
||||
* @return string|boolean The flash message or FALSE if no flash message should be set
|
||||
*/
|
||||
protected function getErrorFlashMessage(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Page not found wrapper
|
||||
*
|
||||
* @throws ImmediateResponseException
|
||||
*/
|
||||
protected function pageNotFound(string $message): ResponseInterface
|
||||
{
|
||||
if (!empty($GLOBALS['TSFE'])) {
|
||||
$response = GeneralUtility::makeInstance(ErrorController::class)->pageNotFoundAction($GLOBALS['TYPO3_REQUEST'], $message);
|
||||
throw new ImmediateResponseException($response);
|
||||
}
|
||||
|
||||
return $this->htmlResponse($message);
|
||||
}
|
||||
|
||||
private function getAlbumPagination(MediaAlbum $album): array
|
||||
{
|
||||
$paginationConfiguration = $this->settings['album']['pagination'] ?? [];
|
||||
|
||||
$itemsPerPage = (int)($paginationConfiguration['itemsPerPage'] ?? 10);
|
||||
$maximumNumberOfLinks = (int)($paginationConfiguration['maximumNumberOfLinks'] ?? 0);
|
||||
|
||||
$currentPage = $this->request->hasArgument('currentPage') ? (int)$this->request->getArgument('currentPage') : 1;
|
||||
$paginator = GeneralUtility::makeInstance(ExtendedArrayPaginator::class, $album->getAssets(), $currentPage, $itemsPerPage);
|
||||
$paginationClass = $paginationConfiguration['class'] ?? SimplePagination::class;
|
||||
if ($paginationClass === NumberedPagination::class && $maximumNumberOfLinks) {
|
||||
$pagination = GeneralUtility::makeInstance(NumberedPagination::class, $paginator, $maximumNumberOfLinks);
|
||||
} else {
|
||||
$pagination = GeneralUtility::makeInstance(SimplePagination::class, $paginator);
|
||||
}
|
||||
|
||||
return [
|
||||
'currentPage' => $currentPage,
|
||||
'paginator' => $paginator,
|
||||
'pagination' => $pagination,
|
||||
];
|
||||
}
|
||||
|
||||
private function getAlbumsPagination(array $albums): array
|
||||
{
|
||||
$paginationConfiguration = $this->settings['list']['pagination'] ?? [];
|
||||
|
||||
$itemsPerPage = (int)($paginationConfiguration['itemsPerPage'] ?? 10);
|
||||
$maximumNumberOfLinks = (int)($paginationConfiguration['maximumNumberOfLinks'] ?? 0);
|
||||
|
||||
$currentPage = $this->request->hasArgument('currentAlbumPage') ? (int)$this->request->getArgument('currentAlbumPage') : 1;
|
||||
$paginator = GeneralUtility::makeInstance(ArrayPaginator::class, $albums, $currentPage, $itemsPerPage);
|
||||
$paginationClass = $paginationConfiguration['class'] ?? SimplePagination::class;
|
||||
if ($paginationClass === NumberedPagination::class && $maximumNumberOfLinks) {
|
||||
$pagination = GeneralUtility::makeInstance(NumberedPagination::class, $paginator, $maximumNumberOfLinks);
|
||||
} else {
|
||||
$pagination = GeneralUtility::makeInstance(SimplePagination::class, $paginator);
|
||||
}
|
||||
|
||||
return [
|
||||
'currentPage' => $currentPage,
|
||||
'paginator' => $paginator,
|
||||
'pagination' => $pagination,
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,519 @@
|
||||
<?php
|
||||
namespace MiniFranske\FsMediaGallery\Domain\Model;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Frans Saris <franssaris@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Extbase\DomainObject\AbstractEntity;
|
||||
use TYPO3\CMS\Core\Resource\FileCollectionRepository;
|
||||
use MiniFranske\FsMediaGallery\Domain\Repository\MediaAlbumRepository;
|
||||
use TYPO3\CMS\Core\Resource\File;
|
||||
use TYPO3\CMS\Core\Resource\FileInterface;
|
||||
use TYPO3\CMS\Core\Resource\FileReference;
|
||||
|
||||
/**
|
||||
* Media album
|
||||
*/
|
||||
class MediaAlbum extends AbstractEntity
|
||||
{
|
||||
|
||||
/**
|
||||
* fileCollectionRepository
|
||||
*
|
||||
* @var \TYPO3\CMS\Core\Resource\FileCollectionRepository
|
||||
*/
|
||||
protected $fileCollectionRepository;
|
||||
|
||||
/**
|
||||
* mediaAlbumRepository
|
||||
*
|
||||
* @var \MiniFranske\FsMediaGallery\Domain\Repository\MediaAlbumRepository
|
||||
*/
|
||||
protected $mediaAlbumRepository;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $assetCache;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $allowedMimeTypes = [];
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $assetsOrderBy = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $assetsOrderDirection = 'asc';
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $excludeEmptyAlbums = false;
|
||||
|
||||
/**
|
||||
* Assets
|
||||
* An array of File or FileReference
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $assets;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*/
|
||||
protected $assetsCount;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $hidden;
|
||||
|
||||
/**
|
||||
* Title
|
||||
*
|
||||
* @var \string
|
||||
*/
|
||||
protected $title;
|
||||
|
||||
/**
|
||||
* Description visible online
|
||||
*
|
||||
* @var \string
|
||||
*/
|
||||
protected $webdescription;
|
||||
|
||||
/**
|
||||
* @var \MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum|NULL
|
||||
* @TYPO3\CMS\Extbase\Annotation\ORM\Lazy
|
||||
*/
|
||||
protected $parentalbum;
|
||||
|
||||
/**
|
||||
* Main asset
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Domain\Model\FileReference
|
||||
*/
|
||||
protected $mainAsset;
|
||||
|
||||
/**
|
||||
* Child albums
|
||||
*
|
||||
* @var \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum>
|
||||
* @TYPO3\CMS\Extbase\Annotation\ORM\Lazy
|
||||
*/
|
||||
public $albumCache;
|
||||
|
||||
/**
|
||||
* @var \DateTime
|
||||
*/
|
||||
protected $datetime;
|
||||
|
||||
public function injectFileCollectionRepository(FileCollectionRepository $fileCollectionRepository): void
|
||||
{
|
||||
$this->fileCollectionRepository = $fileCollectionRepository;
|
||||
}
|
||||
|
||||
public function injectMediaAlbumRepository(MediaAlbumRepository $mediaAlbumRepository): void
|
||||
{
|
||||
$this->mediaAlbumRepository = $mediaAlbumRepository;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set allowedMimeTypes
|
||||
*
|
||||
* @param array $allowedMimeTypes
|
||||
*/
|
||||
public function setAllowedMimeTypes($allowedMimeTypes)
|
||||
{
|
||||
$this->allowedMimeTypes = $allowedMimeTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get allowedMimeTypes
|
||||
*
|
||||
* @return array $allowedMimeTypes
|
||||
*/
|
||||
public function getAllowedMimeTypes()
|
||||
{
|
||||
return $this->allowedMimeTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get assetsOrderBy
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAssetsOrderBy()
|
||||
{
|
||||
return $this->assetsOrderBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set assetsOrderBy
|
||||
*
|
||||
* @param string $assetsOrderBy
|
||||
*/
|
||||
public function setAssetsOrderBy($assetsOrderBy)
|
||||
{
|
||||
$this->assetsOrderBy = $assetsOrderBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get assetsOrderDirection
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAssetsOrderDirection()
|
||||
{
|
||||
return $this->assetsOrderDirection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set assetsOrderDirection
|
||||
*
|
||||
* @param string $assetsOrderDirection
|
||||
*/
|
||||
public function setAssetsOrderDirection($assetsOrderDirection)
|
||||
{
|
||||
$this->assetsOrderDirection = strtolower($assetsOrderDirection);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get excludeEmptyAlbums
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getExcludeEmptyAlbums()
|
||||
{
|
||||
return $this->excludeEmptyAlbums;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set excludeEmptyAlbums
|
||||
*
|
||||
* @param bool $excludeEmptyAlbums
|
||||
*/
|
||||
public function setExcludeEmptyAlbums($excludeEmptyAlbums)
|
||||
{
|
||||
$this->excludeEmptyAlbums = (bool)$excludeEmptyAlbums;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set hidden
|
||||
*
|
||||
* @param boolean $hidden
|
||||
*/
|
||||
public function setHidden($hidden)
|
||||
{
|
||||
$this->hidden = $hidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get hidden
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getHidden()
|
||||
{
|
||||
return $this->hidden;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the title
|
||||
*
|
||||
* @return \string $title
|
||||
*/
|
||||
public function getTitle()
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the title
|
||||
*
|
||||
* @param \string $title
|
||||
* @return void
|
||||
*/
|
||||
public function setTitle($title)
|
||||
{
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the webdescription
|
||||
*
|
||||
* @return \string $webdescription
|
||||
*/
|
||||
public function getWebdescription()
|
||||
{
|
||||
return $this->webdescription;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the webdescription
|
||||
*
|
||||
* @param \string $webdescription
|
||||
* @return void
|
||||
*/
|
||||
public function setWebdescription($webdescription)
|
||||
{
|
||||
$this->webdescription = $webdescription;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set parentalbum
|
||||
*
|
||||
* @param \MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum $parentalbum
|
||||
*/
|
||||
public function setParentalbum(\MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum $parentalbum)
|
||||
{
|
||||
$this->parentalbum = $parentalbum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get parentalbum
|
||||
*
|
||||
* @return \MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum
|
||||
*/
|
||||
public function getParentalbum()
|
||||
{
|
||||
return $this->parentalbum;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return File[]|FileReference[]
|
||||
*/
|
||||
public function getAssets()
|
||||
{
|
||||
if ($this->assetCache === null) {
|
||||
try {
|
||||
/** @var $fileCollection \TYPO3\CMS\Core\Resource\Collection\AbstractFileCollection */
|
||||
$fileCollection = $this->fileCollectionRepository->findByUid($this->getUid());
|
||||
$fileCollection->loadContents();
|
||||
$files = $fileCollection->getItems();
|
||||
// check if file has right mimeType
|
||||
if (count($this->allowedMimeTypes) > 0) {
|
||||
foreach ($files as $key => $fileObject) {
|
||||
/** @var $fileObject File|FileReference */
|
||||
if (!in_array($fileObject->getMimeType(), $this->allowedMimeTypes)) {
|
||||
unset($files[$key]);
|
||||
}
|
||||
}
|
||||
// reset keys
|
||||
$files = array_values($files);
|
||||
}
|
||||
if (trim($this->assetsOrderBy) !== '') {
|
||||
$files = $this->orderAssets($files, $this->assetsOrderBy, $this->assetsOrderDirection);
|
||||
}
|
||||
$this->assetCache = $files;
|
||||
} catch (\Exception $exception) {
|
||||
// failing albums get disabled
|
||||
$this->setHidden(true);
|
||||
$this->mediaAlbumRepository->update($this);
|
||||
$this->assetCache = [];
|
||||
}
|
||||
}
|
||||
return $this->assetCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get asset by uid
|
||||
*
|
||||
* @param int $assetUid
|
||||
* @return File|FileReference|NULL
|
||||
*/
|
||||
public function getAssetByUid($assetUid)
|
||||
{
|
||||
foreach ($assets = $this->getAssets() as $asset) {
|
||||
/** @var $asset File|FileReference */
|
||||
if ((int)$assetUid === (int)$asset->getUid()) {
|
||||
return $asset;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pevious, current and next asset by assetUid
|
||||
*
|
||||
* @param $assetUid
|
||||
* @return FileInterface[]
|
||||
*/
|
||||
public function getPreviousCurrentAndNext($assetUid)
|
||||
{
|
||||
$previous = $last = $current = $next = null;
|
||||
|
||||
foreach ($assets = $this->getAssets() as $asset) {
|
||||
if ($current !== null) {
|
||||
$next = $asset;
|
||||
break;
|
||||
}
|
||||
$previous = $last;
|
||||
$last = $asset;
|
||||
/** @var $asset File|FileReference */
|
||||
if ((int)$assetUid === (int)$asset->getUid()) {
|
||||
$current = $asset;
|
||||
}
|
||||
}
|
||||
|
||||
return [$previous, $current, $next];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @deprecated Will be removed in next major version 2.*
|
||||
*/
|
||||
public function getAssetsUids()
|
||||
{
|
||||
trigger_error('MediaAlbum::getAssetsUid is deprecated and will be removed with next major version 2.*. Use getAssets() as this method can not handle static file collections', E_USER_DEPRECATED);
|
||||
$assetsUids = [];
|
||||
foreach ($assets = $this->getAssets() as $asset) {
|
||||
/** @var $asset FileInterface */
|
||||
$assetsUids[] = $asset->getUid();
|
||||
}
|
||||
return $assetsUids;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get assetsCount
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getAssetsCount()
|
||||
{
|
||||
if ($this->assetCache === null) {
|
||||
return count($this->getAssets());
|
||||
}
|
||||
return count($this->assetCache);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get child albums
|
||||
*
|
||||
* @return \TYPO3\CMS\Extbase\Persistence\ObjectStorage<\MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum>>
|
||||
*/
|
||||
public function getAlbums()
|
||||
{
|
||||
if ($this->albumCache === null) {
|
||||
$this->albumCache = $this->mediaAlbumRepository->findByParentalbum($this, $this->excludeEmptyAlbums);
|
||||
}
|
||||
return $this->albumCache;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get random child album
|
||||
*
|
||||
* @return MediaAlbum
|
||||
*/
|
||||
public function getRandomAlbum()
|
||||
{
|
||||
$albums = $this->getAlbums();
|
||||
return $albums[rand(0, count($albums) - 1)];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return File|FileReference
|
||||
*/
|
||||
public function getMainAsset()
|
||||
{
|
||||
$mainAsset = null;
|
||||
if ($this->mainAsset) {
|
||||
$mainAsset = $this->mainAsset->getOriginalResource();
|
||||
} else {
|
||||
$assets = $this->getAssets();
|
||||
$mainAsset = $assets !== [] ? $assets[0] : null;
|
||||
}
|
||||
return $mainAsset;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return File|FileReference
|
||||
*/
|
||||
public function getRandomAsset()
|
||||
{
|
||||
$assets = $this->getAssets();
|
||||
|
||||
// if there is an asset, return it
|
||||
if (count($assets)) {
|
||||
return $assets[rand(1, count($assets)) - 1];
|
||||
} else {
|
||||
// try to fetch it from child album
|
||||
$randomAlbum = $this->getRandomAlbum();
|
||||
if ($randomAlbum) {
|
||||
return $randomAlbum->getRandomAsset();
|
||||
}
|
||||
// album and child album are empty
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get datetime
|
||||
*
|
||||
* @return \DateTime
|
||||
*/
|
||||
public function getDatetime()
|
||||
{
|
||||
return $this->datetime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set date time
|
||||
*
|
||||
* @param \DateTime $datetime datetime
|
||||
* @return void
|
||||
*/
|
||||
public function setDatetime($datetime)
|
||||
{
|
||||
$this->datetime = $datetime;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param FileInterface[] $files
|
||||
* @param string $orderBy
|
||||
* @param string $direction
|
||||
* @return FileInterface[]
|
||||
*/
|
||||
protected function orderAssets($files, $orderBy, $direction)
|
||||
{
|
||||
usort($files, function ($a, $b) use ($orderBy, $direction) {
|
||||
if ($orderBy === 'crdate') {
|
||||
$compare = $a->getCreationTime() > $b->getCreationTime();
|
||||
} elseif (in_array($orderBy, ['content_creation_date', 'content_modification_date'], true)) {
|
||||
$compare = $a->getProperty($orderBy) > $b->getProperty($orderBy);
|
||||
} else {
|
||||
$compare = strnatcasecmp($a->getProperty($orderBy), $b->getProperty($orderBy));
|
||||
}
|
||||
return $direction === 'desc' ? -1 * $compare : $compare;
|
||||
});
|
||||
|
||||
return $files;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,407 @@
|
||||
<?php
|
||||
namespace MiniFranske\FsMediaGallery\Domain\Repository;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Frans Saris <franssaris@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Extbase\Persistence\Repository;
|
||||
use TYPO3\CMS\Extbase\Persistence\QueryInterface;
|
||||
use MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum;
|
||||
|
||||
/**
|
||||
* MediaAlbumRepository
|
||||
*/
|
||||
class MediaAlbumRepository extends Repository
|
||||
{
|
||||
|
||||
/**
|
||||
* @var array default ordering
|
||||
*/
|
||||
protected $defaultOrderings = [
|
||||
'sorting' => QueryInterface::ORDER_ASCENDING,
|
||||
'crdate' => QueryInterface::ORDER_DESCENDING,
|
||||
];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $allowedAssetMimeTypes = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $albumUids = [];
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
protected $useAlbumUidsAsExclude = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $assetsOrderBy = '';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $assetsOrderDirection = 'asc';
|
||||
|
||||
/**
|
||||
* Set allowedAssetMimeTypes
|
||||
*
|
||||
* @param array $allowedAssetMimeTypes
|
||||
*/
|
||||
public function setAllowedAssetMimeTypes($allowedAssetMimeTypes)
|
||||
{
|
||||
$this->allowedAssetMimeTypes = $allowedAssetMimeTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get allowedAssetMimeTypes
|
||||
*
|
||||
* @return array $allowedAssetMimeTypes
|
||||
*/
|
||||
public function getAllowedAssetMimeTypes()
|
||||
{
|
||||
return $this->allowedAssetMimeTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get allowedAlbumUids
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getAlbumUids()
|
||||
{
|
||||
return $this->albumUids;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set allowedAlbumUids
|
||||
*
|
||||
* @param array $albumUids
|
||||
*/
|
||||
public function setAlbumUids($albumUids)
|
||||
{
|
||||
$this->albumUids = $albumUids;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get useAlbumUidsAsExclude
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getUseAlbumUidsAsExclude()
|
||||
{
|
||||
return $this->useAlbumUidsAsExclude;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set useAlbumUidsAsExclude
|
||||
*
|
||||
* @param boolean $useAlbumUidsAsExclude
|
||||
*/
|
||||
public function setUseAlbumUidsAsExclude($useAlbumUidsAsExclude)
|
||||
{
|
||||
$this->useAlbumUidsAsExclude = $useAlbumUidsAsExclude;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get assetsOrderBy
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAssetsOrderBy()
|
||||
{
|
||||
return $this->assetsOrderBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set assetsOrderBy
|
||||
*
|
||||
* @param string $assetsOrderBy
|
||||
*/
|
||||
public function setAssetsOrderBy($assetsOrderBy)
|
||||
{
|
||||
$this->assetsOrderBy = $assetsOrderBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get assetsOrderDirection
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getAssetsOrderDirection()
|
||||
{
|
||||
return $this->assetsOrderDirection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set assetsOrderDirection
|
||||
*
|
||||
* @param string $assetsOrderDirection
|
||||
*/
|
||||
public function setAssetsOrderDirection($assetsOrderDirection)
|
||||
{
|
||||
$this->assetsOrderDirection = $assetsOrderDirection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get random sub album
|
||||
*
|
||||
* @param MediaAlbum|bool $parent parent MediaAlbum, FALSE for parent = 0 or NULL for no restriction by parent
|
||||
* @return \MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum|NULL
|
||||
*/
|
||||
public function findRandom($parent = null)
|
||||
{
|
||||
|
||||
/** @var \TYPO3\CMS\Extbase\Persistence\Generic\Query $query */
|
||||
$query = $this->createQuery();
|
||||
$constraints = [];
|
||||
|
||||
// restrict by parent album
|
||||
if ($parent !== null) {
|
||||
$constraints[] = $query->equals('parentalbum', $parent ? $parent->getUid() : 0);
|
||||
}
|
||||
|
||||
// restrict by given uids
|
||||
if ($this->albumUids !== []) {
|
||||
if ($this->useAlbumUidsAsExclude) {
|
||||
$constraints[] = $query->logicalNot($query->in('uid', $this->albumUids));
|
||||
} else {
|
||||
$constraints[] = $query->in('uid', $this->albumUids);
|
||||
}
|
||||
}
|
||||
$query->matching($query->logicalAnd($constraints));
|
||||
$mediaAlbums = $query->execute()->toArray();
|
||||
|
||||
/** @var \MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum $mediaAlbum */
|
||||
$mediaAlbum = null;
|
||||
|
||||
if ($mediaAlbums) {
|
||||
$mediaAlbum = $mediaAlbums[array_rand($mediaAlbums, 1)];
|
||||
|
||||
// set allowed asset mime types
|
||||
$mediaAlbum->setAllowedMimeTypes($this->allowedAssetMimeTypes);
|
||||
// set assets order
|
||||
$mediaAlbum->setAssetsOrderBy($this->assetsOrderBy);
|
||||
$mediaAlbum->setAssetsOrderDirection($this->assetsOrderDirection);
|
||||
}
|
||||
|
||||
return $mediaAlbum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find albums by parent album
|
||||
*
|
||||
* @param MediaAlbum $parentAlbum
|
||||
* @param boolean $excludeEmptyAlbums
|
||||
* @param string $orderBy Sort albums by: datetime|crdate|sorting
|
||||
* @param string $orderDirection Sort order: asc|desc
|
||||
* @return MediaAlbum[]
|
||||
*/
|
||||
public function findByParentAlbum(
|
||||
MediaAlbum $parentAlbum = null,
|
||||
$excludeEmptyAlbums = true,
|
||||
$orderBy = 'sorting',
|
||||
$orderDirection = 'desc'
|
||||
) {
|
||||
$excludeEmptyAlbums = filter_var($excludeEmptyAlbums, FILTER_VALIDATE_BOOLEAN);
|
||||
$query = $this->createQuery();
|
||||
$constraints = [];
|
||||
$constraints[] = $query->equals('parentalbum', $parentAlbum ?: 0);
|
||||
|
||||
if ($this->albumUids !== []) {
|
||||
if ($this->useAlbumUidsAsExclude) {
|
||||
$constraints[] = $query->logicalNot($query->in('uid', $this->albumUids));
|
||||
} else {
|
||||
$constraints[] = $query->in('uid', $this->albumUids);
|
||||
}
|
||||
}
|
||||
|
||||
$query->matching($query->logicalAnd($constraints));
|
||||
$query->setOrderings($this->getOrderingsSettings($orderBy, $orderDirection));
|
||||
$mediaAlbums = $query->execute()->toArray();
|
||||
|
||||
foreach ($mediaAlbums as $key => $mediaAlbum) {
|
||||
/** @var $mediaAlbum \MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum */
|
||||
// set allowed asset mime types
|
||||
$mediaAlbum->setAllowedMimeTypes($this->allowedAssetMimeTypes);
|
||||
// set assets order
|
||||
$mediaAlbum->setAssetsOrderBy($this->assetsOrderBy);
|
||||
$mediaAlbum->setAssetsOrderDirection($this->assetsOrderDirection);
|
||||
$mediaAlbum->setExcludeEmptyAlbums($excludeEmptyAlbums);
|
||||
|
||||
// exclude if album is empty
|
||||
if (
|
||||
$excludeEmptyAlbums
|
||||
&&
|
||||
$mediaAlbum->getAssetsCount() === 0
|
||||
&&
|
||||
count($mediaAlbum->getAlbums()) === 0
|
||||
) {
|
||||
unset($mediaAlbums[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
// Reset array keys and return albums
|
||||
return array_values($mediaAlbums);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find album by Uid
|
||||
*
|
||||
* @param integer $uid The identifier of the MediaAlbum to find
|
||||
* @param bool $respectStorage possibility to disable storage restriction
|
||||
* @return MediaAlbum|NULL The matching media album if found, otherwise NULL
|
||||
*/
|
||||
public function findByUid($uid, $respectStorage = true)
|
||||
{
|
||||
|
||||
$query = $this->createQuery();
|
||||
$query->getQuerySettings()->setRespectSysLanguage(false);
|
||||
|
||||
if (!$respectStorage) {
|
||||
$query->getQuerySettings()->setRespectStoragePage(false);
|
||||
}
|
||||
|
||||
$constraints = [$query->equals('uid', (int)$uid)];
|
||||
|
||||
if ($this->albumUids !== []) {
|
||||
if ($this->useAlbumUidsAsExclude) {
|
||||
$constraints[] = $query->logicalNot($query->in('uid', $this->albumUids));
|
||||
} else {
|
||||
$constraints[] = $query->in('uid', $this->albumUids);
|
||||
}
|
||||
}
|
||||
|
||||
/** @var $mediaAlbum \MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum */
|
||||
$mediaAlbum = $query->matching($query->logicalAnd($constraints))->execute()->getFirst();
|
||||
|
||||
if ($mediaAlbum) {
|
||||
// set allowed asset mime types
|
||||
$mediaAlbum->setAllowedMimeTypes($this->allowedAssetMimeTypes);
|
||||
// set assets order
|
||||
$mediaAlbum->setAssetsOrderBy($this->assetsOrderBy);
|
||||
$mediaAlbum->setAssetsOrderDirection($this->assetsOrderDirection);
|
||||
}
|
||||
|
||||
return $mediaAlbum;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find all albums
|
||||
*
|
||||
* @param boolean $excludeEmptyAlbums
|
||||
* @param string $orderBy Sort albums by: datetime|crdate|sorting
|
||||
* @param string $orderDirection Sort order: asc|desc
|
||||
* @return MediaAlbum[]
|
||||
*/
|
||||
public function findAll($excludeEmptyAlbums = true, $orderBy = 'datetime', $orderDirection = 'desc')
|
||||
{
|
||||
$excludeEmptyAlbums = filter_var($excludeEmptyAlbums, FILTER_VALIDATE_BOOLEAN);
|
||||
$query = $this->createQuery();
|
||||
$query->setOrderings($this->getOrderingsSettings($orderBy, $orderDirection));
|
||||
$query->getQuerySettings()->setRespectSysLanguage(false);
|
||||
|
||||
if ($this->albumUids !== []) {
|
||||
if ($this->useAlbumUidsAsExclude) {
|
||||
$query->matching($query->logicalNot($query->in('uid', $this->albumUids)));
|
||||
} else {
|
||||
$query->matching($query->in('uid', $this->albumUids));
|
||||
}
|
||||
}
|
||||
|
||||
$mediaAlbums = $query->execute()->toArray();
|
||||
|
||||
foreach ($mediaAlbums as $key => $mediaAlbum) {
|
||||
/** @var $mediaAlbum \MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum */
|
||||
// set allowed asset mime types
|
||||
$mediaAlbum->setAllowedMimeTypes($this->allowedAssetMimeTypes);
|
||||
// set assets order
|
||||
$mediaAlbum->setAssetsOrderBy($this->assetsOrderBy);
|
||||
$mediaAlbum->setAssetsOrderDirection($this->assetsOrderDirection);
|
||||
$mediaAlbum->setExcludeEmptyAlbums($excludeEmptyAlbums);
|
||||
|
||||
// exclude if album is empty
|
||||
if (
|
||||
$excludeEmptyAlbums
|
||||
&&
|
||||
$mediaAlbum->getAssetsCount() === 0
|
||||
&&
|
||||
count($mediaAlbum->getAlbums()) === 0
|
||||
) {
|
||||
unset($mediaAlbums[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
// Reset array keys and return albums
|
||||
return array_values($mediaAlbums);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get orderings settings. Returns an array like:
|
||||
* array(
|
||||
* 'foo' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING,
|
||||
* 'bar' => \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING
|
||||
* )
|
||||
*
|
||||
* @param string $orderBy Sort albums by: datetime|crdate|sorting
|
||||
* @param string $orderDirection Sort order: asc|desc
|
||||
* @return array Orderings settings used by \TYPO3\CMS\Extbase\Persistence\QueryInterface->setOrderings()
|
||||
*/
|
||||
protected function getOrderingsSettings($orderBy = 'sorting', $orderDirection = 'asc')
|
||||
{
|
||||
|
||||
// check orderDirection
|
||||
if ($orderDirection === 'asc') {
|
||||
$orderDirection = QueryInterface::ORDER_ASCENDING;
|
||||
} else {
|
||||
$orderDirection = QueryInterface::ORDER_DESCENDING;
|
||||
}
|
||||
|
||||
// set $orderingsSettings by orderBy and orderDirection
|
||||
switch ($orderBy) {
|
||||
case 'datetime':
|
||||
$orderingsSettings = [
|
||||
'datetime' => $orderDirection,
|
||||
'crdate' => $orderDirection
|
||||
];
|
||||
break;
|
||||
case 'crdate':
|
||||
$orderingsSettings = ['crdate' => $orderDirection];
|
||||
break;
|
||||
default:
|
||||
// sorting
|
||||
$orderingsSettings = [
|
||||
'sorting' => $orderDirection,
|
||||
'crdate' => $orderDirection
|
||||
];
|
||||
}
|
||||
|
||||
return $orderingsSettings;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
namespace MiniFranske\FsMediaGallery\Hooks;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Frans Saris <franssaris@gmail.com>
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Backend\Routing\UriBuilder;
|
||||
use TYPO3\CMS\Backend\Controller\BackendController;
|
||||
use TYPO3\CMS\Core\Page\PageRenderer;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* This class adds Filelist related JavaScript to the backend
|
||||
*/
|
||||
class BackendControllerHook
|
||||
{
|
||||
/**
|
||||
* Adds Filelist JavaScript used e.g. by context menu
|
||||
*
|
||||
* @param array $configuration
|
||||
* @param BackendController $backendController
|
||||
*/
|
||||
public function addJavaScript(array $configuration, BackendController $backendController)
|
||||
{
|
||||
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
|
||||
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
|
||||
$uriBuilder = GeneralUtility::makeInstance(UriBuilder::class);
|
||||
$pageRenderer->addInlineSetting('FileEdit', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('file_edit'));
|
||||
$pageRenderer->addInlineSetting('FileCreate', 'moduleUrl', (string)$uriBuilder->buildUriFromRoute('file_upload'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
namespace MiniFranske\FsMediaGallery\Hooks;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Frans Saris <franssaris@gmail.com>
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use MiniFranske\FsMediaGallery\Service\AbstractBeAlbumButtons;
|
||||
use TYPO3\CMS\Backend\Template\Components\ButtonBar;
|
||||
use TYPO3\CMS\Core\Imaging\Icon;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Hook to add extra button to DocHeaderButtons in file list
|
||||
*/
|
||||
class DocHeaderButtonsHook extends AbstractBeAlbumButtons
|
||||
{
|
||||
protected function createLink(string $title, string $shortTitle, Icon $icon, string $url, bool $addReturnUrl = true): array
|
||||
{
|
||||
return [
|
||||
'title' => $title,
|
||||
'icon' => $icon,
|
||||
'url' => $url . ($addReturnUrl ? '&returnUrl=' . rawurlencode($_SERVER['REQUEST_URI']) : '')
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Add media album buttons to file list
|
||||
*/
|
||||
public function moduleTemplateDocHeaderGetButtons(array $params, ButtonBar $buttonBar): array
|
||||
{
|
||||
$buttons = $params['buttons'];
|
||||
if (GeneralUtility::_GP('M') === 'file_FilelistList'
|
||||
|| GeneralUtility::_GP('route') === '/file/FilelistList/'
|
||||
|| GeneralUtility::_GP('route') === '/module/file/FilelistList'
|
||||
) {
|
||||
foreach ($this->generateButtons((string)GeneralUtility::_GP('id')) as $buttonInfo) {
|
||||
$button = $buttonBar->makeLinkButton();
|
||||
$button->setShowLabelText(true);
|
||||
$button->setIcon($buttonInfo['icon']);
|
||||
$button->setTitle($buttonInfo['title']);
|
||||
if (strpos($buttonInfo['url'], 'alert') === 0) {
|
||||
// using CSS class to trigger confirmation in modal box
|
||||
$button->setClasses('t3js-modal-trigger')
|
||||
->setDataAttributes([
|
||||
'severity' => 'warning',
|
||||
'title' => $buttonInfo['title'],
|
||||
'bs-content' => htmlspecialchars(substr($buttonInfo['url'], 6)),
|
||||
]);
|
||||
} else {
|
||||
$button->setHref($buttonInfo['url']);
|
||||
}
|
||||
$buttons['left'][2][] = $button;
|
||||
}
|
||||
}
|
||||
|
||||
return $buttons;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
<?php
|
||||
namespace MiniFranske\FsMediaGallery\Hooks;
|
||||
|
||||
/* *
|
||||
* This script is part of the TYPO3 project. *
|
||||
* *
|
||||
* It is free software; you can redistribute it and/or modify it under *
|
||||
* the terms of the GNU Lesser General Public License, either version 3 *
|
||||
* of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* The TYPO3 project - inspiring people to share! *
|
||||
* */
|
||||
|
||||
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* ItemsProcFuncHook
|
||||
*/
|
||||
class ItemsProcFuncHook
|
||||
{
|
||||
|
||||
/**
|
||||
* Sets the available actions for settings.switchableControllerActions
|
||||
*
|
||||
* @param array &$config
|
||||
* @return void
|
||||
*/
|
||||
public function getItemsForSwitchableControllerActions(array &$config)
|
||||
{
|
||||
$availableActions = [
|
||||
'nestedList' => 'MediaAlbum->nestedList;MediaAlbum->showAsset',
|
||||
'flatList' => 'MediaAlbum->flatList;MediaAlbum->showAlbum;MediaAlbum->showAsset',
|
||||
'showAlbumByParam' => 'MediaAlbum->showAlbum;MediaAlbum->showAsset',
|
||||
'showAlbumByConfig' => 'MediaAlbum->showAlbumByConfig;MediaAlbum->showAsset',
|
||||
'randomAsset' => 'MediaAlbum->randomAsset',
|
||||
];
|
||||
$extConf = $this->getExtensionConfiguration();;
|
||||
$allowedActions = [
|
||||
// index action is always allowed
|
||||
// this is needed to make sure the correct tabs/fields are shown in
|
||||
// flexform when a new plugin is added
|
||||
'index' => 'MediaAlbum->index',
|
||||
];
|
||||
$allowedActionsFromExtConf = [];
|
||||
if (!empty($extConf['allowedActionsInFlexforms'])) {
|
||||
$allowedActionsFromExtConf = GeneralUtility::trimExplode(',', $extConf['allowedActionsInFlexforms']);
|
||||
}
|
||||
foreach ($allowedActionsFromExtConf as $allowedActionFromExtConf) {
|
||||
if (!empty($availableActions[$allowedActionFromExtConf])) {
|
||||
$allowedActions[$allowedActionFromExtConf] = $availableActions[$allowedActionFromExtConf];
|
||||
}
|
||||
}
|
||||
// check items; allow all actions if something went wrong (no action except of "indexAction" is allowed)
|
||||
if (count($allowedActions) > 1) {
|
||||
foreach ($config['items'] as $key => $item) {
|
||||
if (!in_array($item[1], $allowedActions)) {
|
||||
unset($config['items'][$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the available options for settings.list.orderBy
|
||||
*
|
||||
* @param array &$config
|
||||
* @return void
|
||||
*/
|
||||
public function getItemsForListOrderBy(array &$config)
|
||||
{
|
||||
$availableOptions = ['datetime', 'crdate', 'sorting'];
|
||||
$extConf = $this->getExtensionConfiguration();;
|
||||
$allowedOptions = [];
|
||||
$allowedOptionsFromExtConf = [];
|
||||
if (!empty($extConf['list']['orderOptions'])) {
|
||||
$allowedOptionsFromExtConf = GeneralUtility::trimExplode(',', $extConf['list']['orderOptions']);
|
||||
}
|
||||
foreach ($allowedOptionsFromExtConf as $allowedOptionFromExtConf) {
|
||||
if (in_array($allowedOptionFromExtConf, $availableOptions)) {
|
||||
$allowedOptions[] = $allowedOptionFromExtConf;
|
||||
}
|
||||
}
|
||||
foreach ($config['items'] as $key => $item) {
|
||||
// check items; empty value (inherit from TS) is always allowed
|
||||
if (!empty($item[1]) && !in_array($item[1], $allowedOptions)) {
|
||||
unset($config['items'][$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the available options for settings.album.assets.orderBy
|
||||
*
|
||||
* @param array &$config
|
||||
* @return void
|
||||
*/
|
||||
public function getItemsForAssetsOrderBy(array &$config)
|
||||
{
|
||||
// default set
|
||||
$allowedOptions = ['name', 'crdate', 'title', 'content_creation_date', 'content_modification_date'];
|
||||
$availableOptions = [];
|
||||
$extConf = $this->getExtensionConfiguration();;
|
||||
|
||||
if (!empty($extConf['asset']['orderOptions'])) {
|
||||
$allowedOptions = GeneralUtility::trimExplode(',', $extConf['asset']['orderOptions']);
|
||||
}
|
||||
// check if field exists in TCA of sys_file or sys_file_metadata
|
||||
foreach ($allowedOptions as $key => $option) {
|
||||
if (
|
||||
$option === 'crdate'
|
||||
||
|
||||
!empty($GLOBALS['TCA']['sys_file']['columns'][$option])
|
||||
||
|
||||
!empty($GLOBALS['TCA']['sys_file_metadata']['columns'][$option])
|
||||
) {
|
||||
$availableOptions[] = $option;
|
||||
}
|
||||
}
|
||||
// @todo: add option to add custom options to the item list
|
||||
// use label from TCA
|
||||
foreach ($config['items'] as $key => $item) {
|
||||
// check items; empty value (inherit from TS) is always allowed
|
||||
if (!empty($item[1]) && !in_array($item[1], $availableOptions)) {
|
||||
unset($config['items'][$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get extension configuration
|
||||
*/
|
||||
protected function getExtensionConfiguration() {
|
||||
return GeneralUtility::makeInstance(
|
||||
ExtensionConfiguration::class
|
||||
)->get('fs_media_gallery');
|
||||
}
|
||||
}
|
||||
250
typo3conf/ext/fs_media_gallery/Classes/Hooks/PageLayoutView.php
Normal file
@@ -0,0 +1,250 @@
|
||||
<?php
|
||||
namespace MiniFranske\FsMediaGallery\Hooks;
|
||||
|
||||
/*
|
||||
* This source file is proprietary property of Beech Applications B.V.
|
||||
* Date: 28-09-2016
|
||||
* All code (c) Beech Applications B.V. all rights reserved
|
||||
*/
|
||||
use TYPO3\CMS\Backend\Utility\BackendUtility as BackendUtilityCore;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Core\Database\Connection;
|
||||
|
||||
/**
|
||||
* Class PageLayoutView
|
||||
*/
|
||||
class PageLayoutView
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
const LLPATH = 'LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $summaryData = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $flexFormData = [];
|
||||
|
||||
public function getExtensionSummary(array $params): string
|
||||
{
|
||||
/** @var \TYPO3\CMS\Backend\View\PageLayoutView $pageLayoutView */
|
||||
$pageLayoutView = $params['pObj'];
|
||||
$row = $params['row'];
|
||||
$this->flexFormData = GeneralUtility::xml2array($row['pi_flexform']);
|
||||
$action = $this->getAction();
|
||||
|
||||
$result = '<strong>' . $pageLayoutView->linkEditContent($this->getLanguageService()->sL(self::LLPATH . 'mediagallery.title'), $row) . '</strong><br>';
|
||||
$result .= $this->getDisplayMode($action);
|
||||
|
||||
$result .= '<hr>';
|
||||
|
||||
if (in_array($action, ['showAlbum', 'showAlbumByConfig'], true)) {
|
||||
$this->addSelectedAlbumToSettingsSummary();
|
||||
} else {
|
||||
$this->addSelectedAlbumsToSettingsSummary();
|
||||
}
|
||||
$this->addStartingPointToSettingsSummary();
|
||||
|
||||
$result .= $this->renderSettingsAsTable();
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
private function getAction(): string
|
||||
{
|
||||
// if flexForm data is found
|
||||
$actions = $this->getFieldFromFlexform('switchableControllerActions');
|
||||
$action = '';
|
||||
|
||||
if (!empty($actions)) {
|
||||
$actionList = GeneralUtility::trimExplode(';', $actions);
|
||||
|
||||
// translate the first action into its translation
|
||||
$action = str_replace('MediaAlbum->', '', $actionList[0]);
|
||||
}
|
||||
return $action;
|
||||
}
|
||||
|
||||
private function getDisplayMode(string $action): string
|
||||
{
|
||||
switch ($action) {
|
||||
case 'showalbum';
|
||||
$actionTranslationKey = 'showAlbumByParam';
|
||||
break;
|
||||
default:
|
||||
$actionTranslationKey = $action;
|
||||
}
|
||||
return $this->getLanguageService()->sL(self::LLPATH . 'flexforms.mediagallery.switchableControllerActions.I.' . $actionTranslationKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get field value from flexform configuration,
|
||||
* including checks if flexform configuration is available
|
||||
*
|
||||
* @param string $key name of the key
|
||||
* @param string $sheet name of the sheet
|
||||
* @return string|NULL if nothing found, value if found
|
||||
*/
|
||||
private function getFieldFromFlexform(string $key, string $sheet = 'general'): ?string
|
||||
{
|
||||
$flexform = $this->flexFormData;
|
||||
if (isset($flexform['data'])) {
|
||||
$flexform = $flexform['data'];
|
||||
if (is_array($flexform) && is_array($flexform[$sheet]) && is_array($flexform[$sheet]['lDEF'])
|
||||
&& is_array($flexform[$sheet]['lDEF'][$key]) && isset($flexform[$sheet]['lDEF'][$key]['vDEF'])
|
||||
) {
|
||||
return $flexform[$sheet]['lDEF'][$key]['vDEF'];
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private function addSelectedAlbumToSettingsSummary(): void
|
||||
{
|
||||
$albumUid = (int)$this->getFieldFromFlexform('settings.mediaAlbum');
|
||||
if ((int)$albumUid > 0) {
|
||||
// Album record
|
||||
$rowSysFileCollectionRecords = $this->getDatabaseConnection()->select(['*'], 'sys_file_collection', [
|
||||
'uid' => (int)$albumUid,
|
||||
'deleted' => 0,
|
||||
])->fetchAllAssociative();
|
||||
|
||||
$albums = [];
|
||||
foreach ($rowSysFileCollectionRecords as $record) {
|
||||
$albums[] = htmlspecialchars(BackendUtilityCore::getRecordTitle('sys_file_collection', $record));
|
||||
}
|
||||
|
||||
$this->summaryData[] = [
|
||||
$this->getLanguageService()->sL(self::LLPATH . 'flexforms.mediagallery.mediaAlbum') .
|
||||
'<br />',
|
||||
implode(', ', $albums)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
private function addSelectedAlbumsToSettingsSummary(): void
|
||||
{
|
||||
$filterMode = '';
|
||||
$albums = [];
|
||||
|
||||
$albumUids = GeneralUtility::intExplode(',', $this->getFieldFromFlexform('settings.mediaAlbumsUids'), true);
|
||||
if (count($albumUids) > 0) {
|
||||
|
||||
// Filter mode
|
||||
$selectedFilerMode = $this->getFieldFromFlexform('settings.useAlbumFilterAsExclude');
|
||||
|
||||
if ($selectedFilerMode !== '') {
|
||||
$filterMode = $this->getLanguageService()->sL(self::LLPATH . 'flexforms.general.I.inherit');
|
||||
$filterMode = '<span style="font-weight:normal;font-style:italic">(' . htmlspecialchars($filterMode) . ')</span>';
|
||||
}
|
||||
|
||||
// Album records
|
||||
$q = $this->getDatabaseConnection()->createQueryBuilder();
|
||||
|
||||
$q->getRestrictions()
|
||||
->removeAll()
|
||||
->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||||
|
||||
$quotedIdentifiers = $q->createNamedParameter($albumUids, Connection::PARAM_INT_ARRAY);
|
||||
$q->select('*')
|
||||
->from('sys_file_collection')
|
||||
->where(
|
||||
$q->expr()->in('uid', $quotedIdentifiers)
|
||||
);
|
||||
|
||||
$rowSysFileCollectionRecords = $q->execute()->fetchAllAssociative();
|
||||
|
||||
foreach ((array)$rowSysFileCollectionRecords as $record) {
|
||||
$albums[] = htmlspecialchars(BackendUtilityCore::getRecordTitle('sys_file_collection', $record));
|
||||
}
|
||||
|
||||
$this->summaryData[] = [
|
||||
$this->getLanguageService()->sL(self::LLPATH . 'flexforms.mediagallery.mediaAlbumsUids') .
|
||||
'<br />' . $filterMode,
|
||||
implode(', ', $albums)
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
private function addStartingPointToSettingsSummary(): void
|
||||
{
|
||||
$value = $this->getFieldFromFlexform('settings.startingpoint');
|
||||
|
||||
if (!empty($value)) {
|
||||
$pagesOut = [];
|
||||
|
||||
$q = $this->getDatabaseConnection('pages')->createQueryBuilder();
|
||||
$quotedIdentifiers = $q->createNamedParameter(GeneralUtility::intExplode(',', $value, true), Connection::PARAM_INT_ARRAY);
|
||||
|
||||
$q->select('*')
|
||||
->from('pages')
|
||||
->where(
|
||||
$q->expr()->in('uid', $quotedIdentifiers)
|
||||
);
|
||||
|
||||
$rawPagesRecords = $q->execute()->fetchAllAssociative();
|
||||
|
||||
foreach ((array)$rawPagesRecords as $page) {
|
||||
$pagesOut[] = htmlspecialchars(BackendUtilityCore::getRecordTitle('pages',
|
||||
$page)) . ' (' . $page['uid'] . ')';
|
||||
}
|
||||
|
||||
$recursiveLevel = (int)$this->getFieldFromFlexform('settings.recursive');
|
||||
$recursiveLevelText = '';
|
||||
if ($recursiveLevel === 250) {
|
||||
$recursiveLevelText = $this->getLanguageService()->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:recursive.I.5');
|
||||
} elseif ($recursiveLevel > 0) {
|
||||
$recursiveLevelText = $this->getLanguageService()->sL('LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:recursive.I.' . $recursiveLevel);
|
||||
}
|
||||
|
||||
if (!empty($recursiveLevelText)) {
|
||||
$recursiveLevelText = '<br />' .
|
||||
$this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.recursive') . ' ' .
|
||||
$recursiveLevelText;
|
||||
}
|
||||
|
||||
$this->summaryData[] = [
|
||||
$this->getLanguageService()->sL('LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.startingpoint'),
|
||||
implode(', ', $pagesOut) . $recursiveLevelText
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the settings as table for Web>Page module
|
||||
*
|
||||
* System settings are displayed in mono font
|
||||
*/
|
||||
private function renderSettingsAsTable(): string
|
||||
{
|
||||
if (count($this->summaryData) == 0) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$content = '';
|
||||
foreach ($this->summaryData as $line) {
|
||||
$content .= '<strong>' . $line[0] . '</strong>' . ' ' . $line[1] . '<br />';
|
||||
}
|
||||
|
||||
return '<pre style="white-space:normal">' . $content . '</pre>';
|
||||
}
|
||||
|
||||
private function getLanguageService(): LanguageService
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
|
||||
private function getDatabaseConnection(string $table = 'sys_file_collection'): Connection
|
||||
{
|
||||
return GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($table);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
namespace MiniFranske\FsMediaGallery\Hooks;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Frans Saris <franssaris@gmail.com>
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Core\DataHandling\DataHandler;
|
||||
use TYPO3\CMS\Backend\Utility\BackendUtility;
|
||||
|
||||
/**
|
||||
* Hooks called after sys_file_collection is added/updated/deleted
|
||||
*/
|
||||
class ProcessDatamapHook
|
||||
{
|
||||
|
||||
/**
|
||||
* Trigger updateFolderTree after change in sys_file_collection
|
||||
*
|
||||
* @param string $status
|
||||
* @param string $table
|
||||
* @param $id
|
||||
* @param array $fieldArray
|
||||
* @param \TYPO3\CMS\Core\DataHandling\DataHandler $dataHandler
|
||||
*/
|
||||
public function processDatamap_afterDatabaseOperations(
|
||||
$status,
|
||||
$table,
|
||||
$id,
|
||||
array $fieldArray,
|
||||
DataHandler $dataHandler
|
||||
) {
|
||||
if ($table === 'sys_file_collection') {
|
||||
BackendUtility::setUpdateSignal('updateFolderTree');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trigger updateFolderTree after a sys_file_collection record is deleted
|
||||
*
|
||||
* @param string $command
|
||||
* @param string $table
|
||||
* @param int $id
|
||||
* @param mixed $value
|
||||
* @param \TYPO3\CMS\Core\DataHandling\DataHandler $dataHandler
|
||||
* @param mixed $pasteUpdate
|
||||
* @param array $pasteDatamap
|
||||
*/
|
||||
public function processCmdmap_postProcess(
|
||||
$command,
|
||||
$table,
|
||||
$id,
|
||||
$value,
|
||||
DataHandler $dataHandler,
|
||||
$pasteUpdate,
|
||||
array $pasteDatamap
|
||||
) {
|
||||
if ($table === 'sys_file_collection') {
|
||||
BackendUtility::setUpdateSignal('updateFolderTree');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,241 @@
|
||||
<?php
|
||||
|
||||
namespace MiniFranske\FsMediaGallery\Listeners;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Frans Saris <franssaris@gmail.com>
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
|
||||
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
|
||||
use TYPO3\CMS\Core\Resource\Event\AfterFileAddedEvent;
|
||||
use TYPO3\CMS\Core\Resource\Event\AfterFileCopiedEvent;
|
||||
use TYPO3\CMS\Core\Resource\Event\AfterFileCreatedEvent;
|
||||
use TYPO3\CMS\Core\Resource\Event\AfterFileDeletedEvent;
|
||||
use TYPO3\CMS\Core\Resource\Event\AfterFileMovedEvent;
|
||||
use TYPO3\CMS\Core\Resource\Event\AfterFileRenamedEvent;
|
||||
use TYPO3\CMS\Core\Resource\Event\AfterFileReplacedEvent;
|
||||
use TYPO3\CMS\Core\Resource\Event\AfterFolderAddedEvent;
|
||||
use TYPO3\CMS\Core\Resource\Event\AfterFolderDeletedEvent;
|
||||
use TYPO3\CMS\Core\Resource\Event\AfterFolderMovedEvent;
|
||||
use TYPO3\CMS\Core\Resource\Event\BeforeFolderDeletedEvent;
|
||||
use TYPO3\CMS\Core\Resource\Event\BeforeFolderMovedEvent;
|
||||
use MiniFranske\FsMediaGallery\Service\Utility;
|
||||
use TYPO3\CMS\Core\Resource\Folder;
|
||||
use TYPO3\CMS\Core\Resource\FolderInterface;
|
||||
|
||||
/**
|
||||
* Slots that pick up signals after (re)moving folders to update mediagallery record (sys_file_collection)
|
||||
*/
|
||||
final class FolderChangedListener
|
||||
{
|
||||
protected $folderMapping = [];
|
||||
|
||||
/**
|
||||
* @var Utility
|
||||
*/
|
||||
private $utilityService;
|
||||
|
||||
/**
|
||||
* @var ExtensionConfiguration
|
||||
*/
|
||||
private $extensionConfiguration;
|
||||
|
||||
public function __construct(Utility $utilityService, ExtensionConfiguration $extensionConfiguration)
|
||||
{
|
||||
$this->utilityService = $utilityService;
|
||||
$this->extensionConfiguration = $extensionConfiguration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sub folder structure of folder before is gets moved
|
||||
* Is needed to update sys_file_collection records when move was successful
|
||||
*/
|
||||
public function preFolderMove(BeforeFolderMovedEvent $event): void
|
||||
{
|
||||
$this->folderMapping[$event->getFolder()->getCombinedIdentifier()] = $this->getSubFolderIdentifiers($event->getFolder());
|
||||
}
|
||||
|
||||
/**
|
||||
* Update sys_file_collection records when folder is moved
|
||||
*/
|
||||
public function postFolderMove(AfterFolderMovedEvent $event): void
|
||||
{
|
||||
if (!$event->getTargetFolder()) {
|
||||
return;
|
||||
}
|
||||
$newFolder = $event->getTargetFolder();
|
||||
$oldStorageUid = $event->getFolder()->getStorage()->getUid();
|
||||
$newStorageUid = $newFolder->getStorage()->getUid();
|
||||
|
||||
$newParentId = null;
|
||||
// If this is a subFolder find new parent album
|
||||
if ($newFolder->getParentFolder() !== $newFolder) {
|
||||
$newParentId = $this->utilityService->findFileCollectionRecordsForFolder(
|
||||
$newStorageUid,
|
||||
$event->getFolder()->getParentFolder()->getIdentifier()
|
||||
)[0]['parentalbum'] ?? null;
|
||||
}
|
||||
|
||||
$this->utilityService->updateFolderRecord(
|
||||
$oldStorageUid,
|
||||
$event->getFolder()->getIdentifier(),
|
||||
$newStorageUid,
|
||||
$newFolder->getIdentifier(),
|
||||
$newParentId
|
||||
);
|
||||
|
||||
if (!empty($this->folderMapping[$event->getFolder()->getCombinedIdentifier()])) {
|
||||
$newMapping = $this->getSubFolderIdentifiers($newFolder);
|
||||
foreach ($this->folderMapping[$event->getFolder()->getCombinedIdentifier()] as $key => $folderInfo) {
|
||||
$this->utilityService->updateFolderRecord(
|
||||
$oldStorageUid,
|
||||
$folderInfo[1],
|
||||
$newStorageUid,
|
||||
$newMapping[$key][1]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get sub folder structure of folder before is gets deleted
|
||||
* Is needed to update sys_file_collection records when delete was successful
|
||||
*/
|
||||
public function preFolderDelete(BeforeFolderDeletedEvent $event): void
|
||||
{
|
||||
$this->folderMapping[$event->getFolder()->getCombinedIdentifier()] = $this->getSubFolderIdentifiers($event->getFolder());
|
||||
}
|
||||
|
||||
/**
|
||||
* Update sys_file_collection records when folder is deleted
|
||||
*/
|
||||
public function postFolderDelete(AfterFolderDeletedEvent $event): void
|
||||
{
|
||||
$folder = $event->getFolder();
|
||||
$storageUid = $folder->getStorage()->getUid();
|
||||
$this->utilityService->deleteFolderRecord($storageUid, $folder->getIdentifier());
|
||||
foreach ($this->folderMapping[$folder->getCombinedIdentifier()] as $folderInfo) {
|
||||
$this->utilityService->deleteFolderRecord($storageUid, $folderInfo[1]);
|
||||
}
|
||||
$this->clearMediaGalleryPageCache($folder);
|
||||
}
|
||||
|
||||
/**
|
||||
* Auto creates a file collection to the first parentCollection found of the current folder,
|
||||
* when no collection is found nothing is created
|
||||
*/
|
||||
public function postFolderAdd(AfterFolderAddedEvent $event): void
|
||||
{
|
||||
if (!$this->getConfigFlag('enableAutoCreateFileCollection')) {
|
||||
return;
|
||||
}
|
||||
|
||||
$folder = $event->getFolder();
|
||||
$mediaFolders = $this->utilityService->getStorageFolders();
|
||||
if (count($mediaFolders) === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach ($mediaFolders as $uid => $title) {
|
||||
$parents = $this->utilityService->getFirstParentCollections($folder, $uid);
|
||||
if (count($parents) === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Take the first parent found
|
||||
$parentUid = $parents[0]['uid'];
|
||||
$this->utilityService->createFolderRecord(
|
||||
ucfirst(trim(str_replace('_', ' ', $folder->getName()))),
|
||||
$uid,
|
||||
$folder->getStorage()->getUid(),
|
||||
$folder->getIdentifier(),
|
||||
$parentUid
|
||||
);
|
||||
$this->clearMediaGalleryPageCache($folder);
|
||||
}
|
||||
}
|
||||
|
||||
public function postFileAdd(AfterFileAddedEvent $event): void
|
||||
{
|
||||
$this->clearMediaGalleryPageCache($event->getFolder());
|
||||
}
|
||||
|
||||
public function postFileCreate(AfterFileCreatedEvent $event): void
|
||||
{
|
||||
$this->clearMediaGalleryPageCache($event->getFolder());
|
||||
}
|
||||
|
||||
public function postFileCopy(AfterFileCopiedEvent $event): void
|
||||
{
|
||||
$this->clearMediaGalleryPageCache($event->getFolder());
|
||||
}
|
||||
|
||||
public function postFileMove(AfterFileMovedEvent $event)
|
||||
{
|
||||
$this->clearMediaGalleryPageCache($event->getOriginalFolder());
|
||||
$this->clearMediaGalleryPageCache($event->getFolder());
|
||||
}
|
||||
|
||||
public function postFileDelete(AfterFileDeletedEvent $event): void
|
||||
{
|
||||
$this->clearMediaGalleryPageCache($event->getFile()->getParentFolder());
|
||||
}
|
||||
|
||||
public function postFileRename(AfterFileRenamedEvent $event): void
|
||||
{
|
||||
$this->clearMediaGalleryPageCache($event->getFile()->getParentFolder());
|
||||
}
|
||||
|
||||
public function postFileReplace(AfterFileReplacedEvent $event): void
|
||||
{
|
||||
$this->clearMediaGalleryPageCache($event->getFile()->getParentFolder());
|
||||
}
|
||||
|
||||
private function clearMediaGalleryPageCache(FolderInterface $folder): void
|
||||
{
|
||||
if ($this->getBackendUser() && $this->getConfigFlag('clearCacheAfterFileChange')) {
|
||||
$this->utilityService->clearMediaGalleryPageCache($folder);
|
||||
}
|
||||
}
|
||||
|
||||
private function getSubFolderIdentifiers(Folder $folder): array
|
||||
{
|
||||
$folderIdentifiers = [];
|
||||
foreach ($folder->getSubfolders() as $subFolder) {
|
||||
$folderIdentifiers[] = [$subFolder->getHashedIdentifier(), $subFolder->getIdentifier()];
|
||||
$folderIdentifiers = array_merge($folderIdentifiers, $this->getSubFolderIdentifiers($subFolder));
|
||||
}
|
||||
|
||||
return $folderIdentifiers;
|
||||
}
|
||||
|
||||
private function getConfigFlag(string $flag): bool
|
||||
{
|
||||
return (bool)($this->extensionConfiguration->get('fs_media_gallery')[$flag] ?? false);
|
||||
}
|
||||
|
||||
private function getBackendUser(): ?BackendUserAuthentication
|
||||
{
|
||||
return $GLOBALS['BE_USER'] ?? null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
<?php
|
||||
|
||||
namespace MiniFranske\FsMediaGallery\Listeners;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2016 Frans Saris <franssaris@gmail.com>
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use MiniFranske\FsMediaGallery\Service\Utility;
|
||||
use TYPO3\CMS\Core\Imaging\Event\ModifyIconForResourcePropertiesEvent;
|
||||
use TYPO3\CMS\Core\Resource\FolderInterface;
|
||||
use TYPO3\CMS\Core\Resource\Folder;
|
||||
|
||||
/**
|
||||
* Class IconFactory
|
||||
*/
|
||||
class IconFactoryListener
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
static private $mediaFolders;
|
||||
|
||||
/**
|
||||
* @var Utility
|
||||
*/
|
||||
private $utilityService;
|
||||
|
||||
public function __construct(Utility $utilityService)
|
||||
{
|
||||
$this->utilityService = $utilityService;
|
||||
}
|
||||
|
||||
public function buildIconForResource(
|
||||
ModifyIconForResourcePropertiesEvent $event
|
||||
): void
|
||||
{
|
||||
$folderObject = $event->getResource();
|
||||
|
||||
if (!($folderObject instanceof Folder)
|
||||
|| !in_array($folderObject->getRole(), [FolderInterface::ROLE_DEFAULT, FolderInterface::ROLE_USERUPLOAD])
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
$mediaFolders = $this->getMediaFolders();
|
||||
if ($mediaFolders === []) {
|
||||
return;
|
||||
}
|
||||
|
||||
$collections = $this->utilityService->findFileCollectionRecordsForFolder(
|
||||
$folderObject->getStorage()->getUid(),
|
||||
$folderObject->getIdentifier(),
|
||||
array_keys($mediaFolders)
|
||||
);
|
||||
|
||||
if (!$collections) {
|
||||
return;
|
||||
}
|
||||
|
||||
$event->setIconIdentifier('tcarecords-sys_file_collection-folder');
|
||||
$hidden = true;
|
||||
foreach ($collections as $collection) {
|
||||
if ((int)$collection['hidden'] === 0) {
|
||||
$hidden = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($hidden) {
|
||||
$event->setOverlayIdentifier('overlay-hidden');
|
||||
}
|
||||
}
|
||||
|
||||
private function getMediaFolders(): array
|
||||
{
|
||||
if (self::$mediaFolders === null) {
|
||||
self::$mediaFolders = $this->utilityService->getStorageFolders();
|
||||
}
|
||||
return self::$mediaFolders;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace MiniFranske\FsMediaGallery\Pagination;
|
||||
|
||||
use TYPO3\CMS\Core\Pagination\AbstractPaginator;
|
||||
|
||||
class ExtendedArrayPaginator extends AbstractPaginator
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $items;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $paginatedItems = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $itemsBefore = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $itemsAfter = [];
|
||||
|
||||
public function __construct(
|
||||
array $items,
|
||||
int $currentPageNumber = 1,
|
||||
int $itemsPerPage = 10
|
||||
)
|
||||
{
|
||||
$this->items = $items;
|
||||
$this->setCurrentPageNumber($currentPageNumber);
|
||||
$this->setItemsPerPage($itemsPerPage);
|
||||
|
||||
$this->updateInternalState();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return iterable|array
|
||||
*/
|
||||
public function getPaginatedItems(): iterable
|
||||
{
|
||||
return $this->paginatedItems;
|
||||
}
|
||||
|
||||
protected function updatePaginatedItems(int $itemsPerPage, int $offset): void
|
||||
{
|
||||
$this->itemsBefore = array_slice($this->items, 0, $offset);
|
||||
$this->paginatedItems = array_slice($this->items, $offset, $itemsPerPage);
|
||||
$this->itemsAfter = array_slice($this->items, $offset + $itemsPerPage);
|
||||
}
|
||||
|
||||
protected function getTotalAmountOfItems(): int
|
||||
{
|
||||
return count($this->items);
|
||||
}
|
||||
|
||||
protected function getAmountOfItemsOnCurrentPage(): int
|
||||
{
|
||||
return count($this->paginatedItems);
|
||||
}
|
||||
|
||||
public function getItemsBefore(): iterable
|
||||
{
|
||||
return $this->itemsBefore;
|
||||
}
|
||||
|
||||
public function getItemsAfter(): iterable
|
||||
{
|
||||
return $this->itemsAfter;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,185 @@
|
||||
<?php
|
||||
|
||||
namespace MiniFranske\FsMediaGallery\Service;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Frans Saris <franssaris@gmail.com>
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Core\Localization\LanguageService;
|
||||
use TYPO3\CMS\Core\Resource\FolderInterface;
|
||||
use TYPO3\CMS\Core\Resource\ResourceFactory;
|
||||
use TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException;
|
||||
use TYPO3\CMS\Backend\Routing\UriBuilder;
|
||||
use TYPO3\CMS\Core\Imaging\Icon;
|
||||
use TYPO3\CMS\Core\Imaging\IconFactory;
|
||||
use TYPO3\CMS\Core\Resource\Folder;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Abstract utility class for classes that want to add album add/edit buttons
|
||||
* somewhere like a ClickMenuOptions class.
|
||||
*/
|
||||
abstract class AbstractBeAlbumButtons
|
||||
{
|
||||
/**
|
||||
* Generate album add/edit buttons for click menu or toolbar
|
||||
*/
|
||||
protected function generateButtons(string $combinedIdentifier): array
|
||||
{
|
||||
$buttons = [];
|
||||
|
||||
// In some folder copy/move actions in file list a invalid id is passed
|
||||
try {
|
||||
/** @var $file \TYPO3\CMS\Core\Resource\Folder */
|
||||
$folder = GeneralUtility::makeInstance(ResourceFactory::class)
|
||||
->retrieveFileOrFolderObject($combinedIdentifier);
|
||||
} catch (ResourceDoesNotExistException $exception) {
|
||||
$folder = null;
|
||||
}
|
||||
|
||||
if ($folder instanceof Folder &&
|
||||
in_array(
|
||||
$folder->getRole(),
|
||||
[FolderInterface::ROLE_DEFAULT, FolderInterface::ROLE_USERUPLOAD]
|
||||
)
|
||||
) {
|
||||
/** @var Utility $utility */
|
||||
$utility = GeneralUtility::makeInstance(Utility::class);
|
||||
$mediaFolders = $utility->getStorageFolders();
|
||||
|
||||
if (count($mediaFolders)) {
|
||||
$collections = $utility->findFileCollectionRecordsForFolder(
|
||||
$folder->getStorage()->getUid(),
|
||||
$folder->getIdentifier(),
|
||||
array_keys($mediaFolders)
|
||||
);
|
||||
|
||||
foreach ($collections as $collection) {
|
||||
$buttons[] = $this->createLink(
|
||||
sprintf($this->sL('module.buttons.editAlbum'), $collection['title']),
|
||||
sprintf(
|
||||
$this->sL('module.buttons.editAlbum'),
|
||||
mb_strimwidth($collection['title'], 0,12, '...')
|
||||
),
|
||||
$this->getIcon('edit-album'),
|
||||
$this->buildEditUrl($collection['uid'])
|
||||
);
|
||||
}
|
||||
|
||||
if (!count($collections)) {
|
||||
foreach ($mediaFolders as $uid => $title) {
|
||||
// find parent album for auto setting parent album
|
||||
$parentUid = 0;
|
||||
$parents = $utility->findFileCollectionRecordsForFolder(
|
||||
$folder->getStorage()->getUid(),
|
||||
$folder->getParentFolder()->getIdentifier(),
|
||||
[$uid]
|
||||
);
|
||||
// if parent(s) found we take the first one
|
||||
if (count($parents)) {
|
||||
$parentUid = $parents[0]['uid'];
|
||||
}
|
||||
$buttons[] = $this->createLink(
|
||||
sprintf($this->sL('module.buttons.createAlbumIn'), $title),
|
||||
sprintf(
|
||||
$this->sL('module.buttons.createAlbumIn'),
|
||||
mb_strimwidth($title, 0, 12, '...')
|
||||
),
|
||||
$this->getIcon('add-album'),
|
||||
$this->buildAddUrl($uid, $parentUid, $folder)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// show hint button for admin users
|
||||
// todo: make this better so it can also be used for editors with enough rights to create a storageFolder
|
||||
} elseif ($GLOBALS['BE_USER']->isAdmin()) {
|
||||
$buttons[] = $this->createLink(
|
||||
$this->sL('module.buttons.createAlbum'),
|
||||
$this->sL('module.buttons.createAlbum'),
|
||||
$this->getIcon('add-album'),
|
||||
'alert:' . $this->sL('module.alerts.firstCreateStorageFolder'),
|
||||
false
|
||||
);
|
||||
}
|
||||
}
|
||||
return $buttons;
|
||||
}
|
||||
|
||||
protected function buildEditUrl(int $mediaAlbumUid): string
|
||||
{
|
||||
return GeneralUtility::makeInstance(UriBuilder::class)->buildUriFromRoute('record_edit', [
|
||||
'edit' => [
|
||||
'sys_file_collection' => [
|
||||
$mediaAlbumUid => 'edit'
|
||||
]
|
||||
],
|
||||
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build Add new media album url
|
||||
*/
|
||||
protected function buildAddUrl(int $pid, int $parentAlbumUid, Folder $folder): string
|
||||
{
|
||||
return GeneralUtility::makeInstance(UriBuilder::class)->buildUriFromRoute('record_edit', [
|
||||
'edit' => [
|
||||
'sys_file_collection' => [
|
||||
$pid => 'new'
|
||||
]
|
||||
],
|
||||
'defVals' => [
|
||||
'sys_file_collection' => [
|
||||
'parentalbum' => $parentAlbumUid,
|
||||
'title' => ucfirst(trim(str_replace('_', ' ', $folder->getName()))),
|
||||
'storage' => $folder->getStorage()->getUid(),
|
||||
'folder' => $folder->getIdentifier(),
|
||||
'type' => 'folder',
|
||||
]
|
||||
],
|
||||
'returnUrl' => GeneralUtility::getIndpEnv('REQUEST_URI')
|
||||
]);
|
||||
}
|
||||
|
||||
abstract protected function createLink(string $title, string $shortTitle, Icon $icon, string $url, bool $addReturnUrl = true): array;
|
||||
|
||||
protected function getIcon(string $name): Icon
|
||||
{
|
||||
$iconFactory = GeneralUtility::makeInstance(IconFactory::class);
|
||||
return $iconFactory->getIcon('action-' . $name, Icon::SIZE_SMALL);
|
||||
}
|
||||
|
||||
protected function getLangService(): LanguageService
|
||||
{
|
||||
return $GLOBALS['LANG'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get language string
|
||||
*/
|
||||
protected function sL(string $key, string $languageFile = 'LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf'): string
|
||||
{
|
||||
return $this->getLangService()->sL($languageFile . ':' . $key);
|
||||
}
|
||||
}
|
||||
258
typo3conf/ext/fs_media_gallery/Classes/Service/SlugService.php
Normal file
@@ -0,0 +1,258 @@
|
||||
<?php
|
||||
/*
|
||||
* This source file is proprietary of Beech Applications bv.
|
||||
* Created by: Ruud Silvrants
|
||||
* Date: 30/04/2019
|
||||
* All code (c) Beech Applications bv. all rights reserverd
|
||||
*/
|
||||
|
||||
namespace MiniFranske\FsMediaGallery\Service;
|
||||
|
||||
|
||||
use TYPO3\CMS\Core\Database\Connection;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
|
||||
use TYPO3\CMS\Core\DataHandling\SlugHelper;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Class SlugService
|
||||
* @package MiniFranske\FsMediaGallery\Service
|
||||
*/
|
||||
class SlugService
|
||||
{
|
||||
protected $tableName = 'sys_file_collection';
|
||||
protected $slugFieldName = 'slug';
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function typo3SupportsSlugs(): bool
|
||||
{
|
||||
return class_exists(SlugHelper::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function countOfSlugUpdates(): int
|
||||
{
|
||||
/** @var QueryBuilder $queryBuilder */
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable($this->tableName);
|
||||
$queryBuilder->getRestrictions()->removeAll();
|
||||
$elementCount = $queryBuilder->count('uid')
|
||||
->from($this->tableName)
|
||||
->where(
|
||||
$queryBuilder->expr()->orX(
|
||||
$queryBuilder->expr()->eq(
|
||||
$this->slugFieldName,
|
||||
$queryBuilder->createNamedParameter('', \PDO::PARAM_STR)
|
||||
),
|
||||
$queryBuilder->expr()->isNull($this->slugFieldName)
|
||||
)
|
||||
)
|
||||
->execute()->fetchOne();
|
||||
|
||||
return $elementCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function performUpdateSlugs(): array
|
||||
{
|
||||
$databaseQueries = [];
|
||||
|
||||
/** @var Connection $connection */
|
||||
$connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($this->tableName);
|
||||
/** @var QueryBuilder $queryBuilder */
|
||||
$queryBuilder = $connection->createQueryBuilder();
|
||||
$queryBuilder->getRestrictions()->removeAll();
|
||||
$fieldConfig = $GLOBALS['TCA'][$this->tableName]['columns'][$this->slugFieldName]['config'];
|
||||
/** @var SlugHelper $slugHelper */
|
||||
$slugHelper = GeneralUtility::makeInstance(SlugHelper::class, $this->tableName, $this->slugFieldName,
|
||||
$fieldConfig);
|
||||
|
||||
$statement = $queryBuilder->select('*')
|
||||
->from($this->tableName)
|
||||
->where(
|
||||
$queryBuilder->expr()->orX(
|
||||
$queryBuilder->expr()->eq(
|
||||
$this->slugFieldName,
|
||||
$queryBuilder->createNamedParameter('', \PDO::PARAM_STR)
|
||||
),
|
||||
$queryBuilder->expr()->isNull($this->slugFieldName)
|
||||
)
|
||||
)
|
||||
->execute();
|
||||
|
||||
while ($record = $statement->fetchAssociative()) {
|
||||
//Use the core slughelper which is also used in the BE form
|
||||
$slug = $slugHelper->generate($record, $record['pid']);
|
||||
/** @var QueryBuilder $queryBuilder */
|
||||
$queryBuilder = $connection->createQueryBuilder();
|
||||
$queryBuilder->update($this->tableName)
|
||||
->where(
|
||||
$queryBuilder->expr()->eq(
|
||||
'uid',
|
||||
$queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT)
|
||||
)
|
||||
)
|
||||
->set($this->slugFieldName, $slug);
|
||||
$databaseQueries[] = $queryBuilder->getSQL();
|
||||
$queryBuilder->execute();
|
||||
}
|
||||
|
||||
return $databaseQueries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Count valid entries from EXT:realurl table tx_realurl_uniqalias which can be migrated
|
||||
* Checks also for existance of third party extension table 'tx_realurl_uniqalias'
|
||||
* EXT:realurl requires not to be installed
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function countOfRealurlAliasMigrations(): int
|
||||
{
|
||||
$elementCount = 0;
|
||||
// Check if table 'tx_realurl_uniqalias' exists
|
||||
/** @var QueryBuilder $queryBuilder */
|
||||
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getQueryBuilderForTable('tx_realurl_uniqalias');
|
||||
$schemaManager = $queryBuilder->getConnection()->getSchemaManager();
|
||||
if ($schemaManager->tablesExist(['tx_realurl_uniqalias']) === true) {
|
||||
// Count valid aliases
|
||||
$queryBuilder->getRestrictions()->removeAll();
|
||||
$elementCount = $queryBuilder->selectLiteral('COUNT(DISTINCT ' . $this->tableName . '.uid)')
|
||||
->from('tx_realurl_uniqalias')
|
||||
->join(
|
||||
'tx_realurl_uniqalias',
|
||||
$this->tableName,
|
||||
$this->tableName,
|
||||
$queryBuilder->expr()->eq(
|
||||
'tx_realurl_uniqalias.value_id',
|
||||
$queryBuilder->quoteIdentifier($this->tableName . '.uid')
|
||||
)
|
||||
)
|
||||
->where(
|
||||
$queryBuilder->expr()->andX(
|
||||
$queryBuilder->expr()->orX(
|
||||
$queryBuilder->expr()->eq(
|
||||
$this->tableName . '.' . $this->slugFieldName,
|
||||
$queryBuilder->createNamedParameter('', \PDO::PARAM_STR)
|
||||
),
|
||||
$queryBuilder->expr()->isNull($this->tableName . '.' . $this->slugFieldName)
|
||||
),
|
||||
$queryBuilder->expr()->eq(
|
||||
$this->tableName . '.sys_language_uid',
|
||||
'tx_realurl_uniqalias.lang'
|
||||
),
|
||||
$queryBuilder->expr()->eq(
|
||||
'tx_realurl_uniqalias.tablename',
|
||||
$queryBuilder->createNamedParameter($this->tableName, \PDO::PARAM_STR)
|
||||
),
|
||||
$queryBuilder->expr()->orX(
|
||||
$queryBuilder->expr()->eq(
|
||||
'tx_realurl_uniqalias.expire',
|
||||
$queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
|
||||
),
|
||||
$queryBuilder->expr()->gte(
|
||||
'tx_realurl_uniqalias.expire',
|
||||
$queryBuilder->createNamedParameter($GLOBALS['ACCESS_TIME'], \PDO::PARAM_INT)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
->execute()->fetchOne(0);
|
||||
}
|
||||
return $elementCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform migration of EXT:realurl unique alias into fs_media_gallery slugs
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function performRealurlAliasMigration(): array
|
||||
{
|
||||
$databaseQueries = [];
|
||||
|
||||
// Check if table 'tx_realurl_uniqalias' exists
|
||||
/** @var QueryBuilder $queryBuilderForRealurl */
|
||||
$queryBuilderForRealurl = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getQueryBuilderForTable('tx_realurl_uniqalias');
|
||||
$schemaManager = $queryBuilderForRealurl->getConnection()->getSchemaManager();
|
||||
if ($schemaManager->tablesExist(['tx_realurl_uniqalias']) === true) {
|
||||
/** @var Connection $connection */
|
||||
$connection = GeneralUtility::makeInstance(ConnectionPool::class)
|
||||
->getConnectionForTable($this->tableName);
|
||||
$queryBuilder = $connection->createQueryBuilder();
|
||||
|
||||
// Get entries to update
|
||||
$statement = $queryBuilder
|
||||
->selectLiteral(
|
||||
'DISTINCT ' . $this->tableName . '.uid, tx_realurl_uniqalias.value_alias, ' . $this->tableName . '.uid'
|
||||
)
|
||||
->from($this->tableName)
|
||||
->join(
|
||||
$this->tableName,
|
||||
'tx_realurl_uniqalias',
|
||||
'tx_realurl_uniqalias',
|
||||
$queryBuilder->expr()->eq(
|
||||
$this->tableName . '.uid',
|
||||
$queryBuilder->quoteIdentifier('tx_realurl_uniqalias.value_id')
|
||||
)
|
||||
)
|
||||
->where(
|
||||
$queryBuilder->expr()->andX(
|
||||
$queryBuilder->expr()->orX(
|
||||
$queryBuilder->expr()->eq(
|
||||
$this->tableName . '.' . $this->slugFieldName,
|
||||
$queryBuilder->createNamedParameter('', \PDO::PARAM_STR)
|
||||
),
|
||||
$queryBuilder->expr()->isNull($this->tableName . '.' . $this->slugFieldName)
|
||||
),
|
||||
$queryBuilder->expr()->eq(
|
||||
$this->tableName . '.sys_language_uid',
|
||||
'tx_realurl_uniqalias.lang'
|
||||
),
|
||||
$queryBuilder->expr()->eq(
|
||||
'tx_realurl_uniqalias.tablename',
|
||||
$queryBuilder->createNamedParameter($this->tableName, \PDO::PARAM_STR)
|
||||
),
|
||||
$queryBuilder->expr()->orX(
|
||||
$queryBuilder->expr()->eq(
|
||||
'tx_realurl_uniqalias.expire',
|
||||
$queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
|
||||
),
|
||||
$queryBuilder->expr()->gte(
|
||||
'tx_realurl_uniqalias.expire',
|
||||
$queryBuilder->createNamedParameter($GLOBALS['ACCESS_TIME'], \PDO::PARAM_INT)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
->execute();
|
||||
|
||||
// Update entries
|
||||
while ($record = $statement->fetchAssociative()) {
|
||||
$slug = (string)$record['value_alias'];
|
||||
$queryBuilder = $connection->createQueryBuilder();
|
||||
$queryBuilder->update($this->tableName)
|
||||
->where(
|
||||
$queryBuilder->expr()->eq(
|
||||
'uid',
|
||||
$queryBuilder->createNamedParameter($record['uid'], \PDO::PARAM_INT)
|
||||
)
|
||||
)
|
||||
->set($this->slugFieldName, $slug);
|
||||
$databaseQueries[] = $queryBuilder->getSQL();
|
||||
$queryBuilder->execute();
|
||||
}
|
||||
}
|
||||
|
||||
return $databaseQueries;
|
||||
}
|
||||
|
||||
}
|
||||
259
typo3conf/ext/fs_media_gallery/Classes/Service/Utility.php
Normal file
@@ -0,0 +1,259 @@
|
||||
<?php
|
||||
|
||||
namespace MiniFranske\FsMediaGallery\Service;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Frans Saris <franssaris@gmail.com>
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Core\Authentication\BackendUserAuthentication;
|
||||
use TYPO3\CMS\Core\SingletonInterface;
|
||||
use TYPO3\CMS\Backend\Utility\BackendUtility;
|
||||
use TYPO3\CMS\Core\Database\Connection;
|
||||
use TYPO3\CMS\Core\Database\ConnectionPool;
|
||||
use TYPO3\CMS\Core\Database\Query\Restriction\DeletedRestriction;
|
||||
use TYPO3\CMS\Core\DataHandling\DataHandler;
|
||||
use TYPO3\CMS\Core\DataHandling\SlugHelper;
|
||||
use TYPO3\CMS\Core\Resource\Folder;
|
||||
use TYPO3\CMS\Core\Resource\FolderInterface;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* Utility class
|
||||
*/
|
||||
class Utility implements SingletonInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* Get storage folders marked as media gallery
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getStorageFolders()
|
||||
{
|
||||
$pages = [];
|
||||
|
||||
if ($this->getBeUser()) {
|
||||
|
||||
$q = $this->getDatabaseConnection()->createQueryBuilder();
|
||||
|
||||
$q->getRestrictions()
|
||||
->removeAll()
|
||||
->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||||
|
||||
$quotedIdentifiers = $q->createNamedParameter(['mediagal'], Connection::PARAM_STR_ARRAY);
|
||||
|
||||
$q->select('uid', 'title')
|
||||
->from('pages')
|
||||
->where(
|
||||
$q->expr()->andX(
|
||||
$q->expr()->eq('doktype', 254),
|
||||
$q->expr()->in('module', $quotedIdentifiers)
|
||||
)
|
||||
)
|
||||
->orderBy('title');
|
||||
|
||||
$statement = $q->execute();
|
||||
while ($row = $statement->fetchAssociative()) {
|
||||
if (BackendUtility::readPageAccess($row['uid'], $this->getBeUser()->getPagePermsClause(1))) {
|
||||
$pages[$row['uid']] = $row['title'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $pages;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear pageCache defined at the storage of the collection/album
|
||||
*
|
||||
* @param FolderInterface $folder
|
||||
*/
|
||||
public function clearMediaGalleryPageCache(FolderInterface $folder)
|
||||
{
|
||||
$collections = $this->findFileCollectionRecordsForFolder(
|
||||
$folder->getStorage()->getUid(),
|
||||
$folder->getIdentifier(),
|
||||
array_keys($this->getStorageFolders())
|
||||
);
|
||||
|
||||
if (!$collections) {
|
||||
return;
|
||||
}
|
||||
|
||||
/** @var DataHandler $tce */
|
||||
$tce = GeneralUtility::makeInstance(DataHandler::class);
|
||||
$tce->start([], []);
|
||||
|
||||
foreach ($collections as $collection) {
|
||||
$pageConfig = BackendUtility::getPagesTSconfig($collection['pid']);
|
||||
if (!empty($pageConfig['TCEMAIN.']['clearCacheCmd'])) {
|
||||
$clearCacheCommands = GeneralUtility::trimExplode(',', $pageConfig['TCEMAIN.']['clearCacheCmd'], true);
|
||||
$clearCacheCommands = array_unique($clearCacheCommands);
|
||||
foreach ($clearCacheCommands as $clearCacheCommand) {
|
||||
$tce->clear_cacheCmd($clearCacheCommand);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the first parentCollections of the given folder and mediaFolderUid(storagepid)
|
||||
*/
|
||||
public function getFirstParentCollections(Folder $folder, int $mediaFolderUid): array
|
||||
{
|
||||
$parentCollection = [];
|
||||
$evalPermissions = $folder->getStorage()->getEvaluatePermissions();
|
||||
$folder->getStorage()->setEvaluatePermissions(false);
|
||||
|
||||
// If not root folder (for root folder parent === folder)
|
||||
if ($folder->getParentFolder()->getIdentifier() !== $folder->getIdentifier()) {
|
||||
$parentCollection = $this->findFileCollectionRecordsForFolder(
|
||||
$folder->getStorage()->getUid(),
|
||||
$folder->getParentFolder()->getIdentifier(),
|
||||
[$mediaFolderUid]
|
||||
);
|
||||
if (!count($parentCollection)) {
|
||||
$parentCollection = $this->getFirstParentCollections($folder->getParentFolder(), $mediaFolderUid);
|
||||
}
|
||||
}
|
||||
$folder->getStorage()->setEvaluatePermissions($evalPermissions);
|
||||
|
||||
return $parentCollection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update file_collection record after move/rename folder
|
||||
*/
|
||||
public function updateFolderRecord(int $oldStorageUid, string $oldIdentifier, int $newStorageUid, string $newIdentifier, ?int $newParentAlbum = 0): void
|
||||
{
|
||||
$updatedData = [
|
||||
'storage' => $newStorageUid,
|
||||
'folder' => $newIdentifier
|
||||
];
|
||||
|
||||
if ($newParentAlbum !== null) {
|
||||
$updatedData['parentalbum'] = $newParentAlbum;
|
||||
}
|
||||
|
||||
$this->getDatabaseConnection()->update(
|
||||
'sys_file_collection',
|
||||
$updatedData,
|
||||
[
|
||||
'storage' => (int)$oldStorageUid,
|
||||
'folder' => $oldIdentifier,
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete file_collection when folder is deleted
|
||||
*
|
||||
* @param int $storageUid
|
||||
* @param string $identifier
|
||||
*/
|
||||
public function deleteFolderRecord($storageUid, $identifier)
|
||||
{
|
||||
$this->getDatabaseConnection()->update(
|
||||
'sys_file_collection',
|
||||
['deleted' => 1],
|
||||
['folder' => $identifier, 'storage' => $storageUid]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a folderRecord (sys_file_collection)
|
||||
*
|
||||
* @param string $title The title of the folder(album_name)
|
||||
* @param int $collectionStoragePid The pid of the collection/mediaStorage
|
||||
* @param int $storageUid The uid of the storage (fileStorage)
|
||||
* @param string $identifier The identifier of the folder
|
||||
* @param int $parentAlbum The uid of the parentAlbum
|
||||
*/
|
||||
public function createFolderRecord($title, $collectionStoragePid, $storageUid, $identifier, $parentAlbum = 0)
|
||||
{
|
||||
$folderRecord = [
|
||||
'pid' => (int)$collectionStoragePid,
|
||||
'deleted' => 0,
|
||||
'hidden' => 0,
|
||||
'type' => 'folder',
|
||||
'storage' => (int)$storageUid,
|
||||
'folder' => $identifier,
|
||||
'title' => $title,
|
||||
'parentalbum' => (int)$parentAlbum,
|
||||
'webdescription' => '',
|
||||
];
|
||||
|
||||
// Create slug
|
||||
$slugTCAConfig = $GLOBALS['TCA']['sys_file_collection']['columns']['slug']['config'];
|
||||
/** @var SlugHelper $slugHelper */
|
||||
$slugHelper = GeneralUtility::makeInstance(
|
||||
SlugHelper::class,
|
||||
'sys_file_collection',
|
||||
'slug',
|
||||
$slugTCAConfig
|
||||
);
|
||||
$slug = $slugHelper->generate($folderRecord, $collectionStoragePid);
|
||||
$folderRecord['slug'] = $slug;
|
||||
|
||||
$this->getDatabaseConnection()->insert('sys_file_collection', $folderRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null|int[] $pids
|
||||
*/
|
||||
public function findFileCollectionRecordsForFolder(int $storageUid, string $folder, ?array $pids = null): ?array
|
||||
{
|
||||
$q = $this->getDatabaseConnection()->createQueryBuilder();
|
||||
|
||||
$q->getRestrictions()
|
||||
->removeAll()
|
||||
->add(GeneralUtility::makeInstance(DeletedRestriction::class));
|
||||
|
||||
$q->select('uid', 'pid', 'title', 'type', 'hidden', 'parentalbum')
|
||||
->from('sys_file_collection')
|
||||
->where(
|
||||
$q->expr()->andX(
|
||||
$q->expr()->eq('storage', $q->createNamedParameter($storageUid, \PDO::PARAM_INT)),
|
||||
$q->expr()->eq('folder', $q->createNamedParameter($folder))
|
||||
)
|
||||
);
|
||||
|
||||
if (is_array($pids) && count($pids) > 0) {
|
||||
$q->andWhere(
|
||||
$q->expr()->in('pid', $pids)
|
||||
);
|
||||
}
|
||||
|
||||
return $q->execute()->fetchAllAssociative();
|
||||
}
|
||||
|
||||
protected function getDatabaseConnection(string $table = 'sys_file_collection'): Connection
|
||||
{
|
||||
return GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($table);
|
||||
}
|
||||
|
||||
protected function getBeUser(): ?BackendUserAuthentication
|
||||
{
|
||||
return $GLOBALS['BE_USER'] ?? null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace MiniFranske\FsMediaGallery\Updates;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use MiniFranske\FsMediaGallery\Service\SlugService;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Install\Updates\AbstractUpdate;
|
||||
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
|
||||
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
|
||||
|
||||
/**
|
||||
* Migrate EXT:realurl unique alias into album slugs
|
||||
*
|
||||
* If a lot of similar titles are used it might be a good a idea
|
||||
* to migrate the unique aliases from realurl to be sure that the same alias is used
|
||||
*
|
||||
* Requires existence of DB table tx_realurl_uniqalias, but EXT:realurl requires not to be installed
|
||||
* Will only appear if missing slugs found between realurl and fs_media_gallery, respecting language and expire date from realurl
|
||||
* Converts title into slug
|
||||
*/
|
||||
class PopulateMedialAlbumsSlug implements UpgradeWizardInterface
|
||||
{
|
||||
|
||||
/** @var SlugService */
|
||||
protected $slugService;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->slugService = GeneralUtility::makeInstance(SlugService::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle(): string
|
||||
{
|
||||
return 'Fill empty field "slug" of EXT:fs_media_gallery records';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
*
|
||||
* @return string Longer description of this updater
|
||||
*/
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Fill empty field "slug" of EXT:fs_media_gallery records';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string Unique identifier of this updater
|
||||
*/
|
||||
public function getIdentifier(): string
|
||||
{
|
||||
return 'populateMedialAlbumsSlug';
|
||||
}
|
||||
|
||||
public function getPrerequisites(): array
|
||||
{
|
||||
return [
|
||||
DatabaseUpdatedPrerequisite::class,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an update is needed
|
||||
*
|
||||
* @return bool Whether an update is needed (TRUE) or not (FALSE)
|
||||
*/
|
||||
public function updateNecessary(): bool
|
||||
{
|
||||
if (!$this->slugService->typo3SupportsSlugs()) {
|
||||
return false;
|
||||
}
|
||||
$elementCount = $this->slugService->countOfSlugUpdates();
|
||||
return (bool)$elementCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the database update
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function executeUpdate(): bool
|
||||
{
|
||||
$queries = $this->slugService->performUpdateSlugs();
|
||||
if (!empty($queries)) {
|
||||
foreach ($queries as $query) {
|
||||
$databaseQueries[] = $query;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace MiniFranske\FsMediaGallery\Updates;
|
||||
|
||||
/*
|
||||
* This file is part of the TYPO3 CMS project.
|
||||
*
|
||||
* It is free software; you can redistribute it and/or modify it under
|
||||
* the terms of the GNU General Public License, either version 2
|
||||
* of the License, or any later version.
|
||||
*
|
||||
* For the full copyright and license information, please read the
|
||||
* LICENSE.txt file that was distributed with this source code.
|
||||
*
|
||||
* The TYPO3 project - inspiring people to share!
|
||||
*/
|
||||
|
||||
use MiniFranske\FsMediaGallery\Service\SlugService;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Install\Updates\AbstractUpdate;
|
||||
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
|
||||
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
|
||||
|
||||
/**
|
||||
* Migrate EXT:realurl unique alias into album slugs
|
||||
*
|
||||
* If a lot of similar titles are used it might be a good a idea
|
||||
* to migrate the unique aliases from realurl to be sure that the same alias is used
|
||||
*
|
||||
* Requires existence of DB table tx_realurl_uniqalias, but EXT:realurl requires not to be installed
|
||||
* Will only appear if missing slugs found between realurl and fs_media_gallery, respecting language and expire date from realurl
|
||||
* Converts title into slug
|
||||
*/
|
||||
class RealurlAliasMediaAlbumsSlug implements UpgradeWizardInterface
|
||||
{
|
||||
/** @var SlugService */
|
||||
protected $slugService;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->slugService = GeneralUtility::makeInstance(SlugService::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get title
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTitle(): string
|
||||
{
|
||||
return 'Migrate realurl alias to slug field "slug" of EXT:fs_media_gallery records';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get description
|
||||
*
|
||||
* @return string Longer description of this updater
|
||||
*/
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Migrates EXT:realurl unique alias values into empty slug field "slug" of EXT:fs_media_gallery records.';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string Unique identifier of this updater
|
||||
*/
|
||||
public function getIdentifier(): string
|
||||
{
|
||||
return 'realurlAliasMediaAlbumsSlug';
|
||||
}
|
||||
|
||||
public function getPrerequisites(): array
|
||||
{
|
||||
return [
|
||||
DatabaseUpdatedPrerequisite::class,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if an update is needed
|
||||
*
|
||||
* @return bool Whether an update is needed (TRUE) or not (FALSE)
|
||||
*/
|
||||
public function updateNecessary(): bool
|
||||
{
|
||||
if (!$this->slugService->typo3SupportsSlugs()) {
|
||||
return false;
|
||||
}
|
||||
$elementCount = $this->slugService->countOfRealurlAliasMigrations();
|
||||
|
||||
return (bool)$elementCount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Performs the database update
|
||||
* @return bool
|
||||
*/
|
||||
public function executeUpdate(): bool
|
||||
{
|
||||
$queries = $this->slugService->performRealurlAliasMigration();
|
||||
if (!empty($queries)) {
|
||||
foreach ($queries as $query) {
|
||||
$databaseQueries[] = $query;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
namespace MiniFranske\FsMediaGallery\Utility;
|
||||
|
||||
/* *
|
||||
* Inspired by Tx_News_Utility_TypoScript *
|
||||
* *
|
||||
* This script is part of the TYPO3 project. *
|
||||
* *
|
||||
* It is free software; you can redistribute it and/or modify it under *
|
||||
* the terms of the GNU Lesser General Public License, either version 3 *
|
||||
* of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* The TYPO3 project - inspiring people to share! *
|
||||
* */
|
||||
|
||||
use TYPO3\CMS\Core\SingletonInterface;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
|
||||
/**
|
||||
* TypoScript Utility class
|
||||
*/
|
||||
class TypoScriptUtility implements SingletonInterface
|
||||
{
|
||||
|
||||
/**
|
||||
* @param array $base
|
||||
* @param array $overload
|
||||
* @return array
|
||||
*/
|
||||
public function override(array $base, array $overload)
|
||||
{
|
||||
$validFields = GeneralUtility::trimExplode(',', $overload['settings']['overrideFlexformSettingsIfEmpty'], true);
|
||||
foreach ($validFields as $fieldName) {
|
||||
|
||||
// Multilevel field
|
||||
if (strpos($fieldName, '.') !== false) {
|
||||
$keyAsArray = explode('.', $fieldName);
|
||||
|
||||
$foundInCurrentTs = $this->getValue($base, $keyAsArray);
|
||||
|
||||
if (is_string($foundInCurrentTs) && strlen($foundInCurrentTs) === 0) {
|
||||
$foundInOriginal = $this->getValue($overload['settings'], $keyAsArray);
|
||||
if ($foundInOriginal) {
|
||||
$base = $this->setValue($base, $keyAsArray, $foundInOriginal);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// if flexform setting is empty and value is available in TS
|
||||
if ((!isset($base[$fieldName]) || (strlen($base[$fieldName]) === 0))
|
||||
&& isset($overload['settings'][$fieldName])
|
||||
) {
|
||||
$base[$fieldName] = $overload['settings'][$fieldName];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $base;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get value from array by path
|
||||
*
|
||||
* @param array $data
|
||||
* @param array $path
|
||||
* @return array|null
|
||||
*/
|
||||
protected function getValue(array $data, array $path)
|
||||
{
|
||||
$found = true;
|
||||
|
||||
for ($x = 0; ($x < count($path) && $found); $x++) {
|
||||
$key = $path[$x];
|
||||
|
||||
if (isset($data[$key])) {
|
||||
$data = $data[$key];
|
||||
} else {
|
||||
$found = false;
|
||||
}
|
||||
}
|
||||
|
||||
if ($found) {
|
||||
return $data;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set value in array by path
|
||||
*
|
||||
* @param array $array
|
||||
* @param $path
|
||||
* @param $value
|
||||
* @return array
|
||||
*/
|
||||
protected function setValue(array $array, $path, $value)
|
||||
{
|
||||
$this->setValueByReference($array, $path, $value);
|
||||
|
||||
$final = array_merge_recursive([], $array);
|
||||
return $final;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set value by reference
|
||||
*
|
||||
* @param array $array
|
||||
* @param array $path
|
||||
* @param $value
|
||||
*/
|
||||
private function setValueByReference(array &$array, array $path, $value)
|
||||
{
|
||||
while (count($path) > 1) {
|
||||
$key = array_shift($path);
|
||||
if (!isset($array[$key])) {
|
||||
$array[$key] = [];
|
||||
}
|
||||
$array = &$array[$key];
|
||||
}
|
||||
|
||||
$key = reset($path);
|
||||
$array[$key] = $value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
namespace MiniFranske\FsMediaGallery\ViewHelpers\Embed;
|
||||
|
||||
/* *
|
||||
* This script is part of the TYPO3 project. *
|
||||
* *
|
||||
* It is free software; you can redistribute it and/or modify it under *
|
||||
* the terms of the GNU Lesser General Public License, either version 3 *
|
||||
* of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* The TYPO3 project - inspiring people to share! *
|
||||
* */
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use TYPO3\CMS\Core\Http\ApplicationType;
|
||||
use TYPO3\CMS\Core\Page\PageRenderer;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface;
|
||||
|
||||
/**
|
||||
* Embed JavaScript view helper.
|
||||
*/
|
||||
class JavaScriptViewHelper extends AbstractViewHelper
|
||||
{
|
||||
|
||||
/**
|
||||
* @var \TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface
|
||||
*/
|
||||
protected $configurationManager;
|
||||
|
||||
public function injectConfigurationManager(ConfigurationManagerInterface $configurationManager): void
|
||||
{
|
||||
$this->configurationManager = $configurationManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize arguments
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
$this->registerArgument('name', 'string',
|
||||
'If empty, a combination of plugin name and the uid of the cObj is used.');
|
||||
$this->registerArgument('moveToFooter', 'boolean',
|
||||
'If TRUE, adds the script to the document footer by PageRenderer->addJsFooterInlineCode().');
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders child nodes as inline JavaScript content or adds it to page footer
|
||||
*
|
||||
* @return string The rendered script content; if moveToFooter is TRUE the script content is added by PageRenderer->addJsFooterInlineCode() and an empty string is returned
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$content = $this->renderChildren();
|
||||
|
||||
if (!is_string($content)) {
|
||||
return $content;
|
||||
}
|
||||
|
||||
if (empty($this->arguments['name'])) {
|
||||
$blockName = 'tx_fsmediagallery';
|
||||
if ($cObj = $this->configurationManager->getContentObject()) {
|
||||
$blockName .= '.' . $cObj->data['uid'];
|
||||
}
|
||||
} else {
|
||||
$blockName = (string)$this->arguments['name'];
|
||||
}
|
||||
|
||||
if (!empty($this->arguments['moveToFooter']) && $this->getApplicationType() === 'FE') {
|
||||
// add JS inline code to footer
|
||||
$this->getPageRenderer()->addJsFooterInlineCode(
|
||||
$blockName,
|
||||
$content,
|
||||
$GLOBALS['TSFE']->config['config']['compressJs']
|
||||
);
|
||||
return '';
|
||||
} else {
|
||||
$lb = "\n";
|
||||
return '<script type="text/javascript">' . $lb . '/*<![CDATA[*/' . $lb .
|
||||
'/*' . $blockName . '*/' . $lb . $content . $lb . '/*]]>*/' . $lb . '</script>';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return PageRenderer
|
||||
*/
|
||||
protected function getPageRenderer() {
|
||||
if(class_exists(\TYPO3\CMS\Core\Page\PageRenderer::class)) {
|
||||
$pageRenderer = GeneralUtility::makeInstance(PageRenderer::class);
|
||||
} elseif (method_exists($GLOBALS['TSFE'], 'getPageRenderer')) {
|
||||
$pageRenderer = $GLOBALS['TSFE']->getPageRenderer();
|
||||
} else {
|
||||
$pageRenderer = null;
|
||||
}
|
||||
return $pageRenderer;
|
||||
}
|
||||
|
||||
/**
|
||||
* String 'FE' if in FrontendApplication, 'BE' otherwise (also in CLI without request object)
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function getApplicationType(): string
|
||||
{
|
||||
if (
|
||||
($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface &&
|
||||
ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend()
|
||||
) {
|
||||
return 'FE';
|
||||
}
|
||||
|
||||
return 'BE';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
namespace MiniFranske\FsMediaGallery\ViewHelpers;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Frans Saris <franssaris@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Core\Resource\File;
|
||||
use TYPO3\CMS\Core\Resource\FileInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
|
||||
/**
|
||||
* File title viewHelper
|
||||
*/
|
||||
class FileDescriptionViewHelper extends AbstractViewHelper
|
||||
{
|
||||
|
||||
/**
|
||||
* Initialize arguments.
|
||||
*
|
||||
* @api
|
||||
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('file', File::class, 'File', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get title of a File
|
||||
*
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return string
|
||||
*/
|
||||
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
|
||||
{
|
||||
$file = $arguments['file'];
|
||||
|
||||
if (is_callable([$file, 'getOriginalResource'])) {
|
||||
// Get the original file from the Extbase model
|
||||
$file = $file->getOriginalResource();
|
||||
}
|
||||
|
||||
if (!$file instanceof FileInterface) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($file->getProperty('description')) {
|
||||
return $file->getProperty('description');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
<?php
|
||||
|
||||
namespace MiniFranske\FsMediaGallery\ViewHelpers;
|
||||
|
||||
/***************************************************************
|
||||
* Copyright notice
|
||||
*
|
||||
* (c) 2014 Frans Saris <franssaris@gmail.com>
|
||||
*
|
||||
* All rights reserved
|
||||
*
|
||||
* This script is part of the TYPO3 project. The TYPO3 project is
|
||||
* free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The GNU General Public License can be found at
|
||||
* http://www.gnu.org/copyleft/gpl.html.
|
||||
*
|
||||
* This script is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* This copyright notice MUST APPEAR in all copies of the script!
|
||||
***************************************************************/
|
||||
|
||||
use TYPO3\CMS\Core\Resource\FileInterface;
|
||||
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
|
||||
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
|
||||
|
||||
/**
|
||||
* File title viewHelper
|
||||
*/
|
||||
class FileTitleViewHelper extends AbstractViewHelper
|
||||
{
|
||||
|
||||
/**
|
||||
* Initialize arguments.
|
||||
*
|
||||
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
|
||||
*/
|
||||
public function initializeArguments()
|
||||
{
|
||||
parent::initializeArguments();
|
||||
$this->registerArgument('file', FileInterface::class, 'File', true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get title of a File
|
||||
*
|
||||
* @param array $arguments
|
||||
* @param \Closure $renderChildrenClosure
|
||||
* @param RenderingContextInterface $renderingContext
|
||||
* @return string
|
||||
*/
|
||||
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
|
||||
{
|
||||
$file = $arguments['file'];
|
||||
|
||||
if (is_callable([$file, 'getOriginalResource'])) {
|
||||
// Get the original file from the Extbase model
|
||||
$file = $file->getOriginalResource();
|
||||
}
|
||||
|
||||
if (!$file instanceof FileInterface) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($file->getProperty('title')) {
|
||||
return $file->getProperty('title');
|
||||
} else {
|
||||
return str_ireplace('_', ' ', $file->getNameWithoutExtension());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
declare(strict_types = 1);
|
||||
|
||||
return [
|
||||
\MiniFranske\FsMediaGallery\Domain\Model\MediaAlbum::class => [
|
||||
'tableName' => 'sys_file_collection',
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,670 @@
|
||||
<T3DataStructure>
|
||||
<meta>
|
||||
<langDisable>1</langDisable>
|
||||
</meta>
|
||||
<sheets>
|
||||
<general>
|
||||
<ROOT>
|
||||
<TCEforms>
|
||||
<sheetTitle>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.tabs.general</sheetTitle>
|
||||
</TCEforms>
|
||||
<type>array</type>
|
||||
<el>
|
||||
<switchableControllerActions>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.switchableControllerActions</label>
|
||||
<onChange>reload</onChange>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<itemsProcFunc>MiniFranske\FsMediaGallery\Hooks\ItemsProcFuncHook->getItemsForSwitchableControllerActions</itemsProcFunc>
|
||||
<items type="array">
|
||||
<numIndex index="0">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.switchableControllerActions.I.empty</numIndex>
|
||||
<numIndex index="1">MediaAlbum->index</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="1">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.switchableControllerActions.I.nestedList</numIndex>
|
||||
<numIndex index="1">MediaAlbum->nestedList;MediaAlbum->showAsset</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.switchableControllerActions.I.flatList</numIndex>
|
||||
<numIndex index="1">MediaAlbum->flatList;MediaAlbum->showAlbum;MediaAlbum->showAsset</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="3">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.switchableControllerActions.I.showAlbumByConfig</numIndex>
|
||||
<numIndex index="1">MediaAlbum->showAlbumByConfig;MediaAlbum->showAsset</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="4">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.switchableControllerActions.I.showAlbumByParam</numIndex>
|
||||
<numIndex index="1">MediaAlbum->showAlbum;MediaAlbum->showAsset</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="5">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.switchableControllerActions.I.randomAsset</numIndex>
|
||||
<numIndex index="1">MediaAlbum->randomAsset</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
<default>MediaAlbum->index</default>
|
||||
<size>1</size>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</switchableControllerActions>
|
||||
<settings.mediaAlbumsUids>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.mediaAlbumsUids</label>
|
||||
<displayCond>FIELD:switchableControllerActions:IN:MediaAlbum->nestedList;MediaAlbum->showAsset,MediaAlbum->randomAsset</displayCond>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectTree</renderType>
|
||||
<treeConfig>
|
||||
<parentField>parentalbum</parentField>
|
||||
<appearance>
|
||||
<showHeader>TRUE</showHeader>
|
||||
<width>650</width>
|
||||
</appearance>
|
||||
</treeConfig>
|
||||
<internal_type>db</internal_type>
|
||||
<size>5</size>
|
||||
<autoSizeMax>20</autoSizeMax>
|
||||
<maxitems>1000</maxitems>
|
||||
<minitems>0</minitems>
|
||||
<!-- itemsProcFunc>MiniFranske\FsMediaGallery\Controller\MediaAlbumController->flexformOptions</itemsProcFunc -->
|
||||
<foreign_table>sys_file_collection</foreign_table>
|
||||
<foreign_table_where>AND sys_file_collection.hidden = 0 AND (sys_file_collection.sys_language_uid = 0 OR sys_file_collection.l10n_parent = 0) ORDER BY sys_file_collection.sorting ASC, sys_file_collection.crdate DESC</foreign_table_where>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.mediaAlbumsUids>
|
||||
<settings.useAlbumFilterAsExclude>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.useAlbumFilterAsExclude</label>
|
||||
<displayCond>FIELD:switchableControllerActions:IN:MediaAlbum->nestedList;MediaAlbum->showAsset,MediaAlbum->randomAsset</displayCond>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<items type="array">
|
||||
<numIndex index="0" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="1">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.useAlbumFilterAsExclude.I.0</numIndex>
|
||||
<numIndex index="1">0</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.useAlbumFilterAsExclude.I.1</numIndex>
|
||||
<numIndex index="1">1</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
<size>1</size>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.useAlbumFilterAsExclude>
|
||||
<!-- single album selection -->
|
||||
<settings.mediaAlbum>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.mediaAlbum</label>
|
||||
<displayCond>FIELD:switchableControllerActions:IN:MediaAlbum->showAlbum;MediaAlbum->showAsset,MediaAlbum->showAlbumByConfig;MediaAlbum->showAsset</displayCond>
|
||||
<config>
|
||||
<type>group</type>
|
||||
<internal_type>db</internal_type>
|
||||
<allowed>sys_file_collection</allowed>
|
||||
<size>1</size>
|
||||
<maxitems>1</maxitems>
|
||||
<minitems>0</minitems>
|
||||
<show_thumbs>1</show_thumbs>
|
||||
<wizards>
|
||||
<suggest>
|
||||
<type>suggest</type>
|
||||
</suggest>
|
||||
</wizards>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.mediaAlbum>
|
||||
<settings.list.orderBy>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.list.orderBy</label>
|
||||
<displayCond>FIELD:switchableControllerActions:IN:MediaAlbum->nestedList;MediaAlbum->showAsset,MediaAlbum->flatList;MediaAlbum->showAlbum;MediaAlbum->showAsset</displayCond>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<itemsProcFunc>MiniFranske\FsMediaGallery\Hooks\ItemsProcFuncHook->getItemsForListOrderBy</itemsProcFunc>
|
||||
<items>
|
||||
<numIndex index="0" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="1">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.list.orderBy.I.datetime</numIndex>
|
||||
<numIndex index="1">datetime</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.list.orderBy.I.crdate</numIndex>
|
||||
<numIndex index="1">crdate</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="3">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.list.orderBy.I.sorting</numIndex>
|
||||
<numIndex index="1">sorting</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.list.orderBy>
|
||||
<settings.list.orderDirection>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.list.orderDirection</label>
|
||||
<displayCond>FIELD:switchableControllerActions:IN:MediaAlbum->nestedList;MediaAlbum->showAsset,MediaAlbum->flatList;MediaAlbum->showAlbum;MediaAlbum->showAsset</displayCond>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<items>
|
||||
<numIndex index="0" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="1">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.list.orderDirection.I.asc</numIndex>
|
||||
<numIndex index="1">asc</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.list.orderDirection.I.desc</numIndex>
|
||||
<numIndex index="1">desc</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.list.orderDirection>
|
||||
<!-- startingpoint -->
|
||||
<settings.startingpoint>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.startingpoint</label>
|
||||
<config>
|
||||
<type>group</type>
|
||||
<internal_type>db</internal_type>
|
||||
<allowed>pages</allowed>
|
||||
<size>3</size>
|
||||
<maxitems>50</maxitems>
|
||||
<minitems>0</minitems>
|
||||
<show_thumbs>1</show_thumbs>
|
||||
<wizards>
|
||||
<suggest>
|
||||
<type>suggest</type>
|
||||
</suggest>
|
||||
</wizards>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.startingpoint>
|
||||
<!-- recursive -->
|
||||
<settings.recursive>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.recursive</label>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<items type="array">
|
||||
<numIndex index="1" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2" type="array">
|
||||
<numIndex index="0">LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:recursive.I.0</numIndex>
|
||||
<numIndex index="1">0</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="3" type="array">
|
||||
<numIndex index="0">LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:recursive.I.1</numIndex>
|
||||
<numIndex index="1">1</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="4" type="array">
|
||||
<numIndex index="0">LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:recursive.I.2</numIndex>
|
||||
<numIndex index="1">2</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="5" type="array">
|
||||
<numIndex index="0">LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:recursive.I.3</numIndex>
|
||||
<numIndex index="1">3</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="6" type="array">
|
||||
<numIndex index="0">LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:recursive.I.4</numIndex>
|
||||
<numIndex index="1">4</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="7" type="array">
|
||||
<numIndex index="0">LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:recursive.I.5</numIndex>
|
||||
<numIndex index="1">250</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.recursive>
|
||||
</el>
|
||||
</ROOT>
|
||||
</general>
|
||||
<list>
|
||||
<ROOT>
|
||||
<TCEforms>
|
||||
<sheetTitle>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.tabs.list</sheetTitle>
|
||||
<displayCond>FIELD:general.switchableControllerActions:IN:MediaAlbum->nestedList;MediaAlbum->showAsset,MediaAlbum->flatList;MediaAlbum->showAlbum;MediaAlbum->showAsset</displayCond>
|
||||
</TCEforms>
|
||||
<type>array</type>
|
||||
<el>
|
||||
<settings.list.pagination.itemsPerPage>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.list.pagination.itemsPerPage</label>
|
||||
<config>
|
||||
<type>input</type>
|
||||
<eval>null,num</eval>
|
||||
<size>2</size>
|
||||
<max>3</max>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.list.pagination.itemsPerPage>
|
||||
<settings.list.thumb.width>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.list.thumb.width</label>
|
||||
<config>
|
||||
<type>input</type>
|
||||
<eval>num</eval>
|
||||
<size>4</size>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.list.thumb.width>
|
||||
<settings.list.thumb.height>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.list.thumb.height</label>
|
||||
<config>
|
||||
<type>input</type>
|
||||
<eval>num</eval>
|
||||
<size>4</size>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.list.thumb.height>
|
||||
<settings.list.thumb.random>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.list.thumb.random</label>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<items type="array">
|
||||
<numIndex index="1" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2" type="array">
|
||||
<numIndex index="0">LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:yes</numIndex>
|
||||
<numIndex index="1">1</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="3" type="array">
|
||||
<numIndex index="0">LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:no</numIndex>
|
||||
<numIndex index="1">0</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.list.thumb.random>
|
||||
<settings.list.thumb.resizeMode>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode</label>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<items type="array">
|
||||
<numIndex index="1" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode.I.m</numIndex>
|
||||
<numIndex index="1">m</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="3" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode.I.c</numIndex>
|
||||
<numIndex index="1">c</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="4" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode.I.s</numIndex>
|
||||
<numIndex index="1">s</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.list.thumb.resizeMode>
|
||||
<settings.list.hideEmptyAlbums>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.list.hideEmptyAlbums</label>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<items type="array">
|
||||
<numIndex index="1" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2" type="array">
|
||||
<numIndex index="0">LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:yes</numIndex>
|
||||
<numIndex index="1">1</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="3" type="array">
|
||||
<numIndex index="0">LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:no</numIndex>
|
||||
<numIndex index="1">0</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.list.hideEmptyAlbums>
|
||||
</el>
|
||||
</ROOT>
|
||||
</list>
|
||||
<album>
|
||||
<ROOT>
|
||||
<TCEforms>
|
||||
<sheetTitle>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.tabs.album</sheetTitle>
|
||||
<displayCond>FIELD:general.switchableControllerActions:IN:MediaAlbum->nestedList;MediaAlbum->showAsset,MediaAlbum->flatList;MediaAlbum->showAlbum;MediaAlbum->showAsset,MediaAlbum->showAlbum;MediaAlbum->showAsset,MediaAlbum->showAlbumByConfig;MediaAlbum->showAsset</displayCond>
|
||||
</TCEforms>
|
||||
<type>array</type>
|
||||
<el>
|
||||
<settings.album.assets.orderBy>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.assets.orderBy</label>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<itemsProcFunc>MiniFranske\FsMediaGallery\Hooks\ItemsProcFuncHook->getItemsForAssetsOrderBy</itemsProcFunc>
|
||||
<items>
|
||||
<numIndex index="0" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="1">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.assets.orderBy.I.name</numIndex>
|
||||
<numIndex index="1">name</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.assets.orderBy.I.crdate</numIndex>
|
||||
<numIndex index="1">crdate</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="3">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.assets.orderBy.I.title</numIndex>
|
||||
<numIndex index="1">title</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="4">
|
||||
<numIndex index="0">LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.content_creation_date</numIndex>
|
||||
<numIndex index="1">content_creation_date</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="5">
|
||||
<numIndex index="0">LLL:EXT:filemetadata/Resources/Private/Language/locallang_tca.xlf:sys_file_metadata.content_modification_date</numIndex>
|
||||
<numIndex index="1">content_modification_date</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.album.assets.orderBy>
|
||||
<settings.album.assets.orderDirection>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.assets.orderDirection</label>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<items>
|
||||
<numIndex index="0" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="1">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.assets.orderDirection.I.asc</numIndex>
|
||||
<numIndex index="1">asc</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.assets.orderDirection.I.desc</numIndex>
|
||||
<numIndex index="1">desc</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.album.assets.orderDirection>
|
||||
<settings.album.pagination.itemsPerPage>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.album.pagination.itemsPerPage</label>
|
||||
<config>
|
||||
<type>input</type>
|
||||
<eval>null,num</eval>
|
||||
<size>2</size>
|
||||
<max>3</max>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.album.pagination.itemsPerPage>
|
||||
<settings.album.thumb.width>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.album.thumb.width</label>
|
||||
<config>
|
||||
<type>input</type>
|
||||
<eval>num</eval>
|
||||
<size>4</size>
|
||||
<max>4</max>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.album.thumb.width>
|
||||
<settings.album.thumb.height>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.album.thumb.height</label>
|
||||
<config>
|
||||
<type>input</type>
|
||||
<eval>num</eval>
|
||||
<size>4</size>
|
||||
<max>4</max>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.album.thumb.height>
|
||||
<settings.album.thumb.resizeMode>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode</label>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<items type="array">
|
||||
<numIndex index="1" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode.I.m</numIndex>
|
||||
<numIndex index="1">m</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="3" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode.I.c</numIndex>
|
||||
<numIndex index="1">c</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="4" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode.I.s</numIndex>
|
||||
<numIndex index="1">s</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.album.thumb.resizeMode>
|
||||
<settings.album.lightbox.enable>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.album.lightbox.enable</label>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<items type="array">
|
||||
<numIndex index="1" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2" type="array">
|
||||
<numIndex index="0">LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:yes</numIndex>
|
||||
<numIndex index="1">1</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="3" type="array">
|
||||
<numIndex index="0">LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:no</numIndex>
|
||||
<numIndex index="1">0</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.album.lightbox.enable>
|
||||
<settings.album.displayTitle>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.album.displayTitle</label>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<items type="array">
|
||||
<numIndex index="1" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2" type="array">
|
||||
<numIndex index="0">LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:yes</numIndex>
|
||||
<numIndex index="1">1</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="3" type="array">
|
||||
<numIndex index="0">LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:no</numIndex>
|
||||
<numIndex index="1">0</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.album.displayTitle>
|
||||
</el>
|
||||
</ROOT>
|
||||
</album>
|
||||
<detail>
|
||||
<ROOT>
|
||||
<TCEforms>
|
||||
<sheetTitle>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.tabs.detail</sheetTitle>
|
||||
<displayCond>FIELD:general.switchableControllerActions:IN:MediaAlbum->nestedList;MediaAlbum->showAsset,MediaAlbum->flatList;MediaAlbum->showAlbum;MediaAlbum->showAsset,MediaAlbum->showAlbum;MediaAlbum->showAsset,MediaAlbum->showAlbumByConfig;MediaAlbum->showAsset</displayCond>
|
||||
</TCEforms>
|
||||
<type>array</type>
|
||||
<el>
|
||||
<settings.detail.asset.width>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.detail.asset.width</label>
|
||||
<config>
|
||||
<type>input</type>
|
||||
<eval>num</eval>
|
||||
<size>4</size>
|
||||
<max>4</max>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.detail.asset.width>
|
||||
<settings.detail.asset.height>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.detail.asset.height</label>
|
||||
<config>
|
||||
<type>input</type>
|
||||
<eval>num</eval>
|
||||
<size>4</size>
|
||||
<max>4</max>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.detail.asset.height>
|
||||
<settings.detail.asset.resizeMode>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode</label>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<items type="array">
|
||||
<numIndex index="1" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode.I.m</numIndex>
|
||||
<numIndex index="1">m</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="3" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode.I.c</numIndex>
|
||||
<numIndex index="1">c</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="4" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode.I.s</numIndex>
|
||||
<numIndex index="1">s</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.detail.asset.resizeMode>
|
||||
</el>
|
||||
</ROOT>
|
||||
</detail>
|
||||
<random>
|
||||
<ROOT>
|
||||
<TCEforms>
|
||||
<sheetTitle>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.tabs.random</sheetTitle>
|
||||
<displayCond>FIELD:general.switchableControllerActions:IN:MediaAlbum->randomAsset</displayCond>
|
||||
</TCEforms>
|
||||
<type>array</type>
|
||||
<el>
|
||||
<settings.random.targetPid>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.random.targetPid</label>
|
||||
<config>
|
||||
<type>group</type>
|
||||
<internal_type>db</internal_type>
|
||||
<allowed>pages</allowed>
|
||||
<size>1</size>
|
||||
<maxitems>1</maxitems>
|
||||
<minitems>0</minitems>
|
||||
<show_thumbs>1</show_thumbs>
|
||||
<wizards>
|
||||
<suggest>
|
||||
<type>suggest</type>
|
||||
</suggest>
|
||||
</wizards>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.random.targetPid>
|
||||
<settings.random.thumb.width>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.random.thumb.width</label>
|
||||
<config>
|
||||
<type>input</type>
|
||||
<eval>num</eval>
|
||||
<size>4</size>
|
||||
<max>4</max>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.random.thumb.width>
|
||||
<settings.random.thumb.height>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.mediagallery.random.thumb.height</label>
|
||||
<config>
|
||||
<type>input</type>
|
||||
<eval>num</eval>
|
||||
<size>4</size>
|
||||
<max>4</max>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.random.thumb.height>
|
||||
<settings.random.thumb.resizeMode>
|
||||
<TCEforms>
|
||||
<label>LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode</label>
|
||||
<config>
|
||||
<type>select</type>
|
||||
<renderType>selectSingle</renderType>
|
||||
<items type="array">
|
||||
<numIndex index="1" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.I.inherit</numIndex>
|
||||
<numIndex index="1"></numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="2" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode.I.m</numIndex>
|
||||
<numIndex index="1">m</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="3" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode.I.c</numIndex>
|
||||
<numIndex index="1">c</numIndex>
|
||||
</numIndex>
|
||||
<numIndex index="4" type="array">
|
||||
<numIndex index="0">LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:flexforms.general.resizeMode.I.s</numIndex>
|
||||
<numIndex index="1">s</numIndex>
|
||||
</numIndex>
|
||||
</items>
|
||||
</config>
|
||||
</TCEforms>
|
||||
</settings.random.thumb.resizeMode>
|
||||
</el>
|
||||
</ROOT>
|
||||
</random>
|
||||
</sheets>
|
||||
</T3DataStructure>
|
||||
@@ -0,0 +1,31 @@
|
||||
routeEnhancers:
|
||||
MediaGallery:
|
||||
type: Extbase
|
||||
extension: FsMediaGallery
|
||||
plugin: Mediagallery
|
||||
routes:
|
||||
- routePath: '/'
|
||||
_controller: 'MediaAlbum::nestedList'
|
||||
- routePath: '/{page}'
|
||||
_controller: 'MediaAlbum::nestedList'
|
||||
_arguments:
|
||||
page: 'currentAlbumPage'
|
||||
- routePath: '/album/{media_album}'
|
||||
_controller: 'MediaAlbum::nestedList'
|
||||
_arguments:
|
||||
media_album: mediaAlbum
|
||||
- routePath: '/album/{media_album}/{page}'
|
||||
_controller: 'MediaAlbum::nestedList'
|
||||
_arguments:
|
||||
media_album: mediaAlbum
|
||||
page: 'currentPage'
|
||||
defaultController: 'MediaAlbum::nestedList'
|
||||
aspects:
|
||||
media_album:
|
||||
type: PersistedAliasMapper
|
||||
tableName: sys_file_collection
|
||||
routeFieldName: slug
|
||||
page:
|
||||
type: StaticRangeMapper
|
||||
start: '1'
|
||||
end: '100'
|
||||
65
typo3conf/ext/fs_media_gallery/Configuration/Services.yaml
Normal file
@@ -0,0 +1,65 @@
|
||||
services:
|
||||
_defaults:
|
||||
autowire: true
|
||||
autoconfigure: true
|
||||
public: false
|
||||
|
||||
MiniFranske\FsMediaGallery\Service\Utility: ~
|
||||
|
||||
MiniFranske\FsMediaGallery\Listeners\IconFactoryListener:
|
||||
tags:
|
||||
- name: event.listener
|
||||
identifier: 'album-change'
|
||||
method: 'buildIconForResource'
|
||||
event: TYPO3\CMS\Core\Imaging\Event\ModifyIconForResourcePropertiesEvent
|
||||
|
||||
MiniFranske\FsMediaGallery\Listeners\FolderChangedListener:
|
||||
tags:
|
||||
- name: event.listener
|
||||
identifier: 'album-change'
|
||||
method: 'postFileAdd'
|
||||
event: TYPO3\CMS\Core\Resource\Event\AfterFileAddedEvent
|
||||
- name: event.listener
|
||||
identifier: 'album-change'
|
||||
method: 'postFileCopy'
|
||||
event: TYPO3\CMS\Core\Resource\Event\AfterFileCopiedEvent
|
||||
- name: event.listener
|
||||
identifier: 'album-change'
|
||||
method: 'postFileCreate'
|
||||
event: TYPO3\CMS\Core\Resource\Event\AfterFileCreatedEvent
|
||||
- name: event.listener
|
||||
identifier: 'album-change'
|
||||
method: 'postFileDelete'
|
||||
event: TYPO3\CMS\Core\Resource\Event\AfterFileDeletedEvent
|
||||
- name: event.listener
|
||||
identifier: 'album-change'
|
||||
method: 'postFileMove'
|
||||
event: TYPO3\CMS\Core\Resource\Event\AfterFileMovedEvent
|
||||
- name: event.listener
|
||||
identifier: 'album-change'
|
||||
method: 'postFileRename'
|
||||
event: TYPO3\CMS\Core\Resource\Event\AfterFileRenamedEvent
|
||||
- name: event.listener
|
||||
identifier: 'album-change'
|
||||
method: 'postFileReplace'
|
||||
event: TYPO3\CMS\Core\Resource\Event\AfterFileReplacedEvent
|
||||
- name: event.listener
|
||||
identifier: 'album-change'
|
||||
method: 'preFolderDelete'
|
||||
event: TYPO3\CMS\Core\Resource\Event\BeforeFolderDeletedEvent
|
||||
- name: event.listener
|
||||
identifier: 'album-change'
|
||||
method: 'preFolderMove'
|
||||
event: TYPO3\CMS\Core\Resource\Event\BeforeFolderMovedEvent
|
||||
- name: event.listener
|
||||
identifier: 'album-change'
|
||||
method: 'postFolderAdd'
|
||||
event: TYPO3\CMS\Core\Resource\Event\AfterFolderAddedEvent
|
||||
- name: event.listener
|
||||
identifier: 'album-change'
|
||||
method: 'postFolderDelete'
|
||||
event: TYPO3\CMS\Core\Resource\Event\AfterFolderDeletedEvent
|
||||
- name: event.listener
|
||||
identifier: 'album-change'
|
||||
method: 'postFolderMove'
|
||||
event: TYPO3\CMS\Core\Resource\Event\AfterFolderMovedEvent
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') || die();
|
||||
|
||||
|
||||
$GLOBALS['TCA']['pages']['ctrl']['typeicon_classes']['contains-mediagal'] =
|
||||
'apps-pagetree-folder-contains-mediagal';
|
||||
|
||||
// Add module icon for Folder (page-contains)
|
||||
$GLOBALS['TCA']['pages']['columns']['module']['config']['items'][] = [
|
||||
'MediaGalleries',
|
||||
'mediagal',
|
||||
'apps-pagetree-folder-contains-mediagal'
|
||||
];
|
||||
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') || die();
|
||||
|
||||
$additionalColumns = [
|
||||
'datetime' => [
|
||||
'exclude' => 1,
|
||||
'label' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:date_formlabel',
|
||||
'config' => [
|
||||
'type' => 'input',
|
||||
'size' => 12,
|
||||
'max' => 20,
|
||||
'eval' => 'datetime',
|
||||
'default' => 0,
|
||||
]
|
||||
],
|
||||
'sorting' => [
|
||||
'label' => 'sorting',
|
||||
'config' => [
|
||||
'type' => 'passthrough'
|
||||
]
|
||||
],
|
||||
'webdescription' => [
|
||||
'exclude' => 1,
|
||||
'label' => 'LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_db.xlf:tx_fsmediagallery_domain_model_mediaalbum.webdescription',
|
||||
'config' => [
|
||||
'type' => 'text',
|
||||
'cols' => 40,
|
||||
'rows' => 5,
|
||||
'eval' => 'trim',
|
||||
'enableRichtext' => true,
|
||||
'fieldControl' => [
|
||||
'fullScreenRichtext' => [
|
||||
'disabled' => false,
|
||||
],
|
||||
],
|
||||
],
|
||||
'defaultExtras' => 'richtext[]',
|
||||
],
|
||||
'parentalbum' => [
|
||||
'exclude' => 1,
|
||||
'label' => 'LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_db.xlf:tx_fsmediagallery_domain_model_mediaalbum.parentalbum',
|
||||
'config' => [
|
||||
'type' => 'select',
|
||||
'renderType' => 'selectTree',
|
||||
'foreign_table' => 'sys_file_collection',
|
||||
'foreign_table_where' => ' AND (sys_file_collection.sys_language_uid = 0 OR sys_file_collection.l10n_parent = 0) AND sys_file_collection.pid = ###CURRENT_PID### AND sys_file_collection.uid != ###THIS_UID### ORDER BY sys_file_collection.sorting ASC, sys_file_collection.crdate DESC',
|
||||
'subType' => 'db',
|
||||
'treeConfig' => [
|
||||
'parentField' => 'parentalbum',
|
||||
'appearance' => [
|
||||
'showHeader' => true,
|
||||
'maxLevels' => 99,
|
||||
'width' => 650,
|
||||
],
|
||||
],
|
||||
'size' => 10,
|
||||
'autoSizeMax' => 20,
|
||||
'minitems' => 0,
|
||||
'maxitems' => 1,
|
||||
'default' => 0,
|
||||
]
|
||||
],
|
||||
'main_asset' => [
|
||||
'exclude' => 1,
|
||||
'label' => 'LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_db.xlf:tx_fsmediagallery_domain_model_mediaalbum.main_asset',
|
||||
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
|
||||
'images',
|
||||
[
|
||||
'appearance' => [
|
||||
'createNewRelationLinkTitle' => 'LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_db.xlf:tx_fsmediagallery_domain_model_mediaalbum.main_asset.add'
|
||||
],
|
||||
'maxitems' => 1,
|
||||
],
|
||||
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
|
||||
)
|
||||
],
|
||||
'slug' => [
|
||||
'exclude' => true,
|
||||
'label' => 'LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_db.xlf:tx_fsmediagallery_domain_model_mediaalbum.slug',
|
||||
'config' => [
|
||||
'type' => 'slug',
|
||||
'generatorOptions' => [
|
||||
'fields' => ['title'],
|
||||
'fieldSeparator' => '/',
|
||||
'prefixParentPageSlug' => false,
|
||||
],
|
||||
'fallbackCharacter' => '-',
|
||||
'eval' => 'uniqueInPid',
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($GLOBALS['TCA']['sys_file_collection']['types'] as $type => $tmp) {
|
||||
$GLOBALS['TCA']['sys_file_collection']['types'][$type]['showitem'] .= ',--div--;LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_db.xlf:tx_fsmediagallery_domain_model_mediaalbum';
|
||||
// try to add field datetime before type (after title)
|
||||
if ($replacedTca = preg_replace('/(\s*)type(\s*)([;,])/', 'datetime,type$3',
|
||||
$GLOBALS['TCA']['sys_file_collection']['types'][$type]['showitem'])
|
||||
) {
|
||||
$GLOBALS['TCA']['sys_file_collection']['types'][$type]['showitem'] = $replacedTca;
|
||||
} else {
|
||||
$GLOBALS['TCA']['sys_file_collection']['types'][$type]['showitem'] .= ',datetime';
|
||||
}
|
||||
$GLOBALS['TCA']['sys_file_collection']['types'][$type]['showitem'] .= ',slug,parentalbum,main_asset,webdescription';
|
||||
}
|
||||
|
||||
// enable manual sorting
|
||||
$GLOBALS['TCA']['sys_file_collection']['ctrl']['sortby'] = 'sorting';
|
||||
$GLOBALS['TCA']['sys_file_collection']['ctrl']['default_sortby'] = 'ORDER BY sorting ASC, crdate DESC';
|
||||
|
||||
// enable main asset preview in list module
|
||||
$GLOBALS['TCA']['sys_file_collection']['ctrl']['thumbnail'] = 'main_asset';
|
||||
|
||||
|
||||
\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule(
|
||||
$GLOBALS['TCA']['sys_file_collection']['columns'],
|
||||
$additionalColumns
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') || die();
|
||||
|
||||
// Media Gellery typoscript
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
|
||||
'fs_media_gallery',
|
||||
'Configuration/TypoScript',
|
||||
'Media Gallery'
|
||||
);
|
||||
// Add Theme 'Bootstrap3'
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
|
||||
'fs_media_gallery',
|
||||
'Configuration/TypoScript/Themes/Bootstrap3',
|
||||
'Media Gallery Theme \'Bootstrap3\''
|
||||
);
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') || die();
|
||||
|
||||
\TYPO3\CMS\Extbase\Utility\ExtensionUtility::registerPlugin(
|
||||
'fs_media_gallery',
|
||||
'Mediagallery',
|
||||
'LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:mediagallery.title'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_excludelist']['fsmediagallery_mediagallery'] = 'layout,select_key,pages,recursive';
|
||||
$GLOBALS['TCA']['tt_content']['types']['list']['subtypes_addlist']['fsmediagallery_mediagallery'] = 'pi_flexform';
|
||||
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPiFlexFormValue(
|
||||
'fsmediagallery_mediagallery',
|
||||
'FILE:EXT:fs_media_gallery/Configuration/FlexForms/flexform_mediaalbum.xml'
|
||||
);
|
||||
@@ -0,0 +1,19 @@
|
||||
mod.wizards {
|
||||
newContentElement {
|
||||
wizardItems {
|
||||
plugins {
|
||||
elements {
|
||||
fsmediagallery_mediagallery {
|
||||
iconIdentifier = content-mediagallery
|
||||
title = LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:mediagallery.title
|
||||
description = LLL:EXT:fs_media_gallery/Resources/Private/Language/locallang_be.xlf:mediagallery.description
|
||||
tt_content_defValues {
|
||||
CType = list
|
||||
list_type = fsmediagallery_mediagallery
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
plugin.tx_fsmediagallery {
|
||||
view {
|
||||
templateRootPaths {
|
||||
100 = {$plugin.tx_fsmediagallery.view.templateRootPath}
|
||||
110 = EXT:fs_media_gallery/Resources/Private/Themes/Bootstrap3/Templates/
|
||||
}
|
||||
partialRootPaths {
|
||||
100 = {$plugin.tx_fsmediagallery.view.partialRootPath}
|
||||
110 = EXT:fs_media_gallery/Resources/Private/Themes/Bootstrap3/Partials/
|
||||
}
|
||||
layoutRootPaths {
|
||||
100 = {$plugin.tx_fsmediagallery.view.layoutRootPath}
|
||||
110 = EXT:fs_media_gallery/Resources/Private/Themes/Bootstrap3/Layouts/
|
||||
}
|
||||
widget {
|
||||
MiniFranske\FsMediaGallery\ViewHelpers\Widget\PaginateViewHelper {
|
||||
templateRootPath = EXT:fs_media_gallery/Resources/Private/Themes/Bootstrap3/Templates/
|
||||
}
|
||||
}
|
||||
}
|
||||
settings {
|
||||
list {
|
||||
dummyImage = EXT:fs_media_gallery/Resources/Public/Images/Blank.png
|
||||
}
|
||||
}
|
||||
}
|
||||
page.includeCSS.tx-fs-media-gallery = EXT:fs_media_gallery/Resources/Public/Css/MediaAlbum_Bootstrap3.css
|
||||
@@ -0,0 +1,24 @@
|
||||
plugin.tx_fsmediagallery {
|
||||
view {
|
||||
# cat=plugin.tx_fsmediagallery/file; type=string; label=Path to template root (FE)
|
||||
templateRootPath = EXT:fs_media_gallery/Resources/Private/Templates/
|
||||
# cat=plugin.tx_fsmediagallery/file; type=string; label=Path to template partials (FE)
|
||||
partialRootPath = EXT:fs_media_gallery/Resources/Private/Partials/
|
||||
# cat=plugin.tx_fsmediagallery/file; type=string; label=Path to template layouts (FE)
|
||||
layoutRootPath = EXT:fs_media_gallery/Resources/Private/Layouts/
|
||||
}
|
||||
persistence {
|
||||
# cat=plugin.tx_fsmediagallery//a; type=string; label=Default storage PID: Comma separated list of pages/sysfolders which hold the album records
|
||||
storagePid =
|
||||
# cat=plugin.tx_fsmediagallery//b; type=options[0 levels (only selected page)=0,1 level=1,2 levels=2,3 levels=3,4levels=4,Infinite=250]; label=Recursion level: Recursion level of the storage PID. Default: 0 levels (only selected page)
|
||||
recursive = 0
|
||||
}
|
||||
settings {
|
||||
# cat=plugin.tx_fsmediagallery//c; type=string; label=Allowed Overwrite Fields: Comma separated list of settings which are allowed to be set by TypoScript
|
||||
overrideFlexformSettingsIfEmpty = list.pagination.itemsPerPage,list.thumb.width,list.thumb.height,list.thumb.resizeMode,list.thumb.random,list.hideEmptyAlbums,list.orderBy,list.orderDirection,album.pagination.itemsPerPage,album.assets.orderBy,album.assets.orderDirection,album.thumb.width,album.thumb.height,album.thumb.resizeMode,album.lightbox.enable,album.lightbox.styleClass,album.displayTitle,album.lightbox.relPrefix,detail.asset.width,detail.asset.height,detail.asset.resizeMode,random.thumb.width,random.thumb.height,random.thumb.resizeMode
|
||||
# cat=plugin.tx_fsmediagallery//d; type=string; label=Allowed Asset MimeTypes: Comma separated list of mime types (if empty, all files are included)
|
||||
allowedAssetMimeTypes = image/jpeg, image/png, image/gif, video/youtube, video/vimeo
|
||||
# cat=plugin.tx_fsmediagallery//e; type=int; label=Target page uid for random view
|
||||
targetPid =
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
plugin.tx_fsmediagallery {
|
||||
|
||||
view {
|
||||
templateRootPaths.100 = {$plugin.tx_fsmediagallery.view.templateRootPath}
|
||||
partialRootPaths.100 = {$plugin.tx_fsmediagallery.view.partialRootPath}
|
||||
layoutRootPaths.100 = {$plugin.tx_fsmediagallery.view.layoutRootPath}
|
||||
}
|
||||
|
||||
persistence {
|
||||
# Comma separated list of pages/sysfolders which hold the album records
|
||||
storagePid = {$plugin.tx_fsmediagallery.persistence.storagePid}
|
||||
# Recursion level of the storagePid (startingpoint in flexform)
|
||||
recursive = {$plugin.tx_fsmediagallery.persistence.recursive}
|
||||
}
|
||||
|
||||
settings {
|
||||
# Comma separated list of settings which are allowed to be set by TypoScript
|
||||
overrideFlexformSettingsIfEmpty = {$plugin.tx_fsmediagallery.settings.overrideFlexformSettingsIfEmpty}
|
||||
# Comma separated list of mime types (if empty, all files are included)
|
||||
allowedAssetMimeTypes = {$plugin.tx_fsmediagallery.settings.allowedAssetMimeTypes}
|
||||
# Comma separated list of albums uids
|
||||
mediaAlbumsUids =
|
||||
# Option to exclude given album uids (settings.mediaAlbums)
|
||||
useAlbumFilterAsExclude = 0
|
||||
|
||||
# Settings for album lists (both nested and flat)
|
||||
list {
|
||||
thumb {
|
||||
width = 180
|
||||
height = 100
|
||||
# Resize assets: m=resize proportional, c=crop, ''=squeeze (unproportional exact fit)
|
||||
resizeMode = m
|
||||
#if 0, always get first image of album as thumbnail
|
||||
random = 1
|
||||
}
|
||||
hideEmptyAlbums = 1
|
||||
# Sort albums list by: datetime|crdate|sorting
|
||||
orderBy = datetime
|
||||
# Sort direction for albums list: asc|desc
|
||||
orderDirection = desc
|
||||
# skip gallery view if there is only 1 album (is currently buggy when used with realUrl autoconf)
|
||||
skipListWhenOnlyOneAlbum = 0
|
||||
# Settings for nested album list
|
||||
nested {
|
||||
}
|
||||
# Settings for flat album list
|
||||
flat {
|
||||
}
|
||||
pagination {
|
||||
itemsPerPage = 12
|
||||
insertAbove = 0
|
||||
insertBelow = 1
|
||||
pagesBefore = 4
|
||||
pagesAfter = 4
|
||||
maximumNumberOfLinks = 9
|
||||
class = GeorgRinger\NumberedPagination\NumberedPagination
|
||||
}
|
||||
}
|
||||
# Settings for album view (list of images)
|
||||
album {
|
||||
# if 0, the album title won't be displayed
|
||||
displayTitle = 1
|
||||
thumb {
|
||||
width = 120
|
||||
height = 70
|
||||
# Resize assets: m=resize proportional, c=crop, ''=squeeze (unproportional exact fit)
|
||||
resizeMode = m
|
||||
#if 0, always get first image of album as thumbnail
|
||||
random = 1
|
||||
}
|
||||
lightbox {
|
||||
enable = 1
|
||||
styleClass = lightbox
|
||||
relPrefix = albm_
|
||||
# render JS code for colorbox
|
||||
jsPlugin = colorbox
|
||||
asset {
|
||||
width = 1920
|
||||
height = 1080
|
||||
# Resize assets: m=resize proportional, c=crop, ''=squeeze (unproportional exact fit)
|
||||
resizeMode = m
|
||||
}
|
||||
}
|
||||
assets {
|
||||
orderBy =
|
||||
orderDirection = asc
|
||||
}
|
||||
pagination {
|
||||
itemsPerPage = 32
|
||||
insertAbove = 0
|
||||
insertBelow = 1
|
||||
pagesBefore = 4
|
||||
pagesAfter = 4
|
||||
maximumNumberOfLinks = 9
|
||||
class = GeorgRinger\NumberedPagination\NumberedPagination
|
||||
}
|
||||
}
|
||||
# Settings for detail view
|
||||
detail {
|
||||
asset {
|
||||
width = 1920
|
||||
height = 1080
|
||||
# Resize assets: m=resize proportional, c=crop, '' or s=squeeze (unproportional exact fit)
|
||||
resizeMode = m
|
||||
}
|
||||
lightbox {
|
||||
maxWidth = 1400
|
||||
maxHeight = 1400
|
||||
}
|
||||
}
|
||||
random {
|
||||
targetPid = {$plugin.tx_fsmediagallery.settings.targetPid}
|
||||
thumb {
|
||||
width = 250
|
||||
height = 140
|
||||
# Resize assets: m=resize proportional, c=crop, ''=squeeze (unproportional exact fit)
|
||||
resizeMode = m
|
||||
}
|
||||
}
|
||||
}
|
||||
# skip default arguments
|
||||
features.skipDefaultArguments = 0
|
||||
}
|
||||
|
||||
# Include MediaGallery default styles
|
||||
page.includeCSS.tx-fs-media-gallery = EXT:fs_media_gallery/Resources/Public/Css/MediaAlbum.css
|
||||
|
||||
26
typo3conf/ext/fs_media_gallery/Documentation/.editorconfig
Normal file
@@ -0,0 +1,26 @@
|
||||
# EditorConfig is awesome: http://EditorConfig.org
|
||||
|
||||
# Use as master:
|
||||
# https://github.com/TYPO3-Documentation/TYPO3CMS-Guide-HowToDocument/blob/master/.editorconfig
|
||||
|
||||
# top-most EditorConfig file
|
||||
root = false
|
||||
|
||||
[{*.rst,*.rst.txt}]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = space
|
||||
indent_size = 3
|
||||
max_line_length = 80
|
||||
|
||||
# MD-Files
|
||||
[*.md]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
max_line_length = 80
|
||||
@@ -0,0 +1,44 @@
|
||||
.. ==================================================
|
||||
.. FOR YOUR INFORMATION
|
||||
.. --------------------------------------------------
|
||||
.. -*- coding: utf-8 -*- with BOM.
|
||||
|
||||
.. include:: ../Includes.txt
|
||||
|
||||
|
||||
.. _changelog:
|
||||
|
||||
ChangeLog
|
||||
=========
|
||||
|
||||
All changes are documented on `https://bitbucket.org/franssaris/fs_media_gallery <https://bitbucket.org/franssaris/fs_media_gallery>`_.
|
||||
Please follow the link to know which bugs have been fixed in which version.
|
||||
|
||||
|
||||
.. _list_of_versions:
|
||||
|
||||
List of versions
|
||||
----------------
|
||||
|
||||
`3.3.0 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/3.0.0>`_
|
||||
`2.2.1 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/2.2.1>`_
|
||||
`2.2.0 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/2.2.0>`_
|
||||
`2.1.1 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/2.1.1>`_
|
||||
`2.1.0 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/2.1.0>`_
|
||||
`2.0.2 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/2.0.2>`_
|
||||
`2.0.1 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/2.0.1>`_
|
||||
`2.0.0 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/2.0.0>`_
|
||||
`1.4.8 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.4.8>`_
|
||||
`1.4.7 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.4.7>`_
|
||||
`1.4.6 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.4.6>`_
|
||||
`1.4.5 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.4.5>`_
|
||||
`1.4.4 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.4.4>`_
|
||||
`1.4.3 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.4.3>`_
|
||||
`1.4.2 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.4.2>`_
|
||||
`1.4.1 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.4.1>`_
|
||||
`1.4.0 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.4.0>`_
|
||||
`1.3.1 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.3.1>`_
|
||||
`1.3.0 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.3.0>`_
|
||||
`1.2.6 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.2.6>`_
|
||||
`1.2.3 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.2.3>`_
|
||||
`1.2.2 <https://bitbucket.org/franssaris/fs_media_gallery/commits/tag/1.2.2>`_
|
||||
@@ -0,0 +1,90 @@
|
||||
.. ==================================================
|
||||
.. FOR YOUR INFORMATION
|
||||
.. --------------------------------------------------
|
||||
.. -*- coding: utf-8 -*- with BOM.
|
||||
|
||||
.. include:: ../../Includes.txt
|
||||
|
||||
|
||||
.. _configuration-extConf:
|
||||
|
||||
Extension Manager
|
||||
=================
|
||||
|
||||
Target group: **Developers**
|
||||
|
||||
EXT:fs_media_gallery offers some basic configuration inside the Extension Manager.
|
||||
To set this configuration, switch to the Extension Manager, search for the extension
|
||||
*fs_media_gallery* and click on it to open the configuration view.
|
||||
|
||||
|
||||
.. container:: ts-properties
|
||||
|
||||
================================================================================================= ================================ ===================================================================
|
||||
Property Data type Default
|
||||
================================================================================================= ================================ ===================================================================
|
||||
:ref:`allowedActionsInFlexforms <extConf.tx_fsmedia_gallery.allowedActionsInFlexforms>` :ref:`t3tsref:data-type-list` nestedList,flatList,showAlbumByParam,showAlbumByConfig,randomAsset
|
||||
:ref:`list.orderOptions <extConf.tx_fsmedia_gallery.list.orderOptions>` :ref:`t3tsref:data-type-list` datetime,crdate,sorting
|
||||
:ref:`enableAutoCreateFileCollection <extConf.tx_fsmedia_gallery.enableAutoCreateFileCollection>` :ref:`t3tsref:data-type-boolean` true
|
||||
:ref:`clearCacheAfterFileChange <extConf.tx_fsmedia_gallery.clearCacheAfterFileChange>` :ref:`t3tsref:data-type-boolean` false
|
||||
================================================================================================= ================================ ===================================================================
|
||||
|
||||
|
||||
Property details
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. _extConf.tx_fsmedia_gallery.allowedActionsInFlexforms:
|
||||
|
||||
allowedActionsInFlexforms
|
||||
"""""""""""""""""""""""""
|
||||
|
||||
Defines plugin actions shown in flexforms so you can disable unwanted plugin modes.
|
||||
Comma separated list of controller actions which could be selected as
|
||||
":ref:`Display mode <flexforms.mediagallery.tabs.general.displayMode>`" in flexforms.
|
||||
Available actions are:
|
||||
|
||||
* nestedList
|
||||
* flatList
|
||||
* showAlbumByParam
|
||||
* showAlbumByConfig
|
||||
* randomAsset
|
||||
|
||||
If no action is defined, *all* available actions are selectable.
|
||||
|
||||
|
||||
.. _extConf.tx_fsmedia_gallery.list.orderOptions:
|
||||
|
||||
list.orderOptions
|
||||
"""""""""""""""""
|
||||
|
||||
Comma separated list of sort options for field ":ref:`Sort albums list by <flexforms.mediagallery.tabs.general.list.orderBy>`" in flexforms.
|
||||
Available actions are:
|
||||
|
||||
* datetime
|
||||
* crdate
|
||||
* sorting
|
||||
|
||||
|
||||
.. _extConf.tx_fsmedia_gallery.enableAutoCreateFileCollection:
|
||||
|
||||
enableAutoCreateFileCollection
|
||||
""""""""""""""""""""""""""""""
|
||||
|
||||
Enables auto creation of fileCollection(s)/album(s) of a folder when a new folder is created beneath an existing fileCollection/album.
|
||||
|
||||
.. _extConf.tx_fsmedia_gallery.clearCacheAfterFileChange:
|
||||
|
||||
clearCacheAfterFileChange
|
||||
"""""""""""""""""""""""""
|
||||
|
||||
Clears the cache of the album after a file change. Set on false by default due that the cache will be cleared multiple times
|
||||
if more files will be added. Make sure "`TCEMAIN.clearCacheCmd`" is set as this value is used to define what cache should be cleared.
|
||||
|
||||
For more info about possible values see `Docs » Page TSconfig » ->TCEMAIN <https://docs.typo3.org/typo3cms/TSconfigReference/PageTsconfig/TCEmain/Index.html#clearcachecmd>`_.
|
||||
|
||||
|
||||
.. figure:: ../../Images/Configuration/ExtensionManager/extension_manager.png
|
||||
:width: 716px
|
||||
:alt: General extensionmanager settings
|
||||
|
||||
**Image 1:** General extensionmanager settings
|
||||
@@ -0,0 +1,32 @@
|
||||
.. ==================================================
|
||||
.. FOR YOUR INFORMATION
|
||||
.. --------------------------------------------------
|
||||
.. -*- coding: utf-8 -*- with BOM.
|
||||
|
||||
.. include:: ../Includes.txt
|
||||
|
||||
|
||||
.. _configuration:
|
||||
|
||||
Configuration
|
||||
=============
|
||||
|
||||
Target group: **Developers**
|
||||
|
||||
Most configuration settings can be set through the flexform settings of a :ref:`plugin <configuration-plugin>`.
|
||||
As not every configuration is needed for every view, the not needed are hidden.
|
||||
Every setting can also be set using :ref:`TypoScript <configuration-typoscript>`.
|
||||
|
||||
.. important::
|
||||
|
||||
The settings of the plugin always override the ones from TypoScript.
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 5
|
||||
:titlesonly:
|
||||
:glob:
|
||||
|
||||
Plugin/Index
|
||||
Reference/Index
|
||||
ExtensionManager/Index
|
||||
@@ -0,0 +1,232 @@
|
||||
.. ==================================================
|
||||
.. FOR YOUR INFORMATION
|
||||
.. --------------------------------------------------
|
||||
.. -*- coding: utf-8 -*- with BOM.
|
||||
|
||||
.. include:: ../../Includes.txt
|
||||
|
||||
|
||||
.. _configuration-plugin:
|
||||
|
||||
Plugin Configuration
|
||||
====================
|
||||
|
||||
Target group: **Editors**, **Developers**
|
||||
|
||||
Most configuration settings can be set through the flexform settings.
|
||||
As not every configuration is needed for every view, the not needed are hidden.
|
||||
Every setting can also be set by using :ref:`TypoScript <configuration-typoscript>`.
|
||||
|
||||
.. important::
|
||||
|
||||
The settings of the plugin always override the ones from TypoScript.
|
||||
|
||||
.. todo: add docu for plugin configuration and screenshots
|
||||
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
:depth: 1
|
||||
|
||||
|
||||
.. _flexforms.mediagallery.tabs.general:
|
||||
|
||||
Tab "General"
|
||||
-------------
|
||||
|
||||
.. figure:: ../../Images/Configuration/Plugin/flexforms_mediagallery_tabs_general_nested.png
|
||||
:width: 716px
|
||||
:alt: Tab "General" of plugin in display mode "Selected albums (nested)"
|
||||
|
||||
**Image 1:** Tab "General" of plugin in display mode "Selected albums (nested)"
|
||||
|
||||
=================== ================= ================================================================================================== ===================
|
||||
Field Display Modes Description TSref
|
||||
=================== ================= ================================================================================================== ===================
|
||||
Display mode all .. _flexforms.mediagallery.tabs.general.displayMode: none
|
||||
|
||||
Sets the display mode of the Plugin.
|
||||
|
||||
* Selected albums (nested) = ``nestedList``
|
||||
* Albums list (flattened) = ``flatList``
|
||||
* Single album (URL handover enabled) = ``showAlbumByParam``
|
||||
* Single album (URL handover disabled) = ``showAlbumByConfig``
|
||||
* Random media asset = ``randomAsset``
|
||||
|
||||
You enable/disable these items via the plugin configuration in the
|
||||
:ref:`Extension Manager <configuration-extConf>`
|
||||
Media Albums nestedList, .. _flexforms.mediagallery.tabs.general.mediaAlbums: :ref:`settings.mediaAlbumsUids <plugin.tx_fsmediagallery.settings.mediaAlbumsUids>`
|
||||
randomAsset
|
||||
Album selection for ``nestedList`` and ``randomAsset`` views.
|
||||
|
||||
.. important::
|
||||
|
||||
If you want to display a nested album you have to select all of its parent albums.
|
||||
Album selection nestedList, .. _flexforms.mediagallery.tabs.general.useAlbumFilterAsExclude: :ref:`settings.useAlbumFilterAsExclude <plugin.tx_fsmediagallery.settings.useAlbumFilterAsExclude>`
|
||||
filter randomAsset
|
||||
Include or exclude selected album items
|
||||
Sort albums list by nestedList, .. _flexforms.mediagallery.tabs.general.list.orderBy: :ref:`settings.list.orderBy <plugin.tx_fsmediagallery.settings.list.orderBy>`
|
||||
flatList
|
||||
Defines how albums in list views are ordered.
|
||||
Sort direction nestedList, .. _flexforms.mediagallery.tabs.general.list.orderDirection: :ref:`settings.list.orderDirection <plugin.tx_fsmediagallery.settings.list.orderDirection>`
|
||||
for albums list flatList
|
||||
Defines the sort direction (ascending/descending) for albums list in list views.
|
||||
Startingpoint all .. _flexforms.mediagallery.tabs.general.startingpoint: :ref:`presistence.storagePid <plugin.tx_fsmediagallery.persistence.storagePid>`
|
||||
|
||||
The "Storage Folder" which holds the album records.
|
||||
Recursive all .. _flexforms.mediagallery.tabs.general.recursive: :ref:`presistence.recursive <plugin.tx_fsmediagallery.persistence.recursive>`
|
||||
|
||||
Recursion level of the :ref:`Startingpoint <flexforms.mediagallery.tabs.general.startingpoint>`.
|
||||
|
||||
=================== ================= ================================================================================================== ===================
|
||||
|
||||
|
||||
.. _flexforms.mediagallery.tabs.list:
|
||||
|
||||
Tab "Albums list"
|
||||
-----------------
|
||||
|
||||
.. figure:: ../../Images/Configuration/Plugin/flexforms_mediagallery_tabs_list.png
|
||||
:width: 716px
|
||||
:alt: Tab "Album list" of plugin"
|
||||
|
||||
**Image 2:** Tab "Album list" of plugin"
|
||||
|
||||
================================== ====================== ================================================================================================== ===================
|
||||
Field Display Modes Description TSref
|
||||
================================== ====================== ================================================================================================== ===================
|
||||
Max. thumbs to display per page nestedList, flatList .. _flexforms.mediagallery.tabs.list.itemsPerPage: :ref:`settings.list.pagination.itemsPerPage <plugin.tx_fsmediagallery.settings.list.pagination.itemsPerPage>`
|
||||
|
||||
Define how many items are shown on one page.
|
||||
Thumb width nestedList, flatList .. _flexforms.mediagallery.tabs.list.thumb.width: :ref:`settings.list.thumb.width <plugin.tx_fsmediagallery.settings.list.thumb.width>`
|
||||
|
||||
Height of thumbnail images.
|
||||
Thumb height nestedList, flatList .. _flexforms.mediagallery.tabs.list.thumb.height: :ref:`settings.list.thumb.height <plugin.tx_fsmediagallery.settings.list.thumb.height>`
|
||||
|
||||
Width of thumbnail images.
|
||||
Random thumbnail nestedList, flatList .. _flexforms.mediagallery.tabs.list.thumb.random: :ref:`settings.list.thumb.resizeMode <plugin.tx_fsmediagallery.settings.list.thumb.random>`
|
||||
|
||||
Defines if a random thumbnail or the first found should be used.
|
||||
Resize mode nestedList, flatList .. _flexforms.mediagallery.tabs.list.thumb.resizeMode: :ref:`settings.list.thumb.resizeMode <plugin.tx_fsmediagallery.settings.list.thumb.resizeMode>`
|
||||
|
||||
Defines how thumbnails in list view are scaled.
|
||||
Hide empty albums nestedList, flatList .. _flexforms.mediagallery.tabs.list.hideEmptyAlbums: :ref:`settings.list.hideEmptyAlbums <plugin.tx_fsmediagallery.settings.list.hideEmptyAlbums>`
|
||||
|
||||
Option to exclude albums without media assets from list views.
|
||||
================================== ====================== ================================================================================================== ===================
|
||||
|
||||
|
||||
.. _flexforms.mediagallery.tabs.album:
|
||||
|
||||
Tab "Album view"
|
||||
----------------
|
||||
|
||||
.. figure:: ../../Images/Configuration/Plugin/flexforms_mediagallery_tabs_album.png
|
||||
:width: 716px
|
||||
:alt: Tab "Album view" of plugin"
|
||||
|
||||
**Image 3:** Tab "Album view" of plugin"
|
||||
|
||||
|
||||
================================== ====================== ================================================================================================== ===================
|
||||
Field Display Modes Description TSref
|
||||
================================== ====================== ================================================================================================== ===================
|
||||
Sort media/files by nestedList, flatList, .. _flexforms.mediagallery.tabs.album.assets.orderBy: :ref:`settings.album.assets.orderBy <plugin.tx_fsmediagallery.settings.album.assets.orderBy>`
|
||||
showAlbumByParam,
|
||||
showAlbumByConfig Defines the sorting of the media/fiels shown in a album.
|
||||
Sort direction for media/files nestedList, flatList, .. _flexforms.mediagallery.tabs.album.assets.orderDirection: :ref:`settings.album.assets.orderDirection <plugin.tx_fsmediagallery.settings.album.assets.orderDirection>`
|
||||
showAlbumByParam,
|
||||
showAlbumByConfig Defines the sort direction (ascending/descending) of the media/files.
|
||||
Max. thumbs to display per page nestedList, flatList, .. _flexforms.mediagallery.tabs.album.itemsPerPage: :ref:`settings.album.pagination.itemsPerPage <plugin.tx_fsmediagallery.settings.album.pagination.itemsPerPage>`
|
||||
showAlbumByParam,
|
||||
showAlbumByConfig Defines how many items are shown on one album page.
|
||||
Thumb width nestedList, flatList, .. _flexforms.mediagallery.tabs.album.thumb.width: :ref:`settings.album.thumb.width <plugin.tx_fsmediagallery.settings.album.thumb.width>`
|
||||
showAlbumByParam,
|
||||
showAlbumByConfig Height of thumbnail images in album view.
|
||||
Thumb height nestedList, flatList, .. _flexforms.mediagallery.tabs.album.thumb.height: :ref:`settings.album.thumb.height <plugin.tx_fsmediagallery.settings.album.thumb.height>`
|
||||
showAlbumByParam,
|
||||
showAlbumByConfig Width of thumbnail images in album view.
|
||||
Resize mode nestedList, flatList, .. _flexforms.mediagallery.tabs.album.thumb.resizeMode: :ref:`settings.album.thumb.resizeMode <plugin.tx_fsmediagallery.settings.album.thumb.resizeMode>`
|
||||
showAlbumByParam,
|
||||
showAlbumByConfig Defines how thumbnails in album view are scaled.
|
||||
Use LightBox/Colorbox instead nestedList, flatList, .. _flexforms.mediagallery.tabs.album.lightbox.enable: :ref:`settings.album.lightbox.enable <plugin.tx_fsmediagallery.settings.album.lightbox.enable>`
|
||||
of detail view showAlbumByParam,
|
||||
showAlbumByConfig Option to do not link to detail view from album list but display media assets using a
|
||||
lightbox/colorbox.
|
||||
Display title nestedList, flatList, .. _flexforms.mediagallery.tabs.album.displayTitle: :ref:`settings.album.displayTitle <plugin.tx_fsmediagallery.settings.album.displayTitle>`
|
||||
showAlbumByParam,
|
||||
showAlbumByConfig Option to hide albums title.
|
||||
================================== ====================== ================================================================================================== ===================
|
||||
|
||||
.. _flexforms.mediagallery.tabs.detail:
|
||||
|
||||
Tab "Detail view"
|
||||
-----------------
|
||||
|
||||
.. figure:: ../../Images/Configuration/Plugin/flexforms_mediagallery_tabs_detail.png
|
||||
:width: 716px
|
||||
:alt: Tab "Detail view" of plugin"
|
||||
|
||||
**Image 4:** Tab "Detail view" of plugin"
|
||||
|
||||
================================== ====================== ================================================================================================== ===================
|
||||
Field Display Modes Description TSref
|
||||
================================== ====================== ================================================================================================== ===================
|
||||
Media width nestedList, flatList, .. _flexforms.mediagallery.tabs.detail.asset.width: :ref:`settings.detail.asset.width <plugin.tx_fsmediagallery.settings.detail.asset.width>`
|
||||
showAlbumByParam,
|
||||
showAlbumByConfig Height of media asset in detail view.
|
||||
|
||||
Media height nestedList, flatList, .. _flexforms.mediagallery.tabs.detail.asset.height: :ref:`settings.detail.asset.height <plugin.tx_fsmediagallery.settings.detail.asset.height>`
|
||||
showAlbumByParam,
|
||||
showAlbumByConfig Width of media asset in detail view.
|
||||
|
||||
Resize mode nestedList, flatList, .. _flexforms.mediagallery.tabs.detail.asset.resizeMode: :ref:`settings.detail.asset.resizeMode <plugin.tx_fsmediagallery.settings.detail.asset.resizeMode>`
|
||||
showAlbumByParam,
|
||||
showAlbumByConfig Defines how media assets in detail view are scaled.
|
||||
================================== ====================== ================================================================================================== ===================
|
||||
|
||||
.. _flexforms.mediagallery.tabs.random:
|
||||
|
||||
Tab "Random asset"
|
||||
------------------
|
||||
|
||||
.. figure:: ../../Images/Configuration/Plugin/flexforms_mediagallery_tabs_random.png
|
||||
:width: 716px
|
||||
:alt: Tab "Random view" of plugin"
|
||||
|
||||
**Image 5:** Tab "Random view" of plugin"
|
||||
|
||||
================================== ====================== ================================================================================================== ===================
|
||||
Field Display Modes Description TSref
|
||||
================================== ====================== ================================================================================================== ===================
|
||||
Album page randomAsset .. _flexforms.mediagallery.tabs.random.targetPid: :ref:`settings.random.targetPid <plugin.tx_fsmediagallery.settings.random.targetPid>`
|
||||
|
||||
Target page a random assets should link to. Select a page on which a plugin is configured to
|
||||
display the full album (:ref:`Display Mode <flexforms.mediagallery.tabs.general.displayMode>` =
|
||||
``showAlbumByParam``, ``nestedList`` or ``flatList``).
|
||||
|
||||
Thumbnail width randomAsset .. _flexforms.mediagallery.tabs.random.thumb.width: :ref:`settings.random.thumb.width <plugin.tx_fsmediagallery.settings.random.thumb.width>`
|
||||
|
||||
Height of thumbnail images of random media assets.
|
||||
|
||||
Thumbnail height randomAsset .. _flexforms.mediagallery.tabs.random.thumb.height: :ref:`settings.random.thumb.height <plugin.tx_fsmediagallery.settings.random.thumb.height>`
|
||||
|
||||
Width of thumbnail images of random media assets.
|
||||
|
||||
Resize mode randomAsset .. _flexforms.mediagallery.tabs.random.thumb.resizeMode: :ref:`settings.random.thumb.resizeMode <plugin.tx_fsmediagallery.settings.random.thumb.resizeMode>`
|
||||
|
||||
Defines how thumbnails of random media assets are scaled.
|
||||
|
||||
================================== ====================== ================================================================================================== ===================
|
||||
|
||||
|
||||
.. _flexforms.mediagallery.hide.field:
|
||||
|
||||
Hide flexform fields for editors
|
||||
--------------------------------
|
||||
|
||||
Through some UserTs and/or PageTs settings you are able to hide flexform fields for editors. ::
|
||||
|
||||
TCEFORM.tt_content.pi_flexform.fsmediagallery_mediagallery.general.settings\.useAlbumFilterAsExclude.disabled = 1
|
||||
TCEFORM.tt_content.pi_flexform.fsmediagallery_mediagallery.general.settings\.list\.orderBy.disabled = 1
|
||||
TCEFORM.tt_content.pi_flexform.fsmediagallery_mediagallery.general.settings\.list\.orderDirection.disabled = 1
|
||||
@@ -0,0 +1,795 @@
|
||||
.. ==================================================
|
||||
.. FOR YOUR INFORMATION
|
||||
.. --------------------------------------------------
|
||||
.. -*- coding: utf-8 -*- with BOM.
|
||||
|
||||
.. include:: ../../Includes.txt
|
||||
|
||||
|
||||
.. _configuration-typoscript:
|
||||
|
||||
TypoScript Reference
|
||||
====================
|
||||
|
||||
Target group: **Developers**
|
||||
|
||||
All configuration options are available in the FlexForm or TypoScript,
|
||||
with the FlexForm settings taking precedence.
|
||||
|
||||
This chapter describes the settings which are available for EXT:fs_media_gallery.
|
||||
Except of setting the template paths and overriding labels of the locallang-file,
|
||||
the settings are defined by using :typoscript:`plugin.tx_fsmediagallery.settings.<property>`.
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
:depth: 1
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.view:
|
||||
|
||||
View and template settings
|
||||
--------------------------
|
||||
|
||||
.. container:: ts-properties
|
||||
|
||||
=========================== ============================== ======================= =================================================================
|
||||
Property Data type :ref:`t3tsref:stdwrap` Default
|
||||
=========================== ============================== ======================= =================================================================
|
||||
`templateRootPaths.100`_ :ref:`t3tsref:data-type-path` no :typoscript:`{$plugin.tx_fsmediagallery.view.templateRootPath}`
|
||||
`partialRootPaths.100`_ :ref:`t3tsref:data-type-path` no :typoscript:`{$plugin.tx_fsmediagallery.view.partialRootPath}`
|
||||
`layoutRootPaths.100`_ :ref:`t3tsref:data-type-path` no :typoscript:`{$plugin.tx_fsmediagallery.view.layoutRootPath}`
|
||||
=========================== ============================== ======================= =================================================================
|
||||
|
||||
|
||||
.. tip::
|
||||
|
||||
Since TYPO3 6.2 it is possible to just override a single template file. Multiple fallbacks can be defined which makes it far easier to customize the templates.
|
||||
|
||||
EXT:fs_media_gallery uses key 100 pointing to the default paths of its fluid files.
|
||||
You can simply add overwrite paths so you only have to copy over files you want to change.
|
||||
All others can remain in the default location.
|
||||
|
||||
.. important::
|
||||
|
||||
Please notice the ending **s** in templateRootPath\ **s**\ , partialRootPath\ **s** and
|
||||
layoutRootPath\ **s**\ .
|
||||
|
||||
.. code-block:: ts
|
||||
|
||||
plugin.tx_fsmediagallery {
|
||||
view {
|
||||
templateRootPaths {
|
||||
100 = {$plugin.tx_fsmediagallery.view.templateRootPath}
|
||||
200 = fileadmin/templates/ext/tx_fsmediagallery/Templates/
|
||||
}
|
||||
partialRootPaths {
|
||||
100 = {$plugin.tx_fsmediagallery.view.partialRootPath}
|
||||
200 = fileadmin/templates/ext/tx_fsmediagallery/Partials/
|
||||
}
|
||||
layoutRootPaths {
|
||||
100 = {$plugin.tx_fsmediagallery.view.layoutRootPath}
|
||||
200 = fileadmin/templates/ext/tx_fsmediagallery/Layouts/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Property details
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. _plugin.tx_fsmediagallery.view.templateRootPaths.100:
|
||||
|
||||
templateRootPaths.100
|
||||
"""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.view.templateRootPaths.100 =` :ref:`t3tsref:data-type-path`
|
||||
|
||||
Root path for the fluid **templates** of the plugin.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.view.partialRootPaths.100:
|
||||
|
||||
partialRootPaths.100
|
||||
""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.view.partialRootPaths.100 =` :ref:`t3tsref:data-type-path`
|
||||
|
||||
Root path for the fluid **partials** of the plugin.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.view.layoutRootPaths.100:
|
||||
|
||||
layoutRootPaths.100
|
||||
"""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.view.layoutRootPaths.100 =` :ref:`t3tsref:data-type-path`
|
||||
|
||||
Root path for the fluid **layouts** of the plugin.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.persistence:
|
||||
|
||||
Extbase persistence layer
|
||||
-------------------------
|
||||
|
||||
.. container:: ts-properties
|
||||
|
||||
=========================== ================================================================== ======================= =================================================================
|
||||
Property Data type :ref:`t3tsref:stdwrap` Default
|
||||
=========================== ================================================================== ======================= =================================================================
|
||||
`persistence.storagePid`_ :ref:`t3tsref:data-type-page-id` or :ref:`t3tsref:data-type-list` no :typoscript:`{$plugin.tx_fsmediagallery.persistence.storagePid}`
|
||||
`persistence.recursive`_ :ref:`t3tsref:data-type-integer` no :typoscript:`{$plugin.tx_fsmediagallery.persistence.recursive}`
|
||||
=========================== ================================================================== ======================= =================================================================
|
||||
|
||||
|
||||
Property details
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. _plugin.tx_fsmediagallery.persistence.storagePid:
|
||||
|
||||
persistence.storagePid
|
||||
""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.persistence.storagePid =` :ref:`t3tsref:data-type-page-id` or :ref:`t3tsref:data-type-list`
|
||||
|
||||
The Storage Folder which holds the Album Records.
|
||||
Multiple foldes can be set using a comma separated list.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.persistence.recursive:
|
||||
|
||||
persistence.recursive
|
||||
"""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.persistence.recursive =` :ref:`t3tsref:data-type-integer`
|
||||
|
||||
| Recursion level of the :ref:`storagePid <plugin.tx_fsmediagallery.persistence.storagePid>` (startingpoint in flexform).
|
||||
| ``0`` = no recursion (only items from Storage Folder are used)
|
||||
| ``1`` ... ``255`` = subfolders of the Storage Folder will be used
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings:
|
||||
|
||||
General properties
|
||||
------------------
|
||||
|
||||
The following table describes general settings for the plugin.
|
||||
They are set by :typoscript:`plugin.tx_fsmediagallery.settings.<property>`
|
||||
|
||||
.. container:: ts-properties
|
||||
|
||||
==================================== ================================= ======================= ===================================================================================
|
||||
Property Data type :ref:`t3tsref:stdwrap` Default
|
||||
==================================== ================================= ======================= ===================================================================================
|
||||
`allowedAssetMimeTypes`_ :ref:`t3tsref:data-type-list` no :typoscript:`{$plugin.tx_fsmediagallery.settings.allowedAssetMimeTypes}`
|
||||
`mediaAlbumsUids`_ :ref:`t3tsref:data-type-list` no
|
||||
`overrideFlexformSettingsIfEmpty`_ :ref:`t3tsref:data-type-list` no :typoscript:`{$plugin.tx_fsmediagallery.settings.overrideFlexformSettingsIfEmpty}`
|
||||
`useAlbumFilterAsExclude`_ :ref:`t3tsref:data-type-boolean` no :code:`0`
|
||||
==================================== ================================= ======================= ===================================================================================
|
||||
|
||||
|
||||
Property details
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.overrideFlexformSettingsIfEmpty:
|
||||
|
||||
overrideFlexformSettingsIfEmpty
|
||||
"""""""""""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.overrideFlexformSettingsIfEmpty =` :ref:`t3tsref:data-type-list`
|
||||
|
||||
Comma separated list of settings which are allowed to be set by TypoScript if the flexform value is empty.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.allowedAssetMimeTypes:
|
||||
|
||||
allowedAssetMimeTypes
|
||||
"""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.allowedAssetMimeTypes =` :ref:`t3tsref:data-type-list`
|
||||
|
||||
Comma separated list of mime types (if empty, all files are included)
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.mediaAlbumsUids:
|
||||
|
||||
mediaAlbumsUids
|
||||
"""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.mediaAlbumsUids =` :ref:`t3tsref:data-type-list`
|
||||
|
||||
Album selection for ``nestedList`` and ``randomAsset`` views of the plugin (see :ref:`Display Mode <flexforms.mediagallery.tabs.general.mediaAlbums>`).
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.useAlbumFilterAsExclude:
|
||||
|
||||
useAlbumFilterAsExclude
|
||||
"""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.useAlbumFilterAsExclude =` :ref:`t3tsref:data-type-boolean`
|
||||
|
||||
| :code:`0` = Show only items defined in :ref:`settings.mediaAlbums <plugin.tx_fsmediagallery.settings.mediaAlbumsUids>`
|
||||
| :code:`1` = Exclude items defined in :ref:`settings.mediaAlbums <plugin.tx_fsmediagallery.settings.mediaAlbumsUids>`
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list:
|
||||
|
||||
Properties for list view
|
||||
------------------------
|
||||
|
||||
The following table describes the settings for the *list* view.
|
||||
They are set by :typoscript:`plugin.tx_fsmediagallery.settings.list.<property>`
|
||||
|
||||
.. container:: ts-properties
|
||||
|
||||
================================================================================================================ ============================================================== ======================= =================
|
||||
Property Data type :ref:`t3tsref:stdwrap` Default
|
||||
================================================================================================================ ============================================================== ======================= =================
|
||||
:ref:`hideEmptyAlbums <plugin.tx_fsmediagallery.settings.list.hideEmptyAlbums>` :ref:`t3tsref:data-type-boolean` no :code:`1`
|
||||
:ref:`orderBy <plugin.tx_fsmediagallery.settings.list.orderBy>` :ref:`t3tsref:data-type-string` ``[datetime|crdate|sorting]`` no :code:`datetime`
|
||||
:ref:`orderDirection <plugin.tx_fsmediagallery.settings.list.orderDirection>` :ref:`t3tsref:data-type-string` ``[asc|desc]`` no :code:`desc`
|
||||
:ref:`pagination.insertAbove <plugin.tx_fsmediagallery.settings.list.pagination.insertAbove>` :ref:`t3tsref:data-type-boolean` no :code:`0`
|
||||
:ref:`pagination.insertBelow <plugin.tx_fsmediagallery.settings.list.pagination.insertBelow>` :ref:`t3tsref:data-type-boolean` no :code:`1`
|
||||
:ref:`pagination.itemsPerPage <plugin.tx_fsmediagallery.settings.list.pagination.itemsPerPage>` :ref:`t3tsref:data-type-positive-integer` no :code:`12`
|
||||
:ref:`pagination.pagesBefore <plugin.tx_fsmediagallery.settings.list.pagination.pagesBefore>` :ref:`t3tsref:data-type-positive-integer` or ``0`` no :code:`4`
|
||||
:ref:`pagination.pagesAfter <plugin.tx_fsmediagallery.settings.list.pagination.pagesAfter>` :ref:`t3tsref:data-type-positive-integer` or ``0`` no :code:`4`
|
||||
:ref:`pagination.maximumNumberOfLinks <plugin.tx_fsmediagallery.settings.list.pagination.maximumNumberOfLinks>` :ref:`t3tsref:data-type-positive-integer` no :code:`9`
|
||||
:ref:`skipListWhenOnlyOneAlbum <plugin.tx_fsmediagallery.settings.list.skipListWhenOnlyOneAlbum>` :ref:`t3tsref:data-type-boolean` no :code:`0`
|
||||
:ref:`thumb.width <plugin.tx_fsmediagallery.settings.list.thumb.width>` :ref:`t3tsref:data-type-pixels` no :code:`180`
|
||||
:ref:`thumb.height <plugin.tx_fsmediagallery.settings.list.thumb.height>` :ref:`t3tsref:data-type-pixels` no :code:`100`
|
||||
:ref:`thumb.resizeMode <plugin.tx_fsmediagallery.settings.list.thumb.resizeMode>` :ref:`t3tsref:data-type-string` ``[m|c|s]`` no :code:`m`
|
||||
:ref:`thumb.random <plugin.tx_fsmediagallery.settings.list.thumb.random>` :ref:`t3tsref:data-type-boolean` no :code:`1`
|
||||
================================================================================================================ ============================================================== ======================= =================
|
||||
|
||||
|
||||
Property details
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.thumb.width:
|
||||
|
||||
thumb.width
|
||||
"""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.thumb.width =` :ref:`t3tsref:data-type-pixels`
|
||||
|
||||
Height of thumbnail images.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.thumb.height:
|
||||
|
||||
thumb.height
|
||||
""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.thumb.height =` :ref:`t3tsref:data-type-pixels`
|
||||
|
||||
Width of thumbnail images.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.thumb.resizeMode:
|
||||
|
||||
thumb.resizeMode
|
||||
""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.thumb.resizeMode =` :ref:`t3tsref:data-type-string` ``[m|c|s]``
|
||||
|
||||
| Defines how thumbnails in list view are scaled.
|
||||
| :code:`m` = resize proportional; the proportions will be preserved and thus width/height are treated as maximum dimensions for the image. The image will be scaled to fit into width/height rectangle.
|
||||
| :code:`c` = crop; the proportions will be preserved and the image will be scaled to fit around a rectangle with width/height dimensions. Then, a centered portion from inside of the image (size defined by width/height) will be cut out.
|
||||
| :code:`s` = squeeze (unproportional exact fit); the proportions will *not* be preserved and the image will be unproportional scaled.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.thumb.random:
|
||||
|
||||
thumb.random
|
||||
""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.thumb.random =` :ref:`t3tsref:data-type-boolean`
|
||||
|
||||
If :code:`1` (:code:`TRUE`) a random album thumbnail will be shown, else the first found.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.hideEmptyAlbums:
|
||||
|
||||
hideEmptyAlbums
|
||||
"""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.hideEmptyAlbums =` :ref:`t3tsref:data-type-boolean`
|
||||
|
||||
If :code:`1` (:code:`TRUE`) albums without media assets are excluded from list views.
|
||||
See :ref:`settings.allowedAssetMimeTypes <plugin.tx_fsmediagallery.settings.allowedAssetMimeTypes>` to set which files should be included.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.skipListWhenOnlyOneAlbum:
|
||||
|
||||
skipListWhenOnlyOneAlbum
|
||||
""""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.skipListWhenOnlyOneAlbum =` :ref:`t3tsref:data-type-boolean`
|
||||
|
||||
If :code:`1` (:code:`TRUE`) the nested album list view is skipped if only one album is to be displayed.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.orderBy:
|
||||
|
||||
orderBy
|
||||
"""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.orderBy =` :ref:`t3tsref:data-type-string` ``[datetime|crdate|sorting]``
|
||||
|
||||
| Defines how albums in list views are ordered.
|
||||
| :code:`datetime` = Given date/time
|
||||
| :code:`crdate` = Creation date/time
|
||||
| :code:`sorting` = Given sort order
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.orderDirection:
|
||||
|
||||
orderDirection
|
||||
""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.orderDirection =` :ref:`t3tsref:data-type-string` ``[asc|desc]``
|
||||
|
||||
| Defines the sort order of albums in list views.
|
||||
| :code:`asc` = Ascending (old to new/low to high)
|
||||
| :code:`desc` = Descending (new to old/high to low)
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.pagination.insertAbove:
|
||||
|
||||
pagination.insertAbove
|
||||
""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.pagination.insertAbove =` :ref:`t3tsref:data-type-boolean`
|
||||
|
||||
Set it to ``1`` (``TRUE``) or ``0`` (``FALSE``) to either show or hide the pagination before an album list.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.pagination.insertBelow:
|
||||
|
||||
pagination.insertBelow
|
||||
""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.pagination.insertBelow =` :ref:`t3tsref:data-type-boolean`
|
||||
|
||||
Set it to ``1`` (``TRUE``) or ``0`` (``FALSE``) to either show or hide the pagination after an album list.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.pagination.itemsPerPage:
|
||||
|
||||
pagination.itemsPerPage
|
||||
"""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.pagination.itemsPerPage =` :ref:`t3tsref:data-type-positive-integer`
|
||||
|
||||
Define how many items are shown on one page.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.pagination.pagesBefore:
|
||||
|
||||
pagination.pagesBefore
|
||||
""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.pagination.pagesBefore =` :ref:`t3tsref:data-type-positive-integer` or ``0``
|
||||
|
||||
Number of page links before the current page.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.pagination.pagesAfter:
|
||||
|
||||
pagination.pagesAfter
|
||||
"""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.pagination.pagesAfter =` :ref:`t3tsref:data-type-positive-integer` or ``0``
|
||||
|
||||
Number of page links after the current page.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.list.pagination.maximumNumberOfLinks:
|
||||
|
||||
pagination.maximumNumberOfLinks
|
||||
"""""""""""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.pagination.maximumNumberOfLinks =` :ref:`t3tsref:data-type-positive-integer`
|
||||
|
||||
Force this number of page browser links on the screen.
|
||||
An odd number is recommended because it looks more symmetrical.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album:
|
||||
|
||||
Properties for album view
|
||||
-------------------------
|
||||
|
||||
The following table describes the settings for the *album* view.
|
||||
They are set by :typoscript:`plugin.tx_fsmediagallery.settings.album.<property>`
|
||||
|
||||
.. container:: ts-properties
|
||||
|
||||
================================================================================================================= ========================================================= ======================= =================
|
||||
Property Data type :ref:`t3tsref:stdwrap` Default
|
||||
================================================================================================================= ========================================================= ======================= =================
|
||||
:ref:`assets.orderBy <plugin.tx_fsmediagallery.settings.album.assets.orderBy>` :ref:`t3tsref:data-type-string` ``[|name|crdate|title]`` no :code:``
|
||||
:ref:`assets.orderDirection <plugin.tx_fsmediagallery.settings.album.assets.orderDirection>` :ref:`t3tsref:data-type-string` ``[asc|desc]`` no :code:`asc`
|
||||
:ref:`lightbox.enable <plugin.tx_fsmediagallery.settings.album.lightbox.enable>` :ref:`t3tsref:data-type-boolean` no :code:`1`
|
||||
:ref:`lightbox.jsPlugin <plugin.tx_fsmediagallery.settings.album.lightbox.jsPlugin>` :ref:`t3tsref:data-type-string` no :code:`colorbox`
|
||||
:ref:`lightbox.relPrefix <plugin.tx_fsmediagallery.settings.album.lightbox.relPrefix>` :ref:`t3tsref:data-type-string` no :code:`albm_`
|
||||
:ref:`lightbox.styleClass <plugin.tx_fsmediagallery.settings.album.lightbox.styleClass>` :ref:`t3tsref:data-type-string` no :code:`lightbox`
|
||||
:ref:`lightbox.asset.width <plugin.tx_fsmediagallery.settings.album.lightbox.asset.width>` :ref:`t3tsref:data-type-pixels` no :code:`1920`
|
||||
:ref:`lightbox.asset.height <plugin.tx_fsmediagallery.settings.album.lightbox.asset.height>` :ref:`t3tsref:data-type-pixels` no :code:`1080`
|
||||
:ref:`lightbox.asset.resizeMode <plugin.tx_fsmediagallery.settings.album.lightbox.asset.resizeMode>` :ref:`t3tsref:data-type-string` ``[m|c|s]`` no :code:`m`
|
||||
:ref:`pagination.insertAbove <plugin.tx_fsmediagallery.settings.album.pagination.insertAbove>` :ref:`t3tsref:data-type-boolean` no :code:`0`
|
||||
:ref:`pagination.insertBelow <plugin.tx_fsmediagallery.settings.album.pagination.insertBelow>` :ref:`t3tsref:data-type-boolean` no :code:`1`
|
||||
:ref:`pagination.itemsPerPage <plugin.tx_fsmediagallery.settings.album.pagination.itemsPerPage>` :ref:`t3tsref:data-type-positive-integer` no :code:`32`
|
||||
:ref:`pagination.pagesBefore <plugin.tx_fsmediagallery.settings.album.pagination.pagesBefore>` :ref:`t3tsref:data-type-positive-integer` or ``0`` no :code:`4`
|
||||
:ref:`pagination.pagesAfter <plugin.tx_fsmediagallery.settings.album.pagination.pagesAfter>` :ref:`t3tsref:data-type-positive-integer` or ``0`` no :code:`4`
|
||||
:ref:`pagination.maximumNumberOfLinks <plugin.tx_fsmediagallery.settings.album.pagination.maximumNumberOfLinks>` :ref:`t3tsref:data-type-positive-integer` no :code:`9`
|
||||
:ref:`thumb.width <plugin.tx_fsmediagallery.settings.album.thumb.width>` :ref:`t3tsref:data-type-pixels` no :code:`120`
|
||||
:ref:`thumb.height <plugin.tx_fsmediagallery.settings.album.thumb.height>` :ref:`t3tsref:data-type-pixels` no :code:`70`
|
||||
:ref:`thumb.resizeMode <plugin.tx_fsmediagallery.settings.album.thumb.resizeMode>` :ref:`t3tsref:data-type-string` ``[m|c|s]`` no :code:`m`
|
||||
:ref:`displayTitle <plugin.tx_fsmediagallery.settings.album.displayTitle>` :ref:`t3tsref:data-type-boolean` no :code:`1`
|
||||
================================================================================================================= ========================================================= ======================= =================
|
||||
|
||||
|
||||
Property details
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.assets.orderBy:
|
||||
|
||||
assets.orderBy
|
||||
""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.assets.orderBy =` :ref:`t3tsref:data-type-string` ``[|name|crdate|title]``
|
||||
|
||||
| Defines the sorting of the media/fiels shown in a album.
|
||||
| :code:`` = When not set (empty) the file system ordering is used
|
||||
| :code:`name` = Name of the file
|
||||
| :code:`crdate` = Creation date/time
|
||||
| :code:`title` = Title of the file (metadata)
|
||||
| :code:`content_creation_date` = Content Creation Date (ext:filemetadata)
|
||||
| :code:`content_modification_date` = Content Modification Date (ext:filemetadata)
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.assets.orderDirection:
|
||||
|
||||
assets.orderDirection
|
||||
"""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.list.orderDirection =` :ref:`t3tsref:data-type-string` ``[asc|desc]``
|
||||
|
||||
| Defines the sort direction of the media/files.
|
||||
| :code:`asc` = Ascending (old to new/low to high)
|
||||
| :code:`desc` = Descending (new to old/high to low)
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.thumb.width:
|
||||
|
||||
thumb.width
|
||||
"""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.thumb.width =` :ref:`t3tsref:data-type-pixels`
|
||||
|
||||
Height of thumbnail images.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.thumb.height:
|
||||
|
||||
thumb.height
|
||||
""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.thumb.height =` :ref:`t3tsref:data-type-pixels`
|
||||
|
||||
Width of thumbnail images.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.thumb.resizeMode:
|
||||
|
||||
thumb.resizeMode
|
||||
""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.thumb.resizeMode =` :ref:`t3tsref:data-type-string` ``[m|c|s]``
|
||||
|
||||
| Defines how thumbnails in album view are scaled.
|
||||
| :code:`m` = resize proportional; the proportions will be preserved and thus width/height are treated as maximum dimensions for the image. The image will be scaled to fit into width/height rectangle.
|
||||
| :code:`c` = crop; the proportions will be preserved and the image will be scaled to fit around a rectangle with width/height dimensions. Then, a centered portion from inside of the image (size defined by width/height) will be cut out.
|
||||
| :code:`s` = squeeze (unproportional exact fit); the proportions will *not* be preserved and the image will be unproportional scaled.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.lightbox.enable:
|
||||
|
||||
lightbox.enable
|
||||
"""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.lightbox.enable =` :ref:`t3tsref:data-type-boolean`
|
||||
|
||||
If :code:`1`, the album view does not link to detail view but displays media assets using a lightbox/colorbox.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.lightbox.styleClass:
|
||||
|
||||
lightbox.styleClass
|
||||
"""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.lightbox.styleClass =` :ref:`t3tsref:data-type-string`
|
||||
|
||||
CSS class used for lightbox/colorbox elements.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.lightbox.relPrefix:
|
||||
|
||||
lightbox.relPrefix
|
||||
""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.lightbox.relPrefix =` :ref:`t3tsref:data-type-string`
|
||||
|
||||
| Prefix used in ``rel`` attributes of lightbox/colorbox links.
|
||||
| The default templates build ``rel`` attributes of lightbox/colorbox links like
|
||||
``<a href="..." rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" ...>...</a>``.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.lightbox.jsPlugin:
|
||||
|
||||
lightbox.jsPlugin
|
||||
"""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.lightbox.jsPlugin =` :ref:`t3tsref:data-type-string`
|
||||
|
||||
Use this setting to e.g. render different lightbox/colorbox javascript code.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.lightbox.asset.width:
|
||||
|
||||
lightbox.asset.width
|
||||
""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.lightbox.asset.width =` :ref:`t3tsref:data-type-pixels`
|
||||
|
||||
Height of media assets used by lightbox/colorbox.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.lightbox.asset.height:
|
||||
|
||||
lightbox.asset.height
|
||||
"""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.lightbox.asset.height =` :ref:`t3tsref:data-type-pixels`
|
||||
|
||||
Width of media assets used by lightbox/colorbox.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.lightbox.asset.resizeMode:
|
||||
|
||||
lightbox.asset.resizeMode
|
||||
"""""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.lightbox.asset.resizeMode =` :ref:`t3tsref:data-type-string` ``[m|c|s]``
|
||||
|
||||
| Defines how media assets used by lightbox/colorbox are scaled.
|
||||
| :code:`m` = resize proportional; the proportions will be preserved and thus width/height are treated as maximum dimensions for the image. The image will be scaled to fit into width/height rectangle.
|
||||
| :code:`c` = crop; the proportions will be preserved and the image will be scaled to fit around a rectangle with width/height dimensions. Then, a centered portion from inside of the image (size defined by width/height) will be cut out.
|
||||
| :code:`s` = squeeze (unproportional exact fit); the proportions will *not* be preserved and the image will be unproportional scaled.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.displayTitle:
|
||||
|
||||
displayTitle
|
||||
""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.displayTitle =` :ref:`t3tsref:data-type-boolean`
|
||||
|
||||
Set it to ``1`` (``TRUE``) or ``0`` (``FALSE``) to either show or hide the album title.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.pagination.insertAbove:
|
||||
|
||||
pagination.insertAbove
|
||||
""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.pagination.insertAbove =` :ref:`t3tsref:data-type-boolean`
|
||||
|
||||
Set it to ``1`` (``TRUE``) or ``0`` (``FALSE``) to either show or hide the pagination before an asset list.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.pagination.insertBelow:
|
||||
|
||||
pagination.insertBelow
|
||||
""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.pagination.insertBelow =` :ref:`t3tsref:data-type-boolean`
|
||||
|
||||
Set it to ``1`` (``TRUE``) or ``0`` (``FALSE``) to either show or hide the pagination after an asset list.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.pagination.itemsPerPage:
|
||||
|
||||
pagination.itemsPerPage
|
||||
"""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.pagination.itemsPerPage =` :ref:`t3tsref:data-type-positive-integer`
|
||||
|
||||
Define how many items are shown on one page.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.pagination.pagesBefore:
|
||||
|
||||
pagination.pagesBefore
|
||||
""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.pagination.pagesBefore =` :ref:`t3tsref:data-type-positive-integer` or ``0``
|
||||
|
||||
Number of page links before the current page.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.pagination.pagesAfter:
|
||||
|
||||
pagination.pagesAfter
|
||||
"""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.pagination.pagesAfter =` :ref:`t3tsref:data-type-positive-integer` or ``0``
|
||||
|
||||
Number of page links after the current page.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.album.pagination.maximumNumberOfLinks:
|
||||
|
||||
pagination.maximumNumberOfLinks
|
||||
"""""""""""""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.album.pagination.maximumNumberOfLinks =` :ref:`t3tsref:data-type-positive-integer`
|
||||
|
||||
Force this number of page browser links on the screen.
|
||||
An odd number is recommended because it looks more symmetrical.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.detail:
|
||||
|
||||
Properties for detail view
|
||||
--------------------------
|
||||
|
||||
The following table describes the settings for the *detail* view.
|
||||
They are set by :typoscript:`plugin.tx_fsmediagallery.settings.detail.<property>`
|
||||
|
||||
.. container:: ts-properties
|
||||
|
||||
==================================================================================== ============================================ ======================= =============
|
||||
Property Data type :ref:`t3tsref:stdwrap` Default
|
||||
==================================================================================== ============================================ ======================= =============
|
||||
:ref:`asset.width <plugin.tx_fsmediagallery.settings.detail.asset.width>` :ref:`t3tsref:data-type-pixels` no :code:`1920`
|
||||
:ref:`asset.height <plugin.tx_fsmediagallery.settings.detail.asset.height>` :ref:`t3tsref:data-type-pixels` no :code:`1080`
|
||||
:ref:`asset.resizeMode <plugin.tx_fsmediagallery.settings.detail.asset.resizeMode>` :ref:`t3tsref:data-type-string` ``[m|c|s]`` no :code:`m`
|
||||
==================================================================================== ============================================ ======================= =============
|
||||
|
||||
|
||||
Property details
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.detail.asset.width:
|
||||
|
||||
asset.width
|
||||
"""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.detail.asset.width =` :ref:`t3tsref:data-type-pixels`
|
||||
|
||||
Height of media asset in detail view.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.detail.asset.height:
|
||||
|
||||
asset.height
|
||||
""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.detail.asset.height =` :ref:`t3tsref:data-type-pixels`
|
||||
|
||||
Width of media asset in detail view.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.detail.asset.resizeMode:
|
||||
|
||||
asset.resizeMode
|
||||
""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.detail.asset.resizeMode =` :ref:`t3tsref:data-type-string` ``[m|c|s]``
|
||||
|
||||
| Defines how media assets in detail view are scaled.
|
||||
| :code:`m` = resize proportional; the proportions will be preserved and thus width/height are treated as maximum dimensions for the image. The image will be scaled to fit into width/height rectangle.
|
||||
| :code:`c` = crop; the proportions will be preserved and the image will be scaled to fit around a rectangle with width/height dimensions. Then, a centered portion from inside of the image (size defined by width/height) will be cut out.
|
||||
| :code:`s` = squeeze (unproportional exact fit); the proportions will *not* be preserved and the image will be unproportional scaled.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.random:
|
||||
|
||||
Properties for random view
|
||||
--------------------------
|
||||
|
||||
The following table describes the settings for the *random* view.
|
||||
They are set by :typoscript:`plugin.tx_fsmediagallery.settings.random.<property>`
|
||||
|
||||
.. container:: ts-properties
|
||||
|
||||
==================================================================================== ============================================ ======================= =============
|
||||
Property Data type :ref:`t3tsref:stdwrap` Default
|
||||
==================================================================================== ============================================ ======================= =============
|
||||
:ref:`targetPid <plugin.tx_fsmediagallery.settings.random.targetPid>` :ref:`t3tsref:data-type-page-id` no
|
||||
:ref:`thumb.width <plugin.tx_fsmediagallery.settings.random.thumb.width>` :ref:`t3tsref:data-type-pixels` no :code:`250`
|
||||
:ref:`thumb.height <plugin.tx_fsmediagallery.settings.random.thumb.height>` :ref:`t3tsref:data-type-pixels` no :code:`140`
|
||||
:ref:`thumb.resizeMode <plugin.tx_fsmediagallery.settings.random.thumb.resizeMode>` :ref:`t3tsref:data-type-string` ``[m|c|s]`` no :code:`m`
|
||||
==================================================================================== ============================================ ======================= =============
|
||||
|
||||
|
||||
Property details
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.random.targetPid:
|
||||
|
||||
targetPid
|
||||
"""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.random.targetPid =` :ref:`t3tsref:data-type-page-id`
|
||||
|
||||
.. todo: add a link to controller actions of plugins
|
||||
|
||||
Target page a random assets should link to.
|
||||
Select a page on which a plugin is configured to display the full album.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.random.thumb.width:
|
||||
|
||||
thumb.width
|
||||
"""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.random.thumb.width =` :ref:`t3tsref:data-type-pixels`
|
||||
|
||||
Height of thumbnail images of random media assets.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.random.thumb.height:
|
||||
|
||||
thumb.height
|
||||
""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.random.thumb.height =` :ref:`t3tsref:data-type-pixels`
|
||||
|
||||
Width of thumbnail images of random media assets.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.random.thumb.resizeMode:
|
||||
|
||||
thumb.resizeMode
|
||||
""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.random.thumb.resizeMode =` :ref:`t3tsref:data-type-string` ``[m|c|s]``
|
||||
|
||||
| Defines how thumbnails of random media assets are scaled.
|
||||
| :code:`m` = resize proportional; the proportions will be preserved and thus width/height are treated as maximum dimensions for the image. The image will be scaled to fit into width/height rectangle.
|
||||
| :code:`c` = crop; the proportions will be preserved and the image will be scaled to fit around a rectangle with width/height dimensions. Then, a centered portion from inside of the image (size defined by width/height) will be cut out.
|
||||
| :code:`s` = squeeze (unproportional exact fit); the proportions will *not* be preserved and the image will be unproportional scaled.
|
||||
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.features:
|
||||
|
||||
Other Properties
|
||||
----------------
|
||||
|
||||
They properties in the following table are set by :typoscript:`plugin.tx_fsmediagallery.settings.<property>`
|
||||
|
||||
.. container:: ts-properties
|
||||
|
||||
======================================================================================================= ================================= ======================= ===========
|
||||
Property Data type :ref:`t3tsref:stdwrap` Default
|
||||
======================================================================================================= ================================= ======================= ===========
|
||||
:ref:`features.skipDefaultArguments <plugin.tx_fsmediagallery.settings.features.skipDefaultArguments>` :ref:`t3tsref:data-type-boolean` no :code:`1`
|
||||
======================================================================================================= ================================= ======================= ===========
|
||||
|
||||
|
||||
Property details
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
.. _plugin.tx_fsmediagallery.settings.features.skipDefaultArguments:
|
||||
|
||||
skipDefaultArguments
|
||||
""""""""""""""""""""
|
||||
|
||||
:typoscript:`plugin.tx_fsmediagallery.settings.features.skipDefaultArguments =` :ref:`t3tsref:data-type-boolean`
|
||||
|
||||
Configure Extbase to skip the URI arguments for controller and action
|
||||
(see `Skip default arguments in URIs <https://forge.typo3.org/projects/typo3v4-mvc/wiki/Skip_default_arguments_in_URIs>`_
|
||||
on TYPO3 Forge).
|
||||
|
After Width: | Height: | Size: 67 KiB |
|
After Width: | Height: | Size: 47 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 81 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 125 KiB |
21
typo3conf/ext/fs_media_gallery/Documentation/Includes.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
.. ==================================================
|
||||
.. FOR YOUR INFORMATION
|
||||
.. --------------------------------------------------
|
||||
.. -*- coding: utf-8 -*- with BOM.
|
||||
|
||||
.. This is 'Includes.txt'. It is included at the very top of each and
|
||||
every ReST source file in this documentation project (= manual).
|
||||
|
||||
|
||||
.. ==================================================
|
||||
.. DEFINE SOME TEXTROLES
|
||||
.. --------------------------------------------------
|
||||
|
||||
.. role:: typoscript(code)
|
||||
|
||||
.. role:: ts(typoscript)
|
||||
:class: typoscript
|
||||
|
||||
.. role:: php(code)
|
||||
|
||||
.. highlight:: php
|
||||
62
typo3conf/ext/fs_media_gallery/Documentation/Index.rst
Normal file
@@ -0,0 +1,62 @@
|
||||
.. ==================================================
|
||||
.. FOR YOUR INFORMATION
|
||||
.. --------------------------------------------------
|
||||
.. -*- coding: utf-8 -*- with BOM.
|
||||
|
||||
.. include:: Includes.txt
|
||||
|
||||
.. _start:
|
||||
|
||||
=======================================================
|
||||
(FS) Media Gallery: A FAL based media gallery for TYPO3
|
||||
=======================================================
|
||||
|
||||
.. only:: html
|
||||
|
||||
:Classification:
|
||||
fs_media_gallery
|
||||
|
||||
:Version:
|
||||
|release|
|
||||
|
||||
:Language:
|
||||
en
|
||||
|
||||
:Description:
|
||||
Extension manual for (FS) Media Gallery (fs_media_gallery).
|
||||
|
||||
:Keywords:
|
||||
fs_media_gallery, media gallery, media album, fal, file abstraction layer
|
||||
|
||||
:Copyright:
|
||||
2013-2021
|
||||
|
||||
:Author:
|
||||
Frans Saris
|
||||
|
||||
:Email:
|
||||
franssaris@gmail.com
|
||||
|
||||
:License:
|
||||
This document is published under the Open Content License
|
||||
available from http://www.opencontent.org/opl.shtml
|
||||
|
||||
:Rendered:
|
||||
|today|
|
||||
|
||||
The content of this document is related to TYPO3,
|
||||
a GNU/GPL CMS/Framework available from `www.typo3.org <http://www.typo3.org/>`_.
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 5
|
||||
:titlesonly:
|
||||
:glob:
|
||||
|
||||
Introduction/Index
|
||||
UsersManual/Index
|
||||
Installation/Index
|
||||
Configuration/Index
|
||||
Support/Index
|
||||
Changelog/Index
|
||||
@@ -0,0 +1,44 @@
|
||||
.. ==================================================
|
||||
.. FOR YOUR INFORMATION
|
||||
.. --------------------------------------------------
|
||||
.. -*- coding: utf-8 -*- with BOM.
|
||||
|
||||
.. include:: ../Includes.txt
|
||||
|
||||
|
||||
.. _administration:
|
||||
|
||||
Installation/updating
|
||||
=====================
|
||||
|
||||
Target group: **Administrators**
|
||||
|
||||
|
||||
.. _read_before_installing_or_updating:
|
||||
|
||||
Read before installing or updating!
|
||||
-----------------------------------
|
||||
|
||||
Before installing this extension or updating to a new major release, you should **always**
|
||||
read the sections "Upgrade procedure" and "Important changes" in the :ref:`ChangeLog <changelog>`.
|
||||
|
||||
|
||||
.. _installation:
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
To install the extension, perform the following steps:
|
||||
|
||||
#. Go to the Extension Manager
|
||||
#. Install the extension
|
||||
#. Include the static template :ref:`*Media Gallery (fs_media_gallery)* <users_manual>`
|
||||
|
||||
To use the latest version from the `code repository <https://bitbucket.org/franssaris/fs_media_gallery>`_ install the extension from command line:
|
||||
|
||||
.. code:: bash
|
||||
|
||||
cd /your/path/to/typo3root/
|
||||
git clone git@bitbucket.org:franssaris/fs_media_gallery.git --single-branch --branch master --depth 1 typo3conf/ext/fs_media_gallery
|
||||
./typo3/cli_dispatch.phpsh extbase extension:install fs_media_gallery
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
.. ==================================================
|
||||
.. FOR YOUR INFORMATION
|
||||
.. --------------------------------------------------
|
||||
.. -*- coding: utf-8 -*- with BOM.
|
||||
|
||||
.. include:: ../Includes.txt
|
||||
|
||||
|
||||
.. _introduction:
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
|
||||
.. _what-does-it-do:
|
||||
|
||||
What does it do?
|
||||
----------------
|
||||
|
||||
(FS) Media Gallery is a FAL based media gallery for TYPO3.
|
||||
It allows you to display your media assets from your local or remote storage as media albums.
|
||||
|
||||
Features
|
||||
--------
|
||||
|
||||
* Easy to use for editors through TYPO3's Mass Uploader
|
||||
* Quickly turns your FAL file collections into media albums
|
||||
* Based on Extbase and Fluid and therefore very easy to style
|
||||
* Comes with a basic automatic RealURL configuration
|
||||
* Supports LightBox/Colorbox (For a LightBox example use this extension in combi with `EXT:bootstrap_package <https://extensions.typo3.org/extension/bootstrap_package/>`_)
|
||||
* Fully configurable by TypoScript
|
||||
* Media Assets (images) can be protected with `EXT:fal_secure_download <http://typo3.org/extensions/repository/view/fal_securedownload>`_ or `EXT:naw_securedl <http://typo3.org/extensions/repository/view/naw_securedl>`_
|
||||
14
typo3conf/ext/fs_media_gallery/Documentation/Settings.cfg
Normal file
@@ -0,0 +1,14 @@
|
||||
[general]
|
||||
project = (FS) Media Gallery
|
||||
version = 2.2
|
||||
release = 2.2.0
|
||||
t3author = Frans Saris
|
||||
copyright = 2021
|
||||
description = A FAL based media gallery for TYPO3. Show your assets
|
||||
from your local or remote storage as a gallery of albums.
|
||||
|
||||
|
||||
[html_theme_options]
|
||||
; for theme t3SphinxThemeRtd and sphinx_typo3_theme
|
||||
project_issues = https://bitbucket.org/franssaris/fs_media_gallery/issues
|
||||
project_repository = https://bitbucket.org/franssaris/fs_media_gallery
|
||||
25
typo3conf/ext/fs_media_gallery/Documentation/Settings.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
# This is the project specific Settings.yml file.
|
||||
# Place Sphinx specific build information here.
|
||||
# Settings given here will replace the settings of 'conf.py'.
|
||||
|
||||
---
|
||||
conf.py:
|
||||
copyright: 2013-2021
|
||||
project: '(FS) Media Gallery'
|
||||
version: 2.2.0
|
||||
release: 2.2.0
|
||||
latex_documents:
|
||||
- - Index
|
||||
- fs_media_gallery.tex
|
||||
- '(FS) Media Gallery: A FAL based media gallery for TYPO3'
|
||||
- Frans Saris
|
||||
- manual
|
||||
latex_elements:
|
||||
papersize: a4paper
|
||||
pointsize: 10pt
|
||||
preamble: \usepackage{typo3}
|
||||
intersphinx_mapping:
|
||||
t3tsref:
|
||||
- https://docs.typo3.org/typo3cms/TyposcriptReference/
|
||||
- null
|
||||
...
|
||||
@@ -0,0 +1,58 @@
|
||||
.. ==================================================
|
||||
.. FOR YOUR INFORMATION
|
||||
.. --------------------------------------------------
|
||||
.. -*- coding: utf-8 -*- with BOM.
|
||||
|
||||
.. include:: ../Includes.txt
|
||||
|
||||
|
||||
.. _support:
|
||||
|
||||
FAQ/Support
|
||||
===========
|
||||
|
||||
|
||||
Frequently Asked Questions
|
||||
--------------------------
|
||||
|
||||
After installing EXT:fs_media_gallery the ordering of my exiting "File collections" changed
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
This is because EXT:fs_media_gallery enables manual sorting of ``sys_file_collection``.
|
||||
This is something we need to make the albums manageable.
|
||||
|
||||
|
||||
I inserted a "Media Gallery" plugin but I see no images in FE
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
* Did you include the static template :ref:`*Media Gallery (fs_media_gallery)* <users_manual>`?
|
||||
* Did you set the :ref:`Startingpoint <flexforms.mediagallery.tabs.general.startingpoint>` to the "Storage Folder" which holds the album records?
|
||||
|
||||
|
||||
Multiple "Media Gallery" plugins on one page won't work properly
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
EXT:fs_media_gallery is designed to display one single plugin per page.
|
||||
Thus it's possible to generate much shorter and cleaner URLs.
|
||||
If you do put multiple plugins on one page please notice that
|
||||
|
||||
* Pagination affects all plugins in in ``nestedList``, ``flatList``, ``showAlbumByParam`` and ``showAlbumByConfig`` :ref:`display modes <flexforms.mediagallery.tabs.general.displayMode>`
|
||||
* Given ``albumUid`` affects all plugins in ``nestedList`` and ``showAlbumByParam`` :ref:`display modes <flexforms.mediagallery.tabs.general.displayMode>`
|
||||
|
||||
|
||||
Bug reports and feature requests
|
||||
--------------------------------
|
||||
|
||||
You found a bug or miss something?
|
||||
|
||||
Please file bug reports and request new features or suggest modifications to existing features
|
||||
in a constructive manner on `https://bitbucket.org/franssaris/fs_media_gallery <https://bitbucket.org/franssaris/fs_media_gallery>`_.
|
||||
|
||||
Help support further development
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
I'm open for all PR's to improve and keeping this extension up-to-date
|
||||
|
||||
Sponsor this project
|
||||
--------------------
|
||||
Please consider supporting me by making a donation on paypal.com (https://paypal.me/franssaris/25) if you use this extension so we can keep the extension up-to-date
|
||||
|
||||
@@ -0,0 +1,80 @@
|
||||
.. ==================================================
|
||||
.. FOR YOUR INFORMATION
|
||||
.. --------------------------------------------------
|
||||
.. -*- coding: utf-8 -*- with BOM.
|
||||
|
||||
.. include:: ../Includes.txt
|
||||
|
||||
|
||||
.. _users_manual:
|
||||
|
||||
Users Manual
|
||||
============
|
||||
|
||||
Target group: **Editors**
|
||||
|
||||
How to create a new media album
|
||||
-------------------------------
|
||||
|
||||
#. Make sure the static template *Media Gallery (fs_media_gallery)* is included
|
||||
|
||||
.. figure:: ../Images/UserManual/include-static-template.png
|
||||
:width: 400px
|
||||
:alt: Include static template *Media Gallery (fs_media_gallery)*
|
||||
|
||||
**Image 1:** Include static template *Media Gallery (fs_media_gallery)*
|
||||
|
||||
If you use `EXT:bootstrap_package <https://extensions.typo3.org/extension/bootstrap_package/>`_ include static template *Media Gallery Theme 'Bootstrap3' (fs_media_gallery)*.
|
||||
|
||||
#. Create a *"<Storage Folder>"* in your page-tree that's gonna hold your albums
|
||||
|
||||
.. figure:: ../Images/UserManual/create-storage-folder.png
|
||||
:width: 200px
|
||||
:alt: Create a *"<Storage Folder>"* to hold your albums
|
||||
|
||||
**Image 2:** Create a *"<Storage Folder>"* to hold your albums
|
||||
|
||||
#. Tell TYPO3 that the *"<Storage Folder>"* holds media albums by setting "Contains Plugin" to "MediaGalleries"
|
||||
|
||||
.. figure:: ../Images/UserManual/create-media-albums-storage-folder.png
|
||||
:width: 300px
|
||||
:alt: Set "Contains Plugin" to "MediaGalleries"
|
||||
|
||||
**Image 3:** Set "Contains Plugin" to "MediaGalleries"
|
||||
|
||||
#. Go to *Filelist* and open the folder you want to turn into a album (the folder should contain some media assets like e.g. images)
|
||||
#. In *Filelist* click on the *Create new album in "<Storage Folder>"* icon in top toolbar or use *Create new album in "<Storage Folder>"* from the context menu in file list
|
||||
|
||||
.. figure:: ../Images/UserManual/create-new-media-album-from-folder.png
|
||||
:width: 400px
|
||||
:alt: Create new album in "<Storage Folder>"
|
||||
|
||||
**Image 4:** Create new album in "<Storage Folder>"
|
||||
|
||||
#. Fill out the required fields and save your new album
|
||||
#. Insert plugin *Media Album* on a page
|
||||
|
||||
.. figure:: ../Images/UserManual/add-media-album-plugin.png
|
||||
:width: 300px
|
||||
:alt: Add media album plugin
|
||||
|
||||
**Image 5:** Add media album plugin
|
||||
|
||||
#. Choose a "Display mode" for instance "Selected albums (nested)" see :ref:`Plugin settings<flexforms.mediagallery.tabs.general>`
|
||||
|
||||
#. Set the :ref:`Startingpoint <flexforms.mediagallery.tabs.general.startingpoint>` to the *"<Storage Folder>"*
|
||||
you created the album in for more configuration options see :ref:`plugin <configuration-plugin>`
|
||||
|
||||
.. figure:: ../Images/UserManual/configure-media-album-plugin.png
|
||||
:width: 300px
|
||||
:alt: Set starting point
|
||||
|
||||
**Image 6:** Set starting point
|
||||
|
||||
#. **Open FE and admire your album :)**
|
||||
|
||||
Clear cache after a folder change
|
||||
---------------------------------
|
||||
|
||||
Clearing the cache of a certain page can be set by adding the 'TCEMAIN.clearCacheCmd' in the pageTs of your MediaGallery storage.
|
||||
After a change in your folder the TCEMAIN.clearCacheCmd will be invoked and the cache of these pages will be flushed.
|
||||
54
typo3conf/ext/fs_media_gallery/README.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# (FS) Media Gallery
|
||||
|
||||
|
||||
A FAL based media gallery for TYPO3. Show your assets from your local or remote storage as a gallery of albums.
|
||||
|
||||
## Features
|
||||
|
||||
- Create a new album from a folder in the file module with only ONE button click
|
||||
- Manage your albums from within the file module
|
||||
- Teaser plugin (show random asset from selected albums)
|
||||
- Editor friendly
|
||||
- Make a album from a static collection of files, a folder or selected by category (core file_collections)
|
||||
|
||||
|
||||
## Requirements
|
||||
|
||||
- TYPO3 11 LTS
|
||||
|
||||
|
||||
## Quick install notes
|
||||
|
||||
- Install extension through Extension Manager or composer ``composer require minifranske/fs-media-gallery``
|
||||
- Include Static Template "Media Galley (fs_media_gallery)"
|
||||
- Create a StoragePage and set "Contains Plugin" to "Media Galleries"
|
||||
- Go to file module and open the folder you want to turn into a album
|
||||
- Click on the "Create new album..." in context menu or top toolbar
|
||||
- Save your new album
|
||||
- Insert plugin on page and select "Media Gallery" as plugin type
|
||||
- Adjust the "Display mode" to the preferred gallery
|
||||
- Set the "Record Storage Page" to the "StoragePage" you just created
|
||||
- Open FE and admire your album :)
|
||||
|
||||
## Known issues
|
||||
|
||||
- After installing fs_media_gallery the ordering of my exiting sys_file_collections changed
|
||||
- This is because fs_media_gallery enables manual sorting of sys_file_collections this is something we need to make the albums manageable.
|
||||
|
||||
- I inserted a "Media Gallery" plugin but I see no images in FE
|
||||
- Did you set the "Record Storage Page" of the plugin to the "StoragePage" with your albums?
|
||||
- Did you set the "Display mode" in the plugin?
|
||||
|
||||
- The images shown in the lightbox don't have the max size but are resized to max 1400px * 1400px
|
||||
- These limits are set in the typoscript template of the extension and are there to prevent that to big images are used in FE. These max values can be overruled by setting your own values in your typoscript template.
|
||||
plugin.tx_fsmediagallery.settings.image.lightbox.maxWidth
|
||||
plugin.tx_fsmediagallery.settings.image.lightbox.maxHeight
|
||||
|
||||
|
||||
### Help support further development
|
||||
|
||||
I'm open for all PR's to improve and keeping this extension up-to-date
|
||||
|
||||
### Sponsor this project
|
||||
Please consider supporting me by making a donation on paypal.com (https://paypal.me/franssaris/25) if you use this extension so we can keep the extension up-to-date
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
deny from all
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2022-07-18T16:43:34Z">
|
||||
<header>
|
||||
<generator>LFEditor</generator>
|
||||
</header>
|
||||
<body>
|
||||
<trans-unit id="asset">
|
||||
<source><![CDATA[asset]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="assets">
|
||||
<source><![CDATA[assets]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="back_to_%s">
|
||||
<source><![CDATA[Back to %s]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="back_to_album">
|
||||
<source><![CDATA[Back to album]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="back_to_albums_list">
|
||||
<source><![CDATA[Back to albums list]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="date_format">
|
||||
<source><![CDATA[Y-m-d]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="lightbox_current">
|
||||
<source><![CDATA[{current}/{total}]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="link_to_album">
|
||||
<source><![CDATA[Show album '%s']]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="media_album">
|
||||
<source><![CDATA[Media Album]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="media_albums">
|
||||
<source><![CDATA[Media Albums]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="no_album_found">
|
||||
<source><![CDATA[Album not found]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="no_albums_found">
|
||||
<source><![CDATA[No albums found]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="no_assets_found">
|
||||
<source><![CDATA[No assets found]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="widget.pagination.ellipsis">
|
||||
<source><![CDATA[…]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="widget.pagination.next">
|
||||
<source><![CDATA[»]]></source>
|
||||
</trans-unit>
|
||||
<trans-unit id="widget.pagination.previous">
|
||||
<source><![CDATA[«]]></source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1,218 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2013-01-27T20:37:07Z" product-name="fs_media_gallery">
|
||||
<header/>
|
||||
<body>
|
||||
<!--
|
||||
General plugin configuration
|
||||
-->
|
||||
|
||||
<trans-unit id="mediagallery.title">
|
||||
<source>Media Album</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="mediagallery.description">
|
||||
<source>Show your assets from your local or remote storage as a gallery of albums.</source>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
FLEXFORMS
|
||||
-->
|
||||
|
||||
<!-- flexforms.general -->
|
||||
<trans-unit id="flexforms.general.I.inherit">
|
||||
<source>Inherit (TypoScript)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.general.resizeMode">
|
||||
<source>Resize mode</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.general.resizeMode.I.m">
|
||||
<source>resize proportional</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.general.resizeMode.I.c">
|
||||
<source>crop</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.general.resizeMode.I.s">
|
||||
<source>squeeze (unproportional exact fit)</source>
|
||||
</trans-unit>
|
||||
<!--
|
||||
flexforms.mediagallery
|
||||
-->
|
||||
<trans-unit id="flexforms.mediagallery.tabs.general">
|
||||
<source>General</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.tabs.list">
|
||||
<source>Albums list</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.tabs.album">
|
||||
<source>Album view</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.tabs.detail">
|
||||
<source>Detail view</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.tabs.random">
|
||||
<source>Random asset</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.switchableControllerActions">
|
||||
<source>Display mode</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.switchableControllerActions.I.nestedList">
|
||||
<source>Selected albums (nested)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.switchableControllerActions.I.flatList">
|
||||
<source>Albums list (flattened)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.switchableControllerActions.I.showAlbumByParam">
|
||||
<source>Single album (URL handover enabled)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.switchableControllerActions.I.showAlbumByConfig">
|
||||
<source>Single album (URL handover disabled)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.switchableControllerActions.I.randomAsset">
|
||||
<source>Random media asset</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.mediaAlbum">
|
||||
<source>Album to display</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.mediaAlbumsUids">
|
||||
<source>Albums to display</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.useAlbumFilterAsExclude">
|
||||
<source>Album selection filter (if no items are selected all are shown)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.useAlbumFilterAsExclude.I.0">
|
||||
<source>Show only selected items</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.useAlbumFilterAsExclude.I.1">
|
||||
<source>Exclude selected items</source>
|
||||
</trans-unit>
|
||||
<!-- flexforms.mediagallery.list (both nested and flat) -->
|
||||
<trans-unit id="flexforms.mediagallery.list.hideEmptyAlbums">
|
||||
<source>Hide empty albums</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.list.pagination.itemsPerPage">
|
||||
<source>Max. thumbs to display per page</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.list.thumb.width">
|
||||
<source>Thumbnail width</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.list.thumb.height">
|
||||
<source>Thumbnail height</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.list.thumb.random">
|
||||
<source>Random thumbnail</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.list.orderBy">
|
||||
<source>Sort albums list by</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.list.orderBy.I.datetime">
|
||||
<source>Given date</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.list.orderBy.I.crdate">
|
||||
<source>Creation date</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.list.orderBy.I.sorting">
|
||||
<source>Given sort order</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.list.orderDirection">
|
||||
<source>Sort direction for albums list</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.list.orderDirection.I.asc">
|
||||
<source>Ascending (old to new/low to high)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.list.orderDirection.I.desc">
|
||||
<source>Descending (new to old/high to low)</source>
|
||||
</trans-unit>
|
||||
<!-- flexforms.mediagallery.album -->
|
||||
<trans-unit id="flexforms.mediagallery.album.pagination.itemsPerPage">
|
||||
<source>Max. thumbs to display per page</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.assets.orderBy">
|
||||
<source>Sort media/files by</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.assets.orderBy.I.name">
|
||||
<source>Filename</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.assets.orderBy.I.crdate">
|
||||
<source>Creation date</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.assets.orderBy.I.title">
|
||||
<source>Title (metadata)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.assets.orderDirection">
|
||||
<source>Sort direction for media/files</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.assets.orderDirection.I.asc">
|
||||
<source>Ascending (old to new/low to high)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.assets.orderDirection.I.desc">
|
||||
<source>Descending (new to old/high to low)</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.album.thumb.width">
|
||||
<source>Thumbnail width</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.album.thumb.height">
|
||||
<source>Thumbnail height</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.album.lightbox.enable">
|
||||
<source>Use LightBox/Colorbox instead of detail view</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.album.displayTitle">
|
||||
<source>Display title</source>
|
||||
</trans-unit>
|
||||
<!-- flexforms.mediagallery.detail -->
|
||||
<trans-unit id="flexforms.mediagallery.detail.asset.width">
|
||||
<source>Media width</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.detail.asset.height">
|
||||
<source>Media height</source>
|
||||
</trans-unit>
|
||||
<!-- flexforms.mediagallery.random -->
|
||||
<trans-unit id="flexforms.mediagallery.random.targetPid">
|
||||
<source>Album page</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.random.thumb.width">
|
||||
<source>Thumbnail width</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="flexforms.mediagallery.random.thumb.height">
|
||||
<source>Thumbnail height</source>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
EXTENSION MANAGER
|
||||
-->
|
||||
<trans-unit id="extmng.allowedActionsInFlexforms">
|
||||
<source>Plugin actions shown in flexforms: Comma separated list of controller actions which could be selected as plugin action in flexforms. Available actions are nestedList,flatList,showAlbumByParam,showAlbumByConfig,randomAsset. If no action is defined, all available actions are selectable.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="extmng.list.orderOptions">
|
||||
<source>Sort options for albums lists in flexforms: Comma separated list of sort options for field "Sort albums list by" which could be selected in flexforms. Available options are datetime,crdate,sorting.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="extmng.asset.orderOptions">
|
||||
<source>Sort options for assets (files) in flexforms: Comma separated list of sort options for field "Sort files by" which could be selected in flexforms. Available options are sys_file and sys_file_metadata options.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="extmng.enableAutoCreateFileCollection">
|
||||
<source>Enable auto creation of fileCollections/albums when a new folder is created beneath an existing album.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="extmng.clearCacheAfterFileChange">
|
||||
<source>Clear the cache of the album after a file change: Make sure PageTS option TCEMAIN.clearCacheCmd is set, see documentation.</source>
|
||||
</trans-unit>
|
||||
|
||||
<!--
|
||||
BE MODULE
|
||||
-->
|
||||
|
||||
<trans-unit id="module.buttons.createAlbum">
|
||||
<source>Turn into album</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="module.buttons.createAlbumIn">
|
||||
<source>Turn into album (add to "%s")</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="module.buttons.editAlbum">
|
||||
<source>Edit album "%s"</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="module.alerts.firstCreateStorageFolder">
|
||||
<source>You must first create a storage folder for your media albums!</source>
|
||||
</trans-unit>
|
||||
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2014-07-29T12:00:00Z" product-name="fs_media_gallery">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="settings.startingpoint.description" xml:space="preserve">
|
||||
<source>Define the pages/sysfolders which hold the album records.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="settings.recursive.description" xml:space="preserve">
|
||||
<source>Select the recursion level of the startingpoint.</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="settings.random.targetPid.description" xml:space="preserve">
|
||||
<source>Target page the random assets should link to. Select the page on which the full album is shown.</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<xliff version="1.0">
|
||||
<file source-language="en" datatype="plaintext" original="messages" date="2013-01-27T20:46:22Z" product-name="fs_media_gallery">
|
||||
<header/>
|
||||
<body>
|
||||
|
||||
<trans-unit id="tx_fsmediagallery_domain_model_mediaalbum">
|
||||
<source>Media Album</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_fsmediagallery_domain_model_mediaalbum.slug">
|
||||
<source>URL Segment</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_fsmediagallery_domain_model_mediaalbum.datetime">
|
||||
<source>Date</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_fsmediagallery_domain_model_mediaalbum.webdescription">
|
||||
<source>Album description</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_fsmediagallery_domain_model_mediaalbum.parentalbum">
|
||||
<source>Parent album</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_fsmediagallery_domain_model_mediaalbum.main_asset">
|
||||
<source>Main asset/image for album</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="tx_fsmediagallery_domain_model_mediaalbum.main_asset.add">
|
||||
<source>Add asset/image</source>
|
||||
</trans-unit>
|
||||
</body>
|
||||
</file>
|
||||
</xliff>
|
||||
@@ -0,0 +1,3 @@
|
||||
<div class="fs-media-gallery">
|
||||
<f:render section="main" />
|
||||
</div>
|
||||
@@ -0,0 +1,87 @@
|
||||
<f:if condition="{settings.album.pagination.insertAbove}">
|
||||
<f:render section="paginator"
|
||||
arguments="{pagination: pagination.pagination, paginator: pagination.paginator, mediaAlbum: mediaAlbum}"/>
|
||||
</f:if>
|
||||
|
||||
<f:format.raw>{content}</f:format.raw>
|
||||
|
||||
<f:if condition="{settings.album.pagination.insertBelow}">
|
||||
<f:render section="paginator"
|
||||
arguments="{pagination: pagination.pagination, paginator: pagination.paginator, mediaAlbum: mediaAlbum}"/>
|
||||
</f:if>
|
||||
|
||||
<f:section name="paginator">
|
||||
<f:if condition="{paginator.numberOfPages} > 1">
|
||||
<div class="paging_bootstrap pagination">
|
||||
<ul>
|
||||
<f:if condition="{pagination.previousPageNumber}">
|
||||
<li class="prev">
|
||||
<f:if condition="{pagination.previousPageNumber} > 1">
|
||||
<f:then>
|
||||
<f:link.action
|
||||
arguments="{currentPage: pagination.previousPageNumber, mediaAlbum: mediaAlbum}">
|
||||
<f:translate key="widget.pagination.previous"/>
|
||||
</f:link.action>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:link.action arguments="{mediaAlbum: mediaAlbum}">
|
||||
<f:translate key="widget.pagination.previous"/>
|
||||
</f:link.action>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.displayRangeStart} > 1">
|
||||
<li class="first">
|
||||
<f:link.action arguments="{mediaAlbum: mediaAlbum}">1</f:link.action>
|
||||
</li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.hasLessPages}">
|
||||
<li class="disabled"><a>
|
||||
<f:translate key="widget.pagination.ellipsis"/>
|
||||
</a></li>
|
||||
</f:if>
|
||||
<f:for each="{pagination.allPageNumbers}" as="page">
|
||||
<f:if condition="{page} == {paginator.currentPageNumber}">
|
||||
<f:then>
|
||||
<li class="active">
|
||||
<f:link.action arguments="{currentPage: page, mediaAlbum: mediaAlbum}">{page}</f:link.action>
|
||||
</li>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<li>
|
||||
<f:if condition="{page} > 1">
|
||||
<f:then>
|
||||
<f:link.action arguments="{currentPage: page, mediaAlbum: mediaAlbum}">{page}</f:link.action>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:link.action arguments="{mediaAlbum: mediaAlbum}">{page}</f:link.action>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</li>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:for>
|
||||
<f:if condition="{pagination.hasMorePages}">
|
||||
<li class="disabled"><a>
|
||||
<f:translate key="widget.pagination.ellipsis"/>
|
||||
</a></li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.displayRangeEnd} < {pagination.numberOfPages}">
|
||||
<li class="last">
|
||||
<f:link.action arguments="{currentPage: pagination.numberOfPages, mediaAlbum: mediaAlbum}">
|
||||
{pagination.numberOfPages}
|
||||
</f:link.action>
|
||||
</li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.nextPageNumber}">
|
||||
<li class="next">
|
||||
<f:link.action arguments="{currentPage: pagination.nextPageNumber, mediaAlbum: mediaAlbum}">
|
||||
<f:translate key="widget.pagination.next"/>
|
||||
</f:link.action>
|
||||
</li>
|
||||
</f:if>
|
||||
</ul>
|
||||
</div>
|
||||
</f:if>
|
||||
</f:section>
|
||||
@@ -0,0 +1,87 @@
|
||||
<f:if condition="{settings.list.pagination.insertAbove}">
|
||||
<f:render section="paginator"
|
||||
arguments="{pagination: pagination.pagination, paginator: pagination.paginator, mediaAlbum: mediaAlbum}"/>
|
||||
</f:if>
|
||||
|
||||
<f:format.raw>{content}</f:format.raw>
|
||||
|
||||
<f:if condition="{settings.list.pagination.insertBelow}">
|
||||
<f:render section="paginator"
|
||||
arguments="{pagination: pagination.pagination, paginator: pagination.paginator, mediaAlbum: mediaAlbum}"/>
|
||||
</f:if>
|
||||
|
||||
<f:section name="paginator">
|
||||
<f:if condition="{paginator.numberOfPages} > 1">
|
||||
<div class="paging_bootstrap pagination">
|
||||
<ul>
|
||||
<f:if condition="{pagination.previousPageNumber}">
|
||||
<li class="prev">
|
||||
<f:if condition="{pagination.previousPageNumber} > 1">
|
||||
<f:then>
|
||||
<f:link.action
|
||||
arguments="{currentAlbumPage: pagination.previousPageNumber, mediaAlbum: mediaAlbum}">
|
||||
<f:translate key="widget.pagination.previous"/>
|
||||
</f:link.action>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:link.action arguments="{mediaAlbum: mediaAlbum}">
|
||||
<f:translate key="widget.pagination.previous"/>
|
||||
</f:link.action>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.displayRangeStart} > 1">
|
||||
<li class="first">
|
||||
<f:link.action arguments="{mediaAlbum: mediaAlbum}">1</f:link.action>
|
||||
</li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.hasLessPages}">
|
||||
<li class="disabled"><a>
|
||||
<f:translate key="widget.pagination.ellipsis"/>
|
||||
</a></li>
|
||||
</f:if>
|
||||
<f:for each="{pagination.allPageNumbers}" as="page">
|
||||
<f:if condition="{page} == {paginator.currentPageNumber}">
|
||||
<f:then>
|
||||
<li class="active">
|
||||
<f:link.action arguments="{currentAlbumPage: page, mediaAlbum: mediaAlbum}">{page}</f:link.action>
|
||||
</li>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<li>
|
||||
<f:if condition="{page} > 1">
|
||||
<f:then>
|
||||
<f:link.action arguments="{currentAlbumPage: page, mediaAlbum: mediaAlbum}">{page}</f:link.action>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:link.action arguments="{mediaAlbum: mediaAlbum}">{page}</f:link.action>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</li>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:for>
|
||||
<f:if condition="{pagination.hasMorePages}">
|
||||
<li class="disabled"><a>
|
||||
<f:translate key="widget.pagination.ellipsis"/>
|
||||
</a></li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.displayRangeEnd} < {pagination.numberOfPages}">
|
||||
<li class="last">
|
||||
<f:link.action arguments="{currentAlbumPage: pagination.numberOfPages, mediaAlbum: mediaAlbum}">
|
||||
{pagination.numberOfPages}
|
||||
</f:link.action>
|
||||
</li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.nextPageNumber}">
|
||||
<li class="next">
|
||||
<f:link.action arguments="{currentAlbumPage: pagination.nextPageNumber, mediaAlbum: mediaAlbum}">
|
||||
<f:translate key="widget.pagination.next"/>
|
||||
</f:link.action>
|
||||
</li>
|
||||
</f:if>
|
||||
</ul>
|
||||
</div>
|
||||
</f:if>
|
||||
</f:section>
|
||||
@@ -0,0 +1,40 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<!--
|
||||
Displays a flattened, one-dimensional album list
|
||||
-->
|
||||
|
||||
<f:section name="AlbumsList">
|
||||
<div class="albums-list">
|
||||
<f:render partial="AlbumsPagination" contentAs="content" arguments="{pagination: mediaAlbumsPagination, mediaAlbum: mediaAlbum}">
|
||||
<f:if condition="{mediaAlbumsPagination.paginator.paginatedItems}">
|
||||
<f:then>
|
||||
<div class="thumbs thumbs-albums clearfix">
|
||||
<f:for each="{mediaAlbumsPagination.paginator.paginatedItems}" as="pagedMediaAlbum">
|
||||
<f:render section="AlbumPreview" arguments="{mediaAlbum:pagedMediaAlbum}" />
|
||||
</f:for>
|
||||
</div>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<div class="alert alert-info">
|
||||
<p><f:translate key="no_albums_found">No albums found.</f:translate></p>
|
||||
</div>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:render>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
<f:section name="AlbumPreview">
|
||||
<f:if condition="{0:0, 1:1} == {0:mediaAlbum.assetsCount, 1:settings.list.hideEmptyAlbums}">
|
||||
<f:else>
|
||||
<div class="img-thumbnail">
|
||||
<f:render partial="MediaAlbum/Thumb" section="Thumb" arguments="{mediaAlbum:mediaAlbum, random:settings.list.thumb.random, width:settings.list.thumb.width, height:settings.list.thumb.height, resizeMode:settings.list.thumb.resizeMode}" />
|
||||
</div>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,52 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<!--
|
||||
Displays assets of an album in FlatList view
|
||||
-->
|
||||
|
||||
<f:section name="AssetsList">
|
||||
<div class="album">
|
||||
<f:if condition="{settings.album.displayTitle}">
|
||||
<h3>{mediaAlbum.title}</h3>
|
||||
</f:if>
|
||||
<div class="description"><f:format.html>{mediaAlbum.webdescription}</f:format.html></div>
|
||||
<f:render partial="AlbumPagination" contentAs="content" arguments="{pagination: mediaAlbumPagination, mediaAlbum: mediaAlbum}">
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:for each="{mediaAlbumPagination.paginator.itemsBefore}" as="mediaAsset">
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass} {settings.album.lightbox.styleClass}-{mediaAlbum.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}"></a>
|
||||
</f:for>
|
||||
</f:if>
|
||||
<f:if condition="{mediaAlbumPagination.paginator.paginatedItems}">
|
||||
<f:then>
|
||||
<div class="thumbs thumbs-assets clearfix">
|
||||
<f:for each="{mediaAlbumPagination.paginator.paginatedItems}" as="mediaAsset">
|
||||
<f:render partial="MediaAsset/Thumb" section="Thumb" arguments="{mediaAlbum:mediaAlbum, mediaAsset:mediaAsset}" />
|
||||
</f:for>
|
||||
</div>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<div class="alert alert-info">
|
||||
<p><f:translate key="no_assets_found">No assets found.</f:translate></p>
|
||||
</div>
|
||||
</f:else>
|
||||
</f:if>
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:for each="{mediaAlbumPagination.paginator.itemsAfter}" as="mediaAsset">
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass} {settings.album.lightbox.styleClass}-{mediaAlbum.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}"></a>
|
||||
</f:for>
|
||||
</f:if>
|
||||
</f:render>
|
||||
<f:if condition="{showBackLink}">
|
||||
<div class="navigation">
|
||||
<f:link.action class="btn btn-default" controller="MediaAlbum"><f:translate key="back_to_albums_list">Back to album list</f:translate></f:link.action>
|
||||
</div>
|
||||
</f:if>
|
||||
</div>
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:render partial="MediaAlbum/Lightbox" section="Lightbox" arguments="{mediaAlbum:mediaAlbum}" />
|
||||
</f:if>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,28 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<f:section name="Lightbox">
|
||||
<f:if condition="{0:'colorbox'} == {0:settings.album.lightbox.jsPlugin}">
|
||||
<mf:embed.javaScript moveToFooter="TRUE">
|
||||
jQuery(document).ready(function($) {
|
||||
var styleClass = '{settings.album.lightbox.styleClass}-{mediaAlbum.uid}';
|
||||
var relName = '{settings.album.lightbox.relPrefix}{mediaAlbum.uid}';
|
||||
var current = '{f:translate(key:'lightbox_current', default:'image {current} of {total}')}';
|
||||
$("." + styleClass).colorbox({
|
||||
rel:relName,
|
||||
maxWidth:function(){if($(window).width()<768){return '100%';}else{return '80%';}},
|
||||
maxHeight:function(){if($(window).width()<768){return '100%';}else{return '80%';}},
|
||||
title:function(){
|
||||
var title = $(this).data('title');
|
||||
if (title == '') {$("#cboxTitle").css('visibility','hidden');}else{$("#cboxTitle").css('visibility','visible');}
|
||||
return title;
|
||||
},
|
||||
current:current
|
||||
});
|
||||
});
|
||||
</mf:embed.javaScript>
|
||||
</f:if>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,30 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<!--
|
||||
Displays an album list
|
||||
-->
|
||||
|
||||
<f:section name="AlbumsList">
|
||||
<f:render partial="AlbumsPagination" contentAs="content" arguments="{pagination: mediaAlbumsPagination, mediaAlbum: mediaAlbum}">
|
||||
<f:if condition="{mediaAlbumsPagination.paginator.paginatedItems}">
|
||||
<f:then>
|
||||
<div class="thumbs thumbs-albums clearfix">
|
||||
<f:for each="{mediaAlbumsPagination.paginator.paginatedItems}" as="pagedMediaAlbum">
|
||||
<div class="thumb">
|
||||
<f:render partial="MediaAlbum/Thumb" section="Thumb" arguments="{mediaAlbum:pagedMediaAlbum, random:settings.list.thumb.random, width:settings.list.thumb.width, height:settings.list.thumb.height, resizeMode:settings.list.thumb.resizeMode}" />
|
||||
</div>
|
||||
</f:for>
|
||||
</div>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<div class="alert alert-info">
|
||||
<p><f:translate key="no_albums_found">No albums found.</f:translate></p>
|
||||
</div>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:render>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,30 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<f:section name="Thumb">
|
||||
<f:link.action controller="MediaAlbum" arguments="{mediaAlbum: mediaAlbum}">
|
||||
<f:if condition="{random}">
|
||||
<f:then>
|
||||
<f:render partial="MediaAsset/Detail" section="Detail" arguments="{alt:mediaAlbum.title,title:mediaAlbum.title,mediaAsset:mediaAlbum.randomAsset,width:width,height:height,resizeMode:resizeMode}" />
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:render partial="MediaAsset/Detail" section="Detail" arguments="{alt:mediaAlbum.title,title:mediaAlbum.title,mediaAsset:mediaAlbum.mainAsset,width:width,height:height,resizeMode:resizeMode}" />
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:link.action>
|
||||
|
||||
<h4 class="name">
|
||||
<f:link.action controller="MediaAlbum" arguments="{mediaAlbum: mediaAlbum}">{mediaAlbum.title}</f:link.action>
|
||||
</h4>
|
||||
|
||||
<div class="description">
|
||||
<span class="teaser">
|
||||
<f:format.crop maxCharacters="17" append=" ...">{mediaAlbum.webdescription -> f:format.stripTags()}</f:format.crop>
|
||||
</span>
|
||||
<span class="asset-count">{mediaAlbum.assetsCount} <f:translate key="assets">assets</f:translate></span>
|
||||
<span class="date"><f:format.date date="{mediaAlbum.datetime}" format="d.m.Y" /></span>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,24 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<f:section name="Detail">
|
||||
<f:if condition="{mediaAsset}">
|
||||
<f:then>
|
||||
<span class="image">
|
||||
<f:media
|
||||
file="{mediaAsset}"
|
||||
alt="{alt}"
|
||||
title="{f:if(condition:title, then:title, else:'{mf:fileTitle(file:mediaAsset)}')}"
|
||||
height="{height}{resizeMode}"
|
||||
width="{width}{resizeMode}"
|
||||
/>
|
||||
</span>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<i class="no-asset" style="width:{width}px;"><f:translate key="no_assets_found">No assets found</f:translate></i>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<f:section name="Thumb">
|
||||
<div class="thumb">
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:then>
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass} {settings.album.lightbox.styleClass}-{mediaAlbum.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}">
|
||||
<f:render partial="MediaAsset/Detail" section="Detail" arguments="{alt:mediaAsset.alternative,title:mediaAsset.title,mediaAsset:mediaAsset,width:settings.album.thumb.width,height:settings.album.thumb.height,resizeMode:settings.album.thumb.resizeMode}" />
|
||||
</a>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:link.action action="showAsset" arguments="{mediaAlbum:mediaAlbum,mediaAssetUid:mediaAsset.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}">
|
||||
<f:render partial="MediaAsset/Detail" section="Detail" arguments="{alt:mediaAsset.alternative,title:mediaAsset.title,mediaAsset:mediaAsset,width:settings.album.thumb.width,height:settings.album.thumb.height,resizeMode:settings.album.thumb.resizeMode}" />
|
||||
</f:link.action>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,19 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="main">
|
||||
<f:flashMessages />
|
||||
<f:if condition="{0:displayMode} == {0:'album'}">
|
||||
<f:then>
|
||||
<f:render partial="MediaAlbum/FlatList/AssetsList" section="AssetsList" arguments="{_all}" />
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:render partial="MediaAlbum/FlatList/AlbumsList" section="AlbumsList" arguments="{_all}" />
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,75 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="main">
|
||||
<f:flashMessages />
|
||||
<f:if condition="{mediaAlbum}">
|
||||
<f:then>
|
||||
<div class="album clearfix">
|
||||
<f:if condition="{settings.album.displayTitle}">
|
||||
<h3>{mediaAlbum.title}</h3>
|
||||
</f:if>
|
||||
<div class="description"><f:format.html>{mediaAlbum.webdescription}</f:format.html></div>
|
||||
<f:if condition="{mediaAlbums}">
|
||||
<f:then>
|
||||
<f:render partial="MediaAlbum/NestedList/AlbumsList" section="AlbumsList" arguments="{mediaAlbums:mediaAlbums, mediaAlbumsPagination: mediaAlbumsPagination}" />
|
||||
</f:then>
|
||||
</f:if>
|
||||
|
||||
<f:render partial="AlbumPagination" contentAs="content" arguments="{pagination: mediaAlbumPagination, mediaAlbum: mediaAlbum}">
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:for each="{mediaAlbumPagination.paginator.itemsBefore}" as="mediaAsset">
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass} {settings.album.lightbox.styleClass}-{mediaAlbum.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}"></a>
|
||||
</f:for>
|
||||
</f:if>
|
||||
<f:if condition="{mediaAlbumPagination.paginator.paginatedItems}">
|
||||
<f:then>
|
||||
<div class="thumbs thumbs-assets clearfix">
|
||||
<f:for each="{mediaAlbumPagination.paginator.paginatedItems}" as="mediaAsset">
|
||||
<f:render partial="MediaAsset/Thumb" section="Thumb" arguments="{mediaAlbum:mediaAlbum,mediaAsset:mediaAsset}" />
|
||||
</f:for>
|
||||
</div>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:if condition="{mediaAlbums}">
|
||||
<f:else>
|
||||
<div class="alert alert-info">
|
||||
<p><f:translate key="no_assets_found">No assets found.</f:translate></p>
|
||||
</div>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:else>
|
||||
</f:if>
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:for each="{mediaAlbumPagination.paginator.itemsAfter}" as="mediaAsset">
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass} {settings.album.lightbox.styleClass}-{mediaAlbum.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}"></a>
|
||||
</f:for>
|
||||
</f:if>
|
||||
</f:render>
|
||||
<f:if condition="{showBackLink}">
|
||||
<div class="navigation">
|
||||
<f:if condition="{parentAlbum}">
|
||||
<f:then>
|
||||
<f:link.action class="btn btn-default" controller="MediaAlbum" arguments="{mediaAlbum:parentAlbum}"><f:translate id="back_to_%s" arguments="{0: parentAlbum.title}">Back to %s</f:translate></f:link.action>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:link.action class="btn btn-default" controller="MediaAlbum"><f:translate key="back_to_album">Back to album</f:translate></f:link.action>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</div>
|
||||
</f:if>
|
||||
</div>
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:render partial="MediaAlbum/Lightbox" section="Lightbox" arguments="{mediaAlbum:mediaAlbum}" />
|
||||
</f:if>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:render partial="MediaAlbum/NestedList/AlbumsList" section="AlbumsList" arguments="{mediaAlbums:mediaAlbums, mediaAlbumsPagination: mediaAlbumsPagination}" />
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,17 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="main">
|
||||
<div class="thumb random">
|
||||
<f:link.action pageUid="{settings.random.targetPid}" controller="MediaAlbum" arguments="{mediaAlbum : mediaAlbum}">
|
||||
<f:render partial="MediaAsset/Detail" section="Detail" arguments="{alt:mediaAlbum.title,title:mediaAlbum.title,mediaAsset:mediaAlbum.randomAsset,width:settings.random.thumb.width,height:settings.random.thumb.height,resizeMode:settings.random.thumb.resizeMode}" />
|
||||
<div class="name">{mediaAlbum.title}</div>
|
||||
<div class="description"><f:format.crop maxCharacters="17" append=" ...">{mediaAlbum.webdescription}</f:format.crop></div>
|
||||
</f:link.action>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,53 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="main">
|
||||
<f:flashMessages />
|
||||
<f:if condition="{mediaAlbum}">
|
||||
<f:then>
|
||||
<div class="album">
|
||||
<f:if condition="{settings.album.displayTitle}">
|
||||
<h3>{mediaAlbum.title}</h3>
|
||||
</f:if>
|
||||
<div class="description"><f:format.html>{mediaAlbum.webdescription}</f:format.html></div>
|
||||
<f:render partial="AlbumPagination" contentAs="content" arguments="{pagination: mediaAlbumPagination, mediaAlbum: mediaAlbum}">
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:for each="{mediaAlbumPagination.paginator.itemsBefore}" as="mediaAsset">
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass} {settings.album.lightbox.styleClass}-{mediaAlbum.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}"></a>
|
||||
</f:for>
|
||||
</f:if>
|
||||
<f:if condition="{mediaAlbumPagination.paginator.paginatedItems}">
|
||||
<f:then>
|
||||
<div class="thumbs clearfix">
|
||||
<f:for each="{mediaAlbumPagination.paginator.paginatedItems}" as="mediaAsset">
|
||||
<f:render partial="MediaAsset/Thumb" section="Thumb" arguments="{mediaAlbum:mediaAlbum,mediaAsset:mediaAsset}" />
|
||||
</f:for>
|
||||
</div>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<div class="alert alert-info">
|
||||
<p><f:translate key="no_assets_found">No assets found.</f:translate></p>
|
||||
</div>
|
||||
</f:else>
|
||||
</f:if>
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:for each="{mediaAlbumPagination.paginator.itemsAfter}" as="mediaAsset">
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass} {settings.album.lightbox.styleClass}-{mediaAlbum.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}"></a>
|
||||
</f:for>
|
||||
</f:if>
|
||||
</f:render>
|
||||
</div>
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:render partial="MediaAlbum/Lightbox" section="Lightbox" arguments="{mediaAlbum:mediaAlbum}" />
|
||||
</f:if>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:translate key="no_album_found" />
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,33 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="main">
|
||||
<f:flashMessages />
|
||||
<div class="asset">
|
||||
<h1>{mediaAlbum.title}</h1>
|
||||
<div class="mediaasset mediatype{mediaAsset.type}">
|
||||
<figure>
|
||||
<f:render partial="MediaAsset/Detail" section="Detail" arguments="{mediaAsset:mediaAsset,width:settings.detail.asset.width,height:settings.detail.asset.height,resizeMode:settings.detail.asset.resizeMode}" />
|
||||
<figcaption>{mf:fileTitle(file:mediaAsset)}</figcaption>
|
||||
<f:if condition="{mediaAsset.properties.description}">
|
||||
<div class="description"><f:format.html>{mediaAsset.properties.description}</f:format.html></div>
|
||||
</f:if>
|
||||
</figure>
|
||||
</div>
|
||||
</div>
|
||||
<div class="navigation">
|
||||
<f:if condition="{previousAsset}">
|
||||
<f:link.action class="btn btn-default" action="showAsset" arguments="{mediaAlbum:mediaAlbum,mediaAssetUid:previousAsset.uid}" title="{mf:fileTitle(file:previousAsset)} - {mediaAlbum.title}">< {mf:fileTitle(file:previousAsset)}</f:link.action>
|
||||
</f:if>
|
||||
<f:link.action class="btn btn-default" controller="MediaAlbum" arguments="{mediaAlbum:mediaAlbum}"><f:translate id="back_to_%s" arguments="{0: mediaAlbum.title}">Back to %s</f:translate></f:link.action>
|
||||
|
||||
<f:if condition="{nextAsset}">
|
||||
<f:link.action class="btn btn-default" action="showAsset" arguments="{mediaAlbum:mediaAlbum,mediaAssetUid:nextAsset.uid}" title="{mf:fileTitle(file:nextAsset)} - {mediaAlbum.title}">{mf:fileTitle(file:nextAsset)} ></f:link.action>
|
||||
</f:if>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,85 @@
|
||||
<f:if condition="{settings.album.pagination.insertAbove}">
|
||||
<f:render section="paginator"
|
||||
arguments="{pagination: pagination.pagination, paginator: pagination.paginator, mediaAlbum: mediaAlbum}"/>
|
||||
</f:if>
|
||||
|
||||
<f:format.raw>{content}</f:format.raw>
|
||||
|
||||
<f:if condition="{settings.album.pagination.insertBelow}">
|
||||
<f:render section="paginator"
|
||||
arguments="{pagination: pagination.pagination, paginator: pagination.paginator, mediaAlbum: mediaAlbum}"/>
|
||||
</f:if>
|
||||
|
||||
<f:section name="paginator">
|
||||
<f:if condition="{paginator.numberOfPages} > 1">
|
||||
<ul class="pagination">
|
||||
<f:if condition="{pagination.previousPageNumber}">
|
||||
<li class="prev">
|
||||
<f:if condition="{pagination.previousPageNumber} > 1">
|
||||
<f:then>
|
||||
<f:link.action
|
||||
arguments="{currentPage: pagination.previousPageNumber, mediaAlbum: mediaAlbum}">
|
||||
<f:translate key="widget.pagination.previous"/>
|
||||
</f:link.action>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:link.action arguments="{mediaAlbum: mediaAlbum}">
|
||||
<f:translate key="widget.pagination.previous"/>
|
||||
</f:link.action>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.displayRangeStart} > 1">
|
||||
<li class="first">
|
||||
<f:link.action arguments="{mediaAlbum: mediaAlbum}">1</f:link.action>
|
||||
</li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.hasLessPages}">
|
||||
<li class="disabled"><a>
|
||||
<f:translate key="widget.pagination.ellipsis"/>
|
||||
</a></li>
|
||||
</f:if>
|
||||
<f:for each="{pagination.allPageNumbers}" as="page">
|
||||
<f:if condition="{page} == {paginator.currentPageNumber}">
|
||||
<f:then>
|
||||
<li class="active">
|
||||
<f:link.action arguments="{currentPage: page, mediaAlbum: mediaAlbum}">{page}</f:link.action>
|
||||
</li>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<li>
|
||||
<f:if condition="{page} > 1">
|
||||
<f:then>
|
||||
<f:link.action arguments="{currentPage: page, mediaAlbum: mediaAlbum}">{page}</f:link.action>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:link.action>{page}</f:link.action>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</li>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:for>
|
||||
<f:if condition="{pagination.hasMorePages}">
|
||||
<li class="disabled"><a>
|
||||
<f:translate key="widget.pagination.ellipsis"/>
|
||||
</a></li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.displayRangeEnd} < {pagination.numberOfPages}">
|
||||
<li class="last">
|
||||
<f:link.action arguments="{currentPage: pagination.numberOfPages, mediaAlbum: mediaAlbum}">
|
||||
{pagination.numberOfPages}
|
||||
</f:link.action>
|
||||
</li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.nextPageNumber}">
|
||||
<li class="next">
|
||||
<f:link.action arguments="{currentPage: pagination.nextPageNumber, mediaAlbum: mediaAlbum}">
|
||||
<f:translate key="widget.pagination.next"/>
|
||||
</f:link.action>
|
||||
</li>
|
||||
</f:if>
|
||||
</ul>
|
||||
</f:if>
|
||||
</f:section>
|
||||
@@ -0,0 +1,87 @@
|
||||
<f:if condition="{settings.list.pagination.insertAbove}">
|
||||
<f:render section="paginator"
|
||||
arguments="{pagination: pagination.pagination, paginator: pagination.paginator, mediaAlbum: mediaAlbum}"/>
|
||||
</f:if>
|
||||
|
||||
<f:format.raw>{content}</f:format.raw>
|
||||
|
||||
<f:if condition="{settings.list.pagination.insertBelow}">
|
||||
<f:render section="paginator"
|
||||
arguments="{pagination: pagination.pagination, paginator: pagination.paginator, mediaAlbum: mediaAlbum}"/>
|
||||
</f:if>
|
||||
|
||||
<f:section name="paginator">
|
||||
<f:if condition="{paginator.numberOfPages} > 1">
|
||||
<div class="paging_bootstrap pagination">
|
||||
<ul>
|
||||
<f:if condition="{pagination.previousPageNumber}">
|
||||
<li class="prev">
|
||||
<f:if condition="{pagination.previousPageNumber} > 1">
|
||||
<f:then>
|
||||
<f:link.action
|
||||
arguments="{currentAlbumPage: pagination.previousPageNumber, mediaAlbum: mediaAlbum}">
|
||||
<f:translate key="widget.pagination.previous"/>
|
||||
</f:link.action>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:link.action arguments="{mediaAlbum: mediaAlbum}">
|
||||
<f:translate key="widget.pagination.previous"/>
|
||||
</f:link.action>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.displayRangeStart} > 1">
|
||||
<li class="first">
|
||||
<f:link.action arguments="{mediaAlbum: mediaAlbum}">1</f:link.action>
|
||||
</li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.hasLessPages}">
|
||||
<li class="disabled"><a>
|
||||
<f:translate key="widget.pagination.ellipsis"/>
|
||||
</a></li>
|
||||
</f:if>
|
||||
<f:for each="{pagination.allPageNumbers}" as="page">
|
||||
<f:if condition="{page} == {paginator.currentPageNumber}">
|
||||
<f:then>
|
||||
<li class="active">
|
||||
<f:link.action arguments="{currentAlbumPage: page, mediaAlbum: mediaAlbum}">{page}</f:link.action>
|
||||
</li>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<li>
|
||||
<f:if condition="{page} > 1">
|
||||
<f:then>
|
||||
<f:link.action arguments="{currentAlbumPage: page, mediaAlbum: mediaAlbum}">{page}</f:link.action>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:link.action>{page}</f:link.action>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</li>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:for>
|
||||
<f:if condition="{pagination.hasMorePages}">
|
||||
<li class="disabled"><a>
|
||||
<f:translate key="widget.pagination.ellipsis"/>
|
||||
</a></li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.displayRangeEnd} < {pagination.numberOfPages}">
|
||||
<li class="last">
|
||||
<f:link.action arguments="{currentAlbumPage: pagination.numberOfPages, mediaAlbum: mediaAlbum}">
|
||||
{pagination.numberOfPages}
|
||||
</f:link.action>
|
||||
</li>
|
||||
</f:if>
|
||||
<f:if condition="{pagination.nextPageNumber}">
|
||||
<li class="next">
|
||||
<f:link.action arguments="{currentAlbumPage: pagination.nextPageNumber, mediaAlbum: mediaAlbum}">
|
||||
<f:translate key="widget.pagination.next"/>
|
||||
</f:link.action>
|
||||
</li>
|
||||
</f:if>
|
||||
</ul>
|
||||
</div>
|
||||
</f:if>
|
||||
</f:section>
|
||||
@@ -0,0 +1,45 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<!--
|
||||
Displays a flattened, one-dimensional album list
|
||||
Theme: Bootstrap3
|
||||
-->
|
||||
|
||||
<f:section name="AlbumsList">
|
||||
<div class="albums-list">
|
||||
<f:render partial="AlbumsPagination" contentAs="content" arguments="{pagination: mediaAlbumsPagination, mediaAlbum: mediaAlbum}">
|
||||
<f:if condition="{mediaAlbumsPagination.paginator.paginatedItems}">
|
||||
<f:then>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<f:for each="{mediaAlbumsPagination.paginator.paginatedItems}" as="pagedMediaAlbum">
|
||||
<div class="thumb col-xs-6 col-sm-4 col-md-3 col-lg-2">
|
||||
<f:render section="AlbumPreview" arguments="{mediaAlbum:pagedMediaAlbum}" />
|
||||
</div>
|
||||
</f:for>
|
||||
</div>
|
||||
</div>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<div class="alert alert-info">
|
||||
<p><f:translate key="no_albums_found">No albums found.</f:translate></p>
|
||||
</div>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:render>
|
||||
</div>
|
||||
</f:section>
|
||||
|
||||
<f:section name="AlbumPreview">
|
||||
<f:if condition="{0:0, 1:1} == {0:mediaAlbum.assetsCount, 1:settings.list.hideEmptyAlbums}">
|
||||
<f:else>
|
||||
<div class="img-thumbnail">
|
||||
<f:render partial="MediaAlbum/Thumb" section="Thumb" arguments="{mediaAlbum:mediaAlbum, random:settings.list.thumb.random, width:settings.list.thumb.width, height:settings.list.thumb.height, resizeMode:settings.list.thumb.resizeMode}" />
|
||||
</div>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,57 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<!--
|
||||
Displays assets of an album in FlatList view
|
||||
Theme: Bootstrap3
|
||||
-->
|
||||
|
||||
<f:section name="AssetsList">
|
||||
<div class="album">
|
||||
<f:if condition="{settings.album.displayTitle}">
|
||||
<h3>{mediaAlbum.title}</h3>
|
||||
</f:if>
|
||||
<div class="description"><f:format.html>{mediaAlbum.webdescription}</f:format.html></div>
|
||||
<f:render partial="AlbumPagination" contentAs="content" arguments="{pagination: mediaAlbumPagination, mediaAlbum: mediaAlbum}">
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:for each="{mediaAlbumPagination.paginator.itemsBefore}" as="mediaAsset">
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass} {settings.album.lightbox.styleClass}-{mediaAlbum.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}"></a>
|
||||
</f:for>
|
||||
</f:if>
|
||||
<f:if condition="{mediaAlbumPagination.paginator.paginatedItems}">
|
||||
<f:then>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<f:for each="{mediaAlbumPagination.paginator.paginatedItems}" as="mediaAsset" iteration="i">
|
||||
<div class="thumb col-xs-6 col-sm-4 col-md-3 col-lg-2">
|
||||
<f:render partial="MediaAsset/Thumb" section="Thumb" arguments="{mediaAlbum:mediaAlbum,mediaAsset:mediaAsset}" />
|
||||
</div>
|
||||
</f:for>
|
||||
</div>
|
||||
</div>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<div class="alert alert-info">
|
||||
<p><f:translate key="no_assets_found">No assets found.</f:translate></p>
|
||||
</div>
|
||||
</f:else>
|
||||
</f:if>
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:for each="{mediaAlbumPagination.paginator.itemsAfter}" as="mediaAsset">
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass} {settings.album.lightbox.styleClass}-{mediaAlbum.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}"></a>
|
||||
</f:for>
|
||||
</f:if>
|
||||
</f:render>
|
||||
<f:if condition="{showBackLink}">
|
||||
<div class="navigation">
|
||||
<f:link.action class="btn btn-default" controller="MediaAlbum"><f:translate key="back_to_albums_list">Back to album list</f:translate></f:link.action>
|
||||
</div>
|
||||
</f:if>
|
||||
</div>
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:render partial="MediaAlbum/Lightbox" section="Lightbox" arguments="{mediaAlbum:mediaAlbum}" />
|
||||
</f:if>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,33 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<!--
|
||||
Displays an album list
|
||||
Theme: Bootstrap3
|
||||
-->
|
||||
|
||||
<f:section name="AlbumsList">
|
||||
<f:render partial="AlbumsPagination" contentAs="content" arguments="{pagination: mediaAlbumsPagination, mediaAlbum: mediaAlbum}">
|
||||
<f:if condition="{mediaAlbumsPagination.paginator.paginatedItems}">
|
||||
<f:then>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<f:for each="{mediaAlbumsPagination.paginator.paginatedItems}" as="pagedMediaAlbum">
|
||||
<div class="thumb col-xs-6 col-sm-4 col-md-3 col-lg-2">
|
||||
<f:render partial="MediaAlbum/Thumb" section="Thumb" arguments="{mediaAlbum:pagedMediaAlbum, random:settings.list.thumb.random, width:settings.list.thumb.width, height:settings.list.thumb.height, resizeMode:settings.list.thumb.resizeMode}" />
|
||||
</div>
|
||||
</f:for>
|
||||
</div>
|
||||
</div>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<div class="alert alert-info">
|
||||
<p><f:translate key="no_albums_found">No albums found.</f:translate></p>
|
||||
</div>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:render>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,34 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<!--
|
||||
Displays a media asset
|
||||
Theme: Bootstrap3
|
||||
-->
|
||||
|
||||
<f:section name="Detail">
|
||||
<f:if condition="{mediaAsset}">
|
||||
<f:then>
|
||||
<f:media
|
||||
file="{mediaAsset}"
|
||||
alt="{alt}"
|
||||
title="{f:if(condition:title, then:title, else:'{mf:fileTitle(file:mediaAsset)}')}"
|
||||
height="{height}{resizeMode}"
|
||||
width="{width}{resizeMode}"
|
||||
class="img-responsive"
|
||||
/>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:image
|
||||
src="{settings.list.dummyImage}"
|
||||
alt=""
|
||||
height="{height}{resizeMode}"
|
||||
width="{width}{resizeMode}"
|
||||
class="img-responsive img-dummy"
|
||||
/>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,26 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<!--
|
||||
Displays a thumbnail of a media asset
|
||||
Theme: Bootstrap3
|
||||
-->
|
||||
|
||||
<f:section name="Thumb">
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:then>
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass} {settings.album.lightbox.styleClass}-{mediaAlbum.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}"
|
||||
data-lightbox-width="{mediaAsset.properties.width}" data-lightbox-height="{mediaAsset.properties.height}">
|
||||
<f:render partial="MediaAsset/Detail" section="Detail" arguments="{alt:mediaAsset.alternative,title:mediaAsset.title,mediaAsset:mediaAsset,width:settings.album.thumb.width,height:settings.album.thumb.height,resizeMode:settings.album.thumb.resizeMode}" />
|
||||
</a>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:link.action action="showAsset" arguments="{mediaAlbum:mediaAlbum,mediaAssetUid:mediaAsset.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}">
|
||||
<f:render partial="MediaAsset/Detail" section="Detail" arguments="{alt:mediaAsset.alternative,title:mediaAsset.title,mediaAsset:mediaAsset,width:settings.album.thumb.width,height:settings.album.thumb.height,resizeMode:settings.album.thumb.resizeMode}" />
|
||||
</f:link.action>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,78 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="main">
|
||||
<f:flashMessages />
|
||||
<f:if condition="{mediaAlbum}">
|
||||
<f:then>
|
||||
<div class="album clearfix">
|
||||
<f:if condition="{settings.album.displayTitle}">
|
||||
<h3>{mediaAlbum.title}</h3>
|
||||
</f:if>
|
||||
<div class="description"><f:format.html>{mediaAlbum.webdescription}</f:format.html></div>
|
||||
<f:if condition="{mediaAlbums}">
|
||||
<f:then>
|
||||
<f:render partial="MediaAlbum/NestedList/AlbumsList" section="AlbumsList" arguments="{mediaAlbums:mediaAlbums, mediaAlbumsPagination: mediaAlbumsPagination}" />
|
||||
</f:then>
|
||||
</f:if>
|
||||
<f:render partial="AlbumPagination" contentAs="content" arguments="{pagination: mediaAlbumPagination, mediaAlbum: mediaAlbum}">
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:for each="{mediaAlbumPagination.paginator.itemsBefore}" as="mediaAsset">
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass} {settings.album.lightbox.styleClass}-{mediaAlbum.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}"></a>
|
||||
</f:for>
|
||||
</f:if>
|
||||
<f:if condition="{mediaAlbumPagination.paginator.paginatedItems}">
|
||||
<f:then>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<f:for each="{mediaAlbumPagination.paginator.paginatedItems}" as="mediaAsset">
|
||||
<div class="thumb col-xs-6 col-sm-4 col-md-3 col-lg-2">
|
||||
<f:render partial="MediaAsset/Thumb" section="Thumb" arguments="{mediaAlbum:mediaAlbum,mediaAsset:mediaAsset}" />
|
||||
</div>
|
||||
</f:for>
|
||||
</div>
|
||||
</div>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:if condition="{mediaAlbums}">
|
||||
<f:else>
|
||||
<div class="alert alert-info">
|
||||
<p><f:translate key="no_assets_found">No assets found.</f:translate></p>
|
||||
</div>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:else>
|
||||
</f:if>
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:for each="{mediaAlbumPagination.paginator.itemsAfter}" as="mediaAsset">
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}"></a>
|
||||
</f:for>
|
||||
</f:if>
|
||||
</f:render>
|
||||
<f:if condition="{showBackLink}">
|
||||
<div class="navigation">
|
||||
<f:if condition="{parentAlbum}">
|
||||
<f:then>
|
||||
<f:link.action class="btn btn-default" controller="MediaAlbum" arguments="{mediaAlbum:parentAlbum}"><f:translate id="back_to_%s" arguments="{0: parentAlbum.title}">Back to %s</f:translate></f:link.action>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:link.action class="btn btn-default" controller="MediaAlbum"><f:translate key="back_to_album">Back to album</f:translate></f:link.action>
|
||||
</f:else>
|
||||
</f:if>
|
||||
</div>
|
||||
</f:if>
|
||||
</div>
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:render partial="MediaAlbum/Lightbox" section="Lightbox" arguments="{mediaAlbum:mediaAlbum}" />
|
||||
</f:if>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:render partial="MediaAlbum/NestedList/AlbumsList" section="AlbumsList" arguments="{mediaAlbums:mediaAlbums, mediaAlbumsPagination: mediaAlbumsPagination}" />
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,57 @@
|
||||
<div xmlns="http://www.w3.org/1999/xhtml" lang="en"
|
||||
xmlns:f="http://typo3.org/ns/fluid/ViewHelpers"
|
||||
xmlns:mf="http://typo3.org/ns/MiniFranske/FsMediaGallery/ViewHelpers">
|
||||
|
||||
<f:layout name="Default" />
|
||||
|
||||
<f:section name="main">
|
||||
<f:flashMessages />
|
||||
<f:if condition="{mediaAlbum}">
|
||||
<f:then>
|
||||
<div class="album">
|
||||
<f:if condition="{settings.album.displayTitle}">
|
||||
<h3>{mediaAlbum.title}</h3>
|
||||
</f:if>
|
||||
<div class="description"><f:format.html>{mediaAlbum.webdescription}</f:format.html></div>
|
||||
<f:render partial="AlbumPagination" contentAs="content" arguments="{pagination: mediaAlbumPagination, mediaAlbum: mediaAlbum}">
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:for each="{mediaAlbumPagination.paginator.itemsBefore}" as="mediaAsset">
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass} {settings.album.lightbox.styleClass}-{mediaAlbum.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}"></a>
|
||||
</f:for>
|
||||
</f:if>
|
||||
<f:if condition="{mediaAlbumPagination.paginator.paginatedItems}">
|
||||
<f:then>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<f:for each="{mediaAlbumPagination.paginator.paginatedItems}" as="mediaAsset">
|
||||
<div class="thumb col-xs-6 col-sm-4 col-md-3 col-lg-2">
|
||||
<f:render partial="MediaAsset/Thumb" section="Thumb" arguments="{mediaAlbum:mediaAlbum,mediaAsset:mediaAsset}" />
|
||||
</div>
|
||||
</f:for>
|
||||
</div>
|
||||
</div>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<div class="alert alert-info">
|
||||
<p><f:translate key="no_assets_found">No assets found.</f:translate></p>
|
||||
</div>
|
||||
</f:else>
|
||||
</f:if>
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:for each="{mediaAlbumPagination.paginator.itemsAfter}" as="mediaAsset">
|
||||
<a href="{f:uri.image(image:mediaAsset, width:'{settings.album.lightbox.asset.width}{settings.album.lightbox.asset.resizeMode}', height:'{settings.album.lightbox.asset.height}{settings.album.lightbox.asset.resizeMode}')}" rel="{settings.album.lightbox.relPrefix}{mediaAlbum.uid}" class="{settings.album.lightbox.styleClass} {settings.album.lightbox.styleClass}-{mediaAlbum.uid}" title="{mf:fileTitle(file:mediaAsset)} - {mediaAlbum.title}"></a>
|
||||
</f:for>
|
||||
</f:if>
|
||||
</f:render>
|
||||
</div>
|
||||
<f:if condition="{settings.album.lightbox.enable}">
|
||||
<f:render partial="MediaAlbum/Lightbox" section="Lightbox" arguments="{mediaAlbum:mediaAlbum}" />
|
||||
</f:if>
|
||||
</f:then>
|
||||
<f:else>
|
||||
<f:translate key="no_album_found" />
|
||||
</f:else>
|
||||
</f:if>
|
||||
</f:section>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,22 @@
|
||||
.fs-media-gallery .thumb {
|
||||
float: left;
|
||||
border: 1px solid #EEE;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.fs-media-gallery .thumb a,
|
||||
.fs-media-gallery .thumb a:link,
|
||||
.fs-media-gallery .thumb a:hover,
|
||||
.fs-media-gallery .thumb a:active,
|
||||
.fs-media-gallery .thumb a:visited {
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
.fs-media-gallery .navigation {
|
||||
clear: both;
|
||||
margin-top:10px;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
.fs-media-gallery .pagination {
|
||||
margin-top:10px;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
.fs-media-gallery .thumb {
|
||||
padding:5px;
|
||||
}
|
||||
.fs-media-gallery .thumb a,
|
||||
.fs-media-gallery .thumb a:link,
|
||||
.fs-media-gallery .thumb a:hover,
|
||||
.fs-media-gallery .thumb a:active,
|
||||
.fs-media-gallery .thumb a:visited {
|
||||
display: block;
|
||||
text-align: center;
|
||||
}
|
||||
.fs-media-gallery .navigation {
|
||||
clear: both;
|
||||
margin-top:10px;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
.fs-media-gallery .pagination {
|
||||
margin-top:10px;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
.fs-media-gallery .container-fluid {
|
||||
padding:0 10px;
|
||||
}
|
||||
.fs-media-gallery .img-thumbnail .dummy {
|
||||
background:#EEEEEE;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#FFC857" d="M16 4v10H0V2h7l1.33 2H16z"/><path fill="#E8A33D" d="M16 5H8.33L7 7H0V4h16v1z"/><g><path fill="#59F" d="M5 5h11v11H5z"/><path opacity=".2" d="M15 6v9H6V6h9m1-1H5v11h11V5z"/><path fill="#FFF" d="M12 14H7l1.25-2 1.25-2 1.25 2L12 14z"/><path fill="#FFF" d="M14 14H9l1.25-1.5L11.5 11l1.25 1.5L14 14z"/><circle fill="#FFF" cx="13" cy="9" r="1"/></g></svg>
|
||||
|
After Width: | Height: | Size: 433 B |
|
After Width: | Height: | Size: 809 B |
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
viewBox="0 0 16 16"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
width="100%"
|
||||
height="100%"
|
||||
sodipodi:docname="mediagallery-add.svg">
|
||||
<metadata
|
||||
id="metadata14">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs12" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1871"
|
||||
inkscape:window-height="1056"
|
||||
id="namedview10"
|
||||
showgrid="false"
|
||||
inkscape:zoom="53.274213"
|
||||
inkscape:cx="9.0040555"
|
||||
inkscape:cy="4.2332151"
|
||||
inkscape:window-x="49"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="g4" />
|
||||
<g
|
||||
class="icon-color"
|
||||
id="g4">
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 4.392369,12.471088 -3.86678643,-0.01877 -4e-8,-11.1310884 5.04934727,4e-7 2.046018,1.9897056 7.9025092,-0.018771 0.01877,9.0475294 0,0"
|
||||
id="path4129"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccc" />
|
||||
<g
|
||||
id="g3088"
|
||||
transform="translate(0,-1)">
|
||||
<g
|
||||
id="g3070">
|
||||
<path
|
||||
id="path3076"
|
||||
d="M 12,14 H 7 l 1.25,-2 1.25,-2 1.25,2 1.25,2 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff" />
|
||||
<path
|
||||
id="path3078"
|
||||
d="M 14,14 H 9 L 10.25,12.5 11.5,11 12.75,12.5 14,14 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff" />
|
||||
<circle
|
||||
id="circle3080"
|
||||
r="1"
|
||||
cy="9"
|
||||
cx="13"
|
||||
sodipodi:cx="13"
|
||||
sodipodi:cy="9"
|
||||
sodipodi:rx="1"
|
||||
sodipodi:ry="1"
|
||||
style="fill:#ffffff"
|
||||
d="m 14,9 c 0,0.5522847 -0.447715,1 -1,1 -0.552285,0 -1,-0.4477153 -1,-1 0,-0.5522847 0.447715,-1 1,-1 0.552285,0 1,0.4477153 1,1 z" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
transform="translate(-0.02649702,-0.41501421)"
|
||||
id="g3070-9">
|
||||
<path
|
||||
id="path3072"
|
||||
d="M 5,5 H 16 V 16 H 5 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none" />
|
||||
<path
|
||||
id="path3074"
|
||||
d="M 15.018771,6.3191037 V 15.319104 H 6.0187708 V 6.3191037 h 9.0000002 m 1,-1 H 5.0187708 V 16.319104 H 16.018771 V 5.3191037 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000" />
|
||||
<path
|
||||
id="path3076-2"
|
||||
d="M 12,14 H 7 l 1.25,-2 1.25,-2 1.25,2 1.25,2 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000" />
|
||||
<path
|
||||
id="path3078-8"
|
||||
d="M 14,14 H 9 L 10.25,12.5 11.5,11 12.75,12.5 14,14 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
id="circle3080-6"
|
||||
r="1"
|
||||
cy="9"
|
||||
cx="13"
|
||||
sodipodi:cx="13"
|
||||
sodipodi:cy="9"
|
||||
sodipodi:rx="1"
|
||||
sodipodi:ry="1"
|
||||
style="fill:#000000"
|
||||
d="m 14,9 c 0,0.5522847 -0.447715,1 -1,1 -0.552285,0 -1,-0.4477153 -1,-1 0,-0.5522847 0.447715,-1 1,-1 0.552285,0 1,0.4477153 1,1 z" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 819 B |
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
viewBox="0 0 16 16"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
width="100%"
|
||||
height="100%"
|
||||
sodipodi:docname="mediagallery-add.svg">
|
||||
<metadata
|
||||
id="metadata14">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs12" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1871"
|
||||
inkscape:window-height="1056"
|
||||
id="namedview10"
|
||||
showgrid="false"
|
||||
inkscape:zoom="53.274213"
|
||||
inkscape:cx="9.0040555"
|
||||
inkscape:cy="4.2332151"
|
||||
inkscape:window-x="49"
|
||||
inkscape:window-y="24"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="g4" />
|
||||
<g
|
||||
class="icon-color"
|
||||
id="g4">
|
||||
<path
|
||||
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
||||
d="m 4.392369,12.471088 -3.86678643,-0.01877 -4e-8,-11.1310884 5.04934727,4e-7 2.046018,1.9897056 7.9025092,-0.018771 0.01877,9.0475294 0,0"
|
||||
id="path4129"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="cccccccc" />
|
||||
<g
|
||||
id="g3088"
|
||||
transform="translate(0,-1)">
|
||||
<g
|
||||
id="g3070">
|
||||
<path
|
||||
id="path3076"
|
||||
d="M 12,14 H 7 l 1.25,-2 1.25,-2 1.25,2 1.25,2 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff" />
|
||||
<path
|
||||
id="path3078"
|
||||
d="M 14,14 H 9 L 10.25,12.5 11.5,11 12.75,12.5 14,14 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff" />
|
||||
<circle
|
||||
id="circle3080"
|
||||
r="1"
|
||||
cy="9"
|
||||
cx="13"
|
||||
sodipodi:cx="13"
|
||||
sodipodi:cy="9"
|
||||
sodipodi:rx="1"
|
||||
sodipodi:ry="1"
|
||||
style="fill:#ffffff"
|
||||
d="m 14,9 c 0,0.5522847 -0.447715,1 -1,1 -0.552285,0 -1,-0.4477153 -1,-1 0,-0.5522847 0.447715,-1 1,-1 0.552285,0 1,0.4477153 1,1 z" />
|
||||
</g>
|
||||
</g>
|
||||
<g
|
||||
transform="translate(-0.02649702,-0.41501421)"
|
||||
id="g3070-9">
|
||||
<path
|
||||
id="path3072"
|
||||
d="M 5,5 H 16 V 16 H 5 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:none" />
|
||||
<path
|
||||
id="path3074"
|
||||
d="M 15.018771,6.3191037 V 15.319104 H 6.0187708 V 6.3191037 h 9.0000002 m 1,-1 H 5.0187708 V 16.319104 H 16.018771 V 5.3191037 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000" />
|
||||
<path
|
||||
id="path3076-2"
|
||||
d="M 12,14 H 7 l 1.25,-2 1.25,-2 1.25,2 1.25,2 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000" />
|
||||
<path
|
||||
id="path3078-8"
|
||||
d="M 14,14 H 9 L 10.25,12.5 11.5,11 12.75,12.5 14,14 z"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#000000" />
|
||||
<circle
|
||||
id="circle3080-6"
|
||||
r="1"
|
||||
cy="9"
|
||||
cx="13"
|
||||
sodipodi:cx="13"
|
||||
sodipodi:cy="9"
|
||||
sodipodi:rx="1"
|
||||
sodipodi:ry="1"
|
||||
style="fill:#000000"
|
||||
d="m 14,9 c 0,0.5522847 -0.447715,1 -1,1 -0.552285,0 -1,-0.4477153 -1,-1 0,-0.5522847 0.447715,-1 1,-1 0.552285,0 1,0.4477153 1,1 z" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 713 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill="#FFC857" d="M16 4v10H0V2h7l1.33 2H16z"/><path fill="#E8A33D" d="M16 5H8.33L7 7H0V4h16v1z"/><g><path fill="#59F" d="M5 5h11v11H5z"/><path opacity=".2" d="M15 6v9H6V6h9m1-1H5v11h11V5z"/><path fill="#FFF" d="M12 14H7l1.25-2 1.25-2 1.25 2L12 14z"/><path fill="#FFF" d="M14 14H9l1.25-1.5L11.5 11l1.25 1.5L14 14z"/><circle fill="#FFF" cx="13" cy="9" r="1"/></g></svg>
|
||||
|
After Width: | Height: | Size: 433 B |
|
After Width: | Height: | Size: 602 B |