Feature proposal #4993
closedCreate plugin API library files for activity handling
Description
Further generalize and improve the usability of the activity API then turn it into a namespaced plugin API library that adds to CBLib.
Updated by krileon almost 10 years ago
- Target version changed from 4.0.0 to 3.0.0
This is going to be necessary to decouple the activity logging. The various plugins should make a call to CBs DI to grab the CBActivity class. This class should allow easy construction of an activity entry. Table class needs to go in there as well. Suggested structure:
CBActivity/Table/ActivityTable.php
CBActivity/Table/HiddenTable.php
CBActivity/CBActivity.php
Should be accessed same way session DI usage is used in TableBrowser. Example as follows.
Application::DI()->get( 'Plugin\CBActivity\CBActivity' )
Updated by krileon almost 10 years ago
The Activity.php should have a constructor to supply the type, subtype, and item. From there object functions should be able to store activity, output an activity row, output a stream (activity or comment, either one).. needs further thought, but the api should be able to construct the query and output the stream (template included).
Updated by krileon almost 10 years ago
Actually this should eventually have the following base classes.
Stream.php
Activity.php
Comment.php
Like.php
Share.php
The stream api should handle displaying a comment or activity stream. This means it handles the query and output functionality. Activity should handle activity management, which is simple create, edit, save, delete, etc.. the same applies to Comment except it handles commenting.. these should also handle single entry display, but no stream handling. Like should handle display of the thumbs up, thumbs down, and toast icons as well as their storage behavior.
Initially there should only be the following though.
Stream.php
Activity.php
Updated by krileon almost 10 years ago
Seams silly to have a class for a class. Let the table classes handle storage. Instead probably the below would be good.
Stream.php
StreamInerface.php
Like.php
LikeInterface.php
Share.php
ShareInterface.php
These purely handle the display aspects. Storage is already handled very well with table objects, as it should be, so there isn't need for an additional class to just call existing table behavior.
Updated by krileon almost 10 years ago
CBActivity.php would contain the global functions (e.g. cbactivityClass functions).