Skip to content

Commit

Permalink
Added WriteCommentFormHeader() logic.
Browse files Browse the repository at this point in the history
  • Loading branch information
tburry committed Dec 21, 2012
1 parent 103f0cf commit 5e8f400
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
13 changes: 13 additions & 0 deletions applications/vanilla/views/discussion/helper_functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,19 @@ function WriteCommentForm() {
}
endif;

if (!function_exists('WriteCommentFormHeader')):
function WriteCommentFormHeader() {
$Session = Gdn::Session();
if (C('Vanilla.Comment.UserPhotoFirst', TRUE)) {
echo UserPhoto($Session->User);
echo UserAnchor($Session->User, 'Username');
} else {
echo UserAnchor($Session->User, 'Username');
echo UserPhoto($Session->User);
}
}
endif;

if (!function_exists('WriteEmbedCommentForm')):
function WriteEmbedCommentForm() {
$Session = Gdn::Session();
Expand Down
10 changes: 3 additions & 7 deletions applications/vanilla/views/post/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,17 @@
<div class="<?php echo $this->EventArguments['FormCssClass']; ?>">
<h2 class="H"><?php echo T($Editing ? 'Edit Comment' : 'Leave a Comment'); ?></h2>
<div class="CommentFormWrap">
<?php if (Gdn::Session()->IsValid()): ?>
<div class="Form-HeaderWrap">
<div class="Form-Header">
<span class="Author">
<?php
if (C('Vanilla.Comment.UserPhotoFirst', TRUE)) {
echo UserPhoto($Session->User);
echo UserAnchor($Session->User, 'Username');
} else {
echo UserAnchor($Session->User, 'Username');
echo UserPhoto($Session->User);
}
WriteCommentFormHeader();
?>
</span>
</div>
</div>
<?php endif; ?>
<div class="Form-BodyWrap">
<div class="Form-Body">
<div class="FormWrapper FormWrapper-Condensed">
Expand Down

0 comments on commit 5e8f400

Please sign in to comment.