Esempio n. 1
0
 /**
  * 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);
     }
 }