2 // Note: This file is included from the library/Vanilla/Vanilla.Control.DiscussionForm.php class.
4 echo '<div id="Form" class="AddComments">
6 <legend>'.$this->Title
.'</legend>'
8 .$this->Get_PostBackForm('frmPostComment', 'post', 'post.php')
11 $this->CallDelegate('CommentForm_PreWhisperInputRender');
13 if ($this->Context
->Configuration
['ENABLE_WHISPERS']) {
14 if ($this->Discussion
->WhisperUserID
> 0) {
15 echo '<li>'.str_replace('//1', (($this->Discussion
->WhisperUserID
== $this->Context
->Session
->UserID
) ?
$this->Discussion
->AuthUsername
: $this->Discussion
->WhisperUsername
), $this->Context
->GetDefinition('YourCommentsWillBeWhisperedToX')).'</li>';
18 <label for="WhisperUsername">'.$this->Context
->GetDefinition('WhisperYourCommentsTo').'</label>
19 <input id="WhisperUsername" name="WhisperUsername" type="text" value="'.$Comment->WhisperUsername
.'" class="Whisper AutoCompleteInput" maxlength="20" />
20 <script type="text/javascript">
21 var WhisperAutoComplete = new AutoComplete("WhisperUsername", false);
22 WhisperAutoComplete.TableID = "WhisperAutoCompleteResults";
23 WhisperAutoComplete.KeywordSourceUrl = "'.$this->Context
->Configuration
['WEB_ROOT'].'ajax/getusers.php?Search=";
30 $this->CallDelegate('CommentForm_PreCommentsInputRender');
32 <label for="CommentBox">
33 <a href="./" id="CommentBoxController" onclick="'
34 ."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>';
36 $this->CallDelegate('CommentForm_PostCommentToggle');
38 echo $this->Context
->GetDefinition('EnterYourComments').'
40 <textarea name="Body" class="'
41 .($this->Context
->Session
->User
->Preference('ShowLargeCommentBox') ?
'LargeCommentBox' : 'SmallCommentBox')
42 .'" id="CommentBox" rows="10" cols="85"'.$this->CommentFormAttributes
.'>'
46 '.$this->GetPostFormatting($Comment->FormatType
)
49 $this->CallDelegate('CommentForm_PreButtonsRender');
51 echo '<div class="Submit">
52 <input type="submit" name="btnSave" value="'.($Comment->CommentID
> 0 ?
$this->Context
->GetDefinition('SaveYourChanges') : $this->Context
->GetDefinition('AddYourComments'))
53 .'" class="Button SubmitButton AddCommentsButton" onclick="'
54 ."Wait(this, '".$this->Context
->GetDefinition('Wait')."');"
56 $this->CallDelegate('CommentForm_PostSubmitRender');
60 if ($this->PostBackAction
== 'SaveComment' ||
($this->PostBackAction
== '' && $Comment->CommentID
> 0)) {
61 if ($this->Comment
->DiscussionID
> 0) {
62 echo '<a href="'.GetUrl($this->Context
->Configuration
, 'comments.php', '', 'DiscussionID', $this->Comment
->DiscussionID
).'" class="CancelButton">'.$this->Context
->GetDefinition('Cancel').'</a>';
64 echo '<a href="'.GetUrl($this->Context
->Configuration
, 'index.php').'" class="CancelButton">'.$this->Context
->GetDefinition('Cancel').'</a>';
69 $this->CallDelegate('CommentForm_PostButtonsRender');