Changeset 6804

Show
Ignore:
Timestamp:
02/13/08 07:32:50 (9 months ago)
Author:
ryan
Message:

Design update for link categories management.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/wp-admin/categories.php

    r6799 r6804  
    127127</table> 
    128128 
     129<br style="clear:both;" /> 
     130 
     131<div class="tablenav"> 
     132<br style="clear:both;" /> 
     133</div> 
     134 
    129135</div> 
    130136 
  • trunk/wp-admin/edit-link-categories.php

    r6555 r6804  
    2020 
    2121<div class="wrap"> 
     22 
     23<form id="posts-filter" action="" method="get"> 
    2224<?php if ( current_user_can('manage_categories') ) : ?> 
    23     <h2><?php printf(__('Categories (<a href="%s">add new</a>)'), '#addcat') ?> </h2> 
     25    <h2><?php printf(__('Manage Link Categories (<a href="%s">add new</a>)'), '#addcat') ?> </h2> 
    2426<?php else : ?> 
    25     <h2><?php _e('Categories') ?> </h2> 
     27    <h2><?php _e('Manage Link Categories') ?> </h2> 
    2628<?php endif; ?> 
     29 
     30<p id="post-search"> 
     31    <input type="text" id="post-search-input" name="s" value="<?php echo attribute_escape(stripslashes($_GET['s'])); ?>" /> 
     32    <input type="submit" value="<?php _e( 'Search Categories' ); ?>" /> 
     33</p> 
     34 
     35<br style="clear:both;" /> 
     36 
     37<div class="tablenav"> 
     38 
     39<?php 
     40$pagenum = absint( $_GET['pagenum'] ); 
     41if ( empty($pagenum) ) 
     42    $pagenum = 1; 
     43if( !$catsperpage || $catsperpage < 0 ) 
     44    $catsperpage = 3; 
     45 
     46$page_links = paginate_links( array( 
     47    'base' => add_query_arg( 'pagenum', '%#%' ), 
     48    'format' => '', 
     49    'total' => ceil(wp_count_terms('link_category') / $catsperpage), 
     50    'current' => $pagenum 
     51)); 
     52 
     53if ( $page_links ) 
     54    echo "<div class='tablenav-pages'>$page_links</div>"; 
     55?> 
     56 
     57<div style="float: left"> 
     58<input type="button" value="<?php _e('Delete'); ?>" name="deleteit" /> 
     59</div> 
     60 
     61<br style="clear:both;" /> 
     62</div> 
     63</form> 
     64 
     65<br style="clear:both;" /> 
     66 
    2767<table class="widefat"> 
    2868    <thead> 
    2969    <tr> 
    30        <th scope="col" style="text-align: center"><?php _e('ID') ?></th> 
     70        <th scope="col" style="text-align: center"><input type="checkbox" onclick="checkAll(document.getElementById('deletetags'));" /></th> 
    3171        <th scope="col"><?php _e('Name') ?></th> 
    3272        <th scope="col"><?php _e('Description') ?></th> 
    3373        <th scope="col" width="90" style="text-align: center"><?php _e('Links') ?></th> 
    34         <th colspan="2" style="text-align: center"><?php _e('Action') ?></th> 
    3574    </tr> 
    3675    </thead> 
    3776    <tbody id="the-list" class="list:link-cat"> 
    3877<?php 
    39 $categories = get_terms( 'link_category', 'hide_empty=0' ); 
     78$start = ($pagenum - 1) * $catsperpage; 
     79$args = array('offset' => $start, 'number' => $catsperpage, 'hide_empty' => 0); 
     80if ( !empty( $_GET['s'] ) ) 
     81    $args['search'] = $_GET['s']; 
     82 
     83$categories = get_terms( 'link_category', $args ); 
    4084if ( $categories ) { 
    4185    $output = ''; 
     
    5397</table> 
    5498 
     99<br style="clear:both;" /> 
     100 
     101<div class="tablenav"> 
     102 
     103<?php 
     104if ( $page_links ) 
     105    echo "<div class='tablenav-pages'>$page_links</div>"; 
     106?> 
     107<br style="clear:both;" /> 
     108</div> 
     109 
    55110</div> 
    56111 
  • trunk/wp-admin/edit-pages.php

    r6798 r6804  
    118118?> 
    119119 
     120<div class="tablenav"> 
     121<br style="clear:both;" /> 
     122</div> 
     123 
    120124</div> 
    121125 
  • trunk/wp-admin/includes/template.php

    r6800 r6804  
    7171 
    7272    if ( current_user_can( 'manage_categories' ) ) { 
    73         $edit = "<a href='link-category.php?action=edit&amp;cat_ID=$category->term_id' class='edit'>".__( 'Edit' )."</a></td>"; 
     73        $edit = "<a href='link-category.php?action=edit&amp;cat_ID=$category->term_id' class='edit'>". ( $name_override ? $name_override : $category->name ) ."</a>"; 
    7474        $default_cat_id = (int) get_option( 'default_link_category' ); 
    75  
    76         $delete_url = wp_nonce_url( "link-category.php?action=delete&amp;cat_ID=$category->term_id", "delete-link-category_$category->term_id" ); 
    77         if ( $category->term_id != $default_cat_id ) 
    78             $edit .= "<td><a href='$delete_url' class='delete:the-list:link-cat-$category->term_id delete'>" . __( 'Delete' ) . "</a>"; 
    79         else 
    80             $edit .= "<td style='text-align:center'>" . __( "Default" ); 
    8175    } else { 
    82         $edit = ''
     76        $edit = ( $name_override ? $name_override : $category->name )
    8377    } 
    8478 
     
    8781    $category->count = number_format_i18n( $category->count ); 
    8882    $count = ( $category->count > 0 ) ? "<a href='link-manager.php?cat_id=$category->term_id'>$category->count</a>" : $category->count; 
    89     $output = "<tr id='link-cat-$category->term_id'$class> 
    90         <th scope='row' style='text-align: center'>$category->term_id</th> 
    91         <td>" . ( $name_override ? $name_override : $category->name ) . "</td> 
     83    $output = "<tr id='link-cat-$category->term_id'$class>" . 
     84        '<td style="text-align: center"> <input type="checkbox" name="delete_tags[]" value="' . $category->term_id . '" /></td>' . 
     85        "<td>$edit</td> 
    9286        <td>$category->description</td> 
    93         <td align='center'>$count</td> 
    94         <td>$edit</td>\n\t</tr>\n"; 
     87        <td align='center'>$count</td>"; 
    9588 
    9689    return apply_filters( 'link_cat_row', $output ); 
  • trunk/wp-admin/link-manager.php

    r6799 r6804  
    204204<div id="ajax-response"></div> 
    205205 
     206<div class="tablenav"> 
     207<br style="clear:both;" /> 
     208</div> 
     209 
    206210</form> 
    207211