}
}
- logger('item, page_writeable:'. ($page_writeable ? 'yes' : 'no') .', show comment box: '. ($show_comment_box ? 'yes' : 'no'), LOGGER_DEBUG);
if($page_writeable) {
$buttons = array(
'like' => array( t("I like this \x28toggle\x29"), t("like")),
$qc = ((local_user()) ? get_pconfig(local_user(),'qcomment','words') : null);
$qcomment = (($qc) ? explode("\n",$qc) : null);
}
-
$comment = replace_macros($cmnt_tpl,array(
'$return_path' => '',
'$jsreload' => (($mode === 'display') ? $_SESSION['return_url'] : ''),
<div class="comment-wwedit-wrapper" id="comment-edit-wrapper-$id" style="display: block;">
- <form class="comment-edit-form" id="comment-edit-form-$id" action="item" method="post" onsubmit="post_comment($id); return false;">
+ <span id="hide-commentbox-$id" class="hide-commentbox fakelink" onclick="showHideCommentBox($id);">$comment</span>
+ <form class="comment-edit-form" style="display: none;" id="comment-edit-form-$id" action="item" method="post" onsubmit="post_comment($id); return false;">
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="profile_uid" value="$profile_uid" />
<input type="hidden" name="parent" value="$parent" />
}
}
+ function showHideCommentBox(id) {
+ if( $('#comment-edit-form-' + id).is(':visible')) {
+ $('#comment-edit-form-' + id).hide();
+ }
+ else {
+ $('#comment-edit-form-' + id).show();
+ }
+ }
+
</script>
<div class="comment-wwedit-wrapper" id="comment-edit-wrapper-$id" style="display: block;">
- <form class="comment-edit-form" id="comment-edit-form-$id" action="item" method="post" onsubmit="post_comment($id); return false;">
+ <span id="hide-commentbox-$id" class="hide-commentbox fakelink" onclick="showHideCommentBox($id);">$comment</span>
+ <form class="comment-edit-form" style="display: none;" id="comment-edit-form-$id" action="item" method="post" onsubmit="post_comment($id); return false;">
<input type="hidden" name="type" value="$type" />
<input type="hidden" name="profile_uid" value="$profile_uid" />
<input type="hidden" name="parent" value="$parent" />