PHP Class AllViewedPlugin, vanilla

Inheritance: extends Gdn_Plugin
Mostrar archivo Open project: vanilla/vanilla

Public Methods

Method Description
base_render_before ( Gdn_Controller $sender ) Adds "Mark All Viewed" to main menu.
discussionModel_setCalculatedFields_handler ( DiscussionModel $sender ) Modify CountUnreadComments to account for DateAllViewed.
discussionsController_markAllViewed_create ( DiscussionsController $sender ) Allows user to mark all discussions as viewed.
discussionsController_markCategoryViewed_create ( DiscussionsController $sender, integer $CategoryID ) Allows user to mark all discussions in a specified category as viewed.
meModule_flyoutMenu_handler ( MeModule $sender ) Adds "Mark All Viewed" and (conditionally) "Mark Category Viewed" to MeModule menu.

Private Methods

Method Description
checkDiscussionDate ( DiscussionModel $Discussion, integer | string $DateAllViewed ) Helper function to actually override a discussion's unread status
getCommentCountSince ( integer $DiscussionID, integer | string $DateAllViewed ) : integer Get the number of comments inserted since the given timestamp.
markCategoryRead ( CategoryModel $categoryModel, integer $categoryID ) Helper function that actually sets the DateMarkedRead column in UserCategory
recursiveMarkCategoryRead ( CategoryModel $CategoryModel, array $UnprocessedCategories, array $ParentIDs ) Helper function to recursively mark categories as read based on a Category's ParentID.

Method Details

base_render_before() public method

Adds "Mark All Viewed" to main menu.
Since: 1.0
public base_render_before ( Gdn_Controller $sender )
$sender Gdn_Controller

discussionModel_setCalculatedFields_handler() public method

Required in DiscussionModel->get() just before the return: $this->EventArguments['Data'] = $Data; $this->fireEvent('AfterAddColumns');
public discussionModel_setCalculatedFields_handler ( DiscussionModel $sender )
$sender DiscussionModel

discussionsController_markAllViewed_create() public method

Allows user to mark all discussions as viewed.
Since: 1.0
public discussionsController_markAllViewed_create ( DiscussionsController $sender )
$sender DiscussionsController

discussionsController_markCategoryViewed_create() public method

Allows user to mark all discussions in a specified category as viewed.
Since: 1.0
public discussionsController_markCategoryViewed_create ( DiscussionsController $sender, integer $CategoryID )
$sender DiscussionsController
$CategoryID integer

meModule_flyoutMenu_handler() public method

Adds "Mark All Viewed" and (conditionally) "Mark Category Viewed" to MeModule menu.
Since: 2.0
public meModule_flyoutMenu_handler ( MeModule $sender )
$sender MeModule