trippo / ResponsiveFilemanager

Completely Responsive Filemanager with integration for tinyMCE,CKEditor and CLEditor editor
http://responsivefilemanager.com
Other
809 stars 368 forks source link

Setting folder dynamically #400

Open petrakid opened 6 years ago

petrakid commented 6 years ago

On my site I have the ability for administrative users to change the site's theme. When they select a theme, all of the files, images, etc. pertaining to that them are stored in their own folder. I want to use ResponsiveFilemanager as an easy way to upload theme graphical files (backgrounds, logos, etc.) to the site and for those files to always upload in the correct theme's directory.

Folks that administrate my site don't have the skill to browse through directories, so I want certain folders to always show up based on the theme, and for files to upload to that theme's folder.

How would I accomplish this??

olimarferraz commented 6 years ago

I have the same issue. Up and watching, may I have one solution, but don't know if works for all.

petrakid commented 6 years ago

I figured out how to do it in my situation.

I had to include the database class in the config.php file, after the session_start(); and then do a query getting the currently active theme folder and assign it to a variable. Then for the upload_dir and current_path, I set using that variable. Works like a charm.

I suppose you could use a session to do this, but this seemed more consistent.

olimarferraz commented 6 years ago

My auth system is a SSO, so to use that database is to much painfull for one simple file upload solution, then I use the $_SESSION to store a $_GET parameter from the dialog call and modify/create a root folder according to the user loged.