Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Allow to manually set the gallery in FileTree #5884

Closed
qzminski opened this issue Jun 6, 2013 · 3 comments
Closed

Allow to manually set the gallery in FileTree #5884

qzminski opened this issue Jun 6, 2013 · 3 comments
Labels
Milestone

Comments

@qzminski
Copy link
Member

qzminski commented Jun 6, 2013

It is not possible to manually set the gallery in FileTree in the custom modules. Again there is a limitation, now requiring a "type" field in the database. Can't we just have a new eval option?

https://github.com/contao/core/blob/master/system/modules/core/widgets/FileTree.php#L106

@Serhii-DV
Copy link
Contributor

This can be added in new 3.2 version without any core improvements.

We can use "isGallery"=>true or "isDownloads"=>true eval option for fileTree input.
And in FileTree widget instead of:

$this->blnIsGallery = (isset($GLOBALS['TL_DCA'][$this->strTable]['fields']['type']['eval']['gallery_types']) && in_array($this->activeRecord->type, $GLOBALS['TL_DCA'][$this->strTable]['fields']['type']['eval']['gallery_types']));
$this->blnIsDownloads = (isset($GLOBALS['TL_DCA'][$this->strTable]['fields']['type']['eval']['downloads_types']) && in_array($this->activeRecord->type, $GLOBALS['TL_DCA'][$this->strTable]['fields']['type']['eval']['downloads_types']));

use this:

$this->blnIsGallery = $this->isGallery || ((isset($GLOBALS['TL_DCA'][$this->strTable]['fields']['type']['eval']['gallery_types']) && in_array($this->activeRecord->type, $GLOBALS['TL_DCA'][$this->strTable]['fields']['type']['eval']['gallery_types'])));
$this->blnIsDownloads = $this->isDownloads || ((isset($GLOBALS['TL_DCA'][$this->strTable]['fields']['type']['eval']['downloads_types']) && in_array($this->activeRecord->type, $GLOBALS['TL_DCA'][$this->strTable]['fields']['type']['eval']['downloads_types'])));

@qzminski
Copy link
Member Author

I agree with DyaGa.

@leofeyer
Copy link
Member

Changed in e5923a9.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants