[ Index ] |
|
Code source de b2evolution 2.1.0-beta |
1 <?php 2 /** 3 * This file implements the Comment form. 4 * 5 * This file is part of the b2evolution/evocms project - {@link http://b2evolution.net/}. 6 * See also {@link http://sourceforge.net/projects/evocms/}. 7 * 8 * @copyright (c)2003-2007 by Francois PLANQUE - {@link http://fplanque.net/}. 9 * 10 * @license http://b2evolution.net/about/license.html GNU General Public License (GPL) 11 * 12 * @package admin 13 * 14 * {@internal Below is a list of authors who have contributed to design/coding of this file: }} 15 * @author fplanque: Francois PLANQUE 16 * 17 * @version $Id: _comment.form.php,v 1.3 2007/10/29 01:24:49 fplanque Exp $ 18 */ 19 if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' ); 20 21 /** 22 * @var Blog 23 */ 24 global $Blog; 25 /** 26 * @var Comment 27 */ 28 global $edited_Comment; 29 /** 30 * 31 */ 32 global $Plugins; 33 34 global $comments_use_autobr, $mode, $month, $tab, $redirect_to; 35 36 $Form = & new Form( NULL, 'comment_checkchanges', 'post' ); 37 38 $Form->global_icon( T_('Cancel editing!'), 'close', $redirect_to, T_('cancel'), 4, 1 ); 39 40 $comment_Item = & $edited_Comment->get_Item(); 41 $title = T_('In response to:').' <a href="?ctrl=items&blog='.$comment_Item->blog_ID.'&p='.$comment_Item->ID.'"><strong>'.$comment_Item->dget('title').'</strong></a>'; 42 43 $Form->begin_form( 'eform', $title ); 44 45 $Form->hidden( 'ctrl', 'comments' ); 46 $Form->hidden( 'action', 'update' ); 47 $Form->hidden( 'redirect_to', $redirect_to ); 48 $Form->hidden( 'comment_ID', $edited_Comment->ID ); 49 ?> 50 51 <div class="left_col"> 52 53 54 <?php 55 $Form->begin_fieldset( T_('Comment contents') ); 56 57 if( ! $edited_Comment->get_author_User() ) 58 { // This is not a member comment 59 $Form->text( 'newcomment_author', $edited_Comment->author, 20, T_('Name'), '', 100 ); 60 $Form->text( 'newcomment_author_email', $edited_Comment->author_email, 20, T_('Email'), '', 100 ); 61 $Form->text( 'newcomment_author_url', $edited_Comment->author_url, 20, T_('URL'), '', 100 ); 62 } 63 ?> 64 65 <div class="edit_toolbars"> 66 <?php // --------------------------- TOOLBARS ------------------------------------ 67 // CALL PLUGINS NOW: 68 $Plugins->trigger_event( 'AdminDisplayToolbar', array( 'target_type' => 'Comment', 'edit_layout' => NULL ) ); 69 ?> 70 </div> 71 72 <?php // ---------------------------- TEXTAREA ------------------------------------- 73 $content = $edited_Comment->content; 74 if( $comments_use_autobr == 'always' || $comments_use_autobr == 'opt-out' ) 75 { 76 // echo 'unBR:',htmlspecialchars(str_replace( ' ', '*', $content) ); 77 $content = unautobrize($content); 78 } 79 80 $Form->fieldstart = '<div class="edit_area">'; 81 $Form->fieldend = "</div>\n"; 82 $Form->textarea( 'content', $content, 16, '', '', 40 , '' ); 83 $Form->fieldstart = '<div class="tile">'; 84 $Form->fieldend = '</div>'; 85 ?> 86 <script type="text/javascript"> 87 <!-- 88 // This is for toolbar plugins 89 var b2evoCanvas = document.getElementById('content'); 90 //--> 91 </script> 92 93 <div class="edit_actions"> 94 95 <input type="submit" value="<?php /* TRANS: This is the value of an input submit button */ echo T_('Save !'); ?>" class="SaveButton" tabindex="10" /> 96 97 <?php 98 // ---------- DELETE ---------- 99 if( $action == 'editcomment' ) 100 { // Editing comment 101 // Display delete button if user has permission to: 102 $edited_Comment->delete_link( ' ', ' ', '#', '#', 'DeleteButton', true ); 103 } 104 105 // CALL PLUGINS NOW: 106 $Plugins->trigger_event( 'AdminDisplayEditorButton', array( 'target_type' => 'Comment', 'edit_layout' => NULL ) ); 107 108 ?> 109 </div> 110 111 <?php 112 $Form->end_fieldset(); 113 114 $Form->begin_fieldset( T_('Advanced properties') ); 115 116 $Form->switch_layout( 'linespan' ); 117 118 if( $current_User->check_perm( 'edit_timestamp' ) ) 119 { // ------------------------------------ TIME STAMP ------------------------------------- 120 echo '<div id="itemform_edit_timestamp">'; 121 $Form->date( 'comment_issue_date', $edited_Comment->date, T_('Comment date') ); 122 echo ' '; // allow wrapping! 123 $Form->time( 'comment_issue_time', $edited_Comment->date, '' ); 124 echo '</div>'; 125 } 126 127 // --------------------------- AUTOBR -------------------------------------- 128 // fp> TODO: this should be Auto-P and handled by the Auto-P plugin 129 ?> 130 <input type="checkbox" class="checkbox" name="post_autobr" value="1" 131 <?php if( $comments_use_autobr == 'always' || $comments_use_autobr == 'opt-out' ) echo ' checked="checked"' ?> 132 id="autobr" tabindex="6" /> 133 <label for="autobr"><strong><?php echo T_('Auto-BR') ?></strong></label> 134 135 <?php 136 137 $Form->switch_layout( NULL ); 138 139 $Form->end_fieldset(); 140 141 // ####################### PLUGIN FIELDSETS ######################### 142 143 $Plugins->trigger_event( 'AdminDisplayCommentFormFieldset', array( 'Form' => & $Form, 'Comment' => & $edited_Comment, 'edit_layout' => NULL ) ); 144 ?> 145 146 </div> 147 148 <div class="right_col"> 149 150 <?php 151 $Form->begin_fieldset( T_('Advanced properties') ); 152 ?> 153 154 <p><strong><?php echo T_('Author') ?>:</strong> <?php echo $edited_Comment->author() ?></p> 155 <p><strong><?php echo T_('Type') ?>:</strong> <?php echo $edited_Comment->type; ?></p> 156 <p><strong><?php echo T_('IP address') ?>:</strong> <?php 157 // Display IP address and allow plugins to filter it, e.g. the DNSBL plugin will add a link to check the IP: 158 echo $Plugins->get_trigger_event( 'FilterIpAddress', array('format'=>'htmlbody', 'data'=>$edited_Comment->author_IP), 'data' ); ?></p> 159 <p><strong><?php echo T_('Spam Karma') ?>:</strong> <?php $edited_Comment->spam_karma(); ?></p> 160 <p><strong><?php echo T_('Item') ?>:</strong> <?php 161 $comment_Item = & $edited_Comment->get_Item(); 162 $comment_Item->permanent_link(); 163 $comment_Item->edit_link(); ?></p> 164 165 <?php 166 $Form->end_fieldset(); 167 168 $Form->begin_fieldset( T_('Visibility'), array( 'id' => 'commentform_visibility' ) ); 169 170 $sharing_options[] = array( 'published', T_('Published (Public)') ); 171 $sharing_options[] = array( 'draft', T_('Draft (Not published!)') ); 172 $sharing_options[] = array( 'deprecated', T_('Deprecated (Not published!)') ); 173 $Form->radio( 'comment_status', $edited_Comment->status, $sharing_options, '', true ); 174 175 $Form->end_fieldset(); 176 ?> 177 </div> 178 179 <div class="clear"></div> 180 181 <?php 182 $Form->end_form(); 183 184 /* 185 * $Log: _comment.form.php,v $ 186 * Revision 1.3 2007/10/29 01:24:49 fplanque 187 * no message 188 * 189 * Revision 1.2 2007/09/04 19:51:27 fplanque 190 * in-context comment editing 191 * 192 * Revision 1.1 2007/06/25 10:59:38 fplanque 193 * MODULES (refactored MVC) 194 * 195 * Revision 1.25 2007/04/26 00:11:06 fplanque 196 * (c) 2007 197 * 198 * Revision 1.24 2007/02/28 23:37:52 blueyed 199 * doc 200 * 201 * Revision 1.23 2007/02/25 01:40:43 fplanque 202 * doc 203 * 204 * Revision 1.22 2007/02/21 23:35:57 blueyed 205 * Trigger FilterIpAddress event 206 * 207 * Revision 1.21 2006/12/12 02:53:56 fplanque 208 * Activated new item/comments controllers + new editing navigation 209 * Some things are unfinished yet. Other things may need more testing. 210 * 211 * Revision 1.20 2006/12/06 23:55:53 fplanque 212 * hidden the dead body of the sidebar plugin + doc 213 * 214 * Revision 1.19 2006/12/03 00:22:17 fplanque 215 * doc 216 * 217 * Revision 1.18 2006/12/01 16:26:34 blueyed 218 * Added AdminDisplayCommentFormFieldset hook 219 * 220 * Revision 1.17 2006/11/19 03:50:29 fplanque 221 * cleaned up CSS 222 * 223 * Revision 1.15 2006/11/16 23:48:55 blueyed 224 * Use div.line instead of span.line as element wrapper for XHTML validity 225 * 226 * Revision 1.14 2006/10/01 22:21:54 blueyed 227 * edit_layout param fixes/doc 228 */ 229 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Thu Nov 29 23:58:50 2007 | par Balluche grâce à PHPXref 0.7 |
![]() |