CB Gallery on a JEvents Event?

2 months 5 days ago #326034 by kdave321
CB Gallery on a JEvents Event? was created by kdave321
I was kinda hoping this would be the same story as CB Comments. However, regardless of input, the trigger just generates Comments. If I put [cbgallery:gallery /] string in the custom layout, it just returns my own gallery. I have cbgallerybot working great on specific articles.

Please Log in to join the conversation.

2 months 5 days ago #326038 by kdave321
Replied by kdave321 on topic CB Gallery on a JEvents Event?
woops. In "Content - CB Gallery", I just had to add my com_jevents context. working now.

Please Log in to join the conversation.

2 months 5 days ago #326039 by kdave321
Replied by kdave321 on topic CB Gallery on a JEvents Event?
Any clue on how to have different Create permissions by context? I have only admins can create gallery items in my special articles, but for events, I need to restrict gallery uploads to attendees of the event.

Please Log in to join the conversation.

2 months 5 days ago - 2 months 5 days ago #326041 by krileon
Replied by krileon on topic CB Gallery on a JEvents Event?

Any clue on how to have different Create permissions by context? I have only admins can create gallery items in my special articles, but for events, I need to restrict gallery uploads to attendees of the event.

Not without coding that. Specifically you'd need to act on the gallery_onGalleryItemsCreateAccess trigger, parse the asset of the gallery, and determine if create permissions should be given. Its variables are as follows.

$_PLUGINS->trigger( 'gallery_onGalleryItemsCreateAccess', array( &$access, $type, $method, $user, $gallery ) );


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

1 month 3 weeks ago #326216 by kdave321
Replied by kdave321 on topic CB Gallery on a JEvents Event?
Not sure if this is what you meant, but I did get this working by modifying the context in the JEvents script ( tricky part was testing for event attendee or creator ) before triggering onContentAfterDisplay. Then I added a test for the context in CBGallery.php so I could skip triggering gallery_onGalleryItemsCreateAccess.

Thanks.

Please Log in to join the conversation.

1 month 3 weeks ago #326217 by krileon
Replied by krileon on topic CB Gallery on a JEvents Event?
Do not modify the core code. Use the trigger to extend the access checks. Your core modifications will be lost every time you update. The below for example can extend the media create access checks.

Global
Triggers: gallery_onGalleryItemsCreateAccess
Type: Code
User: Automatic
Access: Everybody
Conditions
Field: Custom > Value
Custom Value: [var5_asset]
Operator: Is REGEXP
Value: /^jevents.\d+/
Action
Method: PHP
Code:
$variables['var1'] = true;
Parameters
References: Variable 1

This should bypass the access check for any gallery with an asset beginning with jevents.EVENT_ID for example. You can add further conditions to it to condition who exactly should have create access permissions.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.190 seconds

Facebook Twitter LinkedIn