Added iconic images for RSS2 and Atom
[vanilla-miry.git] / themes / discussion_form.php
blobb969a6511c226a43ad2e53492cbe66a3f40de22f
1 <?php
2 // Note: This file is included from the library/Vanilla/Vanilla.Control.DiscussionForm.php class.
4 echo '<div id="Form" class="StartDiscussion">
5 <fieldset>
6 <legend>'.$this->Title.'</legend>'
7 .$this->Get_Warnings()
8 .$this->Get_PostBackForm('frmPostDiscussion', 'post', 'post.php')
9 .'<ul>';
10 if ($this->Context->Configuration['USE_CATEGORIES']) {
11 $this->DelegateParameters['CategorySelect'] = &$cs;
12 $this->CallDelegate('DiscussionForm_PreCategoryRender');
13 $cs->Attributes .= ' id="ddCategories"';
14 echo '<li>
15 <label for="ddCategories">'.$this->Context->GetDefinition('SelectDiscussionCategory').'</label>
16 '.$cs->Get()
17 .'</li>';
18 } else {
19 echo '<input type="hidden" name="CategoryID" value="'.$cs->aOptions[0]['IdValue'].'" />';
21 $this->CallDelegate('DiscussionForm_PreTopicRender');
22 echo '<li>
23 <label for="txtTopic">'.$this->Context->GetDefinition(($Discussion->DiscussionID == 0?'EnterYourDiscussionTopic':'EditYourDiscussionTopic')).'</label>
24 <input id="txtTopic" type="text" name="Name" class="DiscussionBox" maxlength="100" value="'.$Discussion->Name.'" />
25 </li>';
27 if ($this->Context->Configuration['ENABLE_WHISPERS'] && $Discussion->DiscussionID == 0) {
28 echo '<li>
29 <label for="WhisperUsername">'.$this->Context->GetDefinition('WhisperYourCommentsTo').'</label>
30 <input id="WhisperUsername" name="WhisperUsername" type="text" value="'.FormatStringForDisplay($Discussion->WhisperUsername, 0).'" class="Whisper AutoCompleteInput" maxlength="20" />
31 <script type="text/javascript">
32 var WhisperAutoComplete = new AutoComplete("WhisperUsername", false);
33 WhisperAutoComplete.TableID = "WhisperAutoCompleteResults";
34 WhisperAutoComplete.KeywordSourceUrl = "'.$this->Context->Configuration['WEB_ROOT'].'ajax/getusers.php?Search=";
35 </script>
36 </li>
40 $this->CallDelegate('DiscussionForm_PreCommentRender');
41 echo '<li>
42 <label for="CommentBox">
43 <a href="./" id="CommentBoxController" onclick="'
44 ."ToggleCommentBox('".$this->Context->Configuration['WEB_ROOT']."ajax/switch.php', '".$this->Context->GetDefinition('SmallInput')."', '".$this->Context->GetDefinition('BigInput')."', '". $this->Context->Session->GetCsrfValidationKey()."'); return false;".'">'.$this->Context->GetDefinition($this->Context->Session->User->Preference('ShowLargeCommentBox')?'SmallInput':'BigInput').'</a>';
46 $this->CallDelegate('DiscussionForm_PostCommentToggle');
48 echo $this->Context->GetDefinition('EnterYourComments').'
49 </label>
50 <textarea name="Body" class="'
51 .($this->Context->Session->User->Preference('ShowLargeCommentBox') ? 'LargeCommentBox' : 'SmallCommentBox')
52 .'" id="CommentBox" rows="10" cols="85"'.$this->DiscussionFormAttributes.'>'
53 .$Discussion->Comment->Body
54 .'</textarea>
55 </li>'
56 .$this->GetPostFormatting($Discussion->Comment->FormatType)
57 .'</ul>';
59 $this->CallDelegate('DiscussionForm_PreButtonsRender');
61 echo '<div class="Submit">
62 <input type="submit" name="btnSave" value="'.$this->Context->GetDefinition(($Discussion->DiscussionID > 0) ? 'SaveYourChanges' : 'StartYourDiscussion').'" class="Button SubmitButton StartDiscussionButton" onclick="'
63 ."Wait(this, '".$this->Context->GetDefinition('Wait')."');"
64 .'"/>';
65 $this->CallDelegate('DiscussionForm_PostSubmitRender');
66 echo '<a href="'.(!$this->IsPostBack?'javascript:history.back();':'./').'" class="CancelButton">'.$this->Context->GetDefinition('Cancel').'</a>
67 </div>';
69 $this->CallDelegate('DiscussionForm_PostButtonsRender');
71 echo'</form>
72 </fieldset>
73 </div>';