diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php
index 16ea74ddab..32f28b1ca0 100644
--- a/wp-admin/admin-functions.php
+++ b/wp-admin/admin-functions.php
@@ -106,22 +106,26 @@ function dropdown_categories($default = 0) {
// Dandy new recursive multiple category stuff.
function cat_rows($parent = 0, $level = 0, $categories = 0) {
- global $wpdb, $bgcolor;
- if (!$categories) {
+ global $wpdb, $bgcolor, $user_level;
+ if (!$categories)
$categories = $wpdb->get_results("SELECT * FROM $wpdb->categories ORDER BY cat_name");
- }
+
if ($categories) {
foreach ($categories as $category) {
if ($category->category_parent == $parent) {
$category->cat_name = htmlspecialchars($category->cat_name);
$count = $wpdb->get_var("SELECT COUNT(post_id) FROM $wpdb->post2cat WHERE category_id = $category->cat_ID");
$pad = str_repeat('— ', $level);
-
+ if ( $user_level > 3 )
+ $edit = "" . __('Edit') . "
cat_name)) . "')\" class='delete'>" . __('Delete') . "";
+ else
+ $edit = '';
+
$class = ('alternate' == $class) ? '' : 'alternate';
echo " | $category->cat_ID | $pad $category->cat_name |
$category->category_description |
$count |
- " . __('Edit') . " | cat_name)) . "')\" class='delete'>" . __('Delete') . " |
+ $edit |
";
cat_rows($category->cat_ID, $level + 1);
}
diff --git a/wp-admin/categories.php b/wp-admin/categories.php
index 235ba2008d..b384437742 100644
--- a/wp-admin/categories.php
+++ b/wp-admin/categories.php
@@ -112,10 +112,8 @@ break;
default:
- require_once ('admin-header.php');
- if ($user_level < 3) {
- die(sprintf(__("You have no right to edit the categories for this blog.
Ask for a promotion to your blog admin. :)"), get_settings('admin_email')));
- }
+require_once ('admin-header.php');
+
$messages[1] = __('Category added.');
$messages[2] = __('Category deleted.');
$messages[3] = __('Category updated.');
@@ -126,7 +124,11 @@ $messages[3] = __('Category updated.');
-
add new)'), '#addcat') ?>
+ 3 ) : ?>
+
add new)'), '#addcat') ?>
+
+
+
|
@@ -142,6 +144,7 @@ cat_rows();
+ 3 ) : ?>
+
- Your level is not high enough to moderate comments.'));
- }
-
if (isset($deleted) || isset($approved) || isset($ignored)) {
echo "\n
";
if ($approved) {
@@ -107,8 +103,12 @@ if (isset($deleted) || isset($approved) || isset($ignored)) {
?>