Compare commits
98 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd66db9bcb | ||
|
|
0beccf25aa | ||
|
|
07b93d598e | ||
|
|
11893d625a | ||
|
|
f4ba38513e | ||
|
|
6c57fae829 | ||
|
|
3d8cd59bcb | ||
|
|
3fa855d060 | ||
|
|
9fa9078eff | ||
|
|
85f3994cc4 | ||
|
|
73c1f7f960 | ||
|
|
a5b6247297 | ||
|
|
5be8ce4fd4 | ||
|
|
3458ed9d37 | ||
|
|
a91fef2a63 | ||
|
|
6816c5011d | ||
|
|
73d12e0ea0 | ||
|
|
d34a34af3e | ||
|
|
931052a8d3 | ||
|
|
de5b342725 | ||
|
|
66eaffbe4c | ||
|
|
2d4f74d8ef | ||
|
|
0e23a06b5b | ||
|
|
4eb21652f8 | ||
|
|
a5390142f0 | ||
|
|
42f05dbf70 | ||
|
|
ead592d8b2 | ||
|
|
b1bc48c4d3 | ||
|
|
d3be3569b9 | ||
|
|
46178887a8 | ||
|
|
7874a85f1c | ||
|
|
4f72b0f6ba | ||
|
|
a5347b5be6 | ||
|
|
8bdb07273d | ||
|
|
711c293c03 | ||
|
|
6585c2d2e6 | ||
|
|
0ce2be1e10 | ||
|
|
c8da34f5dc | ||
|
|
1285c148b8 | ||
|
|
5edb6e2de9 | ||
|
|
5569095b9f | ||
|
|
1da228d138 | ||
|
|
ade329213d | ||
|
|
024dee654b | ||
|
|
7194e1e88a | ||
|
|
7622069daf | ||
|
|
27f1313c68 | ||
|
|
6f490c1cd1 | ||
|
|
0262bef8ae | ||
|
|
94235fd336 | ||
|
|
445e8577ff | ||
|
|
1d93a351d6 | ||
|
|
0bcd364623 | ||
|
|
a2449b17eb | ||
|
|
bbd3931610 | ||
|
|
39859076b5 | ||
|
|
029bc1442a | ||
|
|
2e70ba5b23 | ||
|
|
02f33500d4 | ||
|
|
095e27c43a | ||
|
|
3b4b6e358e | ||
|
|
04ddd8cb06 | ||
|
|
3bd0e07d30 | ||
|
|
171034ed24 | ||
|
|
5a6b76973f | ||
|
|
0c49ae8c6d | ||
|
|
8696b890ff | ||
|
|
77ab18f590 | ||
|
|
f06e4fc681 | ||
|
|
62d71ca11b | ||
|
|
e73bca6f7e | ||
|
|
96df144c18 | ||
|
|
293e84f6cd | ||
|
|
4d9850ced6 | ||
|
|
3c9e7dcabb | ||
|
|
36a76ba70a | ||
|
|
c6e8ef4885 | ||
|
|
cc67ec0499 | ||
|
|
412ae85b7b | ||
|
|
f7e96fad0a | ||
|
|
a419d43e8e | ||
|
|
a659936a4f | ||
|
|
6d524de74d | ||
|
|
8f434fb30d | ||
|
|
89c03b1658 | ||
|
|
36d87099f8 | ||
|
|
1a17437db9 | ||
|
|
84bba9d6ed | ||
|
|
0f3c87bc78 | ||
|
|
4f05c6ff22 | ||
|
|
ac9c3cfe37 | ||
|
|
660cd88cf2 | ||
|
|
2b36cbc0d8 | ||
|
|
c8073c5ab5 | ||
|
|
ccdfa822c3 | ||
|
|
fb5b146060 | ||
|
|
c8a2dea9e5 | ||
|
|
ff4d5fd518 |
@@ -8,7 +8,7 @@
|
||||
<body>
|
||||
<h1 id="logo" style="text-align: center">
|
||||
<img alt="WordPress" src="wp-admin/images/wordpress-logo.png" />
|
||||
<br /> Version 2.9.2
|
||||
<br /> Version 2.7
|
||||
</h1>
|
||||
<p style="text-align: center">Semantic Personal Publishing Platform</p>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<h1>Upgrading</h1>
|
||||
<p>Before you upgrade anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</p>
|
||||
<h2>Upgrading from any previous WordPress to 2.9.2:</h2>
|
||||
<h2>Upgrading from any previous WordPress to 2.7:</h2>
|
||||
<ol>
|
||||
<li>Delete your old WP files, saving ones you've modified.</li>
|
||||
<li>Upload the new files.</li>
|
||||
@@ -57,7 +57,7 @@
|
||||
<h1>System Recommendations</h1>
|
||||
<ul>
|
||||
<li>PHP version <strong>4.3</strong> or higher.</li>
|
||||
<li>MySQL version <strong>4.1.2</strong> or higher.</li>
|
||||
<li>MySQL version <strong>4.0</strong> or higher.</li>
|
||||
<li>... and a link to <a href="http://wordpress.org/">http://wordpress.org</a> on your site.</li>
|
||||
</ul>
|
||||
<p>WordPress is the official continuation of <a href="http://cafelog.com/">b2/cafélog</a>, which came from Michel V. The work has been continued by the <a href="http://wordpress.org/about/">WordPress developers</a>. If you would like to support WordPress, please consider <a href="http://wordpress.org/donate/">donating</a>.</p>
|
||||
|
||||
@@ -16,9 +16,6 @@ define('WP_ADMIN', true);
|
||||
|
||||
require_once('../wp-load.php');
|
||||
require_once('includes/admin.php');
|
||||
@header('Content-Type: text/html; charset=' . get_option('blog_charset'));
|
||||
|
||||
do_action('admin_init');
|
||||
|
||||
if ( ! is_user_logged_in() ) {
|
||||
|
||||
@@ -37,25 +34,17 @@ if ( ! is_user_logged_in() ) {
|
||||
$x->send();
|
||||
}
|
||||
|
||||
if ( !empty( $_REQUEST['action']) )
|
||||
do_action( 'wp_ajax_nopriv_' . $_REQUEST['action'] );
|
||||
|
||||
die('-1');
|
||||
}
|
||||
|
||||
if ( isset( $_GET['action'] ) ) :
|
||||
switch ( $action = $_GET['action'] ) :
|
||||
case 'ajax-tag-search' :
|
||||
if ( !current_user_can( 'edit_posts' ) )
|
||||
if ( !current_user_can( 'manage_categories' ) )
|
||||
die('-1');
|
||||
|
||||
$s = $_GET['q']; // is this slashed already?
|
||||
|
||||
if ( isset($_GET['tax']) )
|
||||
$taxonomy = sanitize_title($_GET['tax']);
|
||||
else
|
||||
die('0');
|
||||
|
||||
if ( false !== strpos( $s, ',' ) ) {
|
||||
$s = explode( ',', $s );
|
||||
$s = $s[count( $s ) - 1];
|
||||
@@ -63,73 +52,10 @@ case 'ajax-tag-search' :
|
||||
$s = trim( $s );
|
||||
if ( strlen( $s ) < 2 )
|
||||
die; // require 2 chars for matching
|
||||
|
||||
$results = $wpdb->get_col( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = '$taxonomy' AND t.name LIKE ('%" . $s . "%')" );
|
||||
|
||||
$results = $wpdb->get_col( "SELECT t.name FROM $wpdb->term_taxonomy AS tt INNER JOIN $wpdb->terms AS t ON tt.term_id = t.term_id WHERE tt.taxonomy = 'post_tag' AND t.name LIKE ('%". $s . "%')" );
|
||||
echo join( $results, "\n" );
|
||||
die;
|
||||
break;
|
||||
case 'wp-compression-test' :
|
||||
if ( !current_user_can( 'manage_options' ) )
|
||||
die('-1');
|
||||
|
||||
if ( ini_get('zlib.output_compression') || 'ob_gzhandler' == ini_get('output_handler') ) {
|
||||
update_site_option('can_compress_scripts', 0);
|
||||
die('0');
|
||||
}
|
||||
|
||||
if ( isset($_GET['test']) ) {
|
||||
header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
|
||||
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
|
||||
header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
|
||||
header( 'Pragma: no-cache' );
|
||||
header('Content-Type: application/x-javascript; charset=UTF-8');
|
||||
$force_gzip = ( defined('ENFORCE_GZIP') && ENFORCE_GZIP );
|
||||
$test_str = '"wpCompressionTest Lorem ipsum dolor sit amet consectetuer mollis sapien urna ut a. Eu nonummy condimentum fringilla tempor pretium platea vel nibh netus Maecenas. Hac molestie amet justo quis pellentesque est ultrices interdum nibh Morbi. Cras mattis pretium Phasellus ante ipsum ipsum ut sociis Suspendisse Lorem. Ante et non molestie. Porta urna Vestibulum egestas id congue nibh eu risus gravida sit. Ac augue auctor Ut et non a elit massa id sodales. Elit eu Nulla at nibh adipiscing mattis lacus mauris at tempus. Netus nibh quis suscipit nec feugiat eget sed lorem et urna. Pellentesque lacus at ut massa consectetuer ligula ut auctor semper Pellentesque. Ut metus massa nibh quam Curabitur molestie nec mauris congue. Volutpat molestie elit justo facilisis neque ac risus Ut nascetur tristique. Vitae sit lorem tellus et quis Phasellus lacus tincidunt nunc Fusce. Pharetra wisi Suspendisse mus sagittis libero lacinia Integer consequat ac Phasellus. Et urna ac cursus tortor aliquam Aliquam amet tellus volutpat Vestibulum. Justo interdum condimentum In augue congue tellus sollicitudin Quisque quis nibh."';
|
||||
|
||||
if ( 1 == $_GET['test'] ) {
|
||||
echo $test_str;
|
||||
die;
|
||||
} elseif ( 2 == $_GET['test'] ) {
|
||||
if ( !isset($_SERVER['HTTP_ACCEPT_ENCODING']) )
|
||||
die('-1');
|
||||
if ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
|
||||
header('Content-Encoding: deflate');
|
||||
$out = gzdeflate( $test_str, 1 );
|
||||
} elseif ( false !== strpos( strtolower($_SERVER['HTTP_ACCEPT_ENCODING']), 'gzip') && function_exists('gzencode') ) {
|
||||
header('Content-Encoding: gzip');
|
||||
$out = gzencode( $test_str, 1 );
|
||||
} else {
|
||||
die('-1');
|
||||
}
|
||||
echo $out;
|
||||
die;
|
||||
} elseif ( 'no' == $_GET['test'] ) {
|
||||
update_site_option('can_compress_scripts', 0);
|
||||
} elseif ( 'yes' == $_GET['test'] ) {
|
||||
update_site_option('can_compress_scripts', 1);
|
||||
}
|
||||
}
|
||||
|
||||
die('0');
|
||||
break;
|
||||
case 'imgedit-preview' :
|
||||
$post_id = intval($_GET['postid']);
|
||||
if ( empty($post_id) || !current_user_can('edit_post', $post_id) )
|
||||
die('-1');
|
||||
|
||||
check_ajax_referer( "image_editor-$post_id" );
|
||||
|
||||
include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
|
||||
if ( !stream_preview_image($post_id) )
|
||||
die('-1');
|
||||
|
||||
die();
|
||||
break;
|
||||
case 'oembed-cache' :
|
||||
$return = ( $wp_embed->cache_oembed( $_GET['post'] ) ) ? '1' : '0';
|
||||
die( $return );
|
||||
break;
|
||||
default :
|
||||
do_action( 'wp_ajax_' . $_GET['action'] );
|
||||
die('0');
|
||||
@@ -137,105 +63,24 @@ default :
|
||||
endswitch;
|
||||
endif;
|
||||
|
||||
/**
|
||||
* Sends back current comment total and new page links if they need to be updated.
|
||||
*
|
||||
* Contrary to normal success AJAX response ("1"), die with time() on success.
|
||||
*
|
||||
* @since 2.7
|
||||
*
|
||||
* @param int $comment_id
|
||||
* @return die
|
||||
*/
|
||||
function _wp_ajax_delete_comment_response( $comment_id ) {
|
||||
$total = (int) @$_POST['_total'];
|
||||
$per_page = (int) @$_POST['_per_page'];
|
||||
$page = (int) @$_POST['_page'];
|
||||
$url = esc_url_raw( @$_POST['_url'] );
|
||||
// JS didn't send us everything we need to know. Just die with success message
|
||||
if ( !$total || !$per_page || !$page || !$url )
|
||||
die( (string) time() );
|
||||
|
||||
if ( --$total < 0 ) // Take the total from POST and decrement it (since we just deleted one)
|
||||
$total = 0;
|
||||
|
||||
if ( 0 != $total % $per_page && 1 != mt_rand( 1, $per_page ) ) // Only do the expensive stuff on a page-break, and about 1 other time per page
|
||||
die( (string) time() );
|
||||
|
||||
$post_id = 0;
|
||||
$status = 'total_comments'; // What type of comment count are we looking for?
|
||||
$parsed = parse_url( $url );
|
||||
if ( isset( $parsed['query'] ) ) {
|
||||
parse_str( $parsed['query'], $query_vars );
|
||||
if ( !empty( $query_vars['comment_status'] ) )
|
||||
$status = $query_vars['comment_status'];
|
||||
if ( !empty( $query_vars['p'] ) )
|
||||
$post_id = (int) $query_vars['p'];
|
||||
}
|
||||
|
||||
$comment_count = wp_count_comments($post_id);
|
||||
$time = time(); // The time since the last comment count
|
||||
|
||||
if ( isset( $comment_count->$status ) ) // We're looking for a known type of comment count
|
||||
$total = $comment_count->$status;
|
||||
// else use the decremented value from above
|
||||
|
||||
$page_links = paginate_links( array(
|
||||
'base' => add_query_arg( 'apage', '%#%', $url ),
|
||||
'format' => '',
|
||||
'prev_text' => __('«'),
|
||||
'next_text' => __('»'),
|
||||
'total' => ceil($total / $per_page),
|
||||
'current' => $page
|
||||
) );
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'comment',
|
||||
'id' => $comment_id, // here for completeness - not used
|
||||
'supplemental' => array(
|
||||
'pageLinks' => $page_links,
|
||||
'total' => $total,
|
||||
'time' => $time
|
||||
)
|
||||
) );
|
||||
$x->send();
|
||||
}
|
||||
|
||||
$id = isset($_POST['id'])? (int) $_POST['id'] : 0;
|
||||
switch ( $action = $_POST['action'] ) :
|
||||
case 'delete-comment' : // On success, die with time() instead of 1
|
||||
case 'delete-comment' :
|
||||
check_ajax_referer( "delete-comment_$id" );
|
||||
if ( !$comment = get_comment( $id ) )
|
||||
die( (string) time() );
|
||||
die('1');
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
|
||||
die('-1');
|
||||
|
||||
check_ajax_referer( "delete-comment_$id" );
|
||||
$status = wp_get_comment_status( $comment->comment_ID );
|
||||
|
||||
if ( isset($_POST['trash']) && 1 == $_POST['trash'] ) {
|
||||
if ( 'trash' == $status )
|
||||
die( (string) time() );
|
||||
$r = wp_trash_comment( $comment->comment_ID );
|
||||
} elseif ( isset($_POST['untrash']) && 1 == $_POST['untrash'] ) {
|
||||
if ( 'trash' != $status )
|
||||
die( (string) time() );
|
||||
$r = wp_untrash_comment( $comment->comment_ID );
|
||||
} elseif ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
|
||||
if ( 'spam' == $status )
|
||||
die( (string) time() );
|
||||
$r = wp_spam_comment( $comment->comment_ID );
|
||||
} elseif ( isset($_POST['unspam']) && 1 == $_POST['unspam'] ) {
|
||||
if ( 'spam' != $status )
|
||||
die( (string) time() );
|
||||
$r = wp_unspam_comment( $comment->comment_ID );
|
||||
} elseif ( isset($_POST['delete']) && 1 == $_POST['delete'] ) {
|
||||
$r = wp_delete_comment( $comment->comment_ID );
|
||||
if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) {
|
||||
if ( 'spam' == wp_get_comment_status( $comment->comment_ID ) )
|
||||
die('1');
|
||||
$r = wp_set_comment_status( $comment->comment_ID, 'spam' );
|
||||
} else {
|
||||
die('-1');
|
||||
$r = wp_delete_comment( $comment->comment_ID );
|
||||
}
|
||||
|
||||
if ( $r ) // Decide if we need to send back '1' or a more complicated response including page links and comment counts
|
||||
_wp_ajax_delete_comment_response( $comment->comment_ID );
|
||||
die( '0' );
|
||||
die( $r ? '1' : '0' );
|
||||
break;
|
||||
case 'delete-cat' :
|
||||
check_ajax_referer( "delete-category_$id" );
|
||||
@@ -252,18 +97,15 @@ case 'delete-cat' :
|
||||
die('0');
|
||||
break;
|
||||
case 'delete-tag' :
|
||||
$tag_id = (int) $_POST['tag_ID'];
|
||||
check_ajax_referer( "delete-tag_$tag_id" );
|
||||
check_ajax_referer( "delete-tag_$id" );
|
||||
if ( !current_user_can( 'manage_categories' ) )
|
||||
die('-1');
|
||||
|
||||
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
|
||||
|
||||
$tag = get_term( $tag_id, $taxonomy );
|
||||
$tag = get_term( $id, 'post_tag' );
|
||||
if ( !$tag || is_wp_error( $tag ) )
|
||||
die('1');
|
||||
|
||||
if ( wp_delete_term($tag_id, $taxonomy))
|
||||
if ( wp_delete_term($id, 'post_tag'))
|
||||
die('1');
|
||||
else
|
||||
die('0');
|
||||
@@ -279,10 +121,8 @@ case 'delete-link-cat' :
|
||||
|
||||
$cat_name = get_term_field('name', $id, 'link_category');
|
||||
|
||||
$default = get_option('default_link_category');
|
||||
|
||||
// Don't delete the default cats.
|
||||
if ( $id == $default ) {
|
||||
if ( $id == get_option('default_link_category') ) {
|
||||
$x = new WP_AJAX_Response( array(
|
||||
'what' => 'link-cat',
|
||||
'id' => $id,
|
||||
@@ -291,7 +131,7 @@ case 'delete-link-cat' :
|
||||
$x->send();
|
||||
}
|
||||
|
||||
$r = wp_delete_term($id, 'link_category', array('default' => $default));
|
||||
$r = wp_delete_term($id, 'link_category');
|
||||
if ( !$r )
|
||||
die('0');
|
||||
if ( is_wp_error($r) ) {
|
||||
@@ -342,25 +182,6 @@ case 'delete-post' :
|
||||
else
|
||||
die('0');
|
||||
break;
|
||||
case 'trash-post' :
|
||||
case 'untrash-post' :
|
||||
check_ajax_referer( "{$action}_$id" );
|
||||
if ( !current_user_can( 'delete_post', $id ) )
|
||||
die('-1');
|
||||
|
||||
if ( !get_post( $id ) )
|
||||
die('1');
|
||||
|
||||
if ( 'trash-post' == $action )
|
||||
$done = wp_trash_post( $id );
|
||||
else
|
||||
$done = wp_untrash_post( $id );
|
||||
|
||||
if ( $done )
|
||||
die('1');
|
||||
|
||||
die('0');
|
||||
break;
|
||||
case 'delete-page' :
|
||||
check_ajax_referer( "{$action}_$id" );
|
||||
if ( !current_user_can( 'delete_page', $id ) )
|
||||
@@ -374,40 +195,29 @@ case 'delete-page' :
|
||||
else
|
||||
die('0');
|
||||
break;
|
||||
case 'dim-comment' : // On success, die with time() instead of 1
|
||||
case 'dim-comment' :
|
||||
if ( !$comment = get_comment( $id ) )
|
||||
die('0');
|
||||
|
||||
if ( !$comment = get_comment( $id ) ) {
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'comment',
|
||||
'id' => new WP_Error('invalid_comment', sprintf(__('Comment %d does not exist'), $id))
|
||||
) );
|
||||
$x->send();
|
||||
}
|
||||
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) && !current_user_can( 'moderate_comments' ) )
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
|
||||
die('-1');
|
||||
if ( !current_user_can( 'moderate_comments' ) )
|
||||
die('-1');
|
||||
|
||||
$current = wp_get_comment_status( $comment->comment_ID );
|
||||
if ( $_POST['new'] == $current )
|
||||
die( (string) time() );
|
||||
die('1');
|
||||
|
||||
check_ajax_referer( "approve-comment_$id" );
|
||||
if ( in_array( $current, array( 'unapproved', 'spam' ) ) )
|
||||
$result = wp_set_comment_status( $comment->comment_ID, 'approve', true );
|
||||
else
|
||||
$result = wp_set_comment_status( $comment->comment_ID, 'hold', true );
|
||||
|
||||
if ( is_wp_error($result) ) {
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'comment',
|
||||
'id' => $result
|
||||
) );
|
||||
$x->send();
|
||||
if ( in_array( $current, array( 'unapproved', 'spam' ) ) ) {
|
||||
check_ajax_referer( "approve-comment_$id" );
|
||||
if ( wp_set_comment_status( $comment->comment_ID, 'approve' ) )
|
||||
die('1');
|
||||
} else {
|
||||
check_ajax_referer( "unapprove-comment_$id" );
|
||||
if ( wp_set_comment_status( $comment->comment_ID, 'hold' ) )
|
||||
die('1');
|
||||
}
|
||||
|
||||
// Decide if we need to send back '1' or a more complicated response including page links and comment counts
|
||||
_wp_ajax_delete_comment_response( $comment->comment_ID );
|
||||
die( '0' );
|
||||
die('0');
|
||||
break;
|
||||
case 'add-category' : // On the Fly
|
||||
check_ajax_referer( $action );
|
||||
@@ -418,8 +228,11 @@ case 'add-category' : // On the Fly
|
||||
$parent = 0;
|
||||
$post_category = isset($_POST['post_category'])? (array) $_POST['post_category'] : array();
|
||||
$checked_categories = array_map( 'absint', (array) $post_category );
|
||||
$popular_ids = wp_popular_terms_checklist('category', 0, 10, false);
|
||||
$popular_ids = isset( $_POST['popular_ids'] ) ?
|
||||
array_map( 'absint', explode( ',', $_POST['popular_ids'] ) ) :
|
||||
false;
|
||||
|
||||
$x = new WP_Ajax_Response();
|
||||
foreach ( $names as $cat_name ) {
|
||||
$cat_name = trim($cat_name);
|
||||
$category_nicename = sanitize_title($cat_name);
|
||||
@@ -434,43 +247,28 @@ case 'add-category' : // On the Fly
|
||||
wp_category_checklist( 0, $cat_id, $checked_categories, $popular_ids );
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$add = array(
|
||||
$x->add( array(
|
||||
'what' => 'category',
|
||||
'id' => $cat_id,
|
||||
'data' => str_replace( array("\n", "\t"), '', $data),
|
||||
'data' => $data,
|
||||
'position' => -1
|
||||
);
|
||||
) );
|
||||
}
|
||||
if ( $parent ) { // Foncy - replace the parent and all its children
|
||||
$parent = get_category( $parent );
|
||||
$term_id = $parent->term_id;
|
||||
|
||||
while ( $parent->parent ) { // get the top parent
|
||||
$parent = &get_category( $parent->parent );
|
||||
if ( is_wp_error( $parent ) )
|
||||
break;
|
||||
$term_id = $parent->term_id;
|
||||
}
|
||||
|
||||
ob_start();
|
||||
wp_category_checklist( 0, $term_id, $checked_categories, $popular_ids, null, false );
|
||||
dropdown_categories( 0, $parent );
|
||||
$data = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$add = array(
|
||||
$x->add( array(
|
||||
'what' => 'category',
|
||||
'id' => $term_id,
|
||||
'data' => str_replace( array("\n", "\t"), '', $data),
|
||||
'id' => $parent->term_id,
|
||||
'old_id' => $parent->term_id,
|
||||
'data' => $data,
|
||||
'position' => -1
|
||||
);
|
||||
) );
|
||||
|
||||
}
|
||||
|
||||
ob_start();
|
||||
wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category') ) );
|
||||
$sup = ob_get_contents();
|
||||
ob_end_clean();
|
||||
$add['supplemental'] = array( 'newcat_parent' => $sup );
|
||||
|
||||
$x = new WP_Ajax_Response( $add );
|
||||
$x->send();
|
||||
break;
|
||||
case 'add-link-category' : // On the Fly
|
||||
@@ -488,11 +286,11 @@ case 'add-link-category' : // On the Fly
|
||||
$cat_id = wp_insert_term( $cat_name, 'link_category' );
|
||||
}
|
||||
$cat_id = $cat_id['term_id'];
|
||||
$cat_name = esc_html(stripslashes($cat_name));
|
||||
$cat_name = wp_specialchars(stripslashes($cat_name));
|
||||
$x->add( array(
|
||||
'what' => 'link-category',
|
||||
'id' => $cat_id,
|
||||
'data' => "<li id='link-category-$cat_id'><label for='in-link-category-$cat_id' class='selectit'><input value='" . esc_attr($cat_id) . "' type='checkbox' checked='checked' name='link_category[]' id='in-link-category-$cat_id'/> $cat_name</label></li>",
|
||||
'data' => "<li id='link-category-$cat_id'><label for='in-link-category-$cat_id' class='selectit'><input value='$cat_id' type='checkbox' checked='checked' name='link_category[]' id='in-link-category-$cat_id'/> $cat_name</label></li>",
|
||||
'position' => -1
|
||||
) );
|
||||
}
|
||||
@@ -511,7 +309,7 @@ case 'add-cat' : // From Manage->Categories
|
||||
$x->send();
|
||||
}
|
||||
|
||||
if ( category_exists( trim( $_POST['cat_name'] ), $_POST['category_parent'] ) ) {
|
||||
if ( category_exists( trim( $_POST['cat_name'] ) ) ) {
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'cat',
|
||||
'id' => new WP_Error( 'cat_exists', __('The category you are trying to create already exists.'), array( 'form-field' => 'cat_name' ) ),
|
||||
@@ -540,7 +338,7 @@ case 'add-cat' : // From Manage->Categories
|
||||
$cat_full_name = $_cat->name . ' — ' . $cat_full_name;
|
||||
$level++;
|
||||
}
|
||||
$cat_full_name = esc_attr($cat_full_name);
|
||||
$cat_full_name = attribute_escape($cat_full_name);
|
||||
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'cat',
|
||||
@@ -591,27 +389,44 @@ case 'add-tag' : // From Manage->Tags
|
||||
if ( !current_user_can( 'manage_categories' ) )
|
||||
die('-1');
|
||||
|
||||
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
|
||||
$tag = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST );
|
||||
|
||||
if ( !$tag || is_wp_error($tag) || (!$tag = get_term( $tag['term_id'], $taxonomy )) ) {
|
||||
echo '<div class="error"><p>' . __('An error has occured. Please reload the page and try again.') . '</p></div>';
|
||||
exit;
|
||||
if ( '' === trim($_POST['name']) ) {
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'tag',
|
||||
'id' => new WP_Error( 'name', __('You did not enter a tag name.') )
|
||||
) );
|
||||
$x->send();
|
||||
}
|
||||
|
||||
echo _tag_row( $tag, '', $taxonomy );
|
||||
exit;
|
||||
break;
|
||||
case 'get-tagcloud' :
|
||||
if ( !current_user_can( 'edit_posts' ) )
|
||||
die('-1');
|
||||
$tag = wp_insert_term($_POST['name'], 'post_tag', $_POST );
|
||||
|
||||
if ( isset($_POST['tax']) )
|
||||
$taxonomy = sanitize_title($_POST['tax']);
|
||||
else
|
||||
if ( is_wp_error($tag) ) {
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'tag',
|
||||
'id' => $tag
|
||||
) );
|
||||
$x->send();
|
||||
}
|
||||
|
||||
if ( !$tag || (!$tag = get_term( $tag['term_id'], 'post_tag' )) )
|
||||
die('0');
|
||||
|
||||
$tags = get_terms( $taxonomy, array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) );
|
||||
$tag_full_name = $tag->name;
|
||||
$tag_full_name = attribute_escape($tag_full_name);
|
||||
|
||||
$x = new WP_Ajax_Response( array(
|
||||
'what' => 'tag',
|
||||
'id' => $tag->term_id,
|
||||
'position' => '-1',
|
||||
'data' => _tag_row( $tag ),
|
||||
'supplemental' => array('name' => $tag_full_name, 'show-link' => sprintf(__( 'Tag <a href="#%s">%s</a> added' ), "tag-$tag->term_id", $tag_full_name))
|
||||
) );
|
||||
$x->send();
|
||||
break;
|
||||
case 'get-tagcloud' :
|
||||
if ( !current_user_can( 'manage_categories' ) )
|
||||
die('-1');
|
||||
|
||||
$tags = get_tags( array( 'number' => 45, 'orderby' => 'count', 'order' => 'DESC' ) );
|
||||
|
||||
if ( empty( $tags ) )
|
||||
die( __('No tags found!') );
|
||||
@@ -624,8 +439,7 @@ case 'get-tagcloud' :
|
||||
$tags[ $key ]->id = $tag->term_id;
|
||||
}
|
||||
|
||||
// We need raw tag names here, so don't filter the output
|
||||
$return = wp_generate_tag_cloud( $tags, array('filter' => 0) );
|
||||
$return = wp_generate_tag_cloud( $tags );
|
||||
|
||||
if ( empty($return) )
|
||||
die('0');
|
||||
@@ -636,15 +450,11 @@ case 'get-tagcloud' :
|
||||
break;
|
||||
case 'add-comment' :
|
||||
check_ajax_referer( $action );
|
||||
if ( !current_user_can( 'edit_posts' ) )
|
||||
if ( !current_user_can( 'edit_post', $id ) )
|
||||
die('-1');
|
||||
$search = isset($_POST['s']) ? $_POST['s'] : false;
|
||||
$status = isset($_POST['comment_status']) ? $_POST['comment_status'] : 'all';
|
||||
$per_page = isset($_POST['per_page']) ? (int) $_POST['per_page'] + 8 : 28;
|
||||
$start = isset($_POST['page']) ? ( intval($_POST['page']) * $per_page ) -1 : $per_page - 1;
|
||||
if ( 1 > $start )
|
||||
$start = 27;
|
||||
|
||||
$start = isset($_POST['page']) ? intval($_POST['page']) * 25 - 1: 24;
|
||||
$status = isset($_POST['comment_status']) ? $_POST['comment_status'] : false;
|
||||
$mode = isset($_POST['mode']) ? $_POST['mode'] : 'detail';
|
||||
$p = isset($_POST['p']) ? $_POST['p'] : 0;
|
||||
$comment_type = isset($_POST['comment_type']) ? $_POST['comment_type'] : '';
|
||||
@@ -711,7 +521,7 @@ case 'replyto-comment' :
|
||||
|
||||
if ( empty($status) )
|
||||
die('1');
|
||||
elseif ( in_array($status, array('draft', 'pending', 'trash') ) )
|
||||
elseif ( in_array($status, array('draft', 'pending') ) )
|
||||
die( __('Error: you are replying to a comment on a draft post.') );
|
||||
|
||||
$user = wp_get_current_user();
|
||||
@@ -786,7 +596,6 @@ case 'edit-comment' :
|
||||
$mode = ( isset($_POST['mode']) && 'single' == $_POST['mode'] ) ? 'single' : 'detail';
|
||||
$position = ( isset($_POST['position']) && (int) $_POST['position']) ? (int) $_POST['position'] : '-1';
|
||||
$checkbox = ( isset($_POST['checkbox']) && true == $_POST['checkbox'] ) ? 1 : 0;
|
||||
$comments_listing = isset($_POST['comments_listing']) ? $_POST['comments_listing'] : '';
|
||||
|
||||
if ( get_option('show_avatars') && 'single' != $mode )
|
||||
add_filter( 'comment_author', 'floated_admin_avatar' );
|
||||
@@ -794,7 +603,7 @@ case 'edit-comment' :
|
||||
$x = new WP_Ajax_Response();
|
||||
|
||||
ob_start();
|
||||
_wp_comment_row( $comment_id, $mode, $comments_listing, $checkbox );
|
||||
_wp_comment_row( $comment_id, $mode, true, $checkbox );
|
||||
$comment_list_item = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
@@ -814,7 +623,7 @@ case 'add-meta' :
|
||||
if ( isset($_POST['metakeyselect']) || isset($_POST['metakeyinput']) ) {
|
||||
if ( !current_user_can( 'edit_post', $pid ) )
|
||||
die('-1');
|
||||
if ( isset($_POST['metakeyselect']) && '#NONE#' == $_POST['metakeyselect'] && empty($_POST['metakeyinput']) )
|
||||
if ( '#NONE#' == $_POST['metakeyselect'] && empty($_POST['metakeyinput']) )
|
||||
die('1');
|
||||
if ( $pid < 0 ) {
|
||||
$now = current_time('timestamp', 1);
|
||||
@@ -828,13 +637,12 @@ case 'add-meta' :
|
||||
) );
|
||||
$x->send();
|
||||
}
|
||||
if ( !$mid = add_meta( $pid ) )
|
||||
die(__('Please provide a custom field value.'));
|
||||
$mid = add_meta( $pid );
|
||||
} else {
|
||||
die('0');
|
||||
}
|
||||
} else if ( !$mid = add_meta( $pid ) ) {
|
||||
die(__('Please provide a custom field value.'));
|
||||
die('0');
|
||||
}
|
||||
|
||||
$meta = get_post_meta_by_id( $mid );
|
||||
@@ -855,11 +663,8 @@ case 'add-meta' :
|
||||
die('0'); // if meta doesn't exist
|
||||
if ( !current_user_can( 'edit_post', $meta->post_id ) )
|
||||
die('-1');
|
||||
if ( $meta->meta_value != stripslashes($value) ) {
|
||||
if ( !$u = update_meta( $mid, $key, $value ) )
|
||||
die('0'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
|
||||
}
|
||||
|
||||
if ( !$u = update_meta( $mid, $key, $value ) )
|
||||
die('1'); // We know meta exists; we also know it's unchanged (or DB error, in which case there are bigger problems).
|
||||
$key = stripslashes($key);
|
||||
$value = stripslashes($value);
|
||||
$x = new WP_Ajax_Response( array(
|
||||
@@ -910,6 +715,7 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
|
||||
global $current_user;
|
||||
|
||||
$_POST['post_category'] = explode(",", $_POST['catslist']);
|
||||
$_POST['tags_input'] = explode(",", $_POST['tags_input']);
|
||||
if($_POST['post_type'] == 'page' || empty($_POST['post_category']))
|
||||
unset($_POST['post_category']);
|
||||
|
||||
@@ -917,13 +723,9 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
|
||||
$do_lock = true;
|
||||
|
||||
$data = '';
|
||||
/* translators: draft saved date format, see http://php.net/date */
|
||||
$draft_saved_date_format = __('g:i:s a');
|
||||
$message = sprintf( __('Draft Saved at %s.'), date_i18n( $draft_saved_date_format ) );
|
||||
$message = sprintf( __('Draft Saved at %s.'), date_i18n( __('g:i:s a') ) );
|
||||
|
||||
$supplemental = array();
|
||||
if ( isset($login_grace_period) )
|
||||
$supplemental['session_expired'] = add_query_arg( 'interim-login', 1, wp_login_url() );
|
||||
|
||||
$id = $revision_id = 0;
|
||||
if($_POST['post_ID'] < 0) {
|
||||
@@ -945,7 +747,7 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
|
||||
$last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
|
||||
$data = new WP_Error( 'locked', sprintf(
|
||||
$_POST['post_type'] == 'page' ? __( 'Autosave disabled: %s is currently editing this page.' ) : __( 'Autosave disabled: %s is currently editing this post.' ),
|
||||
esc_html( $last_user_name )
|
||||
wp_specialchars( $last_user_name )
|
||||
) );
|
||||
|
||||
$supplemental['disable_autosave'] = 'disable';
|
||||
@@ -1003,73 +805,45 @@ case 'autosave' : // The name of this action is hardcoded in edit_post()
|
||||
case 'autosave-generate-nonces' :
|
||||
check_ajax_referer( 'autosave', 'autosavenonce' );
|
||||
$ID = (int) $_POST['post_ID'];
|
||||
$post_type = ( 'page' == $_POST['post_type'] ) ? 'page' : 'post';
|
||||
if ( current_user_can( "edit_{$post_type}", $ID ) )
|
||||
die( json_encode( array( 'updateNonce' => wp_create_nonce( "update-{$post_type}_{$ID}" ), 'deleteURL' => str_replace( '&', '&', wp_nonce_url( admin_url( $post_type . '.php?action=trash&post=' . $ID ), "trash-{$post_type}_{$ID}" ) ) ) ) );
|
||||
do_action('autosave_generate_nonces');
|
||||
if($_POST['post_type'] == 'post') {
|
||||
if(current_user_can('edit_post', $ID))
|
||||
die(wp_create_nonce('update-post_' . $ID));
|
||||
}
|
||||
if($_POST['post_type'] == 'page') {
|
||||
if(current_user_can('edit_page', $ID)) {
|
||||
die(wp_create_nonce('update-page_' . $ID));
|
||||
}
|
||||
}
|
||||
die('0');
|
||||
break;
|
||||
case 'closed-postboxes' :
|
||||
check_ajax_referer( 'closedpostboxes', 'closedpostboxesnonce' );
|
||||
$closed = isset( $_POST['closed'] ) ? $_POST['closed'] : '';
|
||||
$closed = isset( $_POST['closed'] )? $_POST['closed'] : '';
|
||||
$closed = explode( ',', $_POST['closed'] );
|
||||
$hidden = isset( $_POST['hidden'] ) ? $_POST['hidden'] : '';
|
||||
$hidden = isset( $_POST['hidden'] )? $_POST['hidden'] : '';
|
||||
$hidden = explode( ',', $_POST['hidden'] );
|
||||
$page = isset( $_POST['page'] ) ? $_POST['page'] : '';
|
||||
|
||||
if ( !preg_match( '/^[a-z_-]+$/', $page ) )
|
||||
die('-1');
|
||||
|
||||
if ( ! $user = wp_get_current_user() )
|
||||
die('-1');
|
||||
|
||||
if ( is_array($closed) )
|
||||
update_usermeta($user->ID, 'closedpostboxes_'.$page, $closed);
|
||||
|
||||
if ( is_array($hidden) ) {
|
||||
$hidden = array_diff( $hidden, array('submitdiv', 'linksubmitdiv') ); // postboxes that are always shown
|
||||
update_usermeta($user->ID, 'meta-box-hidden_'.$page, $hidden);
|
||||
$page = isset( $_POST['page'] )? $_POST['page'] : '';
|
||||
if ( !preg_match( '/^[a-z-_]+$/', $page ) ) {
|
||||
die(-1);
|
||||
}
|
||||
|
||||
die('1');
|
||||
break;
|
||||
case 'hidden-columns' :
|
||||
check_ajax_referer( 'screen-options-nonce', 'screenoptionnonce' );
|
||||
$hidden = isset( $_POST['hidden'] ) ? $_POST['hidden'] : '';
|
||||
$hidden = explode( ',', $_POST['hidden'] );
|
||||
$page = isset( $_POST['page'] ) ? $_POST['page'] : '';
|
||||
|
||||
if ( !preg_match( '/^[a-z_-]+$/', $page ) )
|
||||
die('-1');
|
||||
|
||||
if ( ! $user = wp_get_current_user() )
|
||||
die('-1');
|
||||
|
||||
$current_user = wp_get_current_user();
|
||||
if ( is_array($closed) )
|
||||
update_usermeta($current_user->ID, 'closedpostboxes_'.$page, $closed);
|
||||
if ( is_array($hidden) )
|
||||
update_usermeta($user->ID, "manage-$page-columns-hidden", $hidden);
|
||||
|
||||
die('1');
|
||||
break;
|
||||
case 'meta-box-order':
|
||||
check_ajax_referer( 'meta-box-order' );
|
||||
$order = isset( $_POST['order'] ) ? (array) $_POST['order'] : false;
|
||||
$page_columns = isset( $_POST['page_columns'] ) ? (int) $_POST['page_columns'] : 0;
|
||||
$page = isset( $_POST['page'] ) ? $_POST['page'] : '';
|
||||
|
||||
if ( !preg_match( '/^[a-z_-]+$/', $page ) )
|
||||
die('-1');
|
||||
|
||||
if ( ! $user = wp_get_current_user() )
|
||||
die('-1');
|
||||
|
||||
if ( $order )
|
||||
update_user_option($user->ID, "meta-box-order_$page", $order);
|
||||
|
||||
if ( $page_columns )
|
||||
update_usermeta($user->ID, "screen_layout_$page", $page_columns);
|
||||
|
||||
die('1');
|
||||
break;
|
||||
update_usermeta($current_user->ID, 'meta-box-hidden_'.$page, $hidden);
|
||||
break;
|
||||
case 'hidden-columns' :
|
||||
check_ajax_referer( 'hiddencolumns', 'hiddencolumnsnonce' );
|
||||
$hidden = isset( $_POST['hidden'] )? $_POST['hidden'] : '';
|
||||
$hidden = explode( ',', $_POST['hidden'] );
|
||||
$page = isset( $_POST['page'] )? $_POST['page'] : '';
|
||||
if ( !preg_match( '/^[a-z-_]+$/', $page ) ) {
|
||||
die(-1);
|
||||
}
|
||||
$current_user = wp_get_current_user();
|
||||
if ( is_array($hidden) )
|
||||
update_usermeta($current_user->ID, "manage-$page-columns-hidden", $hidden);
|
||||
break;
|
||||
case 'get-permalink':
|
||||
check_ajax_referer( 'getpermalink', 'getpermalinknonce' );
|
||||
$post_id = isset($_POST['post_id'])? intval($_POST['post_id']) : 0;
|
||||
@@ -1099,15 +873,12 @@ case 'inline-save':
|
||||
if ( $last = wp_check_post_lock( $post_ID ) ) {
|
||||
$last_user = get_userdata( $last );
|
||||
$last_user_name = $last_user ? $last_user->display_name : __( 'Someone' );
|
||||
printf( $_POST['post_type'] == 'page' ? __( 'Saving is disabled: %s is currently editing this page.' ) : __( 'Saving is disabled: %s is currently editing this post.' ), esc_html( $last_user_name ) );
|
||||
printf( $_POST['post_type'] == 'page' ? __( 'Saving is disabled: %s is currently editing this page.' ) : __( 'Saving is disabled: %s is currently editing this post.' ), wp_specialchars( $last_user_name ) );
|
||||
exit;
|
||||
}
|
||||
|
||||
$data = &$_POST;
|
||||
|
||||
$post = get_post( $post_ID, ARRAY_A );
|
||||
$post = add_magic_quotes($post); //since it is from db
|
||||
|
||||
$data['content'] = $post['post_content'];
|
||||
$data['excerpt'] = $post['post_excerpt'];
|
||||
|
||||
@@ -1129,6 +900,7 @@ case 'inline-save':
|
||||
$data['ping_status'] = 'closed';
|
||||
|
||||
// update the post
|
||||
$_POST = $data;
|
||||
edit_post();
|
||||
|
||||
$post = array();
|
||||
@@ -1182,18 +954,13 @@ case 'inline-save-tax':
|
||||
|
||||
break;
|
||||
case 'tag' :
|
||||
$taxonomy = !empty($_POST['taxonomy']) ? $_POST['taxonomy'] : 'post_tag';
|
||||
|
||||
$tag = get_term( $id, $taxonomy );
|
||||
$_POST['description'] = $tag->description;
|
||||
|
||||
$updated = wp_update_term($id, $taxonomy, $_POST);
|
||||
$updated = wp_update_term($id, 'post_tag', $_POST);
|
||||
if ( $updated && !is_wp_error($updated) ) {
|
||||
$tag = get_term( $updated['term_id'], $taxonomy );
|
||||
$tag = get_term( $updated['term_id'], 'post_tag' );
|
||||
if ( !$tag || is_wp_error( $tag ) )
|
||||
die( __('Tag not updated.') );
|
||||
|
||||
echo _tag_row($tag, '', $taxonomy);
|
||||
echo _tag_row($tag);
|
||||
} else {
|
||||
die( __('Tag not updated.') );
|
||||
}
|
||||
@@ -1203,6 +970,11 @@ case 'inline-save-tax':
|
||||
|
||||
exit;
|
||||
break;
|
||||
case 'meta-box-order':
|
||||
check_ajax_referer( 'meta-box-order' );
|
||||
update_user_option( $GLOBALS['current_user']->ID, "meta-box-order_$_POST[page]", $_POST['order'] );
|
||||
die('1');
|
||||
break;
|
||||
case 'find_posts':
|
||||
check_ajax_referer( 'find-posts' );
|
||||
|
||||
@@ -1212,10 +984,10 @@ case 'find_posts':
|
||||
$what = isset($_POST['pages']) ? 'page' : 'post';
|
||||
$s = stripslashes($_POST['ps']);
|
||||
preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches);
|
||||
$search_terms = array_map('_search_terms_tidy', $matches[0]);
|
||||
$search_terms = array_map(create_function('$a', 'return trim($a, "\\"\'\\n\\r ");'), $matches[0]);
|
||||
|
||||
$searchand = $search = '';
|
||||
foreach ( (array) $search_terms as $term ) {
|
||||
foreach( (array) $search_terms as $term) {
|
||||
$term = addslashes_gpc($term);
|
||||
$search .= "{$searchand}(($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%'))";
|
||||
$searchand = ' AND ';
|
||||
@@ -1224,12 +996,12 @@ case 'find_posts':
|
||||
if ( count($search_terms) > 1 && $search_terms[0] != $s )
|
||||
$search .= " OR ($wpdb->posts.post_title LIKE '%{$term}%') OR ($wpdb->posts.post_content LIKE '%{$term}%')";
|
||||
|
||||
$posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50" );
|
||||
$posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND $search ORDER BY post_date_gmt DESC LIMIT 50" );
|
||||
|
||||
if ( ! $posts )
|
||||
exit( __('No posts found.') );
|
||||
|
||||
$html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th>'.__('Date').'</th><th>'.__('Status').'</th></tr></thead><tbody>';
|
||||
$html = '<table class="widefat"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th>'.__('Time').'</th><th>'.__('Status').'</th></tr></thead><tbody>';
|
||||
foreach ( $posts as $post ) {
|
||||
|
||||
switch ( $post->post_status ) {
|
||||
@@ -1244,19 +1016,18 @@ case 'find_posts':
|
||||
$stat = __('Pending Review');
|
||||
break;
|
||||
case 'draft' :
|
||||
$stat = __('Draft');
|
||||
$stat = __('Unpublished');
|
||||
break;
|
||||
}
|
||||
|
||||
if ( '0000-00-00 00:00:00' == $post->post_date ) {
|
||||
$time = '';
|
||||
} else {
|
||||
/* translators: date format in table columns, see http://php.net/date */
|
||||
$time = mysql2date(__('Y/m/d'), $post->post_date);
|
||||
}
|
||||
|
||||
$html .= '<tr class="found-posts"><td class="found-radio"><input type="radio" id="found-'.$post->ID.'" name="found_post_id" value="' . esc_attr($post->ID) . '"></td>';
|
||||
$html .= '<td><label for="found-'.$post->ID.'">'.esc_html( $post->post_title ).'</label></td><td>'.esc_html( $time ).'</td><td>'.esc_html( $stat ).'</td></tr>'."\n\n";
|
||||
$html .= '<tr class="found-posts"><td class="found-radio"><input type="radio" id="found-'.$post->ID.'" name="found_post_id" value="'.$post->ID.'"></td>';
|
||||
$html .= '<td><label for="found-'.$post->ID.'">'.wp_specialchars($post->post_title, true).'</label></td><td>'.wp_specialchars($time, true).'</td><td>'.wp_specialchars($stat, true).'</td></tr>'."\n\n";
|
||||
}
|
||||
$html .= '</tbody></table>';
|
||||
|
||||
@@ -1268,162 +1039,6 @@ case 'find_posts':
|
||||
$x->send();
|
||||
|
||||
break;
|
||||
case 'lj-importer' :
|
||||
check_ajax_referer( 'lj-api-import' );
|
||||
if ( !current_user_can( 'publish_posts' ) )
|
||||
die('-1');
|
||||
if ( empty( $_POST['step'] ) )
|
||||
die( '-1' );
|
||||
define('WP_IMPORTING', true);
|
||||
include( ABSPATH . 'wp-admin/import/livejournal.php' );
|
||||
$result = $lj_api_import->{ 'step' . ( (int) $_POST['step'] ) }();
|
||||
if ( is_wp_error( $result ) )
|
||||
echo $result->get_error_message();
|
||||
die;
|
||||
break;
|
||||
case 'widgets-order' :
|
||||
check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' );
|
||||
|
||||
if ( !current_user_can('switch_themes') )
|
||||
die('-1');
|
||||
|
||||
unset( $_POST['savewidgets'], $_POST['action'] );
|
||||
|
||||
// save widgets order for all sidebars
|
||||
if ( is_array($_POST['sidebars']) ) {
|
||||
$sidebars = array();
|
||||
foreach ( $_POST['sidebars'] as $key => $val ) {
|
||||
$sb = array();
|
||||
if ( !empty($val) ) {
|
||||
$val = explode(',', $val);
|
||||
foreach ( $val as $k => $v ) {
|
||||
if ( strpos($v, 'widget-') === false )
|
||||
continue;
|
||||
|
||||
$sb[$k] = substr($v, strpos($v, '_') + 1);
|
||||
}
|
||||
}
|
||||
$sidebars[$key] = $sb;
|
||||
}
|
||||
wp_set_sidebars_widgets($sidebars);
|
||||
die('1');
|
||||
}
|
||||
|
||||
die('-1');
|
||||
break;
|
||||
case 'save-widget' :
|
||||
check_ajax_referer( 'save-sidebar-widgets', 'savewidgets' );
|
||||
|
||||
if ( !current_user_can('switch_themes') || !isset($_POST['id_base']) )
|
||||
die('-1');
|
||||
|
||||
unset( $_POST['savewidgets'], $_POST['action'] );
|
||||
|
||||
do_action('load-widgets.php');
|
||||
do_action('widgets.php');
|
||||
do_action('sidebar_admin_setup');
|
||||
|
||||
$id_base = $_POST['id_base'];
|
||||
$widget_id = $_POST['widget-id'];
|
||||
$sidebar_id = $_POST['sidebar'];
|
||||
$multi_number = !empty($_POST['multi_number']) ? (int) $_POST['multi_number'] : 0;
|
||||
$settings = isset($_POST['widget-' . $id_base]) && is_array($_POST['widget-' . $id_base]) ? $_POST['widget-' . $id_base] : false;
|
||||
$error = '<p>' . __('An error has occured. Please reload the page and try again.') . '</p>';
|
||||
|
||||
$sidebars = wp_get_sidebars_widgets();
|
||||
$sidebar = isset($sidebars[$sidebar_id]) ? $sidebars[$sidebar_id] : array();
|
||||
|
||||
// delete
|
||||
if ( isset($_POST['delete_widget']) && $_POST['delete_widget'] ) {
|
||||
|
||||
if ( !isset($wp_registered_widgets[$widget_id]) )
|
||||
die($error);
|
||||
|
||||
$sidebar = array_diff( $sidebar, array($widget_id) );
|
||||
$_POST = array('sidebar' => $sidebar_id, 'widget-' . $id_base => array(), 'the-widget-id' => $widget_id, 'delete_widget' => '1');
|
||||
} elseif ( $settings && preg_match( '/__i__|%i%/', key($settings) ) ) {
|
||||
if ( !$multi_number )
|
||||
die($error);
|
||||
|
||||
$_POST['widget-' . $id_base] = array( $multi_number => array_shift($settings) );
|
||||
$widget_id = $id_base . '-' . $multi_number;
|
||||
$sidebar[] = $widget_id;
|
||||
}
|
||||
$_POST['widget-id'] = $sidebar;
|
||||
|
||||
foreach ( (array) $wp_registered_widget_updates as $name => $control ) {
|
||||
|
||||
if ( $name == $id_base ) {
|
||||
if ( !is_callable( $control['callback'] ) )
|
||||
continue;
|
||||
|
||||
ob_start();
|
||||
call_user_func_array( $control['callback'], $control['params'] );
|
||||
ob_end_clean();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( isset($_POST['delete_widget']) && $_POST['delete_widget'] ) {
|
||||
$sidebars[$sidebar_id] = $sidebar;
|
||||
wp_set_sidebars_widgets($sidebars);
|
||||
echo "deleted:$widget_id";
|
||||
die();
|
||||
}
|
||||
|
||||
if ( !empty($_POST['add_new']) )
|
||||
die();
|
||||
|
||||
if ( $form = $wp_registered_widget_controls[$widget_id] )
|
||||
call_user_func_array( $form['callback'], $form['params'] );
|
||||
|
||||
die();
|
||||
break;
|
||||
case 'image-editor':
|
||||
$attachment_id = intval($_POST['postid']);
|
||||
if ( empty($attachment_id) || !current_user_can('edit_post', $attachment_id) )
|
||||
die('-1');
|
||||
|
||||
check_ajax_referer( "image_editor-$attachment_id" );
|
||||
include_once( ABSPATH . 'wp-admin/includes/image-edit.php' );
|
||||
|
||||
$msg = false;
|
||||
switch ( $_POST['do'] ) {
|
||||
case 'save' :
|
||||
$msg = wp_save_image($attachment_id);
|
||||
$msg = json_encode($msg);
|
||||
die($msg);
|
||||
break;
|
||||
case 'scale' :
|
||||
$msg = wp_save_image($attachment_id);
|
||||
break;
|
||||
case 'restore' :
|
||||
$msg = wp_restore_image($attachment_id);
|
||||
break;
|
||||
}
|
||||
|
||||
wp_image_editor($attachment_id, $msg);
|
||||
die();
|
||||
break;
|
||||
case 'set-post-thumbnail':
|
||||
$post_id = intval( $_POST['post_id'] );
|
||||
if ( !current_user_can( 'edit_post', $post_id ) )
|
||||
die( '-1' );
|
||||
$thumbnail_id = intval( $_POST['thumbnail_id'] );
|
||||
|
||||
if ( $thumbnail_id == '-1' ) {
|
||||
delete_post_meta( $post_id, '_thumbnail_id' );
|
||||
die( _wp_post_thumbnail_html() );
|
||||
}
|
||||
|
||||
if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
|
||||
$thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'thumbnail' );
|
||||
if ( !empty( $thumbnail_html ) ) {
|
||||
update_post_meta( $post_id, '_thumbnail_id', $thumbnail_id );
|
||||
die( _wp_post_thumbnail_html( $thumbnail_id ) );
|
||||
}
|
||||
}
|
||||
die( '0' );
|
||||
default :
|
||||
do_action( 'wp_ajax_' . $_POST['action'] );
|
||||
die('0');
|
||||
|
||||
@@ -5,10 +5,6 @@
|
||||
* @package WordPress
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
?>
|
||||
|
||||
<div class="clear"></div></div><!-- wpbody-content -->
|
||||
@@ -20,25 +16,13 @@ if ( !defined('ABSPATH') )
|
||||
<p id="footer-left" class="alignleft"><?php
|
||||
do_action( 'in_admin_footer' );
|
||||
$upgrade = apply_filters( 'update_footer', '' );
|
||||
echo apply_filters( 'admin_footer_text', '<span id="footer-thankyou">' . __('Thank you for creating with <a href="http://wordpress.org/">WordPress</a>.').'</span> | '.__('<a href="http://codex.wordpress.org/">Documentation</a>').' | '.__('<a href="http://wordpress.org/support/forum/4">Feedback</a>') ); ?>
|
||||
echo '<span id="footer-thankyou">' . __('Thank you for creating with <a href="http://wordpress.org/">WordPress</a>.').'</span> | '.__('<a href="http://codex.wordpress.org/">Documentation</a>').' | '.__('<a href="http://wordpress.org/support/forum/4">Feedback</a>'); ?>
|
||||
</p>
|
||||
<?php // if ( $is_IE ) browse_happy(); ?>
|
||||
<p id="footer-upgrade" class="alignright"><?php echo $upgrade; ?></p>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php
|
||||
do_action('admin_footer', '');
|
||||
do_action('admin_print_footer_scripts');
|
||||
do_action("admin_footer-$hook_suffix");
|
||||
|
||||
// get_site_option() won't exist when auto upgrading from <= 2.7
|
||||
if ( function_exists('get_site_option') ) {
|
||||
if ( false === get_site_option('can_compress_scripts') )
|
||||
compression_test();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php do_action('admin_footer', ''); ?>
|
||||
<script type="text/javascript">if(typeof wpOnload=='function')wpOnload();</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
@@ -10,22 +10,52 @@
|
||||
if (!isset($_GET["page"])) require_once('admin.php');
|
||||
|
||||
get_admin_page_title();
|
||||
$title = esc_html( strip_tags( $title ) );
|
||||
$title = wp_specialchars( strip_tags( $title ) );
|
||||
wp_user_settings();
|
||||
wp_menu_unfold();
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php echo get_option('blog_charset'); ?>" />
|
||||
<title><?php echo $title; ?> ‹ <?php bloginfo('name') ?> — WordPress</title>
|
||||
<title><?php bloginfo('name') ?> › <?php echo $title; ?> — WordPress</title>
|
||||
<?php
|
||||
|
||||
wp_admin_css( 'css/global' );
|
||||
wp_admin_css();
|
||||
wp_admin_css( 'css/colors' );
|
||||
wp_admin_css( 'css/ie' );
|
||||
wp_enqueue_script('utils');
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
addLoadEvent = function(func) {if (typeof jQuery != "undefined") jQuery(document).ready(func); else if (typeof wpOnload!='function'){wpOnload=func;} else {var oldonload=wpOnload; wpOnload=function(){oldonload();func();}}};
|
||||
|
||||
function convertEntities(o) {
|
||||
var c = function(s) {
|
||||
if (/&[^;]+;/.test(s)) {
|
||||
var e = document.createElement("div");
|
||||
e.innerHTML = s;
|
||||
return !e.firstChild ? s : e.firstChild.nodeValue;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
if ( typeof o === 'string' )
|
||||
return c(o);
|
||||
else if ( typeof o === 'object' )
|
||||
for (var v in o) {
|
||||
if ( typeof o[v] === 'string' )
|
||||
o[v] = c(o[v]);
|
||||
}
|
||||
return o;
|
||||
};
|
||||
//]]>
|
||||
</script>
|
||||
<?php
|
||||
|
||||
if ( in_array( $pagenow, array('post.php', 'post-new.php', 'page.php', 'page-new.php') ) ) {
|
||||
add_action( 'admin_head', 'wp_tiny_mce' );
|
||||
}
|
||||
|
||||
$hook_suffix = '';
|
||||
if ( isset($page_hook) )
|
||||
@@ -35,23 +65,6 @@ else if ( isset($plugin_page) )
|
||||
else if ( isset($pagenow) )
|
||||
$hook_suffix = "$pagenow";
|
||||
|
||||
$admin_body_class = preg_replace('/[^a-z0-9_-]+/i', '-', $hook_suffix);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
addLoadEvent = function(func){if(typeof jQuery!="undefined")jQuery(document).ready(func);else if(typeof wpOnload!='function'){wpOnload=func;}else{var oldonload=wpOnload;wpOnload=function(){oldonload();func();}}};
|
||||
var userSettings = {'url':'<?php echo SITECOOKIEPATH; ?>','uid':'<?php if ( ! isset($current_user) ) $current_user = wp_get_current_user(); echo $current_user->ID; ?>','time':'<?php echo time() ?>'};
|
||||
var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>', pagenow = '<?php echo substr($pagenow, 0, -4); ?>', adminpage = '<?php echo $admin_body_class; ?>', thousandsSeparator = '<?php echo $wp_locale->number_format['thousands_sep']; ?>', decimalPoint = '<?php echo $wp_locale->number_format['decimal_point']; ?>';
|
||||
//]]>
|
||||
</script>
|
||||
<?php
|
||||
|
||||
if ( in_array( $pagenow, array('post.php', 'post-new.php', 'page.php', 'page-new.php') ) ) {
|
||||
add_action( 'admin_print_footer_scripts', 'wp_tiny_mce', 25 );
|
||||
wp_enqueue_script('quicktags');
|
||||
}
|
||||
|
||||
do_action('admin_enqueue_scripts', $hook_suffix);
|
||||
do_action("admin_print_styles-$hook_suffix");
|
||||
do_action('admin_print_styles');
|
||||
do_action("admin_print_scripts-$hook_suffix");
|
||||
@@ -59,24 +72,11 @@ do_action('admin_print_scripts');
|
||||
do_action("admin_head-$hook_suffix");
|
||||
do_action('admin_head');
|
||||
|
||||
if ( get_user_setting('mfold') == 'f' ) {
|
||||
$admin_body_class .= ' folded';
|
||||
}
|
||||
|
||||
if ( $is_iphone ) { ?>
|
||||
<style type="text/css">.row-actions{visibility:visible;}</style>
|
||||
<?php } ?>
|
||||
</head>
|
||||
<body class="wp-admin no-js <?php echo apply_filters( 'admin_body_class', '' ) . " $admin_body_class"; ?>">
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
(function(){
|
||||
var c = document.body.className;
|
||||
c = c.replace(/no-js/, 'js');
|
||||
document.body.className = c;
|
||||
})();
|
||||
//]]>
|
||||
</script>
|
||||
<body class="wp-admin <?php echo apply_filters( 'admin_body_class', '' ); ?>">
|
||||
|
||||
<div id="wpwrap">
|
||||
<div id="wpcontent">
|
||||
@@ -101,7 +101,7 @@ if ( function_exists('mb_strlen') ) {
|
||||
}
|
||||
?>
|
||||
|
||||
<img id="header-logo" src="../wp-includes/images/blank.gif" alt="" width="32" height="32" /> <h1 id="site-heading" <?php echo $title_class ?>><a href="<?php echo trailingslashit( get_bloginfo('url') ); ?>" title="<?php _e('Visit Site') ?>"><span id="site-title"><?php echo $blog_name ?></span> <em id="site-visit-button"><?php _e('Visit Site') ?></em></a></h1>
|
||||
<img id="header-logo" src="../wp-includes/images/blank.gif" alt="" width="32" height="32" /> <h1 <?php echo $title_class ?>><a href="<?php echo trailingslashit( get_bloginfo('url') ); ?>" title="<?php _e('Visit site') ?>"><?php echo $blog_name ?> <span>← <?php _e('Visit site') ?></span></a></h1>
|
||||
|
||||
<div id="wphead-info">
|
||||
<div id="user_info">
|
||||
@@ -110,10 +110,14 @@ if ( function_exists('mb_strlen') ) {
|
||||
<a href="<?php echo wp_logout_url() ?>" title="<?php _e('Log Out') ?>"><?php _e('Log Out'); ?></a></p>
|
||||
</div>
|
||||
|
||||
<?php favorite_actions($hook_suffix); ?>
|
||||
<?php favorite_actions(); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ( get_user_setting('mfold') == 'f' ) { ?>
|
||||
<script type="text/javascript">jQuery('#wpcontent').addClass('folded');</script>
|
||||
<?php } ?>
|
||||
|
||||
<div id="wpbody">
|
||||
<?php require(ABSPATH . 'wp-admin/menu-header.php'); ?>
|
||||
|
||||
|
||||
@@ -16,15 +16,14 @@ else
|
||||
|
||||
require_once(ABSPATH . 'wp-admin/includes/admin.php');
|
||||
|
||||
if ( !wp_validate_auth_cookie() )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
nocache_headers();
|
||||
|
||||
do_action('admin_init');
|
||||
|
||||
$action = 'admin_post';
|
||||
|
||||
if ( !wp_validate_auth_cookie() )
|
||||
$action .= '_nopriv';
|
||||
|
||||
if ( !empty($_REQUEST['action']) )
|
||||
$action .= '_' . $_REQUEST['action'];
|
||||
|
||||
|
||||
@@ -11,25 +11,14 @@
|
||||
*
|
||||
* @since unknown
|
||||
*/
|
||||
if ( !defined('WP_ADMIN') )
|
||||
define('WP_ADMIN', TRUE);
|
||||
define('WP_ADMIN', TRUE);
|
||||
|
||||
if ( defined('ABSPATH') )
|
||||
require_once(ABSPATH . 'wp-load.php');
|
||||
else
|
||||
require_once('../wp-load.php');
|
||||
|
||||
if ( get_option('db_upgraded') ) {
|
||||
$wp_rewrite->flush_rules();
|
||||
update_option( 'db_upgraded', false );
|
||||
|
||||
/**
|
||||
* Runs on the next page load after successful upgrade
|
||||
*
|
||||
* @since 2.8
|
||||
*/
|
||||
do_action('after_db_upgrade');
|
||||
} elseif ( get_option('db_version') != $wp_db_version ) {
|
||||
if ( get_option('db_version') != $wp_db_version ) {
|
||||
wp_redirect(admin_url('upgrade.php?_wp_http_referer=' . urlencode(stripslashes($_SERVER['REQUEST_URI']))));
|
||||
exit;
|
||||
}
|
||||
@@ -42,17 +31,12 @@ nocache_headers();
|
||||
|
||||
update_category_cache();
|
||||
|
||||
// Schedule trash collection
|
||||
if ( !wp_next_scheduled('wp_scheduled_delete') && !defined('WP_INSTALLING') )
|
||||
wp_schedule_event(time(), 'daily', 'wp_scheduled_delete');
|
||||
|
||||
set_screen_options();
|
||||
|
||||
$posts_per_page = get_option('posts_per_page');
|
||||
$what_to_show = get_option('what_to_show');
|
||||
$date_format = get_option('date_format');
|
||||
$time_format = get_option('time_format');
|
||||
|
||||
wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'text', 'trackback', 'pingback'));
|
||||
wp_reset_vars(array('profile', 'redirect', 'redirect_url', 'a', 'popuptitle', 'popupurl', 'text', 'trackback', 'pingback'));
|
||||
|
||||
wp_admin_css_color('classic', __('Blue'), admin_url("css/colors-classic.css"), array('#073447', '#21759B', '#EAF3FA', '#BBD8E7'));
|
||||
wp_admin_css_color('fresh', __('Gray'), admin_url("css/colors-fresh.css"), array('#464646', '#6D6D6D', '#F1F1F1', '#DFDFDF'));
|
||||
@@ -150,7 +134,7 @@ if (isset($plugin_page)) {
|
||||
|
||||
// Make sure rules are flushed
|
||||
global $wp_rewrite;
|
||||
$wp_rewrite->flush_rules(false);
|
||||
$wp_rewrite->flush_rules();
|
||||
|
||||
exit();
|
||||
} else {
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
define('WP_ADMIN', true);
|
||||
|
||||
if ( defined('ABSPATH') )
|
||||
require_once(ABSPATH . 'wp-load.php');
|
||||
else
|
||||
@@ -18,8 +16,6 @@ if ( is_ssl() && empty($_COOKIE[SECURE_AUTH_COOKIE]) && !empty($_REQUEST['auth_c
|
||||
$_COOKIE[SECURE_AUTH_COOKIE] = $_REQUEST['auth_cookie'];
|
||||
elseif ( empty($_COOKIE[AUTH_COOKIE]) && !empty($_REQUEST['auth_cookie']) )
|
||||
$_COOKIE[AUTH_COOKIE] = $_REQUEST['auth_cookie'];
|
||||
if ( empty($_COOKIE[LOGGED_IN_COOKIE]) && !empty($_REQUEST['logged_in_cookie']) )
|
||||
$_COOKIE[LOGGED_IN_COOKIE] = $_REQUEST['logged_in_cookie'];
|
||||
unset($current_user);
|
||||
require_once('admin.php');
|
||||
|
||||
@@ -32,9 +28,8 @@ if ( !current_user_can('upload_files') )
|
||||
if ( isset($_REQUEST['attachment_id']) && ($id = intval($_REQUEST['attachment_id'])) && $_REQUEST['fetch'] ) {
|
||||
if ( 2 == $_REQUEST['fetch'] ) {
|
||||
add_filter('attachment_fields_to_edit', 'media_single_attachment_fields_to_edit', 10, 2);
|
||||
echo get_media_item($id, array( 'send' => false, 'delete' => true ));
|
||||
echo get_media_item($id, array( 'send' => false, 'delete' => false ));
|
||||
} else {
|
||||
add_filter('attachment_fields_to_edit', 'media_post_single_attachment_fields_to_edit', 10, 2);
|
||||
echo get_media_item($id);
|
||||
}
|
||||
exit;
|
||||
@@ -44,7 +39,7 @@ check_admin_referer('media-form');
|
||||
|
||||
$id = media_handle_upload('async-upload', $_REQUEST['post_id']);
|
||||
if (is_wp_error($id)) {
|
||||
echo '<div id="media-upload-error">'.esc_html($id->get_error_message()).'</div>';
|
||||
echo '<div id="media-upload-error">'.wp_specialchars($id->get_error_message()).'</div>';
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -58,4 +53,4 @@ else {
|
||||
echo apply_filters("async_upload_{$type}", $id);
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -25,33 +25,30 @@ case 'addcat':
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
if ( wp_insert_category($_POST ) )
|
||||
wp_safe_redirect( add_query_arg( 'message', 1, wp_get_referer() ) . '#addcat' );
|
||||
else
|
||||
wp_safe_redirect( add_query_arg( 'message', 4, wp_get_referer() ) . '#addcat' );
|
||||
|
||||
if( wp_insert_category($_POST ) ) {
|
||||
wp_redirect('categories.php?message=1#addcat');
|
||||
} else {
|
||||
wp_redirect('categories.php?message=4#addcat');
|
||||
}
|
||||
exit;
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
if ( !isset( $_GET['cat_ID'] ) ) {
|
||||
wp_redirect('categories.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$cat_ID = (int) $_GET['cat_ID'];
|
||||
check_admin_referer('delete-category_' . $cat_ID);
|
||||
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
$cat_name = get_catname($cat_ID);
|
||||
|
||||
// Don't delete the default cats.
|
||||
if ( $cat_ID == get_option('default_category') )
|
||||
wp_die( sprintf( __("Can’t delete the <strong>%s</strong> category: this is the default one"), get_cat_name($cat_ID) ) );
|
||||
if ( $cat_ID == get_option('default_category') )
|
||||
wp_die(sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
|
||||
|
||||
wp_delete_category($cat_ID);
|
||||
|
||||
wp_safe_redirect( add_query_arg( 'message', 2, wp_get_referer() ) );
|
||||
wp_redirect('categories.php?message=2');
|
||||
exit;
|
||||
|
||||
break;
|
||||
@@ -62,20 +59,20 @@ case 'bulk-delete':
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die( __('You are not allowed to delete categories.') );
|
||||
|
||||
$cats = (array) $_GET['delete'];
|
||||
$default_cat = get_option('default_category');
|
||||
foreach ( $cats as $cat_ID ) {
|
||||
$cat_ID = (int) $cat_ID;
|
||||
foreach ( (array) $_GET['delete'] as $cat_ID ) {
|
||||
$cat_name = get_catname($cat_ID);
|
||||
|
||||
// Don't delete the default cat.
|
||||
if ( $cat_ID == $default_cat )
|
||||
wp_die( sprintf( __("Can’t delete the <strong>%s</strong> category: this is the default one"), get_cat_name($cat_ID) ) );
|
||||
// Don't delete the default cats.
|
||||
if ( $cat_ID == get_option('default_category') )
|
||||
wp_die(sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
|
||||
|
||||
wp_delete_category($cat_ID);
|
||||
}
|
||||
|
||||
wp_safe_redirect( wp_get_referer() );
|
||||
exit;
|
||||
$sendback = wp_get_referer();
|
||||
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
|
||||
break;
|
||||
case 'edit':
|
||||
@@ -134,9 +131,9 @@ $messages[5] = __('Category not updated.');
|
||||
|
||||
<div class="wrap nosubsub">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title );
|
||||
<h2><?php echo wp_specialchars( $title );
|
||||
if ( isset($_GET['s']) && $_GET['s'] )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_GET['s']) ) ); ?>
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', wp_specialchars( stripslashes($_GET['s']) ) ); ?>
|
||||
</h2>
|
||||
|
||||
<?php
|
||||
@@ -147,9 +144,9 @@ endif; ?>
|
||||
|
||||
<form class="search-form topmargin" action="" method="get">
|
||||
<p class="search-box">
|
||||
<label class="screen-reader-text" for="category-search-input"><?php _e('Search Categories'); ?>:</label>
|
||||
<input type="text" id="category-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<input type="submit" value="<?php esc_attr_e( 'Search Categories' ); ?>" class="button" />
|
||||
<label class="hidden" for="category-search-input"><?php _e('Search Categories'); ?>:</label>
|
||||
<input type="text" class="search-input" id="category-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
|
||||
</p>
|
||||
</form>
|
||||
<br class="clear" />
|
||||
@@ -165,23 +162,15 @@ endif; ?>
|
||||
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
|
||||
if ( empty($pagenum) )
|
||||
$pagenum = 1;
|
||||
|
||||
$cats_per_page = (int) get_user_option( 'categories_per_page', 0, false );
|
||||
if ( empty( $cats_per_page ) || $cats_per_page < 1 )
|
||||
$cats_per_page = 20;
|
||||
$cats_per_page = apply_filters( 'edit_categories_per_page', $cats_per_page );
|
||||
|
||||
if ( !empty($_GET['s']) )
|
||||
$num_cats = count(get_categories(array('hide_empty' => 0, 'search' => $_GET['s'])));
|
||||
else
|
||||
$num_cats = wp_count_terms('category');
|
||||
if( ! isset( $catsperpage ) || $catsperpage < 0 )
|
||||
$catsperpage = 20;
|
||||
|
||||
$page_links = paginate_links( array(
|
||||
'base' => add_query_arg( 'pagenum', '%#%' ),
|
||||
'format' => '',
|
||||
'prev_text' => __('«'),
|
||||
'next_text' => __('»'),
|
||||
'total' => ceil($num_cats / $cats_per_page),
|
||||
'total' => ceil(wp_count_terms('category') / $catsperpage),
|
||||
'current' => $pagenum
|
||||
));
|
||||
|
||||
@@ -194,7 +183,7 @@ if ( $page_links )
|
||||
<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<?php wp_nonce_field('bulk-categories'); ?>
|
||||
</div>
|
||||
|
||||
@@ -218,7 +207,7 @@ if ( $page_links )
|
||||
|
||||
<tbody id="the-list" class="list:cat">
|
||||
<?php
|
||||
cat_rows(0, 0, 0, $pagenum, $cats_per_page);
|
||||
cat_rows(0, 0, 0, $pagenum, $catsperpage);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -234,7 +223,7 @@ if ( $page_links )
|
||||
<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
<?php wp_nonce_field('bulk-categories'); ?>
|
||||
</div>
|
||||
|
||||
@@ -244,7 +233,7 @@ if ( $page_links )
|
||||
</form>
|
||||
|
||||
<div class="form-wrap">
|
||||
<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_cat_name(get_option('default_category')))) ?></p>
|
||||
<p><?php printf(__('<strong>Note:</strong><br />Deleting a category does not delete the posts in that category. Instead, posts that were only assigned to the deleted category are set to the category <strong>%s</strong>.'), apply_filters('the_category', get_catname(get_option('default_category')))) ?></p>
|
||||
<p><?php printf(__('Categories can be selectively converted to tags using the <a href="%s">category to tag converter</a>.'), 'admin.php?import=wp-cat2tag') ?></p>
|
||||
</div>
|
||||
|
||||
@@ -285,10 +274,10 @@ if ( $page_links )
|
||||
<div class="form-field">
|
||||
<label for="category_description"><?php _e('Description') ?></label>
|
||||
<textarea name="category_description" id="category_description" rows="5" cols="40"></textarea>
|
||||
<p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
|
||||
<p><?php _e('The description is not prominent by default, however some themes may show it.'); ?></p>
|
||||
</div>
|
||||
|
||||
<p class="submit"><input type="submit" class="button" name="submit" value="<?php esc_attr_e('Add Category'); ?>" /></p>
|
||||
<p class="submit"><input type="submit" class="button" name="submit" value="<?php _e('Add Category'); ?>" /></p>
|
||||
<?php do_action('edit_category_form', $category); ?>
|
||||
</form></div>
|
||||
|
||||
@@ -300,6 +289,21 @@ if ( $page_links )
|
||||
</div><!-- /col-container -->
|
||||
</div><!-- /wrap -->
|
||||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
(function($){
|
||||
$(document).ready(function(){
|
||||
$('#doaction, #doaction2').click(function(){
|
||||
if ( $('select[name^="action"]').val() == 'delete' ) {
|
||||
var m = '<?php echo js_escape(__("You are about to delete the selected categories.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
|
||||
return showNotice.warn(m);
|
||||
}
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
<?php
|
||||
inline_edit_term_row('categories');
|
||||
|
||||
|
||||
@@ -17,24 +17,12 @@ wp_reset_vars( array('action') );
|
||||
if ( isset( $_POST['deletecomment'] ) )
|
||||
$action = 'deletecomment';
|
||||
|
||||
if ( 'cdc' == $action )
|
||||
$action = 'delete';
|
||||
elseif ( 'mac' == $action )
|
||||
$action = 'approve';
|
||||
|
||||
if ( isset( $_GET['dt'] ) ) {
|
||||
if ( 'spam' == $_GET['dt'] )
|
||||
$action = 'spam';
|
||||
elseif ( 'trash' == $_GET['dt'] )
|
||||
$action = 'trash';
|
||||
}
|
||||
|
||||
/**
|
||||
* Display error message at bottom of comments.
|
||||
*
|
||||
* @param string $msg Error Message. Assumed to contain HTML and be sanitized.
|
||||
*/
|
||||
function comment_footer_die( $msg ) {
|
||||
function comment_footer_die( $msg ) { //
|
||||
echo "<div class='wrap'><p>$msg</p></div>";
|
||||
include('admin-footer.php');
|
||||
die;
|
||||
@@ -56,60 +44,68 @@ case 'editcomment' :
|
||||
if ( !current_user_can('edit_post', $comment->comment_post_ID) )
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post.') );
|
||||
|
||||
if ( 'trash' == $comment->comment_approved )
|
||||
comment_footer_die( __('This comment is in the Trash. Please move it out of the Trash if you want to edit it.') );
|
||||
|
||||
$comment = get_comment_to_edit( $comment_id );
|
||||
|
||||
include('edit-form-comment.php');
|
||||
|
||||
break;
|
||||
|
||||
case 'delete' :
|
||||
case 'approve' :
|
||||
case 'trash' :
|
||||
case 'spam' :
|
||||
case 'cdc' :
|
||||
case 'mac' :
|
||||
|
||||
require_once('admin-header.php');
|
||||
|
||||
$comment_id = absint( $_GET['c'] );
|
||||
$formaction = $action . 'comment';
|
||||
$nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_';
|
||||
$formaction = 'cdc' == $action ? 'deletecomment' : 'approvecomment';
|
||||
$nonce_action = 'cdc' == $action ? 'delete-comment_' : 'approve-comment_';
|
||||
$nonce_action .= $comment_id;
|
||||
|
||||
if ( !$comment = get_comment_to_edit( $comment_id ) )
|
||||
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );
|
||||
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
|
||||
comment_footer_die( 'approve' != $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
|
||||
comment_footer_die( 'cdc' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
|
||||
?>
|
||||
<div class='wrap'>
|
||||
|
||||
<div class="narrow">
|
||||
<?php
|
||||
switch ( $action ) {
|
||||
case 'spam' :
|
||||
$caution_msg = __('You are about to mark the following comment as spam:');
|
||||
$button = __('Spam Comment');
|
||||
break;
|
||||
case 'trash' :
|
||||
$caution_msg = __('You are about to move the following comment to the Trash:');
|
||||
$button = __('Trash Comment');
|
||||
break;
|
||||
case 'delete' :
|
||||
$caution_msg = __('You are about to delete the following comment:');
|
||||
$button = __('Permanently Delete Comment');
|
||||
break;
|
||||
default :
|
||||
$caution_msg = __('You are about to approve the following comment:');
|
||||
$button = __('Approve Comment');
|
||||
break;
|
||||
if ( 'spam' == $_GET['dt'] ) {
|
||||
$caution_msg = __('You are about to mark the following comment as spam:');
|
||||
$button = __('Spam Comment');
|
||||
} elseif ( 'cdc' == $action ) {
|
||||
$caution_msg = __('You are about to delete the following comment:');
|
||||
$button = __('Delete Comment');
|
||||
} else {
|
||||
$caution_msg = __('You are about to approve the following comment:');
|
||||
$button = __('Approve Comment');
|
||||
}
|
||||
?>
|
||||
|
||||
<p><strong><?php _e('Caution:'); ?></strong> <?php echo $caution_msg; ?></p>
|
||||
|
||||
<table class="form-table comment-ays">
|
||||
<p><?php _e('Are you sure you want to do that?'); ?></p>
|
||||
|
||||
<form action='comment.php' method='get'>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td><input type='button' class="button" value='<?php _e('No'); ?>' onclick="self.location='<?php echo admin_url('edit-comments.php'); ?>" /></td>
|
||||
<td class="textright"><input type='submit' class="button" value='<?php echo $button; ?>' /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php wp_nonce_field( $nonce_action ); ?>
|
||||
<input type='hidden' name='action' value='<?php echo $formaction; ?>' />
|
||||
<?php if ( 'spam' == $_GET['dt'] ) { ?>
|
||||
<input type='hidden' name='dt' value='spam' />
|
||||
<?php } ?>
|
||||
<input type='hidden' name='p' value='<?php echo $comment->comment_post_ID; ?>' />
|
||||
<input type='hidden' name='c' value='<?php echo $comment->comment_ID; ?>' />
|
||||
<input type='hidden' name='noredir' value='1' />
|
||||
</form>
|
||||
|
||||
<table class="form-table" cellpadding="5">
|
||||
<tr class="alt">
|
||||
<th scope="row"><?php _e('Author'); ?></th>
|
||||
<td><?php echo $comment->comment_author; ?></td>
|
||||
@@ -123,121 +119,96 @@ switch ( $action ) {
|
||||
<?php if ( $comment->comment_author_url ) { ?>
|
||||
<tr>
|
||||
<th scope="row"><?php _e('URL'); ?></th>
|
||||
<td><a href="<?php echo $comment->comment_author_url; ?>"><?php echo $comment->comment_author_url; ?></a></td>
|
||||
<td><a href='<?php echo $comment->comment_author_url; ?>'><?php echo $comment->comment_author_url; ?></a></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<tr>
|
||||
<th scope="row" valign="top"><?php /* translators: field name in comment form */ echo _x('Comment', 'noun'); ?></th>
|
||||
<th scope="row" valign="top"><?php echo _c('Comment|noun'); ?></th>
|
||||
<td><?php echo $comment->comment_content; ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<p><?php _e('Are you sure you want to do that?'); ?></p>
|
||||
|
||||
<form action='comment.php' method='get'>
|
||||
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td><a class="button" href="<?php echo admin_url('edit-comments.php'); ?>"><?php esc_attr_e('No'); ?></a></td>
|
||||
<td class="textright"><input type='submit' class="button" value='<?php echo esc_attr($button); ?>' /></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php wp_nonce_field( $nonce_action ); ?>
|
||||
<input type='hidden' name='action' value='<?php echo esc_attr($formaction); ?>' />
|
||||
<input type='hidden' name='p' value='<?php echo esc_attr($comment->comment_post_ID); ?>' />
|
||||
<input type='hidden' name='c' value='<?php echo esc_attr($comment->comment_ID); ?>' />
|
||||
<input type='hidden' name='noredir' value='1' />
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'deletecomment' :
|
||||
case 'trashcomment' :
|
||||
case 'untrashcomment' :
|
||||
case 'spamcomment' :
|
||||
case 'unspamcomment' :
|
||||
$comment_id = absint( $_REQUEST['c'] );
|
||||
check_admin_referer( 'delete-comment_' . $comment_id );
|
||||
|
||||
$noredir = isset($_REQUEST['noredir']);
|
||||
if ( isset( $_REQUEST['noredir'] ) )
|
||||
$noredir = true;
|
||||
else
|
||||
$noredir = false;
|
||||
|
||||
if ( !$comment = get_comment($comment_id) )
|
||||
if ( !$comment = get_comment( $comment_id ) )
|
||||
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit-comments.php') );
|
||||
if ( !current_user_can('edit_post', $comment->comment_post_ID ) )
|
||||
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post.') );
|
||||
|
||||
if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php') )
|
||||
$redir = wp_get_referer();
|
||||
elseif ( '' != wp_get_original_referer() && false == $noredir )
|
||||
$redir = wp_get_original_referer();
|
||||
if ( 'spam' == $_REQUEST['dt'] )
|
||||
wp_set_comment_status( $comment->comment_ID, 'spam' );
|
||||
else
|
||||
$redir = admin_url('edit-comments.php');
|
||||
wp_delete_comment( $comment->comment_ID );
|
||||
|
||||
$redir = remove_query_arg( array('spammed', 'unspammed', 'trashed', 'untrashed', 'deleted', 'ids'), $redir );
|
||||
|
||||
switch ( $action ) {
|
||||
case 'deletecomment' :
|
||||
wp_delete_comment( $comment_id );
|
||||
$redir = add_query_arg( array('deleted' => '1'), $redir );
|
||||
break;
|
||||
case 'trashcomment' :
|
||||
wp_trash_comment($comment_id);
|
||||
$redir = add_query_arg( array('trashed' => '1', 'ids' => $comment_id), $redir );
|
||||
break;
|
||||
case 'untrashcomment' :
|
||||
wp_untrash_comment($comment_id);
|
||||
$redir = add_query_arg( array('untrashed' => '1'), $redir );
|
||||
break;
|
||||
case 'spamcomment' :
|
||||
wp_spam_comment($comment_id);
|
||||
$redir = add_query_arg( array('spammed' => '1', 'ids' => $comment_id), $redir );
|
||||
break;
|
||||
case 'unspamcomment' :
|
||||
wp_unspam_comment($comment_id);
|
||||
$redir = add_query_arg( array('unspammed' => '1'), $redir );
|
||||
break;
|
||||
}
|
||||
|
||||
wp_redirect( $redir );
|
||||
if ( '' != wp_get_referer() && false == $noredir && false === strpos(wp_get_referer(), 'comment.php' ) )
|
||||
wp_redirect( wp_get_referer() );
|
||||
else if ( '' != wp_get_original_referer() && false == $noredir )
|
||||
wp_redirect( wp_get_original_referer() );
|
||||
else
|
||||
wp_redirect( admin_url('edit-comments.php') );
|
||||
|
||||
die;
|
||||
break;
|
||||
|
||||
case 'approvecomment' :
|
||||
case 'unapprovecomment' :
|
||||
$comment_id = absint( $_GET['c'] );
|
||||
check_admin_referer( 'approve-comment_' . $comment_id );
|
||||
check_admin_referer( 'unapprove-comment_' . $comment_id );
|
||||
|
||||
$noredir = isset( $_GET['noredir'] );
|
||||
if ( isset( $_GET['noredir'] ) )
|
||||
$noredir = true;
|
||||
else
|
||||
$noredir = false;
|
||||
|
||||
if ( !$comment = get_comment( $comment_id ) )
|
||||
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );
|
||||
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) {
|
||||
if ( 'approvecomment' == $action )
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
|
||||
else
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );
|
||||
}
|
||||
if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) )
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot disapprove this comment.') );
|
||||
|
||||
wp_set_comment_status( $comment->comment_ID, 'hold' );
|
||||
|
||||
if ( '' != wp_get_referer() && false == $noredir )
|
||||
$redir = remove_query_arg( array('approved', 'unapproved'), wp_get_referer() );
|
||||
wp_redirect( wp_get_referer() );
|
||||
else
|
||||
$redir = admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) );
|
||||
wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
|
||||
|
||||
if ( 'approvecomment' == $action ) {
|
||||
wp_set_comment_status( $comment_id, 'approve' );
|
||||
$redir = add_query_arg( array( 'approved' => 1 ), $redir );
|
||||
} else {
|
||||
wp_set_comment_status( $comment_id, 'hold' );
|
||||
$redir = add_query_arg( array( 'unapproved' => 1 ), $redir );
|
||||
}
|
||||
exit();
|
||||
break;
|
||||
|
||||
wp_redirect( $redir );
|
||||
case 'approvecomment' :
|
||||
$comment_id = absint( $_GET['c'] );
|
||||
check_admin_referer( 'approve-comment_' . $comment_id );
|
||||
|
||||
if ( isset( $_GET['noredir'] ) )
|
||||
$noredir = true;
|
||||
else
|
||||
$noredir = false;
|
||||
|
||||
if ( !$comment = get_comment( $comment_id ) )
|
||||
comment_footer_die( __('Oops, no comment with this ID.') . sprintf(' <a href="%s">'.__('Go back').'</a>!', 'edit.php') );
|
||||
|
||||
if ( !current_user_can('edit_post', $comment->comment_post_ID) )
|
||||
comment_footer_die( __('You are not allowed to edit comments on this post, so you cannot approve this comment.') );
|
||||
|
||||
wp_set_comment_status( $comment->comment_ID, 'approve' );
|
||||
|
||||
if ( '' != wp_get_referer() && false == $noredir )
|
||||
wp_redirect( wp_get_referer() );
|
||||
else
|
||||
wp_redirect( admin_url('edit-comments.php?p=' . absint( $comment->comment_post_ID ) . '#comments') );
|
||||
|
||||
exit();
|
||||
break;
|
||||
@@ -245,7 +216,7 @@ case 'unapprovecomment' :
|
||||
case 'editedcomment' :
|
||||
|
||||
$comment_id = absint( $_POST['comment_ID'] );
|
||||
$comment_post_id = absint( $_POST['comment_post_ID'] );
|
||||
$comment_post_id = absint( $_POST['comment_post_id'] );
|
||||
|
||||
check_admin_referer( 'update-comment_' . $comment_id );
|
||||
|
||||
@@ -266,4 +237,4 @@ default:
|
||||
|
||||
include('admin-footer.php');
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -12,7 +12,7 @@
|
||||
background-image: url(../images/bubble_bg-rtl.gif);
|
||||
}
|
||||
.tablenav .tablenav-pages a {
|
||||
background: #eee url('../images/menu-bits-rtl-vs.gif') repeat-x scroll right -379px;
|
||||
background: #eee url('../images/menu-bits-rtl.gif') repeat-x scroll right -379px;
|
||||
}
|
||||
#upload-menu li.current {
|
||||
border-right-color: transparent;
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu .current a.current {
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -289px;
|
||||
background: transparent url(../images/menu-bits-rtl.gif) no-repeat scroll right -289px;
|
||||
}
|
||||
|
||||
#adminmenu li.wp-menu-separator {
|
||||
@@ -33,7 +33,7 @@
|
||||
|
||||
#adminmenu li.wp-has-current-submenu .wp-menu-toggle,
|
||||
#adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -207px;
|
||||
background: transparent url(../images/menu-bits-rtl.gif) repeat-x scroll right -207px;
|
||||
}
|
||||
|
||||
#adminmenu .wp-has-current-submenu ul li a.current {
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
#adminmenu li.wp-has-current-submenu a.wp-has-current-submenu,
|
||||
#adminmenu .menu-top .current {
|
||||
background: url(../images/menu-bits-rtl-vs.gif) top right repeat-x;
|
||||
background: url(../images/menu-bits-rtl.gif) top right repeat-x;
|
||||
}
|
||||
|
||||
#adminmenu li.wp-has-current-submenu ul li a {
|
||||
@@ -50,31 +50,31 @@
|
||||
}
|
||||
|
||||
#adminmenu li.wp-has-current-submenu.wp-menu-open .wp-menu-toggle, #adminmenu li.wp-has-current-submenu:hover .wp-menu-toggle {
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat right -207px;
|
||||
background: transparent url(../images/menu-bits-rtl.gif) no-repeat right -207px;
|
||||
}
|
||||
|
||||
#adminmenu .wp-has-submenu:hover .wp-menu-toggle,
|
||||
#adminmenu .wp-menu-open .wp-menu-toggle {
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -109px;
|
||||
background: transparent url(../images/menu-bits-rtl.gif) repeat-x scroll right -109px;
|
||||
}
|
||||
|
||||
#adminmenu a.wp-has-submenu {
|
||||
background: #f1f1f1 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right -379px;
|
||||
background: #f1f1f1 url(../images/menu-bits-rtl.gif) repeat-x scroll right -379px;
|
||||
}
|
||||
|
||||
#adminmenu .wp-submenu a {
|
||||
background: #FFFFFF url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -310px;
|
||||
background: #FFFFFF url(../images/menu-bits-rtl.gif) no-repeat scroll right -310px;
|
||||
}
|
||||
|
||||
#adminmenu li.current a,
|
||||
#adminmenu .wp-submenu a:hover {
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -289px;
|
||||
background: transparent url(../images/menu-bits-rtl.gif) no-repeat scroll right -289px;
|
||||
}
|
||||
|
||||
#adminmenu li.wp-has-current-submenu a.wp-has-submenu {
|
||||
background: #b5b5b5 url(../images/menu-bits-rtl-vs.gif) repeat-x scroll right top;
|
||||
background: #b5b5b5 url(../images/menu-bits-rtl.gif) repeat-x scroll right top;
|
||||
}
|
||||
|
||||
.meta-box-sortables .postbox:hover .handlediv {
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -111px;
|
||||
background: transparent url(../images/menu-bits-rtl.gif) no-repeat scroll right -111px;
|
||||
}
|
||||
|
||||
@@ -1,394 +0,0 @@
|
||||
.postbox p, .postbox ul, .postbox ol, .postbox blockquote, #wp-version-message { font-size: 11px; }
|
||||
|
||||
.edit-box {
|
||||
display: none;
|
||||
}
|
||||
|
||||
h3:hover .edit-box {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
form .input-text-wrap {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding: 2px 3px;
|
||||
border-color: #ccc;
|
||||
}
|
||||
|
||||
#dashboard-widgets form .input-text-wrap input {
|
||||
border: 0 none;
|
||||
outline: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 99%;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
form .textarea-wrap {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding: 2px;
|
||||
border-color: #ccc;
|
||||
}
|
||||
|
||||
#dashboard-widgets form .textarea-wrap textarea {
|
||||
border: 0 none;
|
||||
padding: 0;
|
||||
outline: none;
|
||||
width: 99%;
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
#dashboard-widgets .postbox form .submit {
|
||||
float: none;
|
||||
margin: .5em 0 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit input {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#dashboard-widgets-wrap #dashboard-widgets .postbox form .submit #publish {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
div.postbox div.inside {
|
||||
margin: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#dashboard-widgets a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#dashboard-widgets h3 a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#dashboard-widgets h3 .postbox-title-action {
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#dashboard-widgets h4 {
|
||||
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
font-size: 13px;
|
||||
margin: 0 0 .2em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Right Now */
|
||||
|
||||
#dashboard_right_now p.sub,
|
||||
#dashboard_right_now .table, #dashboard_right_now .versions {
|
||||
margin: -12px;
|
||||
}
|
||||
|
||||
#dashboard_right_now .inside {
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#dashboard_right_now p.sub {
|
||||
font-style: italic;
|
||||
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
padding: 5px 10px 15px;
|
||||
color: #777;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
#dashboard_right_now .table {
|
||||
background: #f9f9f9;
|
||||
border-top: #ececec 1px solid;
|
||||
border-bottom: #ececec 1px solid;
|
||||
margin: 0 -9px 10px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
#dashboard_right_now table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#dashboard_right_now table td {
|
||||
border-top: #ececec 1px solid;
|
||||
padding: 3px 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#dashboard_right_now table tr.first td {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
#dashboard_right_now td.b {
|
||||
padding-right: 6px;
|
||||
text-align: right;
|
||||
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#dashboard_right_now td.b a {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
#dashboard_right_now td.b a:hover {
|
||||
color: #d54e21;
|
||||
}
|
||||
|
||||
#dashboard_right_now .t {
|
||||
font-size: 12px;
|
||||
padding-right: 12px;
|
||||
padding-top: 6px;
|
||||
color: #777;
|
||||
}
|
||||
|
||||
#dashboard_right_now .t a {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#dashboard_right_now td.first,
|
||||
#dashboard_right_now td.last {
|
||||
width: 1%;
|
||||
}
|
||||
|
||||
#dashboard_right_now .spam {
|
||||
color: red;
|
||||
}
|
||||
|
||||
#dashboard_right_now .waiting {
|
||||
color: #e66f00;
|
||||
}
|
||||
|
||||
#dashboard_right_now .approved {
|
||||
color: green;
|
||||
}
|
||||
|
||||
#dashboard_right_now .versions {
|
||||
padding: 6px 10px 12px;
|
||||
}
|
||||
|
||||
#dashboard_right_now .versions .b {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#dashboard_right_now a.button {
|
||||
float: right;
|
||||
clear: right;
|
||||
position: relative;
|
||||
top: -5px;
|
||||
}
|
||||
|
||||
/* Recent Comments */
|
||||
|
||||
#dashboard_recent_comments h3 {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#dashboard_recent_comments .inside {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
#dashboard_recent_comments .comment-meta .approve {
|
||||
font-style: italic;
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
#the-comment-list {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item {
|
||||
padding: 1em 10px;
|
||||
border-top: 1px solid;
|
||||
}
|
||||
|
||||
#the-comment-list .pingback {
|
||||
padding-left: 9px !important;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item,
|
||||
#the-comment-list #replyrow {
|
||||
margin: 0 -10px;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item .avatar {
|
||||
float: left;
|
||||
margin: 0 10px 5px 0;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item h4 {
|
||||
line-height: 1.4;
|
||||
margin-top: -.2em;
|
||||
font-weight: normal;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item h4 cite {
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item blockquote,
|
||||
#the-comment-list .comment-item blockquote p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
#dashboard_recent_comments #the-comment-list .trackback blockquote,
|
||||
#dashboard_recent_comments #the-comment-list .pingback blockquote {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item p.row-actions {
|
||||
margin: 3px 0 0;
|
||||
padding: 0;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
/* QuickPress */
|
||||
|
||||
#dashboard_quick_press h4 {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
float: left;
|
||||
width: 5.5em;
|
||||
clear: both;
|
||||
font-weight: normal;
|
||||
text-align: right;
|
||||
padding-top: 5px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#dashboard_quick_press h4 label {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#dashboard_quick_press .input-text-wrap,
|
||||
#dashboard_quick_press .textarea-wrap {
|
||||
margin: 0 0 1em 5em;
|
||||
}
|
||||
|
||||
#dashboard_quick_press #media-buttons {
|
||||
margin: 0 0 .5em 5em;
|
||||
padding: 0 0 0 10px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
#dashboard_quick_press #media-buttons a {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
#dashboard-widgets #dashboard_quick_press form p.submit {
|
||||
margin-left: 4.6em;
|
||||
}
|
||||
|
||||
#dashboard-widgets #dashboard_quick_press form p.submit input {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#dashboard-widgets #dashboard_quick_press form p.submit #save-post {
|
||||
margin: 0 1em 0 10px;
|
||||
}
|
||||
|
||||
#dashboard-widgets #dashboard_quick_press form p.submit #publish {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* Recent Drafts */
|
||||
#dashboard_recent_drafts ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#dashboard_recent_drafts ul li {
|
||||
margin-bottom: 0.6em;
|
||||
}
|
||||
|
||||
#dashboard_recent_drafts h4 {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#dashboard_recent_drafts h4 abbr {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
font-size: 11px;
|
||||
color: #999;
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
#dashboard_recent_drafts p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Feeds */
|
||||
|
||||
.rss-widget ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
a.rsswidget {
|
||||
font-size: 13px;
|
||||
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
line-height: 1.7em;
|
||||
}
|
||||
|
||||
.rss-widget ul li {
|
||||
line-height: 1.5em;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.rss-widget span.rss-date {
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.rss-widget cite {
|
||||
display: block;
|
||||
text-align: right;
|
||||
margin: 0 0 1em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.rss-widget cite:before {
|
||||
content: '\2014';
|
||||
}
|
||||
|
||||
/* Plugins */
|
||||
|
||||
#dashboard_plugins h4 {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
}
|
||||
|
||||
#dashboard_plugins h5 {
|
||||
font-family: Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
font-size: 13px !important;
|
||||
margin: 0;
|
||||
display: inline;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
#dashboard_plugins h5 a {
|
||||
font-weight: normal;
|
||||
line-height: 1.7em;
|
||||
}
|
||||
|
||||
#dashboard_plugins p {
|
||||
margin: 0 0 1.4em;
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
.dashboard-comment-wrap {
|
||||
overflow: hidden;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.farbtastic .color, .farbtastic .overlay {
|
||||
left: 0;
|
||||
right: 47px;
|
||||
}
|
||||
.farbtastic .marker {
|
||||
margin: -8px -8px 0 0;
|
||||
}
|
||||
.farbtastic .color, .farbtastic .overlay {
|
||||
left: 0;
|
||||
right: 47px;
|
||||
}
|
||||
.farbtastic .marker {
|
||||
margin: -8px -8px 0 0;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
margin-right:-160px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
body.folded #adminmenu {
|
||||
div.folded #adminmenu {
|
||||
margin-left: 0;
|
||||
margin-right: -45px;
|
||||
}
|
||||
@@ -14,19 +14,16 @@ body.folded #adminmenu {
|
||||
float: left;
|
||||
clear: left;
|
||||
}
|
||||
|
||||
.has-right-sidebar #post-body {
|
||||
clear:right;
|
||||
float:right;
|
||||
margin-right:0;
|
||||
margin-left:-340px;
|
||||
.has-sidebar {
|
||||
float: right;
|
||||
clear: right;
|
||||
margin-right: 0;
|
||||
margin-left: -340px;
|
||||
}
|
||||
|
||||
.has-right-sidebar #post-body-content {
|
||||
margin-left: 300px;
|
||||
margin-right:0;
|
||||
.has-sidebar .has-sidebar-content {
|
||||
margin-right: 0;
|
||||
margin-left: 305px;
|
||||
}
|
||||
|
||||
#wpbody {
|
||||
margin-left:0;
|
||||
margin-right: 175px;
|
||||
@@ -75,8 +72,3 @@ body, td, textarea, input, select {
|
||||
.updated, .error {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.screen-reader-text, .screen-reader-text span {
|
||||
left:auto;
|
||||
text-indent:-1000em;
|
||||
}
|
||||
@@ -1 +1,455 @@
|
||||
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;background:transparent;}body{line-height:1;}ol,ul{list-style:none;}blockquote,q{quotes:none;}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none;}ins{text-decoration:none;}del{text-decoration:line-through;}#wpwrap{height:auto;min-height:100%;width:100%;}#wpcontent{height:100%;padding-bottom:50px;}#wpbody{clear:both;margin-left:175px;}.folded #wpbody{margin-left:60px;}#wpbody-content{float:left;width:100%;}#adminmenu{float:left;clear:left;width:145px;margin-top:15px;margin-right:5px;margin-bottom:15px;margin-left:-160px;position:relative;padding:0;list-style:none;}.folded #adminmenu{margin-left:-45px;}.folded #adminmenu,.folded #adminmenu li.menu-top{width:28px;}#footer{clear:both;position:relative;width:100%;}.inner-sidebar{float:right;clear:right;display:none;width:281px;position:relative;}.inner-sidebar #side-sortables{width:280px;min-height:300px;}.has-right-sidebar .inner-sidebar{display:block;}.has-right-sidebar #post-body{float:left;clear:left;width:100%;margin-right:-340px;}.has-right-sidebar #post-body-content{margin-right:300px;}#col-container{overflow:hidden;padding:0;margin:0;}#col-left{padding:0;margin:0;overflow:hidden;width:39%;}#col-right{float:right;clear:right;overflow:hidden;padding:0;margin:0;width:59%;}.alignleft{float:left;}.alignright{float:right;}.textleft{text-align:left;}.textright{text-align:right;}.clear{clear:both;}.screen-reader-text,.screen-reader-text span{position:absolute;left:-1000em;height:1px;width:1px;overflow:hidden;}.hidden,.js .closed .inside,.js .hide-if-js,.no-js .hide-if-no-js{display:none;}input[type="text"],input[type="password"],textarea{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}input[type="checkbox"],input[type="radio"]{vertical-align:middle;}html,body{height:100%;}body,td,textarea,input,select{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;font-size:13px;}body,textarea{line-height:1.4em;}input,select{line-height:1em;}p{margin:1em 0;}blockquote{margin:1em;}label{cursor:pointer;}li,dd{margin-bottom:6px;}p,li,dl,dd,dt{line-height:140%;}textarea,input,select{margin:1px;padding:3px;}h1{display:block;font-size:2em;font-weight:bold;margin:.67em 0;}h2{display:block;font-size:1.5em;font-weight:bold;margin:.83em 0;}h3{display:block;font-size:1.17em;font-weight:bold;margin:1em 0;}h4{display:block;font-size:1em;font-weight:bold;margin:1.33em 0;}h5{display:block;font-size:.83em;font-weight:bold;margin:1.67em 0;}h6{display:block;font-size:.67em;font-weight:bold;margin:2.33em 0;}ul.ul-disc{list-style:disc outside;}ul.ul-square{list-style:square outside;}ol.ol-decimal{list-style:decimal outside;}ul.ul-disc,ul.ul-square,ol.ol-decimal{margin-left:1.8em;}ul.ul-disc>li,ul.ul-square>li,ol.ol-decimal>li{margin:0 0 .5em;}.subsubsub{list-style:none;margin:8px 0 5px;padding:0;white-space:nowrap;font-size:11px;float:left;}.subsubsub a{line-height:2;padding:.2em;text-decoration:none;}.subsubsub a .count,.subsubsub a.current .count{color:#999;font-weight:normal;}.subsubsub a.current{font-weight:bold;background:none;border:none;}.subsubsub li{display:inline;margin:0;padding:0;}.widefat{border-width:1px;border-style:solid;border-spacing:0;width:100%;clear:both;margin:0;-moz-border-radius:4px;-khtml-border-radius:4px;-webkit-border-radius:4px;border-radius:4px;}.widefat *{word-wrap:break-word;}.widefat a{text-decoration:none;}.widefat td,.widefat th{border-bottom-width:1px;border-bottom-style:solid;font-size:11px;}.widefat td{padding:3px 7px;vertical-align:top;}.widefat td p,.widefat td ol,.widefat td ul{font-size:11px;}.widefat th{padding:7px 7px 8px;text-align:left;line-height:1.3em;}.widefat th input{margin:0 0 0 8px;padding:0;vertical-align:text-top;}.widefat .check-column{width:2.2em;padding:0;}.widefat tbody th.check-column{padding:7px 0 22px;vertical-align:top;}.widefat .num,.column-comments,.column-links,.column-posts{text-align:center;}.widefat th#comments{vertical-align:middle;}.wrap{margin:0 15px 0 5px;}.updated,.error{border-width:1px;border-style:solid;padding:0 .6em;margin:5px 15px 2px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.updated p,.error p{margin:.5em 0;line-height:1;padding:2px;}.wrap .updated,.wrap .error{margin:5px 0 15px;}.wrap h2{font:italic normal normal 24px/29px Georgia,"Times New Roman","Bitstream Charter",Times,serif;margin:0;padding:14px 15px 3px 0;line-height:35px;text-shadow:rgba(255,255,255,1) 0 1px 0;}.wrap h2.long-header{padding-right:0;}
|
||||
/* http://meyerweb.com/eric/tools/css/reset/ */
|
||||
/* v1.0 | 20080212 */
|
||||
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
/* font-size: 100%;
|
||||
vertical-align: baseline; */
|
||||
background: transparent;
|
||||
}
|
||||
body {
|
||||
line-height: 1;
|
||||
}
|
||||
ol, ul {
|
||||
list-style: none;
|
||||
}
|
||||
blockquote, q {
|
||||
quotes: none;
|
||||
}
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: '';
|
||||
content: none;
|
||||
}
|
||||
|
||||
/* remember to define focus styles! */
|
||||
/*
|
||||
:focus {
|
||||
outline: 0;
|
||||
}
|
||||
*/
|
||||
/* remember to highlight inserts somehow! */
|
||||
ins {
|
||||
text-decoration: none;
|
||||
}
|
||||
del {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
/* tables still need 'cellspacing="0"' in the markup */
|
||||
/*
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
*/
|
||||
/* end reset css */
|
||||
|
||||
|
||||
/* 2 column liquid layout */
|
||||
#wpwrap {
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#wpcontent {
|
||||
height: 100%;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
#wpbody {
|
||||
clear: both;
|
||||
margin-left: 175px;
|
||||
}
|
||||
|
||||
.folded #wpbody {
|
||||
margin-left: 60px;
|
||||
}
|
||||
|
||||
#wpbody-content {
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#adminmenu {
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 145px;
|
||||
margin-top: 15px;
|
||||
margin-right: 5px;
|
||||
margin-bottom: 15px;
|
||||
margin-left: -160px;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.folded #adminmenu {
|
||||
margin-left: -45px;
|
||||
}
|
||||
|
||||
.folded #adminmenu,
|
||||
.folded #adminmenu li.menu-top {
|
||||
width: 28px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
clear: both;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* inner 2 column liquid layout */
|
||||
|
||||
.inner-sidebar {
|
||||
float: right;
|
||||
clear: right;
|
||||
width: 280px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.has-sidebar {
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 100%;
|
||||
margin-right: -340px;
|
||||
}
|
||||
|
||||
.has-sidebar .has-sidebar-content {
|
||||
margin-right: 305px;
|
||||
}
|
||||
|
||||
/* 2 columns main area */
|
||||
|
||||
#col-container {
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#col-left {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
width: 39%;
|
||||
}
|
||||
|
||||
#col-right {
|
||||
float: right;
|
||||
clear: right;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 59%;
|
||||
}
|
||||
|
||||
/* utility classes */
|
||||
.alignleft {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.alignright {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.textleft {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.textright {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.hidden,
|
||||
.closed .inside,
|
||||
.hide-if-no-js {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* include margin and padding in the width calculation of input and textarea */
|
||||
input[type="text"],
|
||||
textarea {
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
-ms-box-sizing: border-box; /* ie8 only */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
/* styles for use by people extending the WordPress interface */
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body,
|
||||
td {
|
||||
font: 13px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
label {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
li,
|
||||
dd {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
p,
|
||||
li,
|
||||
dl,
|
||||
dd,
|
||||
dt {
|
||||
line-height: 140%;
|
||||
}
|
||||
|
||||
textarea,
|
||||
input,
|
||||
select {
|
||||
font: 13px/19px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
margin: 1px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
display: block;
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
margin: .67em 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
display: block;
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
margin: .83em 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
display: block;
|
||||
font-size: 1.17em;
|
||||
font-weight: bold;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
h4 {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
margin: 1.33em 0;
|
||||
}
|
||||
|
||||
h5 {
|
||||
display: block;
|
||||
font-size: 0.83em;
|
||||
font-weight: bold;
|
||||
margin: 1.67em 0;
|
||||
}
|
||||
|
||||
h6 {
|
||||
display: block;
|
||||
font-size: 0.67em;
|
||||
font-weight: bold;
|
||||
margin: 2.33em 0;
|
||||
}
|
||||
|
||||
.subsubsub {
|
||||
list-style: none;
|
||||
margin: 8px 0 5px;
|
||||
padding: 0;
|
||||
white-space: nowrap;
|
||||
font-size: 11px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.subsubsub a {
|
||||
line-height: 2;
|
||||
padding: .2em;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.subsubsub a .count, .subsubsub a.current .count {
|
||||
color: #999;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.subsubsub a.current {
|
||||
font-weight: bold;
|
||||
background: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.subsubsub li {
|
||||
display: inline;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.widefat {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-collapse: separate;
|
||||
border-spacing: 0;
|
||||
width: 100%;
|
||||
clear: both;
|
||||
margin: 0;
|
||||
-moz-border-radius: 4px;
|
||||
-khtml-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.widefat * {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.widefat a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.widefat td,
|
||||
.widefat th {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
font-size: 11px;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
.widefat td {
|
||||
padding: 7px 7px 5px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.widefat thead tr th:first {
|
||||
-moz-border-radius-topleft: 4px;
|
||||
-webkit-border-top-left-radius: 4px;
|
||||
-khtml-border-top-left-radius: 4px;
|
||||
border-top-left-radius: 4px;
|
||||
}
|
||||
|
||||
.widefat thead tr th:last {
|
||||
-moz-border-radius-topright: 4px;
|
||||
-webkit-border-top-right-radius: 4px;
|
||||
-khtml-border-top-right-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
}
|
||||
|
||||
.widefat tfoot tr th:first {
|
||||
-moz-border-radius-bottomleft: 4px;
|
||||
-webkit-border-bottom-left-radius: 4px;
|
||||
-khtml-border-bottom-left-radius: 4px;
|
||||
border-bottom-left-radius: 4px;
|
||||
}
|
||||
|
||||
.widefat tfoot tr th:last {
|
||||
-moz-border-radius-bottomright: 4px;
|
||||
-webkit-border-bottom-right-radius: 4px;
|
||||
-khtml-border-bottom-right-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
}
|
||||
|
||||
.widefat td p {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.widefat th {
|
||||
padding: 7px 7px 8px;
|
||||
text-align: left;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
|
||||
.widefat th input {
|
||||
margin: 0 0 0 8px;
|
||||
padding: 0;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
.widefat .check-column {
|
||||
width: 2.2em;
|
||||
padding: 0;
|
||||
|
||||
}
|
||||
|
||||
.widefat tbody th.check-column {
|
||||
padding: 7px 0 22px;
|
||||
}
|
||||
|
||||
.widefat .num,
|
||||
.column-comments,
|
||||
.column-links,
|
||||
.column-posts,
|
||||
.column-parent {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.widefat th#comments {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
margin: 0 15px 0 5px;
|
||||
}
|
||||
|
||||
.updated,
|
||||
.error {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 0 0.6em;
|
||||
margin: 5px 15px 2px;
|
||||
-moz-border-radius: 3px;
|
||||
-khtml-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.updated p,
|
||||
.error p {
|
||||
margin: 0.5em 0;
|
||||
line-height: 1;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.wrap .updated,
|
||||
.wrap .error {
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.wrap h2 {
|
||||
font: italic normal normal 24px/29px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
margin: 0;
|
||||
padding: 14px 15px 3px 0;
|
||||
line-height: 35px;
|
||||
text-shadow: rgba(255,255,255,1) 0px 1px 0px;
|
||||
}
|
||||
|
||||
.wrap h2.long-header {
|
||||
padding-right: 0;
|
||||
}
|
||||
|
||||
@@ -1,486 +0,0 @@
|
||||
/* http://meyerweb.com/eric/tools/css/reset/ */
|
||||
/* v1.0 | 20080212 */
|
||||
|
||||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, font, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
/* font-size: 100%;
|
||||
vertical-align: baseline; */
|
||||
background: transparent;
|
||||
}
|
||||
body {
|
||||
line-height: 1;
|
||||
}
|
||||
ol, ul {
|
||||
list-style: none;
|
||||
}
|
||||
blockquote, q {
|
||||
quotes: none;
|
||||
}
|
||||
blockquote:before, blockquote:after,
|
||||
q:before, q:after {
|
||||
content: '';
|
||||
content: none;
|
||||
}
|
||||
|
||||
/* remember to define focus styles! */
|
||||
/*
|
||||
:focus {
|
||||
outline: 0;
|
||||
}
|
||||
*/
|
||||
/* remember to highlight inserts somehow! */
|
||||
ins {
|
||||
text-decoration: none;
|
||||
}
|
||||
del {
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
/* tables still need 'cellspacing="0"' in the markup */
|
||||
/*
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
*/
|
||||
/* end reset css */
|
||||
|
||||
|
||||
/* 2 column liquid layout */
|
||||
#wpwrap {
|
||||
height: auto;
|
||||
min-height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#wpcontent {
|
||||
height: 100%;
|
||||
padding-bottom: 50px;
|
||||
}
|
||||
|
||||
#wpbody {
|
||||
clear: both;
|
||||
margin-left: 175px;
|
||||
}
|
||||
|
||||
.folded #wpbody {
|
||||
margin-left: 60px;
|
||||
}
|
||||
|
||||
#wpbody-content {
|
||||
float: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#adminmenu {
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 145px;
|
||||
margin-top: 15px;
|
||||
margin-right: 5px;
|
||||
margin-bottom: 15px;
|
||||
margin-left: -160px;
|
||||
position: relative;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.folded #adminmenu {
|
||||
margin-left: -45px;
|
||||
}
|
||||
|
||||
.folded #adminmenu,
|
||||
.folded #adminmenu li.menu-top {
|
||||
width: 28px;
|
||||
}
|
||||
|
||||
#footer {
|
||||
clear: both;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* inner 2 column liquid layout */
|
||||
.inner-sidebar {
|
||||
float: right;
|
||||
clear: right;
|
||||
display: none;
|
||||
width: 281px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.inner-sidebar #side-sortables {
|
||||
width: 280px;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.has-right-sidebar .inner-sidebar {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.has-right-sidebar #post-body {
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 100%;
|
||||
margin-right: -340px;
|
||||
}
|
||||
|
||||
.has-right-sidebar #post-body-content {
|
||||
margin-right: 300px;
|
||||
}
|
||||
|
||||
/* 2 columns main area */
|
||||
|
||||
#col-container {
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#col-left {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
width: 39%;
|
||||
}
|
||||
|
||||
#col-right {
|
||||
float: right;
|
||||
clear: right;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
width: 59%;
|
||||
}
|
||||
|
||||
/* utility classes */
|
||||
.alignleft {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.alignright {
|
||||
float: right;
|
||||
}
|
||||
|
||||
.textleft {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.textright {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
/* Hide visually but not from screen readers */
|
||||
.screen-reader-text,
|
||||
.screen-reader-text span {
|
||||
position: absolute;
|
||||
left: -1000em;
|
||||
height: 1px;
|
||||
width: 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.hidden,
|
||||
.js .closed .inside,
|
||||
.js .hide-if-js,
|
||||
.no-js .hide-if-no-js {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* include margin and padding in the width calculation of input and textarea */
|
||||
input[type="text"],
|
||||
input[type="password"],
|
||||
textarea {
|
||||
-moz-box-sizing: border-box;
|
||||
-webkit-box-sizing: border-box;
|
||||
-ms-box-sizing: border-box; /* ie8 only */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
input[type="checkbox"],
|
||||
input[type="radio"] {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* styles for use by people extending the WordPress interface */
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body,
|
||||
td,
|
||||
textarea,
|
||||
input,
|
||||
select {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
body,
|
||||
textarea {
|
||||
line-height: 1.4em;
|
||||
}
|
||||
|
||||
input,
|
||||
select {
|
||||
line-height: 1em;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
blockquote {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
label {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
li,
|
||||
dd {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
p,
|
||||
li,
|
||||
dl,
|
||||
dd,
|
||||
dt {
|
||||
line-height: 140%;
|
||||
}
|
||||
|
||||
textarea,
|
||||
input,
|
||||
select {
|
||||
margin: 1px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
h1 {
|
||||
display: block;
|
||||
font-size: 2em;
|
||||
font-weight: bold;
|
||||
margin: .67em 0;
|
||||
}
|
||||
|
||||
h2 {
|
||||
display: block;
|
||||
font-size: 1.5em;
|
||||
font-weight: bold;
|
||||
margin: .83em 0;
|
||||
}
|
||||
|
||||
h3 {
|
||||
display: block;
|
||||
font-size: 1.17em;
|
||||
font-weight: bold;
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
h4 {
|
||||
display: block;
|
||||
font-size: 1em;
|
||||
font-weight: bold;
|
||||
margin: 1.33em 0;
|
||||
}
|
||||
|
||||
h5 {
|
||||
display: block;
|
||||
font-size: 0.83em;
|
||||
font-weight: bold;
|
||||
margin: 1.67em 0;
|
||||
}
|
||||
|
||||
h6 {
|
||||
display: block;
|
||||
font-size: 0.67em;
|
||||
font-weight: bold;
|
||||
margin: 2.33em 0;
|
||||
}
|
||||
|
||||
ul.ul-disc {
|
||||
list-style: disc outside;
|
||||
}
|
||||
|
||||
ul.ul-square {
|
||||
list-style: square outside;
|
||||
}
|
||||
|
||||
ol.ol-decimal {
|
||||
list-style: decimal outside;
|
||||
}
|
||||
|
||||
ul.ul-disc,
|
||||
ul.ul-square,
|
||||
ol.ol-decimal {
|
||||
margin-left: 1.8em;
|
||||
}
|
||||
|
||||
ul.ul-disc > li,
|
||||
ul.ul-square > li,
|
||||
ol.ol-decimal > li {
|
||||
margin: 0 0 0.5em;
|
||||
}
|
||||
|
||||
.subsubsub {
|
||||
list-style: none;
|
||||
margin: 8px 0 5px;
|
||||
padding: 0;
|
||||
white-space: nowrap;
|
||||
font-size: 11px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.subsubsub a {
|
||||
line-height: 2;
|
||||
padding: .2em;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.subsubsub a .count, .subsubsub a.current .count {
|
||||
color: #999;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.subsubsub a.current {
|
||||
font-weight: bold;
|
||||
background: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.subsubsub li {
|
||||
display: inline;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.widefat {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-spacing: 0;
|
||||
width: 100%;
|
||||
clear: both;
|
||||
margin: 0;
|
||||
-moz-border-radius: 4px;
|
||||
-khtml-border-radius: 4px;
|
||||
-webkit-border-radius: 4px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.widefat * {
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.widefat a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.widefat td,
|
||||
.widefat th {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.widefat td {
|
||||
padding: 3px 7px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.widefat td p,
|
||||
.widefat td ol,
|
||||
.widefat td ul {
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.widefat th {
|
||||
padding: 7px 7px 8px;
|
||||
text-align: left;
|
||||
line-height: 1.3em;
|
||||
}
|
||||
|
||||
.widefat th input {
|
||||
margin: 0 0 0 8px;
|
||||
padding: 0;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
.widefat .check-column {
|
||||
width: 2.2em;
|
||||
padding: 0;
|
||||
|
||||
}
|
||||
|
||||
.widefat tbody th.check-column {
|
||||
padding: 7px 0 22px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.widefat .num,
|
||||
.column-comments,
|
||||
.column-links,
|
||||
.column-posts {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.widefat th#comments {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.wrap {
|
||||
margin: 0 15px 0 5px;
|
||||
}
|
||||
|
||||
.updated,
|
||||
.error {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 0 0.6em;
|
||||
margin: 5px 15px 2px;
|
||||
-moz-border-radius: 3px;
|
||||
-khtml-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.updated p,
|
||||
.error p {
|
||||
margin: 0.5em 0;
|
||||
line-height: 1;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
.wrap .updated,
|
||||
.wrap .error {
|
||||
margin: 5px 0 15px;
|
||||
}
|
||||
|
||||
.wrap h2 {
|
||||
font: italic normal normal 24px/29px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
|
||||
margin: 0;
|
||||
padding: 14px 15px 3px 0;
|
||||
line-height: 35px;
|
||||
text-shadow: rgba(255,255,255,1) 0px 1px 0px;
|
||||
}
|
||||
|
||||
.wrap h2.long-header {
|
||||
padding-right: 0;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ div#dashboard-widgets {
|
||||
padding-right: 0;
|
||||
padding-left: 1px;
|
||||
}
|
||||
.tagchecklist span a {
|
||||
#tagchecklist span a {
|
||||
margin: 4px -9px 0 0;
|
||||
}
|
||||
.widefat th input {
|
||||
@@ -89,7 +89,3 @@ p.submit { /* quick edit and reply in edit-comments.php */
|
||||
form#widgets-filter { /* fix widget page */
|
||||
position: static;
|
||||
}
|
||||
|
||||
* html .meta-box-sortables .postbox .handlediv {
|
||||
background: transparent url(../images/menu-bits-rtl-vs.gif) no-repeat scroll right -111px;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,8 @@ input.button-highlighted {
|
||||
}
|
||||
|
||||
#minor-publishing-actions input,
|
||||
#major-publishing-actions input {
|
||||
#major-publishing-actions input,
|
||||
#minor-publishing-actions .preview {
|
||||
min-width: auto;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
@@ -21,17 +22,8 @@ input.button-highlighted {
|
||||
margin-bottom: -1px;
|
||||
}
|
||||
|
||||
* html .meta-box-sortables .postbox .handlediv {
|
||||
background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;
|
||||
}
|
||||
|
||||
* html .edit-box {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
* html .inner-sidebar #side-sortables,
|
||||
* html .postbox-container .meta-box-sortables {
|
||||
height: 300px;
|
||||
* html #side-info-column {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
* html #wpbody-content #screen-options-link-wrap {
|
||||
@@ -46,11 +38,21 @@ input.button-highlighted {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/*
|
||||
* html body.minwidth {
|
||||
_width: expression(document.documentElement.clientWidth < 810 ? "808px" : "99.9%");
|
||||
}
|
||||
|
||||
* html #wpbody {
|
||||
_width: expression(document.documentElement.clientWidth > 982 ? "980px" : "99.9%");
|
||||
}
|
||||
*/
|
||||
|
||||
* html #adminmenu {
|
||||
margin-left: -80px;
|
||||
}
|
||||
|
||||
* html .folded #adminmenu {
|
||||
* html div.folded #adminmenu {
|
||||
margin-left: -22px;
|
||||
}
|
||||
|
||||
@@ -60,13 +62,8 @@ input.button-highlighted {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
* html #footer {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.folded #adminmenu li.menu-top {
|
||||
#wpcontent.folded #adminmenu li.menu-top {
|
||||
display: block;
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
ul#adminmenu {
|
||||
@@ -109,7 +106,7 @@ ul#adminmenu {
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
.folded #adminmenu li.wp-menu-separator {
|
||||
#wpcontent.folded #adminmenu li.wp-menu-separator {
|
||||
width: 28px;
|
||||
}
|
||||
|
||||
@@ -118,7 +115,7 @@ ul#adminmenu {
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
.folded #adminmenu .menu-top {
|
||||
#wpcontent.folded #adminmenu .menu-top {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
@@ -129,8 +126,7 @@ ul#adminmenu {
|
||||
#template,
|
||||
#template div,
|
||||
#editcat,
|
||||
#addcat,
|
||||
* html .stuffbox h3 {
|
||||
#addcat {
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
@@ -196,6 +192,11 @@ input {
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item,
|
||||
ul#widget-list li.widget-list-item {
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
#wphead-info {
|
||||
float: right;
|
||||
}
|
||||
@@ -207,10 +208,9 @@ input {
|
||||
a.button {
|
||||
line-height: 1.4em;
|
||||
margin: 1px;
|
||||
padding: 4px 6px;
|
||||
}
|
||||
|
||||
* html div.widget-liquid-left,
|
||||
* html div.widget-liquid-left-holder,
|
||||
* html div.widget-liquid-right {
|
||||
display: block;
|
||||
position: relative;
|
||||
@@ -230,10 +230,10 @@ a.button {
|
||||
zoom: 100%;
|
||||
}
|
||||
|
||||
#the-comment-list .comment-item,
|
||||
#post-status-info,
|
||||
#wpwrap,
|
||||
#wpcontent,
|
||||
#post,
|
||||
#wrap,
|
||||
#postdivrich,
|
||||
#postdiv,
|
||||
@@ -243,19 +243,16 @@ a.button {
|
||||
#post-body,
|
||||
#editorcontainer,
|
||||
.tablenav,
|
||||
.widget-liquid-left,
|
||||
.widget-liquid-right,
|
||||
#widgets-left,
|
||||
.widgets-sortables,
|
||||
.widget-control-list,
|
||||
li.widget-list-control-item,
|
||||
#dragHelper,
|
||||
.widget .widget-top,
|
||||
.widget,
|
||||
li.widget-list-control-item h4,
|
||||
.widget-sortable,
|
||||
.widget-control-actions,
|
||||
.tagchecklist,
|
||||
#tagchecklist,
|
||||
#col-container,
|
||||
#col-left,
|
||||
#col-right,
|
||||
.fileedit-sub {
|
||||
#col-right {
|
||||
display: block;
|
||||
zoom: 100%;
|
||||
}
|
||||
@@ -304,12 +301,12 @@ div#dashboard-widgets {
|
||||
padding-right: 1px;
|
||||
}
|
||||
|
||||
.tagchecklist span, .tagchecklist span a {
|
||||
#tagchecklist span, #tagchecklist span a {
|
||||
display: inline-block;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tagchecklist span a {
|
||||
#tagchecklist span a {
|
||||
margin: 4px 0 0 -9px;
|
||||
}
|
||||
|
||||
@@ -325,10 +322,6 @@ div#dashboard-widgets {
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.tablenav .actions select {
|
||||
width: 155px;
|
||||
}
|
||||
|
||||
table.ie-fixed {
|
||||
table-layout: fixed;
|
||||
}
|
||||
@@ -350,95 +343,7 @@ table.ie-fixed {
|
||||
padding: 4px 0 22px;
|
||||
}
|
||||
|
||||
.widefat {
|
||||
empty-cells: show;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.tablenav a.button-secondary {
|
||||
display: inline-block;
|
||||
padding: 2px 5px;
|
||||
}
|
||||
|
||||
* html .stuffbox,
|
||||
* html .stuffbox input,
|
||||
* html .stuffbox textarea {
|
||||
border: 1px solid #DFDFDF;
|
||||
}
|
||||
|
||||
* html .feature-filter .feature-group li {
|
||||
width: 145px;
|
||||
}
|
||||
|
||||
* html .widget-top .widget-title-action a {
|
||||
background: url("../images/menu-bits.gif") no-repeat scroll 0 -110px;
|
||||
}
|
||||
|
||||
* html div.widget-liquid-left {
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
#wp_inactive_widgets {
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
* html .widgets-sortables {
|
||||
height: 50px;
|
||||
}
|
||||
|
||||
* html a#content_resize {
|
||||
right: -2px;
|
||||
}
|
||||
|
||||
* html .widget-title h4 {
|
||||
width: 205px;
|
||||
}
|
||||
|
||||
* html #removing-widget .in-widget-title {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#available-widgets .widget-holder {
|
||||
padding-bottom: 65px;
|
||||
}
|
||||
|
||||
#widgets-left .inactive {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.widget-liquid-right .widget,
|
||||
#wp_inactive_widgets .widget {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
* html .media-item .pinkynail {
|
||||
height: 32px;
|
||||
width: 40px;
|
||||
}
|
||||
|
||||
#wpcontent .button-primary-disabled {
|
||||
color: #9FD0D5;
|
||||
background: #298CBA;
|
||||
}
|
||||
|
||||
#wpcontent #ajax-loading {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
* html .describe .field input.text,
|
||||
* html .describe .field textarea {
|
||||
width: 440px;
|
||||
}
|
||||
|
||||
#the-comment-list .unapproved tr,
|
||||
#the-comment-list .unapproved td {
|
||||
background-color: #ffffe0;
|
||||
}
|
||||
|
||||
.imgedit-submit {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
* html input {
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
@@ -1 +1,133 @@
|
||||
html{background:#f7f7f7;}body{background:#fff;color:#333;font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;margin:2em auto 0 auto;width:700px;padding:1em 2em;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;border:1px solid #dfdfdf;}a{color:#2583ad;text-decoration:none;}a:hover{color:#d54e21;}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,"Times New Roman",Times,serif;margin:5px 0 0 -4px;padding:0;padding-bottom:7px;}h2{font-size:16px;}p,li{padding-bottom:2px;font-size:12px;line-height:18px;}code{font-size:13px;}ul,ol{padding:5px 5px 5px 22px;}#logo{margin:6px 0 14px 0;border-bottom:none;}.step{margin:20px 0 15px;}.step,th{text-align:left;padding:0;}.submit input,.button,.button-secondary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-moz-border-radius:15px;-khtml-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}.button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}.form-table{border-collapse:collapse;margin-top:1em;width:100%;}.form-table td{margin-bottom:9px;padding:10px;border-bottom:8px solid #fff;font-size:12px;}.form-table th{font-size:13px;text-align:left;padding:16px 10px 10px 10px;border-bottom:8px solid #fff;width:110px;vertical-align:top;}.form-table tr{background:#f3f3f3;}.form-table code{line-height:18px;font-size:18px;}.form-table p{margin:4px 0 0 0;font-size:11px;}.form-table input{line-height:20px;font-size:15px;padding:2px;}#error-page{margin-top:50px;}#error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}#error-page code{font-family:Consolas,Monaco,Courier,monospace;}
|
||||
html { background: #f7f7f7; }
|
||||
|
||||
body {
|
||||
background: #fff;
|
||||
color: #333;
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
margin: 2em auto 0 auto;
|
||||
width: 700px;
|
||||
padding: 1em 2em;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 11px;
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
a { color: #2583ad; text-decoration: none; }
|
||||
|
||||
a:hover { color: #d54e21; }
|
||||
|
||||
h1 {
|
||||
border-bottom: 1px solid #dadada;
|
||||
clear: both;
|
||||
color: #666;
|
||||
font: 24px Georgia, "Times New Roman", Times, serif;
|
||||
margin: 5px 0 0 -4px;
|
||||
padding: 0;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
h2 { font-size: 16px; }
|
||||
|
||||
p, li {
|
||||
padding-bottom: 2px;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
code { font-size: 13px; }
|
||||
|
||||
ul, ol { padding: 5px 5px 5px 22px; }
|
||||
|
||||
#logo { margin: 6px 0 14px 0; border-bottom: none;}
|
||||
|
||||
.step {
|
||||
margin: 20px 0 15px;
|
||||
}
|
||||
|
||||
.step, th { text-align: left; padding: 0; }
|
||||
|
||||
.submit input, .button, .button-secondary {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
text-decoration: none;
|
||||
font-size: 14px !important;
|
||||
line-height: 16px;
|
||||
padding: 6px 12px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #bbb;
|
||||
color: #464646;
|
||||
-moz-border-radius: 15px;
|
||||
-khtml-border-radius: 15px;
|
||||
-webkit-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box;
|
||||
-khtml-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.button:hover, .button-secondary:hover, .submit input:hover {
|
||||
color: #000;
|
||||
border-color: #666;
|
||||
}
|
||||
|
||||
.button, .submit input, .button-secondary {
|
||||
background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
|
||||
}
|
||||
|
||||
.button:active, .submit input:active, .button-secondary:active {
|
||||
background: #eee url(../images/white-grad-active.png) repeat-x scroll left top;
|
||||
}
|
||||
|
||||
.form-table {
|
||||
border-collapse: collapse;
|
||||
margin-top: 1em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.form-table td {
|
||||
margin-bottom: 9px;
|
||||
padding: 10px;
|
||||
border-bottom: 8px solid #fff;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.form-table th {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
padding: 16px 10px 10px 10px;
|
||||
border-bottom: 8px solid #fff;
|
||||
width: 110px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.form-table tr {
|
||||
background: #f3f3f3;
|
||||
}
|
||||
|
||||
.form-table code {
|
||||
line-height: 18px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.form-table p {
|
||||
margin: 4px 0 0 0;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.form-table input {
|
||||
line-height: 20px;
|
||||
font-size: 15px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
#error-page { margin-top: 50px; }
|
||||
|
||||
#error-page p {
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
margin: 25px 0 20px;
|
||||
}
|
||||
|
||||
#error-page code { font-family: Consolas, Monaco, Courier, monospace; }
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
html { background: #f7f7f7; }
|
||||
|
||||
body {
|
||||
background: #fff;
|
||||
color: #333;
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
margin: 2em auto 0 auto;
|
||||
width: 700px;
|
||||
padding: 1em 2em;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 11px;
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
a { color: #2583ad; text-decoration: none; }
|
||||
|
||||
a:hover { color: #d54e21; }
|
||||
|
||||
h1 {
|
||||
border-bottom: 1px solid #dadada;
|
||||
clear: both;
|
||||
color: #666;
|
||||
font: 24px Georgia, "Times New Roman", Times, serif;
|
||||
margin: 5px 0 0 -4px;
|
||||
padding: 0;
|
||||
padding-bottom: 7px;
|
||||
}
|
||||
|
||||
h2 { font-size: 16px; }
|
||||
|
||||
p, li {
|
||||
padding-bottom: 2px;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
code { font-size: 13px; }
|
||||
|
||||
ul, ol { padding: 5px 5px 5px 22px; }
|
||||
|
||||
#logo { margin: 6px 0 14px 0; border-bottom: none;}
|
||||
|
||||
.step {
|
||||
margin: 20px 0 15px;
|
||||
}
|
||||
|
||||
.step, th { text-align: left; padding: 0; }
|
||||
|
||||
.submit input, .button, .button-secondary {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
text-decoration: none;
|
||||
font-size: 14px !important;
|
||||
line-height: 16px;
|
||||
padding: 6px 12px;
|
||||
cursor: pointer;
|
||||
border: 1px solid #bbb;
|
||||
color: #464646;
|
||||
-moz-border-radius: 15px;
|
||||
-khtml-border-radius: 15px;
|
||||
-webkit-border-radius: 15px;
|
||||
border-radius: 15px;
|
||||
-moz-box-sizing: content-box;
|
||||
-webkit-box-sizing: content-box;
|
||||
-khtml-box-sizing: content-box;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
.button:hover, .button-secondary:hover, .submit input:hover {
|
||||
color: #000;
|
||||
border-color: #666;
|
||||
}
|
||||
|
||||
.button, .submit input, .button-secondary {
|
||||
background: #f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;
|
||||
}
|
||||
|
||||
.button:active, .submit input:active, .button-secondary:active {
|
||||
background: #eee url(../images/white-grad-active.png) repeat-x scroll left top;
|
||||
}
|
||||
|
||||
.form-table {
|
||||
border-collapse: collapse;
|
||||
margin-top: 1em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.form-table td {
|
||||
margin-bottom: 9px;
|
||||
padding: 10px;
|
||||
border-bottom: 8px solid #fff;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.form-table th {
|
||||
font-size: 13px;
|
||||
text-align: left;
|
||||
padding: 16px 10px 10px 10px;
|
||||
border-bottom: 8px solid #fff;
|
||||
width: 110px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.form-table tr {
|
||||
background: #f3f3f3;
|
||||
}
|
||||
|
||||
.form-table code {
|
||||
line-height: 18px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.form-table p {
|
||||
margin: 4px 0 0 0;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.form-table input {
|
||||
line-height: 20px;
|
||||
font-size: 15px;
|
||||
padding: 2px;
|
||||
}
|
||||
|
||||
#error-page { margin-top: 50px; }
|
||||
|
||||
#error-page p {
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
margin: 25px 0 20px;
|
||||
}
|
||||
|
||||
#error-page code { font-family: Consolas, Monaco, Courier, monospace; }
|
||||
@@ -1 +1,107 @@
|
||||
*{margin:0;padding:0;}body{border-top-width:30px;border-top-style:solid;font:11px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;}form{margin-left:8px;padding:16px 16px 40px 16px;font-weight:normal;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:5px;background:#fff;border:1px solid #e5e5e5;-moz-box-shadow:rgba(200,200,200,1) 0 4px 18px;-webkit-box-shadow:rgba(200,200,200,1) 0 4px 18px;-khtml-box-shadow:rgba(200,200,200,1) 0 4px 18px;box-shadow:rgba(200,200,200,1) 0 4px 18px;}form .forgetmenot{font-weight:normal;float:left;margin-bottom:0;}.button-primary{font-family:"Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;padding:3px 10px;border:none;font-size:12px;border-width:1px;border-style:solid;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;cursor:pointer;text-decoration:none;margin-top:-3px;}#login form p{margin-bottom:0;}label{color:#777;font-size:13px;}form .forgetmenot label{font-size:11px;line-height:19px;}form .submit,.alignright{float:right;}form p{margin-bottom:24px;}h1 a{background:url(../images/logo-login.gif) no-repeat top center;width:326px;height:67px;text-indent:-9999px;overflow:hidden;padding-bottom:15px;display:block;}#nav{text-shadow:rgba(255,255,255,1) 0 1px 0;}#backtoblog a{position:absolute;top:7px;left:15px;text-decoration:none;}#login{width:320px;margin:7em auto;}#login_error,.message{margin:0 0 16px 8px;border-width:1px;border-style:solid;padding:12px;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}#nav{margin:0 0 0 8px;padding:16px;}#user_pass,#user_login,#user_email{font-size:24px;width:97%;padding:3px;margin-top:2px;margin-right:6px;margin-bottom:16px;border:1px solid #e5e5e5;background:#fbfbfb;}input{color:#555;}.clear{clear:both;}
|
||||
* { margin: 0; padding: 0; }
|
||||
|
||||
body {
|
||||
border-top-width: 30px;
|
||||
border-top-style: solid;
|
||||
font: 11px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
}
|
||||
|
||||
form {
|
||||
margin-left: 8px;
|
||||
padding: 16px 16px 40px 16px;
|
||||
font-weight: normal;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 5px;
|
||||
background: #fff;
|
||||
border: 1px solid #e5e5e5;
|
||||
-moz-box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
-webkit-box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
-khtml-box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
}
|
||||
|
||||
form .forgetmenot { font-weight: normal; float: left; margin-bottom: 0; }
|
||||
|
||||
#login form .submit input {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
padding: 3px 10px;
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 11px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
margin-top: -3px;
|
||||
text-shadow: rgba(0,0,0,0.3) 0 -1px 0;
|
||||
}
|
||||
|
||||
#login form p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
color: #777;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
form .forgetmenot label {
|
||||
font-size: 11px;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
form .submit { float: right; }
|
||||
|
||||
form p { margin-bottom: 24px; }
|
||||
|
||||
h1 a {
|
||||
background: url(../images/logo-login.gif) no-repeat top center;
|
||||
width: 326px;
|
||||
height: 67px;
|
||||
text-indent: -9999px;
|
||||
overflow: hidden;
|
||||
padding-bottom: 15px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#nav {
|
||||
text-shadow: rgba(255,255,255,1) 0 1px 0;
|
||||
}
|
||||
|
||||
#backtoblog a {
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
left: 15px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#login { width: 320px; margin: 7em auto; }
|
||||
|
||||
#login_error, .message {
|
||||
margin: 0 0 16px 8px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 12px;
|
||||
-moz-border-radius: 3px;
|
||||
-khtml-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#nav { margin: 0 0 0 8px; padding: 16px; }
|
||||
|
||||
#user_pass, #user_login, #user_email {
|
||||
font-size: 24px;
|
||||
width: 97%;
|
||||
padding: 3px;
|
||||
margin-top: 2px;
|
||||
margin-right: 6px;
|
||||
margin-bottom: 16px;
|
||||
border: 1px solid #e5e5e5;
|
||||
background: #fbfbfb;
|
||||
}
|
||||
|
||||
@@ -1,129 +0,0 @@
|
||||
* { margin: 0; padding: 0; }
|
||||
|
||||
body {
|
||||
border-top-width: 30px;
|
||||
border-top-style: solid;
|
||||
font: 11px "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
}
|
||||
|
||||
form {
|
||||
margin-left: 8px;
|
||||
padding: 16px 16px 40px 16px;
|
||||
font-weight: normal;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 5px;
|
||||
background: #fff;
|
||||
border: 1px solid #e5e5e5;
|
||||
-moz-box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
-webkit-box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
-khtml-box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
box-shadow: rgba(200,200,200,1) 0 4px 18px;
|
||||
}
|
||||
|
||||
form .forgetmenot {
|
||||
font-weight: normal;
|
||||
float: left;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.button-primary {
|
||||
font-family: "Lucida Grande", Verdana, Arial, "Bitstream Vera Sans", sans-serif;
|
||||
padding: 3px 10px;
|
||||
border: none;
|
||||
font-size: 12px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 11px;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
margin-top: -3px;
|
||||
}
|
||||
|
||||
#login form p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
label {
|
||||
color: #777;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
form .forgetmenot label {
|
||||
font-size: 11px;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
form .submit,
|
||||
.alignright {
|
||||
float: right;
|
||||
}
|
||||
|
||||
form p {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
h1 a {
|
||||
background: url(../images/logo-login.gif) no-repeat top center;
|
||||
width: 326px;
|
||||
height: 67px;
|
||||
text-indent: -9999px;
|
||||
overflow: hidden;
|
||||
padding-bottom: 15px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#nav {
|
||||
text-shadow: rgba(255,255,255,1) 0 1px 0;
|
||||
}
|
||||
|
||||
#backtoblog a {
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
left: 15px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#login { width: 320px; margin: 7em auto; }
|
||||
|
||||
#login_error,
|
||||
.message {
|
||||
margin: 0 0 16px 8px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 12px;
|
||||
-moz-border-radius: 3px;
|
||||
-khtml-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#nav {
|
||||
margin: 0 0 0 8px;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
#user_pass,
|
||||
#user_login,
|
||||
#user_email {
|
||||
font-size: 24px;
|
||||
width: 97%;
|
||||
padding: 3px;
|
||||
margin-top: 2px;
|
||||
margin-right: 6px;
|
||||
margin-bottom: 16px;
|
||||
border: 1px solid #e5e5e5;
|
||||
background: #fbfbfb;
|
||||
}
|
||||
|
||||
input {
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
@@ -47,7 +47,15 @@ button.dismiss {
|
||||
border-right-style: none;
|
||||
border-left-style: solid;
|
||||
}
|
||||
|
||||
.media-item .pinkynail {
|
||||
float: right;
|
||||
}
|
||||
.describe-toggle-on,
|
||||
.describe-toggle-off {
|
||||
float: left;
|
||||
margin-right: 0;
|
||||
margin-left: 20px;
|
||||
}
|
||||
/* Specific to Uploader */
|
||||
#media-upload .media-upload-form p {
|
||||
margin: 0 0 1em 1em;
|
||||
|
||||
@@ -1 +1,426 @@
|
||||
div#media-upload-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em;}body#media-upload ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px;}div#media-upload-error{margin:1em;font-weight:bold;}form{margin:1em;}#search-filter{text-align:right;}th{position:relative;}.media-upload-form label.form-help,td.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}.media-upload-form p.help{margin:0;padding:0;}.media-upload-form fieldset{width:100%;border:none;text-align:justify;margin:0 0 1em 0;padding:0;}.image-align-none-label{background:url(../images/align-none.png) no-repeat center left;}.image-align-left-label{background:url(../images/align-left.png) no-repeat center left;}.image-align-center-label{background:url(../images/align-center.png) no-repeat center left;}.image-align-right-label{background:url(../images/align-right.png) no-repeat center left;}tr.image-size td{width:460px;}tr.image-size div.image-size-item{float:left;width:25%;margin:0;}#library-form .progress,#gallery-form .progress,#flash-upload-ui,.insert-gallery,.describe.startopen,.describe.startclosed{display:none;}.media-item .thumbnail{max-width:128px;max-height:128px;}thead.media-item-info tr{background-color:transparent;}thead.media-item-info th,thead.media-item-info td{border:none;margin:0;}.form-table thead.media-item-info{border:8px solid #fff;}abbr.required{text-decoration:none;border:none;}.describe label{display:inline;}.describe td{vertical-align:middle;padding:0 5px 8px 0;}.describe td.error{padding:2px 8px;}.describe td.A1{width:132px;}.describe input[type="text"],.describe textarea{width:460px;border-width:1px;border-style:solid;}.hidden{height:0;width:0;overflow:hidden;border:none;}#media-upload p.ml-submit{padding:1em 0;}#media-upload p.help,#media-upload label.help{font-family:"Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;font-style:italic;font-weight:normal;}#media-upload tr.image-size td.field{text-align:center;}#media-upload #media-items{border-width:1px;border-style:solid;border-bottom:none;width:623px;}#media-upload .media-item{border-bottom-width:1px;border-bottom-style:solid;min-height:36px;width:100%;}#media-upload .ui-sortable .media-item{cursor:move;}.filename{line-height:36px;padding:0 10px;overflow:hidden;}#media-upload .describe{padding:5px;width:100%;clear:both;cursor:default;}#media-upload .slidetoggle{border-top-width:1px;border-top-style:solid;}#media-upload .describe th.label{padding-top:.2em;text-align:left;min-width:120px;}#media-upload tr.align td.field{text-align:center;}#media-upload tr.image-size{margin-bottom:1em;height:3em;}#media-upload #filter{width:623px;}#media-upload #filter .subsubsub{margin:8px 0;}#filter .tablenav select{border-style:solid;border-width:1px;padding:2px;vertical-align:top;width:auto;}#media-upload .del-attachment{display:none;margin:5px 0;}.menu_order{float:right;font-size:11px;margin:10px 10px 0;}.menu_order_input{border:1px solid #ddd;font-size:10px;padding:1px;width:23px;}.ui-sortable-helper{background-color:#fff;border:1px solid #aaa;opacity:.6;filter:alpha(opacity=60);}#media-upload th.order-head{width:20%;text-align:center;}#media-upload th.actions-head{width:25%;text-align:center;}#media-upload a.wp-post-thumbnail{margin:0 20px;}#media-items a.delete{display:block;float:right;}#media-upload .widefat{width:626px;border-style:solid solid none;}.sorthelper{height:37px;width:623px;display:block;}#gallery-settings th.label{width:160px;}#gallery-settings #basic th.label{padding:5px 5px 5px 0;}#gallery-settings .title{clear:both;padding:0 0 3px;font-size:1.6em;border-bottom:1px solid #DADADA;}h3.media-title{font-size:1.6em;}h4.media-sub-title{border-bottom:1px solid #DADADA;font-size:1.3em;margin:12px;padding:0 0 3px;}#gallery-settings .title,h3.media-title,h4.media-sub-title{font-family:Georgia,"Times New Roman",Times,serif;font-weight:normal;color:#5A5A5A;}#gallery-settings .describe td{vertical-align:middle;height:3em;}#gallery-settings .describe th.label{padding-top:.5em;text-align:left;}#gallery-settings .describe{padding:5px;width:615px;clear:both;cursor:default;}#gallery-settings .describe select{width:15em;}#gallery-settings .describe select option,#gallery-settings .describe td{padding:0;}#gallery-settings label,#gallery-settings legend{font-size:13px;color:#464646;margin-right:15px;}#gallery-settings .align .field label{margin:0 1.5em 0 0;}#gallery-settings p.ml-submit{border-top:1px solid #dfdfdf;}#gallery-settings select#columns{width:6em;}#sort-buttons{font-size:.8em;margin:3px 25px -8px 0;text-align:right;max-width:625px;}#sort-buttons a{text-decoration:none;}#sort-buttons #asc,#sort-buttons #showall{padding-left:5px;}#sort-buttons span{margin-right:25px;}
|
||||
div#media-upload-header {
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
height: 2.5em;
|
||||
}
|
||||
|
||||
body#media-upload ul#sidemenu {
|
||||
font-weight: normal;
|
||||
margin: 0 5px;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
bottom: -1px;
|
||||
}
|
||||
|
||||
div#media-upload-error {
|
||||
margin: 1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
form {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
#search-filter {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.media-upload-form label,
|
||||
.media-upload-form legend {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
font-size: 13px;
|
||||
margin-bottom: 0.5em;
|
||||
margin: 0 0 0.5em 0;
|
||||
}
|
||||
|
||||
th {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.media-upload-form label.form-help, td.help {
|
||||
font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.media-upload-form p.help {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.media-upload-form fieldset {
|
||||
width: 100%;
|
||||
border: none;
|
||||
text-align: justify;
|
||||
margin: 0 0 1em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* specific to the image upload form */
|
||||
.align .field label {
|
||||
display: inline;
|
||||
padding: 0 0 0 28px;
|
||||
margin: 0 1em 0 0;
|
||||
}
|
||||
|
||||
.image-align-none-label {
|
||||
background: url(../images/align-none.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-left-label {
|
||||
background: url(../images/align-left.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-center-label {
|
||||
background: url(../images/align-center.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-right-label {
|
||||
background: url(../images/align-right.png) no-repeat center left;
|
||||
}
|
||||
|
||||
tr.image-size td {
|
||||
width: 460px;
|
||||
}
|
||||
|
||||
tr.image-size div.image-size-item {
|
||||
float: left;
|
||||
width: 25%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
tr.image-size label {
|
||||
display: inline;
|
||||
margin: 0 0 0 1em;
|
||||
}
|
||||
|
||||
.pinkynail {
|
||||
max-width: 40px;
|
||||
max-height: 40px;
|
||||
}
|
||||
|
||||
.filename.original {
|
||||
float: left;
|
||||
}
|
||||
|
||||
.crunching {
|
||||
display: block;
|
||||
line-height: 32px;
|
||||
text-align: right;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
button.dismiss {
|
||||
position: absolute;
|
||||
top: 7px;
|
||||
right: 5px;
|
||||
z-index: 4;
|
||||
width: 8em;
|
||||
}
|
||||
|
||||
.file-error {
|
||||
float: left;
|
||||
font-weight: bold;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.progress {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 623px;
|
||||
height: 36px;
|
||||
}
|
||||
|
||||
.bar {
|
||||
width: 0;
|
||||
height: 100%;
|
||||
border-right-width: 3px;
|
||||
border-right-style: solid;
|
||||
}
|
||||
|
||||
#library-form .progress,
|
||||
#gallery-form .progress,
|
||||
#flash-upload-ui,
|
||||
.insert-gallery,
|
||||
.describe.startopen,
|
||||
.describe.startclosed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.media-item .thumbnail {
|
||||
max-width: 128px;
|
||||
max-height: 128px;
|
||||
}
|
||||
|
||||
.media-item .pinkynail {
|
||||
float: left;
|
||||
margin: 2px;
|
||||
height: 32px;
|
||||
max-width: 40px;
|
||||
}
|
||||
|
||||
thead.media-item-info tr {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
thead.media-item-info th,
|
||||
thead.media-item-info td {
|
||||
border: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.form-table thead.media-item-info {
|
||||
border: 8px solid #fff;
|
||||
}
|
||||
|
||||
abbr.required {
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.describe label {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.describe td {
|
||||
vertical-align: middle;
|
||||
padding: 0 5px 0 0;
|
||||
}
|
||||
|
||||
.describe td.A1 {
|
||||
width: 132px;
|
||||
}
|
||||
|
||||
.describe input[type="text"],
|
||||
.describe textarea {
|
||||
width: 460px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.describe-toggle-on,
|
||||
.describe-toggle-off {
|
||||
display: block;
|
||||
line-height: 36px;
|
||||
float: right;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.describe-toggle-off {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
height: 0;
|
||||
width: 0;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* Specific to Uploader */
|
||||
|
||||
#media-upload .media-upload-form p {
|
||||
margin: 0 1em 1em 0;
|
||||
}
|
||||
|
||||
#media-upload .media-upload-form p.ml-submit {
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
#media-upload p.help,
|
||||
#media-upload label.help {
|
||||
font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#media-upload tr.image-size td.field {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload #media-items {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-bottom: none;
|
||||
width: 623px;
|
||||
}
|
||||
|
||||
#media-upload .media-item {
|
||||
position: relative;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
min-height: 36px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#media-upload .ui-sortable .media-item {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.filename {
|
||||
float: left;
|
||||
line-height: 36px;
|
||||
margin-left: 10px;
|
||||
overflow: hidden;
|
||||
max-width: 430px;
|
||||
}
|
||||
|
||||
#media-upload .describe {
|
||||
padding: 5px;
|
||||
width: 100%;
|
||||
clear: both;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#media-upload .slidetoggle {
|
||||
border-top-width: 1px;
|
||||
border-top-style: solid;
|
||||
}
|
||||
|
||||
#media-upload .describe th.label {
|
||||
padding-top: .5em;
|
||||
text-align: left;
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
#media-upload tr.align td.field {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload tr.image-size {
|
||||
margin-bottom: 1em;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
#media-upload #filter {
|
||||
width: 623px;
|
||||
}
|
||||
|
||||
#media-upload #filter .subsubsub {
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
#filter .tablenav select {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding: 2px;
|
||||
vertical-align: top;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#media-upload a.delete,
|
||||
#media-upload a.del-link {
|
||||
padding: 0 3px 1px;
|
||||
}
|
||||
|
||||
#media-upload .del-attachment {
|
||||
display: none;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.menu_order {
|
||||
float: right;
|
||||
font-size: 11px;
|
||||
margin: 10px 10px 0;
|
||||
}
|
||||
|
||||
.menu_order_input {
|
||||
border: 1px solid #ddd;
|
||||
font-size: 10px;
|
||||
padding: 1px;
|
||||
width: 23px;
|
||||
}
|
||||
|
||||
.ui-sortable-helper {
|
||||
background-color: #fff;
|
||||
border: 1px solid #aaa;
|
||||
opacity: 0.6;
|
||||
filter: alpha(opacity=60);
|
||||
}
|
||||
|
||||
#media-upload th.order-head {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload .widefat {
|
||||
width: 626px;
|
||||
border-style: solid solid none;
|
||||
}
|
||||
|
||||
.sorthelper {
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
#gallery-settings th.label {
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
#gallery-settings #basic th.label {
|
||||
padding: 5px 5px 5px 0;
|
||||
}
|
||||
|
||||
#gallery-settings .title {
|
||||
clear: both;
|
||||
padding: 0 0 3px;
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 1px;
|
||||
font-family: Georgia,"Times New Roman",Times,serif;
|
||||
font-size: 1.6em;
|
||||
border-bottom-color: #DADADA;
|
||||
color: #5A5A5A;
|
||||
}
|
||||
|
||||
h3.media-title {
|
||||
color: #5A5A5A;
|
||||
font-family: Georgia,"Times New Roman",Times,serif;
|
||||
font-size: 1.6em;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#gallery-settings .describe td {
|
||||
vertical-align: middle;
|
||||
height: 3.5em;
|
||||
}
|
||||
|
||||
#gallery-settings .describe th.label {
|
||||
padding-top: .5em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#gallery-settings .describe {
|
||||
padding: 5px;
|
||||
width: 615px;
|
||||
clear: both;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#gallery-settings .describe select {
|
||||
width: 15em;
|
||||
border: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
#gallery-settings label,
|
||||
#gallery-settings legend {
|
||||
font-size: 13px;
|
||||
color: #464646;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
#gallery-settings .align .field label {
|
||||
margin: 0 1.5em 0 0;
|
||||
}
|
||||
|
||||
#gallery-settings p.ml-submit {
|
||||
border-top: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
#gallery-settings select#columns {
|
||||
width: 6em;
|
||||
}
|
||||
|
||||
@@ -1,384 +0,0 @@
|
||||
div#media-upload-header {
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
height: 2.5em;
|
||||
}
|
||||
|
||||
body#media-upload ul#sidemenu {
|
||||
font-weight: normal;
|
||||
margin: 0 5px;
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
bottom: -1px;
|
||||
}
|
||||
|
||||
div#media-upload-error {
|
||||
margin: 1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
form {
|
||||
margin: 1em;
|
||||
}
|
||||
|
||||
#search-filter {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
th {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.media-upload-form label.form-help, td.help {
|
||||
font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.media-upload-form p.help {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.media-upload-form fieldset {
|
||||
width: 100%;
|
||||
border: none;
|
||||
text-align: justify;
|
||||
margin: 0 0 1em 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* specific to the image upload form */
|
||||
|
||||
|
||||
.image-align-none-label {
|
||||
background: url(../images/align-none.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-left-label {
|
||||
background: url(../images/align-left.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-center-label {
|
||||
background: url(../images/align-center.png) no-repeat center left;
|
||||
}
|
||||
|
||||
.image-align-right-label {
|
||||
background: url(../images/align-right.png) no-repeat center left;
|
||||
}
|
||||
|
||||
tr.image-size td {
|
||||
width: 460px;
|
||||
}
|
||||
|
||||
tr.image-size div.image-size-item {
|
||||
float: left;
|
||||
width: 25%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#library-form .progress,
|
||||
#gallery-form .progress,
|
||||
#flash-upload-ui,
|
||||
.insert-gallery,
|
||||
.describe.startopen,
|
||||
.describe.startclosed {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.media-item .thumbnail {
|
||||
max-width: 128px;
|
||||
max-height: 128px;
|
||||
}
|
||||
|
||||
thead.media-item-info tr {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
thead.media-item-info th,
|
||||
thead.media-item-info td {
|
||||
border: none;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.form-table thead.media-item-info {
|
||||
border: 8px solid #fff;
|
||||
}
|
||||
|
||||
abbr.required {
|
||||
text-decoration: none;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.describe label {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.describe td {
|
||||
vertical-align: middle;
|
||||
padding: 0 5px 8px 0;
|
||||
}
|
||||
|
||||
.describe td.error {
|
||||
padding: 2px 8px;
|
||||
}
|
||||
|
||||
.describe td.A1 {
|
||||
width: 132px;
|
||||
}
|
||||
|
||||
.describe input[type="text"],
|
||||
.describe textarea {
|
||||
width: 460px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
height: 0;
|
||||
width: 0;
|
||||
overflow: hidden;
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* Specific to Uploader */
|
||||
|
||||
#media-upload p.ml-submit {
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
#media-upload p.help,
|
||||
#media-upload label.help {
|
||||
font-family: "Lucida Grande", "Bitstream Vera Sans", Verdana, Arial, sans-serif;
|
||||
font-style: italic;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
#media-upload tr.image-size td.field {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload #media-items {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-bottom: none;
|
||||
width: 623px;
|
||||
}
|
||||
|
||||
#media-upload .media-item {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
min-height: 36px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#media-upload .ui-sortable .media-item {
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
.filename {
|
||||
line-height: 36px;
|
||||
padding: 0 10px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#media-upload .describe {
|
||||
padding: 5px;
|
||||
width: 100%;
|
||||
clear: both;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#media-upload .slidetoggle {
|
||||
border-top-width: 1px;
|
||||
border-top-style: solid;
|
||||
}
|
||||
|
||||
#media-upload .describe th.label {
|
||||
padding-top: .2em;
|
||||
text-align: left;
|
||||
min-width: 120px;
|
||||
}
|
||||
|
||||
#media-upload tr.align td.field {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload tr.image-size {
|
||||
margin-bottom: 1em;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
#media-upload #filter {
|
||||
width: 623px;
|
||||
}
|
||||
|
||||
#media-upload #filter .subsubsub {
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
#filter .tablenav select {
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
padding: 2px;
|
||||
vertical-align: top;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
#media-upload .del-attachment {
|
||||
display: none;
|
||||
margin: 5px 0;
|
||||
}
|
||||
|
||||
.menu_order {
|
||||
float: right;
|
||||
font-size: 11px;
|
||||
margin: 10px 10px 0;
|
||||
}
|
||||
|
||||
.menu_order_input {
|
||||
border: 1px solid #ddd;
|
||||
font-size: 10px;
|
||||
padding: 1px;
|
||||
width: 23px;
|
||||
}
|
||||
|
||||
.ui-sortable-helper {
|
||||
background-color: #fff;
|
||||
border: 1px solid #aaa;
|
||||
opacity: 0.6;
|
||||
filter: alpha(opacity=60);
|
||||
}
|
||||
|
||||
#media-upload th.order-head {
|
||||
width: 20%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload th.actions-head {
|
||||
width: 25%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#media-upload a.wp-post-thumbnail {
|
||||
margin: 0 20px;
|
||||
}
|
||||
|
||||
#media-items a.delete {
|
||||
display: block;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#media-upload .widefat {
|
||||
width: 626px;
|
||||
border-style: solid solid none;
|
||||
}
|
||||
|
||||
.sorthelper {
|
||||
height: 37px;
|
||||
width: 623px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#gallery-settings th.label {
|
||||
width: 160px;
|
||||
}
|
||||
|
||||
#gallery-settings #basic th.label {
|
||||
padding: 5px 5px 5px 0;
|
||||
}
|
||||
|
||||
#gallery-settings .title {
|
||||
clear: both;
|
||||
padding: 0 0 3px;
|
||||
font-size: 1.6em;
|
||||
border-bottom: 1px solid #DADADA;
|
||||
}
|
||||
|
||||
h3.media-title {
|
||||
font-size: 1.6em;
|
||||
}
|
||||
|
||||
h4.media-sub-title {
|
||||
border-bottom: 1px solid #DADADA;
|
||||
font-size: 1.3em;
|
||||
margin: 12px;
|
||||
padding: 0 0 3px;
|
||||
}
|
||||
|
||||
#gallery-settings .title,
|
||||
h3.media-title,
|
||||
h4.media-sub-title {
|
||||
font-family: Georgia,"Times New Roman",Times,serif;
|
||||
font-weight: normal;
|
||||
color: #5A5A5A;
|
||||
}
|
||||
|
||||
#gallery-settings .describe td {
|
||||
vertical-align: middle;
|
||||
height: 3em;
|
||||
}
|
||||
|
||||
#gallery-settings .describe th.label {
|
||||
padding-top: .5em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#gallery-settings .describe {
|
||||
padding: 5px;
|
||||
width: 615px;
|
||||
clear: both;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
#gallery-settings .describe select {
|
||||
width: 15em;
|
||||
}
|
||||
|
||||
#gallery-settings .describe select option,
|
||||
#gallery-settings .describe td {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#gallery-settings label,
|
||||
#gallery-settings legend {
|
||||
font-size: 13px;
|
||||
color: #464646;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
#gallery-settings .align .field label {
|
||||
margin: 0 1.5em 0 0;
|
||||
}
|
||||
|
||||
#gallery-settings p.ml-submit {
|
||||
border-top: 1px solid #dfdfdf;
|
||||
}
|
||||
|
||||
#gallery-settings select#columns {
|
||||
width: 6em;
|
||||
}
|
||||
|
||||
#sort-buttons {
|
||||
font-size: 0.8em;
|
||||
margin: 3px 25px -8px 0;
|
||||
text-align: right;
|
||||
max-width: 625px;
|
||||
}
|
||||
|
||||
#sort-buttons a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#sort-buttons #asc,
|
||||
#sort-buttons #showall {
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#sort-buttons span {
|
||||
margin-right: 25px;
|
||||
}
|
||||
@@ -1 +1,149 @@
|
||||
div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.star{height:100%;position:absolute;top:0;left:0;background-color:transparent;letter-spacing:1ex;border:none;}.star1{width:20%;}.star2{width:40%;}.star3{width:60%;}.star4{width:80%;}.star5{width:100%;}.star img,div.star a,div.star a:hover,div.star a:visited{display:block;position:absolute;right:0;border:none;text-decoration:none;}div.star img{width:19px;height:19px;border-left:1px solid #fff;border-right:1px solid #fff;}#plugin-information-header{margin:0;padding:0 5px;font-weight:bold;position:relative;border-bottom-width:1px;border-bottom-style:solid;height:2.5em;}#plugin-information ul#sidemenu{font-weight:normal;margin:0 5px;position:absolute;left:0;bottom:-1px;}#plugin-information p.action-button{width:100%;padding-bottom:0;margin-bottom:0;margin-top:10px;-moz-border-radius:3px 0 0 3px;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}#plugin-information .action-button a{text-align:center;font-weight:bold;text-decoration:none;display:block;line-height:2em;}#plugin-information h2{clear:none!important;margin-right:200px;}#plugin-information .fyi{margin:0 10px 50px;width:210px;}#plugin-information .fyi h2{font-size:.9em;margin-bottom:0;margin-right:0;}#plugin-information .fyi h2.mainheader{padding:5px;-moz-border-radius-topleft:3px;-webkit-border-top-left-radius:3px;-khtml-border-top-left-radius:3px;border-top-left-radius:3px;}#plugin-information .fyi ul{padding:10px 5px 10px 7px;margin:0;list-style:none;-moz-border-radius-bottomleft:3px;-webkit-border-bottom-left-radius:3px;-khtml-border-bottom-left-radius:3px;border-bottom-left-radius:3px;}#plugin-information .fyi li{margin-right:0;}#plugin-information #section-holder{padding:10px;}#plugin-information .section ul,#plugin-information .section ol{margin-left:16px;list-style-type:square;list-style-image:none;}#plugin-information #section-screenshots li img{vertical-align:text-top;}#plugin-information #section-screenshots li p{font-style:italic;padding-left:20px;padding-bottom:2em;}#plugin-information .updated,#plugin-information pre{margin-right:215px;}#plugin-information pre{padding:7px;}
|
||||
/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */
|
||||
div.star-holder {
|
||||
position: relative;
|
||||
height: 19px;
|
||||
width: 100px;
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
div.star {
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: transparent;
|
||||
letter-spacing: 1ex;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.star1 { width: 20%; }
|
||||
.star2 { width: 40%; }
|
||||
.star3 { width: 60%; }
|
||||
.star4 { width: 80%; }
|
||||
.star5 { width: 100%; }
|
||||
|
||||
.star img, div.star a, div.star a:hover, div.star a:visited {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
div.star img {
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
border-left: 1px solid #fff;
|
||||
border-right: 1px solid #fff;
|
||||
}
|
||||
|
||||
/* Start custom CSS */
|
||||
/* Header on thickbox */
|
||||
#plugin-information-header {
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
height: 2.5em;
|
||||
}
|
||||
#plugin-information ul#sidemenu {
|
||||
font-weight: normal;
|
||||
margin: 0 5px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -1px;
|
||||
}
|
||||
|
||||
/* Install sidemenu */
|
||||
#plugin-information p.action-button {
|
||||
width: 100%;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
margin-top: 10px;
|
||||
-moz-border-radius: 3px 0 0 3px;
|
||||
-webkit-border-top-left-radius: 3px;
|
||||
-khtml-border-top-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
-khtml-border-bottom-left-radius: 3px;
|
||||
border-top-bottom-radius: 3px;
|
||||
}
|
||||
|
||||
#plugin-information .action-button a {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
line-height: 2em;
|
||||
}
|
||||
|
||||
#plugin-information h2 {
|
||||
clear: none !important;
|
||||
margin-right: 200px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi {
|
||||
margin-left: 10px;
|
||||
margin-bottom: 50px;
|
||||
width: 210px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi h2 {
|
||||
font-size: 0.9em;
|
||||
margin-bottom: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#plugin-information .fyi h2.mainheader {
|
||||
padding: 5px;
|
||||
-moz-border-radius-topleft: 3px;
|
||||
-webkit-border-top-left-radius: 3px;
|
||||
-khtml-border-top-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi ul {
|
||||
padding: 10px 5px 10px 7px;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
-moz-border-radius-bottomleft: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
-khtml-border-bottom-left-radius: 3px;
|
||||
border-top-bottom-radius: 3px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi li {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#plugin-information #section-holder {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#plugin-information .section ul,
|
||||
#plugin-information .section ol {
|
||||
margin-left: 16px;
|
||||
list-style-type: square;
|
||||
list-style-image: none;
|
||||
}
|
||||
|
||||
#plugin-information #section-screenshots li img {
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
#plugin-information #section-screenshots li p {
|
||||
font-style: italic;
|
||||
padding-left: 20px;
|
||||
padding-bottom: 2em;
|
||||
}
|
||||
|
||||
#plugin-information .updated,
|
||||
#plugin-information pre {
|
||||
margin-right: 215px;
|
||||
}
|
||||
|
||||
#plugin-information pre {
|
||||
padding: 7px;
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */
|
||||
div.star-holder {
|
||||
position: relative;
|
||||
height: 19px;
|
||||
width: 100px;
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
div.star {
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: transparent;
|
||||
letter-spacing: 1ex;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.star1 { width: 20%; }
|
||||
.star2 { width: 40%; }
|
||||
.star3 { width: 60%; }
|
||||
.star4 { width: 80%; }
|
||||
.star5 { width: 100%; }
|
||||
|
||||
.star img, div.star a, div.star a:hover, div.star a:visited {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
div.star img {
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
border-left: 1px solid #fff;
|
||||
border-right: 1px solid #fff;
|
||||
}
|
||||
|
||||
/* Start custom CSS */
|
||||
/* Header on thickbox */
|
||||
#plugin-information-header {
|
||||
margin: 0;
|
||||
padding: 0 5px;
|
||||
font-weight: bold;
|
||||
position: relative;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
height: 2.5em;
|
||||
}
|
||||
#plugin-information ul#sidemenu {
|
||||
font-weight: normal;
|
||||
margin: 0 5px;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: -1px;
|
||||
}
|
||||
|
||||
/* Install sidemenu */
|
||||
#plugin-information p.action-button {
|
||||
width: 100%;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 0;
|
||||
margin-top: 10px;
|
||||
-moz-border-radius: 3px 0 0 3px;
|
||||
-webkit-border-top-left-radius: 3px;
|
||||
-khtml-border-top-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
-khtml-border-bottom-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
}
|
||||
|
||||
#plugin-information .action-button a {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
line-height: 2em;
|
||||
}
|
||||
|
||||
#plugin-information h2 {
|
||||
clear: none !important;
|
||||
margin-right: 200px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi {
|
||||
margin: 0 10px 50px;
|
||||
width: 210px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi h2 {
|
||||
font-size: 0.9em;
|
||||
margin-bottom: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#plugin-information .fyi h2.mainheader {
|
||||
padding: 5px;
|
||||
-moz-border-radius-topleft: 3px;
|
||||
-webkit-border-top-left-radius: 3px;
|
||||
-khtml-border-top-left-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi ul {
|
||||
padding: 10px 5px 10px 7px;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
-moz-border-radius-bottomleft: 3px;
|
||||
-webkit-border-bottom-left-radius: 3px;
|
||||
-khtml-border-bottom-left-radius: 3px;
|
||||
border-bottom-left-radius: 3px;
|
||||
}
|
||||
|
||||
#plugin-information .fyi li {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#plugin-information #section-holder {
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
#plugin-information .section ul,
|
||||
#plugin-information .section ol {
|
||||
margin-left: 16px;
|
||||
list-style-type: square;
|
||||
list-style-image: none;
|
||||
}
|
||||
|
||||
#plugin-information #section-screenshots li img {
|
||||
vertical-align: text-top;
|
||||
}
|
||||
|
||||
#plugin-information #section-screenshots li p {
|
||||
font-style: italic;
|
||||
padding-left: 20px;
|
||||
padding-bottom: 2em;
|
||||
}
|
||||
|
||||
#plugin-information .updated,
|
||||
#plugin-information pre {
|
||||
margin-right: 215px;
|
||||
}
|
||||
|
||||
#plugin-information pre {
|
||||
padding: 7px;
|
||||
}
|
||||
@@ -1,26 +1,22 @@
|
||||
body {
|
||||
font-family: Tahoma, Arial;
|
||||
}
|
||||
|
||||
#poststuff #edButtonPreview,
|
||||
#poststuff #edButtonHTML {
|
||||
margin: 0 0 0 5px;
|
||||
margin: 0px 0 0 5px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
/* Editor/Main Column */
|
||||
div#poststuff {
|
||||
padding-left: 0;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
.posting {
|
||||
margin-right: 0;
|
||||
margin-left: 228px;
|
||||
left: auto;
|
||||
left:auto;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
#side-info-column {
|
||||
float: left;
|
||||
right: auto;
|
||||
@@ -28,62 +24,50 @@ div#poststuff {
|
||||
margin-right: 0;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#side-info-column .sleeve {
|
||||
padding-left: 0;
|
||||
padding-right: 10px;
|
||||
}
|
||||
|
||||
h3.tb {
|
||||
margin-left: 0;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#actions {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#extra_fields #actions {
|
||||
right: auto;
|
||||
left: 4px;
|
||||
}
|
||||
|
||||
#actions li {
|
||||
float: right;
|
||||
margin-right: 0;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#extra_fields .button {
|
||||
margin-right: 0;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
/* Photo Styles */
|
||||
#img_container a {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#category-add input, #category-add select {
|
||||
font-family: Tahoma, Arial;
|
||||
}
|
||||
|
||||
#categorydiv ul.categorychecklist ul {
|
||||
margin-left: 0;
|
||||
margin-right: 18px;
|
||||
}
|
||||
|
||||
/* Tags */
|
||||
#tagsdiv #newtag {
|
||||
margin-right: 0;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
#tagadd {
|
||||
margin-left: 0;
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
#tagchecklist span {
|
||||
margin-left: .5em;
|
||||
margin-right: 10px;
|
||||
@@ -93,35 +77,29 @@ h3.tb {
|
||||
margin: 6px -9px 0 0;
|
||||
float: right;
|
||||
}
|
||||
|
||||
#content {
|
||||
margin-left: 0;
|
||||
margin-right: 1%;
|
||||
}
|
||||
|
||||
.submit input,
|
||||
.button,
|
||||
.button-primary,
|
||||
.button-secondary,
|
||||
.button-highlighted,
|
||||
#postcustomstuff .submit input {
|
||||
font-family: Tahoma, Arial, sans-serif;
|
||||
font-family: tahoma;
|
||||
}
|
||||
|
||||
.ac_results li {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#TB_ajaxContent #options {
|
||||
right: auto;
|
||||
left: 25px;
|
||||
}
|
||||
|
||||
#post_status {
|
||||
margin-left: 0;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
#footer {
|
||||
padding: 10px 60px 0 0;
|
||||
|
||||
@@ -1,586 +0,0 @@
|
||||
|
||||
body {
|
||||
font: 13px "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
|
||||
color: #333;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-width: 675px;
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
img {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
#wphead {
|
||||
border-top: none;
|
||||
padding-top: 4px;
|
||||
background: #444 !important;
|
||||
}
|
||||
|
||||
.tagchecklist span a {
|
||||
background: transparent url(../images/xit.gif) no-repeat 0 0;
|
||||
}
|
||||
|
||||
#poststuff #edButtonPreview,
|
||||
#poststuff #edButtonHTML {
|
||||
-moz-border-radius: 3px 3px 0 0;
|
||||
-webkit-border-top-right-radius: 3px;
|
||||
-webkit-border-top-left-radius: 3px;
|
||||
-khtml-border-top-right-radius: 3px;
|
||||
-khtml-border-top-left-radius: 3px;
|
||||
border-top-right-radius: 3px;
|
||||
border-top-left-radius: 3px;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
cursor: pointer;
|
||||
display: block;
|
||||
height: 18px;
|
||||
margin: 0 5px 0 0;
|
||||
padding: 0 5px 0;
|
||||
font-size: 10px;
|
||||
line-height: 18px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.howto {
|
||||
margin-top: 2px;
|
||||
margin-bottom: 3px;
|
||||
font-size: 11px;
|
||||
font-style: italic;
|
||||
display: block;
|
||||
}
|
||||
|
||||
input.text {
|
||||
outline-color: -moz-use-text-color;
|
||||
outline-style: none;
|
||||
outline-width: medium;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#message {
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
/* Editor/Main Column */
|
||||
div#poststuff {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
div.zerosize {
|
||||
border: 0 none;
|
||||
height: 0;
|
||||
margin: 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
#poststuff #edButtonPreview.active,
|
||||
#poststuff #edButtonHTML.active {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.posting {
|
||||
margin-right: 212px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#side-info-column {
|
||||
float: right;
|
||||
width: 200px;
|
||||
position: relative;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
#side-info-column .sleeve {
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
#poststuff .inside {
|
||||
font-size: 11px;
|
||||
margin: 8px;
|
||||
}
|
||||
|
||||
#poststuff h2,#poststuff h3 {
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
line-height: 1;
|
||||
margin: 0;
|
||||
padding: 7px 9px;
|
||||
}
|
||||
|
||||
#tagsdiv-post_tag h3,
|
||||
#categorydiv h3 {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
h3.tb {
|
||||
text-shadow: 0 1px 0 #fff;
|
||||
font-weight: bold;
|
||||
font-size: 12px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
#TB_window {
|
||||
border: 1px solid #333;
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.postbox,
|
||||
.stuffbox {
|
||||
margin-bottom: 10px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
line-height: 1;
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.stuffbox:hover .handlediv {
|
||||
background: transparent url(../images/menu-bits-vs.gif) no-repeat scroll left -111px;
|
||||
}
|
||||
|
||||
.handlediv {
|
||||
float: right;
|
||||
height: 26px;
|
||||
width: 23px;
|
||||
}
|
||||
|
||||
#title,
|
||||
.tbtitle {
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
font-size: 1.7em;
|
||||
outline: none;
|
||||
padding: 3px 4px;
|
||||
border-color: #dfdfdf;
|
||||
}
|
||||
|
||||
.tbtitle {
|
||||
font-size: 12px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
#title {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
.editor-container {
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
border: 1px solid #dfdfdf;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.postdivrich {
|
||||
padding-top: 25px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.actions {
|
||||
float: right;
|
||||
margin: -19px 0 0;
|
||||
}
|
||||
|
||||
#extra-fields .actions {
|
||||
margin: -15px -5px 0 0;
|
||||
}
|
||||
|
||||
.actions li {
|
||||
float: left;
|
||||
list-style: none;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#extra-fields .button {
|
||||
margin-right: 5px;
|
||||
padding: 3px 6px;
|
||||
border-radius: 10px;
|
||||
-webkit-border-radius: 10px;
|
||||
-khtml-border-radius: 10px;
|
||||
-moz-border-radius: 10px;
|
||||
}
|
||||
|
||||
/* Photo Styles */
|
||||
.photolist {
|
||||
margin-top: -10px;
|
||||
}
|
||||
|
||||
#photo_saving {
|
||||
margin: 0 8px 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#img_container {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
#img_container_container {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#extra-fields {
|
||||
margin-top: 10px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#waiting {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
#extra-fields .postbox {
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
#extra-fields .titlewrap {
|
||||
padding: 0;
|
||||
overflow: auto;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
#img_container a {
|
||||
display: block;
|
||||
float: left;
|
||||
overflow: hidden;
|
||||
vertical-align: center;
|
||||
}
|
||||
|
||||
#img_container img,
|
||||
#img_container a {
|
||||
width: 68px;
|
||||
height: 68px;
|
||||
}
|
||||
|
||||
#img_container img {
|
||||
border: none;
|
||||
background-color: #f4f4f4;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#img_container a,
|
||||
#img_container a:link,
|
||||
#img_container a:visited {
|
||||
border: 1px solid #ccc;
|
||||
display: block;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#img_container a:hover,
|
||||
#img_container a:active {
|
||||
border-color: #000;
|
||||
z-index: 1000;
|
||||
border-width: 2px;
|
||||
margin: -1px;
|
||||
}
|
||||
|
||||
/* Video */
|
||||
#embed-code {
|
||||
width: 100%;
|
||||
height: 98px;
|
||||
}
|
||||
|
||||
/* Submit Column */
|
||||
#viewsite {
|
||||
padding: 0;
|
||||
margin: 0 0 20px 5px;
|
||||
font-size: 10px;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.wp-hidden-children
|
||||
.wp-hidden-child {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#category-adder {
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
#category-adder h4 {
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
|
||||
#category-add input {
|
||||
width: 94%;
|
||||
font-family: Verdana,Arial,Helvetica,sans-serif;
|
||||
font-size: 13px;
|
||||
margin: 1px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
#category-add select {
|
||||
width: 70%;
|
||||
-x-system-font: none;
|
||||
border-style: solid;
|
||||
border-width: 1px;
|
||||
font-family: "Lucida Grande","Bitstream Vera Sans",Verdana,Arial,sans-serif;
|
||||
font-size: 12px;
|
||||
height: 2em;
|
||||
line-height: 20px;
|
||||
padding: 2px;
|
||||
margin: 1px;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
#category-add input,
|
||||
#category-add-sumbit {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
/* Categories */
|
||||
#categorydiv ul,
|
||||
#linkcategorydiv ul {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#categorydiv ul.categorychecklist ul {
|
||||
margin-left: 18px;
|
||||
}
|
||||
|
||||
#categorydiv div.tabs-panel {
|
||||
height: 140px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
ul.categorychecklist li {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
line-height: 19px;
|
||||
}
|
||||
|
||||
/* Tags */
|
||||
.screen-reader-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tagsdiv .newtag {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.jaxtag {
|
||||
clear: both;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.tagadd {
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.tagchecklist {
|
||||
margin-top: 3px;
|
||||
margin-bottom: 1em;
|
||||
font-size: 12px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.tagchecklist strong {
|
||||
position: absolute;
|
||||
font-size: .75em;
|
||||
}
|
||||
|
||||
.tagchecklist span {
|
||||
margin-right: .5em;
|
||||
margin-left: 10px;
|
||||
display: block;
|
||||
float: left;
|
||||
font-size: 11px;
|
||||
line-height: 1.8em;
|
||||
white-space: nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.tagchecklist span a {
|
||||
margin: 6px 0 0 -9px;
|
||||
cursor: pointer;
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
display: block;
|
||||
float: left;
|
||||
text-indent: -9999px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#content {
|
||||
margin: 5px 0;
|
||||
padding: 0 5px;
|
||||
border: 0 none;
|
||||
height: 365px;
|
||||
width: 97% !important;
|
||||
}
|
||||
|
||||
* html .postdivrich {
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
/* Submit */
|
||||
#saving {
|
||||
display: inline;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.submit input,
|
||||
.button,
|
||||
.button-primary,
|
||||
.button-secondary,
|
||||
.button-highlighted,
|
||||
#postcustomstuff .submit input {
|
||||
font-family: "Lucida Grande",Verdana,Arial,"Bitstream Vera Sans",sans-serif;
|
||||
text-decoration: none;
|
||||
font-size: 11px !important;
|
||||
line-height: 16px;
|
||||
padding: 2px 8px;
|
||||
cursor: pointer;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-moz-border-radius: 11px;
|
||||
-khtml-border-radius: 11px;
|
||||
-webkit-border-radius: 11px;
|
||||
border-radius: 11px;
|
||||
}
|
||||
|
||||
.button-primary {
|
||||
background: #21759B url(../images/button-grad.png) repeat-x scroll left top;
|
||||
border-color: #21759B;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ac_results {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
list-style: none;
|
||||
position: absolute;
|
||||
z-index: 10000;
|
||||
display: none;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.ac_results li {
|
||||
padding: 2px 5px;
|
||||
white-space: nowrap;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.ac_over {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.ac_match {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
#TB_ajaxContent #options {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 25px;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
#TB_ajaxContent h3 {
|
||||
margin-bottom: .25em;
|
||||
}
|
||||
|
||||
.updated {
|
||||
margin: 10px 0;
|
||||
padding: 0;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
width: 99%;
|
||||
}
|
||||
|
||||
.updated p,
|
||||
.error p {
|
||||
margin: 0.6em 0;
|
||||
padding: 0 0.6em;
|
||||
}
|
||||
|
||||
.error a {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.updated a {
|
||||
text-decoration: none;
|
||||
padding-bottom: 2px;
|
||||
}
|
||||
|
||||
#post_status {
|
||||
margin-left: 10px;
|
||||
margin-bottom: 1em;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
#footer {
|
||||
height: 65px;
|
||||
display: block;
|
||||
width: 640px;
|
||||
padding: 10px 0 0 60px;
|
||||
margin: 0;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
#footer p {
|
||||
margin: 0;
|
||||
padding: 7px 0;
|
||||
}
|
||||
|
||||
#footer p a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#footer p a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* Utility Classes */
|
||||
.centered {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.postbox input[type="text"],
|
||||
.postbox textarea,
|
||||
.stuffbox input[type="text"],
|
||||
.stuffbox textarea {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
/* tag hints */
|
||||
.taghint {
|
||||
color: #aaa;
|
||||
margin: -17px 0 0 7px;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
input.newtag ~ div.taghint {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
input.newtag:focus ~ div.taghint {
|
||||
visibility: hidden;
|
||||
}
|
||||
@@ -1,3 +1,12 @@
|
||||
#templateside {
|
||||
float: left;
|
||||
}
|
||||
#themeselector {
|
||||
padding-right: 0;
|
||||
padding-left: 5px;
|
||||
float: left;
|
||||
}
|
||||
div.tablenav {
|
||||
margin-right: 0;
|
||||
margin-left: 210px;
|
||||
}
|
||||
|
||||
@@ -1 +1,66 @@
|
||||
#template textarea{font-family:Consolas,Monaco,Courier,monospace;font-size:12px;width:97%;}#template p{width:97%;}#templateside{float:right;width:190px;word-wrap:break-word;}#templateside h3,#postcustomstuff p.submit{margin:0;}#templateside h4{margin:1em 0 0;}#templateside ol,#templateside ul{margin:.5em;padding:0;}#templateside li{margin:4px 0;}.nonessential{font-size:small;}.highlight{padding:1px;}div.tablenav{margin-right:210px;}#documentation{margin-top:10px;}#documentation label{line-height:22px;vertical-align:top;font-weight:bold;}.fileedit-sub{padding:10px 0 8px;line-height:180%;}
|
||||
#template textarea {
|
||||
font-family: Consolas, Monaco, Courier, monospace;
|
||||
font-size: 12px;
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
#template p {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
#templateside {
|
||||
float: right;
|
||||
width: 190px;
|
||||
}
|
||||
|
||||
#templateside h3, #postcustomstuff p.submit {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
h3#bordertitle {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#templateside h4 {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
#templateside ol, #templateside ul {
|
||||
list-style: none;
|
||||
margin: .5em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#templateside ol li, #templateside ul li {
|
||||
margin: 1px 0;
|
||||
}
|
||||
|
||||
#themeselector {
|
||||
padding-right: 5px;
|
||||
float: right;
|
||||
position: relative;
|
||||
bottom: 25px;
|
||||
top:20px;
|
||||
}
|
||||
|
||||
#themeselector select {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.nonessential {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
div.bordertitle h2 {
|
||||
border: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
div.tablenav {
|
||||
margin-right: 210px;
|
||||
}
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
#template textarea {
|
||||
font-family: Consolas, Monaco, Courier, monospace;
|
||||
font-size: 12px;
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
#template p {
|
||||
width: 97%;
|
||||
}
|
||||
|
||||
#templateside {
|
||||
float: right;
|
||||
width: 190px;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
#templateside h3,
|
||||
#postcustomstuff p.submit {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#templateside h4 {
|
||||
margin: 1em 0 0;
|
||||
}
|
||||
|
||||
#templateside ol,
|
||||
#templateside ul {
|
||||
margin: .5em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
#templateside li {
|
||||
margin: 4px 0;
|
||||
}
|
||||
|
||||
.nonessential {
|
||||
font-size: small;
|
||||
}
|
||||
|
||||
.highlight {
|
||||
padding: 1px;
|
||||
}
|
||||
|
||||
div.tablenav {
|
||||
margin-right: 210px;
|
||||
}
|
||||
|
||||
#documentation {
|
||||
margin-top: 10px;
|
||||
}
|
||||
#documentation label {
|
||||
line-height: 22px;
|
||||
vertical-align: top;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.fileedit-sub {
|
||||
padding: 10px 0 8px;
|
||||
line-height: 180%;
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
div.star-holder{position:relative;height:19px;width:100px;font-size:19px;}div.star{height:100%;position:absolute;top:0;left:0;background-color:transparent;letter-spacing:1ex;border:none;}.star1{width:20%;}.star2{width:40%;}.star3{width:60%;}.star4{width:80%;}.star5{width:100%;}.star img,div.star a,div.star a:hover,div.star a:visited{display:block;position:absolute;right:0;border:none;text-decoration:none;}div.star img{width:19px;height:19px;border-left:1px solid #fff;border-right:1px solid #fff;}.theme-listing .theme-item{display:inline-block;width:200px;border:thin solid #ccc;vertical-align:top;}.theme-listing .theme-item h3{text-align:center;font-size:14px;font-style:italic;margin:0;padding:0;}.theme-listing .theme-item img{max-width:150px;max-height:150px;}.theme-listing .theme-item-info span{display:none;}.theme-listing .theme-item:hover .theme-item-info span{display:inline;}.theme-listing .theme-item:hover .theme-item-info span.dots{display:none;}.theme-listing .theme-item-info span.action-links{font-weight:bold;text-align:center;}.theme-listing br.line{border-bottom-width:1px;border-bottom-style:solid;margin-bottom:3px;}.available-theme{padding:20px 15px;}#theme-information .theme-preview-img{float:left;margin:5px 25px 10px 15px;width:300px;}#theme-information .action-button{border-top-width:1px;border-top-style:solid;margin:10px 5px 20px;}#theme-information .action-button #cancel{float:left;margin:10px 15px;}#theme-information .action-button #install{float:right;margin:10px 15px;}#theme-information .available-theme h3{margin:1em 0;}body#theme-information{height:auto;}.feature-filter{-moz-border-radius:8px;-khtml-border-radius:8px;-webkit-border-radius:8px;border-radius:8px;border-width:1px;border-style:solid;padding:8px 12px 0;}.feature-filter .feature-group{float:left;margin-bottom:20px;width:695px;}.feature-filter .feature-name{float:left;text-align:right;width:95px;}.feature-filter .feature-group li{display:inline;float:left;list-style-type:none;padding-right:25px;min-width:145px;}
|
||||
@@ -1,142 +0,0 @@
|
||||
/* NOTE: the following CSS rules(.star*) are taken more or less straight from the bbPress rating plugin. */
|
||||
div.star-holder {
|
||||
position: relative;
|
||||
height: 19px;
|
||||
width: 100px;
|
||||
font-size: 19px;
|
||||
}
|
||||
|
||||
div.star {
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
background-color: transparent;
|
||||
letter-spacing: 1ex;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.star1 { width: 20%; }
|
||||
.star2 { width: 40%; }
|
||||
.star3 { width: 60%; }
|
||||
.star4 { width: 80%; }
|
||||
.star5 { width: 100%; }
|
||||
|
||||
.star img, div.star a, div.star a:hover, div.star a:visited {
|
||||
display: block;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
div.star img {
|
||||
width: 19px;
|
||||
height: 19px;
|
||||
border-left: 1px solid #fff;
|
||||
border-right: 1px solid #fff;
|
||||
}
|
||||
|
||||
.theme-listing .theme-item {
|
||||
display: inline-block;
|
||||
width: 200px;
|
||||
border: thin solid #ccc;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
.theme-listing .theme-item h3 {
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
font-style: italic;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.theme-listing .theme-item img {
|
||||
max-width: 150px;
|
||||
max-height: 150px;
|
||||
}
|
||||
|
||||
.theme-listing .theme-item-info span {
|
||||
display: none;
|
||||
}
|
||||
.theme-listing .theme-item:hover .theme-item-info span {
|
||||
display: inline;
|
||||
}
|
||||
.theme-listing .theme-item:hover .theme-item-info span.dots {
|
||||
display: none;
|
||||
}
|
||||
.theme-listing .theme-item-info span.action-links {
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.theme-listing br.line {
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-style: solid;
|
||||
margin-bottom: 3px;
|
||||
}
|
||||
|
||||
.available-theme {
|
||||
padding: 20px 15px;
|
||||
}
|
||||
|
||||
#theme-information .theme-preview-img {
|
||||
float: left;
|
||||
margin: 5px 25px 10px 15px;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
#theme-information .action-button {
|
||||
border-top-width: 1px;
|
||||
border-top-style: solid;
|
||||
margin: 10px 5px 20px;
|
||||
}
|
||||
|
||||
#theme-information .action-button #cancel {
|
||||
float: left;
|
||||
margin: 10px 15px;
|
||||
}
|
||||
|
||||
#theme-information .action-button #install {
|
||||
float: right;
|
||||
margin: 10px 15px;
|
||||
}
|
||||
|
||||
#theme-information .available-theme h3 {
|
||||
margin: 1em 0;
|
||||
}
|
||||
|
||||
body#theme-information {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.feature-filter {
|
||||
-moz-border-radius: 8px;
|
||||
-khtml-border-radius: 8px;
|
||||
-webkit-border-radius: 8px;
|
||||
border-radius: 8px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 8px 12px 0;
|
||||
}
|
||||
|
||||
.feature-filter .feature-group {
|
||||
float: left;
|
||||
margin-bottom: 20px;
|
||||
width: 695px;
|
||||
}
|
||||
|
||||
.feature-filter .feature-name {
|
||||
float: left;
|
||||
text-align: right;
|
||||
width: 95px;
|
||||
}
|
||||
|
||||
.feature-filter .feature-group li {
|
||||
display: inline;
|
||||
float: left;
|
||||
list-style-type: none;
|
||||
padding-right: 25px;
|
||||
min-width: 145px;
|
||||
}
|
||||
@@ -1,4 +1,14 @@
|
||||
|
||||
h4.widget-title span {
|
||||
float: right;
|
||||
}
|
||||
h4.widget-title a {
|
||||
float: left;
|
||||
margin-left: 0;
|
||||
margin-right: 1em;
|
||||
}
|
||||
ul#widget-list li.widget-list-item h4.widget-title {
|
||||
float: right;
|
||||
}
|
||||
ul#widget-list li.widget-list-item div.widget-description {
|
||||
margin: 0 200px 0 0;
|
||||
padding: 0 4em 0 0;
|
||||
@@ -9,3 +19,9 @@ ul#widget-list li.widget-list-item div.widget-description {
|
||||
margin-left: 8px;
|
||||
float: right;
|
||||
}
|
||||
li.widget-list-control-item h4.widget-title a,
|
||||
#dragHelper li.widget-list-control-item h4.widget-title a,
|
||||
#draghelper li.widget-list-control-item h4.widget-title a:visited {
|
||||
right: auto;
|
||||
left: 1em;
|
||||
}
|
||||
|
||||
@@ -1,370 +0,0 @@
|
||||
html,
|
||||
body {
|
||||
min-width: 950px;
|
||||
}
|
||||
|
||||
/* 2 column liquid layout */
|
||||
div.widget-liquid-left {
|
||||
float: left;
|
||||
clear: left;
|
||||
width: 100%;
|
||||
margin-right: -325px;
|
||||
}
|
||||
|
||||
div#widgets-left {
|
||||
margin-left: 5px;
|
||||
margin-right: 325px;
|
||||
}
|
||||
|
||||
div#widgets-right {
|
||||
width: 285px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
div.widget-liquid-right {
|
||||
float: right;
|
||||
clear: right;
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.widget-liquid-right .widget,
|
||||
#wp_inactive_widgets .widget,
|
||||
.widget-liquid-right .sidebar-description {
|
||||
width: 250px;
|
||||
margin: 0 auto 20px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.widget-liquid-right .sidebar-description {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
#wp_inactive_widgets .widget {
|
||||
margin: 0 10px 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
div.sidebar-name h3 {
|
||||
margin: 0;
|
||||
padding: 5px 12px;
|
||||
font-size: 13px;
|
||||
height: 19px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
div.sidebar-name {
|
||||
background-repeat: repeat-x;
|
||||
background-position: 0 0;
|
||||
cursor: pointer;
|
||||
font-size: 13px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-moz-border-radius-topleft: 8px;
|
||||
-moz-border-radius-topright: 8px;
|
||||
-webkit-border-top-right-radius: 8px;
|
||||
-webkit-border-top-left-radius: 8px;
|
||||
-khtml-border-top-right-radius: 8px;
|
||||
-khtml-border-top-left-radius: 8px;
|
||||
border-top-right-radius: 8px;
|
||||
border-top-left-radius: 8px;
|
||||
}
|
||||
|
||||
.js .closed .sidebar-name {
|
||||
-moz-border-radius-bottomleft: 8px;
|
||||
-moz-border-radius-bottomright: 8px;
|
||||
-webkit-border-bottom-right-radius: 8px;
|
||||
-webkit-border-bottom-left-radius: 8px;
|
||||
-khtml-border-bottom-right-radius: 8px;
|
||||
-khtml-border-bottom-left-radius: 8px;
|
||||
border-bottom-right-radius: 8px;
|
||||
border-bottom-left-radius: 8px;
|
||||
}
|
||||
|
||||
.widget-liquid-right .widgets-sortables,
|
||||
#widgets-left .widget-holder {
|
||||
border-width: 0 1px 1px;
|
||||
border-style: none solid solid;
|
||||
-moz-border-radius-bottomleft: 8px;
|
||||
-moz-border-radius-bottomright: 8px;
|
||||
-webkit-border-bottom-right-radius: 8px;
|
||||
-webkit-border-bottom-left-radius: 8px;
|
||||
-khtml-border-bottom-right-radius: 8px;
|
||||
-khtml-border-bottom-left-radius: 8px;
|
||||
border-bottom-right-radius: 8px;
|
||||
border-bottom-left-radius: 8px;
|
||||
}
|
||||
|
||||
.js .closed .widgets-sortables,
|
||||
.js .closed .widget-holder {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widget-liquid-right .widgets-sortables {
|
||||
padding: 15px 0 0;
|
||||
}
|
||||
|
||||
#available-widgets .widget-holder {
|
||||
padding: 7px 5px 0;
|
||||
}
|
||||
|
||||
#wp_inactive_widgets {
|
||||
padding: 5px 5px 0;
|
||||
}
|
||||
|
||||
#widget-list .widget {
|
||||
width: 250px;
|
||||
margin: 0 10px 15px;
|
||||
border: 0 none;
|
||||
float: left;
|
||||
}
|
||||
|
||||
#widget-list .widget-description {
|
||||
padding: 5px 8px;
|
||||
}
|
||||
|
||||
#widget-list .widget-top {
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.widget-placeholder {
|
||||
border-width: 1px;
|
||||
border-style: dashed;
|
||||
margin: 0 auto 20px;
|
||||
height: 26px;
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
#wp_inactive_widgets .widget-placeholder {
|
||||
margin: 0 10px 20px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
div.widgets-holder-wrap {
|
||||
padding: 0;
|
||||
margin: 10px 0 20px;
|
||||
}
|
||||
|
||||
#widgets-left #available-widgets {
|
||||
background-color: transparent;
|
||||
border: 0 none;
|
||||
}
|
||||
|
||||
ul#widget-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
min-height: 100px;
|
||||
}
|
||||
|
||||
.widget .widget-top {
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
height: 26px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.widget-top .widget-title {
|
||||
padding: 5px 9px;
|
||||
}
|
||||
|
||||
.widget-top .widget-title-action {
|
||||
float: right;
|
||||
}
|
||||
|
||||
a.widget-action {
|
||||
display: block;
|
||||
width: 24px;
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
#available-widgets a.widget-action {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widget-top a.widget-action {
|
||||
background: url("../images/menu-bits.gif") no-repeat scroll 0 -110px;
|
||||
}
|
||||
|
||||
.widget .widget-inside,
|
||||
.widget .widget-description {
|
||||
padding: 12px 12px 10px;
|
||||
font-size: 11px;
|
||||
line-height: 16px;
|
||||
}
|
||||
|
||||
.widget-inside,
|
||||
.widget-description {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#available-widgets .widget-description {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.widget .widget-inside p {
|
||||
margin: 0 0 1em;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.widget-title h4 {
|
||||
margin: 0;
|
||||
line-height: 1.3;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.widgets-sortables {
|
||||
min-height: 90px;
|
||||
}
|
||||
|
||||
.widget-control-actions {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.widget-control-actions a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.widget-control-actions a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
.widget-control-actions .ajax-feedback {
|
||||
padding-bottom: 3px;
|
||||
}
|
||||
|
||||
.widget-control-actions div.alignleft {
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
div#sidebar-info {
|
||||
padding: 0 1em;
|
||||
margin-bottom: 1em;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.widget-title a,
|
||||
.widget-title a:hover {
|
||||
text-decoration: none;
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.widget-control-edit {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
font-weight: normal;
|
||||
line-height: 26px;
|
||||
padding: 0 8px 0 0;
|
||||
}
|
||||
|
||||
a.widget-control-edit {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.widget-control-edit .add,
|
||||
.widget-control-edit .edit {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#available-widgets .widget-control-edit .add,
|
||||
#widgets-right .widget-control-edit .edit,
|
||||
#wp_inactive_widgets .widget-control-edit .edit {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.editwidget {
|
||||
margin: 0 auto 15px;
|
||||
}
|
||||
|
||||
.editwidget .widget-inside {
|
||||
display: block;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
padding: 10px;
|
||||
-moz-border-radius: 6px;
|
||||
-khtml-border-radius: 6px;
|
||||
-webkit-border-radius: 6px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.inactive p.description {
|
||||
margin: 5px 15px 8px;
|
||||
}
|
||||
|
||||
#available-widgets p.description {
|
||||
margin: 0 12px 12px;
|
||||
}
|
||||
|
||||
.widget-position {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.inactive {
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.sidebar-name-arrow {
|
||||
float: right;
|
||||
height: 29px;
|
||||
width: 26px;
|
||||
}
|
||||
|
||||
.widget-title .in-widget-title {
|
||||
font-size: 11px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#removing-widget {
|
||||
display: none;
|
||||
font-weight: normal;
|
||||
padding-left: 15px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.widget-control-noform,
|
||||
#access-off,
|
||||
.widgets_access .widget-action,
|
||||
.widgets_access .sidebar-name-arrow,
|
||||
.widgets_access #access-on,
|
||||
.widgets_access .widget-holder .description {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.widgets_access .widget-holder,
|
||||
.widgets_access #widget-list {
|
||||
padding-top: 10px;
|
||||
}
|
||||
|
||||
.widgets_access #access-off {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.widgets_access #wpbody-content .widget-title-action,
|
||||
.widgets_access #wpbody-content .widget-control-edit,
|
||||
.widgets_access .closed .widgets-sortables,
|
||||
.widgets_access .closed .widget-holder {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.widgets_access .closed .sidebar-name {
|
||||
-moz-border-radius-bottomleft: 0;
|
||||
-moz-border-radius-bottomright: 0;
|
||||
-webkit-border-bottom-right-radius: 0;
|
||||
-webkit-border-bottom-left-radius: 0;
|
||||
-khtml-border-bottom-right-radius: 0;
|
||||
-khtml-border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
.widgets_access .sidebar-name,
|
||||
.widgets_access .widget .widget-top {
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class Custom_Image_Header {
|
||||
* @since unknown
|
||||
*/
|
||||
function init() {
|
||||
$page = add_theme_page(__('Custom Header'), __('Custom Header'), 'edit_themes', 'custom-header', array(&$this, 'admin_page'));
|
||||
$page = add_theme_page(__('Custom Image Header'), __('Custom Image Header'), 'edit_themes', 'custom-header', array(&$this, 'admin_page'));
|
||||
|
||||
add_action("admin_print_scripts-$page", array(&$this, 'js_includes'));
|
||||
add_action("admin_print_styles-$page", array(&$this, 'css_includes'));
|
||||
@@ -79,7 +79,7 @@ class Custom_Image_Header {
|
||||
if ( 1 == $step )
|
||||
wp_enqueue_script('farbtastic');
|
||||
elseif ( 2 == $step )
|
||||
wp_enqueue_script('jcrop');
|
||||
wp_enqueue_script('cropper');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,10 +90,9 @@ class Custom_Image_Header {
|
||||
function css_includes() {
|
||||
$step = $this->step();
|
||||
|
||||
if ( 1 == $step )
|
||||
if ( 1 == $step ) {
|
||||
wp_enqueue_style('farbtastic');
|
||||
elseif ( 2 == $step )
|
||||
wp_enqueue_style('jcrop');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -216,13 +215,13 @@ class Custom_Image_Header {
|
||||
*/
|
||||
function js_2() { ?>
|
||||
<script type="text/javascript">
|
||||
function onEndCrop( coords ) {
|
||||
jQuery( '#x1' ).val(coords.x);
|
||||
jQuery( '#y1' ).val(coords.y);
|
||||
function onEndCrop( coords, dimensions ) {
|
||||
jQuery( '#x1' ).val(coords.x1);
|
||||
jQuery( '#y1' ).val(coords.y1);
|
||||
jQuery( '#x2' ).val(coords.x2);
|
||||
jQuery( '#y2' ).val(coords.y2);
|
||||
jQuery( '#width' ).val(coords.w);
|
||||
jQuery( '#height' ).val(coords.h);
|
||||
jQuery( '#width' ).val(dimensions.width);
|
||||
jQuery( '#height' ).val(dimensions.height);
|
||||
}
|
||||
|
||||
// with a supplied ratio
|
||||
@@ -232,15 +231,6 @@ class Custom_Image_Header {
|
||||
var ratio = xinit / yinit;
|
||||
var ximg = jQuery('#upload').width();
|
||||
var yimg = jQuery('#upload').height();
|
||||
|
||||
//set up default values
|
||||
jQuery( '#x1' ).val(0);
|
||||
jQuery( '#y1' ).val(0);
|
||||
jQuery( '#x2' ).val(xinit);
|
||||
jQuery( '#y2' ).val(yinit);
|
||||
jQuery( '#width' ).val(xinit);
|
||||
jQuery( '#height' ).val(yinit);
|
||||
|
||||
if ( yimg < yinit || ximg < xinit ) {
|
||||
if ( ximg / yimg > ratio ) {
|
||||
yinit = yimg;
|
||||
@@ -250,12 +240,14 @@ class Custom_Image_Header {
|
||||
yinit = xinit / ratio;
|
||||
}
|
||||
}
|
||||
|
||||
jQuery('#upload').Jcrop({
|
||||
aspectRatio: ratio,
|
||||
setSelect: [ 0, 0, xinit, yinit ],
|
||||
onSelect: onEndCrop
|
||||
});
|
||||
new Cropper.Img(
|
||||
'upload',
|
||||
{
|
||||
ratioDim: { x: xinit, y: yinit },
|
||||
displayOnInit: true,
|
||||
onEndCrop: onEndCrop
|
||||
}
|
||||
)
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
@@ -278,16 +270,16 @@ class Custom_Image_Header {
|
||||
<h2><?php _e('Your Header Image'); ?></h2>
|
||||
<p><?php _e('This is your header image. You can change the text color or upload and crop a new image.'); ?></p>
|
||||
|
||||
<div id="headimg" style="background-image: url(<?php esc_url(header_image()) ?>);">
|
||||
<div id="headimg" style="background-image: url(<?php clean_url(header_image()) ?>);">
|
||||
<h1><a onclick="return false;" href="<?php bloginfo('url'); ?>" title="<?php bloginfo('name'); ?>" id="name"><?php bloginfo('name'); ?></a></h1>
|
||||
<div id="desc"><?php bloginfo('description');?></div>
|
||||
</div>
|
||||
<?php if ( !defined( 'NO_HEADER_TEXT' ) ) { ?>
|
||||
<form method="post" action="<?php echo admin_url('themes.php?page=custom-header&updated=true') ?>">
|
||||
<input type="button" class="button" value="<?php esc_attr_e('Hide Text'); ?>" onclick="hide_text()" id="hidetext" />
|
||||
<input type="button" class="button" value="<?php esc_attr_e('Select a Text Color'); ?>" id="pickcolor" /><input type="button" class="button" value="<?php esc_attr_e('Use Original Color'); ?>" onclick="colorDefault()" id="defaultcolor" />
|
||||
<input type="button" value="<?php _e('Hide Text'); ?>" onclick="hide_text()" id="hidetext" />
|
||||
<input type="button" value="<?php _e('Select a Text Color'); ?>" id="pickcolor" /><input type="button" value="<?php _e('Use Original Color'); ?>" onclick="colorDefault()" id="defaultcolor" />
|
||||
<?php wp_nonce_field('custom-header') ?>
|
||||
<input type="hidden" name="textcolor" id="textcolor" value="#<?php esc_attr(header_textcolor()) ?>" /><input name="submit" type="submit" class="button" value="<?php esc_attr_e('Save Changes'); ?>" /></form>
|
||||
<input type="hidden" name="textcolor" id="textcolor" value="#<?php attribute_escape(header_textcolor()) ?>" /><input name="submit" type="submit" value="<?php _e('Save Changes'); ?>" /></form>
|
||||
<?php } ?>
|
||||
|
||||
<div id="colorPickerDiv" style="z-index: 100;background:#eee;border:1px solid #ccc;position:absolute;display:none;"> </div>
|
||||
@@ -296,12 +288,12 @@ class Custom_Image_Header {
|
||||
<h2><?php _e('Upload New Header Image'); ?></h2><p><?php _e('Here you can upload a custom header image to be shown at the top of your blog instead of the default one. On the next screen you will be able to crop the image.'); ?></p>
|
||||
<p><?php printf(__('Images of exactly <strong>%1$d x %2$d pixels</strong> will be used as-is.'), HEADER_IMAGE_WIDTH, HEADER_IMAGE_HEIGHT); ?></p>
|
||||
|
||||
<form enctype="multipart/form-data" id="uploadForm" method="POST" action="<?php echo esc_attr(add_query_arg('step', 2)) ?>" style="margin: auto; width: 50%;">
|
||||
<form enctype="multipart/form-data" id="uploadForm" method="POST" action="<?php echo attribute_escape(add_query_arg('step', 2)) ?>" style="margin: auto; width: 50%;">
|
||||
<label for="upload"><?php _e('Choose an image from your computer:'); ?></label><br /><input type="file" id="upload" name="import" />
|
||||
<input type="hidden" name="action" value="save" />
|
||||
<?php wp_nonce_field('custom-header') ?>
|
||||
<p class="submit">
|
||||
<input type="submit" value="<?php esc_attr_e('Upload'); ?>" />
|
||||
<input type="submit" value="<?php _e('Upload'); ?>" />
|
||||
</p>
|
||||
</form>
|
||||
|
||||
@@ -311,9 +303,9 @@ class Custom_Image_Header {
|
||||
<div class="wrap">
|
||||
<h2><?php _e('Reset Header Image and Color'); ?></h2>
|
||||
<p><?php _e('This will restore the original header image and color. You will not be able to retrieve any customizations.') ?></p>
|
||||
<form method="post" action="<?php echo esc_attr(add_query_arg('step', 1)) ?>">
|
||||
<form method="post" action="<?php echo attribute_escape(add_query_arg('step', 1)) ?>">
|
||||
<?php wp_nonce_field('custom-header'); ?>
|
||||
<input type="submit" class="button" name="resetheader" value="<?php esc_attr_e('Restore Original Header'); ?>" />
|
||||
<input type="submit" name="resetheader" value="<?php _e('Restore Original Header'); ?>" />
|
||||
</form>
|
||||
</div>
|
||||
<?php endif;
|
||||
@@ -354,7 +346,7 @@ class Custom_Image_Header {
|
||||
// Add the meta-data
|
||||
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
|
||||
|
||||
set_theme_mod('header_image', esc_url($url));
|
||||
set_theme_mod('header_image', clean_url($url));
|
||||
do_action('wp_create_file_in_uploads', $file, $id); // For replication
|
||||
return $this->finished();
|
||||
} elseif ( $width > HEADER_IMAGE_WIDTH ) {
|
||||
@@ -372,7 +364,7 @@ class Custom_Image_Header {
|
||||
|
||||
<div class="wrap">
|
||||
|
||||
<form method="POST" action="<?php echo esc_attr(add_query_arg('step', 3)) ?>">
|
||||
<form method="POST" action="<?php echo attribute_escape(add_query_arg('step', 3)) ?>">
|
||||
|
||||
<p><?php _e('Choose the part of the image you want to use as your header.'); ?></p>
|
||||
<div id="testWrap" style="position: relative">
|
||||
@@ -386,10 +378,10 @@ class Custom_Image_Header {
|
||||
<input type="hidden" name="y2" id="y2" />
|
||||
<input type="hidden" name="width" id="width" />
|
||||
<input type="hidden" name="height" id="height" />
|
||||
<input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo esc_attr($id); ?>" />
|
||||
<input type="hidden" name="oitar" id="oitar" value="<?php echo esc_attr($oitar); ?>" />
|
||||
<input type="hidden" name="attachment_id" id="attachment_id" value="<?php echo $id; ?>" />
|
||||
<input type="hidden" name="oitar" id="oitar" value="<?php echo $oitar; ?>" />
|
||||
<?php wp_nonce_field('custom-header') ?>
|
||||
<input type="submit" value="<?php esc_attr_e('Crop Header'); ?>" />
|
||||
<input type="submit" value="<?php _e('Crop Header'); ?>" />
|
||||
</p>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
if ( ! defined('ABSPATH') ) die();
|
||||
|
||||
if ( have_posts() ) { ?>
|
||||
<table class="widefat fixed" cellspacing="0">
|
||||
@@ -26,22 +24,16 @@ if ( have_posts() ) { ?>
|
||||
|
||||
<tbody id="the-list" class="list:post">
|
||||
<?php
|
||||
add_filter('the_title','esc_html');
|
||||
add_filter('the_title','wp_specialchars');
|
||||
$alt = '';
|
||||
$posts_columns = get_column_headers('upload');
|
||||
$hidden = get_hidden_columns('upload');
|
||||
|
||||
while ( have_posts() ) : the_post();
|
||||
|
||||
if ( $is_trash && $post->post_status != 'trash' )
|
||||
continue;
|
||||
elseif ( !$is_trash && $post->post_status == 'trash' )
|
||||
continue;
|
||||
|
||||
while (have_posts()) : the_post();
|
||||
$alt = ( 'alternate' == $alt ) ? '' : 'alternate';
|
||||
global $current_user;
|
||||
$post_owner = ( $current_user->ID == $post->post_author ? 'self' : 'other' );
|
||||
$att_title = _draft_or_post_title();
|
||||
|
||||
?>
|
||||
<tr id='post-<?php echo $id; ?>' class='<?php echo trim( $alt . ' author-' . $post_owner . ' status-' . $post->post_status ); ?>' valign="top">
|
||||
|
||||
@@ -59,7 +51,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
|
||||
case 'cb':
|
||||
?>
|
||||
<th scope="row" class="check-column"><?php if ( current_user_can('edit_post', $post->ID) ) { ?><input type="checkbox" name="media[]" value="<?php the_ID(); ?>" /><?php } ?></th>
|
||||
<th scope="row" class="check-column"><input type="checkbox" name="media[]" value="<?php the_ID(); ?>" /></th>
|
||||
<?php
|
||||
break;
|
||||
|
||||
@@ -68,15 +60,13 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php
|
||||
if ( $thumb = wp_get_attachment_image( $post->ID, array(80, 60), true ) ) {
|
||||
if ( $is_trash ) echo $thumb;
|
||||
else {
|
||||
?>
|
||||
<a href="media.php?action=edit&attachment_id=<?php the_ID(); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>">
|
||||
|
||||
<a href="media.php?action=edit&attachment_id=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>">
|
||||
<?php echo $thumb; ?>
|
||||
</a>
|
||||
|
||||
<?php }
|
||||
}
|
||||
?></td>
|
||||
<?php
|
||||
// TODO
|
||||
@@ -84,26 +74,16 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
|
||||
case 'media':
|
||||
?>
|
||||
<td <?php echo $attributes ?>><strong><?php if ( $is_trash ) echo $att_title; else { ?><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php echo $att_title; ?></a><?php } ?></strong><br />
|
||||
<td <?php echo $attributes ?>><strong><a href="<?php echo get_edit_post_link( $post->ID ); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php echo $att_title; ?></a></strong><br />
|
||||
<?php echo strtoupper(preg_replace('/^.*?\.(\w+)$/', '$1', get_attached_file($post->ID))); ?>
|
||||
<p>
|
||||
<?php
|
||||
$actions = array();
|
||||
if ( current_user_can('edit_post', $post->ID) && !$is_trash )
|
||||
if ( current_user_can('edit_post', $post->ID) )
|
||||
$actions['edit'] = '<a href="' . get_edit_post_link($post->ID, true) . '">' . __('Edit') . '</a>';
|
||||
if ( current_user_can('delete_post', $post->ID) ) {
|
||||
if ( $is_trash )
|
||||
$actions['untrash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=untrash&post=$post->ID", 'untrash-post_' . $post->ID) . "'>" . __('Restore') . "</a>";
|
||||
elseif ( EMPTY_TRASH_DAYS && MEDIA_TRASH )
|
||||
$actions['trash'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=trash&post=$post->ID", 'trash-post_' . $post->ID) . "'>" . __('Trash') . "</a>";
|
||||
if ( $is_trash || !EMPTY_TRASH_DAYS || !MEDIA_TRASH ) {
|
||||
$delete_ays = (!$is_trash && !MEDIA_TRASH) ? " onclick='return showNotice.warn();'" : '';
|
||||
$actions['delete'] = "<a class='submitdelete'$delete_ays href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "'>" . __('Delete Permanently') . "</a>";
|
||||
}
|
||||
}
|
||||
if ( !$is_trash )
|
||||
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . esc_attr(sprintf(__('View “%s”'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
||||
$actions = apply_filters( 'media_row_actions', $actions, $post );
|
||||
if ( current_user_can('delete_post', $post->ID) )
|
||||
$actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID) . "' onclick=\"if ( confirm('" . js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this attachment '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
|
||||
$actions['view'] = '<a href="' . get_permalink($post->ID) . '" title="' . attribute_escape(sprintf(__('View "%s"'), $title)) . '" rel="permalink">' . __('View') . '</a>';
|
||||
$action_count = count($actions);
|
||||
$i = 0;
|
||||
echo '<div class="row-actions">';
|
||||
@@ -130,7 +110,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
if ( !empty( $tags ) ) {
|
||||
$out = array();
|
||||
foreach ( $tags as $c )
|
||||
$out[] = "<a href='edit.php?tag=$c->slug'> " . esc_html(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . "</a>";
|
||||
$out[] = "<a href='edit.php?tag=$c->slug'> " . wp_specialchars(sanitize_term_field('name', $c->name, $c->term_id, 'post_tag', 'display')) . "</a>";
|
||||
echo join( ', ', $out );
|
||||
} else {
|
||||
_e('No Tags');
|
||||
@@ -151,7 +131,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
} else {
|
||||
$t_time = get_the_time(__('Y/m/d g:i:s A'));
|
||||
$m_time = $post->post_date;
|
||||
$time = get_post_time( 'G', true, $post, false );
|
||||
$time = get_post_time( 'G', true, $post );
|
||||
if ( ( abs($t_diff = time() - $time) ) < 86400 ) {
|
||||
if ( $t_diff < 0 )
|
||||
$h_time = sprintf( __('%s from now'), human_time_diff( $time ) );
|
||||
@@ -176,8 +156,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php _e('(Unattached)'); ?><br />
|
||||
<a class="hide-if-no-js" onclick="findPosts.open('media[]','<?php echo $post->ID ?>');return false;" href="#the-list"><?php _e('Attach'); ?></a></td>
|
||||
<td <?php echo $attributes ?>> </td>
|
||||
<?php
|
||||
}
|
||||
|
||||
@@ -192,7 +171,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
$pending_phrase = sprintf( __('%s pending'), number_format( $left ) );
|
||||
if ( $left )
|
||||
echo '<strong>';
|
||||
comments_number("<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('0', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link */ _x('1', 'comment count') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . /* translators: comment count link: % will be substituted by comment count */ _x('%', 'comment count') . '</span></a>');
|
||||
comments_number("<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('0') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('1') . '</span></a>', "<a href='edit-comments.php?p=$id' title='$pending_phrase' class='post-com-count'><span class='comment-count'>" . __('%') . '</span></a>');
|
||||
if ( $left )
|
||||
echo '</strong>';
|
||||
?>
|
||||
@@ -203,7 +182,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
case 'actions':
|
||||
?>
|
||||
<td <?php echo $attributes ?>>
|
||||
<a href="media.php?action=edit&attachment_id=<?php the_ID(); ?>" title="<?php echo esc_attr(sprintf(__('Edit “%s”'), $att_title)); ?>"><?php _e('Edit'); ?></a> |
|
||||
<a href="media.php?action=edit&attachment_id=<?php the_ID(); ?>" title="<?php echo attribute_escape(sprintf(__('Edit "%s"'), $att_title)); ?>"><?php _e('Edit'); ?></a> |
|
||||
<a href="<?php the_permalink(); ?>"><?php _e('Get permalink'); ?></a>
|
||||
</td>
|
||||
<?php
|
||||
@@ -223,7 +202,7 @@ foreach ($posts_columns as $column_name => $column_display_name ) {
|
||||
</table>
|
||||
<?php } else { ?>
|
||||
|
||||
<p><?php _e('No media attachments found.') ?></p>
|
||||
<p><?php _e('No posts found.') ?></p>
|
||||
|
||||
<?php
|
||||
} // end if ( have_posts() )
|
||||
|
||||
@@ -6,13 +6,6 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('You do not have sufficient permissions to edit categories for this blog.'));
|
||||
|
||||
/**
|
||||
* @var object
|
||||
*/
|
||||
@@ -51,33 +44,33 @@ _fill_empty_category($category);
|
||||
<div id="ajax-response"></div>
|
||||
<form name="editcat" id="editcat" method="post" action="categories.php" class="validate">
|
||||
<input type="hidden" name="action" value="editedcat" />
|
||||
<input type="hidden" name="cat_ID" value="<?php echo esc_attr($category->term_id) ?>" />
|
||||
<input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" />
|
||||
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('update-category_' . $cat_ID); ?>
|
||||
<table class="form-table">
|
||||
<tr class="form-field form-required">
|
||||
<th scope="row" valign="top"><label for="cat_name"><?php _e('Category Name') ?></label></th>
|
||||
<td><input name="cat_name" id="cat_name" type="text" value="<?php echo esc_attr($category->name); ?>" size="40" aria-required="true" /></td>
|
||||
<td><input name="cat_name" id="cat_name" type="text" value="<?php echo attribute_escape($category->name); ?>" size="40" aria-required="true" /><br />
|
||||
<?php _e('The name is used to identify the category almost everywhere, for example under the post or in the category widget.'); ?></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="category_nicename"><?php _e('Category Slug') ?></label></th>
|
||||
<td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo esc_attr(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
|
||||
<span class="description"><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></span></td>
|
||||
<td><input name="category_nicename" id="category_nicename" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
|
||||
<?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="category_parent"><?php _e('Category Parent') ?></label></th>
|
||||
<td>
|
||||
<?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'exclude' => $category->term_id, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br />
|
||||
<span class="description"><?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?></span>
|
||||
<?php wp_dropdown_categories(array('hide_empty' => 0, 'name' => 'category_parent', 'orderby' => 'name', 'selected' => $category->parent, 'hierarchical' => true, 'show_option_none' => __('None'))); ?><br />
|
||||
<?php _e('Categories, unlike tags, can have a hierarchy. You might have a Jazz category, and under that have children categories for Bebop and Big Band. Totally optional.'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="category_description"><?php _e('Description') ?></label></th>
|
||||
<td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo esc_html($category->description); ?></textarea><br />
|
||||
<span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span></td>
|
||||
<td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars($category->description); ?></textarea><br />
|
||||
<?php _e('The description is not prominent by default, however some themes may show it.'); ?></td>
|
||||
</tr>
|
||||
<?php do_action('edit_category_form_fields', $category); ?>
|
||||
</table>
|
||||
<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php esc_attr_e('Update Category'); ?>" /></p>
|
||||
<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php _e('Update Category'); ?>" /></p>
|
||||
<?php do_action('edit_category_form', $category); ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -9,41 +9,45 @@
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once('admin.php');
|
||||
|
||||
if ( !current_user_can('edit_posts') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
wp_enqueue_script('admin-comments');
|
||||
enqueue_comment_hotkeys_js();
|
||||
|
||||
$post_id = isset($_REQUEST['p']) ? (int) $_REQUEST['p'] : 0;
|
||||
|
||||
if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2']) ) {
|
||||
check_admin_referer('bulk-comments');
|
||||
if ( ( isset( $_REQUEST['delete_all_spam'] ) || isset( $_REQUEST['delete_all_spam2'] ) ) && !empty( $_REQUEST['pagegen_timestamp'] ) ) {
|
||||
check_admin_referer('bulk-spam-delete', '_spam_nonce');
|
||||
|
||||
if ( (isset($_REQUEST['delete_all']) || isset($_REQUEST['delete_all2'])) && !empty($_REQUEST['pagegen_timestamp']) ) {
|
||||
$comment_status = $wpdb->escape($_REQUEST['comment_status']);
|
||||
$delete_time = $wpdb->escape($_REQUEST['pagegen_timestamp']);
|
||||
$comment_ids = $wpdb->get_col( "SELECT comment_ID FROM $wpdb->comments WHERE comment_approved = '$comment_status' AND '$delete_time' > comment_date_gmt" );
|
||||
$doaction = 'delete';
|
||||
} elseif ( ($_REQUEST['action'] != -1 || $_REQUEST['action2'] != -1) && isset($_REQUEST['delete_comments']) ) {
|
||||
$comment_ids = $_REQUEST['delete_comments'];
|
||||
$doaction = ($_REQUEST['action'] != -1) ? $_REQUEST['action'] : $_REQUEST['action2'];
|
||||
} elseif ( $_REQUEST['doaction'] == 'undo' && isset($_REQUEST['ids']) ) {
|
||||
$comment_ids = array_map( 'absint', explode(',', $_REQUEST['ids']) );
|
||||
$doaction = $_REQUEST['action'];
|
||||
$delete_time = $wpdb->escape( $_REQUEST['pagegen_timestamp'] );
|
||||
if ( current_user_can('moderate_comments')) {
|
||||
$deleted_spam = $wpdb->query( "DELETE FROM $wpdb->comments WHERE comment_approved = 'spam' AND '$delete_time' > comment_date_gmt" );
|
||||
} else {
|
||||
wp_redirect($_SERVER['HTTP_REFERER']);
|
||||
$deleted_spam = 0;
|
||||
}
|
||||
$redirect_to = 'edit-comments.php?comment_status=spam&deleted=' . (int) $deleted_spam;
|
||||
if ( $post_id )
|
||||
$redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to );
|
||||
wp_redirect( $redirect_to );
|
||||
} elseif ( isset($_REQUEST['delete_comments']) && isset($_REQUEST['action']) && ( -1 != $_REQUEST['action'] || -1 != $_REQUEST['action2'] ) ) {
|
||||
check_admin_referer('bulk-comments');
|
||||
$doaction = ( -1 != $_REQUEST['action'] ) ? $_REQUEST['action'] : $_REQUEST['action2'];
|
||||
|
||||
$approved = $unapproved = $spammed = $unspammed = $trashed = $untrashed = $deleted = 0;
|
||||
|
||||
foreach ($comment_ids as $comment_id) { // Check the permissions on each
|
||||
$deleted = $approved = $unapproved = $spammed = 0;
|
||||
foreach ( (array) $_REQUEST['delete_comments'] as $comment_id) : // Check the permissions on each
|
||||
$comment_id = (int) $comment_id;
|
||||
$_post_id = (int) $wpdb->get_var( $wpdb->prepare( "SELECT comment_post_ID FROM $wpdb->comments WHERE comment_ID = %d", $comment_id) );
|
||||
|
||||
if ( !current_user_can('edit_post', $_post_id) )
|
||||
continue;
|
||||
|
||||
switch( $doaction ) {
|
||||
case 'markspam' :
|
||||
wp_set_comment_status($comment_id, 'spam');
|
||||
$spammed++;
|
||||
break;
|
||||
case 'delete' :
|
||||
wp_set_comment_status($comment_id, 'delete');
|
||||
$deleted++;
|
||||
break;
|
||||
case 'approve' :
|
||||
wp_set_comment_status($comment_id, 'approve');
|
||||
$approved++;
|
||||
@@ -52,48 +56,10 @@ if ( isset($_REQUEST['doaction']) || isset($_REQUEST['doaction2']) || isset($_R
|
||||
wp_set_comment_status($comment_id, 'hold');
|
||||
$unapproved++;
|
||||
break;
|
||||
case 'spam' :
|
||||
wp_spam_comment($comment_id);
|
||||
$spammed++;
|
||||
break;
|
||||
case 'unspam' :
|
||||
wp_unspam_comment($comment_id);
|
||||
$unspammed++;
|
||||
break;
|
||||
case 'trash' :
|
||||
wp_trash_comment($comment_id);
|
||||
$trashed++;
|
||||
break;
|
||||
case 'untrash' :
|
||||
wp_untrash_comment($comment_id);
|
||||
$untrashed++;
|
||||
break;
|
||||
case 'delete' :
|
||||
wp_delete_comment($comment_id);
|
||||
$deleted++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$redirect_to = 'edit-comments.php';
|
||||
|
||||
if ( $approved )
|
||||
$redirect_to = add_query_arg( 'approved', $approved, $redirect_to );
|
||||
if ( $unapproved )
|
||||
$redirect_to = add_query_arg( 'unapproved', $unapproved, $redirect_to );
|
||||
if ( $spammed )
|
||||
$redirect_to = add_query_arg( 'spammed', $spammed, $redirect_to );
|
||||
if ( $unspammed )
|
||||
$redirect_to = add_query_arg( 'unspammed', $unspammed, $redirect_to );
|
||||
if ( $trashed )
|
||||
$redirect_to = add_query_arg( 'trashed', $trashed, $redirect_to );
|
||||
if ( $untrashed )
|
||||
$redirect_to = add_query_arg( 'untrashed', $untrashed, $redirect_to );
|
||||
if ( $deleted )
|
||||
$redirect_to = add_query_arg( 'deleted', $deleted, $redirect_to );
|
||||
if ( $trashed || $spammed )
|
||||
$redirect_to = add_query_arg( 'ids', join(',', $comment_ids), $redirect_to );
|
||||
endforeach;
|
||||
|
||||
$redirect_to = 'edit-comments.php?deleted=' . $deleted . '&approved=' . $approved . '&spam=' . $spammed . '&unapproved=' . $unapproved;
|
||||
if ( $post_id )
|
||||
$redirect_to = add_query_arg( 'p', absint( $post_id ), $redirect_to );
|
||||
if ( isset($_REQUEST['apage']) )
|
||||
@@ -117,60 +83,43 @@ else
|
||||
|
||||
require_once('admin-header.php');
|
||||
|
||||
$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : esc_attr($_GET['mode']);
|
||||
$mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : attribute_escape($_GET['mode']);
|
||||
|
||||
$comment_status = isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all';
|
||||
if ( !in_array($comment_status, array('all', 'moderated', 'approved', 'spam', 'trash')) )
|
||||
$comment_status = 'all';
|
||||
$comment_status = !empty($_GET['comment_status']) ? attribute_escape($_GET['comment_status']) : '';
|
||||
|
||||
$comment_type = !empty($_GET['comment_type']) ? esc_attr($_GET['comment_type']) : '';
|
||||
$comment_type = !empty($_GET['comment_type']) ? attribute_escape($_GET['comment_type']) : '';
|
||||
|
||||
$search_dirty = ( isset($_GET['s']) ) ? $_GET['s'] : '';
|
||||
$search = esc_attr( $search_dirty ); ?>
|
||||
$search = attribute_escape( $search_dirty ); ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title );
|
||||
<h2><?php echo wp_specialchars( $title );
|
||||
if ( isset($_GET['s']) && $_GET['s'] )
|
||||
printf( '<span class="subtitle">' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( stripslashes( $_GET['s'] ) ), 50 ) ) . '</span>' ); ?>
|
||||
printf( '<span class="subtitle">' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( wp_specialchars( stripslashes( $_GET['s'] ) ), 50 ) ) . '</span>' ); ?>
|
||||
</h2>
|
||||
|
||||
<?php
|
||||
if ( isset($_GET['approved']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) || isset($_GET['spammed']) || isset($_GET['unspammed']) ) {
|
||||
$approved = isset($_GET['approved']) ? (int) $_GET['approved'] : 0;
|
||||
$deleted = isset($_GET['deleted']) ? (int) $_GET['deleted'] : 0;
|
||||
$trashed = isset($_GET['trashed']) ? (int) $_GET['trashed'] : 0;
|
||||
$untrashed = isset($_GET['untrashed']) ? (int) $_GET['untrashed'] : 0;
|
||||
$spammed = isset($_GET['spammed']) ? (int) $_GET['spammed'] : 0;
|
||||
$unspammed = isset($_GET['unspammed']) ? (int) $_GET['unspammed'] : 0;
|
||||
if ( isset( $_GET['approved'] ) || isset( $_GET['deleted'] ) || isset( $_GET['spam'] ) ) {
|
||||
$approved = isset( $_GET['approved'] ) ? (int) $_GET['approved'] : 0;
|
||||
$deleted = isset( $_GET['deleted'] ) ? (int) $_GET['deleted'] : 0;
|
||||
$spam = isset( $_GET['spam'] ) ? (int) $_GET['spam'] : 0;
|
||||
|
||||
if ( $approved > 0 || $deleted > 0 || $trashed > 0 || $untrashed > 0 || $spammed > 0 || $unspammed > 0 ) {
|
||||
if ( $approved > 0 || $deleted > 0 || $spam > 0 ) {
|
||||
echo '<div id="moderated" class="updated fade"><p>';
|
||||
|
||||
if ( $approved > 0 ) {
|
||||
printf( _n( '%s comment approved', '%s comments approved', $approved ), $approved );
|
||||
echo '<br />';
|
||||
}
|
||||
if ( $spammed > 0 ) {
|
||||
printf( _n( '%s comment marked as spam.', '%s comments marked as spam.', $spammed ), $spammed );
|
||||
$ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
|
||||
echo ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=unspam&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
}
|
||||
if ( $unspammed > 0 ) {
|
||||
printf( _n( '%s comment restored from the spam', '%s comments restored from the spam', $unspammed ), $unspammed );
|
||||
echo '<br />';
|
||||
}
|
||||
if ( $trashed > 0 ) {
|
||||
printf( _n( '%s comment moved to the trash.', '%s comments moved to the trash.', $trashed ), $trashed );
|
||||
$ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
|
||||
echo ' <a href="' . esc_url( wp_nonce_url( "edit-comments.php?doaction=undo&action=untrash&ids=$ids", "bulk-comments" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
}
|
||||
if ( $untrashed > 0 ) {
|
||||
printf( _n( '%s comment restored from the trash', '%s comments restored from the trash', $untrashed ), $untrashed );
|
||||
printf( __ngettext( '%s comment approved', '%s comments approved', $approved ), $approved );
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
if ( $deleted > 0 ) {
|
||||
printf( _n( '%s comment permanently deleted', '%s comments permanently deleted', $deleted ), $deleted );
|
||||
printf( __ngettext( '%s comment deleted', '%s comments deleted', $deleted ), $deleted );
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
if ( $spam > 0 ) {
|
||||
printf( __ngettext( '%s comment marked as spam', '%s comments marked as spam', $spam ), $spam );
|
||||
echo '<br />';
|
||||
}
|
||||
|
||||
@@ -187,37 +136,34 @@ $num_comments = ( $post_id ) ? wp_count_comments( $post_id ) : wp_count_comments
|
||||
//, number_format_i18n($num_comments->moderated) ), "<span class='comment-count'>" . number_format_i18n($num_comments->moderated) . "</span>"),
|
||||
//, number_format_i18n($num_comments->spam) ), "<span class='spam-comment-count'>" . number_format_i18n($num_comments->spam) . "</span>")
|
||||
$stati = array(
|
||||
'all' => _n_noop('All', 'All'), // singular not used
|
||||
'moderated' => _n_noop('Pending <span class="count">(<span class="pending-count">%s</span>)</span>', 'Pending <span class="count">(<span class="pending-count">%s</span>)</span>'),
|
||||
'approved' => _n_noop('Approved', 'Approved'), // singular not used
|
||||
'spam' => _n_noop('Spam <span class="count">(<span class="spam-count">%s</span>)</span>', 'Spam <span class="count">(<span class="spam-count">%s</span>)</span>'),
|
||||
'trash' => _n_noop('Trash <span class="count">(<span class="trash-count">%s</span>)</span>', 'Trash <span class="count">(<span class="trash-count">%s</span>)</span>')
|
||||
'all' => __ngettext_noop('All', 'All'), // singular not used
|
||||
'moderated' => __ngettext_noop('Pending (<span class="pending-count">%s</span>)', 'Pending (<span class="pending-count">%s</span>)'),
|
||||
'approved' => __ngettext_noop('Approved', 'Approved'), // singular not used
|
||||
'spam' => __ngettext_noop('Spam (<span class="spam-count">%s</span>)', 'Spam (<span class="spam-count">%s</span>)')
|
||||
);
|
||||
|
||||
if ( !EMPTY_TRASH_DAYS )
|
||||
unset($stati['trash']);
|
||||
|
||||
$class = ( '' === $comment_status ) ? ' class="current"' : '';
|
||||
// $status_links[] = "<li><a href='edit-comments.php'$class>" . __( 'All' ) . '</a>';
|
||||
$link = 'edit-comments.php';
|
||||
if ( !empty($comment_type) && 'all' != $comment_type )
|
||||
$link = add_query_arg( 'comment_type', $comment_type, $link );
|
||||
|
||||
foreach ( $stati as $status => $label ) {
|
||||
$class = '';
|
||||
|
||||
if ( $status == $comment_status )
|
||||
if ( str_replace( 'all', '', $status ) == $comment_status )
|
||||
$class = ' class="current"';
|
||||
if ( !isset( $num_comments->$status ) )
|
||||
$num_comments->$status = 10;
|
||||
$link = add_query_arg( 'comment_status', $status, $link );
|
||||
if ( 'all' != $status )
|
||||
$link = add_query_arg( 'comment_status', $status, $link );
|
||||
if ( $post_id )
|
||||
$link = add_query_arg( 'p', absint( $post_id ), $link );
|
||||
/*
|
||||
// I toyed with this, but decided against it. Leaving it in here in case anyone thinks it is a good idea. ~ Mark
|
||||
if ( !empty( $_GET['s'] ) )
|
||||
$link = add_query_arg( 's', esc_attr( stripslashes( $_GET['s'] ) ), $link );
|
||||
$link = add_query_arg( 's', attribute_escape( stripslashes( $_GET['s'] ) ), $link );
|
||||
*/
|
||||
$status_links[] = "<li class='$status'><a href='$link'$class>" . sprintf(
|
||||
_n( $label[0], $label[1], $num_comments->$status ),
|
||||
__ngettext( $label[0], $label[1], $num_comments->$status ),
|
||||
number_format_i18n( $num_comments->$status )
|
||||
) . '</a>';
|
||||
}
|
||||
@@ -230,16 +176,13 @@ unset($status_links);
|
||||
</ul>
|
||||
|
||||
<p class="search-box">
|
||||
<label class="screen-reader-text" for="comment-search-input"><?php _e( 'Search Comments' ); ?>:</label>
|
||||
<input type="text" id="comment-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<input type="submit" value="<?php esc_attr_e( 'Search Comments' ); ?>" class="button" />
|
||||
<label class="hidden" for="comment-search-input"><?php _e( 'Search Comments' ); ?>:</label>
|
||||
<input type="text" class="search-input" id="comment-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<input type="submit" value="<?php _e( 'Search Comments' ); ?>" class="button" />
|
||||
</p>
|
||||
|
||||
<?php
|
||||
$comments_per_page = (int) get_user_option( 'edit_comments_per_page', 0, false );
|
||||
if ( empty( $comments_per_page ) || $comments_per_page < 1 )
|
||||
$comments_per_page = 20;
|
||||
$comments_per_page = apply_filters( 'comments_per_page', $comments_per_page, $comment_status );
|
||||
$comments_per_page = apply_filters('comments_per_page', 20, $comment_status);
|
||||
|
||||
if ( isset( $_GET['apage'] ) )
|
||||
$page = abs( (int) $_GET['apage'] );
|
||||
@@ -248,7 +191,7 @@ else
|
||||
|
||||
$start = $offset = ( $page - 1 ) * $comments_per_page;
|
||||
|
||||
list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 8, $post_id, $comment_type ); // Grab a few extra
|
||||
list($_comments, $total) = _wp_get_comment_list( $comment_status, $search_dirty, $start, $comments_per_page + 5, $post_id, $comment_type ); // Grab a few extra
|
||||
|
||||
$_comment_post_ids = array();
|
||||
foreach ( $_comments as $_c ) {
|
||||
@@ -274,12 +217,12 @@ $page_links = paginate_links( array(
|
||||
|
||||
?>
|
||||
|
||||
<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
|
||||
<input type="hidden" name="mode" value="<?php echo $mode; ?>" />
|
||||
<?php if ( $post_id ) : ?>
|
||||
<input type="hidden" name="p" value="<?php echo esc_attr( intval( $post_id ) ); ?>" />
|
||||
<input type="hidden" name="p" value="<?php echo intval( $post_id ); ?>" />
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
|
||||
<input type="hidden" name="pagegen_timestamp" value="<?php echo esc_attr(current_time('mysql', 1)); ?>" />
|
||||
<input type="hidden" name="comment_status" value="<?php echo $comment_status; ?>" />
|
||||
<input type="hidden" name="pagegen_timestamp" value="<?php echo current_time('mysql', 1); ?>" />
|
||||
|
||||
<div class="tablenav">
|
||||
|
||||
@@ -287,40 +230,29 @@ $page_links = paginate_links( array(
|
||||
<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
|
||||
number_format_i18n( $start + 1 ),
|
||||
number_format_i18n( min( $page * $comments_per_page, $total ) ),
|
||||
'<span class="total-type-count">' . number_format_i18n( $total ) . '</span>',
|
||||
number_format_i18n( $total ),
|
||||
$page_links
|
||||
); echo $page_links_text; ?></div>
|
||||
<input type="hidden" name="_total" value="<?php echo esc_attr($total); ?>" />
|
||||
<input type="hidden" name="_per_page" value="<?php echo esc_attr($comments_per_page); ?>" />
|
||||
<input type="hidden" name="_page" value="<?php echo esc_attr($page); ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="alignleft actions">
|
||||
<select name="action">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions') ?></option>
|
||||
<?php if ( 'all' == $comment_status || 'approved' == $comment_status ): ?>
|
||||
<?php if ( empty($comment_status) || 'approved' == $comment_status ): ?>
|
||||
<option value="unapprove"><?php _e('Unapprove'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'all' == $comment_status || 'moderated' == $comment_status || 'spam' == $comment_status ): ?>
|
||||
<?php if ( empty($comment_status) || 'moderated' == $comment_status || 'spam' == $comment_status ): ?>
|
||||
<option value="approve"><?php _e('Approve'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?>
|
||||
<option value="spam"><?php _e('Mark as Spam'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'trash' == $comment_status ): ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php elseif ( 'spam' == $comment_status ): ?>
|
||||
<option value="unspam"><?php _e('Not Spam'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'trash' == $comment_status || 'spam' == $comment_status || !EMPTY_TRASH_DAYS ): ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php else: ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php if ( 'spam' != $comment_status ): ?>
|
||||
<option value="markspam"><?php _e('Mark as Spam'); ?></option>
|
||||
<?php endif; ?>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" name="doaction" id="doaction" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary apply" />
|
||||
<input type="submit" name="doaction" id="doaction" value="<?php _e('Apply'); ?>" class="button-secondary apply" />
|
||||
<?php wp_nonce_field('bulk-comments'); ?>
|
||||
|
||||
<?php if ( $comment_status ) echo "<input type='hidden' name='comment_status' value='$comment_status' />\n"; ?>
|
||||
<select name="comment_type">
|
||||
<option value="all"><?php _e('Show all comment types'); ?></option>
|
||||
<?php
|
||||
@@ -330,25 +262,23 @@ $page_links = paginate_links( array(
|
||||
) );
|
||||
|
||||
foreach ( $comment_types as $type => $label ) {
|
||||
echo " <option value='" . esc_attr($type) . "'";
|
||||
echo " <option value='$type'";
|
||||
selected( $comment_type, $type );
|
||||
echo ">$label</option>\n";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
|
||||
<input type="submit" id="post-query-submit" value="<?php _e('Filter'); ?>" class="button-secondary" />
|
||||
|
||||
<?php if ( isset($_GET['apage']) ) { ?>
|
||||
<input type="hidden" name="apage" value="<?php echo esc_attr( absint( $_GET['apage'] ) ); ?>" />
|
||||
<input type="hidden" name="apage" value="<?php echo absint( $_GET['apage'] ); ?>" />
|
||||
<?php }
|
||||
|
||||
if ( ( 'spam' == $comment_status || 'trash' == $comment_status) && current_user_can ('moderate_comments') ) {
|
||||
wp_nonce_field('bulk-destroy', '_destroy_nonce');
|
||||
if ( 'spam' == $comment_status && current_user_can('moderate_comments') ) { ?>
|
||||
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
|
||||
<?php } elseif ( 'trash' == $comment_status && current_user_can('moderate_comments') ) { ?>
|
||||
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php }
|
||||
if ( 'spam' == $comment_status ) {
|
||||
wp_nonce_field('bulk-spam-delete', '_spam_nonce');
|
||||
if ( current_user_can ('moderate_comments')) { ?>
|
||||
<input type="submit" name="delete_all_spam" value="<?php _e('Delete All Spam'); ?>" class="button-secondary apply" />
|
||||
<?php }
|
||||
} ?>
|
||||
<?php do_action('manage_comments_nav', $comment_status); ?>
|
||||
</div>
|
||||
@@ -396,32 +326,21 @@ if ( $page_links )
|
||||
<div class="alignleft actions">
|
||||
<select name="action2">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions') ?></option>
|
||||
<?php if ( 'all' == $comment_status || 'approved' == $comment_status ): ?>
|
||||
<?php if ( empty($comment_status) || 'approved' == $comment_status ): ?>
|
||||
<option value="unapprove"><?php _e('Unapprove'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'all' == $comment_status || 'moderated' == $comment_status || 'spam' == $comment_status ): ?>
|
||||
<?php if ( empty($comment_status) || 'moderated' == $comment_status || 'spam' == $comment_status ): ?>
|
||||
<option value="approve"><?php _e('Approve'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'all' == $comment_status || 'approved' == $comment_status || 'moderated' == $comment_status ): ?>
|
||||
<option value="spam"><?php _e('Mark as Spam'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'trash' == $comment_status ): ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php endif; ?>
|
||||
<?php if ( 'trash' == $comment_status || 'spam' == $comment_status || !EMPTY_TRASH_DAYS ): ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php elseif ( 'spam' == $comment_status ): ?>
|
||||
<option value="unspam"><?php _e('Not Spam'); ?></option>
|
||||
<?php else: ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php if ( 'spam' != $comment_status ): ?>
|
||||
<option value="markspam"><?php _e('Mark as Spam'); ?></option>
|
||||
<?php endif; ?>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" name="doaction2" id="doaction2" value="<?php esc_attr_e('Apply'); ?>" class="button-secondary apply" />
|
||||
<input type="submit" name="doaction2" id="doaction2" value="<?php _e('Apply'); ?>" class="button-secondary apply" />
|
||||
|
||||
<?php if ( 'spam' == $comment_status && current_user_can('moderate_comments') ) { ?>
|
||||
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Spam'); ?>" class="button-secondary apply" />
|
||||
<?php } elseif ( 'trash' == $comment_status && current_user_can('moderate_comments') ) { ?>
|
||||
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php if ( 'spam' == $comment_status ) { ?>
|
||||
<input type="submit" name="delete_all_spam2" value="<?php _e('Delete All Spam'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
<?php do_action('manage_comments_nav', $comment_status); ?>
|
||||
</div>
|
||||
@@ -432,19 +351,18 @@ if ( $page_links )
|
||||
</form>
|
||||
|
||||
<form id="get-extra-comments" method="post" action="" class="add:the-extra-comment-list:" style="display: none;">
|
||||
<input type="hidden" name="s" value="<?php echo esc_attr($search); ?>" />
|
||||
<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
|
||||
<input type="hidden" name="comment_status" value="<?php echo esc_attr($comment_status); ?>" />
|
||||
<input type="hidden" name="page" value="<?php echo esc_attr($page); ?>" />
|
||||
<input type="hidden" name="per_page" value="<?php echo esc_attr($comments_per_page); ?>" />
|
||||
<input type="hidden" name="p" value="<?php echo esc_attr( $post_id ); ?>" />
|
||||
<input type="hidden" name="comment_type" value="<?php echo esc_attr( $comment_type ); ?>" />
|
||||
<input type="hidden" name="s" value="<?php echo $search; ?>" />
|
||||
<input type="hidden" name="mode" value="<?php echo $mode; ?>" />
|
||||
<input type="hidden" name="comment_status" value="<?php echo $comment_status; ?>" />
|
||||
<input type="hidden" name="page" value="<?php echo isset($_REQUEST['page']) ? absint( $_REQUEST['page'] ) : 1; ?>" />
|
||||
<input type="hidden" name="p" value="<?php echo attribute_escape( $post_id ); ?>" />
|
||||
<input type="hidden" name="comment_type" value="<?php echo attribute_escape( $comment_type ); ?>" />
|
||||
<?php wp_nonce_field( 'add-comment', '_ajax_nonce', false ); ?>
|
||||
</form>
|
||||
|
||||
<div id="ajax-response"></div>
|
||||
|
||||
<?php } elseif ( 'moderated' == $comment_status ) { ?>
|
||||
<?php } elseif ( 'moderated' == $_GET['comment_status'] ) { ?>
|
||||
<p><?php _e('No comments awaiting moderation… yet.') ?></p>
|
||||
</form>
|
||||
|
||||
@@ -455,7 +373,21 @@ if ( $page_links )
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
(function($){
|
||||
$(document).ready(function(){
|
||||
$('#doaction, #doaction2').click(function(){
|
||||
if ( $('select[name^="action"]').val() == 'delete' ) {
|
||||
var m = '<?php echo js_escape(__("You are about to delete the selected comments.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
|
||||
return showNotice.warn(m);
|
||||
}
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
<?php
|
||||
wp_comment_reply('-1', true, 'detail');
|
||||
wp_comment_trashnotice();
|
||||
include('admin-footer.php'); ?>
|
||||
|
||||
@@ -6,75 +6,48 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
|
||||
/**
|
||||
* Post ID global
|
||||
* @name $post_ID
|
||||
* @var int
|
||||
*/
|
||||
$post_ID = isset($post_ID) ? (int) $post_ID : 0;
|
||||
if ( ! isset( $post_ID ) )
|
||||
$post_ID = 0;
|
||||
else
|
||||
$post_ID = (int) $post_ID;
|
||||
|
||||
$action = isset($action) ? $action : '';
|
||||
|
||||
$message = false;
|
||||
if ( isset($_GET['message']) ) {
|
||||
if ( isset($_GET['message']) )
|
||||
$_GET['message'] = absint( $_GET['message'] );
|
||||
$messages[1] = sprintf( __( 'Post updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
|
||||
$messages[2] = __('Custom field updated.');
|
||||
$messages[3] = __('Custom field deleted.');
|
||||
$messages[4] = __('Post updated.');
|
||||
$messages[6] = sprintf(__('Post published. <a href="%s">View post</a>'), get_permalink($post_ID));
|
||||
$messages[7] = __('Post saved.');
|
||||
$messages[8] = sprintf(__('Post submitted. <a href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
|
||||
|
||||
switch ( $_GET['message'] ) {
|
||||
case 1:
|
||||
$message = sprintf( __('Post updated. <a href="%s">View post</a>'), get_permalink($post_ID) );
|
||||
break;
|
||||
case 2:
|
||||
$message = __('Custom field updated.');
|
||||
break;
|
||||
case 3:
|
||||
$message = __('Custom field deleted.');
|
||||
break;
|
||||
case 4:
|
||||
$message = __('Post updated.');
|
||||
break;
|
||||
case 5:
|
||||
if ( isset($_GET['revision']) )
|
||||
$message = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
|
||||
break;
|
||||
case 6:
|
||||
$message = sprintf( __('Post published. <a href="%s">View post</a>'), get_permalink($post_ID) );
|
||||
break;
|
||||
case 7:
|
||||
$message = __('Post saved.');
|
||||
break;
|
||||
case 8:
|
||||
$message = sprintf( __('Post submitted. <a target="_blank" href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
|
||||
break;
|
||||
case 9:
|
||||
// translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php
|
||||
$message = sprintf( __('Post scheduled for: <b>%1$s</b>. <a target="_blank" href="%2$s">Preview post</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) );
|
||||
break;
|
||||
case 10:
|
||||
$message = sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( isset($_GET['revision']) )
|
||||
$messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
|
||||
|
||||
$notice = false;
|
||||
$notices[1] = __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' );
|
||||
|
||||
if ( 0 == $post_ID ) {
|
||||
$form_action = 'post';
|
||||
$temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post()
|
||||
$form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='" . esc_attr($temp_ID) . "' />";
|
||||
$form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />";
|
||||
$autosave = false;
|
||||
} else {
|
||||
$form_action = 'editpost';
|
||||
$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='" . esc_attr($post_ID) . "' />";
|
||||
$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
|
||||
$autosave = wp_get_post_autosave( $post_ID );
|
||||
|
||||
// Detect if there exists an autosave newer than the post and if that autosave is different than the post
|
||||
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) ) {
|
||||
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) {
|
||||
foreach ( _wp_post_revision_fields() as $autosave_field => $_autosave_field ) {
|
||||
if ( normalize_whitespace( $autosave->$autosave_field ) != normalize_whitespace( $post->$autosave_field ) ) {
|
||||
$notice = sprintf( __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' ), get_edit_post_link( $autosave->ID ) );
|
||||
$notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -83,43 +56,445 @@ if ( 0 == $post_ID ) {
|
||||
}
|
||||
|
||||
// All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action).
|
||||
require_once('includes/meta-boxes.php');
|
||||
|
||||
add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'post', 'side', 'core');
|
||||
/**
|
||||
* Display post submit form fields.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_submit_meta_box($post) {
|
||||
global $action;
|
||||
|
||||
// all tag-style post taxonomies
|
||||
foreach ( get_object_taxonomies('post') as $tax_name ) {
|
||||
if ( !is_taxonomy_hierarchical($tax_name) ) {
|
||||
$taxonomy = get_taxonomy($tax_name);
|
||||
$label = isset($taxonomy->label) ? esc_attr($taxonomy->label) : $tax_name;
|
||||
$can_publish = current_user_can('publish_posts');
|
||||
?>
|
||||
<div class="submitbox" id="submitpost">
|
||||
|
||||
add_meta_box('tagsdiv-' . $tax_name, $label, 'post_tags_meta_box', 'post', 'side', 'core');
|
||||
}
|
||||
<div id="minor-publishing">
|
||||
|
||||
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
|
||||
<div style="display:none;">
|
||||
<input type="submit" name="save" value="<?php echo attribute_escape( __('Save') ); ?>" />
|
||||
</div>
|
||||
|
||||
<div id="minor-publishing-actions">
|
||||
<div id="save-action">
|
||||
<?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
|
||||
<input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" />
|
||||
<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
|
||||
<input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save as Pending') ); ?>" tabindex="4" class="button button-highlighted" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="preview-action">
|
||||
<?php $preview_link = 'publish' == $post->post_status ? clean_url(get_permalink($post->ID)) : clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>
|
||||
|
||||
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php _e('Preview'); ?></a>
|
||||
<input type="hidden" name="wp-preview" id="wp-preview" value="" />
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div><?php // /minor-publishing-actions ?>
|
||||
|
||||
<div id="misc-publishing-actions">
|
||||
|
||||
<div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label>
|
||||
<b><span id="post-status-display">
|
||||
<?php
|
||||
switch ( $post->post_status ) {
|
||||
case 'private':
|
||||
_e('Privately Published');
|
||||
break;
|
||||
case 'publish':
|
||||
_e('Published');
|
||||
break;
|
||||
case 'future':
|
||||
_e('Scheduled');
|
||||
break;
|
||||
case 'pending':
|
||||
_e('Pending Review');
|
||||
break;
|
||||
case 'draft':
|
||||
_e('Draft');
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</span></b>
|
||||
<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
|
||||
<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
|
||||
|
||||
<div id="post-status-select" class="hide-if-js">
|
||||
<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" />
|
||||
<select name='post_status' id='post_status' tabindex='4'>
|
||||
<?php if ( 'publish' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
|
||||
<?php elseif ( 'private' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
|
||||
<?php elseif ( 'future' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
|
||||
<?php endif; ?>
|
||||
<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
|
||||
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
|
||||
</select>
|
||||
<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
</div><?php // /misc-pub-section ?>
|
||||
|
||||
<div class="misc-pub-section " id="visibility">
|
||||
<?php _e('Visibility:'); ?> <b><span id="post-visibility-display"><?php
|
||||
|
||||
if ( 'private' == $post->post_status ) {
|
||||
$post->post_password = '';
|
||||
$visibility = 'private';
|
||||
$visibility_trans = __('Private');
|
||||
} elseif ( !empty( $post->post_password ) ) {
|
||||
$visibility = 'password';
|
||||
$visibility_trans = __('Password protected');
|
||||
} elseif ( is_sticky( $post->ID ) ) {
|
||||
$visibility = 'public';
|
||||
$visibility_trans = __('Public, Sticky');
|
||||
} else {
|
||||
$visibility = 'public';
|
||||
$visibility_trans = __('Public');
|
||||
}
|
||||
|
||||
?><?php echo wp_specialchars( $visibility_trans ); ?></span></b> <?php if ( $can_publish ) { ?> <a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
|
||||
|
||||
<div id="post-visibility-select" class="hide-if-js">
|
||||
<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo attribute_escape($post->post_password); ?>" />
|
||||
<input type="checkbox" style="display:none" name="hidden_post_sticky" id="hidden-post-sticky" value="sticky" <?php checked(is_sticky($post->ID), true); ?> />
|
||||
<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo attribute_escape( $visibility ); ?>" />
|
||||
|
||||
|
||||
<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
|
||||
<span id="sticky-span"><input id="sticky" name="sticky" type="checkbox" value="sticky" <?php checked(is_sticky($post->ID), true); ?> tabindex="4" /> <label for="sticky" class="selectit"><?php _e('Stick this post to the front page') ?></label><br /></span>
|
||||
<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
|
||||
<span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo attribute_escape($post->post_password); ?>" /><br /></span>
|
||||
<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
|
||||
|
||||
<p>
|
||||
<a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div><?php // /misc-pub-section ?>
|
||||
|
||||
|
||||
<?php
|
||||
$datef = _c( 'M j, Y @ G:i|Publish box date format');
|
||||
if ( 0 != $post->ID ) {
|
||||
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
|
||||
$stamp = __('Scheduled for: <b>%1$s</b>');
|
||||
} else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
|
||||
$stamp = __('Published on: <b>%1$s</b>');
|
||||
} else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
|
||||
$stamp = __('Publish <b>immediately</b>');
|
||||
} else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
|
||||
$stamp = __('Schedule for: <b>%1$s</b>');
|
||||
} else { // draft, 1 or more saves, date specified
|
||||
$stamp = __('Publish on: <b>%1$s</b>');
|
||||
}
|
||||
$date = date_i18n( $datef, strtotime( $post->post_date ) );
|
||||
} else { // draft (no saves, and thus no date specified)
|
||||
$stamp = __('Publish <b>immediately</b>');
|
||||
$date = date_i18n( $datef, strtotime( current_time('mysql') ) );
|
||||
}
|
||||
?>
|
||||
<?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
|
||||
<div class="misc-pub-section curtime misc-pub-section-last">
|
||||
<span id="timestamp">
|
||||
<?php printf($stamp, $date); ?></span>
|
||||
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
|
||||
<div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
|
||||
</div><?php // /misc-pub-section ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="major-publishing-actions">
|
||||
<?php do_action('post_submitbox_start'); ?>
|
||||
<div id="delete-action">
|
||||
<?php
|
||||
if ( ( 'edit' == $action ) && current_user_can('delete_post', $post->ID) ) { ?>
|
||||
<a class="submitdelete deletion" href="<?php echo wp_nonce_url("post.php?action=delete&post=$post->ID", 'delete-post_' . $post->ID); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this post '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="publishing-action">
|
||||
<?php
|
||||
if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?>
|
||||
<?php if ( current_user_can('publish_posts') ) : ?>
|
||||
<?php if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Schedule') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Schedule') ?>" />
|
||||
<?php else : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Publish') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Submit for Review') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
|
||||
<?php endif; ?>
|
||||
<?php } else { ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Update Post') ?>" />
|
||||
<input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Update Post') ?>" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'post', 'side', 'core');
|
||||
|
||||
/**
|
||||
* Display post tags form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_tags_meta_box($post) {
|
||||
?>
|
||||
<p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>
|
||||
<div id="tagchecklist"></div>
|
||||
<p id="tagcloud-link" class="hide-if-no-js"><a href='#'><?php _e( 'Choose from the most popular tags' ); ?></a></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'side', 'core');
|
||||
|
||||
/**
|
||||
* Display post categories form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_categories_meta_box($post) {
|
||||
?>
|
||||
<ul id="category-tabs">
|
||||
<li class="ui-tabs-selected"><a href="#categories-all" tabindex="3"><?php _e( 'All Categories' ); ?></a></li>
|
||||
<li class="hide-if-no-js"><a href="#categories-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>
|
||||
</ul>
|
||||
|
||||
<div id="categories-pop" class="ui-tabs-panel" style="display: none;">
|
||||
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >
|
||||
<?php $popular_ids = wp_popular_terms_checklist('category'); ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="categories-all" class="ui-tabs-panel">
|
||||
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
|
||||
<?php wp_category_checklist($post->ID, false, false, $popular_ids) ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php if ( current_user_can('manage_categories') ) : ?>
|
||||
<div id="category-adder" class="wp-hidden-children">
|
||||
<h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>
|
||||
<p id="category-add" class="wp-hidden-child">
|
||||
<label class="hidden" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" aria-required="true"/>
|
||||
<label class="hidden" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>
|
||||
<input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _e( 'Add' ); ?>" tabindex="3" />
|
||||
<?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>
|
||||
<span id="category-ajax-response"></span>
|
||||
</p>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
}
|
||||
add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'side', 'core');
|
||||
if ( current_theme_supports( 'post-thumbnails', 'post' ) )
|
||||
add_meta_box('postimagediv', __('Post Thumbnail'), 'post_thumbnail_meta_box', 'post', 'side', 'low');
|
||||
|
||||
/**
|
||||
* Display post password form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_password_meta_box($post) {
|
||||
?>
|
||||
<p>
|
||||
<label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex="4" /> <?php _e('Keep this post private') ?></label>
|
||||
</p>
|
||||
<h4><?php _e( 'Post Password' ); ?></h4>
|
||||
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php the_post_password(); ?>" /></p>
|
||||
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
// add_meta_box('passworddiv', __('Privacy Options'), 'post_password_meta_box', 'post', 'side', 'core');
|
||||
|
||||
/**
|
||||
* Display post excerpt form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_excerpt_meta_box($post) {
|
||||
?>
|
||||
<label class="hidden" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>
|
||||
<p><?php _e('Excerpts are optional hand-crafted summaries of your content. You can <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" target="_blank">use them in your template</a>'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display trackback links form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_trackback_meta_box($post) {
|
||||
$form_trackback = '<input type="text" name="trackback_url" id="trackback_url" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';
|
||||
if ('' != $post->pinged) {
|
||||
$pings = '<p>'. __('Already pinged:') . '</p><ul>';
|
||||
$already_pinged = explode("\n", trim($post->pinged));
|
||||
foreach ($already_pinged as $pinged_url) {
|
||||
$pings .= "\n\t<li>" . wp_specialchars($pinged_url) . "</li>";
|
||||
}
|
||||
$pings .= '</ul>';
|
||||
}
|
||||
|
||||
?>
|
||||
<p><label for="trackback_url"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>
|
||||
<p><?php _e('Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress blogs they’ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>
|
||||
<?php
|
||||
if ( ! empty($pings) )
|
||||
echo $pings;
|
||||
}
|
||||
add_meta_box('trackbacksdiv', __('Send Trackbacks'), 'post_trackback_meta_box', 'post', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display custom fields for the post form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_custom_meta_box($post) {
|
||||
?>
|
||||
<div id="postcustomstuff">
|
||||
<div id="ajax-response"></div>
|
||||
<?php
|
||||
$metadata = has_meta($post->ID);
|
||||
list_meta($metadata);
|
||||
meta_form();
|
||||
?>
|
||||
</div>
|
||||
<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'normal', 'core');
|
||||
|
||||
do_action('dbx_post_advanced');
|
||||
|
||||
/**
|
||||
* Display comment status for post form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_comment_status_meta_box($post) {
|
||||
global $wpdb, $post_ID;
|
||||
?>
|
||||
<input name="advanced_view" type="hidden" value="1" />
|
||||
<p class="meta-options">
|
||||
<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 on this post') ?></label><br />
|
||||
<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 <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a> on this post') ?></label>
|
||||
</p>
|
||||
<?php
|
||||
$total = $wpdb->get_var($wpdb->prepare("SELECT count(1) FROM $wpdb->comments WHERE comment_post_ID = '%d' AND ( comment_approved = '0' OR comment_approved = '1')", $post_ID));
|
||||
|
||||
if ( !$post_ID || $post_ID < 0 || 1 > $total )
|
||||
return;
|
||||
|
||||
wp_nonce_field( 'get-comments', 'add_comment_nonce', false );
|
||||
?>
|
||||
|
||||
<table class="widefat comments-box fixed" cellspacing="0" style="display:none;">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="column-author"><?php _e('Author') ?></th>
|
||||
<th scope="col" class="column-comment"><?php echo _c('Comment|noun') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="the-comment-list" class="list:comment">
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="hide-if-no-js"><a href="#commentstatusdiv" id="show-comments" onclick="commentsBox.get(<?php echo $total; ?>);return false;"><?php _e('Show comments'); ?></a> <img class="waiting" style="display:none;" src="images/loading.gif" alt="" /></p>
|
||||
<?php
|
||||
$hidden = get_hidden_meta_boxes('post');
|
||||
if ( ! in_array('commentstatusdiv', $hidden) ) { ?>
|
||||
<script type="text/javascript">commentsBox.get(<?php echo $total; ?>, 10);</script>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'post', 'normal', 'core');
|
||||
|
||||
if ( 'publish' == $post->post_status || 'private' == $post->post_status )
|
||||
add_meta_box('commentsdiv', __('Comments'), 'post_comment_meta_box', 'post', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display post slug form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_slug_meta_box($post) {
|
||||
?>
|
||||
<label class="hidden" for="post_name"><?php _e('Post Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
|
||||
<?php
|
||||
}
|
||||
if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) )
|
||||
add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'normal', 'core');
|
||||
|
||||
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
|
||||
if ( $post->post_author && !in_array($post->post_author, $authors) )
|
||||
$authors[] = $post->post_author;
|
||||
if ( $authors && count( $authors ) > 1 )
|
||||
add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'normal', 'core');
|
||||
if ( $authors && count( $authors ) > 1 ) :
|
||||
/**
|
||||
* Display form field with list of authors.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_author_meta_box($post) {
|
||||
global $current_user, $user_ID;
|
||||
$authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM
|
||||
if ( $post->post_author && !in_array($post->post_author, $authors) )
|
||||
$authors[] = $post->post_author;
|
||||
?>
|
||||
<label class="hidden" for="post_author_override"><?php _e('Post Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'normal', 'core');
|
||||
endif;
|
||||
|
||||
if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) )
|
||||
add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'normal', 'core');
|
||||
if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
|
||||
/**
|
||||
* Display list of post revisions.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function post_revisions_meta_box($post) {
|
||||
wp_list_post_revisions();
|
||||
}
|
||||
add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'normal', 'core');
|
||||
endif;
|
||||
|
||||
do_action('do_meta_boxes', 'post', 'normal', $post);
|
||||
do_action('do_meta_boxes', 'post', 'advanced', $post);
|
||||
@@ -129,14 +504,18 @@ require_once('admin-header.php');
|
||||
|
||||
?>
|
||||
|
||||
<?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?>
|
||||
<input type="hidden" name="mode" value="bookmarklet" />
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
<h2><?php echo wp_specialchars( $title ); ?></h2>
|
||||
<?php if ( $notice ) : ?>
|
||||
<div id="notice" class="error"><p><?php echo $notice ?></p></div>
|
||||
<?php endif; ?>
|
||||
<?php if ( $message ) : ?>
|
||||
<div id="message" class="updated fade"><p><?php echo $message; ?></p></div>
|
||||
<?php if (isset($_GET['message'])) : ?>
|
||||
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
|
||||
<?php endif; ?>
|
||||
<form name="post" action="post.php" method="post" id="post">
|
||||
<?php
|
||||
@@ -149,19 +528,18 @@ else
|
||||
?>
|
||||
|
||||
<input type="hidden" id="user-id" name="user_ID" value="<?php echo (int) $user_ID ?>" />
|
||||
<input type="hidden" id="hiddenaction" name="action" value="<?php echo esc_attr($form_action) ?>" />
|
||||
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr($form_action) ?>" />
|
||||
<input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
|
||||
<input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr($post->post_type) ?>" />
|
||||
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr($post->post_status) ?>" />
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php echo esc_url(stripslashes(wp_get_referer())); ?>" />
|
||||
<?php
|
||||
if ( 'draft' != $post->post_status )
|
||||
wp_original_referer_field(true, 'previous');
|
||||
<input type="hidden" id="hiddenaction" name="action" value="<?php echo $form_action ?>" />
|
||||
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
|
||||
<input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
|
||||
<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
|
||||
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
|
||||
<?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>
|
||||
|
||||
echo $form_extra ?>
|
||||
<?php echo $form_extra ?>
|
||||
|
||||
<div id="poststuff" class="metabox-holder">
|
||||
|
||||
<div id="poststuff" class="metabox-holder<?php echo 2 == $screen_layout_columns ? ' has-right-sidebar' : ''; ?>">
|
||||
<div id="side-info-column" class="inner-sidebar">
|
||||
|
||||
<?php do_action('submitpost_box'); ?>
|
||||
@@ -169,25 +547,21 @@ echo $form_extra ?>
|
||||
<?php $side_meta_boxes = do_meta_boxes('post', 'side', $post); ?>
|
||||
</div>
|
||||
|
||||
<div id="post-body">
|
||||
<div id="post-body-content">
|
||||
<div id="post-body" class="<?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?>">
|
||||
<div id="post-body-content" class="has-sidebar-content">
|
||||
<div id="titlediv">
|
||||
<div id="titlewrap">
|
||||
<label class="screen-reader-text" for="title"><?php _e('Title') ?></label>
|
||||
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
|
||||
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape($post->post_title); ?>" id="title" autocomplete="off" />
|
||||
</div>
|
||||
<div class="inside">
|
||||
<?php
|
||||
$sample_permalink_html = get_sample_permalink_html($post->ID);
|
||||
if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) ) { ?>
|
||||
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
|
||||
<?php if ( !( 'pending' == $post->post_status && !current_user_can( 'publish_posts' ) ) ) { ?>
|
||||
<div id="edit-slug-box">
|
||||
<?php
|
||||
if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
|
||||
echo $sample_permalink_html;
|
||||
<?php if ( ! empty($post->ID) && ! empty($sample_permalink_html) ) :
|
||||
echo $sample_permalink_html;
|
||||
endif; ?>
|
||||
</div>
|
||||
<?php
|
||||
} ?>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -195,30 +569,32 @@ endif; ?>
|
||||
|
||||
<?php the_editor($post->post_content); ?>
|
||||
|
||||
<table id="post-status-info" cellspacing="0"><tbody><tr>
|
||||
<td id="wp-word-count"></td>
|
||||
<td class="autosave-info">
|
||||
<div id="post-status-info">
|
||||
<span id="wp-word-count" class="alignleft"></span>
|
||||
<span class="alignright">
|
||||
<span id="autosave"> </span>
|
||||
<?php
|
||||
if ( $post_ID ) {
|
||||
echo '<span id="last-edit">';
|
||||
if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
|
||||
$last_user = get_userdata($last_id);
|
||||
printf(__('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
||||
printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
||||
} else {
|
||||
printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
||||
}
|
||||
echo '</span>';
|
||||
} ?>
|
||||
</td>
|
||||
</tr></tbody></table>
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<br class="clear" />
|
||||
</div>
|
||||
|
||||
<?php
|
||||
wp_nonce_field( 'autosave', 'autosavenonce', false );
|
||||
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
||||
wp_nonce_field( 'getpermalink', 'getpermalinknonce', false );
|
||||
wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
|
||||
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
|
||||
|
||||
<?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
|
||||
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
|
||||
<?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?>
|
||||
<?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?>
|
||||
<?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
@@ -229,7 +605,9 @@ do_action('edit_form_advanced');
|
||||
|
||||
do_meta_boxes('post', 'advanced', $post);
|
||||
|
||||
do_action('dbx_post_sidebar'); ?>
|
||||
do_action('dbx_post_sidebar');
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,18 +6,13 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
$submitbutton_text = __('Edit Comment');
|
||||
$toprow_title = sprintf(__('Editing Comment # %s'), $comment->comment_ID);
|
||||
$form_action = 'editedcomment';
|
||||
$form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . esc_attr($comment->comment_ID) . "' />\n<input type='hidden' name='comment_post_ID' value='" . esc_attr($comment->comment_post_ID);
|
||||
$comment->comment_author_email = esc_attr($comment->comment_author_email);
|
||||
$form_extra = "' />\n<input type='hidden' name='comment_ID' value='" . $comment->comment_ID . "' />\n<input type='hidden' name='comment_post_ID' value='" . $comment->comment_post_ID;
|
||||
?>
|
||||
|
||||
<form name="post" action="comment.php" method="post" id="post">
|
||||
@@ -26,9 +21,15 @@ $comment->comment_author_email = esc_attr($comment->comment_author_email);
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php _e('Edit Comment'); ?></h2>
|
||||
|
||||
<div id="poststuff" class="metabox-holder has-right-sidebar">
|
||||
<div id="poststuff" class="metabox-holder">
|
||||
<input type="hidden" name="user_ID" value="<?php echo (int) $user_ID ?>" />
|
||||
<input type="hidden" name="action" value='<?php echo $form_action . $form_extra ?>' />
|
||||
<?php
|
||||
|
||||
$email = attribute_escape( $comment->comment_author_email );
|
||||
$url = attribute_escape( $comment->comment_author_url );
|
||||
// add_meta_box('submitdiv', __('Save'), 'comment_submit_meta_box', 'comment', 'side', 'core');
|
||||
?>
|
||||
|
||||
<div id="side-info-column" class="inner-sidebar">
|
||||
<div id="submitdiv" class="stuffbox" >
|
||||
@@ -47,15 +48,14 @@ $comment->comment_author_email = esc_attr($comment->comment_author_email);
|
||||
<div id="misc-publishing-actions">
|
||||
|
||||
<div class="misc-pub-section" id="comment-status-radio">
|
||||
<label class="approved"><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php /* translators: comment type radio button */ echo _x('Approved', 'adjective') ?></label><br />
|
||||
<label class="waiting"><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php /* translators: comment type radio button */ echo _x('Pending', 'adjective') ?></label><br />
|
||||
<label class="spam"><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php /* translators: comment type radio button */ echo _x('Spam', 'adjective'); ?></label>
|
||||
<label class="approved"><input type="radio"<?php checked( $comment->comment_approved, '1' ); ?> name="comment_status" value="1" /><?php echo _c('Approved|adjective') ?></label><br />
|
||||
<label class="waiting"><input type="radio"<?php checked( $comment->comment_approved, '0' ); ?> name="comment_status" value="0" /><?php echo _c('Pending|adjective') ?></label><br />
|
||||
<label class="spam"><input type="radio"<?php checked( $comment->comment_approved, 'spam' ); ?> name="comment_status" value="spam" /><?php echo _c('Spam|adjective'); ?></label>
|
||||
</div>
|
||||
|
||||
<div class="misc-pub-section curtime misc-pub-section-last">
|
||||
<?php
|
||||
// translators: Publish box date formt, see http://php.net/date
|
||||
$datef = __( 'M j, Y @ G:i' );
|
||||
$datef = _c( 'M j, Y @ G:i|Publish box date format');
|
||||
$stamp = __('Submitted on: <b>%1$s</b>');
|
||||
$date = date_i18n( $datef, strtotime( $comment->comment_date ) );
|
||||
?>
|
||||
@@ -68,10 +68,10 @@ $date = date_i18n( $datef, strtotime( $comment->comment_date ) );
|
||||
|
||||
<div id="major-publishing-actions">
|
||||
<div id="delete-action">
|
||||
<?php echo "<a class='submitdelete deletion' href='" . wp_nonce_url("comment.php?action=" . ( !EMPTY_TRASH_DAYS ? 'deletecomment' : 'trashcomment' ) . "&c=$comment->comment_ID&_wp_original_http_referer=" . urlencode(wp_get_referer()), 'delete-comment_' . $comment->comment_ID) . "'>" . ( !EMPTY_TRASH_DAYS ? __('Delete Permanently') : __('Move to Trash') ) . "</a>\n"; ?>
|
||||
<a class='submitdelete deletion' href='<?php echo wp_nonce_url("comment.php?action=deletecomment&c=$comment->comment_ID&_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID) . "' onclick=\"if ( confirm('" . js_escape(__("You are about to delete this comment. \n 'Cancel' to stop, 'OK' to delete.")) . "') ) { return true;}return false;\">" . __('Delete'); ?></a>
|
||||
</div>
|
||||
<div id="publishing-action">
|
||||
<input type="submit" name="save" value="<?php esc_attr_e('Update Comment'); ?>" tabindex="4" class="button-primary" />
|
||||
<input type="submit" name="save" value="<?php _e('Update Comment'); ?>" tabindex="4" class="button-primary" />
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
@@ -80,38 +80,40 @@ $date = date_i18n( $datef, strtotime( $comment->comment_date ) );
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="post-body">
|
||||
<div id="post-body-content">
|
||||
<div id="post-body" class="has-sidebar">
|
||||
<div id="post-body-content" class="has-sidebar-content">
|
||||
|
||||
<div id="namediv" class="stuffbox">
|
||||
<h3><label for="name"><?php _e( 'Author' ) ?></label></h3>
|
||||
<div class="inside">
|
||||
<table class="form-table editcomment">
|
||||
<table class="form-table">
|
||||
<tbody>
|
||||
<tr valign="top">
|
||||
<td class="first"><?php _e( 'Name:' ); ?></td>
|
||||
<td><input type="text" name="newcomment_author" size="30" value="<?php echo esc_attr( $comment->comment_author ); ?>" tabindex="1" id="name" /></td>
|
||||
<td><input type="text" name="newcomment_author" size="30" value="<?php echo attribute_escape( $comment->comment_author ); ?>" tabindex="1" id="name" /></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td class="first">
|
||||
<?php
|
||||
if ( $comment->comment_author_email ) {
|
||||
if ( $email ) {
|
||||
printf( __( 'E-mail (%s):' ), get_comment_author_email_link( __( 'send e-mail' ), '', '' ) );
|
||||
} else {
|
||||
_e( 'E-mail:' );
|
||||
}
|
||||
?></td>
|
||||
<td><input type="text" name="newcomment_author_email" size="30" value="<?php echo $comment->comment_author_email; ?>" tabindex="2" id="email" /></td>
|
||||
<td><input type="text" name="newcomment_author_email" size="30" value="<?php echo $email; ?>" tabindex="2" id="email" /></td>
|
||||
</tr>
|
||||
<tr valign="top">
|
||||
<td class="first">
|
||||
<?php
|
||||
if ( ! empty( $comment->comment_author_url ) && 'http://' != $comment->comment_author_url ) {
|
||||
$link = '<a href="' . $comment->comment_author_url . '" rel="external nofollow" target="_blank">' . __('visit site') . '</a>';
|
||||
$url = get_comment_author_url();
|
||||
if ( ! empty( $url ) && 'http://' != $url ) {
|
||||
$link = "<a href='$url' rel='external nofollow' target='_blank'>" . __('visit site') . "</a>";
|
||||
printf( __( 'URL (%s):' ), apply_filters('get_comment_author_link', $link ) );
|
||||
} else {
|
||||
_e( 'URL:' );
|
||||
} ?></td>
|
||||
<td><input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" class="code" value="<?php echo esc_attr($comment->comment_author_url); ?>" tabindex="3" /></td>
|
||||
<td><input type="text" id="newcomment_author_url" name="newcomment_author_url" size="30" value="<?php echo $url; ?>" tabindex="3" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -126,9 +128,9 @@ $date = date_i18n( $datef, strtotime( $comment->comment_date ) );
|
||||
|
||||
<?php do_meta_boxes('comment', 'normal', $comment); ?>
|
||||
|
||||
<input type="hidden" name="c" value="<?php echo esc_attr($comment->comment_ID) ?>" />
|
||||
<input type="hidden" name="p" value="<?php echo esc_attr($comment->comment_post_ID) ?>" />
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php echo esc_url(stripslashes(wp_get_referer())); ?>" />
|
||||
<input type="hidden" name="c" value="<?php echo $comment->comment_ID ?>" />
|
||||
<input type="hidden" name="p" value="<?php echo $comment->comment_post_ID ?>" />
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
|
||||
<?php wp_original_referer_field(true, 'previous'); ?>
|
||||
<input type="hidden" name="noredir" value="1" />
|
||||
|
||||
|
||||
@@ -18,14 +18,13 @@ if ( isset($_GET['action']) && isset($_GET['delete']) ) {
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
if ( 'delete' == $doaction ) {
|
||||
$cats = (array) $_GET['delete'];
|
||||
$default_cat_id = get_option('default_link_category');
|
||||
foreach( (array) $_GET['delete'] as $cat_ID ) {
|
||||
$cat_name = get_term_field('name', $cat_ID, 'link_category');
|
||||
$default_cat_id = get_option('default_link_category');
|
||||
|
||||
foreach( $cats as $cat_ID ) {
|
||||
$cat_ID = (int) $cat_ID;
|
||||
// Don't delete the default cats.
|
||||
if ( $cat_ID == $default_cat_id )
|
||||
wp_die( sprintf( __("Can’t delete the <strong>%s</strong> category: this is the default one"), get_term_field('name', $cat_ID, 'link_category') ) );
|
||||
wp_die(sprintf(__("Can’t delete the <strong>%s</strong> category: this is the default one"), $cat_name));
|
||||
|
||||
wp_delete_term($cat_ID, 'link_category', array('default' => $default_cat_id));
|
||||
}
|
||||
@@ -62,9 +61,9 @@ $messages[6] = __('Categories deleted.'); ?>
|
||||
|
||||
<div class="wrap nosubsub">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title );
|
||||
<h2><?php echo wp_specialchars( $title );
|
||||
if ( isset($_GET['s']) && $_GET['s'] )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_GET['s']) ) ); ?>
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', wp_specialchars( stripslashes($_GET['s']) ) ); ?>
|
||||
</h2>
|
||||
|
||||
<?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
|
||||
@@ -74,9 +73,9 @@ endif; ?>
|
||||
|
||||
<form class="search-form" action="" method="get">
|
||||
<p class="search-box">
|
||||
<label class="screen-reader-text" for="link-category-search-input"><?php _e( 'Search Categories' ); ?>:</label>
|
||||
<input type="text" id="link-category-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<input type="submit" value="<?php esc_attr_e( 'Search Categories' ); ?>" class="button" />
|
||||
<label class="hidden" for="link-category-search-input"><?php _e( 'Search Categories' ); ?>:</label>
|
||||
<input type="text" class="search-input" id="link-category-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<input type="submit" value="<?php _e( 'Search Categories' ); ?>" class="button" />
|
||||
</p>
|
||||
</form>
|
||||
<br class="clear" />
|
||||
@@ -113,7 +112,7 @@ if ( $page_links )
|
||||
<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<?php wp_nonce_field('bulk-link-categories'); ?>
|
||||
</div>
|
||||
|
||||
@@ -167,7 +166,7 @@ if ( $page_links )
|
||||
<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
@@ -190,19 +189,19 @@ if ( $page_links )
|
||||
$category = (object) array(); $category->parent = 0; do_action('add_link_category_form_pre', $category); ?>
|
||||
|
||||
<div class="form-wrap">
|
||||
<h3><?php _e('Add Link Category'); ?></h3>
|
||||
<h3><?php _e('Add Category'); ?></h3>
|
||||
<div id="ajax-response"></div>
|
||||
<form name="addcat" id="addcat" class="add:the-list: validate" method="post" action="link-category.php">
|
||||
<input type="hidden" name="action" value="addcat" />
|
||||
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-link-category'); ?>
|
||||
|
||||
<div class="form-field form-required">
|
||||
<label for="name"><?php _e('Link Category name') ?></label>
|
||||
<label for="name"><?php _e('Category name') ?></label>
|
||||
<input name="name" id="name" type="text" value="" size="40" aria-required="true" />
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="slug"><?php _e('Link Category slug') ?></label>
|
||||
<label for="slug"><?php _e('Category slug') ?></label>
|
||||
<input name="slug" id="slug" type="text" value="" size="40" />
|
||||
<p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
|
||||
</div>
|
||||
@@ -210,10 +209,9 @@ if ( $page_links )
|
||||
<div class="form-field">
|
||||
<label for="description"><?php _e('Description (optional)') ?></label>
|
||||
<textarea name="description" id="description" rows="5" cols="40"></textarea>
|
||||
<p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
|
||||
</div>
|
||||
|
||||
<p class="submit"><input type="submit" class="button" name="submit" value="<?php esc_attr_e('Add Category'); ?>" /></p>
|
||||
<p class="submit"><input type="submit" class="button" name="submit" value="<?php _e('Add Category'); ?>" /></p>
|
||||
<?php do_action('edit_link_category_form', $category); ?>
|
||||
</form>
|
||||
</div>
|
||||
@@ -226,5 +224,20 @@ if ( $page_links )
|
||||
</div><!-- /col-container -->
|
||||
</div><!-- /wrap -->
|
||||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
(function($){
|
||||
$(document).ready(function(){
|
||||
$('#doaction, #doaction2').click(function(){
|
||||
if ( $('select[name^="action"]').val() == 'delete' ) {
|
||||
var m = '<?php echo js_escape(__("You are about to delete the selected link categories.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
|
||||
return showNotice.warn(m);
|
||||
}
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
<?php inline_edit_term_row('edit-link-categories'); ?>
|
||||
<?php include('admin-footer.php'); ?>
|
||||
|
||||
@@ -6,13 +6,6 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('You do not have sufficient permissions to edit link categories for this blog.'));
|
||||
|
||||
/**
|
||||
* @var object
|
||||
*/
|
||||
@@ -64,27 +57,25 @@ _fill_empty_link_category($category);
|
||||
<?php echo $heading ?>
|
||||
<div id="ajax-response"></div>
|
||||
<?php echo $form ?>
|
||||
<input type="hidden" name="action" value="<?php echo esc_attr($action) ?>" />
|
||||
<input type="hidden" name="cat_ID" value="<?php echo esc_attr($category->term_id) ?>" />
|
||||
<input type="hidden" name="action" value="<?php echo $action ?>" />
|
||||
<input type="hidden" name="cat_ID" value="<?php echo $category->term_id ?>" />
|
||||
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field($nonce_action); ?>
|
||||
<table class="form-table">
|
||||
<tr class="form-field form-required">
|
||||
<th scope="row" valign="top"><label for="name"><?php _e('Link Category name') ?></label></th>
|
||||
<td><input name="name" id="name" type="text" value="<?php echo esc_attr($category->name); ?>" size="40" aria-required="true" /></td>
|
||||
<th scope="row" valign="top"><label for="name"><?php _e('Category name') ?></label></th>
|
||||
<td><input name="name" id="name" type="text" value="<?php echo $category->name; ?>" size="40" aria-required="true" /></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="slug"><?php _e('Link Category slug') ?></label></th>
|
||||
<td><input name="slug" id="slug" type="text" value="<?php echo esc_attr(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
|
||||
<th scope="row" valign="top"><label for="slug"><?php _e('Category slug') ?></label></th>
|
||||
<td><input name="slug" id="slug" type="text" value="<?php echo attribute_escape(apply_filters('editable_slug', $category->slug)); ?>" size="40" /><br />
|
||||
<?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="description"><?php _e('Description (optional)') ?></label></th>
|
||||
<td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea><br />
|
||||
<span class="description"><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></span></td>
|
||||
<td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo $category->description; ?></textarea></td>
|
||||
</tr>
|
||||
<?php do_action('edit_link_category_form_fields', $category); ?>
|
||||
</table>
|
||||
<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo esc_attr($submit_text) ?>" /></p>
|
||||
<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php echo $submit_text ?>" /></p>
|
||||
<?php do_action('edit_link_category_form', $category); ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
|
||||
if ( ! empty($link_id) ) {
|
||||
$heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );
|
||||
$submit_text = __('Update Link');
|
||||
@@ -22,12 +18,319 @@ if ( ! empty($link_id) ) {
|
||||
$nonce_action = 'add-bookmark';
|
||||
}
|
||||
|
||||
require_once('includes/meta-boxes.php');
|
||||
/**
|
||||
* Display checked checkboxes attribute for xfn microformat options.
|
||||
*
|
||||
* @since 1.0.1
|
||||
*
|
||||
* @param string $class
|
||||
* @param string $value
|
||||
* @param mixed $deprecated Not used.
|
||||
*/
|
||||
function xfn_check($class, $value = '', $deprecated = '') {
|
||||
global $link;
|
||||
|
||||
$link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
|
||||
$rels = preg_split('/\s+/', $link_rel);
|
||||
|
||||
if ('' != $value && in_array($value, $rels) ) {
|
||||
echo ' checked="checked"';
|
||||
}
|
||||
|
||||
if ('' == $value) {
|
||||
if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"';
|
||||
if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
|
||||
if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
|
||||
if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display link create form fields.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_submit_meta_box($link) {
|
||||
?>
|
||||
<div class="submitbox" id="submitlink">
|
||||
|
||||
<div id="minor-publishing">
|
||||
|
||||
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
|
||||
<div style="display:none;">
|
||||
<input type="submit" name="save" value="<?php echo attribute_escape( __('Save') ); ?>" />
|
||||
</div>
|
||||
|
||||
<div id="minor-publishing-actions">
|
||||
<div id="preview-action">
|
||||
<?php if ( !empty($link->link_id) ) { ?>
|
||||
<a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank" tabindex="4"><?php _e('Visit Link'); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="misc-publishing-actions">
|
||||
<div class="misc-pub-section misc-pub-section-last">
|
||||
<label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div id="major-publishing-actions">
|
||||
<?php do_action('post_submitbox_start'); ?>
|
||||
<div id="delete-action">
|
||||
<?php
|
||||
if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>
|
||||
<a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf(__("You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete."), $link->link_name )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="publishing-action">
|
||||
<?php if ( !empty($link->link_id) ) { ?>
|
||||
<input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php _e('Update Link') ?>" />
|
||||
<?php } else { ?>
|
||||
<input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php _e('Add Link') ?>" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php do_action('submitlink_box'); ?>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('linksubmitdiv', __('Save'), 'link_submit_meta_box', 'link', 'side', 'core');
|
||||
|
||||
/**
|
||||
* Display link categories form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_categories_meta_box($link) { ?>
|
||||
<div id="category-adder" class="wp-hidden-children">
|
||||
<h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
|
||||
<p id="link-category-add" class="wp-hidden-child">
|
||||
<label class="hidden" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
|
||||
<input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" aria-required="true" />
|
||||
<input type="button" id="category-add-submit" class="add:categorychecklist:linkcategorydiv button" value="<?php _e( 'Add' ); ?>" />
|
||||
<?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
|
||||
<span id="category-ajax-response"></span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<ul id="category-tabs">
|
||||
<li class="ui-tabs-selected"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
|
||||
<li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
|
||||
</ul>
|
||||
|
||||
<div id="categories-all" class="ui-tabs-panel">
|
||||
<ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
|
||||
<?php
|
||||
if ( isset($link->link_id) )
|
||||
wp_link_category_checklist($link->link_id);
|
||||
else
|
||||
wp_link_category_checklist();
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div id="categories-pop" class="ui-tabs-panel" style="display: none;">
|
||||
<ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
|
||||
<?php wp_popular_terms_checklist('link_category'); ?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', 'link', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display form fields for changing link target.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_target_meta_box($link) { ?>
|
||||
<fieldset><legend class="hidden"><?php _e('Target') ?></legend>
|
||||
<label for="link_target_blank" class="selectit">
|
||||
<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
|
||||
<code>_blank</code></label><br />
|
||||
<label for="link_target_top" class="selectit">
|
||||
<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
|
||||
<code>_top</code></label><br />
|
||||
<label for="link_target_none" class="selectit">
|
||||
<input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> />
|
||||
<?php _e('none') ?></label>
|
||||
</fieldset>
|
||||
<p><?php _e('Choose the frame your link targets. Essentially this means if you choose <code>_blank</code> your link will open in a new window.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display xfn form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_xfn_meta_box($link) {
|
||||
?>
|
||||
<table class="editform" style="width: 100%;" cellspacing="2" cellpadding="5">
|
||||
<tr>
|
||||
<th style="width: 20%;" scope="row"><label for="link_rel"><?php _e('rel:') ?></label></th>
|
||||
<td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo ( isset( $link->link_rel ) ? $link->link_rel : ''); ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<table cellpadding="3" cellspacing="5" class="form-table">
|
||||
<tr>
|
||||
<th scope="row"> <?php _e('identity') ?> </th>
|
||||
<td><fieldset><legend class="hidden"> <?php _e('identity') ?> </legend>
|
||||
<label for="me">
|
||||
<input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
|
||||
<?php _e('another web address of mine') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php _e('friendship') ?> </th>
|
||||
<td><fieldset><legend class="hidden"> <?php _e('friendship') ?> </legend>
|
||||
<label for="contact">
|
||||
<input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php _e('contact') ?></label>
|
||||
<label for="acquaintance">
|
||||
<input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> /> <?php _e('acquaintance') ?></label>
|
||||
<label for="friend">
|
||||
<input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php _e('friend') ?></label>
|
||||
<label for="friendship">
|
||||
<input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php _e('none') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php _e('physical') ?> </th>
|
||||
<td><fieldset><legend class="hidden"> <?php _e('physical') ?> </legend>
|
||||
<label for="met">
|
||||
<input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
|
||||
<?php _e('met') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php _e('professional') ?> </th>
|
||||
<td><fieldset><legend class="hidden"> <?php _e('professional') ?> </legend>
|
||||
<label for="co-worker">
|
||||
<input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
|
||||
<?php _e('co-worker') ?></label>
|
||||
<label for="colleague">
|
||||
<input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
|
||||
<?php _e('colleague') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php _e('geographical') ?> </th>
|
||||
<td><fieldset><legend class="hidden"> <?php _e('geographical') ?> </legend>
|
||||
<label for="co-resident">
|
||||
<input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
|
||||
<?php _e('co-resident') ?></label>
|
||||
<label for="neighbor">
|
||||
<input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
|
||||
<?php _e('neighbor') ?></label>
|
||||
<label for="geographical">
|
||||
<input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
|
||||
<?php _e('none') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php _e('family') ?> </th>
|
||||
<td><fieldset><legend class="hidden"> <?php _e('family') ?> </legend>
|
||||
<label for="child">
|
||||
<input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />
|
||||
<?php _e('child') ?></label>
|
||||
<label for="kin">
|
||||
<input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?> />
|
||||
<?php _e('kin') ?></label>
|
||||
<label for="parent">
|
||||
<input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
|
||||
<?php _e('parent') ?></label>
|
||||
<label for="sibling">
|
||||
<input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
|
||||
<?php _e('sibling') ?></label>
|
||||
<label for="spouse">
|
||||
<input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
|
||||
<?php _e('spouse') ?></label>
|
||||
<label for="family">
|
||||
<input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
|
||||
<?php _e('none') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row"> <?php _e('romantic') ?> </th>
|
||||
<td><fieldset><legend class="hidden"> <?php _e('romantic') ?> </legend>
|
||||
<label for="muse">
|
||||
<input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
|
||||
<?php _e('muse') ?></label>
|
||||
<label for="crush">
|
||||
<input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
|
||||
<?php _e('crush') ?></label>
|
||||
<label for="date">
|
||||
<input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
|
||||
<?php _e('date') ?></label>
|
||||
<label for="romantic">
|
||||
<input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
|
||||
<?php _e('sweetheart') ?></label>
|
||||
</fieldset></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p><?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display advanced link options form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $link
|
||||
*/
|
||||
function link_advanced_meta_box($link) {
|
||||
?>
|
||||
<table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
|
||||
<tr class="form-field">
|
||||
<th valign="top" scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
|
||||
<td><input type="text" name="link_image" id="link_image" size="50" value="<?php echo ( isset( $link->link_image ) ? $link->link_image : ''); ?>" style="width: 95%" /></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th valign="top" scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>
|
||||
<td><input name="link_rss" type="text" id="rss_uri" value="<?php echo ( isset( $link->link_rss ) ? $link->link_rss : ''); ?>" size="50" style="width: 95%" /></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th valign="top" scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
|
||||
<td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); ?></textarea></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th valign="top" scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>
|
||||
<td><select name="link_rating" id="link_rating" size="1">
|
||||
<?php
|
||||
for ($r = 0; $r < 10; $r++) {
|
||||
echo(' <option value="'.$r.'" ');
|
||||
if ( isset($link->link_rating) && $link->link_rating == $r)
|
||||
echo 'selected="selected"';
|
||||
echo('>'.$r.'</option>');
|
||||
}
|
||||
?></select> <?php _e('(Leave at 0 for no rating.)') ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core');
|
||||
|
||||
do_action('do_meta_boxes', 'link', 'normal', $link);
|
||||
@@ -37,9 +340,11 @@ do_action('do_meta_boxes', 'link', 'side', $link);
|
||||
require_once ('admin-header.php');
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
<h2><?php echo wp_specialchars( $title ); ?></h2>
|
||||
|
||||
<?php if ( isset( $_GET['added'] ) ) : ?>
|
||||
<div id="message" class="updated fade"><p><?php _e('Link added.'); ?></p></div>
|
||||
@@ -55,7 +360,7 @@ wp_nonce_field( $nonce_action );
|
||||
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
||||
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
|
||||
|
||||
<div id="poststuff" class="metabox-holder<?php echo 2 == $screen_layout_columns ? ' has-right-sidebar' : ''; ?>">
|
||||
<div id="poststuff" class="metabox-holder">
|
||||
|
||||
<div id="side-info-column" class="inner-sidebar">
|
||||
<?php
|
||||
@@ -66,12 +371,12 @@ $side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div id="post-body">
|
||||
<div id="post-body-content">
|
||||
<div id="post-body" class="<?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?>">
|
||||
<div id="post-body-content" class="has-sidebar-content">
|
||||
<div id="namediv" class="stuffbox">
|
||||
<h3><label for="link_name"><?php _e('Name') ?></label></h3>
|
||||
<div class="inside">
|
||||
<input type="text" name="link_name" size="30" tabindex="1" value="<?php echo esc_attr($link->link_name); ?>" id="link_name" />
|
||||
<input type="text" name="link_name" size="30" tabindex="1" value="<?php echo $link->link_name; ?>" id="link_name" />
|
||||
<p><?php _e('Example: Nifty blogging software'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -79,7 +384,7 @@ $side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
|
||||
<div id="addressdiv" class="stuffbox">
|
||||
<h3><label for="link_url"><?php _e('Web Address') ?></label></h3>
|
||||
<div class="inside">
|
||||
<input type="text" name="link_url" size="30" class="code" tabindex="1" value="<?php echo esc_attr($link->link_url); ?>" id="link_url" />
|
||||
<input type="text" name="link_url" size="30" tabindex="1" value="<?php echo $link->link_url; ?>" id="link_url" />
|
||||
<p><?php _e('Example: <code>http://wordpress.org/</code> — don’t forget the <code>http://</code>'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -87,7 +392,7 @@ $side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
|
||||
<div id="descriptiondiv" class="stuffbox">
|
||||
<h3><label for="link_description"><?php _e('Description') ?></label></h3>
|
||||
<div class="inside">
|
||||
<input type="text" name="link_description" size="30" tabindex="1" value="<?php echo isset($link->link_description) ? esc_attr($link->link_description) : ''; ?>" id="link_description" />
|
||||
<input type="text" name="link_description" size="30" tabindex="1" value="<?php echo isset($link->link_description) ? $link->link_description : ''; ?>" id="link_description" />
|
||||
<p><?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -101,7 +406,7 @@ do_meta_boxes('link', 'advanced', $link);
|
||||
if ( $link_id ) : ?>
|
||||
<input type="hidden" name="action" value="save" />
|
||||
<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
|
||||
<input type="hidden" name="order_by" value="<?php echo esc_attr($order_by); ?>" />
|
||||
<input type="hidden" name="order_by" value="<?php echo attribute_escape($order_by); ?>" />
|
||||
<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
|
||||
<?php else: ?>
|
||||
<input type="hidden" name="action" value="add" />
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
|
||||
/**
|
||||
* Post ID global.
|
||||
* @name $post_ID
|
||||
@@ -20,41 +16,21 @@ if ( ! isset( $post_ID ) )
|
||||
if ( ! isset( $temp_ID ) )
|
||||
$temp_ID = 0;
|
||||
|
||||
$message = false;
|
||||
if ( isset($_GET['message']) ) {
|
||||
if ( isset($_GET['message']) )
|
||||
$_GET['message'] = absint( $_GET['message'] );
|
||||
$messages[1] = sprintf( __( 'Page updated. Continue editing below or <a href="%s">go back</a>.' ), attribute_escape( stripslashes( ( isset( $_GET['_wp_original_http_referer'] ) ? $_GET['_wp_original_http_referer'] : '') ) ) );
|
||||
$messages[2] = __('Custom field updated.');
|
||||
$messages[3] = __('Custom field deleted.');
|
||||
$messages[4] = __('Page updated.');
|
||||
$messages[5] = sprintf(__('Page published. <a href="%s">View page</a>'), get_permalink($post_ID));
|
||||
$messages[6] = sprintf(__('Page submitted. <a href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
|
||||
|
||||
switch ( $_GET['message'] ) {
|
||||
case 1:
|
||||
$message = sprintf( __('Page updated. <a href="%s">View page</a>'), get_permalink($post_ID) );
|
||||
break;
|
||||
case 2:
|
||||
$message = __('Custom field updated.');
|
||||
break;
|
||||
case 3:
|
||||
$message = __('Custom field deleted.');
|
||||
break;
|
||||
case 4:
|
||||
$message = sprintf( __('Page published. <a href="%s">View page</a>'), get_permalink($post_ID) );
|
||||
break;
|
||||
case 5:
|
||||
if ( isset($_GET['revision']) )
|
||||
$message = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
|
||||
break;
|
||||
case 6:
|
||||
$message = sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
|
||||
break;
|
||||
case 7:
|
||||
// translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php
|
||||
$message = sprintf( __('Page scheduled for: <b>%1$s</b>. <a target="_blank" href="%2$s">Preview page</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) );
|
||||
break;
|
||||
case 8:
|
||||
$message = sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( isset($_GET['revision']) )
|
||||
$messages[5] = sprintf( __('Page restored to revision from %s'), wp_post_revision_title( (int) $_GET['revision'], false ) );
|
||||
|
||||
$notice = false;
|
||||
$notices[1] = __( 'There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.' );
|
||||
|
||||
if ( 0 == $post_ID) {
|
||||
$form_action = 'post';
|
||||
$nonce_action = 'add-page';
|
||||
@@ -66,31 +42,346 @@ if ( 0 == $post_ID) {
|
||||
$nonce_action = 'update-page_' . $post_ID;
|
||||
$form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
|
||||
$autosave = wp_get_post_autosave( $post_ID );
|
||||
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt, false ) > mysql2date( 'U', $post->post_modified_gmt, false ) )
|
||||
$notice = sprintf( __( 'There is an autosave of this page that is more recent than the version below. <a href="%s">View the autosave</a>.' ), get_edit_post_link( $autosave->ID ) );
|
||||
if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) )
|
||||
$notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
|
||||
}
|
||||
|
||||
$temp_ID = (int) $temp_ID;
|
||||
$user_ID = (int) $user_ID;
|
||||
|
||||
require_once('includes/meta-boxes.php');
|
||||
/**
|
||||
* Display submit form fields.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_submit_meta_box($post) {
|
||||
global $action;
|
||||
|
||||
add_meta_box('submitdiv', __('Publish'), 'post_submit_meta_box', 'page', 'side', 'core');
|
||||
$can_publish = current_user_can('publish_pages');
|
||||
?>
|
||||
<div class="submitbox" id="submitpage">
|
||||
|
||||
<div id="minor-publishing">
|
||||
|
||||
<?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
|
||||
<div style="display:none;">
|
||||
<input type="submit" name="save" value="<?php echo attribute_escape( __('Save') ); ?>" />
|
||||
</div>
|
||||
|
||||
<div id="minor-publishing-actions">
|
||||
<div id="save-action">
|
||||
<?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
|
||||
<input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save Draft') ); ?>" tabindex="4" class="button button-highlighted" />
|
||||
<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
|
||||
<input type="submit" name="save" id="save-post" value="<?php echo attribute_escape( __('Save as Pending') ); ?>" tabindex="4" class="button button-highlighted" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="preview-action">
|
||||
<?php $preview_link = 'publish' == $post->post_status ? clean_url(get_permalink($post->ID)) : clean_url(apply_filters('preview_post_link', add_query_arg('preview', 'true', get_permalink($post->ID)))); ?>
|
||||
|
||||
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview" id="post-preview" tabindex="4"><?php _e('Preview'); ?></a>
|
||||
<input type="hidden" name="wp-preview" id="wp-preview" value="" />
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div><?php // /minor-publishing-actions ?>
|
||||
|
||||
<div id="misc-publishing-actions">
|
||||
|
||||
<div class="misc-pub-section<?php if ( !$can_publish ) { echo ' misc-pub-section-last'; } ?>"><label for="post_status"><?php _e('Status:') ?></label>
|
||||
<b><span id="post-status-display">
|
||||
<?php
|
||||
switch ( $post->post_status ) {
|
||||
case 'private':
|
||||
_e('Privately Published');
|
||||
break;
|
||||
case 'publish':
|
||||
_e('Published');
|
||||
break;
|
||||
case 'future':
|
||||
_e('Scheduled');
|
||||
break;
|
||||
case 'pending':
|
||||
_e('Pending Review');
|
||||
break;
|
||||
case 'draft':
|
||||
_e('Draft');
|
||||
break;
|
||||
}
|
||||
?>
|
||||
</span></b>
|
||||
<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
|
||||
<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
|
||||
|
||||
<div id="post-status-select" class="hide-if-js">
|
||||
<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo $post->post_status; ?>" />
|
||||
<select name='post_status' id='post_status' tabindex='4'>
|
||||
<?php if ( 'publish' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'publish' ); ?> value='publish'><?php _e('Published') ?></option>
|
||||
<?php elseif ( 'private' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'private' ); ?> value='publish'><?php _e('Privately Published') ?></option>
|
||||
<?php elseif ( 'future' == $post->post_status ) : ?>
|
||||
<option<?php selected( $post->post_status, 'future' ); ?> value='future'><?php _e('Scheduled') ?></option>
|
||||
<?php endif; ?>
|
||||
<option<?php selected( $post->post_status, 'pending' ); ?> value='pending'><?php _e('Pending Review') ?></option>
|
||||
<option<?php selected( $post->post_status, 'draft' ); ?> value='draft'><?php _e('Draft') ?></option>
|
||||
</select>
|
||||
|
||||
<a href="#post_status" class="save-post-status hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#post_status" class="cancel-post-status hide-if-no-js"><?php _e('Cancel'); ?></a>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
</div><?php // /misc-pub-section ?>
|
||||
|
||||
<div class="misc-pub-section " id="visibility">
|
||||
<?php _e('Visibility:'); ?> <b><span id="post-visibility-display"><?php
|
||||
|
||||
if ( 'private' == $post->post_status ) {
|
||||
$post->post_password = '';
|
||||
$visibility = 'private';
|
||||
$visibility_trans = __('Private');
|
||||
} elseif ( !empty( $post->post_password ) ) {
|
||||
$visibility = 'password';
|
||||
$visibility_trans = __('Password protected');
|
||||
} else {
|
||||
$visibility = 'public';
|
||||
$visibility_trans = __('Public');
|
||||
}
|
||||
|
||||
?><?php echo wp_specialchars( $visibility_trans ); ?></span></b> <?php if ( $can_publish ) { ?> <a href="#visibility" class="edit-visibility hide-if-no-js"><?php _e('Edit'); ?></a>
|
||||
|
||||
<div id="post-visibility-select" class="hide-if-js">
|
||||
<input type="hidden" name="hidden_post_password" id="hidden-post-password" value="<?php echo attribute_escape($post->post_password); ?>" />
|
||||
<input type="hidden" name="hidden_post_visibility" id="hidden-post-visibility" value="<?php echo attribute_escape( $visibility ); ?>" />
|
||||
|
||||
|
||||
<input type="radio" name="visibility" id="visibility-radio-public" value="public" <?php checked( $visibility, 'public' ); ?> /> <label for="visibility-radio-public" class="selectit"><?php _e('Public'); ?></label><br />
|
||||
<input type="radio" name="visibility" id="visibility-radio-password" value="password" <?php checked( $visibility, 'password' ); ?> /> <label for="visibility-radio-password" class="selectit"><?php _e('Password protected'); ?></label><br />
|
||||
<span id="password-span"><label for="post_password"><?php _e('Password:'); ?></label> <input type="text" name="post_password" id="post_password" value="<?php echo attribute_escape($post->post_password); ?>" /><br /></span>
|
||||
<input type="radio" name="visibility" id="visibility-radio-private" value="private" <?php checked( $visibility, 'private' ); ?> /> <label for="visibility-radio-private" class="selectit"><?php _e('Private'); ?></label><br />
|
||||
|
||||
<p>
|
||||
<a href="#visibility" class="save-post-visibility hide-if-no-js button"><?php _e('OK'); ?></a>
|
||||
<a href="#visibility" class="cancel-post-visibility hide-if-no-js"><?php _e('Cancel'); ?></a>
|
||||
</p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
</div><?php // /misc-pub-section ?>
|
||||
|
||||
<?php
|
||||
$datef = _c( 'M j, Y @ G:i|Publish box date format');
|
||||
if ( 0 != $post->ID ) {
|
||||
if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date
|
||||
$stamp = __('Scheduled for: <b>%1$s</b>');
|
||||
} else if ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published
|
||||
$stamp = __('Published on: <b>%1$s</b>');
|
||||
} else if ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified
|
||||
$stamp = __('Publish <b>immediately</b>');
|
||||
} else if ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified
|
||||
$stamp = __('Schedule for: <b>%1$s</b>');
|
||||
} else { // draft, 1 or more saves, date specified
|
||||
$stamp = __('Publish on: <b>%1$s</b>');
|
||||
}
|
||||
$date = date_i18n( $datef, strtotime( $post->post_date ) );
|
||||
} else { // draft (no saves, and thus no date specified)
|
||||
$stamp = __('Publish <b>immediately</b>');
|
||||
$date = date_i18n( $datef, strtotime( current_time('mysql') ) );
|
||||
}
|
||||
?>
|
||||
<?php if ( $can_publish ) : // Contributors don't get to choose the date of publish ?>
|
||||
<div class="misc-pub-section curtime misc-pub-section-last">
|
||||
<span id="timestamp">
|
||||
<?php printf($stamp, $date); ?></span>
|
||||
<a href="#edit_timestamp" class="edit-timestamp hide-if-no-js" tabindex='4'><?php _e('Edit') ?></a>
|
||||
<div id="timestampdiv" class="hide-if-js"><?php touch_time(($action == 'edit'),1,4); ?></div>
|
||||
</div><?php // /misc-pub-section ?>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
||||
<div id="major-publishing-actions">
|
||||
<?php do_action('post_submitbox_start'); ?>
|
||||
<div id="delete-action">
|
||||
<?php
|
||||
if ( ( 'edit' == $action ) && current_user_can('delete_page', $post->ID) ) { ?>
|
||||
<a class="submitdelete deletion" href="<?php echo wp_nonce_url("page.php?action=delete&post=$post->ID", 'delete-page_' . $post->ID); ?>" onclick="if ( confirm('<?php echo js_escape(sprintf( ('draft' == $post->post_status) ? __("You are about to delete this draft '%s'\n 'Cancel' to stop, 'OK' to delete.") : __("You are about to delete this page '%s'\n 'Cancel' to stop, 'OK' to delete."), $post->post_title )); ?>') ) {return true;}return false;"><?php _e('Delete'); ?></a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="publishing-action">
|
||||
<?php
|
||||
if ( !in_array( $post->post_status, array('publish', 'future', 'private') ) || 0 == $post->ID ) { ?>
|
||||
<?php if ( $can_publish ) : ?>
|
||||
<?php if ( !empty($post->post_date_gmt) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Schedule') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Schedule') ?>" />
|
||||
<?php else : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Publish') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Publish') ?>" />
|
||||
<?php endif; ?>
|
||||
<?php else : ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Submit for Review') ?>" />
|
||||
<input name="publish" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Submit for Review') ?>" />
|
||||
<?php endif; ?>
|
||||
<?php } else { ?>
|
||||
<input name="original_publish" type="hidden" id="original_publish" value="<?php _e('Update Page') ?>" />
|
||||
<input name="save" type="submit" class="button-primary" id="publish" tabindex="5" accesskey="p" value="<?php _e('Update Page') ?>" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pagesubmitdiv', __('Publish'), 'page_submit_meta_box', 'page', 'side', 'core');
|
||||
|
||||
/**
|
||||
* Display page password form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_password_meta_box($post){
|
||||
?>
|
||||
<p><label for="post_status_private" class="selectit"><input id="post_status_private" name="post_status" type="checkbox" value="private" <?php checked($post->post_status, 'private'); ?> tabindex='4' /> <?php _e('Keep this page private') ?></label></p>
|
||||
<h4><?php _e( 'Page Password' ); ?></h4>
|
||||
<p><label class="hidden" for="post_password"><?php _e('Password Protect This Page') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php the_post_password(); ?>" /></p>
|
||||
<p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this page and its comments.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
// add_meta_box('pagepassworddiv', __('Privacy Options'), 'page_password_meta_box', 'page', 'side', 'core');
|
||||
|
||||
/**
|
||||
* Display page attributes form fields.
|
||||
*
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_attributes_meta_box($post){
|
||||
?>
|
||||
<h5><?php _e('Parent') ?></h5>
|
||||
<label class="hidden" for="parent_id"><?php _e('Page Parent') ?></label>
|
||||
<?php wp_dropdown_pages(array('exclude_tree' => $post->ID, 'selected' => $post->post_parent, 'name' => 'parent_id', 'show_option_none' => __('Main Page (no parent)'), 'sort_column'=> 'menu_order, post_title')); ?>
|
||||
<p><?php _e('You can arrange your pages in hierarchies, for example you could have an “About” page that has “Life Story” and “My Dog” pages under it. There are no limits to how deeply nested you can make pages.'); ?></p>
|
||||
<?php
|
||||
if ( 0 != count( get_page_templates() ) ) {
|
||||
?>
|
||||
<h5><?php _e('Template') ?></h5>
|
||||
<label class="hidden" for="page_template"><?php _e('Page Template') ?></label><select name="page_template" id="page_template">
|
||||
<option value='default'><?php _e('Default Template'); ?></option>
|
||||
<?php page_template_dropdown($post->page_template); ?>
|
||||
</select>
|
||||
<p><?php _e('Some themes have custom templates you can use for certain pages that might have additional features or custom layouts. If so, you’ll see them above.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<h5><?php _e('Order') ?></h5>
|
||||
<p><label class="hidden" for="menu_order"><?php _e('Page Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo $post->menu_order ?>" /></p>
|
||||
<p><?php _e('Pages are usually ordered alphabetically, but you can put a number above to change the order pages appear in. (We know this is a little janky, it’ll be better in future releases.)'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pageparentdiv', __('Attributes'), 'page_attributes_meta_box', 'page', 'side', 'core');
|
||||
add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'page', 'normal', 'core');
|
||||
add_meta_box('commentstatusdiv', __('Discussion'), 'post_comment_status_meta_box', 'page', 'normal', 'core');
|
||||
add_meta_box('slugdiv', __('Page Slug'), 'post_slug_meta_box', 'page', 'normal', 'core');
|
||||
if ( current_theme_supports( 'post-thumbnails', 'page' ) )
|
||||
add_meta_box('postimagediv', __('Page Image'), 'post_thumbnail_meta_box', 'page', 'side', 'low');
|
||||
|
||||
/**
|
||||
* Display custom field for page form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_custom_meta_box($post){
|
||||
?>
|
||||
<div id="postcustomstuff">
|
||||
<?php
|
||||
$metadata = has_meta($post->ID);
|
||||
list_meta($metadata);
|
||||
meta_form();
|
||||
?>
|
||||
<div id="ajax-response"></div>
|
||||
</div>
|
||||
<p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pagecustomdiv', __('Custom Fields'), 'page_custom_meta_box', 'page', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display comments status form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_comments_status_meta_box($post){
|
||||
?>
|
||||
<input name="advanced_view" type="hidden" value="1" />
|
||||
<p><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></p>
|
||||
<p><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></p>
|
||||
<p><?php _e('These settings apply to this page only. “Pings” are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pagecommentstatusdiv', __('Discussion'), 'page_comments_status_meta_box', 'page', 'normal', 'core');
|
||||
|
||||
/**
|
||||
* Display page slug form fields.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_slug_meta_box($post){
|
||||
?>
|
||||
<label class="hidden" for="post_name"><?php _e('Page Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pageslugdiv', __('Page Slug'), 'page_slug_meta_box', 'page', 'normal', 'core');
|
||||
|
||||
$authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
|
||||
if ( $post->post_author && !in_array($post->post_author, $authors) )
|
||||
$authors[] = $post->post_author;
|
||||
if ( $authors && count( $authors ) > 1 )
|
||||
add_meta_box('pageauthordiv', __('Page Author'), 'post_author_meta_box', 'page', 'normal', 'core');
|
||||
if ( $authors && count( $authors ) > 1 ) {
|
||||
/**
|
||||
* Display page author form fields, when more than one author exists.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_author_meta_box($post){
|
||||
global $current_user, $user_ID;
|
||||
$authors = get_editable_user_ids( $current_user->id, true, 'page' ); // TODO: ROLE SYSTEM
|
||||
if ( $post->post_author && !in_array($post->post_author, $authors) )
|
||||
$authors[] = $post->post_author;
|
||||
?>
|
||||
<label class="hidden" for="post_author_override"><?php _e('Page Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>
|
||||
<?php
|
||||
}
|
||||
add_meta_box('pageauthordiv', __('Page Author'), 'page_author_meta_box', 'page', 'normal', 'core');
|
||||
}
|
||||
|
||||
if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) )
|
||||
add_meta_box('revisionsdiv', __('Page Revisions'), 'post_revisions_meta_box', 'page', 'normal', 'core');
|
||||
if ( 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :
|
||||
/**
|
||||
* Display list of page revisions.
|
||||
*
|
||||
* @since 2.6.0
|
||||
*
|
||||
* @param object $post
|
||||
*/
|
||||
function page_revisions_meta_box($post) {
|
||||
wp_list_post_revisions();
|
||||
}
|
||||
add_meta_box('revisionsdiv', __('Page Revisions'), 'page_revisions_meta_box', 'page', 'normal', 'core');
|
||||
endif;
|
||||
|
||||
do_action('do_meta_boxes', 'page', 'normal', $post);
|
||||
do_action('do_meta_boxes', 'page', 'advanced', $post);
|
||||
@@ -101,42 +392,50 @@ require_once('admin-header.php');
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
<h2><?php echo wp_specialchars( $title ); ?></h2>
|
||||
|
||||
<form name="post" action="page.php" method="post" id="post">
|
||||
<?php if ( $notice ) : ?>
|
||||
<div id="notice" class="error"><p><?php echo $notice ?></p></div>
|
||||
<?php endif; ?>
|
||||
<?php if ( $message ) : ?>
|
||||
<div id="message" class="updated fade"><p><?php echo $message; ?></p></div>
|
||||
<?php if (isset($_GET['message'])) : ?>
|
||||
<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php wp_nonce_field($nonce_action); ?>
|
||||
<?php
|
||||
wp_nonce_field($nonce_action);
|
||||
|
||||
if (isset($mode) && 'bookmarklet' == $mode)
|
||||
echo '<input type="hidden" name="mode" value="bookmarklet" />';
|
||||
?>
|
||||
<input type="hidden" id="user-id" name="user_ID" value="<?php echo $user_ID ?>" />
|
||||
<input type="hidden" id="hiddenaction" name="action" value='<?php echo esc_attr($form_action) ?>' />
|
||||
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo esc_attr($form_action) ?>" />
|
||||
<input type="hidden" id="post_author" name="post_author" value="<?php echo esc_attr( $post->post_author ); ?>" />
|
||||
<input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
|
||||
<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
|
||||
<input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
|
||||
<?php echo $form_extra ?>
|
||||
<input type="hidden" id="post_type" name="post_type" value="<?php echo esc_attr($post->post_type) ?>" />
|
||||
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo esc_attr($post->post_status) ?>" />
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php echo esc_url(stripslashes(wp_get_referer())); ?>" />
|
||||
<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
|
||||
<input type="hidden" id="original_post_status" name="original_post_status" value="<?php echo $post->post_status ?>" />
|
||||
<input name="referredby" type="hidden" id="referredby" value="<?php echo clean_url(stripslashes(wp_get_referer())); ?>" />
|
||||
<?php if ( 'draft' != $post->post_status ) wp_original_referer_field(true, 'previous'); ?>
|
||||
|
||||
<div id="poststuff" class="metabox-holder<?php echo 2 == $screen_layout_columns ? ' has-right-sidebar' : ''; ?>">
|
||||
<div id="poststuff" class="metabox-holder">
|
||||
|
||||
<div id="side-info-column" class="inner-sidebar">
|
||||
|
||||
<?php
|
||||
|
||||
do_action('submitpage_box');
|
||||
$side_meta_boxes = do_meta_boxes('page', 'side', $post); ?>
|
||||
$side_meta_boxes = do_meta_boxes('page', 'side', $post);
|
||||
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div id="post-body">
|
||||
<div id="post-body-content">
|
||||
<div id="post-body" class="<?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?>">
|
||||
<div id="post-body-content" class="has-sidebar-content">
|
||||
|
||||
<div id="titlediv">
|
||||
<div id="titlewrap">
|
||||
<label class="screen-reader-text" for="title"><?php _e('Title') ?></label>
|
||||
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo esc_attr( htmlspecialchars( $post->post_title ) ); ?>" id="title" autocomplete="off" />
|
||||
<input type="text" name="post_title" size="30" tabindex="1" value="<?php echo attribute_escape( $post->post_title ); ?>" id="title" autocomplete="off" />
|
||||
</div>
|
||||
<div class="inside">
|
||||
<?php $sample_permalink_html = get_sample_permalink_html($post->ID); ?>
|
||||
@@ -151,36 +450,38 @@ endif; ?>
|
||||
<div id="<?php echo user_can_richedit() ? 'postdivrich' : 'postdiv'; ?>" class="postarea">
|
||||
|
||||
<?php the_editor($post->post_content); ?>
|
||||
<table id="post-status-info" cellspacing="0"><tbody><tr>
|
||||
<td id="wp-word-count"></td>
|
||||
<td class="autosave-info">
|
||||
<div id="post-status-info">
|
||||
<span id="wp-word-count" class="alignleft"></span>
|
||||
<span class="alignright">
|
||||
<span id="autosave"> </span>
|
||||
|
||||
<?php
|
||||
if ($post_ID) {
|
||||
if ( $last_id = get_post_meta($post_ID, '_edit_last', true) ) {
|
||||
$last_user = get_userdata($last_id);
|
||||
printf(__('Last edited by %1$s on %2$s at %3$s'), esc_html( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
||||
printf(__('Last edited by %1$s on %2$s at %3$s'), wp_specialchars( $last_user->display_name ), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
||||
} else {
|
||||
printf(__('Last edited on %1$s at %2$s'), mysql2date(get_option('date_format'), $post->post_modified), mysql2date(get_option('time_format'), $post->post_modified));
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
</tr></tbody></table>
|
||||
</span>
|
||||
<br class="clear" />
|
||||
</div>
|
||||
|
||||
<?php
|
||||
wp_nonce_field( 'autosave', 'autosavenonce', false );
|
||||
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
||||
wp_nonce_field( 'getpermalink', 'getpermalinknonce', false );
|
||||
wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
|
||||
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
|
||||
<?php wp_nonce_field( 'autosave', 'autosavenonce', false ); ?>
|
||||
<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
|
||||
<?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?>
|
||||
<?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?>
|
||||
<?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
do_meta_boxes('page', 'normal', $post);
|
||||
do_action('edit_page_form');
|
||||
do_meta_boxes('page', 'advanced', $post);
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -9,90 +9,59 @@
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once('admin.php');
|
||||
|
||||
if ( !current_user_can('edit_pages') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
// Handle bulk actions
|
||||
if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) {
|
||||
check_admin_referer('bulk-pages');
|
||||
$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
|
||||
|
||||
if ( strpos($sendback, 'page.php') !== false )
|
||||
$sendback = admin_url('page-new.php');
|
||||
|
||||
if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
|
||||
$post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_GET['post_status']);
|
||||
$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_status = %s", $post_status ) );
|
||||
$doaction = 'delete';
|
||||
} elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['post']) || isset($_GET['ids']) ) ) {
|
||||
$post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']);
|
||||
$doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
|
||||
} else {
|
||||
wp_redirect( admin_url('edit-pages.php') );
|
||||
}
|
||||
if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
|
||||
$doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
|
||||
|
||||
switch ( $doaction ) {
|
||||
case 'trash':
|
||||
$trashed = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can('delete_page', $post_id) )
|
||||
wp_die( __('You are not allowed to move this page to the trash.') );
|
||||
|
||||
if ( !wp_trash_post($post_id) )
|
||||
wp_die( __('Error in moving to trash...') );
|
||||
|
||||
$trashed++;
|
||||
}
|
||||
$sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids)), $sendback );
|
||||
break;
|
||||
case 'untrash':
|
||||
$untrashed = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can('delete_page', $post_id) )
|
||||
wp_die( __('You are not allowed to restore this page from the trash.') );
|
||||
|
||||
if ( !wp_untrash_post($post_id) )
|
||||
wp_die( __('Error in restoring from trash...') );
|
||||
|
||||
$untrashed++;
|
||||
}
|
||||
$sendback = add_query_arg('untrashed', $untrashed, $sendback);
|
||||
break;
|
||||
case 'delete':
|
||||
$deleted = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
$post_del = & get_post($post_id);
|
||||
if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
|
||||
check_admin_referer('bulk-pages');
|
||||
$deleted = 0;
|
||||
foreach( (array) $_GET['post'] as $post_id_del ) {
|
||||
$post_del = & get_post($post_id_del);
|
||||
|
||||
if ( !current_user_can('delete_page', $post_id) )
|
||||
wp_die( __('You are not allowed to delete this page.') );
|
||||
if ( !current_user_can('delete_page', $post_id_del) )
|
||||
wp_die( __('You are not allowed to delete this page.') );
|
||||
|
||||
if ( $post_del->post_type == 'attachment' ) {
|
||||
if ( ! wp_delete_attachment($post_id) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
} else {
|
||||
if ( !wp_delete_post($post_id) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
if ( $post_del->post_type == 'attachment' ) {
|
||||
if ( ! wp_delete_attachment($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
} else {
|
||||
if ( !wp_delete_post($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
}
|
||||
$deleted++;
|
||||
}
|
||||
$deleted++;
|
||||
}
|
||||
$sendback = add_query_arg('deleted', $deleted, $sendback);
|
||||
break;
|
||||
case 'edit':
|
||||
$_GET['post_type'] = 'page';
|
||||
$done = bulk_edit_posts($_GET);
|
||||
if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) {
|
||||
check_admin_referer('bulk-pages');
|
||||
|
||||
if ( is_array($done) ) {
|
||||
$done['updated'] = count( $done['updated'] );
|
||||
$done['skipped'] = count( $done['skipped'] );
|
||||
$done['locked'] = count( $done['locked'] );
|
||||
$sendback = add_query_arg( $done, $sendback );
|
||||
if ( -1 == $_GET['_status'] ) {
|
||||
$_GET['post_status'] = null;
|
||||
unset($_GET['_status'], $_GET['post_status']);
|
||||
} else {
|
||||
$_GET['post_status'] = $_GET['_status'];
|
||||
}
|
||||
|
||||
$done = bulk_edit_posts($_GET);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ( isset($_GET['action']) )
|
||||
$sendback = remove_query_arg( array('action', 'action2', 'post_parent', 'page_template', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view', 'post_type'), $sendback );
|
||||
|
||||
$sendback = wp_get_referer();
|
||||
if (strpos($sendback, 'page.php') !== false) $sendback = admin_url('page-new.php');
|
||||
elseif (strpos($sendback, 'attachments.php') !== false) $sendback = admin_url('attachments.php');
|
||||
if ( isset($done) ) {
|
||||
$done['updated'] = count( $done['updated'] );
|
||||
$done['skipped'] = count( $done['skipped'] );
|
||||
$done['locked'] = count( $done['locked'] );
|
||||
$sendback = add_query_arg( $done, $sendback );
|
||||
}
|
||||
if ( isset($deleted) )
|
||||
$sendback = add_query_arg('deleted', $deleted, $sendback);
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
|
||||
@@ -106,20 +75,14 @@ $parent_file = 'edit-pages.php';
|
||||
wp_enqueue_script('inline-edit-post');
|
||||
|
||||
$post_stati = array( // array( adj, noun )
|
||||
'publish' => array(_x('Published', 'page'), __('Published pages'), _nx_noop('Published <span class="count">(%s)</span>', 'Published <span class="count">(%s)</span>', 'page')),
|
||||
'future' => array(_x('Scheduled', 'page'), __('Scheduled pages'), _nx_noop('Scheduled <span class="count">(%s)</span>', 'Scheduled <span class="count">(%s)</span>', 'page')),
|
||||
'pending' => array(_x('Pending Review', 'page'), __('Pending pages'), _nx_noop('Pending Review <span class="count">(%s)</span>', 'Pending Review <span class="count">(%s)</span>', 'page')),
|
||||
'draft' => array(_x('Draft', 'page'), _x('Drafts', 'manage posts header'), _nx_noop('Draft <span class="count">(%s)</span>', 'Drafts <span class="count">(%s)</span>', 'page')),
|
||||
'private' => array(_x('Private', 'page'), __('Private pages'), _nx_noop('Private <span class="count">(%s)</span>', 'Private <span class="count">(%s)</span>', 'page')),
|
||||
'trash' => array(_x('Trash', 'page'), __('Trash pages'), _nx_noop('Trash <span class="count">(%s)</span>', 'Trash <span class="count">(%s)</span>', 'page'))
|
||||
'publish' => array(__('Published|page'), __('Published pages'), _n_noop('Published <span class="count">(%s)</span>|page', 'Published <span class="count">(%s)</span>')),
|
||||
'future' => array(__('Scheduled|page'), __('Scheduled pages'), _n_noop('Scheduled <span class="count">(%s)</span>|page', 'Scheduled <span class="count">(%s)</span>')),
|
||||
'pending' => array(__('Pending Review|page'), __('Pending pages'), _n_noop('Pending Review <span class="count">(%s)</span>|page', 'Pending Review <span class="count">(%s)</span>')),
|
||||
'draft' => array(__('Draft|page'), _c('Drafts|manage posts header'), _n_noop('Draft <span class="count">(%s)</span>|page', 'Drafts <span class="count">(%s)</span>')),
|
||||
'private' => array(__('Private|page'), __('Private pages'), _n_noop('Private <span class="count">(%s)</span>|page', 'Private <span class="count">(%s)</span>'))
|
||||
);
|
||||
|
||||
if ( !EMPTY_TRASH_DAYS )
|
||||
unset($post_stati['trash']);
|
||||
|
||||
$post_stati = apply_filters('page_stati', $post_stati);
|
||||
|
||||
$query = array('post_type' => 'page', 'orderby' => 'menu_order title',
|
||||
$query = array('post_type' => 'page', 'orderby' => 'menu_order title', 'what_to_show' => 'posts',
|
||||
'posts_per_page' => -1, 'posts_per_archive_page' => -1, 'order' => 'asc');
|
||||
|
||||
$post_status_label = __('Pages');
|
||||
@@ -141,40 +104,33 @@ require_once('admin-header.php'); ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?> <a href="page-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'page'); ?></a> <?php
|
||||
<h2><?php echo wp_specialchars( $title );
|
||||
if ( isset($_GET['s']) && $_GET['s'] )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( get_search_query() ) ); ?>
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', wp_specialchars( get_search_query() ) ); ?>
|
||||
</h2>
|
||||
|
||||
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?>
|
||||
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?>
|
||||
<div id="message" class="updated fade"><p>
|
||||
<?php if ( isset($_GET['updated']) && (int) $_GET['updated'] ) {
|
||||
printf( _n( '%s page updated.', '%s pages updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
|
||||
printf( __ngettext( '%s page updated.', '%s pages updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
|
||||
unset($_GET['updated']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['skipped']) && (int) $_GET['skipped'] ) {
|
||||
printf( _n( '%s page not updated, invalid parent page specified.', '%s pages not updated, invalid parent page specified.', $_GET['skipped'] ), number_format_i18n( $_GET['skipped'] ) );
|
||||
printf( __ngettext( '%s page not updated, invalid parent page specified.', '%s pages not updated, invalid parent page specified.', $_GET['skipped'] ), number_format_i18n( $_GET['skipped'] ) );
|
||||
unset($_GET['skipped']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['locked']) && (int) $_GET['locked'] ) {
|
||||
printf( _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) );
|
||||
printf( __ngettext( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['skipped'] ) );
|
||||
unset($_GET['locked']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
|
||||
printf( _n( 'Page permanently deleted.', '%s pages permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
|
||||
printf( __ngettext( 'Page deleted.', '%s pages deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
|
||||
unset($_GET['deleted']);
|
||||
}
|
||||
if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
|
||||
printf( _n( 'Page moved to the trash.', '%s pages moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
|
||||
$ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
|
||||
echo ' <a href="' . esc_url( wp_nonce_url( "edit-pages.php?doaction=undo&action=untrash&ids=$ids", "bulk-pages" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
unset($_GET['trashed']);
|
||||
}
|
||||
if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) {
|
||||
printf( _n( 'Page restored from the trash.', '%s pages restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
|
||||
unset($_GET['untrashed']);
|
||||
}
|
||||
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] );
|
||||
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] );
|
||||
?>
|
||||
</p></div>
|
||||
<?php } ?>
|
||||
@@ -184,7 +140,7 @@ $_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated'
|
||||
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
|
||||
endif; ?>
|
||||
|
||||
<form id="posts-filter" action="<?php echo admin_url('edit-pages.php'); ?>" method="get">
|
||||
<form id="posts-filter" action="" method="get">
|
||||
<ul class="subsubsub">
|
||||
<?php
|
||||
|
||||
@@ -192,19 +148,19 @@ $avail_post_stati = get_available_post_statuses('page');
|
||||
if ( empty($locked_post_status) ) :
|
||||
$status_links = array();
|
||||
$num_posts = wp_count_posts('page', 'readable');
|
||||
$total_posts = array_sum( (array) $num_posts ) - $num_posts->trash;
|
||||
$total_posts = array_sum( (array) $num_posts );
|
||||
$class = empty($_GET['post_status']) ? ' class="current"' : '';
|
||||
$status_links[] = "<li><a href='edit-pages.php'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'pages' ), number_format_i18n( $total_posts ) ) . '</a>';
|
||||
$status_links[] = "<li><a href='edit-pages.php'$class>" . sprintf( __ngettext( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts ), number_format_i18n( $total_posts ) ) . '</a>';
|
||||
foreach ( $post_stati as $status => $label ) {
|
||||
$class = '';
|
||||
|
||||
if ( !in_array($status, $avail_post_stati) || $num_posts->$status <= 0 )
|
||||
if ( !in_array($status, $avail_post_stati) )
|
||||
continue;
|
||||
|
||||
if ( isset( $_GET['post_status'] ) && $status == $_GET['post_status'] )
|
||||
$class = ' class="current"';
|
||||
|
||||
$status_links[] = "<li><a href='edit-pages.php?post_status=$status'$class>" . sprintf( _nx( $label[2][0], $label[2][1], $num_posts->$status, $label[2][2] ), number_format_i18n( $num_posts->$status ) ) . '</a>';
|
||||
$status_links[] = "<li><a href='edit-pages.php?post_status=$status'$class>" . sprintf( _nc( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
|
||||
}
|
||||
echo implode( " |</li>\n", $status_links ) . '</li>';
|
||||
unset($status_links);
|
||||
@@ -213,12 +169,14 @@ endif;
|
||||
</ul>
|
||||
|
||||
<p class="search-box">
|
||||
<label class="screen-reader-text" for="page-search-input"><?php _e( 'Search Pages' ); ?>:</label>
|
||||
<input type="text" id="page-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<input type="submit" value="<?php esc_attr_e( 'Search Pages' ); ?>" class="button" />
|
||||
<label class="hidden" for="page-search-input"><?php _e( 'Search Pages' ); ?>:</label>
|
||||
<input type="text" class="search-input" id="page-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<input type="submit" value="<?php _e( 'Search Pages' ); ?>" class="button" />
|
||||
</p>
|
||||
|
||||
<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_GET['post_status']) ? esc_attr($_GET['post_status']) : 'all'; ?>" />
|
||||
<?php if ( isset($_GET['post_status'] ) ) : ?>
|
||||
<input type="hidden" name="post_status" value="<?php echo attribute_escape($_GET['post_status']) ?>" />
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($posts) { ?>
|
||||
|
||||
@@ -228,10 +186,8 @@ endif;
|
||||
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
|
||||
if ( empty($pagenum) )
|
||||
$pagenum = 1;
|
||||
$per_page = (int) get_user_option( 'edit_pages_per_page', 0, false );
|
||||
if ( empty( $per_page ) || $per_page < 1 )
|
||||
if( ! isset( $per_page ) || $per_page < 0 )
|
||||
$per_page = 20;
|
||||
$per_page = apply_filters( 'edit_pages_per_page', $per_page );
|
||||
|
||||
$num_pages = ceil($wp_query->post_count / $per_page);
|
||||
$page_links = paginate_links( array(
|
||||
@@ -243,8 +199,6 @@ $page_links = paginate_links( array(
|
||||
'current' => $pagenum
|
||||
));
|
||||
|
||||
$is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash';
|
||||
|
||||
if ( $page_links ) : ?>
|
||||
<div class="tablenav-pages"><?php $page_links_text = sprintf( '<span class="displaying-num">' . __( 'Displaying %s–%s of %s' ) . '</span>%s',
|
||||
number_format_i18n( ( $pagenum - 1 ) * $per_page + 1 ),
|
||||
@@ -257,21 +211,11 @@ if ( $page_links ) : ?>
|
||||
<div class="alignleft actions">
|
||||
<select name="action">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<?php if ( $is_trash ) { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="edit"><?php _e('Edit'); ?></option>
|
||||
<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } ?>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<?php wp_nonce_field('bulk-pages'); ?>
|
||||
<?php if ( $is_trash ) { ?>
|
||||
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
@@ -306,20 +250,10 @@ if ( $page_links )
|
||||
<div class="alignleft actions">
|
||||
<select name="action2">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<?php if ( $is_trash ) { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="edit"><?php _e('Edit'); ?></option>
|
||||
<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } ?>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
<?php if ( $is_trash ) { ?>
|
||||
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
@@ -356,9 +290,7 @@ if ( 1 == count($posts) && is_singular() ) :
|
||||
<table class="widefat" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="column-comment">
|
||||
<?php /* translators: column name */ echo _x('Comment', 'column name') ?>
|
||||
</th>
|
||||
<th scope="col" class="column-comment"><?php echo _c('Comment|noun') ?></th>
|
||||
<th scope="col" class="column-author"><?php _e('Author') ?></th>
|
||||
<th scope="col" class="column-date"><?php _e('Submitted') ?></th>
|
||||
</tr>
|
||||
@@ -380,5 +312,20 @@ endif; // posts;
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include('admin-footer.php');
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
(function($){
|
||||
$(document).ready(function(){
|
||||
$('#doaction, #doaction2').click(function(){
|
||||
if ( $('select[name^="action"]').val() == 'delete' ) {
|
||||
var m = '<?php echo js_escape(__("You are about to delete the selected pages.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
|
||||
return showNotice.warn(m);
|
||||
}
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
columns.init('edit-pages');
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
<?php include('admin-footer.php'); ?>
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
if ( ! defined('ABSPATH') ) die();
|
||||
?>
|
||||
<table class="widefat post fixed" cellspacing="0">
|
||||
<thead>
|
||||
|
||||
@@ -6,13 +6,6 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
// don't load directly
|
||||
if ( !defined('ABSPATH') )
|
||||
die('-1');
|
||||
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('You do not have sufficient permissions to edit tags for this blog.'));
|
||||
|
||||
if ( empty($tag_ID) ) { ?>
|
||||
<div id="message" class="updated fade"><p><strong><?php _e('A tag was not selected for editing.'); ?></strong></p></div>
|
||||
<?php
|
||||
@@ -27,27 +20,21 @@ do_action('edit_tag_form_pre', $tag); ?>
|
||||
<div id="ajax-response"></div>
|
||||
<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate">
|
||||
<input type="hidden" name="action" value="editedtag" />
|
||||
<input type="hidden" name="tag_ID" value="<?php echo esc_attr($tag->term_id) ?>" />
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy) ?>" />
|
||||
<input type="hidden" name="tag_ID" value="<?php echo $tag->term_id ?>" />
|
||||
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('update-tag_' . $tag_ID); ?>
|
||||
<table class="form-table">
|
||||
<tr class="form-field form-required">
|
||||
<th scope="row" valign="top"><label for="name"><?php _e('Tag name') ?></label></th>
|
||||
<td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" /></td>
|
||||
<td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo attribute_escape($tag->name); ?>" size="40" aria-required="true" />
|
||||
<p><?php _e('The name is how the tag appears on your site.'); ?></p></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="slug"><?php _e('Tag slug') ?></label></th>
|
||||
<td><input name="slug" id="slug" type="text" value="<?php if ( isset( $tag->slug ) ) echo esc_attr(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
|
||||
<p class="description"><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td>
|
||||
<td><input name="slug" id="slug" type="text" value="<?php if ( isset( $tag->slug ) ) echo attribute_escape(apply_filters('editable_slug', $tag->slug)); ?>" size="40" />
|
||||
<p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p></td>
|
||||
</tr>
|
||||
<tr class="form-field">
|
||||
<th scope="row" valign="top"><label for="description"><?php _e('Description') ?></label></th>
|
||||
<td><textarea name="description" id="description" rows="5" cols="50" style="width: 97%;"><?php echo esc_html($tag->description); ?></textarea><br />
|
||||
<span class="description"><?php _e('The description is not prominent by default, however some themes may show it.'); ?></span></td>
|
||||
</tr>
|
||||
<?php do_action('edit_tag_form_fields', $tag); ?>
|
||||
</table>
|
||||
<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php esc_attr_e('Update Tag'); ?>" /></p>
|
||||
<p class="submit"><input type="submit" class="button-primary" name="submit" value="<?php _e('Update Tag'); ?>" /></p>
|
||||
<?php do_action('edit_tag_form', $tag); ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -11,30 +11,21 @@ require_once('admin.php');
|
||||
|
||||
$title = __('Tags');
|
||||
|
||||
wp_reset_vars( array('action', 'tag', 'taxonomy') );
|
||||
|
||||
if ( empty($taxonomy) )
|
||||
$taxonomy = 'post_tag';
|
||||
|
||||
if ( !is_taxonomy($taxonomy) )
|
||||
wp_die(__('Invalid taxonomy'));
|
||||
|
||||
$parent_file = 'edit.php';
|
||||
$submenu_file = "edit-tags.php?taxonomy=$taxonomy";
|
||||
wp_reset_vars( array('action', 'tag') );
|
||||
|
||||
if ( isset( $_GET['action'] ) && isset($_GET['delete_tags']) && ( 'delete' == $_GET['action'] || 'delete' == $_GET['action2'] ) )
|
||||
$action = 'bulk-delete';
|
||||
|
||||
switch($action) {
|
||||
|
||||
case 'add-tag':
|
||||
case 'addtag':
|
||||
|
||||
check_admin_referer('add-tag');
|
||||
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
$ret = wp_insert_term($_POST['tag-name'], $taxonomy, $_POST);
|
||||
$ret = wp_insert_term($_POST['name'], 'post_tag', $_POST);
|
||||
if ( $ret && !is_wp_error( $ret ) ) {
|
||||
wp_redirect('edit-tags.php?message=1#addtag');
|
||||
} else {
|
||||
@@ -44,27 +35,15 @@ case 'add-tag':
|
||||
break;
|
||||
|
||||
case 'delete':
|
||||
if ( !isset( $_GET['tag_ID'] ) ) {
|
||||
wp_redirect("edit-tags.php?taxonomy=$taxonomy");
|
||||
exit;
|
||||
}
|
||||
|
||||
$tag_ID = (int) $_GET['tag_ID'];
|
||||
check_admin_referer('delete-tag_' . $tag_ID);
|
||||
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
wp_delete_term( $tag_ID, $taxonomy);
|
||||
wp_delete_term( $tag_ID, 'post_tag');
|
||||
|
||||
$location = 'edit-tags.php';
|
||||
if ( $referer = wp_get_referer() ) {
|
||||
if ( false !== strpos($referer, 'edit-tags.php') )
|
||||
$location = $referer;
|
||||
}
|
||||
|
||||
$location = add_query_arg('message', 2, $location);
|
||||
wp_redirect($location);
|
||||
wp_redirect('edit-tags.php?message=2');
|
||||
exit;
|
||||
|
||||
break;
|
||||
@@ -75,9 +54,9 @@ case 'bulk-delete':
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
$tags = (array) $_GET['delete_tags'];
|
||||
foreach( $tags as $tag_ID ) {
|
||||
wp_delete_term( $tag_ID, $taxonomy);
|
||||
$tags = $_GET['delete_tags'];
|
||||
foreach( (array) $tags as $tag_ID ) {
|
||||
wp_delete_term( $tag_ID, 'post_tag');
|
||||
}
|
||||
|
||||
$location = 'edit-tags.php';
|
||||
@@ -98,7 +77,7 @@ case 'edit':
|
||||
require_once ('admin-header.php');
|
||||
$tag_ID = (int) $_GET['tag_ID'];
|
||||
|
||||
$tag = get_term($tag_ID, $taxonomy, OBJECT, 'edit');
|
||||
$tag = get_term($tag_ID, 'post_tag', OBJECT, 'edit');
|
||||
include('edit-tag-form.php');
|
||||
|
||||
break;
|
||||
@@ -110,7 +89,7 @@ case 'editedtag':
|
||||
if ( !current_user_can('manage_categories') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
$ret = wp_update_term($tag_ID, $taxonomy, $_POST);
|
||||
$ret = wp_update_term($tag_ID, 'post_tag', $_POST);
|
||||
|
||||
$location = 'edit-tags.php';
|
||||
if ( $referer = wp_get_original_referer() ) {
|
||||
@@ -151,23 +130,21 @@ $messages[6] = __('Tags deleted.'); ?>
|
||||
|
||||
<div class="wrap nosubsub">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title );
|
||||
<h2><?php echo wp_specialchars( $title );
|
||||
if ( isset($_GET['s']) && $_GET['s'] )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( stripslashes($_GET['s']) ) ); ?>
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', wp_specialchars( stripslashes($_GET['s']) ) ); ?>
|
||||
</h2>
|
||||
|
||||
<?php if ( isset($_GET['message']) && ( $msg = (int) $_GET['message'] ) ) : ?>
|
||||
<div id="message" class="updated fade"><p><?php echo $messages[$msg]; ?></p></div>
|
||||
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('message'), $_SERVER['REQUEST_URI']);
|
||||
endif; ?>
|
||||
<div id="ajax-response"></div>
|
||||
|
||||
<form class="search-form" action="" method="get">
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
|
||||
<p class="search-box">
|
||||
<label class="screen-reader-text" for="tag-search-input"><?php _e( 'Search Tags' ); ?>:</label>
|
||||
<input type="text" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<input type="submit" value="<?php esc_attr_e( 'Search Tags' ); ?>" class="button" />
|
||||
<label class="hidden" for="tag-search-input"><?php _e( 'Search Tags' ); ?>:</label>
|
||||
<input type="text" class="search-input" id="tag-search-input" name="s" value="<?php _admin_search_query(); ?>" />
|
||||
<input type="submit" value="<?php _e( 'Search Tags' ); ?>" class="button" />
|
||||
</p>
|
||||
</form>
|
||||
<br class="clear" />
|
||||
@@ -177,25 +154,20 @@ endif; ?>
|
||||
<div id="col-right">
|
||||
<div class="col-wrap">
|
||||
<form id="posts-filter" action="" method="get">
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
|
||||
<div class="tablenav">
|
||||
<?php
|
||||
$pagenum = isset( $_GET['pagenum'] ) ? absint( $_GET['pagenum'] ) : 0;
|
||||
if ( empty($pagenum) )
|
||||
$pagenum = 1;
|
||||
|
||||
$tags_per_page = (int) get_user_option( 'edit_tags_per_page', 0, false );
|
||||
if ( empty($tags_per_page) || $tags_per_page < 1 )
|
||||
$tags_per_page = 20;
|
||||
$tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
|
||||
$tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
|
||||
$tagsperpage = apply_filters("tagsperpage",20);
|
||||
|
||||
$page_links = paginate_links( array(
|
||||
'base' => add_query_arg( 'pagenum', '%#%' ),
|
||||
'format' => '',
|
||||
'prev_text' => __('«'),
|
||||
'next_text' => __('»'),
|
||||
'total' => ceil(wp_count_terms($taxonomy) / $tags_per_page),
|
||||
'total' => ceil(wp_count_terms('post_tag') / $tagsperpage),
|
||||
'current' => $pagenum
|
||||
));
|
||||
|
||||
@@ -208,7 +180,7 @@ if ( $page_links )
|
||||
<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<?php wp_nonce_field('bulk-tags'); ?>
|
||||
</div>
|
||||
|
||||
@@ -235,7 +207,7 @@ if ( $page_links )
|
||||
|
||||
$searchterms = isset( $_GET['s'] ) ? trim( $_GET['s'] ) : '';
|
||||
|
||||
$count = tag_rows( $pagenum, $tags_per_page, $searchterms, $taxonomy );
|
||||
$count = tag_rows( $pagenum, $tagsperpage, $searchterms );
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -251,7 +223,7 @@ if ( $page_links )
|
||||
<option value="" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
</div>
|
||||
|
||||
<br class="clear" />
|
||||
@@ -269,9 +241,9 @@ if ( $page_links )
|
||||
<h3><?php _e('Popular Tags'); ?></h3>
|
||||
<?php
|
||||
if ( $can_manage )
|
||||
wp_tag_cloud(array('taxonomy' => $taxonomy, 'link' => 'edit'));
|
||||
wp_tag_cloud(array('link' => 'edit'));
|
||||
else
|
||||
wp_tag_cloud(array('taxonomy' => $taxonomy));
|
||||
wp_tag_cloud();
|
||||
?>
|
||||
</div>
|
||||
|
||||
@@ -280,30 +252,24 @@ else
|
||||
|
||||
<div class="form-wrap">
|
||||
<h3><?php _e('Add a New Tag'); ?></h3>
|
||||
<form id="addtag" method="post" action="edit-tags.php" class="validate">
|
||||
<input type="hidden" name="action" value="add-tag" />
|
||||
<input type="hidden" name="taxonomy" value="<?php echo esc_attr($taxonomy); ?>" />
|
||||
<?php wp_nonce_field('add-tag'); ?>
|
||||
<div id="ajax-response"></div>
|
||||
<form name="addtag" id="addtag" method="post" action="edit-tags.php" class="add:the-list: validate">
|
||||
<input type="hidden" name="action" value="addtag" />
|
||||
<?php wp_original_referer_field(true, 'previous'); wp_nonce_field('add-tag'); ?>
|
||||
|
||||
<div class="form-field form-required">
|
||||
<label for="tag-name"><?php _e('Tag name') ?></label>
|
||||
<input name="tag-name" id="tag-name" type="text" value="" size="40" aria-required="true" />
|
||||
<p><?php _e('The name is how the tag appears on your site.'); ?></p>
|
||||
<label for="name"><?php _e('Tag name') ?></label>
|
||||
<input name="name" id="name" type="text" value="" size="40" aria-required="true" />
|
||||
<p><?php _e('The name is how the tag appears on your site.'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="slug"><?php _e('Tag slug') ?></label>
|
||||
<input name="slug" id="slug" type="text" value="" size="40" />
|
||||
<p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
|
||||
<p><?php _e('The “slug” is the URL-friendly version of the name. It is usually all lowercase and contains only letters, numbers, and hyphens.'); ?></p>
|
||||
</div>
|
||||
|
||||
<div class="form-field">
|
||||
<label for="description"><?php _e('Description') ?></label>
|
||||
<textarea name="description" id="description" rows="5" cols="40"></textarea>
|
||||
<p><?php _e('The description is not prominent by default; however, some themes may show it.'); ?></p>
|
||||
</div>
|
||||
|
||||
<p class="submit"><input type="submit" class="button" name="submit" id="submit" value="<?php esc_attr_e('Add Tag'); ?>" /></p>
|
||||
<p class="submit"><input type="submit" class="button" name="submit" value="<?php _e('Add Tag'); ?>" /></p>
|
||||
<?php do_action('add_tag_form'); ?>
|
||||
</form></div>
|
||||
<?php } ?>
|
||||
@@ -314,6 +280,21 @@ else
|
||||
</div><!-- /col-container -->
|
||||
</div><!-- /wrap -->
|
||||
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
(function($){
|
||||
$(document).ready(function(){
|
||||
$('#doaction, #doaction2').click(function(){
|
||||
if ( $('select[name^="action"]').val() == 'delete' ) {
|
||||
var m = '<?php echo js_escape(__("You are about to delete the selected tags.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
|
||||
return showNotice.warn(m);
|
||||
}
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
<?php inline_edit_term_row('edit-tags'); ?>
|
||||
|
||||
<?php
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
/** WordPress Administration Bootstrap */
|
||||
require_once('admin.php');
|
||||
|
||||
if ( !current_user_can('edit_posts') )
|
||||
wp_die(__('Cheatin’ uh?'));
|
||||
|
||||
// Back-compat for viewing comments of an entry
|
||||
if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['page_id'] ) ) ) {
|
||||
wp_redirect( admin_url('edit-comments.php?p=' . $_redirect ) );
|
||||
@@ -21,85 +18,58 @@ if ( $_redirect = intval( max( @$_GET['p'], @$_GET['attachment_id'], @$_GET['pag
|
||||
}
|
||||
|
||||
// Handle bulk actions
|
||||
if ( isset($_GET['doaction']) || isset($_GET['doaction2']) || isset($_GET['delete_all']) || isset($_GET['delete_all2']) || isset($_GET['bulk_edit']) ) {
|
||||
check_admin_referer('bulk-posts');
|
||||
$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'ids'), wp_get_referer() );
|
||||
|
||||
if ( strpos($sendback, 'post.php') !== false )
|
||||
$sendback = admin_url('post-new.php');
|
||||
|
||||
if ( isset($_GET['delete_all']) || isset($_GET['delete_all2']) ) {
|
||||
$post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_GET['post_status']);
|
||||
$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type='post' AND post_status = %s", $post_status ) );
|
||||
$doaction = 'delete';
|
||||
} elseif ( ( $_GET['action'] != -1 || $_GET['action2'] != -1 ) && ( isset($_GET['post']) || isset($_GET['ids']) ) ) {
|
||||
$post_ids = isset($_GET['post']) ? array_map( 'intval', (array) $_GET['post'] ) : explode(',', $_GET['ids']);
|
||||
$doaction = ($_GET['action'] != -1) ? $_GET['action'] : $_GET['action2'];
|
||||
} else {
|
||||
wp_redirect( admin_url('edit.php') );
|
||||
}
|
||||
if ( isset($_GET['action']) && ( -1 != $_GET['action'] || -1 != $_GET['action2'] ) ) {
|
||||
$doaction = ( -1 != $_GET['action'] ) ? $_GET['action'] : $_GET['action2'];
|
||||
|
||||
switch ( $doaction ) {
|
||||
case 'trash':
|
||||
$trashed = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can('delete_post', $post_id) )
|
||||
wp_die( __('You are not allowed to move this post to the trash.') );
|
||||
|
||||
if ( !wp_trash_post($post_id) )
|
||||
wp_die( __('Error in moving to trash...') );
|
||||
|
||||
$trashed++;
|
||||
}
|
||||
$sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids)), $sendback );
|
||||
break;
|
||||
case 'untrash':
|
||||
$untrashed = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
if ( !current_user_can('delete_post', $post_id) )
|
||||
wp_die( __('You are not allowed to restore this post from the trash.') );
|
||||
|
||||
if ( !wp_untrash_post($post_id) )
|
||||
wp_die( __('Error in restoring from trash...') );
|
||||
|
||||
$untrashed++;
|
||||
}
|
||||
$sendback = add_query_arg('untrashed', $untrashed, $sendback);
|
||||
break;
|
||||
case 'delete':
|
||||
$deleted = 0;
|
||||
foreach( (array) $post_ids as $post_id ) {
|
||||
$post_del = & get_post($post_id);
|
||||
if ( isset($_GET['post']) && ! isset($_GET['bulk_edit']) && (isset($_GET['doaction']) || isset($_GET['doaction2'])) ) {
|
||||
check_admin_referer('bulk-posts');
|
||||
$deleted = 0;
|
||||
foreach( (array) $_GET['post'] as $post_id_del ) {
|
||||
$post_del = & get_post($post_id_del);
|
||||
|
||||
if ( !current_user_can('delete_post', $post_id) )
|
||||
wp_die( __('You are not allowed to delete this post.') );
|
||||
if ( !current_user_can('delete_post', $post_id_del) )
|
||||
wp_die( __('You are not allowed to delete this post.') );
|
||||
|
||||
if ( $post_del->post_type == 'attachment' ) {
|
||||
if ( ! wp_delete_attachment($post_id) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
} else {
|
||||
if ( !wp_delete_post($post_id) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
if ( $post_del->post_type == 'attachment' ) {
|
||||
if ( ! wp_delete_attachment($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
} else {
|
||||
if ( !wp_delete_post($post_id_del) )
|
||||
wp_die( __('Error in deleting...') );
|
||||
}
|
||||
$deleted++;
|
||||
}
|
||||
$deleted++;
|
||||
}
|
||||
$sendback = add_query_arg('deleted', $deleted, $sendback);
|
||||
break;
|
||||
case 'edit':
|
||||
$done = bulk_edit_posts($_GET);
|
||||
if ( isset($_GET['post']) && isset($_GET['bulk_edit']) ) {
|
||||
check_admin_referer('bulk-posts');
|
||||
|
||||
if ( is_array($done) ) {
|
||||
$done['updated'] = count( $done['updated'] );
|
||||
$done['skipped'] = count( $done['skipped'] );
|
||||
$done['locked'] = count( $done['locked'] );
|
||||
$sendback = add_query_arg( $done, $sendback );
|
||||
if ( -1 == $_GET['_status'] ) {
|
||||
$_GET['post_status'] = null;
|
||||
unset($_GET['_status'], $_GET['post_status']);
|
||||
} else {
|
||||
$_GET['post_status'] = $_GET['_status'];
|
||||
}
|
||||
|
||||
$done = bulk_edit_posts($_GET);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if ( isset($_GET['action']) )
|
||||
$sendback = remove_query_arg( array('action', 'action2', 'cat', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view', 'post_type'), $sendback );
|
||||
|
||||
$sendback = wp_get_referer();
|
||||
if ( strpos($sendback, 'post.php') !== false ) $sendback = admin_url('post-new.php');
|
||||
elseif ( strpos($sendback, 'attachments.php') !== false ) $sendback = admin_url('attachments.php');
|
||||
if ( isset($done) ) {
|
||||
$done['updated'] = count( $done['updated'] );
|
||||
$done['skipped'] = count( $done['skipped'] );
|
||||
$done['locked'] = count( $done['locked'] );
|
||||
$sendback = add_query_arg( $done, $sendback );
|
||||
}
|
||||
if ( isset($deleted) )
|
||||
$sendback = add_query_arg('deleted', $deleted, $sendback);
|
||||
wp_redirect($sendback);
|
||||
exit();
|
||||
} elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
|
||||
@@ -112,14 +82,6 @@ if ( empty($title) )
|
||||
$parent_file = 'edit.php';
|
||||
wp_enqueue_script('inline-edit-post');
|
||||
|
||||
$user_posts = false;
|
||||
if ( !current_user_can('edit_others_posts') ) {
|
||||
$user_posts_count = $wpdb->get_var( $wpdb->prepare("SELECT COUNT(1) FROM $wpdb->posts WHERE post_type = 'post' AND post_status != 'trash' AND post_author = %d", $current_user->ID) );
|
||||
$user_posts = true;
|
||||
if ( $user_posts_count && empty($_GET['post_status']) && empty($_GET['all_posts']) && empty($_GET['author']) )
|
||||
$_GET['author'] = $current_user->ID;
|
||||
}
|
||||
|
||||
list($post_stati, $avail_post_stati) = wp_edit_posts_query();
|
||||
|
||||
require_once('admin-header.php');
|
||||
@@ -130,13 +92,13 @@ if ( !isset( $_GET['paged'] ) )
|
||||
if ( empty($_GET['mode']) )
|
||||
$mode = 'list';
|
||||
else
|
||||
$mode = esc_attr($_GET['mode']); ?>
|
||||
$mode = attribute_escape($_GET['mode']); ?>
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?> <a href="post-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'post'); ?></a> <?php
|
||||
<h2><?php echo wp_specialchars( $title );
|
||||
if ( isset($_GET['s']) && $_GET['s'] )
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', esc_html( get_search_query() ) ); ?>
|
||||
printf( '<span class="subtitle">' . __('Search results for “%s”') . '</span>', wp_specialchars( get_search_query() ) ); ?>
|
||||
</h2>
|
||||
|
||||
<?php
|
||||
@@ -145,10 +107,10 @@ if ( isset($_GET['posted']) && $_GET['posted'] ) : $_GET['posted'] = (int) $_GET
|
||||
<?php $_SERVER['REQUEST_URI'] = remove_query_arg(array('posted'), $_SERVER['REQUEST_URI']);
|
||||
endif; ?>
|
||||
|
||||
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) || isset($_GET['trashed']) || isset($_GET['untrashed']) ) { ?>
|
||||
<?php if ( isset($_GET['locked']) || isset($_GET['skipped']) || isset($_GET['updated']) || isset($_GET['deleted']) ) { ?>
|
||||
<div id="message" class="updated fade"><p>
|
||||
<?php if ( isset($_GET['updated']) && (int) $_GET['updated'] ) {
|
||||
printf( _n( '%s post updated.', '%s posts updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
|
||||
printf( __ngettext( '%s post updated.', '%s posts updated.', $_GET['updated'] ), number_format_i18n( $_GET['updated'] ) );
|
||||
unset($_GET['updated']);
|
||||
}
|
||||
|
||||
@@ -156,52 +118,31 @@ if ( isset($_GET['skipped']) && (int) $_GET['skipped'] )
|
||||
unset($_GET['skipped']);
|
||||
|
||||
if ( isset($_GET['locked']) && (int) $_GET['locked'] ) {
|
||||
printf( _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) );
|
||||
printf( __ngettext( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $_GET['locked'] ), number_format_i18n( $_GET['locked'] ) );
|
||||
unset($_GET['locked']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['deleted']) && (int) $_GET['deleted'] ) {
|
||||
printf( _n( 'Post permanently deleted.', '%s posts permanently deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
|
||||
printf( __ngettext( 'Post deleted.', '%s posts deleted.', $_GET['deleted'] ), number_format_i18n( $_GET['deleted'] ) );
|
||||
unset($_GET['deleted']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['trashed']) && (int) $_GET['trashed'] ) {
|
||||
printf( _n( 'Post moved to the trash.', '%s posts moved to the trash.', $_GET['trashed'] ), number_format_i18n( $_GET['trashed'] ) );
|
||||
$ids = isset($_GET['ids']) ? $_GET['ids'] : 0;
|
||||
echo ' <a href="' . esc_url( wp_nonce_url( "edit.php?doaction=undo&action=untrash&ids=$ids", "bulk-posts" ) ) . '">' . __('Undo') . '</a><br />';
|
||||
unset($_GET['trashed']);
|
||||
}
|
||||
|
||||
if ( isset($_GET['untrashed']) && (int) $_GET['untrashed'] ) {
|
||||
printf( _n( 'Post restored from the trash.', '%s posts restored from the trash.', $_GET['untrashed'] ), number_format_i18n( $_GET['untrashed'] ) );
|
||||
unset($_GET['undeleted']);
|
||||
}
|
||||
|
||||
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI'] );
|
||||
$_SERVER['REQUEST_URI'] = remove_query_arg( array('locked', 'skipped', 'updated', 'deleted'), $_SERVER['REQUEST_URI'] );
|
||||
?>
|
||||
</p></div>
|
||||
<?php } ?>
|
||||
|
||||
<form id="posts-filter" action="<?php echo admin_url('edit.php'); ?>" method="get">
|
||||
<form id="posts-filter" action="" method="get">
|
||||
|
||||
<ul class="subsubsub">
|
||||
<?php
|
||||
if ( empty($locked_post_status) ) :
|
||||
$status_links = array();
|
||||
$num_posts = wp_count_posts( 'post', 'readable' );
|
||||
$class = '';
|
||||
$allposts = '';
|
||||
$total_posts = array_sum( (array) $num_posts );
|
||||
$class = empty( $_GET['post_status'] ) ? ' class="current"' : '';
|
||||
$status_links[] = "<li><a href='edit.php' $class>" . sprintf( __ngettext( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts ), number_format_i18n( $total_posts ) ) . '</a>';
|
||||
|
||||
if ( $user_posts ) {
|
||||
if ( isset( $_GET['author'] ) && ( $_GET['author'] == $current_user->ID ) )
|
||||
$class = ' class="current"';
|
||||
$status_links[] = "<li><a href='edit.php?author=$current_user->ID'$class>" . sprintf( _nx( 'My Posts <span class="count">(%s)</span>', 'My Posts <span class="count">(%s)</span>', $user_posts_count, 'posts' ), number_format_i18n( $user_posts_count ) ) . '</a>';
|
||||
$allposts = '?all_posts=1';
|
||||
}
|
||||
|
||||
$total_posts = array_sum( (array) $num_posts ) - $num_posts->trash;
|
||||
$class = empty($class) && empty($_GET['post_status']) ? ' class="current"' : '';
|
||||
$status_links[] = "<li><a href='edit.php{$allposts}'$class>" . sprintf( _nx( 'All <span class="count">(%s)</span>', 'All <span class="count">(%s)</span>', $total_posts, 'posts' ), number_format_i18n( $total_posts ) ) . '</a>';
|
||||
|
||||
foreach ( $post_stati as $status => $label ) {
|
||||
$class = '';
|
||||
@@ -211,11 +152,10 @@ foreach ( $post_stati as $status => $label ) {
|
||||
|
||||
if ( empty( $num_posts->$status ) )
|
||||
continue;
|
||||
|
||||
if ( isset($_GET['post_status']) && $status == $_GET['post_status'] )
|
||||
$class = ' class="current"';
|
||||
|
||||
$status_links[] = "<li><a href='edit.php?post_status=$status'$class>" . sprintf( _n( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
|
||||
$status_links[] = "<li><a href='edit.php?post_status=$status' $class>" . sprintf( __ngettext( $label[2][0], $label[2][1], $num_posts->$status ), number_format_i18n( $num_posts->$status ) ) . '</a>';
|
||||
}
|
||||
echo implode( " |</li>\n", $status_links ) . '</li>';
|
||||
unset( $status_links );
|
||||
@@ -224,13 +164,15 @@ endif;
|
||||
</ul>
|
||||
|
||||
<p class="search-box">
|
||||
<label class="screen-reader-text" for="post-search-input"><?php _e( 'Search Posts' ); ?>:</label>
|
||||
<input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />
|
||||
<input type="submit" value="<?php esc_attr_e( 'Search Posts' ); ?>" class="button" />
|
||||
<label class="hidden" for="post-search-input"><?php _e( 'Search Posts' ); ?>:</label>
|
||||
<input type="text" class="search-input" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />
|
||||
<input type="submit" value="<?php _e( 'Search Posts' ); ?>" class="button" />
|
||||
</p>
|
||||
|
||||
<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_GET['post_status']) ? esc_attr($_GET['post_status']) : 'all'; ?>" />
|
||||
<input type="hidden" name="mode" value="<?php echo esc_attr($mode); ?>" />
|
||||
<?php if ( isset($_GET['post_status'] ) ) : ?>
|
||||
<input type="hidden" name="post_status" value="<?php echo attribute_escape($_GET['post_status']) ?>" />
|
||||
<?php endif; ?>
|
||||
<input type="hidden" name="mode" value="<?php echo $mode; ?>" />
|
||||
|
||||
<?php if ( have_posts() ) { ?>
|
||||
|
||||
@@ -245,24 +187,15 @@ $page_links = paginate_links( array(
|
||||
'current' => $_GET['paged']
|
||||
));
|
||||
|
||||
$is_trash = isset($_GET['post_status']) && $_GET['post_status'] == 'trash';
|
||||
|
||||
?>
|
||||
|
||||
<div class="alignleft actions">
|
||||
<select name="action">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<?php if ( $is_trash ) { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="edit"><?php _e('Edit'); ?></option>
|
||||
<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } ?>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction" id="doaction" class="button-secondary action" />
|
||||
<?php wp_nonce_field('bulk-posts'); ?>
|
||||
|
||||
<?php // view filters
|
||||
@@ -289,7 +222,7 @@ foreach ($arc_result as $arc_row) {
|
||||
else
|
||||
$default = '';
|
||||
|
||||
echo "<option$default value='" . esc_attr("$arc_row->yyear$arc_row->mmonth") . "'>";
|
||||
echo "<option$default value='$arc_row->yyear$arc_row->mmonth'>";
|
||||
echo $wp_locale->get_month($arc_row->mmonth) . " $arc_row->yyear";
|
||||
echo "</option>\n";
|
||||
}
|
||||
@@ -303,11 +236,8 @@ $dropdown_options = array('show_option_all' => __('View all categories'), 'hide_
|
||||
wp_dropdown_categories($dropdown_options);
|
||||
do_action('restrict_manage_posts');
|
||||
?>
|
||||
<input type="submit" id="post-query-submit" value="<?php esc_attr_e('Filter'); ?>" class="button-secondary" />
|
||||
<?php }
|
||||
<input type="submit" id="post-query-submit" value="<?php _e('Filter'); ?>" class="button-secondary" />
|
||||
|
||||
if ( $is_trash && current_user_can('edit_others_posts') ) { ?>
|
||||
<input type="submit" name="delete_all" id="delete_all" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
@@ -321,8 +251,8 @@ if ( $is_trash && current_user_can('edit_others_posts') ) { ?>
|
||||
<?php } ?>
|
||||
|
||||
<div class="view-switch">
|
||||
<a href="<?php echo esc_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'list' == $mode ) echo 'class="current"'; ?> id="view-switch-list" src="../wp-includes/images/blank.gif" width="20" height="20" title="<?php _e('List View') ?>" alt="<?php _e('List View') ?>" /></a>
|
||||
<a href="<?php echo esc_url(add_query_arg('mode', 'excerpt', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'excerpt' == $mode ) echo 'class="current"'; ?> id="view-switch-excerpt" src="../wp-includes/images/blank.gif" width="20" height="20" title="<?php _e('Excerpt View') ?>" alt="<?php _e('Excerpt View') ?>" /></a>
|
||||
<a href="<?php echo clean_url(add_query_arg('mode', 'list', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'list' == $mode ) echo 'class="current"'; ?> id="view-switch-list" src="../wp-includes/images/blank.gif" width="20" height="20" title="<?php _e('List View') ?>" alt="<?php _e('List View') ?>" /></a>
|
||||
<a href="<?php echo clean_url(add_query_arg('mode', 'excerpt', $_SERVER['REQUEST_URI'])) ?>"><img <?php if ( 'excerpt' == $mode ) echo 'class="current"'; ?> id="view-switch-excerpt" src="../wp-includes/images/blank.gif" width="20" height="20" title="<?php _e('Excerpt View') ?>" alt="<?php _e('Excerpt View') ?>" /></a>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
@@ -342,20 +272,10 @@ if ( $page_links )
|
||||
<div class="alignleft actions">
|
||||
<select name="action2">
|
||||
<option value="-1" selected="selected"><?php _e('Bulk Actions'); ?></option>
|
||||
<?php if ( $is_trash ) { ?>
|
||||
<option value="untrash"><?php _e('Restore'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="edit"><?php _e('Edit'); ?></option>
|
||||
<?php } if ( $is_trash || !EMPTY_TRASH_DAYS ) { ?>
|
||||
<option value="delete"><?php _e('Delete Permanently'); ?></option>
|
||||
<?php } else { ?>
|
||||
<option value="trash"><?php _e('Move to Trash'); ?></option>
|
||||
<?php } ?>
|
||||
<option value="delete"><?php _e('Delete'); ?></option>
|
||||
</select>
|
||||
<input type="submit" value="<?php esc_attr_e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
<?php if ( $is_trash && current_user_can('edit_others_posts') ) { ?>
|
||||
<input type="submit" name="delete_all2" id="delete_all2" value="<?php esc_attr_e('Empty Trash'); ?>" class="button-secondary apply" />
|
||||
<?php } ?>
|
||||
<input type="submit" value="<?php _e('Apply'); ?>" name="doaction2" id="doaction2" class="button-secondary action" />
|
||||
<br class="clear" />
|
||||
</div>
|
||||
<br class="clear" />
|
||||
@@ -363,12 +283,7 @@ if ( $page_links )
|
||||
|
||||
<?php } else { // have_posts() ?>
|
||||
<div class="clear"></div>
|
||||
<p><?php
|
||||
if ( isset($_GET['post_status']) && 'trash' == $_GET['post_status'] )
|
||||
_e('No posts found in the trash');
|
||||
else
|
||||
_e('No posts found');
|
||||
?></p>
|
||||
<p><?php _e('No posts found') ?></p>
|
||||
<?php } ?>
|
||||
|
||||
</form>
|
||||
@@ -376,8 +291,25 @@ else
|
||||
<?php inline_edit_row( 'post' ); ?>
|
||||
|
||||
<div id="ajax-response"></div>
|
||||
|
||||
<br class="clear" />
|
||||
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include('admin-footer.php');
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
(function($){
|
||||
$(document).ready(function(){
|
||||
$('#doaction, #doaction2').click(function(){
|
||||
if ( $('select[name^="action"]').val() == 'delete' ) {
|
||||
var m = '<?php echo js_escape(__("You are about to delete the selected posts.\n 'Cancel' to stop, 'OK' to delete.")); ?>';
|
||||
return showNotice.warn(m);
|
||||
}
|
||||
});
|
||||
});
|
||||
})(jQuery);
|
||||
columns.init('edit');
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
<?php include('admin-footer.php'); ?>
|
||||
|
||||
@@ -9,9 +9,6 @@
|
||||
/** Load WordPress Bootstrap */
|
||||
require_once ('admin.php');
|
||||
|
||||
if ( !current_user_can('edit_files') )
|
||||
wp_die(__('You do not have sufficient permissions to export the content of this blog.'));
|
||||
|
||||
/** Load WordPress export API */
|
||||
require_once('includes/export.php');
|
||||
$title = __('Export');
|
||||
@@ -27,7 +24,7 @@ require_once ('admin-header.php');
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
<h2><?php echo wp_specialchars( $title ); ?></h2>
|
||||
|
||||
<p><?php _e('When you click the button below WordPress will create an XML file for you to save to your computer.'); ?></p>
|
||||
<p><?php _e('This format, which we call WordPress eXtended RSS or WXR, will contain your posts, pages, comments, custom fields, categories, and tags.'); ?></p>
|
||||
@@ -45,14 +42,14 @@ require_once ('admin-header.php');
|
||||
$authors = $wpdb->get_col( "SELECT post_author FROM $wpdb->posts GROUP BY post_author" );
|
||||
foreach ( $authors as $id ) {
|
||||
$o = get_userdata( $id );
|
||||
echo "<option value='" . esc_attr($o->ID) . "'>$o->display_name</option>";
|
||||
echo "<option value='$o->ID'>$o->display_name</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="submit"><input type="submit" name="submit" class="button" value="<?php esc_attr_e('Download Export File'); ?>" />
|
||||
<p class="submit"><input type="submit" name="submit" class="button" value="<?php _e('Download Export File'); ?>" />
|
||||
<input type="hidden" name="download" value="true" />
|
||||
</p>
|
||||
</form>
|
||||
|
||||
@@ -6,19 +6,119 @@
|
||||
* @subpackage Administration
|
||||
*/
|
||||
|
||||
/**
|
||||
* Disable error reporting
|
||||
*
|
||||
* Set this to error_reporting( E_ALL ) or error_reporting( E_ALL | E_STRICT ) for debugging
|
||||
*/
|
||||
error_reporting(0);
|
||||
|
||||
/** Set ABSPATH for execution */
|
||||
define( 'ABSPATH', dirname(dirname(__FILE__)) . '/' );
|
||||
define( 'ABSPATH', dirname(dirname(__FILE__)) );
|
||||
define( 'WPINC', '/wp-includes' );
|
||||
|
||||
require(ABSPATH . '/wp-admin/includes/manifest.php');
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function __() {}
|
||||
|
||||
$files = get_manifest();
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function _c() {}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function add_filter() {}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function attribute_escape() {}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function apply_filters() {}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function get_option() {}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function is_lighttpd_before_150() {}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function add_action() {}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function do_action_ref_array() {}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function get_bloginfo() {}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function is_admin() {return true;}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function site_url() {}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function admin_url() {}
|
||||
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
function wp_guess_url() {}
|
||||
|
||||
require(ABSPATH . '/wp-includes/script-loader.php');
|
||||
require(ABSPATH . '/wp-includes/version.php');
|
||||
|
||||
$wp_scripts = new WP_Scripts();
|
||||
wp_default_scripts($wp_scripts);
|
||||
|
||||
$wp_styles = new WP_Styles();
|
||||
wp_default_styles($wp_styles);
|
||||
|
||||
$defaults = $man_version = '';
|
||||
foreach ( $wp_scripts->registered as $script ) {
|
||||
if ( empty($script->src) ) continue;
|
||||
$ver = empty($script->ver) ? $wp_version : $script->ver;
|
||||
if ( 'editor' == $script->handle ) $mce_ver = $script->ver;
|
||||
$src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $script->src );
|
||||
$defaults .= '{ "url" : "' . $src . '?ver=' . $ver . '" },' . "\n";
|
||||
$man_version .= $ver;
|
||||
}
|
||||
|
||||
foreach ( $wp_styles->registered as $style ) {
|
||||
if ( empty($style->src) ) continue;
|
||||
|
||||
$ver = empty($style->ver) ? $wp_version : $style->ver;
|
||||
$src = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->src );
|
||||
if ( 'colors' == $style->handle ) $src = 'css/colors-classic.css';
|
||||
$defaults .= '{ "url" : "' . $src . '?ver=' . $ver . '" },' . "\n";
|
||||
|
||||
if ( isset($style->extra['rtl']) && $style->extra['rtl'] ) {
|
||||
if ( is_bool( $style->extra['rtl'] ) )
|
||||
$rtl_href = str_replace( '.css', '-rtl.css', $src );
|
||||
else
|
||||
$rtl_href = str_replace( array( '/wp-admin/', '/wp-includes/' ), array( '', '../wp-includes/' ), $style->extra['rtl'] );
|
||||
|
||||
$defaults .= '{ "url" : "' . $rtl_href . '?ver=' . $ver . '" },' . "\n";
|
||||
}
|
||||
$man_version .= $ver;
|
||||
}
|
||||
|
||||
$man_version = md5($man_version);
|
||||
|
||||
header( 'Expires: Wed, 11 Jan 1984 05:00:00 GMT' );
|
||||
header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' );
|
||||
@@ -28,24 +128,190 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
|
||||
?>
|
||||
{
|
||||
"betaManifestVersion" : 1,
|
||||
"version" : "<?php echo $man_version; ?>",
|
||||
"version" : "<?php echo $man_version; ?>_20081201",
|
||||
"entries" : [
|
||||
<?php
|
||||
$entries = '';
|
||||
<?php echo $defaults; ?>
|
||||
|
||||
foreach ( $files as $file ) {
|
||||
// If version is not set, just output the file
|
||||
if ( !isset($file[1]) )
|
||||
$entries .= '{ "url" : "' . $file[0] . '" },' . "\n";
|
||||
// If ver is set but ignoreQuery is not, output file with ver tacked on
|
||||
elseif ( !isset($file[2]) )
|
||||
$entries .= '{ "url" : "' . $file[0] . '?' . $file[1] . '" },' . "\n";
|
||||
// Output url, src, and ignoreQuery
|
||||
else
|
||||
$entries .= '{ "url" : "' . $file[0] . '", "src" : "' . $file[0] . '?' . $file[1] . '", "ignoreQuery" : true },' . "\n";
|
||||
}
|
||||
{ "url" : "images/align-center.png" },
|
||||
{ "url" : "images/align-left.png" },
|
||||
{ "url" : "images/align-none.png" },
|
||||
{ "url" : "images/align-right.png" },
|
||||
{ "url" : "images/archive-link.png" },
|
||||
{ "url" : "images/blue-grad.png" },
|
||||
{ "url" : "images/browse-happy.gif" },
|
||||
{ "url" : "images/bubble_bg.gif" },
|
||||
{ "url" : "images/bubble_bg-rtl.gif" },
|
||||
{ "url" : "images/button-grad.png" },
|
||||
{ "url" : "images/button-grad-active.png" },
|
||||
{ "url" : "images/comment-grey-bubble.png" },
|
||||
{ "url" : "images/date-button.gif" },
|
||||
{ "url" : "images/ed-bg.gif" },
|
||||
{ "url" : "images/fade-butt.png" },
|
||||
{ "url" : "images/fav.png" },
|
||||
{ "url" : "images/fav-arrow.gif" },
|
||||
{ "url" : "images/fav-arrow-rtl.gif" },
|
||||
{ "url" : "images/fav-top.png" },
|
||||
{ "url" : "images/generic.png" },
|
||||
{ "url" : "images/gray-grad.png" },
|
||||
{ "url" : "images/icons32.png" },
|
||||
{ "url" : "images/icons32-vs.png" },
|
||||
{ "url" : "images/list.png" },
|
||||
{ "url" : "images/list-vs.png" },
|
||||
{ "url" : "images/loading.gif" },
|
||||
{ "url" : "images/loading-publish.gif" },
|
||||
{ "url" : "images/logo.gif" },
|
||||
{ "url" : "images/logo-ghost.png" },
|
||||
{ "url" : "images/logo-login.gif" },
|
||||
{ "url" : "images/media-button-image.gif" },
|
||||
{ "url" : "images/media-button-music.gif" },
|
||||
{ "url" : "images/media-button-other.gif" },
|
||||
{ "url" : "images/media-button-video.gif" },
|
||||
{ "url" : "images/menu.png" },
|
||||
{ "url" : "images/menu-vs.png" },
|
||||
{ "url" : "images/menu-arrows.gif" },
|
||||
{ "url" : "images/menu-bits.gif" },
|
||||
{ "url" : "images/menu-bits-rtl.gif" },
|
||||
{ "url" : "images/menu-dark.gif" },
|
||||
{ "url" : "images/menu-dark-rtl.gif" },
|
||||
{ "url" : "images/no.png" },
|
||||
{ "url" : "images/required.gif" },
|
||||
{ "url" : "images/resize.gif" },
|
||||
{ "url" : "images/screen-options-left.gif" },
|
||||
{ "url" : "images/screen-options-right.gif" },
|
||||
{ "url" : "images/screen-options-right-up.gif" },
|
||||
{ "url" : "images/se.png" },
|
||||
{ "url" : "images/star.gif" },
|
||||
{ "url" : "images/toggle-arrow.gif" },
|
||||
{ "url" : "images/toggle-arrow-rtl.gif" },
|
||||
{ "url" : "images/white-grad.png" },
|
||||
{ "url" : "images/white-grad-active.png" },
|
||||
{ "url" : "images/wordpress-logo.png" },
|
||||
{ "url" : "images/wp-logo.gif" },
|
||||
{ "url" : "images/xit.gif" },
|
||||
{ "url" : "images/yes.png" },
|
||||
|
||||
echo trim( trim($entries), ',' );
|
||||
?>
|
||||
<?php if ( is_file('../wp-includes/js/tinymce/tiny_mce.js') ) { ?>
|
||||
{ "url" : "../wp-includes/js/tinymce/tiny_mce.js", "src" : "../wp-includes/js/tinymce/tiny_mce.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/langs/wp-langs-en.js", "src" : "../wp-includes/js/tinymce/langs/wp-langs-en.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/wordpress.css", "src" : "../wp-includes/js/tinymce/wordpress.css?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/utils/mctabs.js", "src" : "../wp-includes/js/tinymce/utils/mctabs.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/utils/validate.js", "src" : "../wp-includes/js/tinymce/utils/validate.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/utils/form_utils.js", "src" : "../wp-includes/js/tinymce/utils/form_utils.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/utils/editable_selects.js", "src" : "../wp-includes/js/tinymce/utils/editable_selects.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/tiny_mce_popup.js", "src" : "../wp-includes/js/tinymce/tiny_mce_popup.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js", "src" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm", "src" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm", "src" : "../wp-includes/js/tinymce/themes/advanced/anchor.htm?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/image.htm", "src" : "../wp-includes/js/tinymce/themes/advanced/image.htm?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/link.htm", "src" : "../wp-includes/js/tinymce/themes/advanced/link.htm?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/color_picker.htm", "src" : "../wp-includes/js/tinymce/themes/advanced/color_picker.htm?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/charmap.htm", "src" : "../wp-includes/js/tinymce/themes/advanced/charmap.htm?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/color_picker.js", "src" : "../wp-includes/js/tinymce/themes/advanced/js/color_picker.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/charmap.js", "src" : "../wp-includes/js/tinymce/themes/advanced/js/charmap.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/image.js", "src" : "../wp-includes/js/tinymce/themes/advanced/js/image.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js", "src" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js", "src" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js", "src" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css", "src" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css", "src" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/content.css?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css", "src" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/dialog.css?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/autosave/editor_plugin.js", "src" : "../wp-includes/js/tinymce/plugins/autosave/editor_plugin.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js", "src" : "../wp-includes/js/tinymce/plugins/fullscreen/editor_plugin.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm", "src" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js", "src" : "../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm", "src" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css", "src" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/window.css?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/media/editor_plugin.js", "src" : "../wp-includes/js/tinymce/plugins/media/editor_plugin.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/media/js/media.js", "src" : "../wp-includes/js/tinymce/plugins/media/js/media.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/media/media.htm", "src" : "../wp-includes/js/tinymce/plugins/media/media.htm?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/media/css/content.css", "src" : "../wp-includes/js/tinymce/plugins/media/css/content.css?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css", "src" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/paste/editor_plugin.js", "src" : "../wp-includes/js/tinymce/plugins/paste/editor_plugin.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pasteword.js", "src" : "../wp-includes/js/tinymce/plugins/paste/js/pasteword.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/paste/js/pastetext.js", "src" : "../wp-includes/js/tinymce/plugins/paste/js/pastetext.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/paste/pasteword.htm", "src" : "../wp-includes/js/tinymce/plugins/paste/pasteword.htm?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/paste/blank.htm", "src" : "../wp-includes/js/tinymce/plugins/paste/blank.htm?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm", "src" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css", "src" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css", "src" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/safari/editor_plugin.js", "src" : "../wp-includes/js/tinymce/plugins/safari/editor_plugin.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js", "src" : "../wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/spellchecker/css/content.css", "src" : "../wp-includes/js/tinymce/plugins/spellchecker/css/content.css?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js", "src" : "../wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/css/content.css", "src" : "../wp-includes/js/tinymce/plugins/wordpress/css/content.css?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js", "src" : "../wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html", "src" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js", "src" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css", "src" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css", "src" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js", "src" : "../wp-includes/js/tinymce/plugins/wpgallery/editor_plugin.js?ver=<?php echo $mce_ver; ?>", "ignoreQuery" : true },
|
||||
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/icons.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/colorpicker.jpg" },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/fm.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/gotmoxie.png" },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/img/sflogo.png" },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/butt2.png" },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/fade-butt.png" },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/tabs.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/img/down_arrow.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/progress.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_check.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/default/img/menu_arrow.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/drag.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/corners.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/buttons.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/horizontal.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/alert.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/button.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/confirm.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/skins/clearlooks2/img/vertical.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/flash.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/flv_player.swf" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/quicktime.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/realmedia.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/shockwave.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/windowsmedia.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/media/img/trans.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/spellchecker/img/wline.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/more.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/more_bug.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/page.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/page_bug.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/toolbars.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/help.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/image.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/media.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/video.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/audio.gif" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/image.png" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wpgallery/img/delete.png" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wpgallery/img/edit.png" },
|
||||
{ "url" : "../wp-includes/js/tinymce/plugins/wpgallery/img/gallery.png" },
|
||||
<?php } ?>
|
||||
|
||||
{ "url" : "../wp-includes/images/crystal/archive.png" },
|
||||
{ "url" : "../wp-includes/images/crystal/audio.png" },
|
||||
{ "url" : "../wp-includes/images/crystal/code.png" },
|
||||
{ "url" : "../wp-includes/images/crystal/default.png" },
|
||||
{ "url" : "../wp-includes/images/crystal/document.png" },
|
||||
{ "url" : "../wp-includes/images/crystal/interactive.png" },
|
||||
{ "url" : "../wp-includes/images/crystal/text.png" },
|
||||
{ "url" : "../wp-includes/images/crystal/video.png" },
|
||||
{ "url" : "../wp-includes/images/crystal/spreadsheet.png" },
|
||||
{ "url" : "../wp-includes/images/rss.png" },
|
||||
{ "url" : "../wp-includes/js/thickbox/loadingAnimation.gif" },
|
||||
{ "url" : "../wp-includes/js/thickbox/tb-close.png" }
|
||||
]}
|
||||
|
||||
|
Before Width: | Height: | Size: 160 B After Width: | Height: | Size: 242 B |
|
Before Width: | Height: | Size: 152 B |
|
Before Width: | Height: | Size: 155 B |
|
Before Width: | Height: | Size: 291 B |
|
Before Width: | Height: | Size: 338 B |
|
Before Width: | Height: | Size: 101 B |
|
Before Width: | Height: | Size: 142 B |
|
Before Width: | Height: | Size: 9.4 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 193 B |
|
Before Width: | Height: | Size: 136 B |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
@@ -8,10 +8,6 @@
|
||||
|
||||
/** Load WordPress Bootstrap */
|
||||
require_once ('admin.php');
|
||||
|
||||
if ( !current_user_can('edit_files') )
|
||||
wp_die(__('You do not have sufficient permissions to import content in this blog.'));
|
||||
|
||||
$title = __('Import');
|
||||
require_once ('admin-header.php');
|
||||
$parent_file = 'tools.php';
|
||||
@@ -19,7 +15,7 @@ $parent_file = 'tools.php';
|
||||
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php echo esc_html( $title ); ?></h2>
|
||||
<h2><?php echo wp_specialchars( $title ); ?></h2>
|
||||
<p><?php _e('If you have posts or comments in another system, WordPress can import those into this blog. To get started, choose a system to import from below:'); ?></p>
|
||||
|
||||
<?php
|
||||
|
||||
@@ -51,7 +51,7 @@ class Blogger_Import {
|
||||
$welcome = __('Howdy! This importer allows you to import posts and comments from your Blogger account into your WordPress blog.');
|
||||
$prereqs = __('To use this importer, you must have a Google account and an upgraded (New, was Beta) blog hosted on blogspot.com or a custom domain (not FTP).');
|
||||
$stepone = __('The first thing you need to do is tell Blogger to let WordPress access your account. You will be sent back here after providing authorization.');
|
||||
$auth = esc_attr__('Authorize');
|
||||
$auth = __('Authorize');
|
||||
|
||||
echo "
|
||||
<div class='wrap'>
|
||||
@@ -190,21 +190,20 @@ class Blogger_Import {
|
||||
}
|
||||
}
|
||||
//echo '<pre>'.print_r($this,1).'</pre>';
|
||||
$start = esc_js( __('Import') );
|
||||
$continue = esc_js( __('Continue') );
|
||||
$stop = esc_js( __('Importing...') );
|
||||
$authors = esc_js( __('Set Authors') );
|
||||
$loadauth = esc_js( __('Preparing author mapping form...') );
|
||||
$authhead = esc_js( __('Final Step: Author Mapping') );
|
||||
$nothing = esc_js( __('Nothing was imported. Had you already imported this blog?') );
|
||||
$stopping = ''; //Missing String used below.
|
||||
$start = js_escape( __('Import') );
|
||||
$continue = js_escape( __('Continue') );
|
||||
$stop = js_escape( __('Importing...') );
|
||||
$authors = js_escape( __('Set Authors') );
|
||||
$loadauth = js_escape( __('Preparing author mapping form...') );
|
||||
$authhead = js_escape( __('Final Step: Author Mapping') );
|
||||
$nothing = js_escape( __('Nothing was imported. Had you already imported this blog?') );
|
||||
$title = __('Blogger Blogs');
|
||||
$name = __('Blog Name');
|
||||
$url = __('Blog URL');
|
||||
$action = __('The Magic Button');
|
||||
$posts = __('Posts');
|
||||
$comments = __('Comments');
|
||||
$noscript = __('This feature requires Javascript but it seems to be disabled. Please enable Javascript and then reload this page. Don’t worry, you can turn it back off when you’re done.');
|
||||
$noscript = __('This feature requires Javascript but it seems to be disabled. Please enable Javascript and then reload this page. Don\'t worry, you can turn it back off when you\'re done.');
|
||||
|
||||
$interval = STATUS_INTERVAL * 1000;
|
||||
|
||||
@@ -215,8 +214,7 @@ class Blogger_Import {
|
||||
$value = $continue;
|
||||
else
|
||||
$value = $authors;
|
||||
$value = esc_attr($value);
|
||||
$blogtitle = esc_js( $blog['title'] );
|
||||
$blogtitle = js_escape( $blog['title'] );
|
||||
$pdone = isset($blog['posts_done']) ? (int) $blog['posts_done'] : 0;
|
||||
$cdone = isset($blog['comments_done']) ? (int) $blog['comments_done'] : 0;
|
||||
$init .= "blogs[$i]=new blog($i,'$blogtitle','{$blog['mode']}'," . $this->get_js_status($i) . ');';
|
||||
@@ -439,7 +437,7 @@ class Blogger_Import {
|
||||
if ( count( $matches[1] ) )
|
||||
foreach ( $matches[1] as $match )
|
||||
if ( preg_match('/rel=.previous./', $match) )
|
||||
$query = @html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match), ENT_COMPAT, get_option('blog_charset') );
|
||||
$query = html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match) );
|
||||
|
||||
if ( $query ) {
|
||||
parse_str($query, $q);
|
||||
@@ -497,7 +495,7 @@ class Blogger_Import {
|
||||
if ( count( $matches[1] ) )
|
||||
foreach ( $matches[1] as $match )
|
||||
if ( preg_match('/rel=.previous./', $match) )
|
||||
$query = @html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match), ENT_COMPAT, get_option('blog_charset') );
|
||||
$query = html_entity_decode( preg_replace('/^.*href=[\'"].*\?(.+)[\'"].*$/', '$1', $match) );
|
||||
|
||||
parse_str($query, $q);
|
||||
|
||||
@@ -530,10 +528,6 @@ class Blogger_Import {
|
||||
return preg_replace( '|\s+|', ' ', $string );
|
||||
}
|
||||
|
||||
function _normalize_tag( $matches ) {
|
||||
return '<' . strtolower( $matches[1] );
|
||||
}
|
||||
|
||||
function import_post( $entry ) {
|
||||
global $importing_blog;
|
||||
|
||||
@@ -551,12 +545,12 @@ class Blogger_Import {
|
||||
}
|
||||
|
||||
$post_date = $this->convert_date( $entry->published );
|
||||
$post_content = trim( addslashes( $this->no_apos( @html_entity_decode( $entry->content, ENT_COMPAT, get_option('blog_charset') ) ) ) );
|
||||
$post_content = trim( addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) ) );
|
||||
$post_title = trim( addslashes( $this->no_apos( $this->min_whitespace( $entry->title ) ) ) );
|
||||
$post_status = isset( $entry->draft ) ? 'draft' : 'publish';
|
||||
|
||||
// Clean up content
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
|
||||
$post_content = str_replace('<br>', '<br />', $post_content);
|
||||
$post_content = str_replace('<hr>', '<hr />', $post_content);
|
||||
|
||||
@@ -606,10 +600,10 @@ class Blogger_Import {
|
||||
$comment_author = addslashes( $this->no_apos( strip_tags( (string) $matches[1] ) ) );
|
||||
$comment_author_url = addslashes( $this->no_apos( strip_tags( (string) $matches[2] ) ) );
|
||||
$comment_date = $this->convert_date( $entry->updated );
|
||||
$comment_content = addslashes( $this->no_apos( @html_entity_decode( $entry->content, ENT_COMPAT, get_option('blog_charset') ) ) );
|
||||
$comment_content = addslashes( $this->no_apos( html_entity_decode( $entry->content ) ) );
|
||||
|
||||
// Clean up content
|
||||
$comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content);
|
||||
$comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
|
||||
$comment_content = str_replace('<br>', '<br />', $comment_content);
|
||||
$comment_content = str_replace('<hr>', '<hr />', $comment_content);
|
||||
|
||||
@@ -622,7 +616,6 @@ class Blogger_Import {
|
||||
} else {
|
||||
$comment = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_date', 'comment_content');
|
||||
|
||||
$comment = wp_filter_comment($comment);
|
||||
$comment_id = wp_insert_comment($comment);
|
||||
|
||||
$this->blogs[$importing_blog]['comments'][$entry->old_permalink] = $comment_id;
|
||||
@@ -659,17 +652,17 @@ class Blogger_Import {
|
||||
$this->save_vars();
|
||||
}
|
||||
|
||||
$directions = __('All posts were imported with the current user as author. Use this form to move each Blogger user’s posts to a different WordPress user. You may <a href="users.php">add users</a> and then return to this page and complete the user mapping. This form may be used as many times as you like until you activate the “Restart” function below.');
|
||||
$directions = __('All posts were imported with the current user as author. Use this form to move each Blogger user\'s posts to a different WordPress user. You may <a href="users.php">add users</a> and then return to this page and complete the user mapping. This form may be used as many times as you like until you activate the "Restart" function below.');
|
||||
$heading = __('Author mapping');
|
||||
$blogtitle = "{$blog['title']} ({$blog['host']})";
|
||||
$mapthis = __('Blogger username');
|
||||
$tothis = __('WordPress login');
|
||||
$submit = esc_js( __('Save Changes') );
|
||||
$submit = js_escape( __('Save Changes') );
|
||||
|
||||
foreach ( $blog['authors'] as $i => $author )
|
||||
$rows .= "<tr><td><label for='authors[$i]'>{$author[0]}</label></td><td><select name='authors[$i]' id='authors[$i]'>" . $this->get_user_options($author[1]) . "</select></td></tr>";
|
||||
|
||||
return "<div class='wrap'><h2>$heading</h2><h3>$blogtitle</h3><p>$directions</p><form action='index.php?import=blogger&noheader=true&saveauthors=1' method='post'><input type='hidden' name='blog' value='" . esc_attr($importing_blog) . "' /><table cellpadding='5'><thead><td>$mapthis</td><td>$tothis</td></thead>$rows<tr><td></td><td class='submit'><input type='submit' class='button authorsubmit' value='$submit' /></td></tr></table></form></div>";
|
||||
return "<div class='wrap'><h2>$heading</h2><h3>$blogtitle</h3><p>$directions</p><form action='index.php?import=blogger&noheader=true&saveauthors=1' method='post'><input type='hidden' name='blog' value='$importing_blog' /><table cellpadding='5'><thead><td>$mapthis</td><td>$tothis</td></thead>$rows<tr><td></td><td class='submit'><input type='submit' class='button authorsubmit' value='$submit' /></td></tr></table></form></div>";
|
||||
}
|
||||
|
||||
function get_user_options($current) {
|
||||
@@ -802,7 +795,7 @@ class Blogger_Import {
|
||||
$blog = (int) $_GET['blog'];
|
||||
echo '<h1>'.__('Congratulations!').'</h1><p>'.__('Now that you have imported your Blogger blog into WordPress, what are you going to do? Here are some suggestions:').'</p><ul><li>'.__('That was hard work! Take a break.').'</li>';
|
||||
if ( count($this->import['blogs']) > 1 )
|
||||
echo '<li>'.__('In case you haven’t done it already, you can import the posts from your other blogs:'). $this->show_blogs() . '</li>';
|
||||
echo '<li>'.__('In case you haven\'t done it already, you can import the posts from your other blogs:'). $this->show_blogs() . '</li>';
|
||||
if ( $n = count($this->import['blogs'][$blog]['newusers']) )
|
||||
echo '<li>'.sprintf(__('Go to <a href="%s" target="%s">Authors & Users</a>, where you can modify the new user(s) or delete them. If you want to make all of the imported posts yours, you will be given that option when you delete the new authors.'), 'users.php', '_parent').'</li>';
|
||||
echo '<li>'.__('For security, click the link below to reset this importer.').'</li>';
|
||||
@@ -838,7 +831,7 @@ class Blogger_Import {
|
||||
if ( $saved && !isset($_GET['noheader']) ) {
|
||||
$restart = __('Restart');
|
||||
$message = __('We have saved some information about your Blogger account in your WordPress database. Clearing this information will allow you to start over. Restarting will not affect any posts you have already imported. If you attempt to re-import a blog, duplicate posts and comments will be skipped.');
|
||||
$submit = esc_attr__('Clear account information');
|
||||
$submit = __('Clear account information');
|
||||
echo "<div class='wrap'><h2>$restart</h2><p>$message</p><form method='post' action='?import=blogger&noheader=true'><p class='submit' style='text-align:left;'><input type='submit' class='button' value='$submit' name='restart' /></p></form></div>";
|
||||
}
|
||||
}
|
||||
@@ -911,19 +904,10 @@ class AtomParser {
|
||||
var $entry;
|
||||
|
||||
function AtomParser() {
|
||||
|
||||
$this->entry = new AtomEntry();
|
||||
}
|
||||
|
||||
function _map_attrs_func( $k, $v ) {
|
||||
return "$k=\"$v\"";
|
||||
}
|
||||
|
||||
function _map_xmlns_func( $p, $n ) {
|
||||
$xd = "xmlns";
|
||||
if ( strlen( $n[0] ) > 0 )
|
||||
$xd .= ":{$n[0]}";
|
||||
|
||||
return "{$xd}=\"{$n[1]}\"";
|
||||
$this->map_attrs_func = create_function('$k,$v', 'return "$k=\"$v\"";');
|
||||
$this->map_xmlns_func = create_function('$p,$n', '$xd = "xmlns"; if(strlen($n[0])>0) $xd .= ":{$n[0]}"; return "{$xd}=\"{$n[1]}\"";');
|
||||
}
|
||||
|
||||
function parse($xml) {
|
||||
@@ -965,12 +949,12 @@ class AtomParser {
|
||||
foreach($attrs as $key => $value) {
|
||||
$attrs_prefix[$this->ns_to_prefix($key)] = $this->xml_escape($value);
|
||||
}
|
||||
$attrs_str = join(' ', array_map( array( &$this, '_map_attrs_func' ), array_keys($attrs_prefix), array_values($attrs_prefix)));
|
||||
$attrs_str = join(' ', array_map($this->map_attrs_func, array_keys($attrs_prefix), array_values($attrs_prefix)));
|
||||
if(strlen($attrs_str) > 0) {
|
||||
$attrs_str = " " . $attrs_str;
|
||||
}
|
||||
|
||||
$xmlns_str = join(' ', array_map( array( &$this, '_map_xmlns_func' ), array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0])));
|
||||
$xmlns_str = join(' ', array_map($this->map_xmlns_func, array_keys($this->ns_contexts[0]), array_values($this->ns_contexts[0])));
|
||||
if(strlen($xmlns_str) > 0) {
|
||||
$xmlns_str = " " . $xmlns_str;
|
||||
}
|
||||
|
||||
@@ -42,10 +42,6 @@ class BW_Import {
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function _normalize_tag( $matches ) {
|
||||
return '<' . strtolower( $matches[1] );
|
||||
}
|
||||
|
||||
function import_posts() {
|
||||
global $wpdb, $current_user;
|
||||
|
||||
@@ -93,7 +89,7 @@ class BW_Import {
|
||||
}
|
||||
|
||||
// Clean up content
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
|
||||
$post_content = str_replace('<br>', '<br />', $post_content);
|
||||
$post_content = str_replace('<hr>', '<hr />', $post_content);
|
||||
$post_content = $wpdb->escape($post_content);
|
||||
@@ -113,7 +109,7 @@ class BW_Import {
|
||||
return $post_id;
|
||||
}
|
||||
if (!$post_id) {
|
||||
_e('Couldn’t get post ID');
|
||||
_e("Couldn't get post ID");
|
||||
echo '</li>';
|
||||
break;
|
||||
}
|
||||
@@ -133,7 +129,7 @@ class BW_Import {
|
||||
$comment_content = $this->unhtmlentities($comment_content);
|
||||
|
||||
// Clean up content
|
||||
$comment_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $comment_content);
|
||||
$comment_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $comment_content);
|
||||
$comment_content = str_replace('<br>', '<br />', $comment_content);
|
||||
$comment_content = str_replace('<hr>', '<hr />', $comment_content);
|
||||
$comment_content = $wpdb->escape($comment_content);
|
||||
@@ -159,7 +155,7 @@ class BW_Import {
|
||||
}
|
||||
if ( $num_comments ) {
|
||||
echo ' ';
|
||||
printf( _n('%s comment', '%s comments', $num_comments), $num_comments );
|
||||
printf( __ngettext('%s comment', '%s comments', $num_comments), $num_comments );
|
||||
}
|
||||
echo '</li>';
|
||||
flush();
|
||||
|
||||
130
wp-admin/import/btt.php
Normal file
@@ -0,0 +1,130 @@
|
||||
<?php
|
||||
/**
|
||||
* BunnyTags Plugin Tag Importer
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Importer
|
||||
*/
|
||||
|
||||
/**
|
||||
* BunnyTags Plugin tag converter
|
||||
*
|
||||
* This will process the BunnyTags plugin tags and convert them to the WordPress
|
||||
* 2.3 taxonomy.
|
||||
*
|
||||
* @since unknown
|
||||
*/
|
||||
class BunnyTags_Import {
|
||||
|
||||
function header() {
|
||||
echo '<div class="wrap">';
|
||||
screen_icon();
|
||||
echo '<h2>'.__('Import Bunny’s Technorati Tags').'</h2>';
|
||||
echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'<br /><br /></p>';
|
||||
}
|
||||
|
||||
function footer() {
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function greet() {
|
||||
echo '<div class="narrow">';
|
||||
echo '<p>'.__('Howdy! This imports tags from Bunny’s Technorati Tags into WordPress tags.').'</p>';
|
||||
echo '<p>'.__('This is suitable for Bunny’s Technorati Tags version 0.6.').'</p>';
|
||||
echo '<p><strong>'.__('All existing Bunny’s Technorati Tags will be removed after import.').'</strong></p>';
|
||||
echo '<p><strong>'.__('Don’t be stupid - backup your database before proceeding!').'</strong></p>';
|
||||
echo '<form action="admin.php?import=btt&step=1" method="post">';
|
||||
wp_nonce_field('import-btt');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Import Tags').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function dispatch() {
|
||||
if ( empty($_GET['step']) )
|
||||
$step = 0;
|
||||
else
|
||||
$step = absint($_GET['step']);
|
||||
|
||||
// load the header
|
||||
$this->header();
|
||||
|
||||
switch ( $step ) {
|
||||
case 0 :
|
||||
$this->greet();
|
||||
break;
|
||||
case 1 :
|
||||
check_admin_referer('import-btt');
|
||||
$this->check_post_keyword( true );
|
||||
break;
|
||||
case 2 :
|
||||
check_admin_referer('import-btt');
|
||||
$this->check_post_keyword( false );
|
||||
break;
|
||||
case 3:
|
||||
$this->done();
|
||||
break;
|
||||
}
|
||||
|
||||
// load the footer
|
||||
$this->footer();
|
||||
}
|
||||
|
||||
function check_post_keyword($precheck = true) {
|
||||
global $wpdb;
|
||||
|
||||
echo '<div class="narrow">';
|
||||
echo '<p><h3>'.__('Reading Bunny’s Technorati Tags…').'</h3></p>';
|
||||
|
||||
// import Bunny's Keywords tags
|
||||
$metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'tags'");
|
||||
if ( !is_array($metakeys)) {
|
||||
echo '<p>' . __('No Tags Found!') . '</p>';
|
||||
return false;
|
||||
} else {
|
||||
$count = count($metakeys);
|
||||
echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> post with tags were read.', 'Done! <strong>%s</strong> posts with tags were read.', $count), $count ) . '<br /></p>';
|
||||
echo '<ul>';
|
||||
foreach ( $metakeys as $post_meta ) {
|
||||
if ( $post_meta->meta_value != '' ) {
|
||||
$post_keys = explode(' ', $post_meta->meta_value);
|
||||
foreach ( $post_keys as $keyword ) {
|
||||
$keyword = addslashes(trim(str_replace('+',' ',$keyword)));
|
||||
if ( '' != $keyword ) {
|
||||
echo '<li>' . $post_meta->post_id . ' - ' . $keyword . '</li>';
|
||||
if ( !$precheck )
|
||||
wp_add_post_tags($post_meta->post_id, $keyword);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( !$precheck )
|
||||
delete_post_meta($post_meta->post_id, 'tags');
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
echo '<form action="admin.php?import=btt&step='.($precheck? 2:3).'" method="post">';
|
||||
wp_nonce_field('import-btt');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Next').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function done() {
|
||||
echo '<div class="narrow">';
|
||||
echo '<p><h3>'.__('Import Complete!').'</h3></p>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function BunnyTags_Import() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// create the import object
|
||||
$btt_import = new BunnyTags_Import();
|
||||
|
||||
// add it to the import page!
|
||||
register_importer('btt', 'Bunny’s Technorati Tags', __('Import Bunny’s Technorati Tags into WordPress tags.'), array($btt_import, 'dispatch'));
|
||||
|
||||
?>
|
||||
@@ -48,9 +48,115 @@ if(!function_exists('link_exists'))
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Identify UTF-8 text
|
||||
Taken from http://www.php.net/manual/fr/function.mb-detect-encoding.php#50087
|
||||
*/
|
||||
//
|
||||
// utf8 encoding validation developed based on Wikipedia entry at:
|
||||
// http://en.wikipedia.org/wiki/UTF-8
|
||||
//
|
||||
// Implemented as a recursive descent parser based on a simple state machine
|
||||
// copyright 2005 Maarten Meijer
|
||||
//
|
||||
// This cries out for a C-implementation to be included in PHP core
|
||||
//
|
||||
|
||||
/**
|
||||
* Convert from dotclear charset to utf8 if required
|
||||
* @package WordPress
|
||||
* @subpackage Dotclear_Import
|
||||
*
|
||||
* @param string $char
|
||||
* @return string
|
||||
*/
|
||||
function valid_1byte($char) {
|
||||
if(!is_int($char)) return false;
|
||||
return ($char & 0x80) == 0x00;
|
||||
}
|
||||
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage Dotclear_Import
|
||||
*
|
||||
* @param string $char
|
||||
* @return string
|
||||
*/
|
||||
function valid_2byte($char) {
|
||||
if(!is_int($char)) return false;
|
||||
return ($char & 0xE0) == 0xC0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage Dotclear_Import
|
||||
*
|
||||
* @param string $char
|
||||
* @return string
|
||||
*/
|
||||
function valid_3byte($char) {
|
||||
if(!is_int($char)) return false;
|
||||
return ($char & 0xF0) == 0xE0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage Dotclear_Import
|
||||
*
|
||||
* @param string $char
|
||||
* @return string
|
||||
*/
|
||||
function valid_4byte($char) {
|
||||
if(!is_int($char)) return false;
|
||||
return ($char & 0xF8) == 0xF0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage Dotclear_Import
|
||||
*
|
||||
* @param string $char
|
||||
* @return string
|
||||
*/
|
||||
function valid_nextbyte($char) {
|
||||
if(!is_int($char)) return false;
|
||||
return ($char & 0xC0) == 0x80;
|
||||
}
|
||||
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage Dotclear_Import
|
||||
*
|
||||
* @param string $string
|
||||
* @return string
|
||||
*/
|
||||
function valid_utf8($string) {
|
||||
$len = strlen($string);
|
||||
$i = 0;
|
||||
while( $i < $len ) {
|
||||
$char = ord(substr($string, $i++, 1));
|
||||
if(valid_1byte($char)) { // continue
|
||||
continue;
|
||||
} else if(valid_2byte($char)) { // check 1 byte
|
||||
if(!valid_nextbyte(ord(substr($string, $i++, 1))))
|
||||
return false;
|
||||
} else if(valid_3byte($char)) { // check 2 bytes
|
||||
if(!valid_nextbyte(ord(substr($string, $i++, 1))))
|
||||
return false;
|
||||
if(!valid_nextbyte(ord(substr($string, $i++, 1))))
|
||||
return false;
|
||||
} else if(valid_4byte($char)) { // check 3 bytes
|
||||
if(!valid_nextbyte(ord(substr($string, $i++, 1))))
|
||||
return false;
|
||||
if(!valid_nextbyte(ord(substr($string, $i++, 1))))
|
||||
return false;
|
||||
if(!valid_nextbyte(ord(substr($string, $i++, 1))))
|
||||
return false;
|
||||
} // goto next char
|
||||
}
|
||||
return true; // done
|
||||
}
|
||||
|
||||
/**
|
||||
* @package WordPress
|
||||
* @subpackage Dotclear_Import
|
||||
*
|
||||
@@ -58,7 +164,7 @@ if(!function_exists('link_exists'))
|
||||
* @return string
|
||||
*/
|
||||
function csc ($s) {
|
||||
if (seems_utf8 ($s)) {
|
||||
if (valid_utf8 ($s)) {
|
||||
return $s;
|
||||
} else {
|
||||
return iconv(get_option ("dccharset"),"UTF-8",$s);
|
||||
@@ -109,7 +215,7 @@ class Dotclear_Import {
|
||||
echo '<form action="admin.php?import=dotclear&step=1" method="post">';
|
||||
wp_nonce_field('import-dotclear');
|
||||
$this->db_form();
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Import Categories').'" /></p>';
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.attribute_escape(__('Import Categories')).'" /></p>';
|
||||
echo '</form></div>';
|
||||
}
|
||||
|
||||
@@ -206,7 +312,7 @@ class Dotclear_Import {
|
||||
|
||||
// Store category translation for future use
|
||||
add_option('dccat2wpcat',$dccat2wpcat);
|
||||
echo '<p>'.sprintf(_n('Done! <strong>%1$s</strong> category imported.', 'Done! <strong>%1$s</strong> categories imported.', $count), $count).'<br /><br /></p>';
|
||||
echo '<p>'.sprintf(__ngettext('Done! <strong>%1$s</strong> category imported.', 'Done! <strong>%1$s</strong> categories imported.', $count), $count).'<br /><br /></p>';
|
||||
return true;
|
||||
}
|
||||
echo __('No Categories to Import!');
|
||||
@@ -413,7 +519,11 @@ class Dotclear_Import {
|
||||
$web = "http://".$wpdb->escape($comment_site);
|
||||
$message = $wpdb->escape(textconv ($comment_content));
|
||||
|
||||
$comment = array(
|
||||
if($cinfo = comment_exists($name, $comment_dt))
|
||||
{
|
||||
// Update comments
|
||||
$ret_id = wp_update_comment(array(
|
||||
'comment_ID' => $cinfo,
|
||||
'comment_post_ID' => $comment_post_ID,
|
||||
'comment_author' => $name,
|
||||
'comment_author_email' => $email,
|
||||
@@ -422,16 +532,23 @@ class Dotclear_Import {
|
||||
'comment_date' => $comment_dt,
|
||||
'comment_date_gmt' => $comment_dt,
|
||||
'comment_content' => $message,
|
||||
'comment_approved' => $comment_approved);
|
||||
$comment = wp_filter_comment($comment);
|
||||
|
||||
if ( $cinfo = comment_exists($name, $comment_dt) ) {
|
||||
// Update comments
|
||||
$comment['comment_ID'] = $cinfo;
|
||||
$ret_id = wp_update_comment($comment);
|
||||
} else {
|
||||
'comment_approved' => $comment_approved)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Insert comments
|
||||
$ret_id = wp_insert_comment($comment);
|
||||
$ret_id = wp_insert_comment(array(
|
||||
'comment_post_ID' => $comment_post_ID,
|
||||
'comment_author' => $name,
|
||||
'comment_author_email' => $email,
|
||||
'comment_author_url' => $web,
|
||||
'comment_author_IP' => $comment_ip,
|
||||
'comment_date' => $comment_dt,
|
||||
'comment_date_gmt' => $comment_dt,
|
||||
'comment_content' => $message,
|
||||
'comment_approved' => $comment_approved)
|
||||
);
|
||||
}
|
||||
$dccm2wpcm[$comment_ID] = $ret_id;
|
||||
}
|
||||
@@ -496,7 +613,7 @@ class Dotclear_Import {
|
||||
}
|
||||
add_option('dclinks2wplinks',$dclinks2wplinks);
|
||||
echo '<p>';
|
||||
printf(_n('Done! <strong>%s</strong> link or link category imported.', 'Done! <strong>%s</strong> links or link categories imported.', $count), $count);
|
||||
printf(__ngettext('Done! <strong>%s</strong> link or link category imported.', 'Done! <strong>%s</strong> links or link categories imported.', $count), $count);
|
||||
echo '<br /><br /></p>';
|
||||
return true;
|
||||
}
|
||||
@@ -515,7 +632,7 @@ class Dotclear_Import {
|
||||
|
||||
echo '<form action="admin.php?import=dotclear&step=2" method="post">';
|
||||
wp_nonce_field('import-dotclear');
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Import Users'));
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', attribute_escape(__('Import Users')));
|
||||
echo '</form>';
|
||||
|
||||
}
|
||||
@@ -528,7 +645,7 @@ class Dotclear_Import {
|
||||
|
||||
echo '<form action="admin.php?import=dotclear&step=3" method="post">';
|
||||
wp_nonce_field('import-dotclear');
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Import Posts'));
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', attribute_escape(__('Import Posts')));
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
@@ -542,7 +659,7 @@ class Dotclear_Import {
|
||||
|
||||
echo '<form action="admin.php?import=dotclear&step=4" method="post">';
|
||||
wp_nonce_field('import-dotclear');
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Import Comments'));
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', attribute_escape(__('Import Comments')));
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
@@ -554,7 +671,7 @@ class Dotclear_Import {
|
||||
|
||||
echo '<form action="admin.php?import=dotclear&step=5" method="post">';
|
||||
wp_nonce_field('import-dotclear');
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Import Links'));
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', attribute_escape(__('Import Links')));
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
@@ -567,7 +684,7 @@ class Dotclear_Import {
|
||||
|
||||
echo '<form action="admin.php?import=dotclear&step=6" method="post">';
|
||||
wp_nonce_field('import-dotclear');
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Finish'));
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', attribute_escape(__('Finish')));
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
@@ -593,11 +710,11 @@ class Dotclear_Import {
|
||||
{
|
||||
echo '<p>'.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from DotClear, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'</p>';
|
||||
echo '<h3>'.__('Users').'</h3>';
|
||||
echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in DotClear, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and DotClear uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Log in</a> and change it.'), '/wp-login.php').'</p>';
|
||||
echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn\'t have that login in DotClear, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and DotClear uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Login</a> and change it.'), '/wp-login.php').'</p>';
|
||||
echo '<h3>'.__('Preserving Authors').'</h3>';
|
||||
echo '<p>'.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>';
|
||||
echo '<h3>'.__('Textile').'</h3>';
|
||||
echo '<p>'.__('Also, since you’re coming from DotClear, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>. Trust me… You’ll want it.').'</p>';
|
||||
echo '<p>'.__('Also, since you\'re coming from DotClear, you probably have been using Textile to format your comments and posts. If this is the case, we recommend downloading and installing <a href="http://www.huddledmasses.org/category/development/wordpress/textile/">Textile for WordPress</a>. Trust me... You\'ll want it.').'</p>';
|
||||
echo '<h3>'.__('WordPress Resources').'</h3>';
|
||||
echo '<p>'.__('Finally, there are numerous WordPress resources around the internet. Some of them are:').'</p>';
|
||||
echo '<ul>';
|
||||
@@ -605,7 +722,7 @@ class Dotclear_Import {
|
||||
echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums</a>').'</li>';
|
||||
echo '<li>'.__('<a href="http://codex.wordpress.org">The Codex (In other words, the WordPress Bible)</a>').'</li>';
|
||||
echo '</ul>';
|
||||
echo '<p>'.sprintf(__('That’s it! What are you waiting for? Go <a href="%1$s">log in</a>!'), '../wp-login.php').'</p>';
|
||||
echo '<p>'.sprintf(__('That\'s it! What are you waiting for? Go <a href="%1$s">login</a>!'), '../wp-login.php').'</p>';
|
||||
}
|
||||
|
||||
function db_form()
|
||||
|
||||
@@ -61,12 +61,12 @@ class GM_Import {
|
||||
<td><input type="text" style="width:300px" name="archivespath" id="archivespath" value="/home/my/site/cgi-bin/greymatter/archives/" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><label for="lastentry"><?php _e('Last entry’s number:') ?></label></td>
|
||||
<td><label for="lastentry"><?php _e("Last entry's number:") ?></label></td>
|
||||
<td><input type="text" name="lastentry" id="lastentry" value="00000001" /><br />
|
||||
<?php _e('This importer will search for files 00000001.cgi to 000-whatever.cgi,<br />so you need to enter the number of the last GM post here.<br />(if you don’t know that number, just log in to your FTP and look it out<br />in the entries’ folder)') ?></td>
|
||||
<?php _e("This importer will search for files 00000001.cgi to 000-whatever.cgi,<br />so you need to enter the number of the last GM post here.<br />(if you don't know that number, just log into your FTP and look it out<br />in the entries' folder)") ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p class="submit"><input type="submit" name="submit" class="button" value="<?php esc_attr_e('Start Importing') ?>" /></p>
|
||||
<p class="submit"><input type="submit" name="submit" class="button" value="<?php _e('Start Importing') ?>" /></p>
|
||||
</form>
|
||||
<?php
|
||||
$this->footer();
|
||||
@@ -283,12 +283,12 @@ class GM_Import {
|
||||
}
|
||||
if ($numAddedComments > 0) {
|
||||
echo ': ';
|
||||
printf( _n('imported %s comment', 'imported %s comments', $numAddedComments) , $numAddedComments);
|
||||
printf( __ngettext('imported %s comment', 'imported %s comments', $numAddedComments) , $numAddedComments);
|
||||
}
|
||||
$preExisting = $numComments - numAddedComments;
|
||||
if ($preExisting > 0) {
|
||||
echo ' ';
|
||||
printf( _n( 'ignored %s pre-existing comment', 'ignored %s pre-existing comments', $preExisting ) , $preExisting);
|
||||
printf( __ngettext( 'ignored %s pre-existing comment', 'ignored %s pre-existing comments', $preExisting ) , $preExisting);
|
||||
}
|
||||
}
|
||||
echo '... <strong>'.__('Done').'</strong></li>';
|
||||
|
||||
192
wp-admin/import/jkw.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
/**
|
||||
* Jeromes Keyword Plugin Importer
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Importer
|
||||
*/
|
||||
|
||||
/**
|
||||
* Jeromes Keyword Plugin Importer class
|
||||
*
|
||||
* Will convert Jeromes Keyword Plugin tags to WordPress taxonomy tags.
|
||||
*
|
||||
* @since 2.3
|
||||
*/
|
||||
class JeromesKeyword_Import {
|
||||
|
||||
function header() {
|
||||
echo '<div class="wrap">';
|
||||
screen_icon();
|
||||
echo '<h2>'.__('Import Jerome’s Keywords').'</h2>';
|
||||
echo '<p>'.__('Steps may take a few minutes depending on the size of your database. Please be patient.').'<br /><br /></p>';
|
||||
}
|
||||
|
||||
function footer() {
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function greet() {
|
||||
echo '<div class="narrow">';
|
||||
echo '<p>'.__('Howdy! This imports tags from Jerome’s Keywords into WordPress tags.').'</p>';
|
||||
echo '<p>'.__('This is suitable for Jerome’s Keywords version 1.x and 2.0a.').'</p>';
|
||||
echo '<p><strong>'.__('All existing Jerome’s Keywords will be removed after import.').'</strong></p>';
|
||||
echo '<p><strong>'.__('Don’t be stupid - backup your database before proceeding!').'</strong></p>';
|
||||
echo '<form action="admin.php?import=jkw&step=1" method="post">';
|
||||
wp_nonce_field('import-jkw');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Import Version 1.x').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '<form action="admin.php?import=jkw&step=3" method="post">';
|
||||
wp_nonce_field('import-jkw');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Import Version 2.0a').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function dispatch() {
|
||||
if ( empty($_GET['step']) )
|
||||
$step = 0;
|
||||
else
|
||||
$step = absint($_GET['step']);
|
||||
|
||||
// load the header
|
||||
$this->header();
|
||||
|
||||
switch ( $step ) {
|
||||
case 0 :
|
||||
$this->greet();
|
||||
break;
|
||||
case 1 :
|
||||
check_admin_referer('import-jkw');
|
||||
$this->check_V1_post_keyword( true );
|
||||
break;
|
||||
case 2 :
|
||||
check_admin_referer('import-jkw');
|
||||
$this->check_V1_post_keyword( false );
|
||||
break;
|
||||
case 3 :
|
||||
check_admin_referer('import-jkw');
|
||||
$this->check_V2_post_keyword( true );
|
||||
break;
|
||||
case 4 :
|
||||
check_admin_referer('import-jkw');
|
||||
$this->check_V2_post_keyword( false );
|
||||
break;
|
||||
case 5:
|
||||
check_admin_referer('import-jkw');
|
||||
$this->cleanup_V2_import();
|
||||
break;
|
||||
case 6:
|
||||
$this->done();
|
||||
break;
|
||||
}
|
||||
|
||||
// load the footer
|
||||
$this->footer();
|
||||
}
|
||||
|
||||
function check_V1_post_keyword($precheck = true) {
|
||||
global $wpdb;
|
||||
|
||||
echo '<div class="narrow">';
|
||||
echo '<p><h3>'.__('Reading Jerome’s Keywords Tags…').'</h3></p>';
|
||||
|
||||
// import Jerome's Keywords tags
|
||||
$metakeys = $wpdb->get_results("SELECT post_id, meta_id, meta_key, meta_value FROM $wpdb->postmeta WHERE $wpdb->postmeta.meta_key = 'keywords'");
|
||||
if ( !is_array($metakeys)) {
|
||||
echo '<p>' . __('No Tags Found!') . '</p>';
|
||||
return false;
|
||||
} else {
|
||||
$count = count($metakeys);
|
||||
echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> post with tags were read.', 'Done! <strong>%s</strong> posts with tags were read.', $count), $count ) . '<br /></p>';
|
||||
echo '<ul>';
|
||||
foreach ( $metakeys as $post_meta ) {
|
||||
if ( $post_meta->meta_value != '' ) {
|
||||
$post_keys = explode(',', $post_meta->meta_value);
|
||||
foreach ( $post_keys as $keyword ) {
|
||||
$keyword = addslashes(trim($keyword));
|
||||
if ( '' != $keyword ) {
|
||||
echo '<li>' . $post_meta->post_id . ' - ' . $keyword . '</li>';
|
||||
if ( !$precheck )
|
||||
wp_add_post_tags($post_meta->post_id, $keyword);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( !$precheck )
|
||||
delete_post_meta($post_meta->post_id, 'keywords');
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
|
||||
echo '<form action="admin.php?import=jkw&step='.($precheck? 2:6).'" method="post">';
|
||||
wp_nonce_field('import-jkw');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Next').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function check_V2_post_keyword($precheck = true) {
|
||||
global $wpdb;
|
||||
|
||||
echo '<div class="narrow">';
|
||||
echo '<p><h3>'.__('Reading Jerome’s Keywords Tags…').'</h3></p>';
|
||||
|
||||
// import Jerome's Keywords tags
|
||||
$tablename = $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1);
|
||||
$metakeys = $wpdb->get_results("SELECT post_id, tag_name FROM $tablename");
|
||||
if ( !is_array($metakeys) ) {
|
||||
echo '<p>' . __('No Tags Found!') . '</p>';
|
||||
return false;
|
||||
} else {
|
||||
$count = count($metakeys);
|
||||
echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag were read.', 'Done! <strong>%s</strong> tags were read.', $count), $count ) . '<br /></p>';
|
||||
echo '<ul>';
|
||||
foreach ( $metakeys as $post_meta ) {
|
||||
$keyword = addslashes(trim($post_meta->tag_name));
|
||||
if ( $keyword != '' ) {
|
||||
echo '<li>' . $post_meta->post_id . ' - ' . $keyword . '</li>';
|
||||
if ( !$precheck )
|
||||
wp_add_post_tags($post_meta->post_id, $keyword);
|
||||
}
|
||||
}
|
||||
echo '</ul>';
|
||||
}
|
||||
echo '<form action="admin.php?import=jkw&step='.($precheck? 4:5).'" method="post">';
|
||||
wp_nonce_field('import-jkw');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Next').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function cleanup_V2_import() {
|
||||
global $wpdb;
|
||||
|
||||
/* options from V2.0a (jeromes-keywords.php) */
|
||||
$options = array('version', 'keywords_table', 'query_varname', 'template', 'meta_always_include', 'meta_includecats', 'meta_autoheader', 'search_strict', 'use_feed_cats', 'post_linkformat', 'post_tagseparator', 'post_includecats', 'post_notagstext', 'cloud_linkformat', 'cloud_tagseparator', 'cloud_includecats', 'cloud_sortorder', 'cloud_displaymax', 'cloud_displaymin', 'cloud_scalemax', 'cloud_scalemin');
|
||||
|
||||
$wpdb->query('DROP TABLE IF EXISTS ' . $wpdb->prefix . substr(get_option('jkeywords_keywords_table'), 1, -1));
|
||||
|
||||
foreach ( $options as $o )
|
||||
delete_option('jkeywords_' . $o);
|
||||
|
||||
$this->done();
|
||||
}
|
||||
|
||||
function done() {
|
||||
echo '<div class="narrow">';
|
||||
echo '<p><h3>'.__('Import Complete!').'</h3></p>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function JeromesKeyword_Import() {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// create the import object
|
||||
$jkw_import = new JeromesKeyword_Import();
|
||||
|
||||
// add it to the import page!
|
||||
register_importer('jkw', 'Jerome’s Keywords', __('Import Jerome’s Keywords into WordPress tags.'), array($jkw_import, 'dispatch'));
|
||||
|
||||
?>
|
||||
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* Movable Type and TypePad Importer
|
||||
* Movable Type and Typepad Importer
|
||||
*
|
||||
* @package WordPress
|
||||
* @subpackage Importer
|
||||
*/
|
||||
|
||||
/**
|
||||
* Moveable Type and TypePad Importer class
|
||||
* Moveable Type and Typepad Importer class
|
||||
*
|
||||
* Upload your exported Movable Type or TypePad entries into WordPress.
|
||||
* Upload your exported Movable Type or Typepad entries into WordPress.
|
||||
*
|
||||
* @since unknown
|
||||
*/
|
||||
@@ -36,20 +36,20 @@ class MT_Import {
|
||||
$this->header();
|
||||
?>
|
||||
<div class="narrow">
|
||||
<p><?php _e('Howdy! We’re about to begin importing all of your Movable Type or TypePad entries into WordPress. To begin, either choose a file to upload and click “Upload file and import”, or use FTP to upload your MT export file as <code>mt-export.txt</code> in your <code>/wp-content/</code> directory and then click "Import mt-export.txt"'); ?></p>
|
||||
<p><?php _e('Howdy! We’re about to begin importing all of your Movable Type or Typepad entries into WordPress. To begin, either choose a file to upload and click "Upload file and import," or use FTP to upload your MT export file as <code>mt-export.txt</code> in your <code>/wp-content/</code> directory and then click "Import mt-export.txt"'); ?></p>
|
||||
|
||||
<?php wp_import_upload_form( add_query_arg('step', 1) ); ?>
|
||||
<form method="post" action="<?php echo esc_attr(add_query_arg('step', 1)); ?>" class="import-upload-form">
|
||||
<form method="post" action="<?php echo add_query_arg('step', 1); ?>" class="import-upload-form">
|
||||
|
||||
<?php wp_nonce_field('import-upload'); ?>
|
||||
<p>
|
||||
<input type="hidden" name="upload_type" value="ftp" />
|
||||
<?php _e('Or use <code>mt-export.txt</code> in your <code>/wp-content/</code> directory'); ?></p>
|
||||
<p class="submit">
|
||||
<input type="submit" class="button" value="<?php esc_attr_e('Import mt-export.txt'); ?>" />
|
||||
<input type="submit" class="button" value="<?php echo attribute_escape(__('Import mt-export.txt')); ?>" />
|
||||
</p>
|
||||
</form>
|
||||
<p><?php _e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if—for whatever reason—it doesn’t finish. If you get an <strong>out of memory</strong> error try splitting up the import file into pieces.'); ?> </p>
|
||||
<p><?php _e('The importer is smart enough not to import duplicates, so you can run this multiple times without worry if—for whatever reason—it doesn\'t finish. If you get an <strong>out of memory</strong> error try splitting up the import file into pieces.'); ?> </p>
|
||||
</div>
|
||||
<?php
|
||||
$this->footer();
|
||||
@@ -194,9 +194,9 @@ class MT_Import {
|
||||
<div class="wrap">
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php _e('Assign Authors'); ?></h2>
|
||||
<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as admin’s entries.'); ?></p>
|
||||
<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as admin\'s entries.'); ?></p>
|
||||
<p><?php _e('Below, you can see the names of the authors of the MovableType posts in <em>italics</em>. For each of these names, you can either pick an author in your WordPress installation from the menu, or enter a name for the author in the textbox.'); ?></p>
|
||||
<p><?php _e('If a new user is created by WordPress, a password will be randomly generated. Manually change the user’s details if necessary.'); ?></p>
|
||||
<p><?php _e('If a new user is created by WordPress, a password will be randomly generated. Manually change the user\'s details if necessary.'); ?></p>
|
||||
<?php
|
||||
|
||||
|
||||
@@ -207,12 +207,12 @@ class MT_Import {
|
||||
$j = -1;
|
||||
foreach ($authors as $author) {
|
||||
++ $j;
|
||||
echo '<li><label>'.__('Current author:').' <strong>'.$author.'</strong><br />'.sprintf(__('Create user %1$s or map to existing'), ' <input type="text" value="'. esc_attr($author) .'" name="'.'user[]'.'" maxlength="30"> <br />');
|
||||
echo '<li><label>'.__('Current author:').' <strong>'.$author.'</strong><br />'.sprintf(__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30"> <br />');
|
||||
$this->users_form($j);
|
||||
echo '</label></li>';
|
||||
}
|
||||
|
||||
echo '<p class="submit"><input type="submit" class="button" value="'.esc_attr__('Submit').'"></p>'.'<br />';
|
||||
echo '<p class="submit"><input type="submit" class="button" value="'.__('Submit').'"></p>'.'<br />';
|
||||
echo '</form>';
|
||||
echo '</ol></div>';
|
||||
|
||||
@@ -288,7 +288,7 @@ class MT_Import {
|
||||
}
|
||||
|
||||
if ( $num_comments )
|
||||
printf(' '._n('(%s comment)', '(%s comments)', $num_comments), $num_comments);
|
||||
printf(' '.__ngettext('(%s comment)', '(%s comments)', $num_comments), $num_comments);
|
||||
|
||||
$num_pings = 0;
|
||||
foreach ( $pings as $ping ) {
|
||||
@@ -305,7 +305,7 @@ class MT_Import {
|
||||
}
|
||||
|
||||
if ( $num_pings )
|
||||
printf(' '._n('(%s ping)', '(%s pings)', $num_pings), $num_pings);
|
||||
printf(' '.__ngettext('(%s ping)', '(%s pings)', $num_pings), $num_pings);
|
||||
|
||||
echo "</li>";
|
||||
//ob_flush();flush();
|
||||
@@ -438,10 +438,10 @@ class MT_Import {
|
||||
$ping->comment_author = $blog;
|
||||
} else {
|
||||
// Processing multi-line field, check context.
|
||||
|
||||
|
||||
if( !empty($line) )
|
||||
$line .= "\n";
|
||||
|
||||
|
||||
if ( 'body' == $context ) {
|
||||
$post->post_content .= $line;
|
||||
} else if ( 'extended' == $context ) {
|
||||
@@ -510,5 +510,5 @@ class MT_Import {
|
||||
|
||||
$mt_import = new MT_Import();
|
||||
|
||||
register_importer('mt', __('Movable Type and TypePad'), __('Import posts and comments from a Movable Type or TypePad blog.'), array ($mt_import, 'dispatch'));
|
||||
register_importer('mt', __('Movable Type and TypePad'), __('Import posts and comments from a Movable Type or Typepad blog.'), array ($mt_import, 'dispatch'));
|
||||
?>
|
||||
|
||||
@@ -42,7 +42,7 @@ switch ($step) {
|
||||
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
|
||||
<div style="width: 48%;" class="alignleft">
|
||||
<h3><label for="opml_url"><?php _e('Specify an OPML URL:'); ?></label></h3>
|
||||
<input type="text" name="opml_url" id="opml_url" size="50" class="code" style="width: 90%;" value="http://" />
|
||||
<input type="text" name="opml_url" id="opml_url" size="50" style="width: 90%;" value="http://" />
|
||||
</div>
|
||||
|
||||
<div style="width: 48%;" class="alignleft">
|
||||
@@ -58,13 +58,13 @@ switch ($step) {
|
||||
$categories = get_terms('link_category', 'get=all');
|
||||
foreach ($categories as $category) {
|
||||
?>
|
||||
<option value="<?php echo $category->term_id; ?>"><?php echo esc_html(apply_filters('link_category', $category->name)); ?></option>
|
||||
<option value="<?php echo $category->term_id; ?>"><?php echo wp_specialchars(apply_filters('link_category', $category->name)); ?></option>
|
||||
<?php
|
||||
} // end foreach
|
||||
?>
|
||||
</select></p>
|
||||
|
||||
<p class="submit"><input type="submit" name="submit" value="<?php esc_attr_e('Import OPML File') ?>" /></p>
|
||||
<p class="submit"><input type="submit" name="submit" value="<?php _e('Import OPML File') ?>" /></p>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
@@ -92,7 +92,6 @@ foreach ($categories as $category) {
|
||||
$blogrolling = true;
|
||||
} else { // try to get the upload file.
|
||||
$overrides = array('test_form' => false, 'test_type' => false);
|
||||
$_FILES['userfile']['name'] .= '.txt';
|
||||
$file = wp_handle_upload($_FILES['userfile'], $overrides);
|
||||
|
||||
if ( isset($file['error']) )
|
||||
|
||||
@@ -43,10 +43,6 @@ class RSS_Import {
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
function _normalize_tag( $matches ) {
|
||||
return '<' . strtolower( $matches[1] );
|
||||
}
|
||||
|
||||
function get_posts() {
|
||||
global $wpdb;
|
||||
|
||||
@@ -107,7 +103,7 @@ class RSS_Import {
|
||||
}
|
||||
|
||||
// Clean up content
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
|
||||
$post_content = str_replace('<br>', '<br />', $post_content);
|
||||
$post_content = str_replace('<hr>', '<hr />', $post_content);
|
||||
|
||||
@@ -133,7 +129,7 @@ class RSS_Import {
|
||||
if ( is_wp_error( $post_id ) )
|
||||
return $post_id;
|
||||
if (!$post_id) {
|
||||
_e('Couldn’t get post ID');
|
||||
_e("Couldn't get post ID");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ class STP_Import {
|
||||
echo '<p><strong>'.__('Don’t be stupid - backup your database before proceeding!').'</strong></p>';
|
||||
echo '<form action="admin.php?import=stp&step=1" method="post">';
|
||||
wp_nonce_field('import-stp');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Step 1').'" /></p>';
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Step 1').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
@@ -88,12 +88,12 @@ class STP_Import {
|
||||
|
||||
add_option('stpimp_posts', $posts);
|
||||
$count = count($posts);
|
||||
echo '<p>' . sprintf( _n('Done! <strong>%s</strong> tag to post relationships were read.', 'Done! <strong>%s</strong> tags to post relationships were read.', $count), $count ) . '<br /></p>';
|
||||
echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag to post relationships were read.', 'Done! <strong>%s</strong> tags to post relationships were read.', $count), $count ) . '<br /></p>';
|
||||
}
|
||||
|
||||
echo '<form action="admin.php?import=stp&step=2" method="post">';
|
||||
wp_nonce_field('import-stp');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Step 2').'" /></p>';
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Step 2').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
@@ -106,10 +106,10 @@ class STP_Import {
|
||||
// run that funky magic!
|
||||
$tags_added = $this->tag2post();
|
||||
|
||||
echo '<p>' . sprintf( _n('Done! <strong>%s</strong> tag was added!', 'Done! <strong>%s</strong> tags were added!', $tags_added), $tags_added ) . '<br /></p>';
|
||||
echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag was added!', 'Done! <strong>%s</strong> tags were added!', $tags_added), $tags_added ) . '<br /></p>';
|
||||
echo '<form action="admin.php?import=stp&step=3" method="post">';
|
||||
wp_nonce_field('import-stp');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Step 3').'" /></p>';
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Step 3').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ class Textpattern_Import {
|
||||
echo '<form action="admin.php?import=textpattern&step=1" method="post">';
|
||||
wp_nonce_field('import-textpattern');
|
||||
$this->db_form();
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Import').'" /></p>';
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.attribute_escape(__('Import')).'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
@@ -201,7 +201,7 @@ class Textpattern_Import {
|
||||
|
||||
// Store category translation for future use
|
||||
add_option('txpcat2wpcat',$txpcat2wpcat);
|
||||
echo '<p>'.sprintf(_n('Done! <strong>%1$s</strong> category imported.', 'Done! <strong>%1$s</strong> categories imported.', $count), $count).'<br /><br /></p>';
|
||||
echo '<p>'.sprintf(__ngettext('Done! <strong>%1$s</strong> category imported.', 'Done! <strong>%1$s</strong> categories imported.', $count), $count).'<br /><br /></p>';
|
||||
return true;
|
||||
}
|
||||
echo __('No Categories to Import!');
|
||||
@@ -397,24 +397,33 @@ class Textpattern_Import {
|
||||
$web = $wpdb->escape($web);
|
||||
$message = $wpdb->escape($message);
|
||||
|
||||
$comment = array(
|
||||
'comment_post_ID' => $comment_post_ID,
|
||||
'comment_author' => $name,
|
||||
'comment_author_IP' => $ip,
|
||||
'comment_author_email' => $email,
|
||||
'comment_author_url' => $web,
|
||||
'comment_date' => $posted,
|
||||
'comment_content' => $message,
|
||||
'comment_approved' => $comment_approved);
|
||||
$comment = wp_filter_comment($comment);
|
||||
|
||||
if ( $cinfo = comment_exists($name, $posted) ) {
|
||||
if($cinfo = comment_exists($name, $posted))
|
||||
{
|
||||
// Update comments
|
||||
$comment['comment_ID'] = $cinfo;
|
||||
$ret_id = wp_update_comment($comment);
|
||||
} else {
|
||||
$ret_id = wp_update_comment(array(
|
||||
'comment_ID' => $cinfo,
|
||||
'comment_post_ID' => $comment_post_ID,
|
||||
'comment_author' => $name,
|
||||
'comment_author_email' => $email,
|
||||
'comment_author_url' => $web,
|
||||
'comment_date' => $posted,
|
||||
'comment_content' => $message,
|
||||
'comment_approved' => $comment_approved)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Insert comments
|
||||
$ret_id = wp_insert_comment($comment);
|
||||
$ret_id = wp_insert_comment(array(
|
||||
'comment_post_ID' => $comment_post_ID,
|
||||
'comment_author' => $name,
|
||||
'comment_author_email' => $email,
|
||||
'comment_author_url' => $web,
|
||||
'comment_author_IP' => $ip,
|
||||
'comment_date' => $posted,
|
||||
'comment_content' => $message,
|
||||
'comment_approved' => $comment_approved)
|
||||
);
|
||||
}
|
||||
$txpcm2wpcm[$comment_ID] = $ret_id;
|
||||
}
|
||||
@@ -477,7 +486,7 @@ class Textpattern_Import {
|
||||
}
|
||||
add_option('txplinks2wplinks',$txplinks2wplinks);
|
||||
echo '<p>';
|
||||
printf(_n('Done! <strong>%s</strong> link imported', 'Done! <strong>%s</strong> links imported', $count), $count);
|
||||
printf(__ngettext('Done! <strong>%s</strong> link imported', 'Done! <strong>%s</strong> links imported', $count), $count);
|
||||
echo '<br /><br /></p>';
|
||||
return true;
|
||||
}
|
||||
@@ -496,7 +505,7 @@ class Textpattern_Import {
|
||||
|
||||
echo '<form action="admin.php?import=textpattern&step=2" method="post">';
|
||||
wp_nonce_field('import-textpattern');
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Import Users'));
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', attribute_escape(__('Import Users')));
|
||||
echo '</form>';
|
||||
|
||||
}
|
||||
@@ -509,7 +518,7 @@ class Textpattern_Import {
|
||||
|
||||
echo '<form action="admin.php?import=textpattern&step=3" method="post">';
|
||||
wp_nonce_field('import-textpattern');
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Import Posts'));
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', attribute_escape(__('Import Posts')));
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
@@ -523,7 +532,7 @@ class Textpattern_Import {
|
||||
|
||||
echo '<form action="admin.php?import=textpattern&step=4" method="post">';
|
||||
wp_nonce_field('import-textpattern');
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Import Comments'));
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', attribute_escape(__('Import Comments')));
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
@@ -535,7 +544,7 @@ class Textpattern_Import {
|
||||
|
||||
echo '<form action="admin.php?import=textpattern&step=5" method="post">';
|
||||
wp_nonce_field('import-textpattern');
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Import Links'));
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', attribute_escape(__('Import Links')));
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
@@ -548,7 +557,7 @@ class Textpattern_Import {
|
||||
|
||||
echo '<form action="admin.php?import=textpattern&step=6" method="post">';
|
||||
wp_nonce_field('import-textpattern');
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', esc_attr__('Finish'));
|
||||
printf('<p class="submit"><input type="submit" name="submit" class="button" value="%s" /></p>', attribute_escape(__('Finish')));
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
@@ -573,7 +582,7 @@ class Textpattern_Import {
|
||||
{
|
||||
echo '<p>'.__('Welcome to WordPress. We hope (and expect!) that you will find this platform incredibly rewarding! As a new WordPress user coming from Textpattern, there are some things that we would like to point out. Hopefully, they will help your transition go as smoothly as possible.').'</p>';
|
||||
echo '<h3>'.__('Users').'</h3>';
|
||||
echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in Textpattern, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">log in</a> and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
|
||||
echo '<p>'.sprintf(__('You have already setup WordPress and have been assigned an administrative login and password. Forget it. You didn’t have that login in Textpattern, why should you have it here? Instead we have taken care to import all of your users into our system. Unfortunately there is one downside. Because both WordPress and Textpattern uses a strong encryption hash with passwords, it is impossible to decrypt it and we are forced to assign temporary passwords to all your users. <strong>Every user has the same username, but their passwords are reset to password123.</strong> So <a href="%1$s">Login</a> and change it.'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
|
||||
echo '<h3>'.__('Preserving Authors').'</h3>';
|
||||
echo '<p>'.__('Secondly, we have attempted to preserve post authors. If you are the only author or contributor to your blog, then you are safe. In most cases, we are successful in this preservation endeavor. However, if we cannot ascertain the name of the writer due to discrepancies between database tables, we assign it to you, the administrative user.').'</p>';
|
||||
echo '<h3>'.__('Textile').'</h3>';
|
||||
@@ -585,7 +594,7 @@ class Textpattern_Import {
|
||||
echo '<li>'.__('<a href="http://wordpress.org/support/">The WordPress support forums</a>').'</li>';
|
||||
echo '<li>'.__('<a href="http://codex.wordpress.org">The Codex (In other words, the WordPress Bible)</a>').'</li>';
|
||||
echo '</ul>';
|
||||
echo '<p>'.sprintf(__('That’s it! What are you waiting for? Go <a href="%1$s">log in</a>!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
|
||||
echo '<p>'.sprintf(__('That’s it! What are you waiting for? Go <a href="%1$s">login</a>!'), get_bloginfo( 'wpurl' ) . '/wp-login.php').'</p>';
|
||||
}
|
||||
|
||||
function db_form()
|
||||
|
||||
@@ -33,7 +33,7 @@ class UTW_Import {
|
||||
echo '<p>'.__('To accommodate larger databases for those tag-crazy authors out there, we have made this into an easy 5-step program to help you kick that nasty UTW habit. Just keep clicking along and we will let you know when you are in the clear!').'</p>';
|
||||
echo '<p><strong>'.__('Don’t be stupid - backup your database before proceeding!').'</strong></p>';
|
||||
echo '<form action="admin.php?import=utw&step=1" method="post">';
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Step 1').'" /></p>';
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Step 1').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
@@ -98,7 +98,7 @@ class UTW_Import {
|
||||
|
||||
$count = count($tags);
|
||||
|
||||
echo '<p>' . sprintf( _n('Done! <strong>%s</strong> tag were read.', 'Done! <strong>%s</strong> tags were read.', $count), $count ) . '<br /></p>';
|
||||
echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag were read.', 'Done! <strong>%s</strong> tags were read.', $count), $count ) . '<br /></p>';
|
||||
echo '<p>' . __('The following tags were found:') . '</p>';
|
||||
|
||||
echo '<ul>';
|
||||
@@ -120,7 +120,7 @@ class UTW_Import {
|
||||
|
||||
echo '<form action="admin.php?import=utw&step=2" method="post">';
|
||||
wp_nonce_field('import-utw');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Step 2').'" /></p>';
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Step 2').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
@@ -150,13 +150,13 @@ class UTW_Import {
|
||||
|
||||
$count = count($posts);
|
||||
|
||||
echo '<p>' . sprintf( _n('Done! <strong>%s</strong> tag to post relationships were read.', 'Done! <strong>%s</strong> tags to post relationships were read.', $count), $count ) . '<br /></p>';
|
||||
echo '<p>' . sprintf( __ngettext('Done! <strong>%s</strong> tag to post relationships were read.', 'Done! <strong>%s</strong> tags to post relationships were read.', $count), $count ) . '<br /></p>';
|
||||
|
||||
}
|
||||
|
||||
echo '<form action="admin.php?import=utw&step=3" method="post">';
|
||||
wp_nonce_field('import-utw');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Step 3').'" /></p>';
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Step 3').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
|
||||
@@ -171,11 +171,11 @@ class UTW_Import {
|
||||
// run that funky magic!
|
||||
$tags_added = $this->tag2post();
|
||||
|
||||
echo '<p>' . sprintf( _n( 'Done! <strong>%s</strong> tag were added!', 'Done! <strong>%s</strong> tags were added!', $tags_added ), $tags_added ) . '<br /></p>';
|
||||
echo '<p>' . sprintf( __ngettext( 'Done! <strong>%s</strong> tag were added!', 'Done! <strong>%s</strong> tags were added!', $tags_added ), $tags_added ) . '<br /></p>';
|
||||
|
||||
echo '<form action="admin.php?import=utw&step=4" method="post">';
|
||||
wp_nonce_field('import-utw');
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.esc_attr__('Step 4').'" /></p>';
|
||||
echo '<p class="submit"><input type="submit" name="submit" class="button" value="'.__('Step 4').'" /></p>';
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ class WP_Import {
|
||||
var $author_ids = array ();
|
||||
var $tags = array ();
|
||||
var $categories = array ();
|
||||
var $terms = array ();
|
||||
|
||||
var $j = -1;
|
||||
var $fetch_attachments = false;
|
||||
@@ -123,11 +122,6 @@ class WP_Import {
|
||||
$this->tags[] = $tag[1];
|
||||
continue;
|
||||
}
|
||||
if ( false !== strpos($importline, '<wp:term>') ) {
|
||||
preg_match('|<wp:term>(.*?)</wp:term>|is', $importline, $term);
|
||||
$this->terms[] = $term[1];
|
||||
continue;
|
||||
}
|
||||
if ( false !== strpos($importline, '<item>') ) {
|
||||
$this->post = '';
|
||||
$doing_entry = true;
|
||||
@@ -204,20 +198,19 @@ class WP_Import {
|
||||
|
||||
function wp_authors_form() {
|
||||
?>
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php _e('Assign Authors'); ?></h2>
|
||||
<p><?php _e('To make it easier for you to edit and save the imported posts and drafts, you may want to change the name of the author of the posts. For example, you may want to import all the entries as <code>admin</code>s entries.'); ?></p>
|
||||
<?php
|
||||
if ( $this->allow_create_users() ) {
|
||||
echo '<p>'.__('If a new user is created by WordPress, a password will be randomly generated. Manually change the user’s details if necessary.')."</p>\n";
|
||||
echo '<p>'.__('If a new user is created by WordPress, a password will be randomly generated. Manually change the user\'s details if necessary.')."</p>\n";
|
||||
}
|
||||
|
||||
|
||||
$authors = $this->get_wp_authors();
|
||||
echo '<form action="?import=wordpress&step=2&id=' . $this->id . '" method="post">';
|
||||
wp_nonce_field('import-wordpress');
|
||||
?>
|
||||
<ol id="authors">
|
||||
<?php
|
||||
echo '<ol id="authors">';
|
||||
$j = -1;
|
||||
foreach ($authors as $author) {
|
||||
++ $j;
|
||||
@@ -229,6 +222,7 @@ class WP_Import {
|
||||
if ( $this->allow_fetch_attachments() ) {
|
||||
?>
|
||||
</ol>
|
||||
<?php screen_icon(); ?>
|
||||
<h2><?php _e('Import Attachments'); ?></h2>
|
||||
<p>
|
||||
<input type="checkbox" value="1" name="attachments" id="import-attachments" />
|
||||
@@ -239,7 +233,7 @@ class WP_Import {
|
||||
}
|
||||
|
||||
echo '<p class="submit">';
|
||||
echo '<input type="submit" class="button" value="'. esc_attr__('Submit') .'" />'.'<br />';
|
||||
echo '<input type="submit" class="button" value="'.attribute_escape( __('Submit') ).'" />'.'<br />';
|
||||
echo '</p>';
|
||||
echo '</form>';
|
||||
|
||||
@@ -248,14 +242,14 @@ class WP_Import {
|
||||
function users_form($n, $author) {
|
||||
|
||||
if ( $this->allow_create_users() ) {
|
||||
printf('<label>'.__('Create user %1$s or map to existing'), ' <input type="text" value="'. esc_attr($author) .'" name="'.'user_create['.intval($n).']'.'" maxlength="30" /></label> <br />');
|
||||
printf('<label>'.__('Create user %1$s or map to existing'), ' <input type="text" value="'.$author.'" name="'.'user_create['.intval($n).']'.'" maxlength="30" /></label> <br />');
|
||||
}
|
||||
else {
|
||||
echo __('Map to existing').'<br />';
|
||||
}
|
||||
|
||||
// keep track of $n => $author name
|
||||
echo '<input type="hidden" name="author_in['.intval($n).']" value="' . esc_attr($author).'" />';
|
||||
echo '<input type="hidden" name="author_in['.intval($n).']" value="'.htmlspecialchars($author).'" />';
|
||||
|
||||
$users = get_users_of_blog();
|
||||
?><select name="user_select[<?php echo $n; ?>]">
|
||||
@@ -306,7 +300,6 @@ class WP_Import {
|
||||
continue;
|
||||
|
||||
$category_nicename = $this->get_tag( $c, 'wp:category_nicename' );
|
||||
$category_description = $this->get_tag( $c, 'wp:category_description' );
|
||||
$posts_private = (int) $this->get_tag( $c, 'wp:posts_private' );
|
||||
$links_private = (int) $this->get_tag( $c, 'wp:links_private' );
|
||||
|
||||
@@ -317,7 +310,7 @@ class WP_Import {
|
||||
else
|
||||
$category_parent = category_exists($parent);
|
||||
|
||||
$catarr = compact('category_nicename', 'category_parent', 'posts_private', 'links_private', 'posts_private', 'cat_name', 'category_description');
|
||||
$catarr = compact('category_nicename', 'category_parent', 'posts_private', 'links_private', 'posts_private', 'cat_name');
|
||||
|
||||
$cat_ID = wp_insert_category($catarr);
|
||||
}
|
||||
@@ -343,43 +336,6 @@ class WP_Import {
|
||||
$tag_ID = wp_insert_term($tag_name, 'post_tag', $tagarr);
|
||||
}
|
||||
}
|
||||
|
||||
function process_terms() {
|
||||
global $wpdb, $wp_taxonomies;
|
||||
|
||||
$custom_taxonomies = $wp_taxonomies;
|
||||
// get rid of the standard taxonomies
|
||||
unset( $custom_taxonomies['category'] );
|
||||
unset( $custom_taxonomies['post_tag'] );
|
||||
unset( $custom_taxonomies['link_category'] );
|
||||
|
||||
$custom_taxonomies = array_keys( $custom_taxonomies );
|
||||
$current_terms = (array) get_terms( $custom_taxonomies, 'get=all' );
|
||||
$taxonomies = array();
|
||||
foreach ( $current_terms as $term ) {
|
||||
if ( isset( $_terms[$term->taxonomy] ) ) {
|
||||
$taxonomies[$term->taxonomy] = array_merge( $taxonomies[$term->taxonomy], array($term->name) );
|
||||
} else {
|
||||
$taxonomies[$term->taxonomy] = array($term->name);
|
||||
}
|
||||
}
|
||||
|
||||
while ( $c = array_shift($this->terms) ) {
|
||||
$term_name = trim($this->get_tag( $c, 'wp:term_name' ));
|
||||
$term_taxonomy = trim($this->get_tag( $c, 'wp:term_taxonomy' ));
|
||||
|
||||
// If the term exists in the taxonomy we leave it alone
|
||||
if ( isset($taxonomies[$term_taxonomy] ) && in_array( $term_name, $taxonomies[$term_taxonomy] ) )
|
||||
continue;
|
||||
|
||||
$slug = $this->get_tag( $c, 'wp:term_slug' );
|
||||
$description = $this->get_tag( $c, 'wp:term_description' );
|
||||
|
||||
$termarr = compact('slug', 'description');
|
||||
|
||||
$term_ID = wp_insert_term($term_name, $this->get_tag( $c, 'wp:term_taxonomy' ), $termarr);
|
||||
}
|
||||
}
|
||||
|
||||
function process_author($post) {
|
||||
$author = $this->get_tag( $post, 'dc:creator' );
|
||||
@@ -400,10 +356,6 @@ class WP_Import {
|
||||
echo '<h3>'.sprintf(__('All done.').' <a href="%s">'.__('Have fun!').'</a>', get_option('home')).'</h3>';
|
||||
}
|
||||
|
||||
function _normalize_tag( $matches ) {
|
||||
return '<' . strtolower( $matches[1] );
|
||||
}
|
||||
|
||||
function process_post($post) {
|
||||
global $wpdb;
|
||||
|
||||
@@ -425,17 +377,16 @@ class WP_Import {
|
||||
$menu_order = $this->get_tag( $post, 'wp:menu_order' );
|
||||
$post_type = $this->get_tag( $post, 'wp:post_type' );
|
||||
$post_password = $this->get_tag( $post, 'wp:post_password' );
|
||||
$is_sticky = $this->get_tag( $post, 'wp:is_sticky' );
|
||||
$guid = $this->get_tag( $post, 'guid' );
|
||||
$post_author = $this->get_tag( $post, 'dc:creator' );
|
||||
|
||||
$post_excerpt = $this->get_tag( $post, 'excerpt:encoded' );
|
||||
$post_excerpt = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_excerpt);
|
||||
$post_excerpt = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_excerpt);
|
||||
$post_excerpt = str_replace('<br>', '<br />', $post_excerpt);
|
||||
$post_excerpt = str_replace('<hr>', '<hr />', $post_excerpt);
|
||||
|
||||
$post_content = $this->get_tag( $post, 'content:encoded' );
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', array( &$this, '_normalize_tag' ), $post_content);
|
||||
$post_content = preg_replace_callback('|<(/?[A-Z]+)|', create_function('$match', 'return "<" . strtolower($match[1]);'), $post_content);
|
||||
$post_content = str_replace('<br>', '<br />', $post_content);
|
||||
$post_content = str_replace('<hr>', '<hr />', $post_content);
|
||||
|
||||
@@ -496,9 +447,6 @@ class WP_Import {
|
||||
else {
|
||||
printf(__('Importing post <em>%s</em>...'), stripslashes($post_title));
|
||||
$comment_post_ID = $post_id = wp_insert_post($postdata);
|
||||
if ( $post_id && $is_sticky == 1 )
|
||||
stick_post( $post_id );
|
||||
|
||||
}
|
||||
|
||||
if ( is_wp_error( $post_id ) )
|
||||
@@ -559,38 +507,28 @@ class WP_Import {
|
||||
preg_match_all('|<wp:comment>(.*?)</wp:comment>|is', $post, $comments);
|
||||
$comments = $comments[1];
|
||||
$num_comments = 0;
|
||||
$inserted_comments = array();
|
||||
if ( $comments) {
|
||||
foreach ($comments as $comment) {
|
||||
$comment_id = $this->get_tag( $comment, 'wp:comment_id');
|
||||
$newcomments[$comment_id]['comment_post_ID'] = $comment_post_ID;
|
||||
$newcomments[$comment_id]['comment_author'] = $this->get_tag( $comment, 'wp:comment_author');
|
||||
$newcomments[$comment_id]['comment_author_email'] = $this->get_tag( $comment, 'wp:comment_author_email');
|
||||
$newcomments[$comment_id]['comment_author_IP'] = $this->get_tag( $comment, 'wp:comment_author_IP');
|
||||
$newcomments[$comment_id]['comment_author_url'] = $this->get_tag( $comment, 'wp:comment_author_url');
|
||||
$newcomments[$comment_id]['comment_date'] = $this->get_tag( $comment, 'wp:comment_date');
|
||||
$newcomments[$comment_id]['comment_date_gmt'] = $this->get_tag( $comment, 'wp:comment_date_gmt');
|
||||
$newcomments[$comment_id]['comment_content'] = $this->get_tag( $comment, 'wp:comment_content');
|
||||
$newcomments[$comment_id]['comment_approved'] = $this->get_tag( $comment, 'wp:comment_approved');
|
||||
$newcomments[$comment_id]['comment_type'] = $this->get_tag( $comment, 'wp:comment_type');
|
||||
$newcomments[$comment_id]['comment_parent'] = $this->get_tag( $comment, 'wp:comment_parent');
|
||||
if ( $comments) { foreach ($comments as $comment) {
|
||||
$comment_author = $this->get_tag( $comment, 'wp:comment_author');
|
||||
$comment_author_email = $this->get_tag( $comment, 'wp:comment_author_email');
|
||||
$comment_author_IP = $this->get_tag( $comment, 'wp:comment_author_IP');
|
||||
$comment_author_url = $this->get_tag( $comment, 'wp:comment_author_url');
|
||||
$comment_date = $this->get_tag( $comment, 'wp:comment_date');
|
||||
$comment_date_gmt = $this->get_tag( $comment, 'wp:comment_date_gmt');
|
||||
$comment_content = $this->get_tag( $comment, 'wp:comment_content');
|
||||
$comment_approved = $this->get_tag( $comment, 'wp:comment_approved');
|
||||
$comment_type = $this->get_tag( $comment, 'wp:comment_type');
|
||||
$comment_parent = $this->get_tag( $comment, 'wp:comment_parent');
|
||||
|
||||
// if this is a new post we can skip the comment_exists() check
|
||||
if ( !$post_exists || !comment_exists($comment_author, $comment_date) ) {
|
||||
$commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_author_email', 'comment_author_IP', 'comment_date', 'comment_date_gmt', 'comment_content', 'comment_approved', 'comment_type', 'comment_parent');
|
||||
wp_insert_comment($commentdata);
|
||||
$num_comments++;
|
||||
}
|
||||
// Sort by comment ID, to make sure comment parents exist (if there at all)
|
||||
ksort($newcomments);
|
||||
foreach ($newcomments as $key => $comment) {
|
||||
// if this is a new post we can skip the comment_exists() check
|
||||
if ( !$post_exists || !comment_exists($comment['comment_author'], $comment['comment_date']) ) {
|
||||
if (isset($inserted_comments[$comment['comment_parent']]))
|
||||
$comment['comment_parent'] = $inserted_comments[$comment['comment_parent']];
|
||||
$comment = wp_filter_comment($comment);
|
||||
$inserted_comments[$key] = wp_insert_comment($comment);
|
||||
$num_comments++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} }
|
||||
|
||||
if ( $num_comments )
|
||||
printf(' '._n('(%s comment)', '(%s comments)', $num_comments), $num_comments);
|
||||
printf(' '.__ngettext('(%s comment)', '(%s comments)', $num_comments), $num_comments);
|
||||
|
||||
// Now for post meta
|
||||
preg_match_all('|<wp:postmeta>(.*?)</wp:postmeta>|is', $post, $postmeta);
|
||||
@@ -745,8 +683,8 @@ class WP_Import {
|
||||
}
|
||||
|
||||
function is_valid_meta_key($key) {
|
||||
// skip attachment metadata since we'll regenerate it from scratch
|
||||
if ( $key == '_wp_attached_file' || $key == '_wp_attachment_metadata' )
|
||||
// skip _wp_attached_file metadata since we'll regenerate it from scratch
|
||||
if ( $key == '_wp_attached_file' )
|
||||
return false;
|
||||
return $key;
|
||||
}
|
||||
@@ -801,7 +739,6 @@ class WP_Import {
|
||||
$this->get_entries();
|
||||
$this->process_categories();
|
||||
$this->process_tags();
|
||||
$this->process_terms();
|
||||
$result = $this->process_posts();
|
||||
wp_suspend_cache_invalidation(false);
|
||||
$this->backfill_parents();
|
||||
|
||||
@@ -65,7 +65,7 @@ class WP_Categories_to_Tags {
|
||||
|
||||
if ( $cat_num > 0 ) {
|
||||
screen_icon();
|
||||
echo '<h2>' . sprintf( _n( 'Convert Category to Tag.', 'Convert Categories (%d) to Tags.', $cat_num ), $cat_num ) . '</h2>';
|
||||
echo '<h2>' . sprintf( __ngettext( 'Convert Category to Tag.', 'Convert Categories (%d) to Tags.', $cat_num ), $cat_num ) . '</h2>';
|
||||
echo '<div class="narrow">';
|
||||
echo '<p>' . __('Hey there. Here you can selectively convert existing categories to tags. To get started, check the categories you wish to be converted, then click the Convert button.') . '</p>';
|
||||
echo '<p>' . __('Keep in mind that if you convert a category with child categories, the children become top-level orphans.') . '</p></div>';
|
||||
@@ -103,7 +103,7 @@ function check_all_rows() {
|
||||
</script>
|
||||
|
||||
<form name="catlist" id="catlist" action="admin.php?import=wp-cat2tag&step=2" method="post">
|
||||
<p><input type="button" class="button-secondary" value="<?php esc_attr_e('Check All'); ?>" onclick="this.value=check_all_rows()" />
|
||||
<p><input type="button" class="button-secondary" value="<?php _e('Check All'); ?>" onclick="this.value=check_all_rows()" />
|
||||
<?php wp_nonce_field('import-cat2tag'); ?></p>
|
||||
<ul style="list-style:none">
|
||||
|
||||
@@ -128,7 +128,7 @@ function check_all_rows() {
|
||||
<?php if ( ! empty($this->hybrids_ids) )
|
||||
echo '<p><a name="note"></a>' . __('* This category is also a tag. Converting it will add that tag to all posts that are currently in the category.') . '</p>'; ?>
|
||||
|
||||
<p class="submit"><input type="submit" name="submit" class="button" value="<?php esc_attr_e('Convert Categories to Tags'); ?>" /></p>
|
||||
<p class="submit"><input type="submit" name="submit" class="button" value="<?php _e('Convert Categories to Tags'); ?>" /></p>
|
||||
</form>
|
||||
|
||||
<?php }
|
||||
@@ -141,9 +141,9 @@ function check_all_rows() {
|
||||
|
||||
if ( $tags_num > 0 ) {
|
||||
screen_icon();
|
||||
echo '<h2>' . sprintf( _n( 'Convert Tag to Category.', 'Convert Tags (%d) to Categories.', $tags_num ), $tags_num ) . '</h2>';
|
||||
echo '<h2>' . sprintf( __ngettext( 'Convert Tag to Category.', 'Convert Tags (%d) to Categories.', $tags_num ), $tags_num ) . '</h2>';
|
||||
echo '<div class="narrow">';
|
||||
echo '<p>' . __('Here you can selectively convert existing tags to categories. To get started, check the tags you wish to be converted, then click the Convert button.') . '</p>';
|
||||
echo '<p>' . __('Here you can selectively converts existing tags to categories. To get started, check the tags you wish to be converted, then click the Convert button.') . '</p>';
|
||||
echo '<p>' . __('The newly created categories will still be associated with the same posts.') . '</p></div>';
|
||||
|
||||
$this->tags_form();
|
||||
@@ -179,12 +179,12 @@ function check_all_tagrows() {
|
||||
</script>
|
||||
|
||||
<form name="taglist" id="taglist" action="admin.php?import=wp-cat2tag&step=4" method="post">
|
||||
<p><input type="button" class="button-secondary" value="<?php esc_attr_e('Check All'); ?>" onclick="this.value=check_all_tagrows()" />
|
||||
<p><input type="button" class="button-secondary" value="<?php _e('Check All'); ?>" onclick="this.value=check_all_tagrows()" />
|
||||
<?php wp_nonce_field('import-cat2tag'); ?></p>
|
||||
<ul style="list-style:none">
|
||||
|
||||
<?php foreach ( $this->all_tags as $tag ) { ?>
|
||||
<li><label><input type="checkbox" name="tags_to_convert[]" value="<?php echo intval($tag->term_id); ?>" /> <?php echo esc_attr($tag->name) . ' (' . $tag->count . ')'; ?></label><?php if ( in_array( intval($tag->term_id), $this->hybrids_ids ) ) echo ' <a href="#note"> * </a>'; ?></li>
|
||||
<li><label><input type="checkbox" name="tags_to_convert[]" value="<?php echo intval($tag->term_id); ?>" /> <?php echo attribute_escape($tag->name) . ' (' . $tag->count . ')'; ?></label><?php if ( in_array( intval($tag->term_id), $this->hybrids_ids ) ) echo ' <a href="#note"> * </a>'; ?></li>
|
||||
|
||||
<?php } ?>
|
||||
</ul>
|
||||
@@ -192,7 +192,7 @@ function check_all_tagrows() {
|
||||
<?php if ( ! empty($this->hybrids_ids) )
|
||||
echo '<p><a name="note"></a>' . __('* This tag is also a category. When converted, all posts associated with the tag will also be in the category.') . '</p>'; ?>
|
||||
|
||||
<p class="submit"><input type="submit" name="submit_tags" class="button" value="<?php esc_attr_e('Convert Tags to Categories'); ?>" /></p>
|
||||
<p class="submit"><input type="submit" name="submit_tags" class="button" value="<?php _e('Convert Tags to Categories'); ?>" /></p>
|
||||
</form>
|
||||
|
||||
<?php }
|
||||
@@ -249,7 +249,7 @@ function check_all_tagrows() {
|
||||
$cat_id = (int) $cat_id;
|
||||
|
||||
if ( ! $this->_category_exists($cat_id) ) {
|
||||
echo '<li>' . sprintf( __('Category %s doesn’t exist!'), $cat_id ) . "</li>\n";
|
||||
echo '<li>' . sprintf( __('Category %s doesn\'t exist!'), $cat_id ) . "</li>\n";
|
||||
} else {
|
||||
$category =& get_category($cat_id);
|
||||
echo '<li>' . sprintf(__('Converting category <strong>%s</strong> ... '), $category->name);
|
||||
@@ -325,12 +325,14 @@ function check_all_tagrows() {
|
||||
|
||||
if ( ! empty($clean_term_cache) ) {
|
||||
$clean_term_cache = array_unique(array_values($clean_term_cache));
|
||||
clean_term_cache($clean_term_cache, 'post_tag');
|
||||
foreach ( $clean_term_cache as $id )
|
||||
wp_cache_delete($id, 'post_tag');
|
||||
}
|
||||
|
||||
if ( ! empty($clean_cat_cache) ) {
|
||||
$clean_cat_cache = array_unique(array_values($clean_cat_cache));
|
||||
clean_term_cache($clean_cat_cache, 'category');
|
||||
foreach ( $clean_cat_cache as $id )
|
||||
wp_cache_delete($id, 'category');
|
||||
}
|
||||
|
||||
if ( $clear_parents ) delete_option('category_children');
|
||||
@@ -406,18 +408,20 @@ function check_all_tagrows() {
|
||||
echo __('Converted successfully.') . "</li>\n";
|
||||
|
||||
} else {
|
||||
printf( '<li>' . __('Tag #%s doesn’t exist!') . "</li>\n", $tag_id );
|
||||
printf( '<li>' . __('Tag #%s doesn\'t exist!') . "</li>\n", $tag_id );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty($clean_term_cache) ) {
|
||||
$clean_term_cache = array_unique(array_values($clean_term_cache));
|
||||
clean_term_cache($clean_term_cache, 'post_tag');
|
||||
foreach ( $clean_term_cache as $id )
|
||||
wp_cache_delete($id, 'post_tag');
|
||||
}
|
||||
|
||||
if ( ! empty($clean_cat_cache) ) {
|
||||
$clean_cat_cache = array_unique(array_values($clean_cat_cache));
|
||||
clean_term_cache($clean_term_cache, 'category');
|
||||
foreach ( $clean_cat_cache as $id )
|
||||
wp_cache_delete($id, 'category');
|
||||
}
|
||||
|
||||
if ( $clear_parents ) delete_option('category_children');
|
||||
|
||||
@@ -29,11 +29,11 @@ function edit_link( $link_id = '' ) {
|
||||
if (!current_user_can( 'manage_links' ))
|
||||
wp_die( __( 'Cheatin’ uh?' ));
|
||||
|
||||
$_POST['link_url'] = esc_html( $_POST['link_url'] );
|
||||
$_POST['link_url'] = esc_url($_POST['link_url']);
|
||||
$_POST['link_name'] = esc_html( $_POST['link_name'] );
|
||||
$_POST['link_image'] = esc_html( $_POST['link_image'] );
|
||||
$_POST['link_rss'] = esc_url($_POST['link_rss']);
|
||||
$_POST['link_url'] = wp_specialchars( $_POST['link_url'] );
|
||||
$_POST['link_url'] = clean_url($_POST['link_url']);
|
||||
$_POST['link_name'] = wp_specialchars( $_POST['link_name'] );
|
||||
$_POST['link_image'] = wp_specialchars( $_POST['link_image'] );
|
||||
$_POST['link_rss'] = clean_url($_POST['link_rss']);
|
||||
if ( !isset($_POST['link_visible']) || 'N' != $_POST['link_visible'] )
|
||||
$_POST['link_visible'] = 'Y';
|
||||
|
||||
@@ -54,12 +54,12 @@ function edit_link( $link_id = '' ) {
|
||||
*/
|
||||
function get_default_link_to_edit() {
|
||||
if ( isset( $_GET['linkurl'] ) )
|
||||
$link->link_url = esc_url( $_GET['linkurl']);
|
||||
$link->link_url = clean_url( $_GET['linkurl']);
|
||||
else
|
||||
$link->link_url = '';
|
||||
|
||||
if ( isset( $_GET['name'] ) )
|
||||
$link->link_name = esc_attr( $_GET['name']);
|
||||
$link->link_name = attribute_escape( $_GET['name']);
|
||||
else
|
||||
$link->link_name = '';
|
||||
|
||||
|
||||
@@ -278,10 +278,7 @@ class ftp_base {
|
||||
$dns=@gethostbyaddr($host);
|
||||
if(!$ip) $ip=$host;
|
||||
if(!$dns) $dns=$host;
|
||||
// Validate the IPAddress PHP4 returns -1 for invalid, PHP5 false
|
||||
// -1 === "255.255.255.255" which is the broadcast address which is also going to be invalid
|
||||
$ipaslong = ip2long($ip);
|
||||
if ( ($ipaslong == false) || ($ipaslong === -1) ) {
|
||||
if(ip2long($ip) === -1) {
|
||||
$this->SendMSG("Wrong host name/address \"".$host."\"");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,8 @@ class WP_Filesystem_Base {
|
||||
* @return string The location of the remote path.
|
||||
*/
|
||||
function abspath() {
|
||||
if ( defined('FTP_BASE') && strpos($this->method, 'ftp') !== false )
|
||||
return FTP_BASE;
|
||||
$folder = $this->find_folder(ABSPATH);
|
||||
//Perhaps the FTP folder is rooted at the WordPress install, Check for wp-includes folder in root, Could have some false positives, but rare.
|
||||
if ( ! $folder && $this->is_dir('/wp-includes') )
|
||||
@@ -60,6 +62,8 @@ class WP_Filesystem_Base {
|
||||
* @return string The location of the remote path.
|
||||
*/
|
||||
function wp_content_dir() {
|
||||
if ( defined('FTP_CONTENT_DIR') && strpos($this->method, 'ftp') !== false )
|
||||
return FTP_CONTENT_DIR;
|
||||
return $this->find_folder(WP_CONTENT_DIR);
|
||||
}
|
||||
/**
|
||||
@@ -71,6 +75,8 @@ class WP_Filesystem_Base {
|
||||
* @return string The location of the remote path.
|
||||
*/
|
||||
function wp_plugins_dir() {
|
||||
if ( defined('FTP_PLUGIN_DIR') && strpos($this->method, 'ftp') !== false )
|
||||
return FTP_PLUGIN_DIR;
|
||||
return $this->find_folder(WP_PLUGIN_DIR);
|
||||
}
|
||||
/**
|
||||
@@ -136,15 +142,6 @@ class WP_Filesystem_Base {
|
||||
*/
|
||||
function find_folder($folder) {
|
||||
|
||||
if ( strpos($this->method, 'ftp') !== false ) {
|
||||
$constant_overrides = array( 'FTP_BASE' => ABSPATH, 'FTP_CONTENT_DIR' => WP_CONTENT_DIR, 'FTP_PLUGIN_DIR' => WP_PLUGIN_DIR );
|
||||
foreach ( $constant_overrides as $constant => $dir )
|
||||
if ( defined($constant) && $folder === $dir )
|
||||
return trailingslashit(constant($constant));
|
||||
} elseif ( 'direct' == $this->method ) {
|
||||
return trailingslashit($folder);
|
||||
}
|
||||
|
||||
$folder = preg_replace('|^([a-z]{1}):|i', '', $folder); //Strip out windows driveletter if its there.
|
||||
$folder = str_replace('\\', '/', $folder); //Windows path sanitiation
|
||||
|
||||
@@ -152,7 +149,6 @@ class WP_Filesystem_Base {
|
||||
return $this->cache[ $folder ];
|
||||
|
||||
if ( $this->exists($folder) ) { //Folder exists at that absolute path.
|
||||
$folder = trailingslashit($folder);
|
||||
$this->cache[ $folder ] = $folder;
|
||||
return $folder;
|
||||
}
|
||||
@@ -193,24 +189,24 @@ class WP_Filesystem_Base {
|
||||
// If its found, change into it and follow through looking for it.
|
||||
// If it cant find WordPress down that route, it'll continue onto the next folder level, and see if that matches, and so on.
|
||||
// If it reaches the end, and still cant find it, it'll return false for the entire function.
|
||||
if ( isset($files[ $key ]) ){
|
||||
if( isset($files[ $key ]) ){
|
||||
//Lets try that folder:
|
||||
$newdir = trailingslashit(path_join($base, $key));
|
||||
if ( $this->verbose )
|
||||
if( $this->verbose )
|
||||
printf( __('Changing to %s') . '<br/>', $newdir );
|
||||
if ( $ret = $this->search_for_folder( $folder, $newdir, $loop) )
|
||||
if( $ret = $this->search_for_folder( $folder, $newdir, $loop) )
|
||||
return $ret;
|
||||
}
|
||||
}
|
||||
|
||||
//Only check this as a last resort, to prevent locating the incorrect install. All above proceeedures will fail quickly if this is the right branch to take.
|
||||
if (isset( $files[ $last_path ] ) ) {
|
||||
if ( $this->verbose )
|
||||
if(isset( $files[ $last_path ] ) ) {
|
||||
if( $this->verbose )
|
||||
printf( __('Found %s') . '<br/>', $base . $last_path );
|
||||
return trailingslashit($base . $last_path);
|
||||
return $base . $last_path;
|
||||
}
|
||||
if ( $loop )
|
||||
return false; //Prevent tihs function looping again.
|
||||
if( $loop )
|
||||
return false;//Prevent tihs function looping again.
|
||||
//As an extra last resort, Change back to / if the folder wasnt found. This comes into effect when the CWD is /home/user/ but WP is at /var/www/.... mainly dedicated setups.
|
||||
return $this->search_for_folder($folder, '/', true);
|
||||
|
||||
@@ -242,7 +238,7 @@ class WP_Filesystem_Base {
|
||||
$info = 'd';
|
||||
elseif (($perms & 0x2000) == 0x2000) // Character special
|
||||
$info = 'c';
|
||||
elseif (($perms & 0x1000) == 0x1000) // FIFO pipe
|
||||
elseif (($perms & 0x1000) == 0x1000)// FIFO pipe
|
||||
$info = 'p';
|
||||
else // Unknown
|
||||
$info = 'u';
|
||||
|
||||
@@ -14,200 +14,117 @@
|
||||
* @subpackage Filesystem
|
||||
* @uses WP_Filesystem_Base Extends class
|
||||
*/
|
||||
class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
var $errors = null;
|
||||
/**
|
||||
* constructor
|
||||
*
|
||||
* @param $arg mixed ingored argument
|
||||
*/
|
||||
class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
var $permission = null;
|
||||
var $errors = array();
|
||||
function WP_Filesystem_Direct($arg) {
|
||||
$this->method = 'direct';
|
||||
$this->errors = new WP_Error();
|
||||
$this->permission = umask();
|
||||
}
|
||||
/**
|
||||
* connect filesystem.
|
||||
*
|
||||
* @return bool Returns true on success or false on failure (always true for WP_Filesystem_Direct).
|
||||
*/
|
||||
function connect() {
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Reads entire file into a string
|
||||
*
|
||||
* @param $file string Name of the file to read.
|
||||
* @return string|bool The function returns the read data or false on failure.
|
||||
*/
|
||||
function setDefaultPermissions($perm) {
|
||||
$this->permission = $perm;
|
||||
}
|
||||
function get_contents($file) {
|
||||
return @file_get_contents($file);
|
||||
}
|
||||
/**
|
||||
* Reads entire file into an array
|
||||
*
|
||||
* @param $file string Path to the file.
|
||||
* @return array|bool the file contents in an array or false on failure.
|
||||
*/
|
||||
function get_contents_array($file) {
|
||||
return @file($file);
|
||||
}
|
||||
/**
|
||||
* Write a string to a file
|
||||
*
|
||||
* @param $file string Path to the file where to write the data.
|
||||
* @param $contents string The data to write.
|
||||
* @param $mode int (optional) The file permissions as octal number, usually 0644.
|
||||
* @param $type string (optional) Specifies additional type of access you require to the file.
|
||||
* @return bool False upon failure.
|
||||
*/
|
||||
function put_contents($file, $contents, $mode = false, $type = '') {
|
||||
if ( ! ($fp = @fopen($file, 'w' . $type)) )
|
||||
return false;
|
||||
@fwrite($fp, $contents);
|
||||
@fclose($fp);
|
||||
$this->chmod($file, $mode);
|
||||
$this->chmod($file,$mode);
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Gets the current working directory
|
||||
*
|
||||
* @return string|bool the current working directory on success, or false on failure.
|
||||
*/
|
||||
function cwd() {
|
||||
return @getcwd();
|
||||
}
|
||||
/**
|
||||
* Change directory
|
||||
*
|
||||
* @param $dir string The new current directory.
|
||||
* @return bool Returns true on success or false on failure.
|
||||
*/
|
||||
function chdir($dir) {
|
||||
return @chdir($dir);
|
||||
}
|
||||
/**
|
||||
* Changes file group
|
||||
*
|
||||
* @param $file string Path to the file.
|
||||
* @param $group mixed A group name or number.
|
||||
* @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False.
|
||||
* @return bool Returns true on success or false on failure.
|
||||
*/
|
||||
function chgrp($file, $group, $recursive = false) {
|
||||
if ( ! $this->exists($file) )
|
||||
if( ! $this->exists($file) )
|
||||
return false;
|
||||
if ( ! $recursive )
|
||||
if( ! $recursive )
|
||||
return @chgrp($file, $group);
|
||||
if ( ! $this->is_dir($file) )
|
||||
if( ! $this->is_dir($file) )
|
||||
return @chgrp($file, $group);
|
||||
//Is a directory, and we want recursive
|
||||
$file = trailingslashit($file);
|
||||
$filelist = $this->dirlist($file);
|
||||
foreach ($filelist as $filename)
|
||||
foreach($filelist as $filename)
|
||||
$this->chgrp($file . $filename, $group, $recursive);
|
||||
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Changes filesystem permissions
|
||||
*
|
||||
* @param $file string Path to the file.
|
||||
* @param $mode int (optional) The permissions as octal number, usually 0644 for files, 0755 for dirs.
|
||||
* @param $recursive bool (optional) If set True changes file group recursivly. Defaults to False.
|
||||
* @return bool Returns true on success or false on failure.
|
||||
*/
|
||||
function chmod($file, $mode = false, $recursive = false) {
|
||||
if ( ! $this->exists($file) )
|
||||
if( ! $mode )
|
||||
$mode = $this->permission;
|
||||
if( ! $this->exists($file) )
|
||||
return false;
|
||||
|
||||
if ( ! $mode ) {
|
||||
if ( $this->is_file($file) )
|
||||
$mode = FS_CHMOD_FILE;
|
||||
elseif ( $this->is_dir($file) )
|
||||
$mode = FS_CHMOD_DIR;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $recursive )
|
||||
return @chmod($file, $mode);
|
||||
if ( ! $this->is_dir($file) )
|
||||
if( ! $recursive )
|
||||
return @chmod($file,$mode);
|
||||
if( ! $this->is_dir($file) )
|
||||
return @chmod($file, $mode);
|
||||
//Is a directory, and we want recursive
|
||||
$file = trailingslashit($file);
|
||||
$filelist = $this->dirlist($file);
|
||||
foreach ($filelist as $filename)
|
||||
foreach($filelist as $filename)
|
||||
$this->chmod($file . $filename, $mode, $recursive);
|
||||
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Changes file owner
|
||||
*
|
||||
* @param $file string Path to the file.
|
||||
* @param $owner mixed A user name or number.
|
||||
* @param $recursive bool (optional) If set True changes file owner recursivly. Defaults to False.
|
||||
* @return bool Returns true on success or false on failure.
|
||||
*/
|
||||
function chown($file, $owner, $recursive = false) {
|
||||
if ( ! $this->exists($file) )
|
||||
if( ! $this->exists($file) )
|
||||
return false;
|
||||
if ( ! $recursive )
|
||||
if( ! $recursive )
|
||||
return @chown($file, $owner);
|
||||
if ( ! $this->is_dir($file) )
|
||||
if( ! $this->is_dir($file) )
|
||||
return @chown($file, $owner);
|
||||
//Is a directory, and we want recursive
|
||||
$filelist = $this->dirlist($file);
|
||||
foreach ($filelist as $filename) {
|
||||
foreach($filelist as $filename){
|
||||
$this->chown($file . '/' . $filename, $owner, $recursive);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Gets file owner
|
||||
*
|
||||
* @param $file string Path to the file.
|
||||
* @return string Username of the user.
|
||||
*/
|
||||
function owner($file) {
|
||||
$owneruid = @fileowner($file);
|
||||
if ( ! $owneruid )
|
||||
if( ! $owneruid )
|
||||
return false;
|
||||
if ( ! function_exists('posix_getpwuid') )
|
||||
if( ! function_exists('posix_getpwuid') )
|
||||
return $owneruid;
|
||||
$ownerarray = posix_getpwuid($owneruid);
|
||||
return $ownerarray['name'];
|
||||
}
|
||||
/**
|
||||
* Gets file permissions
|
||||
*
|
||||
* FIXME does not handle errors in fileperms()
|
||||
*
|
||||
* @param $file string Path to the file.
|
||||
* @return string Mode of the file (last 4 digits).
|
||||
*/
|
||||
function getchmod($file) {
|
||||
return substr(decoct(@fileperms($file)),3);
|
||||
return @fileperms($file);
|
||||
}
|
||||
function group($file) {
|
||||
$gid = @filegroup($file);
|
||||
if ( ! $gid )
|
||||
if( ! $gid )
|
||||
return false;
|
||||
if ( ! function_exists('posix_getgrgid') )
|
||||
if( ! function_exists('posix_getgrgid') )
|
||||
return $gid;
|
||||
$grouparray = posix_getgrgid($gid);
|
||||
return $grouparray['name'];
|
||||
}
|
||||
|
||||
function copy($source, $destination, $overwrite = false) {
|
||||
if ( ! $overwrite && $this->exists($destination) )
|
||||
if( ! $overwrite && $this->exists($destination) )
|
||||
return false;
|
||||
return copy($source, $destination);
|
||||
}
|
||||
|
||||
function move($source, $destination, $overwrite = false) {
|
||||
//Possible to use rename()?
|
||||
if ( $this->copy($source, $destination, $overwrite) && $this->exists($destination) ) {
|
||||
if( $this->copy($source, $destination, $overwrite) && $this->exists($destination) ){
|
||||
$this->delete($source);
|
||||
return true;
|
||||
} else {
|
||||
@@ -216,13 +133,11 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function delete($file, $recursive = false) {
|
||||
if ( empty($file) ) //Some filesystems report this as /, which can cause non-expected recursive deletion of all files in the filesystem.
|
||||
return false;
|
||||
$file = str_replace('\\', '/', $file); //for win32, occasional problems deleteing files otherwise
|
||||
|
||||
if ( $this->is_file($file) )
|
||||
if( $this->is_file($file) )
|
||||
return @unlink($file);
|
||||
if ( ! $recursive && $this->is_dir($file) )
|
||||
if( ! $recursive && $this->is_dir($file) )
|
||||
return @rmdir($file);
|
||||
|
||||
//At this point its a folder, and we're in recursive mode
|
||||
@@ -230,13 +145,13 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
$filelist = $this->dirlist($file, true);
|
||||
|
||||
$retval = true;
|
||||
if ( is_array($filelist) ) //false if no files, So check first.
|
||||
foreach ($filelist as $filename => $fileinfo)
|
||||
if ( ! $this->delete($file . $filename, $recursive) )
|
||||
if( is_array($filelist) ) //false if no files, So check first.
|
||||
foreach($filelist as $filename => $fileinfo)
|
||||
if( ! $this->delete($file . $filename, $recursive) )
|
||||
$retval = false;
|
||||
|
||||
if ( file_exists($file) && ! @rmdir($file) )
|
||||
$retval = false;
|
||||
if( ! @rmdir($file) )
|
||||
return false;
|
||||
return $retval;
|
||||
}
|
||||
|
||||
@@ -271,35 +186,34 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
return @filesize($file);
|
||||
}
|
||||
|
||||
function touch($file, $time = 0, $atime = 0) {
|
||||
if ($time == 0)
|
||||
function touch($file, $time = 0, $atime = 0){
|
||||
if($time == 0)
|
||||
$time = time();
|
||||
if ($atime == 0)
|
||||
if($atime == 0)
|
||||
$atime = time();
|
||||
return @touch($file, $time, $atime);
|
||||
}
|
||||
|
||||
function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
|
||||
if ( ! $chmod )
|
||||
$chmod = FS_CHMOD_DIR;
|
||||
function mkdir($path, $chmod = false, $chown = false, $chgrp = false){
|
||||
if( ! $chmod)
|
||||
$chmod = $this->permission;
|
||||
|
||||
if ( ! @mkdir($path) )
|
||||
if( ! @mkdir($path, $chmod) )
|
||||
return false;
|
||||
$this->chmod($path, $chmod);
|
||||
if ( $chown )
|
||||
if( $chown )
|
||||
$this->chown($path, $chown);
|
||||
if ( $chgrp )
|
||||
if( $chgrp )
|
||||
$this->chgrp($path, $chgrp);
|
||||
return true;
|
||||
}
|
||||
|
||||
function rmdir($path, $recursive = false) {
|
||||
//Currently unused and untested, Use delete() instead.
|
||||
if ( ! $recursive )
|
||||
if( ! $recursive )
|
||||
return @rmdir($path);
|
||||
//recursive:
|
||||
$filelist = $this->dirlist($path);
|
||||
foreach ($filelist as $filename => $det) {
|
||||
foreach($filelist as $filename => $det) {
|
||||
if ( '/' == substr($filename, -1, 1) )
|
||||
$this->rmdir($path . '/' . $filename, $recursive);
|
||||
@rmdir($filename);
|
||||
@@ -307,34 +221,29 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
return @rmdir($path);
|
||||
}
|
||||
|
||||
function dirlist($path, $include_hidden = true, $recursive = false) {
|
||||
if ( $this->is_file($path) ) {
|
||||
$limit_file = basename($path);
|
||||
function dirlist($path, $incdot = false, $recursive = false) {
|
||||
if( $this->is_file($path) ) {
|
||||
$limitFile = basename($path);
|
||||
$path = dirname($path);
|
||||
} else {
|
||||
$limit_file = false;
|
||||
$limitFile = false;
|
||||
}
|
||||
|
||||
if ( ! $this->is_dir($path) )
|
||||
return false;
|
||||
|
||||
$dir = @dir($path);
|
||||
if ( ! $dir )
|
||||
if( ! $this->is_dir($path) )
|
||||
return false;
|
||||
|
||||
$ret = array();
|
||||
|
||||
$dir = @dir($path);
|
||||
if ( ! $dir )
|
||||
return false;
|
||||
while (false !== ($entry = $dir->read()) ) {
|
||||
$struc = array();
|
||||
$struc['name'] = $entry;
|
||||
|
||||
if ( '.' == $struc['name'] || '..' == $struc['name'] )
|
||||
if( '.' == $struc['name'] || '..' == $struc['name'] )
|
||||
continue; //Do not care about these folders.
|
||||
if( '.' == $struc['name'][0] && !$incdot)
|
||||
continue;
|
||||
|
||||
if ( ! $include_hidden && '.' == $struc['name'][0] )
|
||||
continue;
|
||||
|
||||
if ( $limit_file && $struc['name'] != $limit_file)
|
||||
if( $limitFile && $struc['name'] != $limitFile)
|
||||
continue;
|
||||
|
||||
$struc['perms'] = $this->gethchmod($path.'/'.$entry);
|
||||
@@ -349,8 +258,8 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
||||
$struc['type'] = $this->is_dir($path.'/'.$entry) ? 'd' : 'f';
|
||||
|
||||
if ( 'd' == $struc['type'] ) {
|
||||
if ( $recursive )
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
|
||||
if( $recursive )
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
|
||||
else
|
||||
$struc['files'] = array();
|
||||
}
|
||||
|
||||
@@ -16,9 +16,12 @@
|
||||
*/
|
||||
class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
var $link;
|
||||
var $errors = null;
|
||||
var $timeout = 5;
|
||||
var $errors = array();
|
||||
var $options = array();
|
||||
|
||||
var $permission = null;
|
||||
|
||||
function WP_Filesystem_FTPext($opt='') {
|
||||
$this->method = 'ftpext';
|
||||
$this->errors = new WP_Error();
|
||||
@@ -30,11 +33,6 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
// Set defaults:
|
||||
//This Class uses the timeout on a per-connection basis, Others use it on a per-action basis.
|
||||
|
||||
if ( ! defined('FS_TIMEOUT') )
|
||||
define('FS_TIMEOUT', 240);
|
||||
|
||||
if ( empty($opt['port']) )
|
||||
$this->options['port'] = 21;
|
||||
else
|
||||
@@ -49,26 +47,28 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
$this->wp_base = $opt['base'];
|
||||
|
||||
// Check if the options provided are OK.
|
||||
if ( empty($opt['username']) )
|
||||
if ( empty ($opt['username']) )
|
||||
$this->errors->add('empty_username', __('FTP username is required'));
|
||||
else
|
||||
$this->options['username'] = $opt['username'];
|
||||
|
||||
if ( empty($opt['password']) )
|
||||
if ( empty ($opt['password']) )
|
||||
$this->errors->add('empty_password', __('FTP password is required'));
|
||||
else
|
||||
$this->options['password'] = $opt['password'];
|
||||
|
||||
$this->options['ssl'] = false;
|
||||
if ( isset($opt['connection_type']) && 'ftps' == $opt['connection_type'] )
|
||||
$this->options['ssl'] = true;
|
||||
if ( isset($opt['ssl']) )
|
||||
$this->options['ssl'] = ( !empty($opt['ssl']) );
|
||||
elseif ( isset( $opt['connection_type']) )
|
||||
$this->options['ssl'] = ( 'ftps' == $opt['connection_type'] );
|
||||
}
|
||||
|
||||
function connect() {
|
||||
if ( isset($this->options['ssl']) && $this->options['ssl'] && function_exists('ftp_ssl_connect') )
|
||||
$this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT);
|
||||
if ( $this->options['ssl'] && function_exists('ftp_ssl_connect') )
|
||||
$this->link = @ftp_ssl_connect($this->options['hostname'], $this->options['port'],$this->timeout);
|
||||
else
|
||||
$this->link = @ftp_connect($this->options['hostname'], $this->options['port'], FS_CONNECT_TIMEOUT);
|
||||
$this->link = @ftp_connect($this->options['hostname'], $this->options['port'],$this->timeout);
|
||||
|
||||
if ( ! $this->link ) {
|
||||
$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
|
||||
@@ -82,21 +82,23 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
|
||||
//Set the Connection to use Passive FTP
|
||||
@ftp_pasv( $this->link, true );
|
||||
if ( @ftp_get_option($this->link, FTP_TIMEOUT_SEC) < FS_TIMEOUT )
|
||||
@ftp_set_option($this->link, FTP_TIMEOUT_SEC, FS_TIMEOUT);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function get_contents($file, $type = '', $resumepos = 0 ) {
|
||||
if ( empty($type) )
|
||||
function setDefaultPermissions($perm) {
|
||||
$this->permission = $perm;
|
||||
}
|
||||
|
||||
function get_contents($file, $type = '', $resumepos = 0 ){
|
||||
if( empty($type) )
|
||||
$type = FTP_BINARY;
|
||||
|
||||
$temp = tmpfile();
|
||||
if ( ! $temp )
|
||||
return false;
|
||||
|
||||
if ( ! @ftp_fget($this->link, $temp, $file, $type, $resumepos) )
|
||||
if( ! @ftp_fget($this->link, $temp, $file, $type, $resumepos) )
|
||||
return false;
|
||||
|
||||
fseek($temp, 0); //Skip back to the start of the file being written to
|
||||
@@ -112,7 +114,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
return explode("\n", $this->get_contents($file));
|
||||
}
|
||||
function put_contents($file, $contents, $type = '' ) {
|
||||
if ( empty($type) )
|
||||
if( empty($type) )
|
||||
$type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII;
|
||||
|
||||
$temp = tmpfile();
|
||||
@@ -129,29 +131,23 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
}
|
||||
function cwd() {
|
||||
$cwd = @ftp_pwd($this->link);
|
||||
if ( $cwd )
|
||||
if( $cwd )
|
||||
$cwd = trailingslashit($cwd);
|
||||
return $cwd;
|
||||
}
|
||||
function chdir($dir) {
|
||||
return @ftp_chdir($this->link, $dir);
|
||||
return @ftp_chdir($dir);
|
||||
}
|
||||
function chgrp($file, $group, $recursive = false ) {
|
||||
return false;
|
||||
}
|
||||
function chmod($file, $mode = false, $recursive = false) {
|
||||
if ( ! $this->exists($file) && ! $this->is_dir($file) )
|
||||
if( ! $mode )
|
||||
$mode = $this->permission;
|
||||
if( ! $mode )
|
||||
return false;
|
||||
if ( ! $this->exists($file) )
|
||||
return false;
|
||||
|
||||
if ( ! $mode ) {
|
||||
if ( $this->is_file($file) )
|
||||
$mode = FS_CHMOD_FILE;
|
||||
elseif ( $this->is_dir($file) )
|
||||
$mode = FS_CHMOD_DIR;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $recursive || ! $this->is_dir($file) ) {
|
||||
if ( ! function_exists('ftp_chmod') )
|
||||
return @ftp_site($this->link, sprintf('CHMOD %o %s', $mode, $file));
|
||||
@@ -159,7 +155,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
}
|
||||
//Is a directory, and we want recursive
|
||||
$filelist = $this->dirlist($file);
|
||||
foreach ( $filelist as $filename ) {
|
||||
foreach($filelist as $filename){
|
||||
$this->chmod($file . '/' . $filename, $mode, $recursive);
|
||||
}
|
||||
return true;
|
||||
@@ -180,10 +176,10 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
return $dir[$file]['group'];
|
||||
}
|
||||
function copy($source, $destination, $overwrite = false ) {
|
||||
if ( ! $overwrite && $this->exists($destination) )
|
||||
if( ! $overwrite && $this->exists($destination) )
|
||||
return false;
|
||||
$content = $this->get_contents($source);
|
||||
if ( false === $content)
|
||||
if( false === $content)
|
||||
return false;
|
||||
return $this->put_contents($destination, $content);
|
||||
}
|
||||
@@ -191,39 +187,38 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
return ftp_rename($this->link, $source, $destination);
|
||||
}
|
||||
|
||||
function delete($file, $recursive = false ) {
|
||||
if ( empty($file) )
|
||||
return false;
|
||||
function delete($file,$recursive=false) {
|
||||
if ( $this->is_file($file) )
|
||||
return @ftp_delete($this->link, $file);
|
||||
if ( !$recursive )
|
||||
return @ftp_rmdir($this->link, $file);
|
||||
|
||||
$filelist = $this->dirlist( trailingslashit($file) );
|
||||
if ( !empty($filelist) )
|
||||
foreach ( $filelist as $delete_file )
|
||||
$this->delete( trailingslashit($file) . $delete_file['name'], $recursive);
|
||||
$filelist = $this->dirlist($file);
|
||||
foreach ((array) $filelist as $filename => $fileinfo) {
|
||||
$this->delete($file . '/' . $filename, $recursive);
|
||||
}
|
||||
return @ftp_rmdir($this->link, $file);
|
||||
}
|
||||
|
||||
function exists($file) {
|
||||
$list = @ftp_nlist($this->link, $file);
|
||||
return !empty($list); //empty list = no file, so invert.
|
||||
$list = ftp_rawlist($this->link, $file, false);
|
||||
if( ! $list )
|
||||
return false;
|
||||
return count($list) == 1 ? true : false;
|
||||
}
|
||||
function is_file($file) {
|
||||
return $this->exists($file) && !$this->is_dir($file);
|
||||
return $this->is_dir($file) ? false : true;
|
||||
}
|
||||
function is_dir($path) {
|
||||
$cwd = $this->cwd();
|
||||
$result = @ftp_chdir($this->link, trailingslashit($path) );
|
||||
if ( $result && $path == $this->cwd() || $this->cwd() != $cwd ) {
|
||||
$result = @ftp_chdir($this->link, $path);
|
||||
if( $result && $path == $this->cwd() || $this->cwd() != $cwd ) {
|
||||
@ftp_chdir($this->link, $cwd);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
function is_readable($file) {
|
||||
//Get dir list, Check if the file is readable by the current user??
|
||||
//Get dir list, Check if the file is writable by the current user??
|
||||
return true;
|
||||
}
|
||||
function is_writable($file) {
|
||||
@@ -243,29 +238,31 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
return false;
|
||||
}
|
||||
function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
|
||||
if ( !ftp_mkdir($this->link, $path) )
|
||||
if( !@ftp_mkdir($this->link, $path) )
|
||||
return false;
|
||||
if ( ! $chmod )
|
||||
$chmod = FS_CHMOD_DIR;
|
||||
$this->chmod($path, $chmod);
|
||||
if ( $chown )
|
||||
if( $chmod )
|
||||
$this->chmod($path, $chmod);
|
||||
if( $chown )
|
||||
$this->chown($path, $chown);
|
||||
if ( $chgrp )
|
||||
if( $chgrp )
|
||||
$this->chgrp($path, $chgrp);
|
||||
return true;
|
||||
}
|
||||
function rmdir($path, $recursive = false) {
|
||||
return $this->delete($path, $recursive);
|
||||
if( ! $recursive )
|
||||
return @ftp_rmdir($this->link, $path);
|
||||
|
||||
//TODO: Recursive Directory delete, Have to delete files from the folder first.
|
||||
//$dir = $this->dirlist($path);
|
||||
//foreach($dir as $file)
|
||||
|
||||
}
|
||||
|
||||
function parselisting($line) {
|
||||
static $is_windows;
|
||||
if ( is_null($is_windows) )
|
||||
$is_windows = strpos( strtolower(ftp_systype($this->link)), 'win') !== false;
|
||||
|
||||
if ( $is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/", $line, $lucifer) ) {
|
||||
$is_windows = ($this->OS_remote == FTP_OS_Windows);
|
||||
if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/", $line, $lucifer)) {
|
||||
$b = array();
|
||||
if ( $lucifer[3] < 70 ) { $lucifer[3] +=2000; } else { $lucifer[3] += 1900; } // 4digit year fix
|
||||
if ($lucifer[3]<70) { $lucifer[3] +=2000; } else { $lucifer[3]+=1900; } // 4digit year fix
|
||||
$b['isdir'] = ($lucifer[7]=="<DIR>");
|
||||
if ( $b['isdir'] )
|
||||
$b['type'] = 'd';
|
||||
@@ -323,12 +320,12 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
return $b;
|
||||
}
|
||||
|
||||
function dirlist($path = '.', $include_hidden = true, $recursive = false) {
|
||||
if ( $this->is_file($path) ) {
|
||||
$limit_file = basename($path);
|
||||
function dirlist($path = '.', $incdot = false, $recursive = false) {
|
||||
if( $this->is_file($path) ) {
|
||||
$limitFile = basename($path);
|
||||
$path = dirname($path) . '/';
|
||||
} else {
|
||||
$limit_file = false;
|
||||
$limitFile = false;
|
||||
}
|
||||
|
||||
$list = @ftp_rawlist($this->link, '-a ' . $path, false);
|
||||
@@ -342,13 +339,7 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
if ( empty($entry) )
|
||||
continue;
|
||||
|
||||
if ( '.' == $entry['name'] || '..' == $entry['name'] )
|
||||
continue;
|
||||
|
||||
if ( ! $include_hidden && '.' == $entry['name'][0] )
|
||||
continue;
|
||||
|
||||
if ( $limit_file && $entry['name'] != $limit_file)
|
||||
if ( '.' == $entry["name"] || '..' == $entry["name"] )
|
||||
continue;
|
||||
|
||||
$dirlist[ $entry['name'] ] = $entry;
|
||||
@@ -356,23 +347,34 @@ class WP_Filesystem_FTPext extends WP_Filesystem_Base {
|
||||
|
||||
if ( ! $dirlist )
|
||||
return false;
|
||||
if ( empty($dirlist) )
|
||||
return array();
|
||||
|
||||
$ret = array();
|
||||
foreach ( (array)$dirlist as $struc ) {
|
||||
if ( 'd' == $struc['type'] ) {
|
||||
if ( $recursive )
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
|
||||
else
|
||||
$struc['files'] = array();
|
||||
}
|
||||
foreach ( $dirlist as $struc ) {
|
||||
|
||||
$ret[ $struc['name'] ] = $struc;
|
||||
if ( 'd' == $struc['type'] ) {
|
||||
$struc['files'] = array();
|
||||
|
||||
if ( $incdot ){
|
||||
//We're including the doted starts
|
||||
if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
|
||||
if ($recursive)
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
|
||||
}
|
||||
} else { //No dots
|
||||
if ($recursive)
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
|
||||
}
|
||||
}
|
||||
//File
|
||||
$ret[$struc['name']] = $struc;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function __destruct() {
|
||||
if ( $this->link )
|
||||
function __destruct(){
|
||||
if( $this->link )
|
||||
ftp_close($this->link);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,15 +16,18 @@
|
||||
*/
|
||||
class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
var $ftp = false;
|
||||
var $errors = null;
|
||||
var $timeout = 5;
|
||||
var $errors;
|
||||
var $options = array();
|
||||
|
||||
var $permission = null;
|
||||
|
||||
function WP_Filesystem_ftpsockets($opt = '') {
|
||||
$this->method = 'ftpsockets';
|
||||
$this->errors = new WP_Error();
|
||||
|
||||
//Check if possible to use ftp functions.
|
||||
if ( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' )
|
||||
if( ! @include_once ABSPATH . 'wp-admin/includes/class-ftp.php' )
|
||||
return false;
|
||||
$this->ftp = new ftp();
|
||||
|
||||
@@ -58,13 +61,12 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
if ( ! $this->ftp )
|
||||
return false;
|
||||
|
||||
$this->ftp->setTimeout(FS_CONNECT_TIMEOUT);
|
||||
//$this->ftp->Verbose = true;
|
||||
|
||||
if ( ! $this->ftp->SetServer($this->options['hostname'], $this->options['port']) ) {
|
||||
$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $this->ftp->connect() ) {
|
||||
$this->errors->add('connect', sprintf(__('Failed to connect to FTP Server %1$s:%2$s'), $this->options['hostname'], $this->options['port']));
|
||||
return false;
|
||||
@@ -77,15 +79,18 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
|
||||
$this->ftp->SetType(FTP_AUTOASCII);
|
||||
$this->ftp->Passive(true);
|
||||
$this->ftp->setTimeout(FS_TIMEOUT);
|
||||
return true;
|
||||
}
|
||||
|
||||
function setDefaultPermissions($perm) {
|
||||
$this->permission = $perm;
|
||||
}
|
||||
|
||||
function get_contents($file, $type = '', $resumepos = 0) {
|
||||
if ( ! $this->exists($file) )
|
||||
if( ! $this->exists($file) )
|
||||
return false;
|
||||
|
||||
if ( empty($type) )
|
||||
if( empty($type) )
|
||||
$type = FTP_AUTOASCII;
|
||||
$this->ftp->SetType($type);
|
||||
|
||||
@@ -116,13 +121,13 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function put_contents($file, $contents, $type = '' ) {
|
||||
if ( empty($type) )
|
||||
if( empty($type) )
|
||||
$type = $this->is_binary($contents) ? FTP_BINARY : FTP_ASCII;
|
||||
|
||||
$this->ftp->SetType($type);
|
||||
|
||||
$temp = wp_tempnam( $file );
|
||||
if ( ! $temphandle = fopen($temp, 'w+') ) {
|
||||
if ( ! $temphandle = fopen($temp, 'w+') ){
|
||||
unlink($temp);
|
||||
return false;
|
||||
}
|
||||
@@ -139,7 +144,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
|
||||
function cwd() {
|
||||
$cwd = $this->ftp->pwd();
|
||||
if ( $cwd )
|
||||
if( $cwd )
|
||||
$cwd = trailingslashit($cwd);
|
||||
return $cwd;
|
||||
}
|
||||
@@ -153,25 +158,20 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function chmod($file, $mode = false, $recursive = false ) {
|
||||
|
||||
if ( ! $mode ) {
|
||||
if ( $this->is_file($file) )
|
||||
$mode = FS_CHMOD_FILE;
|
||||
elseif ( $this->is_dir($file) )
|
||||
$mode = FS_CHMOD_DIR;
|
||||
else
|
||||
return false;
|
||||
if( ! $mode )
|
||||
$mode = $this->permission;
|
||||
if( ! $mode )
|
||||
return false;
|
||||
//if( ! $this->exists($file) )
|
||||
// return false;
|
||||
if( ! $recursive || ! $this->is_dir($file) ) {
|
||||
return $this->ftp->chmod($file,$mode);
|
||||
}
|
||||
|
||||
if ( ! $recursive || ! $this->is_dir($file) ) {
|
||||
return $this->ftp->chmod($file, $mode);
|
||||
}
|
||||
|
||||
//Is a directory, and we want recursive
|
||||
$filelist = $this->dirlist($file);
|
||||
foreach ( $filelist as $filename )
|
||||
foreach($filelist as $filename){
|
||||
$this->chmod($file . '/' . $filename, $mode, $recursive);
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function copy($source, $destination, $overwrite = false ) {
|
||||
if ( ! $overwrite && $this->exists($destination) )
|
||||
if( ! $overwrite && $this->exists($destination) )
|
||||
return false;
|
||||
|
||||
$content = $this->get_contents($source);
|
||||
@@ -210,8 +210,6 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function delete($file, $recursive = false ) {
|
||||
if ( empty($file) )
|
||||
return false;
|
||||
if ( $this->is_file($file) )
|
||||
return $this->ftp->delete($file);
|
||||
if ( !$recursive )
|
||||
@@ -264,57 +262,57 @@ class WP_Filesystem_ftpsockets extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function mkdir($path, $chmod = false, $chown = false, $chgrp = false ) {
|
||||
if ( ! $this->ftp->mkdir($path) )
|
||||
if( ! $this->ftp->mkdir($path) )
|
||||
return false;
|
||||
if ( ! $chmod )
|
||||
$chmod = FS_CHMOD_DIR;
|
||||
$this->chmod($path, $chmod);
|
||||
if ( $chown )
|
||||
if( $chmod )
|
||||
$this->chmod($path, $chmod);
|
||||
if( $chown )
|
||||
$this->chown($path, $chown);
|
||||
if ( $chgrp )
|
||||
if( $chgrp )
|
||||
$this->chgrp($path, $chgrp);
|
||||
return true;
|
||||
}
|
||||
|
||||
function rmdir($path, $recursive = false ) {
|
||||
if ( ! $recursive )
|
||||
if( ! $recursive )
|
||||
return $this->ftp->rmdir($path);
|
||||
|
||||
return $this->ftp->mdel($path);
|
||||
}
|
||||
|
||||
function dirlist($path = '.', $include_hidden = true, $recursive = false ) {
|
||||
if ( $this->is_file($path) ) {
|
||||
$limit_file = basename($path);
|
||||
function dirlist($path = '.', $incdot = false, $recursive = false ) {
|
||||
if( $this->is_file($path) ) {
|
||||
$limitFile = basename($path);
|
||||
$path = dirname($path) . '/';
|
||||
} else {
|
||||
$limit_file = false;
|
||||
$limitFile = false;
|
||||
}
|
||||
|
||||
$list = $this->ftp->dirlist($path);
|
||||
if ( ! $list )
|
||||
if( ! $list )
|
||||
return false;
|
||||
if( empty($list) )
|
||||
return array();
|
||||
|
||||
$ret = array();
|
||||
foreach ( $list as $struc ) {
|
||||
|
||||
if ( '.' == $struc['name'] || '..' == $struc['name'] )
|
||||
continue;
|
||||
|
||||
if ( ! $include_hidden && '.' == $struc['name'][0] )
|
||||
continue;
|
||||
|
||||
if ( $limit_file && $struc['name'] != $limit_file )
|
||||
continue;
|
||||
|
||||
if ( 'd' == $struc['type'] ) {
|
||||
if ( $recursive )
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
|
||||
else
|
||||
$struc['files'] = array();
|
||||
}
|
||||
$struc['files'] = array();
|
||||
|
||||
$ret[ $struc['name'] ] = $struc;
|
||||
if ( $incdot ){
|
||||
//We're including the doted starts
|
||||
if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
|
||||
if ($recursive)
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
|
||||
}
|
||||
} else { //No dots
|
||||
if ($recursive)
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
|
||||
}
|
||||
}
|
||||
//File
|
||||
$ret[$struc['name']] = $struc;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*
|
||||
* @contrib http://kevin.vanzonneveld.net/techblog/article/make_ssh_connections_with_php/ - Installation Notes
|
||||
*
|
||||
* Complie libssh2 (Note: Only 0.14 is officaly working with PHP 5.2.6+ right now, But many users have found the latest versions work)
|
||||
* Complie libssh2 (Note: Only 0.14 is officaly working with PHP 5.2.6+ right now.)
|
||||
*
|
||||
* cd /usr/src
|
||||
* wget http://surfnet.dl.sourceforge.net/sourceforge/libssh2/libssh2-0.14.tar.gz
|
||||
@@ -22,7 +22,7 @@
|
||||
* ./configure
|
||||
* make all install
|
||||
*
|
||||
* Note: Do not leave the directory yet!
|
||||
* Note: No not leave the directory yet!
|
||||
*
|
||||
* Enter: pecl install -f ssh2
|
||||
*
|
||||
@@ -33,7 +33,6 @@
|
||||
* Restart Apache!
|
||||
* Check phpinfo() streams to confirm that: ssh2.shell, ssh2.exec, ssh2.tunnel, ssh2.scp, ssh2.sftp exist.
|
||||
*
|
||||
* Note: as of WordPress 2.8, This utilises the PHP5+ function 'stream_get_contents'
|
||||
*
|
||||
* @since 2.7
|
||||
* @package WordPress
|
||||
@@ -42,12 +41,24 @@
|
||||
*/
|
||||
class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
|
||||
var $link = false;
|
||||
var $sftp_link = false;
|
||||
var $debugtest = false; // set this to true only if your a debuging your connection
|
||||
|
||||
var $link = null;
|
||||
var $sftp_link = null;
|
||||
var $keys = false;
|
||||
/*
|
||||
* This is the timeout value for ssh results to comeback.
|
||||
* Slower servers might need this incressed, but this number otherwise should not change.
|
||||
*
|
||||
* @parm $timeout int
|
||||
*
|
||||
*/
|
||||
var $timeout = 15;
|
||||
var $errors = array();
|
||||
var $options = array();
|
||||
|
||||
var $permission = 0644;
|
||||
|
||||
function WP_Filesystem_SSH2($opt='') {
|
||||
$this->method = 'ssh2';
|
||||
$this->errors = new WP_Error();
|
||||
@@ -57,10 +68,6 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
$this->errors->add('no_ssh2_ext', __('The ssh2 PHP extension is not available'));
|
||||
return false;
|
||||
}
|
||||
if ( !function_exists('stream_get_contents') ) {
|
||||
$this->errors->add('ssh2_php_requirement', __('The ssh2 PHP extension is available, however, we require the PHP5 function <code>stream_get_contents()</code>'));
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set defaults:
|
||||
if ( empty($opt['port']) )
|
||||
@@ -77,22 +84,23 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
$this->wp_base = $opt['base'];
|
||||
|
||||
// Check if the options provided are OK.
|
||||
if ( !empty ($opt['public_key']) && !empty ($opt['private_key']) ) {
|
||||
if ( empty ($opt['username']) )
|
||||
$this->errors->add('empty_username', __('SSH2 username is required'));
|
||||
else
|
||||
$this->options['username'] = $opt['username'];
|
||||
|
||||
if ( ( !empty ($opt['public_key']) ) && ( !empty ($opt['private_key']) ) ) {
|
||||
$this->options['public_key'] = $opt['public_key'];
|
||||
$this->options['private_key'] = $opt['private_key'];
|
||||
|
||||
$this->options['hostkey'] = array('hostkey' => 'ssh-rsa');
|
||||
$this->options['hostkey'] = array("hostkey" => "ssh-rsa");
|
||||
|
||||
$this->keys = true;
|
||||
} elseif ( empty ($opt['username']) ) {
|
||||
$this->errors->add('empty_username', __('SSH2 username is required'));
|
||||
}
|
||||
|
||||
if ( !empty($opt['username']) )
|
||||
$this->options['username'] = $opt['username'];
|
||||
|
||||
if ( empty ($opt['password']) ) {
|
||||
if ( !$this->keys ) //password can be blank if we are using keys
|
||||
if ( !$this->keys ) // password can be blank if we are using keys
|
||||
$this->errors->add('empty_password', __('SSH2 password is required'));
|
||||
} else {
|
||||
$this->options['password'] = $opt['password'];
|
||||
@@ -101,6 +109,8 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function connect() {
|
||||
$this->debug("connect();");
|
||||
|
||||
if ( ! $this->keys ) {
|
||||
$this->link = @ssh2_connect($this->options['hostname'], $this->options['port']);
|
||||
} else {
|
||||
@@ -119,7 +129,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
}
|
||||
} else {
|
||||
if ( ! @ssh2_auth_pubkey_file($this->link, $this->options['username'], $this->options['public_key'], $this->options['private_key'], $this->options['password'] ) ) {
|
||||
$this->errors->add('auth', sprintf(__('Public and Private keys incorrect for %s'), $this->options['username']));
|
||||
$this->errors->add('auth', sprintf(__('Public and Private keys incorrent for %s'), $this->options['username']));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -129,112 +139,148 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
return true;
|
||||
}
|
||||
|
||||
function run_command( $command, $returnbool = false) {
|
||||
|
||||
if ( ! $this->link )
|
||||
return false;
|
||||
|
||||
if ( ! ($stream = ssh2_exec($this->link, $command)) ) {
|
||||
function run_command($link, $command, $returnbool = false) {
|
||||
$this->debug("run_command();");
|
||||
if(!($stream = @ssh2_exec( $link, $command . "; echo \"__COMMAND_FINISHED__\";"))) {
|
||||
$this->errors->add('command', sprintf(__('Unable to perform command: %s'), $command));
|
||||
} else {
|
||||
stream_set_blocking( $stream, true );
|
||||
stream_set_timeout( $stream, FS_TIMEOUT );
|
||||
$data = stream_get_contents( $stream );
|
||||
fclose( $stream );
|
||||
|
||||
if ( $returnbool )
|
||||
return ( $data === false ) ? false : '' != trim($data);
|
||||
else
|
||||
$time_start = time();
|
||||
$data = null;
|
||||
while( true ) {
|
||||
if (strpos($data,"__COMMAND_FINISHED__") !== false){
|
||||
break; // the command has finshed!
|
||||
}
|
||||
if( (time()-$time_start) > $this->timeout ){
|
||||
$this->errors->add('command', sprintf(__('Connection to the server has timeout after %s seconds.'), $this->timeout));
|
||||
unset($this->link);
|
||||
unset($this->sftp_link); // close connections
|
||||
return false;
|
||||
}
|
||||
while( $buf = fread( $stream, strlen($stream) ) )
|
||||
$data .= $buf;
|
||||
}
|
||||
fclose($stream);
|
||||
$data = trim(str_replace("__COMMAND_FINISHED__", "", $data));
|
||||
if (($returnbool) && ( (int) $data )) {
|
||||
return true;
|
||||
} elseif (($returnbool) && (! (int) $data )) {
|
||||
return false;
|
||||
} else {
|
||||
return $data;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function debug($text)
|
||||
{
|
||||
if ($this->debugtest)
|
||||
{
|
||||
echo "<br/>" . $text . "<br/>";
|
||||
}
|
||||
}
|
||||
|
||||
function setDefaultPermissions($perm) {
|
||||
$this->debug("setDefaultPermissions();");
|
||||
if ( $perm )
|
||||
$this->permission = $perm;
|
||||
}
|
||||
|
||||
function get_contents($file, $type = '', $resumepos = 0 ) {
|
||||
$file = ltrim($file, '/');
|
||||
return file_get_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file);
|
||||
$this->debug("get_contents();");
|
||||
$tempfile = wp_tempnam( $file );
|
||||
if ( ! $tempfile )
|
||||
return false;
|
||||
if( ! ssh2_scp_recv($this->link, $file, $tempfile) )
|
||||
return false;
|
||||
$contents = file_get_contents($tempfile);
|
||||
unlink($tempfile);
|
||||
return $contents;
|
||||
}
|
||||
|
||||
function get_contents_array($file) {
|
||||
$file = ltrim($file, '/');
|
||||
return file('ssh2.sftp://' . $this->sftp_link . '/' . $file);
|
||||
$this->debug("get_contents_array();");
|
||||
return explode("\n", $this->get_contents($file));
|
||||
}
|
||||
|
||||
function put_contents($file, $contents, $type = '' ) {
|
||||
$file = ltrim($file, '/');
|
||||
return false !== file_put_contents('ssh2.sftp://' . $this->sftp_link . '/' . $file, $contents);
|
||||
$this->debug("put_contents($file);");
|
||||
$tempfile = wp_tempnam( $file );
|
||||
$temp = fopen($tempfile, 'w');
|
||||
if ( ! $temp )
|
||||
return false;
|
||||
fwrite($temp, $contents);
|
||||
fclose($temp);
|
||||
$ret = ssh2_scp_send($this->link, $tempfile, $file, $this->permission);
|
||||
unlink($tempfile);
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function cwd() {
|
||||
$cwd = $this->run_command('pwd');
|
||||
$this->debug("cwd();");
|
||||
$cwd = $this->run_command($this->link, 'pwd');
|
||||
if( $cwd )
|
||||
$cwd = trailingslashit($cwd);
|
||||
return $cwd;
|
||||
}
|
||||
|
||||
function chdir($dir) {
|
||||
return $this->run_command('cd ' . $dir, true);
|
||||
$this->debug("chdir();");
|
||||
return $this->run_command($this->link, 'cd ' . $dir, true);
|
||||
}
|
||||
|
||||
function chgrp($file, $group, $recursive = false ) {
|
||||
$this->debug("chgrp();");
|
||||
if ( ! $this->exists($file) )
|
||||
return false;
|
||||
if ( ! $recursive || ! $this->is_dir($file) )
|
||||
return $this->run_command(sprintf('chgrp %o %s', $mode, escapeshellarg($file)), true);
|
||||
return $this->run_command(sprintf('chgrp -R %o %s', $mode, escapeshellarg($file)), true);
|
||||
return $this->run_command($this->link, sprintf('chgrp %o %s', $mode, $file), true);
|
||||
return $this->run_command($this->link, sprintf('chgrp -R %o %s', $mode, $file), true);
|
||||
}
|
||||
|
||||
function chmod($file, $mode = false, $recursive = false) {
|
||||
$this->debug("chmod();");
|
||||
if( ! $mode )
|
||||
$mode = $this->permission;
|
||||
if( ! $mode )
|
||||
return false;
|
||||
if ( ! $this->exists($file) )
|
||||
return false;
|
||||
|
||||
if ( ! $mode ) {
|
||||
if ( $this->is_file($file) )
|
||||
$mode = FS_CHMOD_FILE;
|
||||
elseif ( $this->is_dir($file) )
|
||||
$mode = FS_CHMOD_DIR;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( ! $recursive || ! $this->is_dir($file) )
|
||||
return $this->run_command(sprintf('chmod %o %s', $mode, escapeshellarg($file)), true);
|
||||
return $this->run_command(sprintf('chmod -R %o %s', $mode, escapeshellarg($file)), true);
|
||||
return $this->run_command($this->link, sprintf('chmod %o %s', $mode, $file), true);
|
||||
return $this->run_command($this->link, sprintf('chmod -R %o %s', $mode, $file), true);
|
||||
}
|
||||
|
||||
function chown($file, $owner, $recursive = false ) {
|
||||
$this->debug("chown();");
|
||||
if ( ! $this->exists($file) )
|
||||
return false;
|
||||
if ( ! $recursive || ! $this->is_dir($file) )
|
||||
return $this->run_command(sprintf('chown %o %s', $mode, escapeshellarg($file)), true);
|
||||
return $this->run_command(sprintf('chown -R %o %s', $mode, escapeshellarg($file)), true);
|
||||
return $this->run_command($this->link, sprintf('chown %o %s', $mode, $file), true);
|
||||
return $this->run_command($this->link, sprintf('chown -R %o %s', $mode, $file), true);
|
||||
}
|
||||
|
||||
function owner($file) {
|
||||
$owneruid = @fileowner('ssh2.sftp://' . $this->sftp_link . '/' . ltrim($file, '/'));
|
||||
if ( ! $owneruid )
|
||||
return false;
|
||||
if ( ! function_exists('posix_getpwuid') )
|
||||
return $owneruid;
|
||||
$ownerarray = posix_getpwuid($owneruid);
|
||||
return $ownerarray['name'];
|
||||
$this->debug("owner();");
|
||||
$dir = $this->dirlist($file);
|
||||
return $dir[$file]['owner'];
|
||||
}
|
||||
|
||||
function getchmod($file) {
|
||||
return substr(decoct(@fileperms( 'ssh2.sftp://' . $this->sftp_link . '/' . ltrim($file, '/') )),3);
|
||||
$this->debug("getchmod();");
|
||||
$dir = $this->dirlist($file);
|
||||
return $dir[$file]['permsn'];
|
||||
}
|
||||
|
||||
function group($file) {
|
||||
$gid = @filegroup('ssh2.sftp://' . $this->sftp_link . '/' . ltrim($file, '/'));
|
||||
if ( ! $gid )
|
||||
return false;
|
||||
if ( ! function_exists('posix_getgrgid') )
|
||||
return $gid;
|
||||
$grouparray = posix_getgrgid($gid);
|
||||
return $grouparray['name'];
|
||||
$this->debug("group();");
|
||||
$dir = $this->dirlist($file);
|
||||
return $dir[$file]['group'];
|
||||
}
|
||||
|
||||
function copy($source, $destination, $overwrite = false ) {
|
||||
$this->debug("copy();");
|
||||
if( ! $overwrite && $this->exists($destination) )
|
||||
return false;
|
||||
$content = $this->get_contents($source);
|
||||
@@ -244,10 +290,12 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function move($source, $destination, $overwrite = false) {
|
||||
$this->debug("move();");
|
||||
return @ssh2_sftp_rename($this->link, $source, $destination);
|
||||
}
|
||||
|
||||
function delete($file, $recursive = false) {
|
||||
$this->debug("delete();");
|
||||
if ( $this->is_file($file) )
|
||||
return ssh2_sftp_unlink($this->sftp_link, $file);
|
||||
if ( ! $recursive )
|
||||
@@ -262,118 +310,198 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
||||
}
|
||||
|
||||
function exists($file) {
|
||||
$file = ltrim($file, '/');
|
||||
return file_exists('ssh2.sftp://' . $this->sftp_link . '/' . $file);
|
||||
$this->debug("exists();");
|
||||
return $this->run_command($this->link, sprintf('ls -lad %s', $file), true);
|
||||
}
|
||||
|
||||
function is_file($file) {
|
||||
$file = ltrim($file, '/');
|
||||
return is_file('ssh2.sftp://' . $this->sftp_link . '/' . $file);
|
||||
$this->debug("is_file();");
|
||||
//DO NOT RELY ON dirlist()!
|
||||
$list = $this->run_command($this->link, sprintf('ls -lad %s', $file));
|
||||
$list = $this->parselisting($list);
|
||||
if ( ! $list )
|
||||
return false;
|
||||
else
|
||||
return ( !$list['isdir'] && !$list['islink'] ); //ie. not a file or link, yet exists, must be file.
|
||||
}
|
||||
|
||||
function is_dir($path) {
|
||||
$path = ltrim($path, '/');
|
||||
return is_dir('ssh2.sftp://' . $this->sftp_link . '/' . $path);
|
||||
$this->debug("is_dir();");
|
||||
//DO NOT RELY ON dirlist()!
|
||||
$list = $this->parselisting($this->run_command($this->link, sprintf('ls -lad %s', untrailingslashit($path))));
|
||||
if ( ! $list )
|
||||
return false;
|
||||
else
|
||||
return $list['isdir'];
|
||||
}
|
||||
|
||||
function is_readable($file) {
|
||||
$file = ltrim($file, '/');
|
||||
return is_readable('ssh2.sftp://' . $this->sftp_link . '/' . $file);
|
||||
//Not implmented.
|
||||
}
|
||||
|
||||
function is_writable($file) {
|
||||
$file = ltrim($file, '/');
|
||||
return is_writable('ssh2.sftp://' . $this->sftp_link . '/' . $file);
|
||||
//Not implmented.
|
||||
}
|
||||
|
||||
function atime($file) {
|
||||
$file = ltrim($file, '/');
|
||||
return fileatime('ssh2.sftp://' . $this->sftp_link . '/' . $file);
|
||||
//Not implmented.
|
||||
}
|
||||
|
||||
function mtime($file) {
|
||||
$file = ltrim($file, '/');
|
||||
return filemtime('ssh2.sftp://' . $this->sftp_link . '/' . $file);
|
||||
//Not implmented.
|
||||
}
|
||||
|
||||
function size($file) {
|
||||
$file = ltrim($file, '/');
|
||||
return filesize('ssh2.sftp://' . $this->sftp_link . '/' . $file);
|
||||
//Not implmented.
|
||||
}
|
||||
|
||||
function touch($file, $time = 0, $atime = 0) {
|
||||
//Not implmented.
|
||||
}
|
||||
|
||||
function mkdir($path, $chmod = false, $chown = false, $chgrp = false) {
|
||||
function mkdir($path, $chmod = null, $chown = false, $chgrp = false) {
|
||||
$this->debug("mkdir();");
|
||||
$path = untrailingslashit($path);
|
||||
if ( ! $chmod )
|
||||
$chmod = FS_CHMOD_DIR;
|
||||
if ( ! ssh2_sftp_mkdir($this->sftp_link, $path, $chmod, true) )
|
||||
if( ! ssh2_sftp_mkdir($this->sftp_link, $path, $chmod, true) )
|
||||
return false;
|
||||
if ( $chown )
|
||||
if( $chown )
|
||||
$this->chown($path, $chown);
|
||||
if ( $chgrp )
|
||||
if( $chgrp )
|
||||
$this->chgrp($path, $chgrp);
|
||||
return true;
|
||||
}
|
||||
|
||||
function rmdir($path, $recursive = false) {
|
||||
$this->debug("rmdir();");
|
||||
return $this->delete($path, $recursive);
|
||||
}
|
||||
|
||||
function dirlist($path, $include_hidden = true, $recursive = false) {
|
||||
if ( $this->is_file($path) ) {
|
||||
$limit_file = basename($path);
|
||||
$path = dirname($path);
|
||||
} else {
|
||||
$limit_file = false;
|
||||
function parselisting($line) {
|
||||
$this->debug("parselisting();");
|
||||
$is_windows = ($this->OS_remote == FTP_OS_Windows);
|
||||
if ($is_windows && preg_match("/([0-9]{2})-([0-9]{2})-([0-9]{2}) +([0-9]{2}):([0-9]{2})(AM|PM) +([0-9]+|<DIR>) +(.+)/", $line, $lucifer)) {
|
||||
$b = array();
|
||||
if ($lucifer[3]<70) { $lucifer[3] +=2000; } else { $lucifer[3]+=1900; } // 4digit year fix
|
||||
$b['isdir'] = ($lucifer[7]=="<DIR>");
|
||||
if ( $b['isdir'] )
|
||||
$b['type'] = 'd';
|
||||
else
|
||||
$b['type'] = 'f';
|
||||
$b['size'] = $lucifer[7];
|
||||
$b['month'] = $lucifer[1];
|
||||
$b['day'] = $lucifer[2];
|
||||
$b['year'] = $lucifer[3];
|
||||
$b['hour'] = $lucifer[4];
|
||||
$b['minute'] = $lucifer[5];
|
||||
$b['time'] = @mktime($lucifer[4]+(strcasecmp($lucifer[6],"PM")==0?12:0),$lucifer[5],0,$lucifer[1],$lucifer[2],$lucifer[3]);
|
||||
$b['am/pm'] = $lucifer[6];
|
||||
$b['name'] = $lucifer[8];
|
||||
} else if (!$is_windows && $lucifer=preg_split("/[ ]/",$line,9,PREG_SPLIT_NO_EMPTY)) {
|
||||
//echo $line."\n";
|
||||
$lcount=count($lucifer);
|
||||
if ($lcount<8) return '';
|
||||
$b = array();
|
||||
$b['isdir'] = $lucifer[0]{0} === "d";
|
||||
$b['islink'] = $lucifer[0]{0} === "l";
|
||||
if ( $b['isdir'] )
|
||||
$b['type'] = 'd';
|
||||
elseif ( $b['islink'] )
|
||||
$b['type'] = 'l';
|
||||
else
|
||||
$b['type'] = 'f';
|
||||
$b['perms'] = $lucifer[0];
|
||||
$b['number'] = $lucifer[1];
|
||||
$b['owner'] = $lucifer[2];
|
||||
$b['group'] = $lucifer[3];
|
||||
$b['size'] = $lucifer[4];
|
||||
if ($lcount==8) {
|
||||
sscanf($lucifer[5],"%d-%d-%d",$b['year'],$b['month'],$b['day']);
|
||||
sscanf($lucifer[6],"%d:%d",$b['hour'],$b['minute']);
|
||||
$b['time'] = @mktime($b['hour'],$b['minute'],0,$b['month'],$b['day'],$b['year']);
|
||||
$b['name'] = $lucifer[7];
|
||||
} else {
|
||||
$b['month'] = $lucifer[5];
|
||||
$b['day'] = $lucifer[6];
|
||||
if (preg_match("/([0-9]{2}):([0-9]{2})/",$lucifer[7],$l2)) {
|
||||
$b['year'] = date("Y");
|
||||
$b['hour'] = $l2[1];
|
||||
$b['minute'] = $l2[2];
|
||||
} else {
|
||||
$b['year'] = $lucifer[7];
|
||||
$b['hour'] = 0;
|
||||
$b['minute'] = 0;
|
||||
}
|
||||
$b['time'] = strtotime(sprintf("%d %s %d %02d:%02d",$b['day'],$b['month'],$b['year'],$b['hour'],$b['minute']));
|
||||
$b['name'] = $lucifer[8];
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! $this->is_dir($path) )
|
||||
return $b;
|
||||
}
|
||||
|
||||
function dirlist($path = '.', $incdot = false, $recursive = false) {
|
||||
$this->debug("dirlist();");
|
||||
if( $this->is_file($path) ) {
|
||||
$limitFile = basename($path);
|
||||
$path = trailingslashit(dirname($path));
|
||||
} else {
|
||||
$limitFile = false;
|
||||
}
|
||||
|
||||
$list = $this->run_command($this->link, sprintf('ls -la %s', $path));
|
||||
|
||||
if ( $list === false )
|
||||
return false;
|
||||
|
||||
$list = explode("\n", $list);
|
||||
|
||||
$dirlist = array();
|
||||
foreach ( (array)$list as $k => $v ) {
|
||||
$entry = $this->parselisting($v);
|
||||
if ( empty($entry) )
|
||||
continue;
|
||||
|
||||
if ( '.' == $entry['name'] || '..' == $entry['name'] )
|
||||
continue;
|
||||
|
||||
$dirlist[ $entry['name'] ] = $entry;
|
||||
}
|
||||
|
||||
if ( ! $dirlist )
|
||||
return false;
|
||||
|
||||
if ( empty($dirlist) )
|
||||
return array();
|
||||
|
||||
$ret = array();
|
||||
$dir = @dir('ssh2.sftp://' . $this->sftp_link .'/' . ltrim($path, '/') );
|
||||
|
||||
if ( ! $dir )
|
||||
return false;
|
||||
|
||||
while (false !== ($entry = $dir->read()) ) {
|
||||
$struc = array();
|
||||
$struc['name'] = $entry;
|
||||
|
||||
if ( '.' == $struc['name'] || '..' == $struc['name'] )
|
||||
continue; //Do not care about these folders.
|
||||
|
||||
if ( ! $include_hidden && '.' == $struc['name'][0] )
|
||||
continue;
|
||||
|
||||
if ( $limit_file && $struc['name'] != $limit_file )
|
||||
continue;
|
||||
|
||||
$struc['perms'] = $this->gethchmod($path.'/'.$entry);
|
||||
$struc['permsn'] = $this->getnumchmodfromh($struc['perms']);
|
||||
$struc['number'] = false;
|
||||
$struc['owner'] = $this->owner($path.'/'.$entry);
|
||||
$struc['group'] = $this->group($path.'/'.$entry);
|
||||
$struc['size'] = $this->size($path.'/'.$entry);
|
||||
$struc['lastmodunix']= $this->mtime($path.'/'.$entry);
|
||||
$struc['lastmod'] = date('M j',$struc['lastmodunix']);
|
||||
$struc['time'] = date('h:i:s',$struc['lastmodunix']);
|
||||
$struc['type'] = $this->is_dir($path.'/'.$entry) ? 'd' : 'f';
|
||||
foreach ( $dirlist as $struc ) {
|
||||
|
||||
if ( 'd' == $struc['type'] ) {
|
||||
if ( $recursive )
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive);
|
||||
else
|
||||
$struc['files'] = array();
|
||||
}
|
||||
$struc['files'] = array();
|
||||
|
||||
$ret[ $struc['name'] ] = $struc;
|
||||
if ( $incdot ){
|
||||
//We're including the doted starts
|
||||
if( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder
|
||||
if ($recursive)
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
|
||||
}
|
||||
} else { //No dots
|
||||
if ( $recursive )
|
||||
$struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive);
|
||||
}
|
||||
}
|
||||
//File
|
||||
$ret[$struc['name']] = $struc;
|
||||
}
|
||||
$dir->close();
|
||||
unset($dir);
|
||||
return $ret;
|
||||
}
|
||||
function __destruct() {
|
||||
$this->debug("__destruct();");
|
||||
if ( $this->link )
|
||||
unset($this->link);
|
||||
if ( $this->sftp_link )
|
||||
unset($this->sftp_link);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||