Made quite a few changes so that the code works in the server
[vanilla-miry.git] / themes / panel.php
blob640b1f7eb2d4fc3c26af2fb83e680a6ae9af8b95
1 <?php
2 // Note: This file is included from the library/Framework/Framework.Control.Panel.php class.
4 echo '<div id="Panel">';
6 // Add the start button to the panel
7 if ($this->Context->Session->UserID > 0 && $this->Context->Session->User->Permission('PERMISSION_START_DISCUSSION')) {
8 $CategoryID = ForceIncomingInt('CategoryID', 0);
9 if ($CategoryID == 0) $CategoryID = '';
10 echo '<h1><a href="'.GetUrl($this->Context->Configuration, 'post.php', 'category/', 'CategoryID', $CategoryID).'">'
11 .$this->Context->GetDefinition('StartANewDiscussion')
12 .'</a></h1>';
15 $this->CallDelegate('PostStartButtonRender');
17 while (list($Key, $PanelElement) = each($this->PanelElements)) {
18 $Type = $PanelElement['Type'];
19 $Key = $PanelElement['Key'];
20 if ($Type == 'List') {
21 $sReturn = '';
22 $Links = $this->Lists[$Key];
23 if (count($Links) > 0) {
24 ksort($Links);
25 $sReturn .= '<ul>
26 <li>
27 <h2>'.$Key.'</h2>
28 <ul>';
29 while (list($LinkKey, $Link) = each($Links)) {
30 $sReturn .= '<li>
31 <a '.($Link['Link'] != '' ? 'href="'.$Link['Link'].'"' : '').' '.$Link['LinkAttributes'].'>'
32 .$Link['Item'];
33 if ($Link['Suffix'] != '') $sReturn .= ' <span>'.$this->Context->GetDefinition($Link['Suffix']).'</span>';
34 $sReturn .= '</a>';
35 $sReturn .= '</li>';
37 $sReturn .= '</ul>
38 </li>
39 </ul>';
41 echo $sReturn;
42 } elseif ($Type == 'String') {
43 echo $this->Strings[$Key];
47 $this->CallDelegate('PostElementsRender');
49 echo '</div>
50 <div id="Content">';