A few CSS polishes
git-svn-id: http://svn.automattic.com/wordpress/trunk@2730 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
54f46d875a
commit
ba19c859f9
|
@ -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);
|
||||
|
|
|
@ -85,7 +85,12 @@ window.onload = focusit;
|
|||
|
||||
<fieldset id="categorydiv" class="dbx-box">
|
||||
<h3 class="dbx-handle"><?php _e('Categories') ?></h3>
|
||||
<div class="dbx-content"><?php dropdown_categories(get_settings('default_category')); ?></div>
|
||||
<div class="dbx-content"><div><?php dropdown_categories(get_settings('default_category')); ?></div>
|
||||
<p id="ajaxcat">
|
||||
<input type="text" name="newcat" id="newcat" size="16" />
|
||||
<input type="button" name="Button" value="+">
|
||||
</p>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset class="dbx-box">
|
||||
|
|
|
@ -39,32 +39,83 @@ function focusit() {
|
|||
window.onload = focusit;
|
||||
//-->
|
||||
</script>
|
||||
<fieldset id="titlediv">
|
||||
<legend><?php _e('Page Title') ?></legend>
|
||||
<div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
|
||||
</fieldset>
|
||||
<fieldset id="commentstatusdiv">
|
||||
<legend><?php _e('Discussion') ?></legend>
|
||||
<div>
|
||||
<input name="advanced_view" type="hidden" value="1" />
|
||||
<label for="comment_status" class="selectit">
|
||||
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
|
||||
<?php _e('Allow Comments') ?></label>
|
||||
<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label>
|
||||
</div>
|
||||
<div id="poststuff">
|
||||
|
||||
<div id="moremeta">
|
||||
<div id="grabit" class="dbx-group">
|
||||
<fieldset id="commentstatusdiv" class="dbx-box">
|
||||
<h3 class="dbx-handle"><?php _e('Discussion') ?></h3>
|
||||
<div class="dbx-content">
|
||||
<input name="advanced_view" type="hidden" value="1" />
|
||||
<label for="comment_status" class="selectit">
|
||||
<input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />
|
||||
<?php _e('Allow Comments') ?></label>
|
||||
<label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset id="postpassworddiv">
|
||||
<legend><?php _e('Page Password') ?></legend>
|
||||
<div><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
|
||||
</fieldset>
|
||||
<fieldset id="pageparent">
|
||||
<legend><?php _e('Page Parent') ?></legend>
|
||||
<div><select name="parent_id">
|
||||
<option value='0'><?php _e('Main Page (no parent)'); ?></option>
|
||||
<?php parent_dropdown($post->post_parent); ?>
|
||||
</select>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="passworddiv" class="dbx-box">
|
||||
<h3 class="dbx-handle"><?php _e('Password-Protect Post') ?></h3>
|
||||
<div class="dbx-content"><input name="post_password" type="text" size="13" id="post_password" value="<?php echo $post->post_password ?>" /></div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="pageparent" class="dbx-box">
|
||||
<h3 class="dbx-handle"><?php _e('Page Parent') ?></h3>
|
||||
<div class="dbx-content"><p><select name="parent_id">
|
||||
<option value='0'><?php _e('Main Page (no parent)'); ?></option>
|
||||
<?php parent_dropdown($post->post_parent); ?>
|
||||
</select></p>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<?php if ( 0 != count( get_page_templates() ) ) { ?>
|
||||
<fieldset id="pageparent" class="dbx-box">
|
||||
<h3 class="dbx-handle"><?php _e('Page Template:') ?></h3>
|
||||
<div class="dbx-content"><p><select name="page_template">
|
||||
<option value='default'><?php _e('Default Template'); ?></option>
|
||||
<?php page_template_dropdown($post->page_template); ?>
|
||||
</select></p>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php } ?>
|
||||
|
||||
<fieldset id="slugdiv" class="dbx-box">
|
||||
<h3 class="dbx-handle"><?php _e('Post slug') ?></h3>
|
||||
<div class="dbx-content"><input name="post_name" type="text" size="13" id="post_name" value="<?php echo $post->post_name ?>" /></div>
|
||||
</fieldset>
|
||||
|
||||
<?php if ( $authors = get_editable_authors( $current_user->ID ) ) : // TODO: ROLE SYSTEM ?>
|
||||
<fieldset id="authordiv" class="dbx-box">
|
||||
<h3 class="dbx-handle"><?php _e('Post author'); ?>:</h3>
|
||||
<div class="dbx-content">
|
||||
<select name="post_author_override" id="post_author_override">
|
||||
<?php
|
||||
foreach ($authors as $o) :
|
||||
$o = get_userdata( $o->ID );
|
||||
if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"';
|
||||
else $selected = '';
|
||||
echo "<option value='$o->ID' $selected>$o->display_name</option>";
|
||||
endforeach;
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</fieldset>
|
||||
<?php endif; ?>
|
||||
|
||||
<fieldset id="pageorder" class="dbx-box">
|
||||
<h3 class="dbx-handle"><?php _e('Page Order') ?></h3>
|
||||
<div class="dbx-content"><p><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p></div>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset id="titlediv">
|
||||
<legend><?php _e('Page Title') ?></legend>
|
||||
<div><input type="text" name="post_title" size="30" tabindex="1" value="<?php echo $post->post_title; ?>" id="title" /></div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<fieldset id="postdiv">
|
||||
<legend><?php _e('Page Content') ?></legend>
|
||||
<?php the_quicktags(); ?>
|
||||
|
@ -89,58 +140,12 @@ edCanvas = document.getElementById('content');
|
|||
<input name="referredby" type="hidden" id="referredby" value="<?php echo $sendto; ?>" />
|
||||
</p>
|
||||
|
||||
<fieldset id="pageoptions">
|
||||
<legend><?php _e('Page Options') ?></legend>
|
||||
<table width="100%" cellspacing="2" cellpadding="5" class="editform">
|
||||
<?php if ( 0 != count( get_page_templates() ) ) { ?>
|
||||
<tr valign="top">
|
||||
<th scope="row" width="30%"><?php _e('Page Template:') ?></th>
|
||||
<td><div><select name="page_template">
|
||||
<option value='default'><?php _e('Default Template'); ?></option>
|
||||
<?php page_template_dropdown($post->page_template); ?>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr valign="top">
|
||||
<th scope="row" width="30%"><?php _e('Page slug') ?>:</th>
|
||||
<td><input name="post_name" type="text" size="25" id="post_name" value="<?php echo $post->post_name ?>" /></td>
|
||||
</tr>
|
||||
<?php if ( $authors = get_editable_authors( $current_user->ID ) ) : // TODO: ROLE SYSTEM ?>
|
||||
<tr>
|
||||
<th scope="row" width="30%"><?php _e('Page owner'); ?>:</th>
|
||||
<td>
|
||||
<select name="post_author" id="post_author">
|
||||
<?php
|
||||
foreach ($authors as $o) :
|
||||
$o = get_userdata( $o->ID );
|
||||
if ( $post->post_author == $o->ID || ( empty($post_ID) && $user_ID == $o->ID ) ) $selected = 'selected="selected"';
|
||||
else $selected = '';
|
||||
echo "<option value='$o->ID' $selected>$o->user_login ($o->first_name $o->last_name)</option>";
|
||||
endforeach;
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<tr>
|
||||
<th scope="row" width="25%"><?php _e('Page Order') ?>:</th>
|
||||
<td><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"><?php _e('Delete'); ?>:</th>
|
||||
<td><?php if ('edit' == $action) : ?>
|
||||
<input name="deletepost" class="delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"return confirm('" . sprintf(__("You are about to delete this page \'%s\'\\n \'Cancel\' to stop, \'OK\' to delete."), $wpdb->escape($post->post_title) ) . "')\""; ?> />
|
||||
<?php endif; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|
||||
<fieldset id="postcustom">
|
||||
<legend><?php _e('Custom Fields') ?> <script type="text/javascript">customToggleLink();</script></legend>
|
||||
<div id="postcustomstuff">
|
||||
<div id="advancedstuff" class="dbx-group">
|
||||
|
||||
<fieldset id="postcustom" class="dbx-box">
|
||||
<h3 class="dbx-handle"><?php _e('Custom Fields') ?></h3>
|
||||
<div id="postcustomstuff" class="dbx-content">
|
||||
<?php
|
||||
if($metadata = has_meta($post_ID)) {
|
||||
?>
|
||||
|
@ -154,7 +159,15 @@ if($metadata = has_meta($post_ID)) {
|
|||
</div>
|
||||
</fieldset>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if ('edit' == $action) : ?>
|
||||
<input name="deletepost" class="delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"return confirm('" . sprintf(__("You are about to delete this page \'%s\'\\n \'Cancel\' to stop, \'OK\' to delete."), $wpdb->escape($post->post_title) ) . "')\""; ?> />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php do_action('edit_page_form', ''); ?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
|
@ -2,6 +2,7 @@
|
|||
require_once('admin.php');
|
||||
$title = __('New Page');
|
||||
$parent_file = 'post.php';
|
||||
$editing = true;
|
||||
require_once('admin-header.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
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue