Hello,
newbie to using Gallery3.
I'll briefly outline my requirements. It'll save time.
I've set up a gallery for a small group of people to upload pictures to. A shared photo album.
It's a single album.
What I want to do is have the settings so that people can't rearrange the album, they can't change album description/title, they can't delete photos or rotate them. But they can edit photos so that people can provide descriptions of the pictures they've uploaded. May appear restrictive but I'm dealing with a group of people who are not exactly confident when it comes to anything to do with computers, nevermind websites! And I don't intend to keep uploading pictures for other people, better things to do.
I've been scratching my head going through the code and all the modules available. Unfortunately I'm just going around in circles now.
Any ideas of how or if this can be achieved?
Any feedback much appreciated.
Kind regards
Nick
Posts: 1857
Closest starting point I know of: http://codex.gallery2.org/Gallery3:Modules:remove_actions
I don't really even understand what you're looking to accomplish. If they "can't change album description/title" how can they "can edit photos so that people can provide descriptions of the pictures they've uploaded"? Honestly though, even if you explain it, I can't really give much more guidance than offering the starting point linked above.
Posts: 8
Thank you tempg.
I'm already editing the Module:remove_actions and have achieved 80% of what is needed.
A little more coding and I should get what's required.
Thanks.
Posts: 27300
Let me know what specific action you removed so I can update the module for others to benefit as well.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 8
Hi Dave,
I've edited the "remove_actions" module to my needs. But I've also extended it.
All Album options can be removed.
All Photo options can be removed.
All Add options can be removed.
If all the options in a menu are selected for removal the menu tab is also removed.
i.e. If you remove Add photos and remove Add album from the Add menu then as these are the only options the menu tab Add is also removed.
No point in having a menu tab that doesn't have a menu.
I have not been able to annotate the checkboxes as I wish to indicate to the user how this works.
How do I submit the revised module?
Cheerio
Nick
Posts: 27300
Post it here and I can review and then I can add it to the code page.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 8
Hi Dave,
as requested.
The only two files I had to work on are
trigger_remove.html.php
admin_remove_actions.php
I feel it is incomplete without a full account of what happens when each group of submenus is selected.
But I don't know how to add text output to admin checkbox form.
Cheerio
Nick
Posts: 27300
Thanks!
Looks good. I would think about re-factoring it a bi to have the same about of if statements to eliminate more and one or two <scrip> and </script> tags.
Care to do that? A great way to contribute back
I'm not sure what you mean by:
Screen shot or a better explanation?
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 8
Hello Dave,
I'll look at refactoring. But may take me some time, I'm a C programmer on microcontrollers, php can I work with and java is just plain horrible.
A string of IF statements etc is common in my field. Refactoring usually produces too many overheads on micros.
As to the text question I'll explain it better.
The code obviously generates a list of checkboxes for the admin to remove the action.
But there are groups of related actions. i.e. the 'Add' group comprises the 'Add album' and 'Add photos'
When all the actions within a group are selected for removal the code also removes the main menu item. e.g 'Add' as there'e no submenu items to display.
What I want to do is insert some text at the top of the checkboxes for each group to indicate to the administrator what happens when they select all the 'remove actions' within a group.
At the moment they'll just see a main menu item disappear and wonder what the hell is going on!
Cheerio
Nick
Posts: 27300
I guess I did not explain vary well.....
I think that all the if statements are needed jut only one opening <script> tag and one closing </script> tag are needed. Now it looks like there will be a opening tag and a closing tag for each bit of JS.
Grouping of the checkboxes can be done. I'll take a look at it a bit later today when I get back from my road trip for my real job.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 8
Hello Dave,
there was a big hole in the edited Remove Actions module.
I omitted the options on the thumbnail phtotos. This is because some of the options use a different wording.
I have corrected this.
Again if all the action are removed from the thumbnail 'options' menu I've made the menu disappear.
Cheerio
Nick
Posts: 27300
Thanks for your contribution!
I have updated the modules codex page to version 2 and refactored it a bit to speed up the JS and have less code.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 5
Just the plugin I needed. Thanks a lot. Some feature requests:
- Remove "Delete this album" (not only "Delete photo")
- Remove "Choose as the album cover"
Posts: 27300
Dr_Spock,
try the version on the codex page. I just added the 2 options but did not test.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 27300
Perhaps the http://codex.gallery2.org/Gallery3:Modules:tag_by_group module is what you are after.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 27300
Updated the remove_actions module to add a few more actions that the admin can remove.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 53
r
Posts: 53
Hello Dave,
Thanks by your advice!
This module is very useful!
But the option to Remove the "Edit album" action is not working here...
I need at the cover of album, for the user, just the options: "Add a photo" and "Organize album"... could you help?
Inside album is working Beautiful!!
Thanks and Regards!
Tony
Posts: 27300
Sure it does but the "edit this album" does not.
edit the modules view file adding the bold around line 20
<? if (module::get_var("remove_actions", "editalbum") == true) : ?> $(document).ready(function(){ $('li > a:contains("<?= t('Edit album') ?>")').remove(); $('li > a:contains("<?= t('Edit this album') ?>")').remove(); }); <? endif ?>
hope that works.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team