initialize() public method

Always called by dispatcher before controller's requested method.
Since: 2.0.0
public initialize ( )
 public function initialize()
 {
     parent::initialize();
     /**
      * The default Cache-Control header does not include no-store, which can cause issues with outdated category
      * information (e.g. counts).  The same check is performed here as in Gdn_Controller before the Cache-Control
      * header is added, but this value includes the no-store specifier.
      */
     if (Gdn::session()->isValid()) {
         $this->setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
     }
 }
 /**
  * Highlight route & add common JS definitions.
  *
  * Always called by dispatcher before controller's requested method.
  *
  * @since 2.0.0
  * @access public
  */
 public function initialize()
 {
     parent::initialize();
     $this->addDefinition('ConfirmDeleteCommentHeading', t('ConfirmDeleteCommentHeading', 'Delete Comment'));
     $this->addDefinition('ConfirmDeleteCommentText', t('ConfirmDeleteCommentText', 'Are you sure you want to delete this comment?'));
     $this->Menu->highlightRoute('/discussions');
 }
 /**
  * Include CSS for all methods.
  *
  * Always called by dispatcher before controller's requested method.
  *
  * @since 2.0.0
  * @access public
  */
 public function initialize()
 {
     parent::initialize();
     $this->CssClass = 'NoPanel';
 }
 /**
  * Highlight route and include JS, CSS, and modules used by all methods.
  *
  * Always called by dispatcher before controller's requested method.
  *
  * @since 2.0.0
  * @access public
  */
 public function initialize()
 {
     parent::initialize();
     $this->ShowOptions = true;
     $this->Menu->highlightRoute('/discussions');
     $this->addJsFile('discussions.js');
     // Inform moderator of checked comments in this discussion
     $CheckedDiscussions = Gdn::session()->getAttribute('CheckedDiscussions', array());
     if (count($CheckedDiscussions) > 0) {
         ModerationController::InformCheckedDiscussions($this);
     }
     $this->CountCommentsPerPage = c('Vanilla.Comments.PerPage', 30);
     $this->fireEvent('AfterInitialize');
 }
 /**
  * Highlight route and include JS, CSS, and modules used by all methods.
  *
  * Always called by dispatcher before controller's requested method.
  *
  * @since 2.0.0
  * @access public
  */
 public function initialize()
 {
     parent::initialize();
     $this->ShowOptions = true;
     $this->Menu->highlightRoute('/discussions');
     $this->addJsFile('discussions.js');
     // Inform moderator of checked comments in this discussion
     $CheckedDiscussions = Gdn::session()->getAttribute('CheckedDiscussions', array());
     if (count($CheckedDiscussions) > 0) {
         ModerationController::InformCheckedDiscussions($this);
     }
     $this->CountCommentsPerPage = c('Vanilla.Comments.PerPage', 30);
     /**
      * The default Cache-Control header does not include no-store, which can cause issues (e.g. inaccurate unread
      * status or new comment counts) when users visit the discussion list via the browser's back button.  The same
      * check is performed here as in Gdn_Controller before the Cache-Control header is added, but this value
      * includes the no-store specifier.
      */
     if (Gdn::session()->isValid()) {
         $this->setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
     }
     $this->fireEvent('AfterInitialize');
 }
 /**
  * Include CSS for all methods.
  *
  * Always called by dispatcher before controller's requested method.
  *
  * @since 2.0.0
  * @access public
  */
 public function initialize()
 {
     parent::initialize();
     $this->addModule('NewDiscussionModule');
 }
 /**
  * Highlight route.
  *
  * Always called by dispatcher before controller's requested method.
  *
  * @since 2.0.0
  * @access public
  */
 public function initialize()
 {
     parent::initialize();
     if (!c('Vanilla.Categories.Use')) {
         redirect('/discussions');
     }
     if ($this->Menu) {
         $this->Menu->highlightRoute('/categories');
     }
     $this->CountCommentsPerPage = c('Vanilla.Comments.PerPage', 30);
 }
 /**
  * Highlight route.
  *
  * Always called by dispatcher before controller's requested method.
  *
  * @since 2.0.0
  * @access public
  */
 public function initialize()
 {
     parent::initialize();
     if (!c('Vanilla.Categories.Use')) {
         redirect('/discussions');
     }
     if ($this->Menu) {
         $this->Menu->highlightRoute('/categories');
     }
     $this->CountCommentsPerPage = c('Vanilla.Comments.PerPage', 30);
     /**
      * The default Cache-Control header does not include no-store, which can cause issues with outdated category
      * information (e.g. counts).  The same check is performed here as in Gdn_Controller before the Cache-Control
      * header is added, but this value includes the no-store specifier.
      */
     if (Gdn::session()->isValid()) {
         $this->setHeader('Cache-Control', 'private, no-cache, no-store, max-age=0, must-revalidate');
     }
 }
 /**
  * Include CSS for all methods.
  *
  * Always called by dispatcher before controller's requested method.
  *
  * @since 2.0.0
  * @access public
  */
 public function initialize()
 {
     parent::initialize();
     $this->addModule('NewDiscussionModule');
     $this->CssClass = 'NoPanel';
 }