root/trunk/wp-admin/edit-form-comment.php

Revision 9119, 6.8 kB (checked in by ryan, 3 days ago)

phpdoc for wp-admin. Props jacobsantos. see #7527

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 <?php
2 /**
3  * Edit comment form for inclusion in another file.
4  *
5  * @package WordPress
6  * @subpackage Administration
7  */
8
9 /**
10  * @var string
11  */
12 $submitbutton_text = __('Edit Comment');
13 $toprow_title = sprintf(__('Editing Comment # %s'), $comment->comment_ID);
14 $form_action = 'editedcomment';
15 $form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment->comment_ID . "' />\n<input type='hidden' name='comment_post_ID' value='" . $comment->comment_post_ID;
16 ?>
17
18 <form name="post" action="comment.php" method="post" id="post">
19 <?php wp_nonce_field('update-comment_' . $comment->comment_ID) ?>
20 <div class="wrap">
21
22 <div id="poststuff" class="metabox-holder">
23 <input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
24 <input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
25 <?php
26 // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
27
28 /**
29  * Display comment edit meta box.
30  *
31  * Not used, but keeping for a bit longer in case it's needed.
32  *
33  * @since 2.7.0
34  *
35  * @param object $comment Comment data.
36  */
37 function comment_submit_meta_box($comment) {
38 ?>
39 <div class="submitbox" id="submitcomment">
40 <div class="inside-submitbox">
41
42 <p><strong><?php _e('Approval Status') ?></strong></p>
43 <p id='comment-status-radio'>
44 <label><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php _e('Approved') ?></label>
45 <label><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _e('Awaiting Moderation') ?></label>
46 <label><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php _e('Spam') ?></label>
47 </p>
48
49 <div class="insidebox" id="deletebutton">
50 <?php
51 echo "<a class='submitdelete' href='" . wp_nonce_url("comment.php?action=deletecomment&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n  'Cancel' to stop, 'OK' to delete.")) . "') ) { return true;}return false;\">" . __('Delete comment') . "</a>"; ?>
52 </div>
53
54 <?php
55 $stamp = __('%1$s at %2$s');
56 $date = mysql2date(get_option('date_format'), $comment->comment_date);
57 $time = mysql2date(get_option('time_format'), $comment->comment_date);
58 ?>
59 <div class="insidebox curtime"><span id="timestamp"><?php printf($stamp, $date, $time); ?></span>
60 &nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
61 <div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0, 5); ?></div></div>
62
63 </div>
64
65 <p class="submit">
66 <input type="submit" name="save" value="<?php _e('Save'); ?>" tabindex="4" class="button button-highlighted" />
67 <a class="preview button" href="<?php echo get_comment_link(); ?>" target="_blank"><?php _e('View Comment'); ?></a>
68 </p>
69 </div>
70 <?php
71 }
72 // add_meta_box('submitdiv', __('Save'), 'comment_submit_meta_box', 'comment', 'side', 'core');
73 ?>
74
75 <div id="side-info-column" class="inner-sidebar">
76 <div id="submitdiv" class="stuffbox" >
77 <h3><span class='hndle'>Save</span></h3>
78
79 <div class="submitbox" id="submitcomment">
80 <div class="inside-submitbox">
81
82 <div class="insidebox">
83 <div id='comment-status-radio'>
84 <p><strong><?php _e('This comment is') ?></strong></p>
85 <label><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php _e('Approved') ?></label><br />
86 <label><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php _e('Awaiting Moderation') ?></label><br />
87 <label><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php _e('Spam') ?></label>
88 </div>
89 </div>
90
91 <div class="insidebox" id="deletebutton">
92 <?php
93 echo "<a class='submitdelete' href='" . wp_nonce_url("comment.php?action=deletecomment&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n  'Cancel' to stop, 'OK' to delete.")) . "') ) { return true;}return false;\">" . __('Delete comment') . "</a>"; ?>
94 </div>
95
96 <?php
97 $stamp = __('%1$s at %2$s');
98 $date = mysql2date(get_option('date_format'), $comment->comment_date);
99 $time = mysql2date(get_option('time_format'), $comment->comment_date);
100 ?>
101 <div class="insidebox curtime"><span id="timestamp"><?php printf($stamp, $date, $time); ?></span>&nbsp;<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
102 <div id='timestampdiv' class='hide-if-js'><?php touch_time(('editcomment' == $action), 0, 5); ?></div></div>
103
104 </div>
105
106 <p class="submit">
107 <input type="submit" name="save" value="<?php _e('Save'); ?>" tabindex="4" class="button button-highlighted" />
108 <a class="preview button" href="<?php echo get_comment_link(); ?>" target="_blank"><?php _e('View Comment'); ?></a>
109 </p>
110 </div>
111
112 </div>
113 </div>
114
115 <div id="post-body" class="<?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?>">
116 <div id="post-body-content" class="has-sidebar-content">
117
118 <div id="namediv" class="stuffbox">
119 <h3><label for="name"><?php _e('Name') ?></label></h3>
120 <div class="inside">
121 <input type="text" name="newcomment_author" size="30" value="<?php echo attribute_escape( $comment->comment_author ); ?>" tabindex="1" id="name" />
122 </div>
123 </div>
124
125 <div id="postdiv" class="postarea">
126 <h3><?php _e('Comment') ?></h3>
127 <?php the_editor($comment->comment_content, 'content', 'newcomment_author_url', false, 4); ?>
128 <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
129 </div>
130
131 <div id="emaildiv" class="stuffbox">
132 <h3><label for="email"><?php _e('E-mail') ?></label></h3>
133 <div class="inside">
134 <input type="text" name="newcomment_author_email" size="30" value="<?php echo attribute_escape( $comment->comment_author_email ); ?>" tabindex="2" id="email" />
135 </div>
136 </div>
137
138 <div id="uridiv" class="stuffbox">
139 <h3><label for="newcomment_author_url"><?php _e('URL') ?></label></h3>
140 <div class="inside">
141 <input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" value="<?php echo attribute_escape( $comment->comment_author_url ); ?>" tabindex="3" />
142 </div>
143 </div>
144
145 <?php do_meta_boxes('comment', 'normal', $comment); ?>
146
147 <input type="hidden" name="c" value="<?php echo $comment->comment_ID ?>" />
148 <input type="hidden" name="p" value="<?php echo $comment->comment_post_ID ?>" />
149 <input name="referredby" type="hidden" id="referredby" value="<?php echo wp_get_referer(); ?>" />
150 <?php wp_original_referer_field(true, 'previous'); ?>
151 <input type="hidden" name="noredir" value="1" />
152
153 </div>
154 </div>
155 </div>
156 </div>
157 </form>
158
159 <script type="text/javascript">
160 try{document.post.name.focus();}catch(e){}
161 </script>
162
Note: See TracBrowser for help on using the browser.