AllViewedPlugin::meModule_flyoutMenu_handler PHP Method

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
    public function meModule_flyoutMenu_handler($sender)
    {
        // Add "Mark All Viewed" to menu
        if (Gdn::session()->isValid()) {
            echo wrap(anchor(sprite('SpMarkAllViewed') . ' ' . t('Mark All Viewed'), '/discussions/markallviewed', 'Hijack'), 'li', ['class' => 'MarkAllViewed']);
            $CategoryID = (int) (empty(Gdn::controller()->CategoryID) ? 0 : Gdn::controller()->CategoryID);
            if ($CategoryID > 0) {
                echo wrap(anchor(sprite('SpMarkCategoryViewed') . ' ' . t('Mark Category Viewed'), "/discussions/markcategoryviewed/{$CategoryID}", 'Hijack'), 'li', ['class' => 'MarkCategoryViewed']);
            }
        }
    }