Make WordPress Core


Ignore:
Timestamp:
02/13/2008 07:32:50 AM (17 years ago)
Author:
ryan
Message:

Design update for link categories management.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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
Note: See TracChangeset for help on using the changeset viewer.