2 // Note: This file is included from the library/Vanilla/Vanilla.Control.CategoryList.php class.
4 $SessionPostBackKey = $this->Context
->Session
->GetCsrfValidationKey();
6 $CategoryList = '<div class="ContentInfo Top">
7 <h1>'.$this->Context
->PageTitle
.'</h1>
10 <ol id="Categories">';
11 $Category = $this->Context
->ObjectFactory
->NewObject($this->Context
, 'Category');
14 while ($Row = $this->Context
->Database
->GetRow($this->Data
)) {
16 $Category->GetPropertiesFromDataSet($Row);
17 $Category->FormatPropertiesForDisplay();
18 $CategoryList .= '<li id="Category_'.$Category->CategoryID
.'" class="Category'.($Category->Blocked?
' BlockedCategory':' UnblockedCategory').($FirstRow?
' FirstCategory':'').' Category_'.$Category->CategoryID
.($Alternate ?
' Alternate' : '').'">
20 <li class="CategoryName">
21 <span>'.$this->Context
->GetDefinition('Category').'</span> <a href="'.GetUrl($this->Context
->Configuration
, 'index.php', '', 'CategoryID', $Category->CategoryID
).'">'.$Category->Name
.'</a>
23 <li class="CategoryDescription">
24 <span>'.$this->Context
->GetDefinition('CategoryDescription').'</span> '.$Category->Description
.'
26 <li class="CategoryDiscussionCount">
27 <span>'.$this->Context
->GetDefinition('Discussions').'</span> '.$Category->DiscussionCount
.'
29 if ($this->Context
->Session
->UserID
> 0) {
31 <li class="CategoryOptions">
32 <span>'.$this->Context
->GetDefinition('Options').'</span> ';
33 if ($Category->Blocked
) {
34 $CategoryList .= '<a id="BlockCategory'.$Category->CategoryID
.'" onclick="ToggleCategoryBlock('."'".$this->Context
->Configuration
['WEB_ROOT']."ajax/blockcategory.php', ".$Category->CategoryID
.", 0, 'BlockCategory".$Category->CategoryID
."', '".$SessionPostBackKey."');\">".$this->Context
->GetDefinition('UnblockCategory').'</a>';
36 $CategoryList .= '<a id="BlockCategory'.$Category->CategoryID
.'" onclick="ToggleCategoryBlock('."'".$this->Context
->Configuration
['WEB_ROOT']."ajax/blockcategory.php', ".$Category->CategoryID
.", 1, 'BlockCategory".$Category->CategoryID
."', '".$SessionPostBackKey."');\">".$this->Context
->GetDefinition('BlockCategory').'</a>';
38 $CategoryList .= '</li>
41 $CategoryList .= '</ul>
44 $Alternate = FlipBool($Alternate);