Deprecation: 2.2.113 Dropped in favor of muting categories
Inheritance: extends Gdn_Module
 /**
  * Show all categories and few discussions from each.
  *
  * @param string $Category The url code of the parent category.
  * @since 2.0.0
  * @access public
  */
 public function discussions($Category = '')
 {
     // Setup head
     $this->addJsFile('discussions.js');
     $this->Menu->highlightRoute('/discussions');
     if (!$this->title()) {
         $Title = c('Garden.HomepageTitle');
         if ($Title) {
             $this->title($Title, '');
         } else {
             $this->title(t('All Categories'));
         }
     }
     if (!$Category) {
         $this->Description(c('Garden.Description', null));
     }
     Gdn_Theme::section('CategoryDiscussionList');
     // Set the category follow toggle before we load category data so that it affects the category query appropriately.
     $CategoryFollowToggleModule = new CategoryFollowToggleModule($this);
     $CategoryFollowToggleModule->SetToggle();
     $this->CategoryModel->Watching = !Gdn::session()->GetPreference('ShowAllCategories');
     if ($Category) {
         $Subtree = CategoryModel::GetSubtree($Category, false);
         $CategoryIDs = consolidateArrayValuesByKey($Subtree, 'CategoryID');
         $Categories = $this->CategoryModel->GetFull($CategoryIDs)->resultArray();
     } else {
         $Categories = $this->CategoryModel->GetFull()->resultArray();
     }
     $this->setData('Categories', $Categories);
     // Get category data and discussions
     $this->DiscussionsPerCategory = c('Vanilla.Discussions.PerCategory', 5);
     $DiscussionModel = new DiscussionModel();
     $this->CategoryDiscussionData = array();
     foreach ($this->CategoryData->result() as $Category) {
         if ($Category->CategoryID > 0) {
             $this->CategoryDiscussionData[$Category->CategoryID] = $DiscussionModel->get(0, $this->DiscussionsPerCategory, array('d.CategoryID' => $Category->CategoryID, 'Announce' => 'all'));
         }
     }
     // Add modules
     $this->addModule('NewDiscussionModule');
     $this->addModule('DiscussionFilterModule');
     $this->addModule('CategoriesModule');
     $this->addModule('BookmarkedModule');
     $this->addModule($CategoryFollowToggleModule);
     // Set view and render
     $this->View = 'discussions';
     $this->canonicalUrl(url('/categories', true));
     $Path = $this->fetchViewLocation('helper_functions', 'discussions', false, false);
     if ($Path) {
         include_once $Path;
     }
     // For GetOptions function
     $Path2 = $this->fetchViewLocation('helper_functions', 'categories', false, false);
     if ($Path2) {
         include_once $Path2;
     }
     $this->render();
 }
 /**
  * Show all categories and few discussions from each.
  * 
  * @since 2.0.0
  * @access public
  */
 public function Discussions()
 {
     // Setup head
     $this->AddCssFile('vanilla.css');
     $this->Menu->HighlightRoute('/discussions');
     $this->AddJsFile('bookmark.js');
     $this->AddJsFile('discussions.js');
     $this->AddJsFile('options.js');
     $Title = C('Garden.HomepageTitle');
     if ($Title) {
         $this->Title($Title, '');
     } else {
         $this->Title(T('All Categories'));
     }
     $this->Description(C('Garden.Description', NULL));
     Gdn_Theme::Section('CategoryDiscussionList');
     // Set the category follow toggle before we load category data so that it affects the category query appropriately.
     $CategoryFollowToggleModule = new CategoryFollowToggleModule($this);
     $CategoryFollowToggleModule->SetToggle();
     // Get category data and discussions
     $this->DiscussionsPerCategory = C('Vanilla.Discussions.PerCategory', 5);
     $DiscussionModel = new DiscussionModel();
     $this->CategoryModel->Watching = !Gdn::Session()->GetPreference('ShowAllCategories');
     $this->CategoryData = $this->CategoryModel->GetFull();
     $this->SetData('Categories', $this->CategoryData);
     $this->CategoryDiscussionData = array();
     foreach ($this->CategoryData->Result() as $Category) {
         if ($Category->CategoryID > 0) {
             $this->CategoryDiscussionData[$Category->CategoryID] = $DiscussionModel->Get(0, $this->DiscussionsPerCategory, array('d.CategoryID' => $Category->CategoryID, 'Announce' => 'all'));
         }
     }
     // Add modules
     $this->AddModule('NewDiscussionModule');
     $this->AddModule('DiscussionFilterModule');
     $this->AddModule('CategoriesModule');
     $this->AddModule('BookmarkedModule');
     $this->AddModule($CategoryFollowToggleModule);
     // Set view and render
     $this->View = 'discussions';
     $this->CanonicalUrl(Url('/categories', TRUE));
     include_once $this->FetchViewLocation('helper_functions', 'discussions');
     $this->Render();
 }
   /**
    * Show all categories and few discussions from each.
    * 
    * @since 2.0.0
    * @access public
    */
   public function Discussions() {
      // Setup head
      $this->AddCssFile('vanilla.css');
      $this->Menu->HighlightRoute('/discussions');
      $this->AddJsFile('bookmark.js');
      $this->AddJsFile('discussions.js');
      $this->Title(T('All Categories'));
      
		// Set the category follow toggle before we load category data so that it affects the category query appropriately.
		$CategoryFollowToggleModule = new CategoryFollowToggleModule($this);
		$CategoryFollowToggleModule->SetToggle();
		
      // Get category data and discussions
      $this->DiscussionsPerCategory = C('Vanilla.Discussions.PerCategory', 5);
      $DiscussionModel = new DiscussionModel();
      $this->CategoryModel->Watching = !Gdn::Session()->GetPreference('ShowAllCategories');
      $this->CategoryData = $this->CategoryModel->GetFull();
		$this->SetData('Categories', $this->CategoryData);
      $this->CategoryDiscussionData = array();
      foreach ($this->CategoryData->Result() as $Category) {
			if ($Category->CategoryID > 0)
				$this->CategoryDiscussionData[$Category->CategoryID] = $DiscussionModel->Get(0, $this->DiscussionsPerCategory, array('d.CategoryID' => $Category->CategoryID));
      }
      
      // Add modules
      $this->AddModule('NewDiscussionModule');
      $this->AddModule('CategoriesModule');
      $this->AddModule('BookmarkedModule');
		$this->AddModule($CategoryFollowToggleModule);
      
      // Set view and render
      $this->View = 'discussions';
      $this->Render();
   }