/** * Add 'Unanswered' option to discussion filters. */ public function Base_AfterDiscussionFilters_Handler($Sender, $Args) { if (Gdn::Session()->CheckPermission('Garden.Moderation.Manage')) { $DiscussionModel = new DiscussionModel(); $Active = $Controller->RequestMethod == 'unanswered' ? ' Active' : ''; $Unanswered = Sprite('SpUnansweredQuestionsSpUnansweredQuestions') . ' ' . T('Unanswered') . FilterCountString($DiscussionModel->UnansweredCount()); echo '<li class="Unanswered ' . $Active . '">' . Anchor($Unanswered, 'discussions/unanswered') . '</li>'; } }
if ($Session->IsValid()) { $CountBookmarks = $Session->User->CountBookmarks; $CountDiscussions = $Session->User->CountDiscussions; $CountDrafts = $Session->User->CountDrafts; } if (!function_exists('FilterCountString')) { function FilterCountString($Count, $Url = '') { $Count = CountString($Count, $Url); return $Count != '' ? '<span class="Aside">' . $Count . '</span>' : ''; } } if (C('Vanilla.Discussions.ShowCounts', TRUE)) { $Bookmarked .= FilterCountString($CountBookmarks, Url('/discussions/UserBookmarkCount')); $MyDiscussions .= FilterCountString($CountDiscussions); $MyDrafts .= FilterCountString($CountDrafts); } ?> <div class="BoxFilter BoxDiscussionFilter"> <ul class="FilterMenu"> <?php $Controller->FireEvent('BeforeDiscussionFilters'); // if (C('Vanilla.Categories.ShowTabs')) { $CssClass = 'AllCategories'; if (strtolower($Controller->ControllerName) == 'categoriescontroller' && in_array(strtolower($Controller->RequestMethod), array('index', 'all'))) { $CssClass .= ' Active'; } echo '<li class="' . $CssClass . '">' . Anchor(Sprite('SpAllCategories') . T('Categories'), '/categories') . '</li> '; // } ?> <li class="Discussions<?php