Changeset 6800
- Timestamp:
- 02/12/2008 09:25:19 AM (18 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 2 edited
-
edit-tags.php (modified) (3 diffs)
-
includes/template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-tags.php
r6759 r6800 102 102 <div class="wrap"> 103 103 104 <form id=" tags-filter" action="" method="get">104 <form id="posts-filter" action="" method="get"> 105 105 <?php if ( current_user_can('manage_categories') ) : ?> 106 <h2><?php printf(__(' Tags (<a href="%s">add new</a>)'), '#addtag') ?> </h2>106 <h2><?php printf(__('Manage Tags (<a href="%s">add new</a>)'), '#addtag') ?> </h2> 107 107 <?php else : ?> 108 <h2><?php _e(' Tags') ?> </h2>108 <h2><?php _e('Manage Tags') ?> </h2> 109 109 <?php endif; ?> 110 <p id="tag-search"> 111 <input type="text" id="tag-search-input" name="s" value="<?php echo attribute_escape( stripslashes( $_GET[ 's' ]) ); ?>" /> 112 <input type="submit" value="<?php _e( 'Search Tags' ); ?>" /> 113 </p> 110 111 <p id="post-search"> 112 <input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" /> 113 <input type="submit" value="<?php _e( 'Search Tags' ); ?>" /> 114 </p> 115 116 <br style="clear:both;" /> 117 118 <div class="tablenav"> 119 120 <?php 121 $pagenum = absint( $_GET['pagenum'] ); 122 if ( empty($pagenum) ) 123 $pagenum = 1; 124 if( !$tagsperpage || $tagsperpage < 0 ) 125 $tagsperpage = 20; 126 127 $page_links = paginate_links( array( 128 'base' => add_query_arg( 'pagenum', '%#%' ), 129 'format' => '', 130 'total' => ceil(wp_count_terms('post_tag') / $tagsperpage), 131 'current' => $pagenum 132 )); 133 134 if ( $page_links ) 135 echo "<div class='tablenav-pages'>$page_links</div>"; 136 ?> 137 138 <div style="float: left"> 139 <input type="button" value="<?php _e('Delete'); ?>" name="deleteit" /> 140 </div> 141 142 <br style="clear:both;" /> 143 </div> 114 144 </form> 115 145 … … 123 153 <tr> 124 154 <th scope="col" style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById('deletetags'));" /></th> 125 <th scope="col" style="text-align: center"><?php _e('ID') ?></th>126 155 <th scope="col"><?php _e('Name') ?></th> 127 156 <th scope="col" width="90" style="text-align: center"><?php _e('Posts') ?></th> 128 <th colspan="2" style="text-align: center"><?php _e('Action') ?></th>129 157 </tr> 130 158 </thead> 131 159 <tbody id="the-list" class="list:tag"> 132 160 <?php 133 $pagenum = absint( $_GET['pagenum'] ); 134 if( !$tagsperpage || $tagsperpage < 0 ) { 135 $tagsperpage = 20; 136 } 161 137 162 $searchterms = trim( $_GET['s'] ); 138 163 … … 143 168 <p class="submit"><input type="submit" class="button" name="deletetags" id="deletetags" value="<?php _e('Delete Checked Tags »') ?>" onclick="return confirm('<?php echo js_escape(__("You are about to delete these tags permanently.\n'Cancel' to stop, 'OK' to delete.")); ?>')" /></p> 144 169 </form> 170 171 <div class="tablenav"> 172 145 173 <?php 146 147 $baseurl = get_bloginfo( 'wpurl' ) . '/wp-admin/edit-tags.php?pagenum='; 148 if( $pagenum >= 1 ) { 149 echo '<a href="' . $baseurl . ($pagenum - 1 ) . '"><<' . __('Previous Tags') . '</a>'; 150 if( $count == $tagsperpage ) { 151 echo ' | '; 152 } 153 } 154 155 156 if( $count == $tagsperpage ) { 157 echo '<a href="' . $baseurl . ($pagenum + 1 ) . '">' . __('Next Tags') . '>></a>'; 158 } 159 174 if ( $page_links ) 175 echo "<div class='tablenav-pages'>$page_links</div>"; 160 176 ?> 177 <br style="clear:both;" /> 178 </div> 161 179 162 180 </div> -
trunk/wp-admin/includes/template.php
r6799 r6800 243 243 $out .= '<tr id="tag-' . $tag->term_id . '"' . $class . '>'; 244 244 $out .= '<td style="text-align: center"> <input type="checkbox" name="delete_tags[]" value="' . $tag->term_id . '" /></td>'; 245 $out .= '<th scope="row">' . $tag->term_id . '</th>'; 246 247 $out .= '<td>' . apply_filters( 'term_name', $tag->name ) . '</td>'; 245 $out .= '<td><a href="edit-tags.php?action=edit&tag_ID=' . $tag->term_id . '">' . 246 apply_filters( 'term_name', $tag->name ) . '</td>'; 248 247 249 248 $out .= "<td>$count</td>"; 250 $out .= '<td><a href="edit-tags.php?action=edit&tag_ID=' . $tag->term_id . '" class="edit">' .251 __( 'Edit' ) . "</a></td>" .252 '<td><a href="' . wp_nonce_url( "edit-tags.php?action=delete&tag_ID=$tag->term_id",253 'delete-tag_' . $tag->term_id ) .254 '" class="delete:the-list:tag-' . $tag->term_id . ' delete">' .255 __( 'Delete' ) . "</a></td>";256 249 $out .= '</tr>'; 257 250 … … 262 255 // assuming M tags displayed at a time on the page 263 256 // Returns the number of tags displayed 264 function tag_rows( $page = 0, $pagesize = 20, $searchterms = '' ) {257 function tag_rows( $page = 1, $pagesize = 20, $searchterms = '' ) { 265 258 266 259 // Get a page worth of tags 267 $start = $page* $pagesize;260 $start = ($page - 1) * $pagesize; 268 261 269 262 $args = array('offset' => $start, 'number' => $pagesize, 'hide_empty' => 0); 270 263 271 264 if ( !empty( $searchterms ) ) { 272 $args[' name__like'] = '%' . like_escape( $searchterms );265 $args['search'] = $searchterms; 273 266 } 274 267
Note: See TracChangeset
for help on using the changeset viewer.