2 // Note: This file is included from the library/Vanilla/Vanilla.Control.DiscussionForm.php class.
4 echo '<div id="Form" class="StartDiscussion">
6 <legend>'.$this->Title
.'</legend>'
8 .$this->Get_PostBackForm('frmPostDiscussion', 'post', 'post.php')
10 if ($this->Context
->Configuration
['USE_CATEGORIES']) {
11 $this->DelegateParameters
['CategorySelect'] = &$cs;
12 $this->CallDelegate('DiscussionForm_PreCategoryRender');
13 $cs->Attributes
.= ' id="ddCategories"';
15 <label for="ddCategories">'.$this->Context
->GetDefinition('SelectDiscussionCategory').'</label>
19 echo '<input type="hidden" name="CategoryID" value="'.$cs->aOptions
[0]['IdValue'].'" />';
21 $this->CallDelegate('DiscussionForm_PreTopicRender');
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
.'" />
27 if ($this->Context
->Configuration
['ENABLE_WHISPERS'] && $Discussion->DiscussionID
== 0) {
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=";
40 $this->CallDelegate('DiscussionForm_PreCommentRender');
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').'
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
56 .$this->GetPostFormatting($Discussion->Comment
->FormatType
)
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')."');"
65 $this->CallDelegate('DiscussionForm_PostSubmitRender');
66 echo '<a href="'.(!$this->IsPostBack?
'javascript:history.back();':'./').'" class="CancelButton">'.$this->Context
->GetDefinition('Cancel').'</a>
69 $this->CallDelegate('DiscussionForm_PostButtonsRender');