Added iconic images for RSS2 and Atom
[vanilla-miry.git] / themes / comment_form.php
blobb1086d0bebeb4283cd2c7e504e400df44dcd9870
1 <?php
2 // Note: This file is included from the library/Vanilla/Vanilla.Control.DiscussionForm.php class.
4 echo '<div id="Form" class="AddComments">
5 <fieldset>
6 <legend>'.$this->Title.'</legend>'
7 .$this->Get_Warnings()
8 .$this->Get_PostBackForm('frmPostComment', 'post', 'post.php')
9 .'<ul>';
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>';
16 } else {
17 echo '<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=";
24 </script>
25 </li>
30 $this->CallDelegate('CommentForm_PreCommentsInputRender');
31 echo '<li>
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').'
39 </label>
40 <textarea name="Body" class="'
41 .($this->Context->Session->User->Preference('ShowLargeCommentBox') ? 'LargeCommentBox' : 'SmallCommentBox')
42 .'" id="CommentBox" rows="10" cols="85"'.$this->CommentFormAttributes.'>'
43 .$Comment->Body
44 .'</textarea>
45 </li>
46 '.$this->GetPostFormatting($Comment->FormatType)
47 .'</ul>';
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')."');"
55 .'" />';
56 $this->CallDelegate('CommentForm_PostSubmitRender');
58 echo '&nbsp;';
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>';
63 } else {
64 echo '<a href="'.GetUrl($this->Context->Configuration, 'index.php').'" class="CancelButton">'.$this->Context->GetDefinition('Cancel').'</a>';
67 echo '</div>';
69 $this->CallDelegate('CommentForm_PostButtonsRender');
71 echo '
72 </form>
73 </fieldset>
74 </div>';