I'm still hesitant between the two solutions.
1) CB activity seems great because I could get the activity id and store it in another table to check the correct store of data to our IA or not (we add the website data to a vector database)
Also fine is the fact that the autoaction would act on a single post, so it's easy to reuse our old code for CB Gallery without too much changes and depending upon the autoaction id.
On the other hand it seems difficult to get the link consistently from the message. Do you have a substitution for the link only ? or should I parse the full message ? For instance if the user changes the message but not the link the autoaction should not be launched.
Also is it possible to change the activity invite to adapt it to the specific case ? something like What website would you like to add to MoniA ?
So CB Activity seems nicer for the display and the ease of use provided that I could fix the above points
2) A group field of website field seems less fancy and maybe more robust at first but it seems difficult to iterate to all the data each time and launch the autoaction only for the fields that have been updated or removed.
That would mean that I would need to code another php code to trigger the existing code at each field change because I don't see how to do this easily with the autoaction.
I guess that I could use conditions to check if the fields have been changed.
Are there substitutions to access each website data if I have a form like this ?
Code:
------WebKitFormBoundary4NzSsPCxZAz1GGyW
Content-Disposition: form-data; name="_cb_websites_link_group__0__index"
0
------WebKitFormBoundary4NzSsPCxZAz1GGyW
Content-Disposition: form-data; name="_cb_websites_link_group__0__cb_website2"
test.org
------WebKitFormBoundary4NzSsPCxZAz1GGyW
Content-Disposition: form-data; name="_cb_websites_link_group__0__cb_website2__privacy[]"
0
------WebKitFormBoundary4NzSsPCxZAz1GGyW
Content-Disposition: form-data; name="_cb_websites_link_group__1__index"
1
------WebKitFormBoundary4NzSsPCxZAz1GGyW
Content-Disposition: form-data; name="_cb_websites_link_group__1__cb_website2"
test2.org
------WebKitFormBoundary4NzSsPCxZAz1GGyW
Content-Disposition: form-data; name="_cb_websites_link_group__1__cb_website2__privacy[]"
0
------WebKitFormBoundary4NzSsPCxZAz1GGyW
Content-Disposition: form-data; name="_cb_websites_link_group__count"
2
------WebKitFormBoundary4NzSsPCxZAz1GGyW
Content-Disposition: form-data; name="cc65f289cc1db5051b3d845ef157d40a"
1
------WebKitFormBoundary4NzSsPCxZAz1GGyW--
Knowing that for now we use CB Gallery with code autoaction on gallery_onAfterCreateItem and gallery_onAfterUpdateItem which maps these variables...
Code:
$userid = $action->string($user, '[var1_user_id]');
$document = $variables['var1']->path();
$documentName = basename($document);
$namefile = pathinfo($variables['var1']->name(), PATHINFO_FILENAME);
$olddocumentname = $action->string($user, '[var2_value]');
$olddocument = $variables['var2']->path();
$oldid = $action->string($user, '[var2_id]');
$ext = $variables['var1']->extension();
$link = $variables['var1']->domain();
$id = $action->string($user, '[var1_id]');
... ideally that could be great to use some CB Activity triggers with roughly the same data/variables.
I may need your advice upon the two solutions and the triggers to use for CB Activity if I can fix the points above.
Thanks for your time.