gantry5
gantry5 copied to clipboard
advise to how develop.i want Separate file and folder for user in gantry
hi, i want separate path for upload or delete file via gantry filepicker or any other place that user can upload or view or delete from gantry. now i write the plugin to access each style by set user as admin of each style.but i have another problem each admin can see other admin file's or delete that. 1-Can you say me all way that user can view/upload/delete from inside of gantry? (i think only way is filepicker field. am i right?) 2- Which file should be edited and can you tell me the path for override it?
Unfortunately, setting a custom location for different users isn't possible; it's only possible to customize this by a particle.
Unfortunately, setting a custom location for different users isn't possible; it's only possible to customize this by a particle.
thank you but i asked reply me to first question. in gantry we only can upload file from filepicker field type?
i am trying to override /public_html/libraries/gantry5/classes/Gantry/Admin/Controller/Json/Filepicker.php for modify upload and view and delete process. am i right?
Yes, but I do not recommend doing that as it'll be overridden upon update.
That said, I would be interested in the change if you can make it work.
i want create override according to this Doc: https://docs.gantry.org/gantry5/advanced/file-overrides#gantry-directory-structure i must override /public_html/libraries/gantry5/classes/Gantry/Admin/Controller/Json/Filepicker.php and autoloader to register classes in that file. i am trying to do it.
also i created a plugin that i say each gantry style who can access to his style that administrator set that access to each other admin. by this way each admin can access to his menu item style and Gantry has many particle that you don't need use joomla module.
That said, I would be interested in the change if you can make it work. if i override that , even you update gantry, it must be still working. i don't understand your mean
Yeah, override works if you add the overridden file to the autoloader. Just be careful with that override as the classes may change in the future and aren't part of the API (so there's no compatibility requirements). That said, I don't think this file is going to change much.
Yeah, override works if you add the overridden file to the autoloader.
hi again @mahagr we do that and it is work correctly for me. but i can't understand your mean about autoloder. are you mean add to autoloader.php in JOOMLA/libraries/gantry5/vendor/twig/twig/lib/Twig/Autoloader.php ? if yes how to override in what path? i study the Gantry5 Doc but i can't understand implement. in each way this code is work and you can test it . if you say this is benefit for Gantry5, you can set this code in the core as a new feature and avoid override process. also a suggest is add a setting to Gantry5 component joomla options to set each admin can only access to his file (upload/view/delete). there are three place modified code that start with " // start changes" and end with "// end changes". replace these code with filepicker.php and see the result in gantry5 filepicker field in each gantry template style: filepicker.zip
friendly bump... @mahagr
friendly bump... @mahagr
where are you @mahagr ? we develop part of gantry and wait for your confirmation...
@mahagr @w00fz @coder4life @kevlardev i implemented separate upload space for each user by the file attached , i only need 2 line help from you.
@hexplor please review my code and if it is possible set in gantry. In short, the code that has been sent makes every user who has access to Gantry management only able to see his own uploaded file, and this code makes a folder for each user, and the files uploaded by him are only accessible by him. be Suitable for modes of Joomla sites where several administrators have access to gantry themes.