CB Gallery question

10 months 3 weeks ago - 10 months 3 weeks ago #333960 by activha
Replied by activha on topic CB Gallery question
I meant the privacy status of the document in CB gallery :-)

So that if the document is set as private by the user I will process it differently.

I also noticed that the trigger gallery_onAfterCreateItem acts once the document is uploaded and not once it's terminated. Is it possible to act when the user clicks on terminate instead ? so that if it does not follow the process we wouldn't have lost items 

Please Log in to join the conversation.

10 months 3 weeks ago #333971 by krileon
Replied by krileon on topic CB Gallery question
Privacy is stored in CB Privacy not CB Gallery so no you can't get that from the gallery object. You'll need to build its privacy object to do that or just query against the privacy database table _comprofiler_plugin_privacy to get its privacy rule (private is 99). The asset for CB Gallery privacy entries will be: gallery.MEDIA_TYPE.MEDIA_ID (e.g. gallery.photos.123).

I also noticed that the trigger gallery_onAfterCreateItem acts once the document is uploaded and not once it's terminated. Is it possible to act when the user clicks on terminate instead ? so that if it does not follow the process we wouldn't have lost items

I've no idea what you mean here. That trigger is fired when a new media entry is created. This will always be the case.


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.

10 months 3 weeks ago - 10 months 3 weeks ago #333989 by activha
Replied by activha on topic CB Gallery question

I've no idea what you mean here. That trigger is fired when a new media entry is created. This will always be the case.

Sorry I forgot that the Cancel button is not the one that confirms the loading but only reverts to the profile page...

Are the triggers gallery_OnAfterCreateitem and gallery_OnAfterUpdateItem enough to deal with all the cases where the users edit the item and its privacy ?

Also if I want to send the file, is $document = $variables->path(); to access it and post it ?

Please Log in to join the conversation.

10 months 3 weeks ago #333995 by krileon
Replied by krileon on topic CB Gallery question

Are the triggers gallery_OnAfterCreateitem and gallery_OnAfterUpdateItem enough to deal with all the cases where the users edit the item and its privacy ?

Yes, the create trigger is fired when new media is created and the update trigger is fired when media is edited.

Also if I want to send the file, is $document = $variables->path(); to access it and post it ?

Files are protected by htaccess permissions. They cannot be accessed directly. They must be output by PHP, which is done with the output function as follows.
$variables['var1']->output();


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.

10 months 3 weeks ago #334000 by activha
Replied by activha on topic CB Gallery question
Ok thanks a lot ;-)

Last issue, is the privacy rule available at the time where the item is added ?

I tried this but always get null
$asset = $action->string($user, '[var1_asset]');

$db    = Factory::getDbo();
$query = $db->getQuery(true)
    ->select('rule')
    ->from($db->quoteName('#__comprofiler_plugin_privacy'))
    ->where($db->quoteName('asset') . ' = ' . $db->quote($asset));
$db->setQuery($query);
$private= $db->loadResult();

Please Log in to join the conversation.

10 months 3 weeks ago #334004 by krileon
Replied by krileon on topic CB Gallery question
The privacy rule is handled by the system action. So it won't be available until after that system action stores it.


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.264 seconds

Facebook Twitter LinkedIn