Changeset 599
- Timestamp:
- 06/27/06 11:03:10 (2 years ago)
- Files:
-
- trunk/wp-admin/admin-functions.php (modified) (1 diff)
- trunk/wp-admin/categories.php (modified) (3 diffs)
- trunk/wp-admin/comment.php (modified) (4 diffs)
- trunk/wp-admin/edit-page-form.php (modified) (1 diff)
- trunk/wp-admin/import/blogger.php (modified) (3 diffs)
- trunk/wp-admin/inline-uploading.php (modified) (3 diffs)
- trunk/wp-admin/link.php (modified) (5 diffs)
- trunk/wp-admin/moderation.php (modified) (1 diff)
- trunk/wp-admin/options-discussion.php (modified) (1 diff)
- trunk/wp-admin/page.php (modified) (3 diffs)
- trunk/wp-admin/plugin-editor.php (modified) (1 diff)
- trunk/wp-admin/plugins.php (modified) (2 diffs)
- trunk/wp-admin/post.php (modified) (3 diffs)
- trunk/wp-admin/templates.php (modified) (1 diff)
- trunk/wp-admin/theme-editor.php (modified) (1 diff)
- trunk/wp-admin/themes.php (modified) (2 diffs)
- trunk/wp-admin/user-edit.php (modified) (2 diffs)
- trunk/wp-admin/users.php (modified) (6 diffs)
- trunk/wp-content/mu-plugins/misc.php (modified) (1 diff)
- trunk/wp-content/themes/default/functions.php (modified) (1 diff)
- trunk/wp-includes/cron.php (modified) (1 diff)
- trunk/wp-includes/functions.php (modified) (2 diffs)
- trunk/wp-includes/js/tinymce/plugins/autosave/editor_plugin_src.js (deleted)
- trunk/wp-includes/js/tinymce/plugins/autosave/readme.txt (deleted)
- trunk/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js (modified) (1 diff)
- trunk/wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin_src.js (deleted)
- trunk/wp-includes/js/tinymce/plugins/inlinepopups/readme.txt (deleted)
- trunk/wp-includes/js/tinymce/plugins/paste/editor_plugin.js (modified) (1 diff)
- trunk/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js (modified) (1 diff)
- trunk/wp-includes/js/tinymce/themes/advanced/editor_template.js (modified) (7 diffs)
- trunk/wp-includes/js/tinymce/tiny_mce.js (modified) (60 diffs)
- trunk/wp-includes/js/tinymce/tiny_mce_config.php (modified) (2 diffs)
- trunk/wp-includes/js/tinymce/tiny_mce_popup.js (modified) (1 diff)
- trunk/wp-includes/pluggable.php (modified) (2 diffs)
- trunk/wp-includes/rss.php (modified) (7 diffs)
- trunk/wp-includes/script-loader.php (modified) (2 diffs)
- trunk/wp-login.php (modified) (3 diffs)
- trunk/wp-trackback.php (modified) (1 diff)
- trunk/xmlrpc.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-admin/admin-functions.php
r595 r599 413 413 $pass2 = $_POST['pass2']; 414 414 415 if (isset ($_POST['role']) ) {416 if ($user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap('edit_users'))415 if (isset ($_POST['role']) && current_user_can('edit_users')) { 416 if ($user_id != $current_user->id || $wp_roles->role_objects[$_POST['role']]->has_cap('edit_users')) 417 417 $user->role = $_POST['role']; 418 418 } trunk/wp-admin/categories.php
r550 r599 32 32 wp_insert_category($_POST); 33 33 34 header('Location:categories.php?message=1#addcat');34 wp_redirect('categories.php?message=1#addcat'); 35 35 break; 36 36 … … 53 53 wp_delete_category($cat_ID); 54 54 55 header('Location:categories.php?message=2');55 wp_redirect('categories.php?message=2'); 56 56 57 57 break; … … 75 75 wp_update_category($_POST); 76 76 77 header('Location:categories.php?message=3');77 wp_redirect('categories.php?message=3'); 78 78 break; 79 79 trunk/wp-admin/comment.php
r595 r599 119 119 120 120 if ((wp_get_referer() != '') && (false == $noredir)) { 121 header('Location: ' .wp_get_referer());122 } else { 123 header('Location: '.get_settings('siteurl') .'/wp-admin/edit-comments.php');121 wp_redirect(wp_get_referer()); 122 } else { 123 wp_redirect(get_settings('siteurl') .'/wp-admin/edit-comments.php'); 124 124 } 125 125 exit(); … … 146 146 147 147 if ((wp_get_referer() != "") && (false == $noredir)) { 148 header('Location: ' .wp_get_referer());149 } else { 150 header('Location: '.get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments');148 wp_redirect(wp_get_referer()); 149 } else { 150 wp_redirect(get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); 151 151 } 152 152 exit(); … … 177 177 178 178 if ((wp_get_referer() != "") && (false == $noredir)) { 179 header('Location: ' .wp_get_referer());180 } else { 181 header('Location: '.get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments');179 wp_redirect(wp_get_referer()); 180 } else { 181 wp_redirect(get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); 182 182 } 183 183 exit(); … … 195 195 $referredby = $_POST['referredby']; 196 196 if (!empty($referredby)) { 197 header('Location: ' .$referredby);198 } else { 199 header ("Location:edit.php?p=$comment_post_ID&c=1#comments");197 wp_redirect($referredby); 198 } else { 199 wp_redirect("edit.php?p=$comment_post_ID&c=1#comments"); 200 200 } 201 201 trunk/wp-admin/edit-page-form.php
r595 r599 185 185 186 186 <?php if ('edit' == $action) : 187 $delete_nonce = wp_create_nonce( 'delete-page_' . $post_ID ); 187 188 if ( current_user_can('delete_page', $post->ID) ) ?> 188 <input name="deletepost" class=" delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"return confirm('" . sprintf(__("You are about to delete this page \'%s\'\\n \'Cancel\' to stop, \'OK\' to delete."), js_escape($post->post_title) ) . "')\""; ?> />189 <input name="deletepost" class="button" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this page') ?>" <?php echo "onclick=\"if ( confirm('" . sprintf(__("You are about to delete this page \'%s\'\\n \'Cancel\' to stop, \'OK\' to delete."), js_escape($post->post_title) ) . "') ) { document.forms.post._wpnonce.value = '$delete_nonce'; return true;}return false;\""; ?> /> 189 190 <?php endif; ?> 190 191 </form> trunk/wp-admin/import/blogger.php
r550 r599 31 31 function restart() { 32 32 delete_option('import-blogger'); 33 header("Location:admin.php?import=blogger");33 wp_redirect("admin.php?import=blogger"); 34 34 die(); 35 35 } … … 219 219 // Redirects to next step 220 220 function do_next_step() { 221 header("Location:admin.php?import=blogger&noheader=true&blog={$_GET['blog']}");221 wp_redirect("admin.php?import=blogger&noheader=true&blog={$_GET['blog']}"); 222 222 die(); 223 223 } … … 279 279 } 280 280 update_option('import-blogger', $this->import); 281 header("Location:admin.php?import=blogger&noheader=true&step=1");281 wp_redirect("admin.php?import=blogger&noheader=true&step=1"); 282 282 } 283 283 die(); trunk/wp-admin/inline-uploading.php
r550 r599 42 42 wp_delete_attachment($attachment); 43 43 44 header("Location: " .basename(__FILE__) ."?post=$post&all=$all&action=view&start=$start");44 wp_redirect(basename(__FILE__) ."?post=$post&all=$all&action=view&start=$start"); 45 45 die; 46 46 … … 106 106 } 107 107 108 header("Location: " .basename(__FILE__) . "?post=$post&all=$all&action=view&start=0");108 wp_redirect(basename(__FILE__) . "?post=$post&all=$all&action=view&start=0"); 109 109 die(); 110 110 … … 145 145 146 146 if ( count($attachments) == 0 ) { 147 header("Location: " .basename(__FILE__) ."?post=$post&action=upload" );147 wp_redirect( basename(__FILE__) ."?post=$post&action=upload" ); 148 148 die; 149 149 } elseif ( count($attachments) > $num ) { trunk/wp-admin/link.php
r595 r599 38 38 //for each link id (in $linkcheck[]) change category to selected value 39 39 if (count($linkcheck) == 0) { 40 header('Location: '.$this_file);40 wp_redirect($this_file); 41 41 exit; 42 42 } … … 50 50 } 51 51 52 header("Location:$this_file?deleted=$deleted");52 wp_redirect("$this_file?deleted=$deleted"); 53 53 break; 54 54 … … 62 62 //for each link id (in $linkcheck[]) change category to selected value 63 63 if (count($linkcheck) == 0) { 64 header('Location: '.$this_file);64 wp_redirect($this_file); 65 65 exit; 66 66 } … … 69 69 //$q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)"); 70 70 71 header('Location: '.$this_file);71 wp_redirect($this_file); 72 72 break; 73 73 … … 77 77 add_link(); 78 78 79 header('Location: '.wp_get_referer().'?added=true');79 wp_redirect(wp_get_referer().'?added=true'); 80 80 break; 81 81 trunk/wp-admin/moderation.php
r550 r599 71 71 72 72 $file = basename(__FILE__); 73 header("Location:$file?ignored=$item_ignored&deleted=$item_deleted&approved=$item_approved&spam=$item_spam");73 wp_redirect("$file?ignored=$item_ignored&deleted=$item_deleted&approved=$item_approved&spam=$item_spam"); 74 74 exit(); 75 75 trunk/wp-admin/options-discussion.php
r550 r599 88 88 <textarea name="blacklist_keys" cols="60" rows="4" id="blacklist_keys" style="width: 98%; font-size: 12px;" class="code"><?php form_option('blacklist_keys'); ?></textarea> 89 89 </p> 90 <p><label for="open_proxy_check">91 <input name="open_proxy_check" type="checkbox" id="open_proxy_check" value="1" <?php checked('1', get_settings('open_proxy_check')); ?> />92 <?php _e('Blacklist comments from open and insecure proxies.') ?></label></p>93 90 </fieldset> 94 91 <p class="submit"> trunk/wp-admin/page.php
r595 r599 53 53 $location = "page.php?action=edit&post=$page_ID"; 54 54 55 header("Location: $location");55 wp_redirect($location); 56 56 exit(); 57 57 break; … … 121 121 $location = 'page-new.php'; 122 122 } 123 header ('Location: ' .$location); // Send user on their way while we keep working123 wp_redirect($location); // Send user on their way while we keep working 124 124 125 125 exit(); … … 147 147 elseif (strstr($sendback, 'attachments.php')) $sendback = get_settings('siteurl') .'/wp-admin/attachments.php'; 148 148 $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); 149 header ('Location: ' .$sendback);149 wp_redirect($sendback); 150 150 exit(); 151 151 break; 152 152 153 153 default: 154 header('Location:edit-pages.php');154 wp_redirect('edit-pages.php'); 155 155 exit(); 156 156 break; trunk/wp-admin/plugin-editor.php
r559 r599 46 46 fwrite($f, $newcontent); 47 47 fclose($f); 48 header("Location:plugin-editor.php?file=$file&a=te");48 wp_redirect("plugin-editor.php?file=$file&a=te"); 49 49 } else { 50 header("Location:plugin-editor.php?file=$file");50 wp_redirect("plugin-editor.php?file=$file"); 51 51 } 52 52 trunk/wp-admin/plugins.php
r550 r599 20 20 do_action('activate_' . trim( $_GET['plugin'] )); 21 21 } 22 header('Location:plugins.php?activate=true');22 wp_redirect('plugins.php?activate=true'); 23 23 } else if ('deactivate' == $_GET['action']) { 24 24 check_admin_referer('deactivate-plugin_' . $_GET['plugin']); … … 27 27 update_option('active_plugins', $current); 28 28 do_action('deactivate_' . trim( $_GET['plugin'] )); 29 header('Location:plugins.php?deactivate=true');29 wp_redirect('plugins.php?deactivate=true'); 30 30 } 31 31 exit; trunk/wp-admin/post.php
r595 r599 53 53 $location = "post.php?action=edit&post=$post_ID"; 54 54 55 header("Location: $location");55 wp_redirect($location); 56 56 exit(); 57 57 break; … … 124 124 } 125 125 126 header ('Location: ' .$location); // Send user on their way while we keep working126 wp_redirect($location); // Send user on their way while we keep working 127 127 128 128 exit(); … … 150 150 elseif (strstr($sendback, 'attachments.php')) $sendback = get_settings('siteurl') .'/wp-admin/attachments.php'; 151 151 $sendback = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $sendback); 152 header ('Location: ' .$sendback);152 wp_redirect($sendback); 153 153 exit(); 154 154 break; 155 155 156 156 default: 157 header('Location:edit.php');157 wp_redirect('edit.php'); 158 158 exit(); 159 159 break; trunk/wp-admin/templates.php
r559 r599 49 49 fwrite($f, $newcontent); 50 50 fclose($f); 51 header("Location:templates.php?file=$file&a=te");51 wp_redirect("templates.php?file=$file&a=te"); 52 52 } else { 53 header("Location:templates.php?file=$file&a=err");53 wp_redirect("templates.php?file=$file&a=err"); 54 54 } 55 55 } else { 56 header("Location:templates.php?file=$file&a=err");56 wp_redirect("templates.php?file=$file&a=err"); 57 57 } 58 58 trunk/wp-admin/theme-editor.php
r559 r599 60 60 fwrite($f, $newcontent); 61 61 fclose($f); 62 header("Location:theme-editor.php?file=$file&theme=$theme&a=te");62 wp_redirect("theme-editor.php?file=$file&theme=$theme&a=te"); 63 63 } else { 64 header("Location:theme-editor.php?file=$file&theme=$theme");64 wp_redirect("theme-editor.php?file=$file&theme=$theme"); 65 65 } 66 66 trunk/wp-admin/themes.php
r550 r599 2 2 require_once('admin.php'); 3 3 4 if ( isset($_GET['action']) ) {5 check_admin_referer('switch-theme_' . $_GET['template']);6 7 if ('activate' == $_GET['action']) {8 if ( isset($_GET['template']) )9 update_option('template', $_GET['template']);10 11 if ( isset($_GET['stylesheet']) )12 update_option('stylesheet', $_GET['stylesheet']);13 14 do_action('switch_theme', get_current_theme());15 16 header('Location: themes.php?activated=true');17 exit;18 }19 }20 21 $title = __('Manage Themes');22 $parent_file = 'themes.php';23 require_once('admin-header.php');24 ?>25 26 <?php if ( ! validate_current_theme() ) : ?>27 <div id="message1" class="updated fade"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div>28 <?php elseif ( isset($_GET['activated']) ) : ?>29 <div id="message2" class="updated fade"><p><?php printf(__('New theme activated. <a href="%s">View site »</a>'), get_bloginfo('home') . '/'); ?></p></div>30 <?php endif; ?>31 32 <?php33 4 $themes = get_themes(); 34 5 $ct = current_theme_info(); … … 52 23 } 53 24 reset( $themes ); 25 26 if ( isset($_GET['action']) ) { 27 check_admin_referer('switch-theme_' . $_GET['template']); 28 29 if ('activate' == $_GET['action']) { 30 $found = false; 31 while( list( $key, $details ) = each( $themes ) ) { 32 if( $details[ 'Template' ] == $_GET['template'] && $details[ 'Stylesheet' ] == $_GET['stylesheet'] ) { 33 $found = true; 34 break; 35 } 36 } 37 if( $found == true ) { 38 if ( isset($_GET['template']) ) 39 update_option('template', $_GET['template']); 40 41 if ( isset($_GET['stylesheet']) ) 42 update_option('stylesheet', $_GET['stylesheet']); 43 44 do_action('switch_theme', get_current_theme()); 45 46 wp_redirect('themes.php?activated=true'); 47 } else { 48 wp_redirect('themes.php'); 49 } 50 exit; 51 } 52 } 53 54 $title = __('Manage Themes'); 55 $parent_file = 'themes.php'; 56 require_once('admin-header.php'); 54 57 ?> 58 59 <?php if ( ! validate_current_theme() ) : ?> 60 <div id="message1" class="updated fade"><p><?php _e('The active theme is broken. Reverting to the default theme.'); ?></p></div> 61 <?php elseif ( isset($_GET['activated']) ) : ?> 62 <div id="message2" class="updated fade"><p><?php printf(__('New theme activated. <a href="%s">View site »</a>'), get_bloginfo('home') . '/'); ?></p></div> 63 <?php endif; ?> 64 55 65 56 66 <div class="wrap"> trunk/wp-admin/user-edit.php
r598 r599 26 26 27 27 $wp_http_referer = remove_query_arg(array('update', 'delete_count'), stripslashes($wp_http_referer)); 28 $errors = array();29 30 28 // Only allow site admins to edit every user. 31 if ( is_site_admin() == false )32 if( $user_id != $current_user->ID )$errors = new WP_Error('head', __('You do not have permission to edit this user.'));29 if ( !is_site_admin() && ($user_id != $current_user->ID) ) 30 $errors = new WP_Error('head', __('You do not have permission to edit this user.')); 33 31 34 32 switch ($action) { … … 47 45 if ( !current_user_can('edit_user', $user_id) ) 48 46 $errors = new WP_Error('head', __('You do not have permission to edit this user.')); 49 else 50 if( isset( $errors ) == false ) $errors = edit_user($user_id); 47 48 if ( !isset($errors) ) 49 $errors = edit_user($user_id); 51 50 52 51 if( !is_wp_error( $errors ) ) { 53 52 $redirect = "user-edit.php?user_id=$user_id&updated=true"; 54 53 $redirect = add_query_arg('wp_http_referer', urlencode($wp_http_referer), $redirect); 55 header("Location: $redirect");54 wp_redirect($redirect); 56 55 exit; 57 56 } trunk/wp-admin/users.php
r559 r599 125 125 126 126 if (empty($_POST['users'])) { 127 header('Location: ' .$redirect);127 wp_redirect($redirect); 128 128 } 129 129 … … 146 146 } 147 147 148 header('Location: ' .add_query_arg('update', $update, $redirect));148 wp_redirect(add_query_arg('update', $update, $redirect)); 149 149 150 150 break; … … 155 155 156 156 if ( empty($_POST['users']) ) { 157 header('Location: ' .$redirect);157 wp_redirect($redirect); 158 158 } 159 159 … … 186 186 $redirect = add_query_arg('delete_count', $delete_count, $redirect); 187 187 188 header('Location: ' .add_query_arg('update', $update, $redirect));188 wp_redirect(add_query_arg('update', $update, $redirect)); 189 189 190 190 break; … … 195 195 196 196 if ( empty($_POST['users']) ) 197 header('Location: ' .$redirect);197 wp_redirect($redirect); 198 198 199 199 if ( !current_user_can('delete_users') ) … … 333 333 $new_user_login = apply_filters('pre_user_login', sanitize_user(stripslashes($_POST['user_login']), true)); 334 334 $redirect = add_query_arg('usersearch', $new_user_login, $redirect); 335 header('Location: ' .add_query_arg('update', $update, $redirect) . '#user-' . $user_id);335 wp_redirect(add_query_arg('update', $update, $redirect) . '#user-' . $user_id); 336 336 die(); 337 337 } trunk/wp-content/mu-plugins/misc.php
r551 r599 1 1 <?php 2 3 function kill_proxy_check( $option ) { 4 return 0; 5 } 6 add_filter('option_open_proxy_check', 'kill_proxy_check'); 2 7 3 8 function graceful_fail( $message ) { trunk/wp-content/themes/default/functions.php
r541 r599 124 124 } 125 125 //print_r($_REQUEST); 126 header("Location:themes.php?page=functions.php&saved=true");126 wp_redirect("themes.php?page=functions.php&saved=true"); 127 127 die; 128 128 } trunk/wp-includes/cron.php
r559 r599 66 66 67 67 function spawn_cron() { 68 $keys = array_keys( get_option( 'cron' ) ); 68 $crons = get_option( 'cron' ); 69 70 if ( !is_array($crons) ) 71 return; 72 73 $keys = array_keys( $crons ); 69 74 if ( array_shift( $keys ) > time() ) 70 75 return; trunk/wp-includes/functions.php
r595 r599 810 810 function do_robots() { 811 811 global $current_blog; 812 do_action('do_robots'); 812 do_action('do_robotstxt'); 813 813 814 if ( '0' == $current_blog->public ) { 814 815 echo "User-agent: *\n"; … … 1044 1045 } 1045 1046 1047 function wp_explain_nonce($action) { 1048 if ( $action !== -1 && preg_match('/([a-z]+)-([a-z]+)(_(.+))?/', $action, $matches) ) { 1049 $verb = $matches[1]; 1050 $noun = $matches[2]; 1051 1052 $trans = array(); 1053 $trans['update']['attachment'] = array(__('Are you sure you want to edit this attachment: "%s"?'), 'get_the_title'); 1054 1055 $trans['add']['category'] = array(__('Are you sure you want to add this category?'), false); 1056 $trans['delete']['category'] = array(__('Are you sure you want to delete this category: "%s"?'), 'get_catname'); 1057 $trans['update']['category'] = array(__('Are you sure you want to edit this category: "%s"?'), 'get_catname'); 1058 1059 $trans['delete']['comment'] = array(__('Are you sure you want to delete this comment: "%s"?'), 'use_id'); 1060 $trans['unapprove']['comment'] = array(__('Are you sure you want to unapprove this comment: "%s"?'), 'use_id'); 1061 $trans['approve']['comment'] = array(__('Are you sure you want to approve this comment: "%s"?'), 'use_id'); 1062 $trans['update']['comment'] = array(__('Are you sure you want to edit this comment: "%s"?'), 'use_id'); 1063 $trans['bulk']['comments'] = array(__('Are you sure you want to bulk modify comments?'), false); 1064 $trans['moderate']['comments'] = array(__('Are you sure you want to moderate comments?'), false); 1065 1066 $trans['add']['bookmark'] = array(__('Are you sure you want to add this bookmark?'), false); 1067 $trans['delete']['bookmark'] = array(__('Are you sure you want to delete this bookmark: "%s"?'), 'use_id'); 1068 $trans['update']['bookmark'] = array(__('Are you sure you want to edit this bookmark: "%s"?'), 'use_id'); 1069 $trans['bulk']['bookmarks'] = array(__('Are you sure you want to bulk modify bookmarks?'), false); 1070 1071 $trans['add']['page'] = array(__('Are you sure you want to add this page?'), false); 1072 $trans['delete']['page'] = array(__('Are you sure you want to delete this page: "%s"?'), 'get_the_title'); 1073 $trans['update']['page'] = array(__('Are you sure you want to edit this page: "%s"?'), 'get_the_title'); 1074 1075 $trans['edit']['plugin'] = array(__('Are you sure you want to edit this plugin file: "%s"?'), 'use_id'); 1076 $trans['activate']['plugin'] = array(__('Are you sure you want to activate this plugin: "%s"?'), 'use_id'); 1077 $trans['deactivate']['plugin'] = array(__('Are you sure you want to deactivate this plugin: "%s"?'), 'use_id'); 1078 1079 $trans['add']['post'] = array(__('Are you sure you want to add this post?'), false); 1080 $trans['delete']['post'] = array(__('Are you sure you want to delete this post: "%s"?'), 'get_the_title'); 1081 $trans['update']['post'] = array(__('Are you sure you want to edit this post: "%s"?'), 'get_the_title'); 1082 1083 $trans['add']['user'] = array(__('Are you sure you want to add this user?'), false); 1084 $trans['delete']['users'] = array(__('Are you sure you want to delete users?'), false); 1085 $trans['bulk']['users'] = array(__('Are you sure you want to bulk modify users?'), false); 1086 $trans['update']['user'] = array(__('Are you sure you want to edit this user: "%s"?'), 'get_author_name'); 1087 $trans['update']['profile'] = array(__('Are you sure you want to modify the profile for: "%s"?'), 'get_author_name'); 1088 1089 $trans['update']['options'] = array(__('Are you sure you want to edit your settings?'), false); 1090 $trans['update']['permalink'] = array(__('Are you sure you want to change your permalink structure to: %s?'), 'use_id'); 1091 $trans['edit']['file'] = array(__('Are you sure you want to edit this file: "%s"?'), 'use_id'); 1092 $trans['edit']['theme'] = array(__('Are you sure you want to edit this theme file: "%s"?'), 'use_id'); 1093 $trans['switch']['theme'] = array(__('Are you sure you want to switch to this theme: "%s"?'), 'use_id'); 1094 1095 if ( isset($trans[$verb][$noun]) ) { 1096 if ( !empty($trans[$verb][$noun][1]) ) { 1097 $lookup = $trans[$verb][$noun][1]; 1098 $object = $matches[4]; 1099 if ( 'use_id' != $lookup ) 1100 $object = call_user_func($lookup, $object); 1101 return sprintf($trans[$verb][$noun][0], $object); 1102 } else { 1103 return $trans[$verb][$noun][0]; 1104 } 1105 } 1106 } 1107 1108 return __('Are you sure you want to do this'); 1109 } 1110 1111 function wp_nonce_ays($action) { 1112 global $pagenow, $menu, $submenu, $parent_file, $submenu_file; 1113 1114 $adminurl = get_settings('siteurl') . '/wp-admin'; 1115 if ( wp_get_referer() ) 1116 $adminurl = wp_get_referer(); 1117 1118 $title = __('WordPress Confirmation'); 1119 require_once(ABSPATH . '/wp-admin/admin-header.php'); 1120 // Remove extra layer of slashes. 1121 $_POST = stripslashes_deep($_POST ); 1122 if ( $_POST ) { 1123 $q = http_build_query($_POST); 1124 $q = explode( ini_get('arg_separator.output'), $q); 1125 $html .= "\t<form method='post' action='$pagenow'>\n"; 1126 foreach ( (array) $q as $a ) { 1127 $v = substr(strstr($a, '='), 1); 1128 $k = substr($a, 0, -(strlen($v)+1)); 1129 $html .= "\t\t<input type='hidden' name='" . wp_specialchars( urldecode($k), 1 ) . "' value='" . wp_specialchars( urldecode($v), 1 ) . "' />\n"; 1130 } 1131 $html .= "\t\t<input type='hidden' name='_wpnonce' value='" . wp_create_nonce($action) . "' />\n"; 1132 $html .= "\t\t<div id='message' class='confirm fade'>\n\t\t<p>" . wp_explain_nonce($action) . "</p>\n\t\t<p><a href='$adminurl'>" . __('No') . "</a> <input type='submit' value='" . __('Yes') . "' /></p>\n\t\t</div>\n\t</form>\n"; 1133 } else { 1134 $html .= "\t<div id='message' class='confirm fade'>\n\t<p>" . wp_explain_nonce($action) . "</p>\n\t<p><a href='$adminurl'>" . __('No') . "</a> <a href='" . add_query_arg( '_wpnonce', wp_create_nonce($action), $_SERVER['REQUEST_URI'] ) . "'>" . __('Yes') . "</a></p>\n\t</div>\n"; 1135 } 1136 $html .= "</body>\n</html>"; 1137 echo $html; 1138 include_once(ABSPATH . '/wp-admin/admin-footer.php'); 1139 } 1140 1046 1141 ?> trunk/wp-includes/js/tinymce/plugins/directionality/editor_plugin.js
r454 r599 1 /** 2 * $RCSfile: editor_plugin_src.js,v $ 3 * $Revision: 1.16 $ 4 * $Date: 2006/02/10 21:34:28 $ 5 * 6 * @author Moxiecode 7 * @copyright Copyright � 2004-2006, Moxiecode Systems AB, All rights reserved. 8 */ 9 1 10 /* Import plugin specific language pack */ 2 tinyMCE.importPluginLanguagePack('directionality', 'en, sv,fr_ca,zh_cn,cs,da,he,no,de,hu,ru,ru_KOI8-R,ru_UTF-8,es,cy,is,pl');11 tinyMCE.importPluginLanguagePack('directionality', 'en,tr,sv,fr_ca,zh_cn,cs,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,es,cy,is,pl,nl,fr,pt_br'); 3 12 4 function TinyMCE_directionality_getInfo() { 5 return { 6 longname : 'Directionality', 7 author : 'Moxiecode Systems', 8 authorurl : 'http://tinymce.moxiecode.com', 9 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html', 10 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion 11 }; 13 var TinyMCE_DirectionalityPlugin = { 14 getInfo : function() { 15 return { 16 longname : 'Directionality', 17 author : 'Moxiecode Systems', 18 authorurl : 'http://tinymce.moxiecode.com', 19 infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_directionality.html', 20 version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion 21 }; 22 }, 23 24 getControlHTML : function(cn) { 25 switch (cn) { 26 case "ltr": 27 return tinyMCE.getButtonHTML(cn, 'lang_directionality_ltr_desc', '{$pluginurl}/images/ltr.gif', 'mceDirectionLTR'); 28 29 case "rtl": 30 return tinyMCE.getButtonHTML(cn, 'lang_directionality_rtl_desc', '{$pluginurl}/images/rtl.gif', 'mceDirectionRTL'); 31 } 32 33 return ""; 34 }, 35 36 execCommand : function(editor_id, element, command, user_interface, value) { 37 // Handle commands 38 switch (command) { 39 case "mceDirectionLTR": 40 var inst = tinyMCE.getInstanceById(editor_id); 41 var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); 42 43 if (elm) 44 elm.setAttribute("dir", "ltr"); 45 46 tinyMCE.triggerNodeChange(false); 47 return true; 48 49 case "mceDirectionRTL": 50 var inst = tinyMCE.getInstanceById(editor_id); 51 var elm = tinyMCE.getParentElement(inst.getFocusElement(), "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); 52 53 if (elm) 54 elm.setAttribute("dir", "rtl"); 55 56 tinyMCE.triggerNodeChange(false); 57 return true; 58 } 59 60 // Pass to next handler in chain 61 return false; 62 }, 63 64 handleNodeChange : function(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) { 65 function getAttrib(elm, name) { 66 return elm.getAttribute(name) ? elm.getAttribute(name) : ""; 67 } 68 69 if (node == null) 70 return; 71 72 var elm = tinyMCE.getParentElement(node, "p,div,td,h1,h2,h3,h4,h5,h6,pre,address"); 73 if (!elm) { 74 tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonDisabled'); 75 tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonDisabled'); 76 return true; 77 } 78 79 tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonNormal'); 80 tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonNormal'); 81 82 var dir = getAttrib(elm, "dir"); 83 if (dir == "ltr" || dir == "") 84 tinyMCE.switchClass(editor_id + '_ltr', 'mceButtonSelected'); 85 else 86 tinyMCE.switchClass(editor_id + '_rtl', 'mceButtonSelected'); 87 88 return true; 89 } 12 90 }; 13 91 14 function TinyMCE_directionality_getControlHTML(control_name) { 15 switch (control_name) { 16 case "ltr": 17 var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionLTR\');return false;'; 18 return '<a href="javascript:' + cmd + '" onclick="' + cmd + '" target="_self" onmousedown="return false;"><img id="{$editor_id}_ltr" src="{$pluginurl}/images/ltr.gif" title="{$lang_directionality_ltr_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>' 19 + '<div class="zerosize"><input type="button" accesskey="." onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionLTR\',false);" /></div>'; 20 21 case "rtl": 22 var cmd = 'tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionRTL\');return false;'; 23 return '<a href="javascript:' + cmd + '" onclick="' + cmd + '" target="_self" onmousedown="return false;"><img id="{$editor_id}_rtl" src="{$pluginurl}/images/rtl.gif" title="{$lang_directionality_rtl_desc}" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>' 24 + '<div class="zerosize"><input type="button" accesskey="," onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceDirectionRTL\',false);" /></div>'; 25 } 26 27 return ""; 28 } 29<
