diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 25bf68936..7b4757f7c 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -363,38 +363,9 @@ function checked($checked, $current) { if ($checked == $current) echo ' checked="checked"'; } -function return_categories_list( $parent = 0, $sortbyname = FALSE ) -{ - /* - * This function returns an list of all categories - * that have $parent as their parent - * if no parent is specified we will assume top level caegories - * are required. - */ - global $wpdb; - - // select sort order - $sort = "cat_id"; - if( TRUE == $sortbyname ) - { - $sort = "cat_name"; - } - - // First query the database - $cats_tmp = $wpdb->get_results("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY $sort"); - - // Now strip this down to a simple array of IDs - $cats = array(); - if( count($cats_tmp) > 0 ) - { - foreach( $cats_tmp as $cat ) - { - $cats[] = $cat->cat_ID; - } - } - - // Return the list of categories - return $cats; +function return_categories_list( $parent = 0 ) { + global $wpdb; + return $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories WHERE category_parent = $parent ORDER BY category_count DESC"); } function get_nested_categories($default = 0, $parent = 0) { @@ -417,11 +388,10 @@ function get_nested_categories($default = 0, $parent = 0) { $checked_categories[] = $default; } - $cats = return_categories_list($parent, TRUE); + $cats = return_categories_list($parent); $result = array(); - foreach($cats as $cat) - { + foreach($cats as $cat) { $result[$cat]['children'] = get_nested_categories($default, $cat); $result[$cat]['cat_ID'] = $cat; $result[$cat]['checked'] = in_array($cat, $checked_categories); diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index da72ee49f..2cd0984cd 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -85,7 +85,12 @@ window.onload = focusit;

-
+
+

+ + +

+
diff --git a/wp-admin/edit-page-form.php b/wp-admin/edit-page-form.php index a238423de..6e7d44515 100644 --- a/wp-admin/edit-page-form.php +++ b/wp-admin/edit-page-form.php @@ -39,32 +39,83 @@ function focusit() { window.onload = focusit; //--> -
- -
-
-
- -
- - - -
+
+ +
+
+
+

+
+ + + +
-
- -
-
-
- -
-
-
+ +
+

+
+
+ +
+

+

+
+
+ + +
+

+

+
+
+ + +
+

+
+
+ +ID ) ) : // TODO: ROLE SYSTEM ?> +
+

:

+
+ +
+
+ + +
+

+

+
+ +
+
+ +
+ +
+
+ +
@@ -89,58 +140,12 @@ edCanvas = document.getElementById('content');

-
- - - - - - - - - - - - -ID ) ) : // TODO: ROLE SYSTEM ?> - - - - - - - - - - - - - -
- -
-
:
: - -
:
: - escape($post->post_title) ) . "')\""; ?> /> -
-
-
- -
+
+ +
+

+
@@ -154,7 +159,15 @@ if($metadata = has_meta($post_ID)) {
+
+ + + escape($post->post_title) ) . "')\""; ?> /> + +
+ +
\ No newline at end of file diff --git a/wp-admin/page-new.php b/wp-admin/page-new.php index 8c79f3dbf..4ca573a53 100644 --- a/wp-admin/page-new.php +++ b/wp-admin/page-new.php @@ -2,6 +2,7 @@ require_once('admin.php'); $title = __('New Page'); $parent_file = 'post.php'; +$editing = true; require_once('admin-header.php'); ?> diff --git a/wp-admin/upgrade-functions.php b/wp-admin/upgrade-functions.php index 24c366c4c..238819317 100644 --- a/wp-admin/upgrade-functions.php +++ b/wp-admin/upgrade-functions.php @@ -266,6 +266,14 @@ function upgrade_160() { foreach ( $old_user_fields as $old ) $wpdb->query("ALTER TABLE $wpdb->users DROP $old"); $wpdb->show_errors(); + + if ( 0 == $wpdb->get_var("SELECT SUM(category_count) FROM $wpdb->categories") ) { // Create counts + $categories = $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories"); + foreach ( $categories as $cat_id ) { + $count = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->post2cat WHERE category_id = '$cat_id'"); + $wpdb->query("UPDATE $wpdb->categories SET category_count = '$count' WHERE cat_ID = '$cat_id'"); + } + } } // The functions we use to actually do stuff diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index 59b776dd8..ead69db46 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -365,6 +365,10 @@ textarea, input, select { font-family: "Courier New", Courier, mono; } +#title { + font-size: 1.5em; +} + #excerpt { height: 1.8em; width: 98%; @@ -618,8 +622,18 @@ textarea, input, select { margin-left: 2%; } +#categorydiv div div { + height: 12em; + overflow: auto; +} + +#ajaxcat input { + border: 1px solid #ccc; +} + /* default box styles */ .dbx-box { +background: #fff; } /* box when toggle is open */