<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[13008] trunk/wp-admin/includes/template.php: Remove cat_rows()
admin template functions.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/13008">13008</a></dd>
<dt>Author</dt> <dd>dd32</dd>
<dt>Date</dt> <dd>2010-02-07 05:54:33 +0000 (Sun, 07 Feb 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove cat_rows() admin template functions. See <a href="http://trac.wordpress.org/ticket/11838">#11838</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (13007 => 13008)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2010-02-07 05:07:36 UTC (rev 13007)
+++ trunk/wp-admin/includes/template.php        2010-02-07 05:54:33 UTC (rev 13008)
</span><span class="lines">@@ -8,199 +8,9 @@
</span><span class="cx"> * @subpackage Administration
</span><span class="cx"> */
</span><span class="cx">
</span><del>-// Ugly recursive category stuff.
</del><span class="cx"> /**
</span><span class="cx"> * {@internal Missing Short Description}}
</span><span class="cx"> *
</span><del>- * @since unknown
- *
- * @param unknown_type $parent
- * @param unknown_type $level
- * @param unknown_type $categories
- * @param unknown_type $page
- * @param unknown_type $per_page
- */
-function cat_rows( $parent = 0, $level = 0, $categories = 0, $page = 1, $per_page = 20, $taxonomy = 'category' ) {
-
-        $count = 0;
-
-        if ( empty($categories) ) {
-
-                $args = array('hide_empty' => 0, 'taxonomy' => $taxonomy);
-                if ( !empty($_GET['s']) )
-                        $args['search'] = $_GET['s'];
-
-                $categories = get_categories( $args );
-
-                if ( empty($categories) )
-                        return false;
-        }
-
-        $children = _get_term_hierarchy($taxonomy);
-
-        echo _cat_rows( $parent, $level, $categories, $children, $page, $per_page, $count );
-
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $categories
- * @param unknown_type $count
- * @param unknown_type $parent
- * @param unknown_type $level
- * @param unknown_type $page
- * @param unknown_type $per_page
- * @return string the output of the table.
- */
-function _cat_rows( $parent = 0, $level = 0, $categories, &$children, $page = 1, $per_page = 20, &$count ) {
-
-        $start = ($page - 1) * $per_page;
-        $end = $start + $per_page;
-
-        $output = '';
-        foreach ( $categories as $key => $category ) {
-                if ( $count >= $end )
-                        break;
-
-                if ( $category->parent != $parent && empty($_GET['s']) )
-                        continue;
-
-                // If the page starts in a subtree, print the parents.
-                if ( $count == $start && $category->parent > 0 ) {
-
-                        $my_parents = array();
-                        $p = $category->parent;
-                        while ( $p ) {
-                                $my_parent = get_category( $p );
-                                $my_parents[] = $my_parent;
-                                if ( $my_parent->parent == 0 )
-                                        break;
-                                $p = $my_parent->parent;
-                        }
-
-                        $num_parents = count($my_parents);
-                        while( $my_parent = array_pop($my_parents) ) {
-                                $output = "\t" . _cat_row( $my_parent, $level - $num_parents );
-                                $num_parents--;
-                        }
-                }
-
-                if ( $count >= $start )
-                        $output .= "\t" . _cat_row( $category, $level );
-
-                unset( $categories[ $key ] );
-
-                $count++;
-
-                if ( isset($children[$category->term_id]) )
-                        $output .= _cat_rows( $category->term_id, $level + 1, $categories, $children, $page, $per_page, $count );
-        }
-
-        return $output;
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since unknown
- *
- * @param unknown_type $category
- * @param unknown_type $level
- * @param unknown_type $name_override
- * @return unknown
- */
-function _cat_row( $category, $level, $name_override = false ) {
-        static $row_class = '';
-
-        $category = get_category( $category, OBJECT, 'display' );
-
-        $default_cat_id = (int) get_option( 'default_category' );
-        $pad = str_repeat( '&#8212; ', max(0, $level) );
-        $name = ( $name_override ? $name_override : $pad . ' ' . $category->name );
-        $edit_link = "categories.php?action=edit&amp;cat_ID=$category->term_id";
-        if ( current_user_can( 'manage_categories' ) ) {
-                $edit = "<a class='row-title' href='$edit_link' title='" . esc_attr(sprintf(__('Edit &#8220;%s&#8221;'), $category->name)) . "'>" . esc_attr( $name ) . '</a><br />';
-                $actions = array();
-                $actions['edit'] = '<a href="' . $edit_link . '">' . __('Edit') . '</a>';
-                $actions['inline hide-if-no-js'] = '<a href="#" class="editinline">' . __('Quick&nbsp;Edit') . '</a>';
-                if ( $default_cat_id != $category->term_id )
-                        $actions['delete'] = "<a class='delete:the-list:cat-$category->term_id submitdelete' href='" . wp_nonce_url("categories.php?action=delete&amp;cat_ID=$category->term_id", 'delete-category_' . $category->term_id) . "'>" . __('Delete') . "</a>";
-                $actions = apply_filters('cat_row_actions', $actions, $category);
-                $action_count = count($actions);
-                $i = 0;
-                $edit .= '<div class="row-actions">';
-                foreach ( $actions as $action => $link ) {
-                        ++$i;
-                        ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
-                        $edit .= "<span class='$action'>$link$sep</span>";
-                }
-                $edit .= '</div>';
-        } else {
-                $edit = $name;
-        }
-
-        $row_class = 'alternate' == $row_class ? '' : 'alternate';
-        $qe_data = get_category_to_edit($category->term_id);
-
-        $category->count = number_format_i18n( $category->count );
-        $posts_count = ( $category->count > 0 ) ? "<a href='edit.php?cat=$category->term_id'>$category->count</a>" : $category->count;
-        $output = "<tr id='cat-$category->term_id' class='iedit $row_class'>";
-
-        $columns = get_column_headers('categories');
-        $hidden = get_hidden_columns('categories');
-        foreach ( $columns as $column_name => $column_display_name ) {
-                $class = "class=\"$column_name column-$column_name\"";
-
-                $style = '';
-                if ( in_array($column_name, $hidden) )
-                        $style = ' style="display:none;"';
-
-                $attributes = "$class$style";
-
-                switch ($column_name) {
-                        case 'cb':
-                                $output .= "<th scope='row' class='check-column'>";
-                                if ( $default_cat_id != $category->term_id ) {
-                                        $output .= "<input type='checkbox' name='delete[]' value='$category->term_id' />";
-                                } else {
-                                        $output .= "&nbsp;";
-                                }
-                                $output .= '</th>';
-                                break;
-                        case 'name':
-                                $output .= "<td $attributes>$edit";
-                                $output .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
-                                $output .= '<div class="name">' . $qe_data->name . '</div>';
-                                $output .= '<div class="slug">' . apply_filters('editable_slug', $qe_data->slug) . '</div>';
-                                $output .= '<div class="cat_parent">' . $qe_data->parent . '</div></div></td>';
-                                break;
-                        case 'description':
-                                $output .= "<td $attributes>$category->description</td>";
-                                break;
-                        case 'slug':
-                                $output .= "<td $attributes>" . apply_filters('editable_slug', $category->slug) . "</td>";
-                                break;
-                        case 'posts':
-                                $attributes = 'class="posts column-posts num"' . $style;
-                                $output .= "<td $attributes>$posts_count</td>\n";
-                                break;
-                        default:
-                                $output .= "<td $attributes>";
-                                $output .= apply_filters('manage_categories_custom_column', '', $column_name, $category->term_id);
-                                $output .= "</td>";
-                }
-        }
-        $output .= '</tr>';
-
-        return $output;
-}
-
-/**
- * {@internal Missing Short Description}}
- *
</del><span class="cx"> * @since 2.7
</span><span class="cx"> *
</span><span class="cx"> * Outputs the HTML for the hidden table rows used in Categories, Link Caregories and Tags quick edit.
</span><span class="lines">@@ -2708,7 +2518,7 @@
</span><span class="cx"> ?>
</span><span class="cx"> </select>
</span><span class="cx"> <input class="hide-if-js" type="text" id="metakeyinput" name="metakeyinput" tabindex="7" value="" />
</span><del>-<a href="#postcustomstuff" class="hide-if-no-js" onclick="jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggle();return false;">
</del><ins>+<a href="#postcustomstuff" class="hide-if-no-js" onClick="jQuery('#metakeyinput, #metakeyselect, #enternew, #cancelnew').toggle();return false;">
</ins><span class="cx"> <span id="enternew"><?php _e('Enter new'); ?></span>
</span><span class="cx"> <span id="cancelnew" class="hidden"><?php _e('Cancel'); ?></span></a>
</span><span class="cx"> <?php } else { ?>
</span><span class="lines">@@ -3385,7 +3195,7 @@
</span><span class="cx">                                 <?php wp_nonce_field( 'find-posts', '_ajax_nonce', false ); ?>
</span><span class="cx">                                 <label class="screen-reader-text" for="find-posts-input"><?php _e( 'Search' ); ?></label>
</span><span class="cx">                                 <input type="text" id="find-posts-input" name="ps" value="" />
</span><del>-                                <input type="button" onclick="findPosts.send();" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br />
</del><ins>+                                <input type="button" onClick="findPosts.send();" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br />
</ins><span class="cx">
</span><span class="cx">                                 <input type="radio" name="find-posts-what" id="find-posts-posts" checked="checked" value="posts" />
</span><span class="cx">                                 <label for="find-posts-posts"><?php _e( 'Posts' ); ?></label>
</span><span class="lines">@@ -3395,7 +3205,7 @@
</span><span class="cx">                         <div id="find-posts-response"></div>
</span><span class="cx">                 </div>
</span><span class="cx">                 <div class="find-box-buttons">
</span><del>-                        <input type="button" class="button alignleft" onclick="findPosts.close();" value="<?php esc_attr_e('Close'); ?>" />
</del><ins>+                        <input type="button" class="button alignleft" onClick="findPosts.close();" value="<?php esc_attr_e('Close'); ?>" />
</ins><span class="cx">                         <input id="find-posts-submit" type="submit" class="button-primary alignright" value="<?php esc_attr_e('Select'); ?>" />
</span><span class="cx">                 </div>
</span><span class="cx">         </div>
</span></span></pre>
</div>
</div>
</body>
</html>