From 9d42ec4ee5db0437e9ad14b793f044fa0f5de8fe Mon Sep 17 00:00:00 2001 From: donncha Date: Wed, 7 Jun 2006 14:28:14 +0000 Subject: WP Merge and new features git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@550 7be80a69-a1ef-0310-a953-fb0f7c49ff36 --- wp-inst/wp-admin/admin-functions.php | 62 +++++++++++++++++------------------- 1 file changed, 30 insertions(+), 32 deletions(-) (limited to 'wp-inst/wp-admin/admin-functions.php') diff --git a/wp-inst/wp-admin/admin-functions.php b/wp-inst/wp-admin/admin-functions.php index 527df20..bf25871 100644 --- a/wp-inst/wp-admin/admin-functions.php +++ b/wp-inst/wp-admin/admin-functions.php @@ -647,7 +647,7 @@ function cat_rows($parent = 0, $level = 0, $categories = 0) { global $wpdb, $class; if (!$categories) - $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name"); + $categories = get_categories('hide_empty=0'); if ($categories) { foreach ($categories as $category) { @@ -664,7 +664,7 @@ function cat_rows($parent = 0, $level = 0, $categories = 0) { $default_link_cat_id = get_option('default_link_category'); if ( ($category->cat_ID != $default_cat_id) && ($category->cat_ID != $default_link_cat_id) ) - $edit .= "cat_ID, '".sprintf(__("You are about to delete the category "%s".\\nAll of its posts will go into the default category of "%s"\\nAll of its bookmarks will go into the default category of "%s".\\n"OK" to delete, "Cancel" to stop."), addslashes($category->cat_name), addslashes(wp_specialchars(get_catname($default_cat_id),'double')), addslashes(wp_specialchars(get_catname($default_link_cat_id),'double')))."' );\" class='delete'>".__('Delete').""; + $edit .= "cat_ID ) . "' onclick=\"return deleteSomething( 'cat', $category->cat_ID, '" . sprintf(__("You are about to delete the category "%s".\\nAll of its posts will go into the default category of "%s"\\nAll of its bookmarks will go into the default category of "%s".\\n"OK" to delete, "Cancel" to stop."), addslashes($category->cat_name), js_escape(get_catname($default_cat_id)), js_escape(get_catname($default_link_cat_id))) . "' );\" class='delete'>".__('Delete').""; else $edit .= "".__("Default"); } @@ -693,7 +693,7 @@ function page_rows($parent = 0, $level = 0, $pages = 0, $hierarchy = true) { global $wpdb, $class, $post; if (!$pages) - $pages = $wpdb->get_results("SELECT * FROM $wpdb->posts WHERE post_type = 'page' ORDER BY menu_order"); + $pages = get_pages('sort_column=menu_order'); if (! $pages) return false; @@ -717,7 +717,7 @@ function page_rows($parent = 0, $level = 0, $pages = 0, $hierarchy = true) { post_modified); ?> " . __('Edit') . ""; } ?> - " . __('Delete') . ""; } ?> + " . __('Delete') . ""; } ?> user_email; + if( $current_user->ID != $user_object->ID || is_site_admin() == false ) + $email = "N/A"; $url = $user_object->user_url; $short_url = str_replace('http://', '', $url); $short_url = str_replace('www.', '', $short_url); @@ -744,19 +748,19 @@ function user_row( $user_object, $style = '' ) { $email $short_url"; - $r .= "\n\t\t$numposts"; + $r .= "\n\t\t$numposts"; $r .= "\n\t\t"; - if (current_user_can('edit_users')) + if ( ( is_site_admin() || $current_user->ID == $user_object->ID ) && current_user_can('edit_user', $user_object->ID) ) $r .= "".__('Edit').""; $r .= "\n\t"; return $r; } function wp_dropdown_cats($currentcat = 0, $currentparent = 0, $parent = 0, $level = 0, $categories = 0) { - global $wpdb, $bgcolor; - if (!$categories) { - $categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name"); - } + global $wpdb; + if (!$categories) + $categories = get_categories('hide_empty=0'); + if ($categories) { foreach ($categories as $category) { if ($currentcat != $category->cat_ID && $parent == $category->category_parent) { @@ -869,7 +873,6 @@ function wp_create_thumbnail($file, $max_side, $effect = '') { if (!empty ($error)) { return $error; } else { - apply_filters( 'wp_create_thumbnail', $thumbpath ); return $thumbpath; } } @@ -1182,14 +1185,15 @@ function save_mod_rewrite_rules() { function the_quicktags() { // Browser detection sucks, but until Safari supports the JS needed for this to work people just assume it's a bug in WP - if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Safari')) + if (!strstr($_SERVER['HTTP_USER_AGENT'], 'Safari')) { echo '
- - + '; + wp_print_scripts( 'quicktags' ); + echo '
'; - else echo ' + } else echo ' -
- + +

+ -

- - -
+

+

+ +