/** * Displays the amounts of unanswered questions. * * @param DiscussionsController $sender Sending controller instance. * @param array $args Event arguments. */ public function discussionsController_unansweredCount_create($sender, $args) { $Count = $this->getUnansweredCount(); $sender->setData('UnansweredCount', $Count); $sender->setData('_Value', $Count); $sender->render('Value', 'Utility', 'Dashboard'); }
/** * Allows user to mark all discussions as viewed. * * @since 1.0 * @access public * * @param DiscussionsController $sender */ public function discussionsController_markAllViewed_create($sender) { if (Gdn::request()->isAuthenticatedPostBack()) { $CategoryModel = new CategoryModel(); $this->markCategoryRead($CategoryModel, -1); $this->recursiveMarkCategoryRead($CategoryModel, CategoryModel::categories(), [-1]); $sender->informMessage(t('All discussions marked as viewed.')); // Didn't use the default async option and landed here directly. if ($sender->deliveryType() == DELIVERY_TYPE_ALL) { redirect('/'); } $sender->render('blank', 'utility', 'dashboard'); } else { throw new Exception('Requires POST', 405); } }