Source for file _comment.form.php
Documentation is available at _comment.form.php
* This file implements the Comment form.
* This file is part of the Quam Plures project - {@link http://quamplures.net/}.
* See also {@link https://launchpad.net/quam-plures}.
* @copyright (c) 2009 - 2011 by the Quam Plures developers - {@link http://quamplures.net/}
* @copyright (c)2003-2009 by Francois PLANQUE - {@link http://fplanque.net/}.
* @license http://quamplures.net/license.html GNU General Public License (GPL)
* {@internal Below is a list of authors who have contributed to design/coding of this file: }}
* @author fplanque: Francois PLANQUE
if( !defined('QP_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
global $comments_use_autobr, $mode, $month, $tab, $redirect_to;
$Form = new Form( NULL, 'comment_checkchanges', 'post' );
$Form->global_icon( T_('Cancel editing!'), 'close', str_replace( '&', '&', $redirect_to), T_('cancel'), 4, 1 );
$Form->begin_form( 'eform' );
$Form->hidden( 'ctrl', 'comments' );
$Form->hidden( 'action', 'update' );
$Form->hidden( 'redirect_to', $redirect_to );
$Form->hidden( 'comment_ID', $edited_Comment->ID );
<div class="clear"></div>
$Form->begin_fieldset( T_('Comment contents') );
echo '<table cellspacing="0" class="compose_layout">';
echo '<tr><td width="1%"><strong>'. T_('In response to'). ':</strong></td>';
echo '<td class="input">';
$comment_Item = & $edited_Comment->get_Item();
// display and link item title
$comment_Item->title( array(
'link_type' => 'admin_view',
if( ! $edited_Comment->get_author_User() )
{ // This is not a member comment
$Form->switch_layout( 'none' );
echo '<tr><td width="1%"><strong>'. T_('Author'). ':</strong></td>';
echo '<td class="input">';
$Form->text_input( 'newcomment_author', $edited_Comment->author, 20, '', '', array('maxlength'=> 100, 'style'=> 'width: 100%;') );
echo '<tr><td width="1%"><strong>'. T_('Email'). ':</strong></td>';
echo '<td class="input">';
$Form->text_input( 'newcomment_author_email', $edited_Comment->author_email, 20, '', '', array('maxlength'=> 100, 'style'=> 'width: 100%;') );
echo '<tr><td width="1%"><strong>'. T_('Website URL'). ':</strong></td>';
echo '<td class="input">';
$Form->text_input( 'newcomment_author_url', $edited_Comment->author_url, 20, '', '', array('maxlength'=> 100, 'style'=> 'width: 100%;') );
$Form->switch_layout( NULL );
echo '<tr><td width="1%"><strong>'. T_('Author'). ':</strong></td>';
echo '<td class="input">';
// display comment author's name
$edited_Comment->author( array() );
<div class="edit_toolbars">
// spark the plugin manager
$Plugins->trigger_event( 'AdminDisplayToolbarAbove', array(
'target_type' => 'Comment',
<?php // ---------------------------- TEXTAREA -------------------------------------
$content = $edited_Comment->content;
if( $comments_use_autobr == 'always' || $comments_use_autobr == 'opt-out' )
$Form->fieldstart = '<div class="edit_area">';
$Form->fieldend = "</div>\n";
$Form->textarea( 'content', $content, 16, '', '', 40 , '' );
$Form->fieldstart = '<div class="tile">';
$Form->fieldend = '</div>';
<script type="text/javascript">
// This is for toolbar plugins
var app_Canvas = document.getElementById('content');
<div class="edit_toolbars">
// spark the plugin manager
$Plugins->trigger_event( 'AdminDisplayToolbarBelow', array(
'target_type' => 'Comment',
<div class="edit_actions">
<input type="submit" value=" <?php /* TRANS: This is the value of an input submit button */ echo T_('Save !'); ?>" class="SaveButton" tabindex="10" />
// ---------- DELETE ----------
if( $action == 'editcomment' )
// display a link to delete a comment
$edited_Comment->delete_link( array(
'class' => 'DeleteButton',
// spark the plugin manager
$Plugins->trigger_event( 'AdminDisplayEditorButton', array(
'target_type' => 'Comment',
$Form->begin_fieldset( T_('Advanced properties') );
$Form->switch_layout( 'linespan' );
if( $current_User->check_perm( 'edit_timestamp' ) )
{ // ------------------------------------ TIME STAMP -------------------------------------
echo '<div id="itemform_edit_timestamp">';
$Form->date( 'comment_issue_date', $edited_Comment->date, T_('Comment date') );
echo ' '; // allow wrapping!
$Form->time( 'comment_issue_time', $edited_Comment->date, '' );
// --------------------------- AUTOBR --------------------------------------
// fp> TODO: this should be Auto-P and handled by the Auto-P plugin
<input type="checkbox" class="checkbox" name="post_autobr" value="1"
<?php if( $comments_use_autobr == 'always' || $comments_use_autobr == 'opt-out' ) echo ' checked="checked"' ?>
id="autobr" tabindex="6" />
<label for="autobr"><strong> <?php echo T_('Auto-BR') ?></strong></label>
$Form->switch_layout( NULL );
// ####################### PLUGIN FIELDSETS #########################
// spark the plugin manager
$Plugins->trigger_event( 'AdminDispCommentFormField', array(
'Comment' => & $edited_Comment,
<div class="edit_toolbars">
// spark the plugin manager
$Plugins->trigger_event( 'AdminDisplayToolbarSidebar', array(
'target_type' => 'Comment',
if( $Blog->get_setting('allow_rating') != 'never'
|| !empty( $edited_Comment->rating ) )
$Form->begin_fieldset( T_('Rating') );
// display options to rate a comment
$edited_Comment->rating_input( array(
// display option to reset rating
$edited_Comment->rating_none_input( array(
$Form->hidden( 'comment_rating', 0 );
$Form->begin_fieldset( T_('Properties') );
$Form->checkbox_basic_input( 'comment_featured', $edited_Comment->featured, T_('Featured') );
$Form->begin_fieldset( T_('Visibility'), array( 'id' => 'commentform_visibility' ) );
$sharing_options[] = array( 'published', T_('Published (Public)') );
$sharing_options[] = array( 'draft', T_('Draft (Not published!)') );
$sharing_options[] = array( 'deprecated', T_('Deprecated (Not published!)') );
$Form->radio( 'comment_status', $edited_Comment->status, $sharing_options, '', true );
$Form->begin_fieldset( T_('Links') );
$Form->checkbox_basic_input( 'comment_nofollow', $edited_Comment->nofollow, T_('Nofollow website URL') );
// TODO: apply to all links -- note: see basic antispam plugin that does this for x hours
$Form->begin_fieldset( T_('Feedback info') );
<p><strong> <?php echo T_('Type') ?>:</strong> <?php echo $edited_Comment->type; ?></p>
<p><strong> <?php echo T_('IP address') ?>:</strong> <?php
// Display IP address and allow plugins to filter it, e.g. the DNSBL plugin will add a link to check the IP:
echo $Plugins->get_trigger_event( 'FilterIpAddress', array('format'=> 'htmlbody', 'data'=> $edited_Comment->author_IP), 'data' ); ?></p>
<p><strong> <?php echo T_('Spam Karma') ?>:</strong> <?php $edited_Comment->spam_karma(); ?></p>
<div class="clear"></div>
|