Changeset 8682 for trunk/wp-admin/includes/template.php
- Timestamp:
- 08/20/2008 04:06:36 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r8646 r8682 344 344 $posts_columns = array(); 345 345 $posts_columns['cb'] = '<input type="checkbox" />'; 346 $posts_columns['title'] = __('Title'); 346 347 if ( isset($_GET['post_status']) && 'draft' === $_GET['post_status'] ) 347 348 $posts_columns['modified'] = __('Modified'); … … 350 351 else 351 352 $posts_columns['date'] = __('Date'); 352 $posts_columns['title'] = __('Title'); 353 $posts_columns['author'] = __('Author'); 353 //$posts_columns['author'] = __('Author'); 354 354 $posts_columns['categories'] = __('Categories'); 355 355 $posts_columns['tags'] = __('Tags'); … … 368 368 $posts_columns['icon'] = ''; 369 369 $posts_columns['media'] = _c('Media|media column header'); 370 $posts_columns['desc'] = _c('Description|media column header'); 370 $posts_columns['tags'] = _c('Tags|media column header'); 371 // $posts_columns['desc'] = _c('Description|media column header'); 371 372 $posts_columns['date'] = _c('Date Added|media column header'); 372 373 $posts_columns['parent'] = _c('Appears with|media column header'); 373 374 $posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="images/comment-grey-bubble.png" /></div>'; 374 $posts_columns['location'] = _c('Location|media column header');375 // $posts_columns['actions'] = _c('Actions|media column header'); 375 376 $posts_columns = apply_filters('manage_media_columns', $posts_columns); 376 377 … … 742 743 $authordata = get_userdata($post->post_author); 743 744 $the_comment_status = wp_get_comment_status($comment->comment_ID); 744 $class = ('unapproved' == $the_comment_status) ? 'unapproved' : '';745 745 746 746 if ( current_user_can( 'edit_post', $post->ID ) ) { 747 747 $post_link = "<a href='" . get_comment_link() . "'>"; 748 749 748 $post_link .= get_the_title($comment->comment_post_ID) . '</a>'; 750 751 $edit_link_start = "<a class='row-title' href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>";752 $edit_link_end = '</a>';753 749 } else { 754 750 $post_link = get_the_title($comment->comment_post_ID); 755 $edit_link_start = $edit_link_end ='';756 751 } 757 752 … … 775 770 776 771 ?> 777 <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $ class; ?>'>772 <tr id="comment-<?php echo $comment->comment_ID; ?>" class='<?php echo $the_comment_status; ?>'> 778 773 <?php if ( $checkbox ) : ?> 779 774 <td class="check-column"><?php if ( current_user_can('edit_post', $comment->comment_post_ID) ) { ?><input type="checkbox" name="delete_comments[]" value="<?php echo $comment->comment_ID; ?>" /><?php } ?></td> 780 775 <?php endif; ?> 781 <td class="comment"> 782 <p class="comment-author"><strong><?php echo $edit_link_start; comment_author(); echo $edit_link_end; ?></strong><br /> 783 <?php if ( !empty($author_url) ) : ?> 784 <a href="<?php echo $author_url ?>"><?php echo $author_url_display; ?></a> | 785 <?php endif; ?> 786 <?php if ( current_user_can( 'edit_post', $post->ID ) ) : ?> 787 <?php if ( !empty($comment->comment_author_email) ): ?> 788 <?php comment_author_email_link() ?> | 789 <?php endif; ?> 790 <a href="edit-comments.php?s=<?php comment_author_IP() ?>&mode=detail"><?php comment_author_IP() ?></a> 791 <?php endif; //current_user_can?> 792 </p> 793 <?php if ( 'detail' == $mode ) comment_text(); ?> 794 <p><?php printf(__('From %1$s, %2$s'), $post_link, $ptime) ?></p> 795 </td> 796 <td><?php comment_date(__('Y/m/d')); ?></td> 797 <td class="action-links"> 776 <td class="comment-column"> 777 <?php if ( 'detail' == $mode || 'single' == $mode ) comment_text(); ?> 778 798 779 <?php 799 800 780 $actions = array(); 801 781 … … 803 783 $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 804 784 $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 805 806 // we're looking at list of only approved or only unapproved comments 807 if ( 'moderated' == $comment_status ) { 808 $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 809 unset($actions['unapprove']); 810 } elseif ( 'approved' == $comment_status ) { 811 $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 812 unset($actions['approve']); 813 } 814 785 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a> | '; 786 $actions['flag'] = "<a href='#' class='no-crazy'>Flag for Follow-up</a> | "; 815 787 $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | '; 816 788 $actions['delete'] = "<a href='$delete_url' class='delete:the-comment-list:comment-$comment->comment_ID delete'>" . __('Delete') . '</a>'; 789 790 if ( $comment_status ) { // not looking at all comments 791 if ( 'approved' == $the_comment_status ) { 792 $actions['unapprove'] = "<a href='$unapprove_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 793 unset($actions['approve']); 794 } else { 795 $actions['approve'] = "<a href='$approve_url' class='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 796 unset($actions['unapprove']); 797 } 798 } 799 800 if ( 'spam' == $the_comment_status ) 801 unset($actions['spam']); 802 817 803 $actions = apply_filters( 'comment_row_actions', $actions, $comment ); 804 818 805 foreach ( $actions as $action => $link ) 819 806 echo "<span class='$action'>$link</span>"; 820 807 } 821 808 ?> 809 </td> 810 <td class="author-column"> 811 <strong><?php comment_author(); ?></strong><br /> 812 <?php if ( !empty($author_url) ) : ?> 813 <a href="<?php echo $author_url ?>"><?php echo $author_url_display; ?></a><br /> 814 <?php endif; ?> 815 <?php if ( current_user_can( 'edit_post', $post->ID ) ) : ?> 816 <?php if ( !empty($comment->comment_author_email) ): ?> 817 <?php comment_author_email_link() ?><br /> 818 <?php endif; ?> 819 <a href="edit-comments.php?s=<?php comment_author_IP() ?>&mode=detail"><?php comment_author_IP() ?></a> 820 <?php endif; //current_user_can?> 822 821 </td> 822 <td class="date-column"><?php comment_date(__('Y/m/d \a\t g:ia')); ?></td> 823 <?php if ( 'single' !== $mode ) : ?> 824 <td class="response-column"> 825 "<?php echo $post_link ?>" <?php echo sprintf('(%s comments)', $post->comment_count); ?><br/> 826 <?php echo get_the_time(__('Y/m/d \a\t g:ia')); ?> 827 </td> 828 <?php endif; ?> 823 829 </tr> 824 830 <?php … … 990 996 $hour = '<input type="text" id="hh" name="hh" value="' . $hh . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />'; 991 997 $minute = '<input type="text" id="mn" name="mn" value="' . $mn . '" size="2" maxlength="2"' . $tab_index_attribute . ' autocomplete="off" />'; 992 printf(_c('%1$s%2$s, %3$s <br />@ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute);998 printf(_c('%1$s%2$s, %3$s @ %4$s : %5$s|1: month input, 2: day input, 3: year input, 4: hour input, 5: minute input'), $month, $day, $year, $hour, $minute); 993 999 echo "\n\n"; 994 1000 foreach ( array('mm', 'jj', 'aa', 'hh', 'mn') as $timeunit ) … … 997 1003 998 1004 <input type="hidden" id="ss" name="ss" value="<?php echo $ss ?>" size="2" maxlength="2" /> 1005 1006 <a href="#edit_timestamp" class="save-timestamp hide-if-no-js button"><?php _e('OK'); ?></a> 1007 <a href="#edit_timestamp" class="edit-timestamp hide-if-no-js"><?php _e('Cancel'); ?></a> 999 1008 <?php 1000 1009 } … … 1173 1182 global $wp_meta_boxes; 1174 1183 1175 1176 1184 if ( !isset($wp_meta_boxes) ) 1177 1185 $wp_meta_boxes = array(); … … 1181 1189 $wp_meta_boxes[$page][$context] = array(); 1182 1190 1191 foreach ( array_keys($wp_meta_boxes[$page]) as $a_context ) { 1183 1192 foreach ( array('high', 'core', 'default', 'low') as $a_priority ) { 1184 if ( !isset($wp_meta_boxes[$page][$ context][$a_priority][$id]) )1193 if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) ) 1185 1194 continue; 1195 1186 1196 // If a core box was previously added or removed by a plugin, don't add. 1187 1197 if ( 'core' == $priority ) { 1188 1198 // If core box previously deleted, don't add 1189 if ( false === $wp_meta_boxes[$page][$ context][$a_priority][$id] )1199 if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] ) 1190 1200 return; 1191 1201 // If box was added with default priority, give it core priority to maintain sort order 1192 1202 if ( 'default' == $a_priority ) { 1193 $wp_meta_boxes[$page][$ context]['core'][$id] = $wp_meta_boxes[$page][$context]['default'][$id];1194 unset($wp_meta_boxes[$page][$ context]['default'][$id]);1203 $wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id]; 1204 unset($wp_meta_boxes[$page][$a_context]['default'][$id]); 1195 1205 } 1196 1206 return; 1197 1207 } 1198 1208 // If no priority given and id already present, use existing priority 1199 if ( empty($priority) ) 1209 if ( empty($priority) ) { 1200 1210 $priority = $a_priority; 1201 // An id can be in only one priority 1202 if ( $priority != $a_priority ) 1203 unset($wp_meta_boxes[$page][$context][$a_priority][$id]); 1211 // else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority. 1212 } elseif ( 'sorted' == $priority ) { 1213 $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title']; 1214 $callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback']; 1215 } 1216 // An id can be in only one priority and one context 1217 if ( $priority != $a_priority || $context != $a_context ) 1218 unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]); 1219 } 1204 1220 } 1205 1221 1206 1222 if ( empty($priority) ) 1207 $priority = low;1223 $priority = 'low'; 1208 1224 1209 1225 if ( !isset($wp_meta_boxes[$page][$context][$priority]) ) … … 1213 1229 } 1214 1230 1231 // crazyhorse - this can be made simpler 1215 1232 function do_meta_boxes($page, $context, $object) { 1216 1233 global $wp_meta_boxes; 1234 static $already_sorted = false; 1217 1235 1218 1236 do_action('do_meta_boxes', $page, $context, $object); 1219 1237 1220 if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) ) 1221 return; 1222 1223 foreach ( array('high', 'core', 'default', 'low') as $priority ) { 1224 if ( ! isset( $wp_meta_boxes[$page][$context][$priority] ) ) 1225 continue; 1226 1227 foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) { 1228 if ( false === $box ) 1229 continue; 1230 echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '">' . "\n"; 1231 echo "<h3>{$box['title']}</h3>\n"; 1232 echo '<div class="inside">' . "\n"; 1233 call_user_func($box['callback'], $object, $box); 1234 echo "</div>\n"; 1235 echo "</div>\n"; 1236 } 1237 } 1238 echo "<div id='$context-sortables' class='meta-box-sortables'>\n"; 1239 1240 $i = 0; 1241 do { 1242 // Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose 1243 if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) { 1244 foreach ( $sorted as $box_context => $ids ) 1245 foreach ( explode(',', $ids) as $id ) 1246 if ( $id ) 1247 add_meta_box( $id, null, null, $page, $box_context, 'sorted' ); 1248 } 1249 $already_sorted = true; 1250 1251 if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) ) 1252 break; 1253 1254 1255 foreach ( array('high', 'sorted', 'core', 'default', 'low') as $priority ) { 1256 foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) { 1257 if ( false == $box || ! $box['title'] ) 1258 continue; 1259 $i++; 1260 echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '">' . "\n"; 1261 echo "<h3><span class='hndle'>{$box['title']}</span></h3>\n"; 1262 echo '<div class="inside">' . "\n"; 1263 call_user_func($box['callback'], $object, $box); 1264 echo "</div>\n"; 1265 echo "</div>\n"; 1266 } 1267 } 1268 } while(0); 1269 1270 echo "</div>"; 1271 1272 return $i; 1273 1238 1274 } 1239 1275
Note: See TracChangeset
for help on using the changeset viewer.