Fixed minor things and added missing file
[vanilla-miry.git] / themes / discussions.php
bloba26f366c54fcf7dce192466679cf25f6eaacb1b0
1 <?php
2 // Note: This file is included from the library/Vanilla/Vanilla.Control.DiscussionGrid.php class.
4 echo '<div class="ContentInfo Top">
5 <h1>
6 '.$this->Context->PageTitle.'
7 </h1>
8 '.$this->PageJump.'
9 <div class="PageInfo">
10 <p>'.($PageDetails == '' ? $this->Context->GetDefinition('NoDiscussionsFound') : $PageDetails).'</p>
11 '.$PageList.'
12 </div>
13 </div>
14 <div id="ContentBody">
15 <ol id="Discussions">';
17 $Discussion = $this->Context->ObjectFactory->NewContextObject($this->Context, 'Discussion');
18 $FirstRow = 1;
19 $CurrentUserJumpToLastCommentPref = $this->Context->Session->User->Preference('JumpToLastReadComment');
20 $DiscussionList = '';
21 $ThemeFilePath = ThemeFilePath($this->Context->Configuration, 'discussion.php');
22 $Alternate = 0;
23 $RowNumber = 0;
24 while ($Row = $this->Context->Database->GetRow($this->DiscussionData)) {
25 $RowNumber++;
26 $this->DelegateParameters['RowNumber'] = &$RowNumber;
27 $Discussion->Clear();
28 $Discussion->GetPropertiesFromDataSet($Row);
29 $Discussion->FormatPropertiesForDisplay();
30 // Prefix the discussion name with the whispered-to username if this is a whisper
31 if ($Discussion->WhisperUserID > 0) {
32 $Discussion->Name = @$Discussion->WhisperUsername.': '.$Discussion->Name;
34 $this->DelegateParameters['Discussion'] = &$Discussion;
35 $this->CallDelegate( 'PreSingleDiscussionRender' );
36 // Discussion search results are identical to regular discussion listings, so include the discussion search results template here.
37 include($ThemeFilePath);
39 $FirstRow = 0;
40 $Alternate = FlipBool($Alternate);
42 echo $DiscussionList.'
43 </ol>
44 </div>';
45 if ($this->DiscussionDataCount > 0) {
46 echo '<div class="ContentInfo Bottom">
47 <div class="PageInfo">
48 <p>'.$pl->GetPageDetails($this->Context).'</p>
49 '.$PageList.'
50 </div>
51 <a id="TopOfPage" href="'.GetRequestUri().'#pgtop">'.$this->Context->GetDefinition('TopOfPage').'</a>
52 </div>';