summaryrefslogtreecommitdiffstats
path: root/wp-inst
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-06-01 17:55:28 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2006-06-01 17:55:28 +0000
commit16cdc878fce216364bd57f498baeeb1b94ca8662 (patch)
tree9f94384eff6d37dd270f3b38920af9b0e6b6e68d /wp-inst
parent860410c2a5eee8f30ff5be2578760efae27bf5b3 (diff)
downloadwordpress-mu-16cdc878fce216364bd57f498baeeb1b94ca8662.tar.gz
wordpress-mu-16cdc878fce216364bd57f498baeeb1b94ca8662.tar.xz
wordpress-mu-16cdc878fce216364bd57f498baeeb1b94ca8662.zip
Added lots of files file WP SVN
File changes tomorrow (Takes time!) git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@549 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst')
-rw-r--r--wp-inst/wp-admin/dbx-admin-key-js.php66
-rw-r--r--wp-inst/wp-admin/edit-category-form.php50
-rw-r--r--wp-inst/wp-admin/edit-comments.js5
-rw-r--r--wp-inst/wp-admin/export.php106
-rw-r--r--wp-inst/wp-admin/import/blogware.php192
-rw-r--r--wp-inst/wp-admin/import/wordpress.php311
-rw-r--r--wp-inst/wp-admin/options-privacy.php36
-rw-r--r--wp-inst/wp-includes/js/tinymce/plugins/paste/blank.htm19
-rw-r--r--wp-inst/wp-includes/js/tinymce/plugins/paste/css/blank.css13
-rw-r--r--wp-inst/wp-includes/js/tinymce/plugins/paste/css/pasteword.css3
-rw-r--r--wp-inst/wp-includes/js/tinymce/plugins/paste/editor_plugin.js388
-rw-r--r--wp-inst/wp-includes/js/tinymce/plugins/paste/images/pastetext.gifbin0 -> 294 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/plugins/paste/images/pasteword.gifbin0 -> 299 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/plugins/paste/images/selectall.gifbin0 -> 205 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/plugins/paste/jscripts/pastetext.js34
-rw-r--r--wp-inst/wp-includes/js/tinymce/plugins/paste/jscripts/pasteword.js46
-rw-r--r--wp-inst/wp-includes/js/tinymce/plugins/paste/langs/en.js10
-rw-r--r--wp-inst/wp-includes/js/tinymce/plugins/paste/pastetext.htm34
-rw-r--r--wp-inst/wp-includes/js/tinymce/plugins/paste/pasteword.htm29
-rwxr-xr-xwp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/HttpClient.class.php339
-rwxr-xr-xwp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php73
-rwxr-xr-xwp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php64
-rwxr-xr-xwp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php100
-rwxr-xr-xwp-inst/wp-includes/js/tinymce/plugins/spellchecker/config.php29
-rwxr-xr-xwp-inst/wp-includes/js/tinymce/plugins/spellchecker/css/content.css5
-rwxr-xr-xwp-inst/wp-includes/js/tinymce/plugins/spellchecker/css/spellchecker.css34
-rwxr-xr-xwp-inst/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js573
-rwxr-xr-xwp-inst/wp-includes/js/tinymce/plugins/spellchecker/images/spellchecker.gifbin0 -> 591 bytes
-rwxr-xr-xwp-inst/wp-includes/js/tinymce/plugins/spellchecker/images/wline.gifbin0 -> 46 bytes
-rwxr-xr-xwp-inst/wp-includes/js/tinymce/plugins/spellchecker/langs/en.js14
-rwxr-xr-xwp-inst/wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php133
-rwxr-xr-xwp-inst/wp-includes/js/tinymce/plugins/wordpress/images/toolbars.gifbin0 -> 260 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/plugins/wordpress/popups.css354
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/bold_es.gifbin0 -> 80 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/bold_tw.gifbin0 -> 207 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/button_menu.gifbin0 -> 57 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/help.gifbin0 -> 295 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/italic_es.gifbin0 -> 74 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/italic_tw.gifbin0 -> 274 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifycenter.gifbin0 -> 70 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifyfull.gifbin0 -> 71 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifyleft.gifbin0 -> 71 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifyright.gifbin0 -> 70 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/menu_check.gifbin0 -> 51 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/opacity.pngbin0 -> 147 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/separator.gifbin0 -> 57 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/underline_es.gifbin0 -> 79 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/themes/advanced/images/underline_tw.gifbin0 -> 245 bytes
-rw-r--r--wp-inst/wp-includes/js/tinymce/tiny_mce_config.php86
-rw-r--r--wp-inst/wp-includes/js/tinymce/utils/mclayer.js212
-rw-r--r--wp-inst/wp-includes/script-loader.php235
51 files changed, 3593 insertions, 0 deletions
diff --git a/wp-inst/wp-admin/dbx-admin-key-js.php b/wp-inst/wp-admin/dbx-admin-key-js.php
new file mode 100644
index 0000000..de7cf9d
--- /dev/null
+++ b/wp-inst/wp-admin/dbx-admin-key-js.php
@@ -0,0 +1,66 @@
+<?php
+require_once('admin.php');
+header('Content-type: text/javascript; charset=' . get_settings('blog_charset'), true);
+
+switch ( $_GET['pagenow'] ) :
+ case 'post.php' :
+ case 'post-new.php' :
+ $man = 'postmeta';
+ break;
+ case 'page.php' :
+ case 'page-new.php' :
+ $man = 'pagemeta';
+ break;
+ case 'link-add.php' :
+ case 'link.php' :
+ $man = 'linkmeta';
+ break;
+endswitch;
+?>
+addLoadEvent( function() {var manager = new dbxManager('<?php echo $man; ?>');} );
+
+addLoadEvent( function()
+{
+ //create new docking boxes group
+ var meta = new dbxGroup(
+ 'grabit', // container ID [/-_a-zA-Z0-9/]
+ 'vertical', // orientation ['vertical'|'horizontal']
+ '10', // drag threshold ['n' pixels]
+ 'no', // restrict drag movement to container axis ['yes'|'no']
+ '10', // animate re-ordering [frames per transition, or '0' for no effect]
+ 'yes', // include open/close toggle buttons ['yes'|'no']
+ 'closed', // default state ['open'|'closed']
+ 'open', // word for "open", as in "open this box"
+ 'close', // word for "close", as in "close this box"
+ 'click-down and drag to move this box', // sentence for "move this box" by mouse
+ 'click to %toggle% this box', // pattern-match sentence for "(open|close) this box" by mouse
+ 'use the arrow keys to move this box', // sentence for "move this box" by keyboard
+ ', or press the enter key to %toggle% it', // pattern-match sentence-fragment for "(open|close) this box" by keyboard
+ '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
+ );
+
+ // Boxes are closed by default. Open the Category box if the cookie isn't already set.
+ var catdiv = document.getElementById('categorydiv');
+ if ( catdiv ) {
+ var button = catdiv.getElementsByTagName('A')[0];
+ if ( dbx.cookiestate == null && /dbx\-toggle\-closed/.test(button.className) )
+ meta.toggleBoxState(button, true);
+ }
+
+ var advanced = new dbxGroup(
+ 'advancedstuff', // container ID [/-_a-zA-Z0-9/]
+ 'vertical', // orientation ['vertical'|'horizontal']
+ '10', // drag threshold ['n' pixels]
+ 'yes', // restrict drag movement to container axis ['yes'|'no']
+ '10', // animate re-ordering [frames per transition, or '0' for no effect]
+ 'yes', // include open/close toggle buttons ['yes'|'no']
+ 'closed', // default state ['open'|'closed']
+ 'open', // word for "open", as in "open this box"
+ 'close', // word for "close", as in "close this box"
+ 'click-down and drag to move this box', // sentence for "move this box" by mouse
+ 'click to %toggle% this box', // pattern-match sentence for "(open|close) this box" by mouse
+ 'use the arrow keys to move this box', // sentence for "move this box" by keyboard
+ ', or press the enter key to %toggle% it', // pattern-match sentence-fragment for "(open|close) this box" by keyboard
+ '%mytitle% [%dbxtitle%]' // pattern-match syntax for title-attribute conflicts
+ );
+});
diff --git a/wp-inst/wp-admin/edit-category-form.php b/wp-inst/wp-admin/edit-category-form.php
new file mode 100644
index 0000000..0063578
--- /dev/null
+++ b/wp-inst/wp-admin/edit-category-form.php
@@ -0,0 +1,50 @@
+<?php
+if ( ! empty($cat_ID) ) {
+ $heading = __('Edit Category');
+ $submit_text = __('Edit Category &raquo;');
+ $form = '<form name="editcat" id="editcat" method="post" action="categories.php">';
+ $action = 'editedcat';
+ $nonce_action = 'update-category_' . $cat_ID;
+} else {
+ $heading = __('Add Category');
+ $submit_text = __('Add Category &raquo;');
+ $form = '<form name="addcat" id="addcat" method="post" action="categories.php">';
+ $action = 'addcat';
+ $nonce_action = 'add-category';
+}
+?>
+
+<div class="wrap">
+<h2><?php echo $heading ?></h2>
+<?php echo $form ?>
+<input type="hidden" name="action" value="<?php echo $action ?>" />
+<input type="hidden" name="cat_ID" value="<?php echo $category->cat_ID ?>" />
+<?php wp_nonce_field($nonce_action); ?>
+ <table class="editform" width="100%" cellspacing="2" cellpadding="5">
+ <tr>
+ <th width="33%" scope="row" valign="top"><label for="cat_name"><?php _e('Category name:') ?></label></th>
+ <td width="67%"><input name="cat_name" id="cat_name" type="text" value="<?php echo wp_specialchars($category->cat_name); ?>" size="40" />
+ <div style='display:none; height: 100px; width: 200px; overflow: auto; border: 1px solid #ccc; background: #eee; margin: 5px; padding: 5px;' id="searchresults"><?php _e( 'Search Results' ) ?></div>
+ <?php AJAX_search_box( "wpmu-edit.php?action=searchcategories&search=", "cat_name", "searchresults" ); ?></td>
+ </tr>
+ <tr>
+ <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 wp_specialchars($category->category_nicename); ?>" size="40" /></td>
+ </tr>
+ <tr>
+ <th scope="row" valign="top"><label for="category_parent"><?php _e('Category parent:') ?></label></th>
+ <td>
+ <select name='category_parent' id='category_parent'>
+ <option value='0' <?php if (!$category->category_parent) echo " selected='selected'"; ?>><?php _e('None') ?></option>
+ <?php wp_dropdown_cats($category->cat_ID, $category->category_parent); ?>
+ </select></td>
+ </tr>
+ <tr>
+ <th scope="row" valign="top"><label for="category_description"><?php _e('Description: (optional)') ?></label></th>
+ <td><textarea name="category_description" id="category_description" rows="5" cols="50" style="width: 97%;"><?php echo wp_specialchars($category->category_description, 1); ?></textarea></td>
+ </tr>
+ </table>
+<p class="submit"><input type="submit" name="submit" value="<?php echo $submit_text ?>" /></p>
+<div id="ajax-response"></div>
+</form>
+</div>
diff --git a/wp-inst/wp-admin/edit-comments.js b/wp-inst/wp-admin/edit-comments.js
new file mode 100644
index 0000000..193dd48
--- /dev/null
+++ b/wp-inst/wp-admin/edit-comments.js
@@ -0,0 +1,5 @@
+addLoadEvent(function() {theList.dimComplete = function(what,id,dimClass) {
+ var m = document.getElementById('awaitmod');
+ if ( document.getElementById(what + '-' + id).className.match(dimClass) ) m.innerHTML = parseInt(m.innerHTML,10) + 1;
+ else m.innerHTML = parseInt(m.innerHTML,10) - 1;
+}});
diff --git a/wp-inst/wp-admin/export.php b/wp-inst/wp-admin/export.php
new file mode 100644
index 0000000..8894f29
--- /dev/null
+++ b/wp-inst/wp-admin/export.php
@@ -0,0 +1,106 @@
+<?php
+require_once ('admin.php');
+$title = __('Export');
+$parent_file = 'edit.php';
+
+if ( isset( $_GET['download'] ) )
+ export_wp();
+
+require_once ('admin-header.php');
+?>
+
+<div class="wrap">
+<h2><?php _e('Export'); ?></h2>
+<p><?php _e('This will allow you to download an export of your WordPress posts and comments in a XML format.'); ?></p>
+<p>We need some more text here. Maybe talking about the export file or how to save it.</p>
+<form action="" method="get">
+<p class="submit"><input type="submit" name="submit" value="<?php _e('Download Export File'); ?> &raquo;" />
+<input type="hidden" name="download" value="true" />
+</p>
+</form>
+</div>
+
+<?php
+
+function export_wp() {
+ global $wpdb, $posts, $post;
+ $filename = 'wordpress.' . date('Y-m-d') . '.xml';
+header('Content-Description: File Transfer');
+header('Content-Type: application/octet-stream');
+header("Content-Disposition: attachment; filename=$filename");
+header('Content-type: text/xml; charset=' . get_settings('blog_charset'), true);
+//$posts = query_posts('');
+$posts = $wpdb->get_results("SELECT * FROM $wpdb->posts ORDER BY post_date_gmt ASC");
+?>
+<!-- generator="wordpress/<?php bloginfo_rss('version') ?>" created="<?php echo date('Y-m-d H:m'); ?>"-->
+<rss version="2.0"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
+ xmlns:wfw="http://wellformedweb.org/CommentAPI/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:wp="http://wordpress.org/export/1.0/"
+>
+
+<channel>
+ <title><?php bloginfo_rss('name'); ?></title>
+ <link><?php bloginfo_rss('url') ?></link>
+ <description><?php bloginfo_rss("description") ?></description>
+ <pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_lastpostmodified('GMT'), false); ?></pubDate>
+ <generator>http://wordpress.org/?v=<?php bloginfo_rss('version'); ?></generator>
+ <language><?php echo get_option('rss_language'); ?></language>
+ <?php do_action('rss2_head'); ?>
+ <?php if ($posts) { foreach ($posts as $post) { start_wp(); ?>
+<item>
+<title><?php the_title_rss() ?></title>
+<link><?php permalink_single_rss() ?></link>
+<pubDate><?php echo mysql2date('D, d M Y H:i:s +0000', get_post_time('Y-m-d H:i:s', true), false); ?></pubDate>
+<dc:creator><?php the_author() ?></dc:creator>
+<?php the_category_rss() ?>
+
+<guid isPermaLink="false"><?php the_guid(); ?></guid>
+<description></description>
+<content:encoded><![CDATA[<?php echo $post->post_content ?>]]></content:encoded>
+<wp:post_date><?php echo $post->post_date; ?></wp:post_date>
+<wp:post_date_gmt><?php echo $post->post_date_gmt; ?></wp:post_date_gmt>
+<wp:comment_status><?php echo $post->comment_status; ?></wp:comment_status>
+<wp:ping_status><?php echo $post->ping_status; ?></wp:ping_status>
+<wp:post_name><?php echo $post->post_name; ?></wp:post_name>
+<wp:status><?php echo $post->post_status; ?></wp:status>
+<wp:post_parent><?php echo $post->post_parent; ?></wp:post_parent>
+<wp:post_type><?php echo $post->post_type; ?></wp:post_type>
+<?php
+$postmeta = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE post_id = $post->ID");
+if ( $postmeta ) {
+?>
+<?php foreach( $postmeta as $meta ) { ?>
+<wp:postmeta>
+<wp:meta_key><?php echo $meta->meta_key; ?></wp:meta_key>
+<wp:meta_value><?Php echo $meta->meta_value; ?></wp:meta_value>
+</wp:postmeta>
+<?php } ?>
+<?php } ?>
+<?php
+$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = $post->ID");
+if ( $comments ) { foreach ( $comments as $c ) { ?>
+<wp:comment>
+<wp:comment_author><?php echo $c->comment_author; ?></wp:comment_author>
+<wp:comment_author_email><?php echo $c->comment_author_email; ?></wp:comment_author_email>
+<wp:comment_author_url><?php echo $c->comment_author_url; ?></wp:comment_author_url>
+<wp:comment_author_IP><?php echo $c->comment_author_IP; ?></wp:comment_author_IP>
+<wp:comment_date><?php echo $c->comment_date; ?></wp:comment_date>
+<wp:comment_date_gmt><?php echo $c->comment_date_gmt; ?></wp:comment_date_gmt>
+<wp:comment_content><?php echo $c->comment_content; ?></wp:comment_content>
+<wp:comment_approved><?php echo $c->comment_approved; ?></wp:comment_approved>
+<wp:comment_type><?php echo $c->comment_type; ?></wp:comment_type>
+<wp:comment_parent><?php echo $c->comment_parent; ?></wp:comment_parent>
+</wp:comment>
+<?php } } ?>
+ </item>
+<?php } } ?>
+</channel>
+</rss>
+<?php
+ die();
+}
+
+include ('admin-footer.php');
+?> \ No newline at end of file
diff --git a/wp-inst/wp-admin/import/blogware.php b/wp-inst/wp-admin/import/blogware.php
new file mode 100644
index 0000000..35ab610
--- /dev/null
+++ b/wp-inst/wp-admin/import/blogware.php
@@ -0,0 +1,192 @@
+<?php
+
+/* By Shayne Sweeney - http://www.theshayne.com/ */
+
+class BW_Import {
+
+ var $file;
+
+ function header() {
+ echo '<div class="wrap">';
+ echo '<h2>'.__('Import Blogware').'</h2>';
+ }
+
+ function footer() {
+ echo '</div>';
+ }
+
+ function unhtmlentities($string) { // From php.net for < 4.3 compat
+ $trans_tbl = get_html_translation_table(HTML_ENTITIES);
+ $trans_tbl = array_flip($trans_tbl);
+ return strtr($string, $trans_tbl);
+ }
+
+ function greet() {
+ echo '<p>'.__('Howdy! This importer allows you to extract posts from Blogware XML export file into your blog. Pick a Blogware file to upload and click Import.').'</p>';
+ wp_import_upload_form("admin.php?import=blogware&amp;step=1");
+ }
+
+ function import_posts() {
+ global $wpdb, $current_user;
+
+ set_magic_quotes_runtime(0);
+ $importdata = file($this->file); // Read the file into an array
+ $importdata = implode('', $importdata); // squish it
+ $importdata = str_replace(array ("\r\n", "\r"), "\n", $importdata);
+
+ preg_match_all('|(<item[^>]+>(.*?)</item>)|is', $importdata, $posts);
+ $posts = $posts[1];
+ unset($importdata);
+ echo '<ol>';
+ foreach ($posts as $post) {
+ flush();
+ preg_match('|<item type=\"(.*?)\">|is', $post, $post_type);
+ $post_type = $post_type[1];
+ if($post_type == "photo") {
+ preg_match('|<photoFilename>(.*?)</photoFilename>|is', $post, $post_title);
+ } else {
+ preg_match('|<title>(.*?)</title>|is', $post, $post_title);
+ }
+ $post_title = $wpdb->escape(trim($post_title[1]));
+
+ preg_match('|<pubDate>(.*?)</pubDate>|is', $post, $post_date);
+ $post_date = strtotime($post_date[1]);
+ $post_date = gmdate('Y-m-d H:i:s', $post_date);
+
+ preg_match_all('|<category>(.*?)</category>|is', $post, $categories);
+ $categories = $categories[1];
+
+ $cat_index = 0;
+ foreach ($categories as $category) {
+ $categories[$cat_index] = $wpdb->escape($this->unhtmlentities($category));
+ $cat_index++;
+ }
+
+ if(strcasecmp($post_type, "photo") === 0) {
+ preg_match('|<sizedPhotoUrl>(.*?)</sizedPhotoUrl>|is', $post, $post_content);
+ $post_content = '<img src="'.trim($post_content[1]).'" />';
+ $post_content = $this->unhtmlentities($post_content);
+ } else {
+ preg_match('|<body>(.*?)</body>|is', $post, $post_content);
+ $post_content = str_replace(array ('<![CDATA[', ']]>'), '', trim($post_content[1]));
+ $post_content = $this->unhtmlentities($post_content);
+ }
+
+ // Clean up content
+ $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$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);
+
+ $post_author = $current_user->ID;
+ preg_match('|<postStatus>(.*?)</postStatus>|is', $post, $post_status);
+ $post_status = trim($post_status[1]);
+
+ echo '<li>';
+ if ($post_id = post_exists($post_title, $post_content, $post_date)) {
+ printf(__('Post <i>%s</i> already exists.'), stripslashes($post_title));
+ } else {
+ printf(__('Importing post <i>%s</i>...'), stripslashes($post_title));
+ $postdata = compact('post_author', 'post_date', 'post_content', 'post_title', 'post_status');
+ $post_id = wp_insert_post($postdata);
+ if (!$post_id) {
+ _e("Couldn't get post ID");
+ echo '</li>';
+ break;
+ }
+ if(0 != count($categories))
+ wp_create_categories($categories, $post_id);
+ }
+
+ preg_match_all('|<comment>(.*?)</comment>|is', $post, $comments);
+ $comments = $comments[1];
+
+ if ( $comments ) {
+ $comment_post_ID = $post_id;
+ $num_comments = 0;
+ foreach ($comments as $comment) {
+ preg_match('|<body>(.*?)</body>|is', $comment, $comment_content);
+ $comment_content = str_replace(array ('<![CDATA[', ']]>'), '', trim($comment_content[1]));
+ $comment_content = $this->unhtmlentities($comment_content);
+
+ // Clean up content
+ $comment_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$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);
+
+ preg_match('|<pubDate>(.*?)</pubDate>|is', $comment, $comment_date);
+ $comment_date = trim($comment_date[1]);
+ $comment_date = date('Y-m-d H:i:s', strtotime($comment_date));
+
+ preg_match('|<author>(.*?)</author>|is', $comment, $comment_author);
+ $comment_author = $wpdb->escape(trim($comment_author[1]));
+
+ $comment_author_email = NULL;
+
+ $comment_approved = 1;
+ // Check if it's already there
+ if (!comment_exists($comment_author, $comment_date)) {
+ $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_date', 'comment_content', 'comment_approved');
+ $commentdata = wp_filter_comment($commentdata);
+ wp_insert_comment($commentdata);
+ $num_comments++;
+ }
+ }
+ }
+ if ( $num_comments ) {
+ echo ' ';
+ printf(__('(%s comments)'), $num_comments);
+ }
+ echo '</li>';
+ flush();
+ ob_flush();
+ }
+ echo '</ol>';
+ }
+
+ function import() {
+ $file = wp_import_handle_upload();
+ if ( isset($file['error']) ) {
+ echo $file['error'];
+ return;
+ }
+
+ $this->file = $file['file'];
+ $this->import_posts();
+ wp_import_cleanup($file['id']);
+
+ echo '<h3>';
+ printf(__('All done. <a href="%s">Have fun!</a>'), get_option('home'));
+ echo '</h3>';
+ }
+
+ function dispatch() {
+ if (empty ($_GET['step']))
+ $step = 0;
+ else
+ $step = (int) $_GET['step'];
+
+ $this->header();
+
+ switch ($step) {
+ case 0 :
+ $this->greet();
+ break;
+ case 1 :
+ $this->import();
+ break;
+ }
+
+ $this->footer();
+ }
+
+ function BW_Import() {
+ // Nothing.
+ }
+}
+
+$blogware_import = new BW_Import();
+
+register_importer('blogware', 'Blogware', __('Import posts from Blogware'), array ($blogware_import, 'dispatch'));
+?>
diff --git a/wp-inst/wp-admin/import/wordpress.php b/wp-inst/wp-admin/import/wordpress.php
new file mode 100644
index 0000000..11c9f3e
--- /dev/null
+++ b/wp-inst/wp-admin/import/wordpress.php
@@ -0,0 +1,311 @@
+<?php
+
+class WP_Import {
+
+ var $posts = array ();
+ var $file;
+ var $id;
+ var $mtnames = array ();
+ var $newauthornames = array ();
+ var $j = -1;
+
+ function header() {
+ echo '<div class="wrap">';
+ echo '<h2>'.__('Import WordPress').'</h2>';
+ }
+
+ function footer() {
+ echo '</div>';
+ }
+
+ function unhtmlentities($string) { // From php.net for < 4.3 compat
+ $trans_tbl = get_html_translation_table(HTML_ENTITIES);
+ $trans_tbl = array_flip($trans_tbl);
+ return strtr($string, $trans_tbl);
+ }
+
+ function greet() {
+ echo '<p>'.__('Howdy! Upload your WordPress eXtended RSS (WXR) file and we&#8217;ll import the posts and comments into this blog.').'</p>';
+ wp_import_upload_form("admin.php?import=wordpress&amp;step=1");
+ }
+
+ function get_tag( $string, $tag ) {
+ preg_match("|<$tag.*?>(.*?)</$tag>|is", $string, $return);
+ $return = addslashes( trim( $return[1] ) );
+ return $return;
+ }
+
+ function users_form($n) {
+ global $wpdb, $testing;
+ $users = $wpdb->get_results("SELECT * FROM $wpdb->users ORDER BY ID");
+?><select name="userselect[<?php echo $n; ?>]">
+ <option value="#NONE#">- Select -</option>
+ <?php
+ foreach ($users as $user) {
+ echo '<option value="'.$user->user_login.'">'.$user->user_login.'</option>';
+ }
+?>
+ </select>
+ <?php
+ }
+
+ //function to check the authorname and do the mapping
+ function checkauthor($author) {
+ global $wpdb;
+ //mtnames is an array with the names in the mt import file
+ $pass = 'changeme';
+ if (!(in_array($author, $this->mtnames))) { //a new mt author name is found
+ ++ $this->j;
+ $this->mtnames[$this->j] = $author; //add that new mt author name to an array
+ $user_id = username_exists($this->newauthornames[$this->j]); //check if the new author name defined by the user is a pre-existing wp user
+ if (!$user_id) { //banging my head against the desk now.
+ if ($newauthornames[$this->j] == 'left_blank') { //check if the user does not want to change the authorname
+ $user_id = wp_create_user($author, $pass);
+ $this->newauthornames[$this->j] = $author; //now we have a name, in the place of left_blank.
+ } else {
+ $user_id = wp_create_user($this->newauthornames[$this->j], $pass);
+ }
+ } else {
+ return $user_id; // return pre-existing wp username if it exists
+ }
+ } else {
+ $key = array_search($author, $this->mtnames); //find the array key for $author in the $mtnames array
+ $user_id = username_exists($this->newauthornames[$key]); //use that key to get the value of the author's name from $newauthornames
+ }
+
+ return $user_id;
+ }
+
+ function get_entries() {
+ set_magic_quotes_runtime(0);
+ $importdata = file($this->file); // Read the file into an array
+ $importdata = implode('', $importdata); // squish it
+ $importdata = preg_replace("/(\r\n|\n|\r)/", "\n", $importdata);
+ preg_match_all('|<item>(.*?)</item>|is', $importdata, $this->posts);
+ $this->posts = $this->posts[1];
+ }
+
+ function get_wp_authors() {
+ $temp = array ();
+ $i = -1;
+ foreach ($this->posts as $post) {
+ if ('' != trim($post)) {
+ ++ $i;
+ $author = $this->get_tag( $post, 'dc:creator' );
+ array_push($temp, "$author"); //store the extracted author names in a temporary array
+ }
+ }
+
+ // We need to find unique values of author names, while preserving the order, so this function emulates the unique_value(); php function, without the sorting.
+ $authors[0] = array_shift($temp);
+ $y = count($temp) + 1;
+ for ($x = 1; $x < $y; $x ++) {
+ $next = array_shift($temp);
+ if (!(in_array($next, $authors)))
+ array_push($authors, "$next");
+ }
+
+ return $authors;
+ }
+
+ function get_authors_from_post() {
+ $formnames = array ();
+ $selectnames = array ();
+
+ foreach ($_POST['user'] as $key => $line) {
+ $newname = trim(stripslashes($line));
+ if ($newname == '')
+ $newname = 'left_blank'; //passing author names from step 1 to step 2 is accomplished by using POST. left_blank denotes an empty entry in the form.
+ array_push($formnames, "$newname");
+ } // $formnames is the array with the form entered names
+
+ foreach ($_POST['userselect'] as $user => $key) {
+ $selected = trim(stripslashes($key));
+ array_push($selectnames, "$selected");
+ }
+
+ $count = count($formnames);
+ for ($i = 0; $i < $count; $i ++) {
+ if ($selectnames[$i] != '#NONE#') { //if no name was selected from the select menu, use the name entered in the form
+ array_push($this->newauthornames, "$selectnames[$i]");
+ } else {
+ array_push($this->newauthornames, "$formnames[$i]");
+ }
+ }
+ }
+
+ function wp_authors_form() {
+?>
+<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>
+<p><?php _e('If a new user is created by WordPress, the password will be set, by default, to "changeme". Quite suggestive, eh? ;)'); ?></p>
+ <?php
+
+
+ $authors = $this->get_wp_authors();
+ echo '<ol id="authors">';
+ echo '<form action="?import=wordpress&amp;step=2&amp;id=' . $this->id . '" method="post">';
+ $j = -1;
+ foreach ($authors as $author) {
+ ++ $j;
+ echo '<li>Current author: <strong>'.$author.'</strong><br />'.'Create user <input type="text" value="'.$author.'" name="'.'user[]'.'" maxlength="30"> <br /> or map to existing ';
+ $this->users_form($j);
+ echo '</li>';
+ }
+
+ echo '<input type="submit" value="Submit">'.'<br/>';
+ echo '</form>';
+ echo '</ol>';
+
+ }
+
+ function select_authors() {
+ $file = wp_import_handle_upload();
+ if ( isset($file['error']) ) {
+ $this->header();
+ echo '<p>Sorry, there has been an error.</p>';
+ echo '<p><strong>' . $file['error'] . '</strong></p>';
+ $this->footer();
+ return;
+ }
+ $this->file = $file['file'];
+ $this->id = $file['id'];
+
+ $this->get_entries();
+ $this->wp_authors_form();
+ }
+
+ function process_posts() {
+ global $wpdb;
+ $i = -1;
+ echo '<ol>';
+ foreach ($this->posts as $post) {
+
+ // There are only ever one of these
+ $post_title = $this->get_tag( $post, 'title' );
+ $post_date = $this->get_tag( $post, 'wp:post_date' );
+ $post_date_gmt = $this->get_tag( $post, 'wp:post_date_gmt' );
+ $comment_status = $this->get_tag( $post, 'wp:comment_status' );
+ $ping_status = $this->get_tag( $post, 'wp:ping_status' );
+ $post_status = $this->get_tag( $post, 'wp:status' );
+ $post_parent = $this->get_tag( $post, 'wp:post_parent' );
+ $post_type = $this->get_tag( $post, 'wp:post_type' );
+ $guid = $this->get_tag( $post, 'guid' );
+ $post_author = $this->get_tag( $post, 'dc:creator' );
+
+ $post_content = $this->get_tag( $post, 'content:encoded' );
+ $post_content = str_replace(array ('<![CDATA[', ']]>'), '', $post_content);
+ $post_content = preg_replace('|<(/?[A-Z]+)|e', "'<' . strtolower('$1')", $post_content);
+ $post_content = str_replace('<br>', '<br />', $post_content);
+ $post_content = str_replace('<hr>', '<hr />', $post_content);
+
+ preg_match_all('|<category>(.*?)</category>|is', $post, $categories);
+ $categories = $categories[1];
+
+ $cat_index = 0;
+ foreach ($categories as $category) {
+ $categories[$cat_index] = $wpdb->escape($this->unhtmlentities($category));
+ $cat_index++;
+ }
+
+ if ($post_id = post_exists($post_title, '', $post_date)) {
+ echo '<li>';
+ printf(__('Post <i>%s</i> already exists.'), stripslashes($post_title));
+ } else {
+ echo '<li>';
+ printf(__('Importing post <i>%s</i>...'), stripslashes($post_title));
+
+ $post_author = $this->checkauthor($post_author); //just so that if a post already exists, new users are not created by checkauthor
+
+ $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_excerpt', 'post_status', 'comment_status', 'ping_status', 'post_modified', 'post_modified_gmt', 'guid', 'post_parent', 'post_type');
+ $comment_post_ID = $post_id = wp_insert_post($postdata);
+ // Add categories.
+ if (0 != count($categories)) {
+ wp_create_categories($categories, $post_id);
+ }
+ }
+
+ // Now for comments
+ preg_match_all('|<wp:comment>(.*?)</wp:comment>|is', $post, $comments);
+ $comments = $comments[1];
+ $num_comments = 0;
+ 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 ( !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++;
+ }
+ } }
+ if ( $num_comments )
+ printf(__(' (%s comments)'), $num_comments);
+
+ // Now for post meta
+ preg_match_all('|<wp:postmeta>(.*?)</wp:postmeta>|is', $post, $postmeta);
+ $postmeta = $postmeta[1];
+ if ( $postmeta) { foreach ($postmeta as $p) {
+ $key = $this->get_tag( $p, 'wp:meta_key' );
+ $value = $this->get_tag( $p, 'wp:meta_value' );
+ add_post_meta( $post_id, $key, $value );
+ } }
+
+ $index++;
+ }
+
+ echo '</ol>';
+
+ wp_import_cleanup($this->id);
+
+ echo '<h3>'.sprintf(__('All done. <a href="%s">Have fun!</a>'), get_option('home')).'</h3>';
+ }
+
+ function import() {
+ $this->id = (int) $_GET['id'];
+
+ $this->file = get_attached_file($this->id);
+ $this->get_authors_from_post();
+ $this->get_entries();
+ $this->process_posts();
+ }
+
+ function dispatch() {
+ if (empty ($_GET['step']))
+ $step = 0;
+ else
+ $step = (int) $_GET['step'];
+
+ $this->header();
+ switch ($step) {
+ case 0 :
+ $this->greet();
+ break;
+ case 1 :
+ $this->select_authors();
+ break;
+ case 2:
+ $this->import();
+ break;
+ }
+ $this->footer();
+ }
+
+ function WP_Import() {
+ // Nothing.
+ }
+}
+
+$wp_import = new WP_Import();
+
+register_importer('wordpress', 'WordPress', __('Import posts from a WordPress export file'), array ($wp_import, 'dispatch'));
+
+?>
diff --git a/wp-inst/wp-admin/options-privacy.php b/wp-inst/wp-admin/options-privacy.php
new file mode 100644
index 0000000..17d0364
--- /dev/null
+++ b/wp-inst/wp-admin/options-privacy.php
@@ -0,0 +1,36 @@
+<?php
+require_once('./admin.php');
+
+$title = __('Privacy Options');
+$parent_file = 'options-general.php';
+
+include('./admin-header.php');
+?>
+
+<div class="wrap">
+<h2><?php _e('Privacy Options') ?></h2>
+<form method="post" action="options.php">
+<?php wp_nonce_field('update-options') ?>
+<table class="optiontable">
+<tr valign="top">
+<th scope="row"><?php _e('Blog visibility:') ?> </th>
+<td>
+<input id="blog-public" type="radio" name="blog_public" value="1" <?php checked('1', get_option('blog_public')); ?> />
+<label for="blog-public">I would like my blog to be visible to anyone who visits, including search engines and archivers</label>
+<br />
+<input id="blog-norobots" type="radio" name="blog_public" value="0" <?php checked('0', get_option('blog_public')); ?> />
+<label for="blog-norobots">I would like to block search engines, but allow normal folks</label>
+<?php do_action('blog_privacy_selector'); ?>
+</td>
+</tr>
+</table>
+
+<p class="submit"><input type="submit" name="Submit" value="<?php _e('Update Options &raquo;') ?>" />
+<input type="hidden" name="action" value="update" />
+<input type="hidden" name="page_options" value="blog_public" />
+</p>
+</form>
+
+</div>
+
+<?php include('./admin-footer.php') ?>
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/paste/blank.htm b/wp-inst/wp-includes/js/tinymce/plugins/paste/blank.htm
new file mode 100644
index 0000000..1ddf829
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/paste/blank.htm
@@ -0,0 +1,19 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>blank_page</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <script language="javascript">
+ function init() {
+ document.body.contentEditable = true;
+ document.designMode = 'on';
+ parent.initIframe(document);
+ window.focus();
+ }
+ </script>
+ <link href="css/blank.css" rel="stylesheet" type="text/css" />
+ <base target="_self" />
+</head>
+<body onload="init();">
+
+</body>
+</html>
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/paste/css/blank.css b/wp-inst/wp-includes/js/tinymce/plugins/paste/css/blank.css
new file mode 100644
index 0000000..eca411a
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/paste/css/blank.css
@@ -0,0 +1,13 @@
+body {
+ background-color: #FFFFFF;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+ scrollbar-3dlight-color: #F0F0EE;
+ scrollbar-arrow-color: #676662;
+ scrollbar-base-color: #F0F0EE;
+ scrollbar-darkshadow-color: #DDDDDD;
+ scrollbar-face-color: #E0E0DD;
+ scrollbar-highlight-color: #F0F0EE;
+ scrollbar-shadow-color: #F0F0EE;
+ scrollbar-track-color: #F5F5F5;
+}
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/paste/css/pasteword.css b/wp-inst/wp-includes/js/tinymce/plugins/paste/css/pasteword.css
new file mode 100644
index 0000000..b3be627
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/paste/css/pasteword.css
@@ -0,0 +1,3 @@
+.sourceIframe {
+ border: 1px solid #808080;
+}
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/paste/editor_plugin.js b/wp-inst/wp-includes/js/tinymce/plugins/paste/editor_plugin.js
new file mode 100644
index 0000000..916e29f
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/paste/editor_plugin.js
@@ -0,0 +1,388 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.36 $
+ * $Date: 2006/03/20 12:03:44 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+/* Import plugin specific language pack */
+tinyMCE.importPluginLanguagePack('paste', 'en,tr,sv,cs,zh_cn,fr_ca,da,he,nb,de,hu,ru,ru_KOI8-R,ru_UTF-8,nn,fi,es,cy,is,pl,nl,fr,pt_br');
+
+var TinyMCE_PastePlugin = {
+ getInfo : function() {
+ return {
+ longname : 'Paste text/word',
+ author : 'Moxiecode Systems',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_paste.html',
+ version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+ };
+ },
+
+ initInstance : function(inst) {
+ if (tinyMCE.isMSIE && tinyMCE.getParam("paste_auto_cleanup_on_paste", false))
+ tinyMCE.addEvent(inst.getBody(), "paste", TinyMCE_PastePlugin._handlePasteEvent);
+ },
+
+ getControlHTML : function(cn) {
+ switch (cn) {
+ case "pastetext":
+ return tinyMCE.getButtonHTML(cn, 'lang_paste_text_desc', '{$pluginurl}/images/pastetext.gif', 'mcePasteText', true);
+
+ case "pasteword":
+ return tinyMCE.getButtonHTML(cn, 'lang_paste_word_desc', '{$pluginurl}/images/pasteword.gif', 'mcePasteWord', true);
+
+ case "selectall":
+ return tinyMCE.getButtonHTML(cn, 'lang_selectall_desc', '{$pluginurl}/images/selectall.gif', 'mceSelectAll', true);
+ }
+
+ return '';
+ },
+
+ execCommand : function(editor_id, element, command, user_interface, value) {
+ switch (command) {
+ case "mcePasteText":
+ if (user_interface) {
+ if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && !tinyMCE.getParam('paste_use_dialog', false))
+ TinyMCE_PastePlugin._insertText(clipboardData.getData("Text"), true);
+ else {
+ var template = new Array();
+ template['file'] = '../../plugins/paste/pastetext.htm'; // Relative to theme
+ template['width'] = 450;
+ template['height'] = 400;
+ var plain_text = "";
+ tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", inline : "yes", mceDo : 'insert'});
+ }
+ } else
+ TinyMCE_PastePlugin._insertText(value['html'], value['linebreaks']);
+
+ return true;
+
+ case "mcePasteWord":
+ if (user_interface) {
+ if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && !tinyMCE.getParam('paste_use_dialog', false)) {
+ var html = TinyMCE_PastePlugin._clipboardHTML();
+
+ if (html && html.length > 0)
+ TinyMCE_PastePlugin._insertWordContent(html);
+ } else {
+ var template = new Array();
+ template['file'] = '../../plugins/paste/pasteword.htm'; // Relative to theme
+ template['width'] = 450;
+ template['height'] = 400;
+ var plain_text = "";
+ tinyMCE.openWindow(template, {editor_id : editor_id, plain_text: plain_text, resizable : "yes", scrollbars : "no", inline : "yes", mceDo : 'insert'});
+ }
+ } else
+ TinyMCE_PastePlugin._insertWordContent(value);
+
+ return true;
+
+ case "mceSelectAll":
+ tinyMCE.execInstanceCommand(editor_id, 'selectall');
+ return true;
+
+ }
+
+ // Pass to next handler in chain
+ return false;
+ },
+
+ // Private plugin internal methods
+
+ _handlePasteEvent : function(e) {
+ switch (e.type) {
+ case "paste":
+ var html = TinyMCE_PastePlugin._clipboardHTML();
+ var r, inst = tinyMCE.selectedInstance;
+
+ // Removes italic, strong etc, the if was needed due to bug #1437114
+ if (inst && (r = inst.getRng()) && r.text.length > 0)
+ tinyMCE.execCommand('delete');
+
+ if (html && html.length > 0)
+ tinyMCE.execCommand('mcePasteWord', false, html);
+
+ tinyMCE.cancelEvent(e);
+ return false;
+ }
+
+ return true;
+ },
+
+ _insertText : function(content, bLinebreaks) {
+ if (content && content.length > 0) {
+ if (bLinebreaks) {
+ // Special paragraph treatment
+ if (tinyMCE.getParam("paste_create_paragraphs", true)) {
+ var rl = tinyMCE.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
+ for (var i=0; i<rl.length; i+=2)
+ content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]);
+
+ content = tinyMCE.regexpReplace(content, "\r\n\r\n", "</p><p>", "gi");
+ content = tinyMCE.regexpReplace(content, "\r\r", "</p><p>", "gi");
+ content = tinyMCE.regexpReplace(content, "\n\n", "</p><p>", "gi");
+
+ // Has paragraphs
+ if ((pos = content.indexOf('</p><p>')) != -1) {
+ tinyMCE.execCommand("Delete");
+
+ var node = tinyMCE.selectedInstance.getFocusElement();
+
+ // Get list of elements to break
+ var breakElms = new Array();
+
+ do {
+ if (node.nodeType == 1) {
+ // Don't break tables and break at body
+ if (node.nodeName == "TD" || node.nodeName == "BODY")
+ break;
+
+ breakElms[breakElms.length] = node;
+ }
+ } while(node = node.parentNode);
+
+ var before = "", after = "</p>";
+ before += content.substring(0, pos);
+
+ for (var i=0; i<breakElms.length; i++) {
+ before += "</" + breakElms[i].nodeName + ">";
+ after += "<" + breakElms[(breakElms.length-1)-i].nodeName + ">";
+ }
+
+ before += "<p>";
+ content = before + content.substring(pos+7) + after;
+ }
+ }
+
+ if (tinyMCE.getParam("paste_create_linebreaks", true)) {
+ content = tinyMCE.regexpReplace(content, "\r\n", "<br />", "gi");
+ content = tinyMCE.regexpReplace(content, "\r", "<br />", "gi");
+ content = tinyMCE.regexpReplace(content, "\n", "<br />", "gi");
+ }
+ }
+
+ tinyMCE.execCommand("mceInsertRawHTML", false, content);
+ }
+ },
+
+ _insertWordContent : function(content) {
+ if (content && content.length > 0) {
+ // Cleanup Word content
+ var bull = String.fromCharCode(8226);
+ var middot = String.fromCharCode(183);
+ var cb;
+
+ if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "")
+ content = eval(cb + "('before', content)");
+
+ var rl = tinyMCE.getParam("paste_replace_list", '\u2122,<sup>TM</sup>,\u2026,...,\u201c|\u201d,",\u2019,\',\u2013|\u2014|\u2015|\u2212,-').split(',');
+ for (var i=0; i<rl.length; i+=2)
+ content = content.replace(new RegExp(rl[i], 'gi'), rl[i+1]);
+
+ if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) {
+ content = content.replace(new RegExp('<p class=MsoHeading.*?>(.*?)<\/p>', 'gi'), '<p><b>$1</b></p>');
+ }
+
+ content = content.replace(new RegExp('tab-stops: list [0-9]+.0pt">', 'gi'), '">' + "--list--");
+ content = content.replace(new RegExp(bull + "(.*?)<BR>", "gi"), "<p>" + middot + "$1</p>");
+ content = content.replace(new RegExp('<SPAN style="mso-list: Ignore">', 'gi'), "<span>" + bull); // Covert to bull list
+ content = content.replace(/<o:p><\/o:p>/gi, "");
+ content = content.replace(new RegExp('<br style="page-break-before: always;.*>', 'gi'), '-- page break --'); // Replace pagebreaks
+ content = content.replace(new RegExp('<(!--)([^>]*)(--)>', 'g'), ""); // Word comments
+
+ if (tinyMCE.getParam("paste_remove_spans", true))
+ content = content.replace(/<\/?span[^>]*>/gi, "");
+
+ if (tinyMCE.getParam("paste_remove_styles", true))
+ content = content.replace(new RegExp('<(\\w[^>]*) style="([^"]*)"([^>]*)', 'gi'), "<$1$3");
+
+ content = content.replace(/<\/?font[^>]*>/gi, "");
+
+ // Strips class attributes.
+ switch (tinyMCE.getParam("paste_strip_class_attributes", "all")) {
+ case "all":
+ content = content.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3");
+ break;
+
+ case "mso":
+ content = content.replace(new RegExp('<(\\w[^>]*) class="?mso([^ |>]*)([^>]*)', 'gi'), "<$1$3");
+ break;
+ }
+
+ content = content.replace(new RegExp('href="?' + TinyMCE_PastePlugin._reEscape("" + document.location) + '', 'gi'), 'href="' + tinyMCE.settings['document_base_url']);
+ content = content.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3");
+ content = content.replace(/<\\?\?xml[^>]*>/gi, "");
+ content = content.replace(/<\/?\w+:[^>]*>/gi, "");
+ content = content.replace(/-- page break --\s*<p>&nbsp;<\/p>/gi, ""); // Remove pagebreaks
+ content = content.replace(/-- page break --/gi, ""); // Remove pagebreaks
+
+ // content = content.replace(/\/?&nbsp;*/gi, ""); &nbsp;
+ // content = content.replace(/<p>&nbsp;<\/p>/gi, '');
+
+ if (!tinyMCE.settings['force_p_newlines']) {
+ content = content.replace('', '' ,'gi');
+ content = content.replace('</p>', '<br /><br />' ,'gi');
+ }
+
+ if (!tinyMCE.isMSIE && !tinyMCE.settings['force_p_newlines']) {
+ content = content.replace(/<\/?p[^>]*>/gi, "");
+ }
+
+ content = content.replace(/<\/?div[^>]*>/gi, "");
+
+ // Convert all middlot lists to UL lists
+ if (tinyMCE.getParam("paste_convert_middot_lists", true)) {
+ var div = document.createElement("div");
+ div.innerHTML = content;
+
+ // Convert all middot paragraphs to li elements
+ var className = tinyMCE.getParam("paste_unindented_list_class", "unIndentedList");
+
+ while (TinyMCE_PastePlugin._convertMiddots(div, "--list--")) ; // bull
+ while (TinyMCE_PastePlugin._convertMiddots(div, middot, className)) ; // Middot
+ while (TinyMCE_PastePlugin._convertMiddots(div, bull)) ; // bull
+
+ content = div.innerHTML;
+ }
+
+ // Replace all headers with strong and fix some other issues
+ if (tinyMCE.getParam("paste_convert_headers_to_strong", false)) {
+ content = content.replace(/<h[1-6]>&nbsp;<\/h[1-6]>/gi, '<p>&nbsp;&nbsp;</p>');
+ content = content.replace(/<h[1-6]>/gi, '<p><b>');
+ content = content.replace(/<\/h[1-6]>/gi, '</b></p>');
+ content = content.replace(/<b>&nbsp;<\/b>/gi, '<b>&nbsp;&nbsp;</b>');
+ content = content.replace(/^(&nbsp;)*/gi, '');
+ }
+
+ content = content.replace(/--list--/gi, ""); // Remove --list--
+
+ if ((cb = tinyMCE.getParam("paste_insert_word_content_callback", "")) != "")
+ content = eval(cb + "('after', content)");
+
+ // Insert cleaned content
+ tinyMCE.execCommand("mceInsertContent", false, content);
+ window.setTimeout('tinyMCE.execCommand("mceCleanup");', 1); // Do normal cleanup detached from this thread
+ }
+ },
+
+ _reEscape : function(s) {
+ var l = "?.\\*[](){}+^$:";
+ var o = "";
+
+ for (var i=0; i<s.length; i++) {
+ var c = s.charAt(i);
+
+ if (l.indexOf(c) != -1)
+ o += '\\' + c;
+ else
+ o += c;
+ }
+
+ return o;
+ },
+
+ _convertMiddots : function(div, search, class_name) {
+ var mdot = String.fromCharCode(183);
+ var bull = String.fromCharCode(8226);
+
+ var nodes = div.getElementsByTagName("p");
+ var prevul;
+ for (var i=0; i<nodes.length; i++) {
+ var p = nodes[i];
+
+ // Is middot
+ if (p.innerHTML.indexOf(search) == 0) {
+ var ul = document.createElement("ul");
+
+ if (class_name)
+ ul.className = class_name;
+
+ // Add the first one
+ var li = document.createElement("li");
+ li.innerHTML = p.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--|&nbsp;', "gi"), '');
+ ul.appendChild(li);
+
+ // Add the rest
+ var np = p.nextSibling;
+ while (np) {
+ // If the node is whitespace, then
+ // ignore it and continue on.
+ if (np.nodeType == 3 && /^\s$/m.test(np.nodeValue)) {
+ np = np.nextSibling;
+ continue;
+ }
+
+ if (search == mdot) {
+ if (np.nodeType == 1 && /^o(\s+|&nbsp;)/.test(np.innerHTML)) {
+ // Second level of nesting
+ if (!prevul) {
+ prevul = ul;
+ ul = document.createElement("ul");
+ prevul.appendChild(ul);
+ }
+ np.innerHTML = np.innerHTML.replace(/^o/, '');
+ } else {
+ // Pop the stack if we're going back up to the first level
+ if (prevul) {
+ ul = prevul;
+ prevul = null;
+ }
+ // Not element or middot paragraph
+ if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0)
+ break;
+ }
+ } else {
+ // Not element or middot paragraph
+ if (np.nodeType != 1 || np.innerHTML.indexOf(search) != 0)
+ break;
+ }
+
+ var cp = np.nextSibling;
+ var li = document.createElement("li");
+ li.innerHTML = np.innerHTML.replace(new RegExp('' + mdot + '|' + bull + '|--list--|&nbsp;', "gi"), '');
+ np.parentNode.removeChild(np);
+ ul.appendChild(li);
+ np = cp;
+ }
+
+ p.parentNode.replaceChild(ul, p);
+
+ return true;
+ }
+ }
+
+ return false;
+ },
+
+ _clipboardHTML : function() {
+ var div = document.getElementById('_TinyMCE_clipboardHTML');
+
+ if (!div) {
+ var div = document.createElement('DIV');
+ div.id = '_TinyMCE_clipboardHTML';
+
+ with (div.style) {
+ visibility = 'hidden';
+ overflow = 'hidden';
+ position = 'absolute';
+ width = 1;
+ height = 1;
+ }
+
+ document.body.appendChild(div);
+ }
+
+ div.innerHTML = '';
+ var rng = document.body.createTextRange();
+ rng.moveToElementText(div);
+ rng.execCommand('Paste');
+ var html = div.innerHTML;
+ div.innerHTML = '';
+ return html;
+ }
+};
+
+tinyMCE.addPlugin("paste", TinyMCE_PastePlugin);
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/paste/images/pastetext.gif b/wp-inst/wp-includes/js/tinymce/plugins/paste/images/pastetext.gif
new file mode 100644
index 0000000..e381cc6
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/paste/images/pastetext.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/paste/images/pasteword.gif b/wp-inst/wp-includes/js/tinymce/plugins/paste/images/pasteword.gif
new file mode 100644
index 0000000..0ccb008
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/paste/images/pasteword.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/paste/images/selectall.gif b/wp-inst/wp-includes/js/tinymce/plugins/paste/images/selectall.gif
new file mode 100644
index 0000000..c4f9901
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/paste/images/selectall.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/paste/jscripts/pastetext.js b/wp-inst/wp-includes/js/tinymce/plugins/paste/jscripts/pastetext.js
new file mode 100644
index 0000000..927745b
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/paste/jscripts/pastetext.js
@@ -0,0 +1,34 @@
+function saveContent() {
+ if (document.forms[0].htmlSource.value == '') {
+ tinyMCEPopup.close();
+ return false;
+ }
+
+ tinyMCEPopup.execCommand('mcePasteText', false, {
+ html : document.forms[0].htmlSource.value,
+ linebreaks : document.forms[0].linebreaks.checked
+ });
+
+ tinyMCEPopup.close();
+}
+
+function onLoadInit() {
+ tinyMCEPopup.resizeToInnerSize();
+
+ resizeInputs();
+}
+
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
+
+function resizeInputs() {
+ if (!tinyMCE.isMSIE) {
+ wHeight = self.innerHeight-80;
+ wWidth = self.innerWidth-17;
+ } else {
+ wHeight = document.body.clientHeight-80;
+ wWidth = document.body.clientWidth-17;
+ }
+
+ document.forms[0].htmlSource.style.height = Math.abs(wHeight) + 'px';
+ document.forms[0].htmlSource.style.width = Math.abs(wWidth) + 'px';
+}
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/paste/jscripts/pasteword.js b/wp-inst/wp-includes/js/tinymce/plugins/paste/jscripts/pasteword.js
new file mode 100644
index 0000000..c56ea81
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/paste/jscripts/pasteword.js
@@ -0,0 +1,46 @@
+function saveContent() {
+ var html = document.getElementById("frmData").contentWindow.document.body.innerHTML;
+
+ if (html == ''){
+ tinyMCEPopup.close();
+ return false;
+ }
+
+ tinyMCEPopup.execCommand('mcePasteWord', false, html);
+ tinyMCEPopup.close();
+}
+
+function onLoadInit() {
+ tinyMCEPopup.resizeToInnerSize();
+
+ // Fix for endless reloading in FF
+ window.setTimeout('createIFrame();', 10);
+}
+
+function createIFrame() {
+ document.getElementById('iframecontainer').innerHTML = '<iframe id="frmData" name="frmData" class="sourceIframe" src="blank.htm" height="280" width="400" frameborder="0" style="background-color:#FFFFFF; width:100%;" dir="ltr" wrap="soft"></iframe>';
+}
+
+var wHeight=0, wWidth=0, owHeight=0, owWidth=0;
+
+function initIframe(doc) {
+ var dir = tinyMCE.selectedInstance.settings['directionality'];
+ doc.body.dir = dir;
+ resizeInputs();
+}
+
+function resizeInputs() {
+ if (!tinyMCE.isMSIE) {
+ wHeight = self.innerHeight - 80;
+ wWidth = self.innerWidth - 18;
+ } else {
+ wHeight = document.body.clientHeight - 80;
+ wWidth = document.body.clientWidth - 18;
+ }
+
+ var elm = document.getElementById('frmData');
+ if (elm) {
+ elm.style.height = Math.abs(wHeight) + 'px';
+ elm.style.width = Math.abs(wWidth) + 'px';
+ }
+}
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/paste/langs/en.js b/wp-inst/wp-includes/js/tinymce/plugins/paste/langs/en.js
new file mode 100644
index 0000000..b125d51
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/paste/langs/en.js
@@ -0,0 +1,10 @@
+// UK lang variables
+
+tinyMCE.addToLang('',{
+paste_text_desc : 'Paste as Plain Text',
+paste_text_title : 'Use CTRL+V on your keyboard to paste the text into the window.',
+paste_text_linebreaks : 'Keep linebreaks',
+paste_word_desc : 'Paste from Word',
+paste_word_title : 'Use CTRL+V on your keyboard to paste the text into the window.',
+selectall_desc : 'Select All'
+});
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/paste/pastetext.htm b/wp-inst/wp-includes/js/tinymce/plugins/paste/pastetext.htm
new file mode 100644
index 0000000..63ff000
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/paste/pastetext.htm
@@ -0,0 +1,34 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title>{$lang_paste_text_desc}</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+ <script language="javascript" type="text/javascript" src="jscripts/pastetext.js"></script>
+ <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('onLoadInit();');" onresize="resizeInputs();" style="display: none">
+<form name="source" onsubmit="saveContent();">
+ <div style="float: left" class="title">{$lang_paste_text_desc}</div>
+
+ <div style="float: right">
+ <input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{$lang_paste_text_linebreaks}</label>
+ </div>
+
+ <br style="clear: both" />
+
+ <div>{$lang_paste_text_title}</div>
+
+ <textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft"></textarea>
+
+ <div class="mceActionPanel">
+ <div style="float: left">
+ <input type="button" name="insert" value="{$lang_insert}" onclick="saveContent();" id="insert" />
+ </div>
+
+ <div style="float: right">
+ <input type="button" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
+ </div>
+ </div>
+</form>
+</body>
+</html> \ No newline at end of file
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/paste/pasteword.htm b/wp-inst/wp-includes/js/tinymce/plugins/paste/pasteword.htm
new file mode 100644
index 0000000..7acc7f7
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/paste/pasteword.htm
@@ -0,0 +1,29 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <title>{$lang_paste_word_desc}</title>
+ <script language="javascript" type="text/javascript" src="../../tiny_mce_popup.js"></script>
+ <script language="javascript" type="text/javascript" src="jscripts/pasteword.js"></script>
+ <link href="css/pasteword.css" rel="stylesheet" type="text/css" />
+ <base target="_self" />
+</head>
+<body onload="tinyMCEPopup.executeOnLoad('onLoadInit();');" onresize="resizeInputs();" style="display: none">
+ <form name="source" onsubmit="saveContent();" action="#">
+ <div class="title">{$lang_paste_word_desc}</div>
+
+ <div>{$lang_paste_word_title}</div>
+
+ <div id="iframecontainer"></div>
+
+ <div class="mceActionPanel">
+ <div style="float: left">
+ <input type="button" id="insert" name="insert" value="{$lang_insert}" onclick="saveContent();" />
+ </div>
+
+ <div style="float: right">
+ <input type="button" id="cancel" name="cancel" value="{$lang_cancel}" onclick="tinyMCEPopup.close();" />
+ </div>
+ </div>
+ </form>
+</body>
+</html>
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/HttpClient.class.php b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/HttpClient.class.php
new file mode 100755
index 0000000..cae27f0
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/HttpClient.class.php
@@ -0,0 +1,339 @@
+<?php
+
+/* Version 0.9, 6th April 2003 - Simon Willison ( http://simon.incutio.com/ )
+ Manual: http://scripts.incutio.com/httpclient/
+*/
+
+class HttpClient {
+ // Request vars
+ var $host;
+ var $port;
+ var $path;
+ var $method;
+ var $postdata = '';
+ var $cookies = array();
+ var $referer;
+ var $accept = 'text/xml,application/xml,application/xhtml+xml,text/html,text/plain,image/png,image/jpeg,image/gif,*/*';
+ var $accept_encoding = 'gzip';
+ var $accept_language = 'en-us';
+ var $user_agent = 'Incutio HttpClient v0.9';
+ // Options
+ var $timeout = 20;
+ var $use_gzip = true;
+ var $persist_cookies = true; // If true, received cookies are placed in the $this->cookies array ready for the next request
+ // Note: This currently ignores the cookie path (and time) completely. Time is not important,
+ // but path could possibly lead to security problems.
+ var $persist_referers = true; // For each request, sends path of last request as referer
+ var $debug = false;
+ var $handle_redirects = true; // Auaomtically redirect if Location or URI header is found
+ var $max_redirects = 5;
+ var $headers_only = false; // If true, stops receiving once headers have been read.
+ // Basic authorization variables
+ var $username;
+ var $password;
+ // Response vars
+ var $status;
+ var $headers = array();
+ var $content = '';
+ var $errormsg;
+ // Tracker variables
+ var $redirect_count = 0;
+ var $cookie_host = '';
+ function HttpClient($host, $port=80) {
+ $this->host = $host;
+ $this->port = $port;
+ }
+ function get($path, $data = false) {
+ $this->path = $path;
+ $this->method = 'GET';
+ if ($data) {
+ $this->path .= '?'.$this->buildQueryString($data);
+ }
+ return $this->doRequest();
+ }
+ function post($path, $data) {
+ $this->path = $path;
+ $this->method = 'POST';
+ $this->postdata = $this->buildQueryString($data);
+ return $this->doRequest();
+ }
+ function buildQueryString($data) {
+ $querystring = '';
+ if (is_array($data)) {
+ // Change data in to postable data
+ foreach ($data as $key => $val) {
+ if (is_array($val)) {
+ foreach ($val as $val2) {
+ $querystring .= urlencode($key).'='.urlencode($val2).'&';
+ }
+ } else {
+ $querystring .= urlencode($key).'='.urlencode($val).'&';
+ }
+ }
+ $querystring = substr($querystring, 0, -1); // Eliminate unnecessary &
+ } else {
+ $querystring = $data;
+ }
+ return $querystring;
+ }
+ function doRequest() {
+ // Performs the actual HTTP request, returning true or false depending on outcome
+ if (!$fp = @fsockopen($this->host, $this->port, $errno, $errstr, $this->timeout)) {
+ // Set error message
+ switch($errno) {
+ case -3:
+ $this->errormsg = 'Socket creation failed (-3)';
+ case -4:
+ $this->errormsg = 'DNS lookup failure (-4)';
+ case -5:
+ $this->errormsg = 'Connection refused or timed out (-5)';
+ default:
+ $this->errormsg = 'Connection failed ('.$errno.')';
+ $this->errormsg .= ' '.$errstr;
+ $this->debug($this->errormsg);
+ }
+ return false;
+ }
+ socket_set_timeout($fp, $this->timeout);
+ $request = $this->buildRequest();
+ $this->debug('Request', $request);
+ fwrite($fp, $request);
+ // Reset all the variables that should not persist between requests
+ $this->headers = array();
+ $this->content = '';
+ $this->errormsg = '';
+ // Set a couple of flags
+ $inHeaders = true;
+ $atStart = true;
+ // Now start reading back the response
+ while (!feof($fp)) {
+ $line = fgets($fp, 4096);
+ if ($atStart) {
+ // Deal with first line of returned data
+ $atStart = false;
+ if (!preg_match('/HTTP\/(\\d\\.\\d)\\s*(\\d+)\\s*(.*)/', $line, $m)) {
+ $this->errormsg = "Status code line invalid: ".htmlentities($line);
+ $this->debug($this->errormsg);
+ return false;
+ }
+ $http_version = $m[1]; // not used
+ $this->status = $m[2];
+ $status_string = $m[3]; // not used
+ $this->debug(trim($line));
+ continue;
+ }
+ if ($inHeaders) {
+ if (trim($line) == '') {
+ $inHeaders = false;
+ $this->debug('Received Headers', $this->headers);
+ if ($this->headers_only) {
+ break; // Skip the rest of the input
+ }
+ continue;
+ }
+ if (!preg_match('/([^:]+):\\s*(.*)/', $line, $m)) {
+ // Skip to the next header
+ continue;
+ }
+ $key = strtolower(trim($m[1]));
+ $val = trim($m[2]);
+ // Deal with the possibility of multiple headers of same name
+ if (isset($this->headers[$key])) {
+ if (is_array($this->headers[$key])) {
+ $this->headers[$key][] = $val;
+ } else {
+ $this->headers[$key] = array($this->headers[$key], $val);
+ }
+ } else {
+ $this->headers[$key] = $val;
+ }
+ continue;
+ }
+ // We're not in the headers, so append the line to the contents
+ $this->content .= $line;
+ }
+ fclose($fp);
+ // If data is compressed, uncompress it
+ if (isset($this->headers['content-encoding']) && $this->headers['content-encoding'] == 'gzip') {
+ $this->debug('Content is gzip encoded, unzipping it');
+ $this->content = substr($this->content, 10); // See http://www.php.net/manual/en/function.gzencode.php
+ $this->content = gzinflate($this->content);
+ }
+ // If $persist_cookies, deal with any cookies
+ if ($this->persist_cookies && isset($this->headers['set-cookie']) && $this->host == $this->cookie_host) {
+ $cookies = $this->headers['set-cookie'];
+ if (!is_array($cookies)) {
+ $cookies = array($cookies);
+ }
+ foreach ($cookies as $cookie) {
+ if (preg_match('/([^=]+)=([^;]+);/', $cookie, $m)) {
+ $this->cookies[$m[1]] = $m[2];
+ }
+ }
+ // Record domain of cookies for security reasons
+ $this->cookie_host = $this->host;
+ }
+ // If $persist_referers, set the referer ready for the next request
+ if ($this->persist_referers) {
+ $this->debug('Persisting referer: '.$this->getRequestURL());
+ $this->referer = $this->getRequestURL();
+ }
+ // Finally, if handle_redirects and a redirect is sent, do that
+ if ($this->handle_redirects) {
+ if (++$this->redirect_count >= $this->max_redirects) {
+ $this->errormsg = 'Number of redirects exceeded maximum ('.$this->max_redirects.')';
+ $this->debug($this->errormsg);
+ $this->redirect_count = 0;
+ return false;
+ }
+ $location = isset($this->headers['location']) ? $this->headers['location'] : '';
+ $uri = isset($this->headers['uri']) ? $this->headers['uri'] : '';
+ if ($location || $uri) {
+ $url = parse_url($location.$uri);
+ // This will FAIL if redirect is to a different site
+ return $this->get($url['path']);
+ }
+ }
+ return true;
+ }
+ function buildRequest() {
+ $headers = array();
+ $headers[] = "{$this->method} {$this->path} HTTP/1.0"; // Using 1.1 leads to all manner of problems, such as "chunked" encoding
+ $headers[] = "Host: {$this->host}";
+ $headers[] = "User-Agent: {$this->user_agent}";
+ $headers[] = "Accept: {$this->accept}";
+ if ($this->use_gzip) {
+ $headers[] = "Accept-encoding: {$this->accept_encoding}";
+ }
+ $headers[] = "Accept-language: {$this->accept_language}";
+ if ($this->referer) {
+ $headers[] = "Referer: {$this->referer}";
+ }
+ // Cookies
+ if ($this->cookies) {
+ $cookie = 'Cookie: ';
+ foreach ($this->cookies as $key => $value) {
+ $cookie .= "$key=$value; ";
+ }
+ $headers[] = $cookie;
+ }
+ // Basic authentication
+ if ($this->username && $this->password) {
+ $headers[] = 'Authorization: BASIC '.base64_encode($this->username.':'.$this->password);
+ }
+ // If this is a POST, set the content type and length
+ if ($this->postdata) {
+ $headers[] = 'Content-Type: application/x-www-form-urlencoded';
+ $headers[] = 'Content-Length: '.strlen($this->postdata);
+ }
+ $request = implode("\r\n", $headers)."\r\n\r\n".$this->postdata;
+ return $request;
+ }
+ function getStatus() {
+ return $this->status;
+ }
+ function getContent() {
+ return $this->content;
+ }
+ function getHeaders() {
+ return $this->headers;
+ }
+ function getHeader($header) {
+ $header = strtolower($header);
+ if (isset($this->headers[$header])) {
+ return $this->headers[$header];
+ } else {
+ return false;
+ }
+ }
+ function getError() {
+ return $this->errormsg;
+ }
+ function getCookies() {
+ return $this->cookies;
+ }
+ function getRequestURL() {
+ $url = 'http://'.$this->host;
+ if ($this->port != 80) {
+ $url .= ':'.$this->port;
+ }
+ $url .= $this->path;
+ return $url;
+ }
+ // Setter methods
+ function setUserAgent($string) {
+ $this->user_agent = $string;
+ }
+ function setAuthorization($username, $password) {
+ $this->username = $username;
+ $this->password = $password;
+ }
+ function setCookies($array) {
+ $this->cookies = $array;
+ }
+ // Option setting methods
+ function useGzip($boolean) {
+ $this->use_gzip = $boolean;
+ }
+ function setPersistCookies($boolean) {
+ $this->persist_cookies = $boolean;
+ }
+ function setPersistReferers($boolean) {
+ $this->persist_referers = $boolean;
+ }
+ function setHandleRedirects($boolean) {
+ $this->handle_redirects = $boolean;
+ }
+ function setMaxRedirects($num) {
+ $this->max_redirects = $num;
+ }
+ function setHeadersOnly($boolean) {
+ $this->headers_only = $boolean;
+ }
+ function setDebug($boolean) {
+ $this->debug = $boolean;
+ }
+ // "Quick" static methods
+ function quickGet($url) {
+ $bits = parse_url($url);
+ $host = $bits['host'];
+ $port = isset($bits['port']) ? $bits['port'] : 80;
+ $path = isset($bits['path']) ? $bits['path'] : '/';
+ if (isset($bits['query'])) {
+ $path .= '?'.$bits['query'];
+ }
+ $client = new HttpClient($host, $port);
+ if (!$client->get($path)) {
+ return false;
+ } else {
+ return $client->getContent();
+ }
+ }
+ function quickPost($url, $data) {
+ $bits = parse_url($url);
+ $host = $bits['host'];
+ $port = isset($bits['port']) ? $bits['port'] : 80;
+ $path = isset($bits['path']) ? $bits['path'] : '/';
+ $client = new HttpClient($host, $port);
+ if (!$client->post($path, $data)) {
+ return false;
+ } else {
+ return $client->getContent();
+ }
+ }
+ function debug($msg, $object = false) {
+ if ($this->debug) {
+ print '<div style="border: 1px solid red; padding: 0.5em; margin: 0.5em;"><strong>HttpClient Debug:</strong> '.$msg;
+ if ($object) {
+ ob_start();
+ print_r($object);
+ $content = htmlentities(ob_get_contents());
+ ob_end_clean();
+ print '<pre>'.$content.'</pre>';
+ }
+ print '</div>';
+ }
+ }
+}
+
+?> \ No newline at end of file
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php
new file mode 100755
index 0000000..971da10
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyGoogleSpell.class.php
@@ -0,0 +1,73 @@
+<?php
+/* *
+ * Tiny Spelling Interface for TinyMCE Spell Checking.
+ *
+ * Copyright © 2006 Moxiecode Systems AB
+ */
+
+require_once("HttpClient.class.php");
+
+class TinyGoogleSpell {
+ var $lang;
+
+ function TinyGoogleSpell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
+ $this->lang = $lang;
+ }
+
+ // Returns array with bad words or false if failed.
+ function checkWords($word_array) {
+ $words = array();
+ $wordstr = implode(' ', $word_array);
+
+ $matches = $this->_getMatches($wordstr);
+
+ for ($i=0; $i<count($matches); $i++)
+ $words[] = substr($wordstr, $matches[$i][1], $matches[$i][2]);
+
+ return $words;
+ }
+
+ // Returns array with suggestions or false if failed.
+ function getSuggestion($word) {
+ $sug = array();
+
+ $matches = $this->_getMatches($word);
+
+ if (count($matches) > 0)
+ $sug = explode("\t", $matches[0][4]);
+
+ return $sug;
+ }
+
+ function _getMatches($word_list) {
+ $xml = "";
+
+ // Setup HTTP Client
+ $client = new HttpClient('www.google.com');
+ $client->setUserAgent('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR');
+ $client->setHandleRedirects(false);
+ $client->setDebug(false);
+
+ // Setup XML request
+ $xml .= '<?xml version="1.0" encoding="utf-8" ?>';
+ $xml .= '<spellrequest textalreadyclipped="0" ignoredups="0" ignoredigits="1" ignoreallcaps="1">';
+ $xml .= '<text>' . htmlentities($word_list) . '</text></spellrequest>';
+
+ // Execute HTTP Post to Google
+ if (!$client->post('/tbproxy/spell?lang=' . $this->lang, $xml)) {
+ $this->errorMsg[] = 'An error occurred: ' . $client->getError();
+ return array();
+ }
+
+ // Grab and parse content
+ $xml = $client->getContent();
+ preg_match_all('/<c o="([^"]*)" l="([^"]*)" s="([^"]*)">([^<]*)<\/c>/', $xml, $matches, PREG_SET_ORDER);
+
+ return $matches;
+ }
+}
+
+// Setup classname, should be the same as the name of the spellchecker class
+$spellCheckerConfig['class'] = "TinyGoogleSpell";
+
+?>
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php
new file mode 100755
index 0000000..21fb194
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspell.class.php
@@ -0,0 +1,64 @@
+<?php
+/* *
+ * Tiny Spelling Interface for TinyMCE Spell Checking.
+ *
+ * Copyright © 2006 Moxiecode Systems AB
+ *
+ */
+
+class TinyPSpell {
+ var $lang;
+ var $mode;
+ var $string;
+ var $plink;
+ var $errorMsg;
+
+ var $jargon;
+ var $spelling;
+ var $encoding;
+
+ function TinyPSpell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
+ $this->lang = $lang;
+ $this->mode = $mode;
+ $this->plink = false;
+ $this->errorMsg = array();
+
+ if (!function_exists("pspell_new")) {
+ $this->errorMsg[] = "PSpell not found.";
+ return;
+ }
+
+ $this->plink = pspell_new($this->lang, $this->spelling, $this->jargon, $this->encoding, $this->mode);
+ }
+
+ // Returns array with bad words or false if failed.
+ function checkWords($wordArray) {
+ if (!$this->plink) {
+ $this->errorMsg[] = "No PSpell link found for checkWords.";
+ return array();
+ }
+
+ $wordError = array();
+ foreach($wordArray as $word) {
+ if(!pspell_check($this->plink, trim($word)))
+ $wordError[] = $word;
+ }
+
+ return $wordError;
+ }
+
+ // Returns array with suggestions or false if failed.
+ function getSuggestion($word) {
+ if (!$this->plink) {
+ $this->errorMsg[] = "No PSpell link found for getSuggestion.";
+ return array();
+ }
+
+ return pspell_suggest($this->plink, $word);
+ }
+}
+
+// Setup classname, should be the same as the name of the spellchecker class
+$spellCheckerConfig['class'] = "TinyPspell";
+
+?> \ No newline at end of file
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php
new file mode 100755
index 0000000..cd75ce9
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/classes/TinyPspellShell.class.php
@@ -0,0 +1,100 @@
+<?php
+/* *
+ * Tiny Spelling Interface for TinyMCE Spell Checking.
+ *
+ * Copyright © 2006 Moxiecode Systems AB
+ *
+ */
+
+class TinyPspellShell {
+ var $lang;
+ var $mode;
+ var $string;
+ var $error;
+ var $errorMsg;
+
+ var $cmd;
+ var $tmpfile;
+
+ var $jargon;
+ var $spelling;
+ var $encoding;
+
+ function TinyPspellShell(&$config, $lang, $mode, $spelling, $jargon, $encoding) {
+ $this->lang = $lang;
+ $this->mode = $mode;
+ $this->error = false;
+ $this->errorMsg = array();
+
+ $this->tmpfile = tempnam($config['tinypspellshell.tmp'], "tinyspell");
+ $this->cmd = "cat ". $this->tmpfile ." | " . $config['tinypspellshell.aspell'] . " -a --lang=". $this->lang;
+ }
+
+ // Returns array with bad words or false if failed.
+ function checkWords($wordArray) {
+ if ($fh = fopen($this->tmpfile, "w")) {
+ fwrite($fh, "!\n");
+ foreach($wordArray as $key => $value)
+ fwrite($fh, "^" . $value . "\n");
+
+ fclose($fh);
+ } else {
+ $this->errorMsg[] = "PSpell not found.";
+ return array();
+ }
+
+ $data = shell_exec($this->cmd);
+ $returnData = array();
+ $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);
+
+ foreach($dataArr as $dstr) {
+ $matches = array();
+
+ // Skip this line.
+ if (strpos($dstr, "@") === 0)
+ continue;
+
+ preg_match("/\& (.*) .* .*: .*/i", $dstr, $matches);
+
+ if (!empty($matches[1]))
+ $returnData[] = $matches[1];
+ }
+
+ return $returnData;
+ }
+
+ // Returns array with suggestions or false if failed.
+ function getSuggestion($word) {
+ if ($fh = fopen($this->tmpfile, "w")) {
+ fwrite($fh, "!\n");
+ fwrite($fh, "^$word\n");
+ fclose($fh);
+ } else
+ die("Error opening tmp file.");
+
+ $data = shell_exec($this->cmd);
+ $returnData = array();
+ $dataArr = preg_split("/\n/", $data, -1, PREG_SPLIT_NO_EMPTY);
+
+ foreach($dataArr as $dstr) {
+ $matches = array();
+
+ // Skip this line.
+ if (strpos($dstr, "@") === 0)
+ continue;
+
+ preg_match("/\& .* .* .*: (.*)/i", $dstr, $matches);
+
+ if (!empty($matches[1])) {
+ // For some reason, the exec version seems to add commas?
+ $returnData[] = str_replace(",", "", $matches[1]);
+ }
+ }
+ return $returnData;
+ }
+}
+
+// Setup classname, should be the same as the name of the spellchecker class
+$spellCheckerConfig['class'] = "TinyPspellShell";
+
+?> \ No newline at end of file
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/config.php b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/config.php
new file mode 100755
index 0000000..a528565
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/config.php
@@ -0,0 +1,29 @@
+<?php
+ $spellCheckerConfig = array();
+
+ // General settings
+ $spellCheckerConfig['enabled'] = true;
+
+ // Pspell shell specific settings
+ $spellCheckerConfig['tinypspellshell.aspell'] = '/usr/bin/aspell';
+ $spellCheckerConfig['tinypspellshell.tmp'] = '/tmp';
+
+ // Default settings
+ $spellCheckerConfig['default.language'] = 'en';
+ $spellCheckerConfig['default.mode'] = PSPELL_FAST;
+
+ // Normaly not required to configure
+ $spellCheckerConfig['default.spelling'] = "";
+ $spellCheckerConfig['default.jargon'] = "";
+ $spellCheckerConfig['default.encoding'] = "";
+
+ // Spellchecker class use
+ if ( function_exists('pspell_new') )
+ require_once("classes/TinyPspell.class.php"); // Internal PHP version
+
+ elseif ( file_exists($spellCheckerConfig['tinypspellshell.aspell']) )
+ require_once("classes/TinyPspellShell.class.php"); // Command line pspell
+
+ else
+ require_once("classes/TinyGoogleSpell.class.php"); // Google web service
+?>
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/css/content.css b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/css/content.css
new file mode 100755
index 0000000..fb82733
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/css/content.css
@@ -0,0 +1,5 @@
+.mceItemHiddenSpellWord {
+ background: url('../images/wline.gif') repeat-x bottom left;
+ bo2rder-bottom: 1px dashed red;
+ cursor: default;
+}
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/css/spellchecker.css b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/css/spellchecker.css
new file mode 100755
index 0000000..aa4a8ea
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/css/spellchecker.css
@@ -0,0 +1,34 @@
+.mceMsgBox {
+ border: 1px solid gray;
+ padding: 8px;
+}
+
+.mceMsgBox span {
+ vertical-align: top;
+ color: #555555;
+}
+
+/* Misc */
+
+.mceBlockBox {
+ display: none;
+ position: absolute;
+ left: 0;
+ top: 0;
+ z-index: 100;
+ filter:progid:DXImageTransform.Microsoft.Alpha(style=0, opacity=60);
+ -moz-opacity:0.6;
+ opacity: 0.6;
+ background-color: white;
+}
+
+.mceMsgBox {
+ display: none;
+ z-index: 101;
+ position: absolute;
+ left: 0;
+ top: 0;
+ font-family: Arial, Verdana, Tahoma, Helvetica;
+ font-weight: bold;
+ font-size: 11px;
+}
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js
new file mode 100755
index 0000000..ab3fc6b
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/editor_plugin.js
@@ -0,0 +1,573 @@
+/**
+ * $RCSfile: editor_plugin_src.js,v $
+ * $Revision: 1.4 $
+ * $Date: 2006/03/24 17:24:50 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+tinyMCE.importPluginLanguagePack('spellchecker', 'en,sv,nn,nb');
+
+// Plucin static class
+var TinyMCE_SpellCheckerPlugin = {
+ _contextMenu : new TinyMCE_Menu(),
+ _menu : new TinyMCE_Menu(),
+ _counter : 0,
+
+ getInfo : function() {
+ return {
+ longname : 'Spellchecker',
+ author : 'Moxiecode Systems AB',
+ authorurl : 'http://tinymce.moxiecode.com',
+ infourl : 'http://tinymce.moxiecode.com/tinymce/docs/plugin_spellchecker.html',
+ version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion
+ };
+ },
+
+ handleEvent : function(e) {
+ var elm = tinyMCE.isMSIE ? e.srcElement : e.target;
+ var inst = tinyMCE.selectedInstance, args = '';
+ var self = TinyMCE_SpellCheckerPlugin;
+ var cm = self._contextMenu;
+ var p, p2, x, y, sx, sy, h, elm;
+
+ // Handle click on word
+ if ((e.type == "click" || e.type == "contextmenu") && elm) {
+ do {
+ if (tinyMCE.getAttrib(elm, 'class') == "mceItemHiddenSpellWord") {
+ inst.spellCheckerElm = elm;
+
+ // Setup arguments
+ args += 'id=' + inst.editorId + "|" + (++self._counter);
+ args += '&cmd=suggest&check=' + escape(elm.innerHTML);
+ args += '&lang=' + escape(inst.spellCheckerLang);
+
+ elm = inst.spellCheckerElm;
+ p = tinyMCE.getAbsPosition(inst.iframeElement);
+ p2 = tinyMCE.getAbsPosition(elm);
+ h = parseInt(elm.offsetHeight);
+ sx = inst.getBody().scrollLeft;
+ sy = inst.getBody().scrollTop;
+ x = p.absLeft + p2.absLeft - sx;
+ y = p.absTop + p2.absTop - sy + h;
+
+ cm.clear();
+ cm.addTitle(tinyMCE.getLang('lang_spellchecker_wait', '', true));
+ cm.show();
+ cm.moveTo(x, y);
+
+ inst.selection.selectNode(elm, false, false);
+
+ self._sendAjax(self.baseURL + "/tinyspell.php", self._ajaxResponse, 'post', args);
+
+ tinyMCE.cancelEvent(e);
+ return false;
+ }
+ } while ((elm = elm.parentNode));
+ }
+
+ return true;
+ },
+
+ initInstance : function(inst) {
+ var self = TinyMCE_SpellCheckerPlugin, m = self._menu, cm = self._contextMenu, e;
+
+ tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/spellchecker/css/content.css");
+
+ if (!tinyMCE.hasMenu('spellcheckercontextmenu')) {
+ tinyMCE.importCSS(document, tinyMCE.baseURL + "/plugins/spellchecker/css/spellchecker.css");
+
+ cm.init({drop_menu : false});
+ tinyMCE.addMenu('spellcheckercontextmenu', cm);
+ }
+
+ if (!tinyMCE.hasMenu('spellcheckermenu')) {
+ m.init({});
+ tinyMCE.addMenu('spellcheckermenu', m);
+ }
+
+ inst.spellCheckerLang = 'en';
+ self._buildSettingsMenu(inst, null);
+
+ e = self._getBlockBoxLayer(inst).create('div', 'mceBlockBox', document.getElementById(inst.editorId + '_parent'));
+ self._getMsgBoxLayer(inst).create('div', 'mceMsgBox', document.getElementById(inst.editorId + '_parent'));
+ },
+
+ _getMsgBoxLayer : function(inst) {
+ if (!inst.spellCheckerMsgBoxL)
+ inst.spellCheckerMsgBoxL = new TinyMCE_Layer(inst.editorId + '_spellcheckerMsgBox', false);
+
+ return inst.spellCheckerMsgBoxL;
+ },
+
+ _getBlockBoxLayer : function(inst) {
+ if (!inst.spellCheckerBoxL)
+ inst.spellCheckerBoxL = new TinyMCE_Layer(inst.editorId + '_spellcheckerBlockBox', false);
+
+ return inst.spellCheckerBoxL;
+ },
+
+ _buildSettingsMenu : function(inst, lang) {
+ var i, ar = tinyMCE.getParam('spellchecker_languages', '+English=en').split(','), p;
+ var self = TinyMCE_SpellCheckerPlugin, m = self._menu, c;
+
+ m.clear();
+ m.addTitle(tinyMCE.getLang('lang_spellchecker_langs', '', true));
+
+ for (i=0; i<ar.length; i++) {
+ if (ar[i] != '') {
+ p = ar[i].split('=');
+ c = 'mceMenuCheckItem';
+
+ if (p[0].charAt(0) == '+') {
+ p[0] = p[0].substring(1);
+
+ if (lang == null) {
+ c = 'mceMenuSelectedItem';
+ inst.spellCheckerLang = p[1];
+ }
+ }
+
+ if (lang == p[1])
+ c = 'mceMenuSelectedItem';
+
+ m.add({text : p[0], js : "tinyMCE.execInstanceCommand('" + inst.editorId + "','mceSpellCheckerSetLang',false,'" + p[1] + "');", class_name : c});
+ }
+ }
+ },
+
+ setupContent : function(editor_id, body, doc) {
+ TinyMCE_SpellCheckerPlugin._removeWords(doc);
+ },
+
+ getControlHTML : function(cn) {
+ switch (cn) {
+ case "spellchecker":
+ return TinyMCE_SpellCheckerPlugin._getMenuButtonHTML(cn, 'lang_spellchecker_desc', '{$pluginurl}/images/spellchecker.gif', 'lang_spellchecker_desc', 'mceSpellCheckerMenu', 'mceSpellCheck');
+ }
+
+ return "";
+ },
+
+ /**
+ * Returns the HTML code for a normal button control.
+ *
+ * @param {string} id Button control id, this will be the suffix for the element id, the prefix is the editor id.
+ * @param {string} lang Language variable key name to insert as the title/alt of the button image.
+ * @param {string} img Image URL to insert, {$themeurl} and {$pluginurl} will be replaced.
+ * @param {string} mlang Language variable key name to insert as the title/alt of the menu button image.
+ * @param {string} mid Menu by id to display when the menu button is pressed.
+ * @param {string} cmd Command to execute when the user clicks the button.
+ * @param {string} ui Optional user interface boolean for command.
+ * @param {string} val Optional value for command.
+ * @return HTML code for a normal button based in input information.
+ * @type string
+ */
+ _getMenuButtonHTML : function(id, lang, img, mlang, mid, cmd, ui, val) {
+ var h = '', m, x;
+
+ cmd = 'tinyMCE.hideMenus();tinyMCE.execInstanceCommand(\'{$editor_id}\',\'' + cmd + '\'';
+
+ if (typeof(ui) != "undefined" && ui != null)
+ cmd += ',' + ui;
+
+ if (typeof(val) != "undefined" && val != null)
+ cmd += ",'" + val + "'";
+
+ cmd += ');';
+
+ // Use tilemaps when enabled and found and never in MSIE since it loads the tile each time from cache if cahce is disabled
+ if (tinyMCE.getParam('button_tile_map') && (!tinyMCE.isMSIE || tinyMCE.isOpera) && (m = tinyMCE.buttonMap[id]) != null && (tinyMCE.getParam("language") == "en" || img.indexOf('$lang') == -1)) {
+ // Tiled button
+ x = 0 - (m * 20) == 0 ? '0' : 0 - (m * 20);
+ h += '<a id="{$editor_id}_' + id + '" href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" class="mceTiledButton mceButtonNormal" target="_self">';
+ h += '<img src="{$themeurl}/images/spacer.gif" style="background-position: ' + x + 'px 0" title="{$' + lang + '}" />';
+ h += '<img src="{$themeurl}/images/button_menu.gif" title="{$' + lang + '}" class="mceMenuButton" onclick="' + mcmd + 'return false;" />';
+ h += '</a>';
+ } else {
+ if (tinyMCE.isMSIE && !tinyMCE.isOpera)
+ h += '<span id="{$editor_id}_' + id + '" class="mceMenuButton" onmouseover="tinyMCE.plugins.spellchecker._menuButtonEvent(\'over\',this);" onmouseout="tinyMCE.plugins.spellchecker._menuButtonEvent(\'out\',this);">';
+ else
+ h += '<span id="{$editor_id}_' + id + '" class="mceMenuButton">';
+
+ h += '<a href="javascript:' + cmd + '" onclick="' + cmd + 'return false;" onmousedown="return false;" class="mceMenuButtonNormal" target="_self">';
+ h += '<img src="' + img + '" title="{$' + lang + '}" /></a>';
+ h += '<a href="#" onclick="tinyMCE.plugins.spellchecker._toggleMenu(\'{$editor_id}\',\'' + mid + '\');return false;" onmousedown="return false;"><img src="{$themeurl}/images/button_menu.gif" title="{$' + lang + '}" class="mceMenuButton" />';
+ h += '</a></span>';
+ }
+
+ return h;
+ },
+
+ _menuButtonEvent : function(e, o) {
+ if (o.className == 'mceMenuButtonFocus')
+ return;
+
+ if (e == 'over')
+ o.className = o.className + ' mceMenuHover';
+ else
+ o.className = o.className.replace(/\s.*$/, '');
+ },
+
+ _toggleMenu : function(editor_id, id) {
+ var self = TinyMCE_SpellCheckerPlugin;
+ var e = document.getElementById(editor_id + '_spellchecker');
+ var inst = tinyMCE.getInstanceById(editor_id);
+
+ if (self._menu.isVisible()) {
+ tinyMCE.hideMenus();
+ return;
+ }
+
+ tinyMCE.lastMenuBtnClass = e.className.replace(/\s.*$/, '');
+ tinyMCE.switchClass(editor_id + '_spellchecker', 'mceMenuButtonFocus');
+
+ self._menu.moveRelativeTo(e, 'bl');
+ self._menu.moveBy(tinyMCE.isMSIE && !tinyMCE.isOpera ? 0 : 1, -1);
+
+ if (tinyMCE.isOpera)
+ self._menu.moveBy(0, -2);
+
+ self._onMenuEvent(inst, self._menu, 'show');
+
+ self._menu.show();
+
+ tinyMCE.lastSelectedMenuBtn = editor_id + '_spellchecker';
+ },
+
+ _onMenuEvent : function(inst, m, n) {
+ TinyMCE_SpellCheckerPlugin._buildSettingsMenu(inst, inst.spellCheckerLang);
+ },
+
+ execCommand : function(editor_id, element, command, user_interface, value) {
+ var inst = tinyMCE.getInstanceById(editor_id), self = TinyMCE_SpellCheckerPlugin, args = '', co, bb, mb, nl, i, e;
+
+ // Handle commands
+ switch (command) {
+ case "mceSpellCheck":
+ if (!inst.spellcheckerOn) {
+ inst.spellCheckerBookmark = inst.selection.getBookmark();
+
+ // Setup arguments
+ args += 'id=' + inst.editorId + "|" + (++self._counter);
+ args += '&cmd=spell&check=' + escape(self._getWordList(inst.getBody())).replace(/%20/g, '+');
+ args += '&lang=' + escape(inst.spellCheckerLang);
+
+ co = document.getElementById(inst.editorId + '_parent').firstChild;
+ bb = self._getBlockBoxLayer(inst);
+ bb.moveRelativeTo(co, 'tl');
+ bb.resizeTo(co.offsetWidth, co.offsetHeight);
+ bb.show();
+
+ // Setup message box
+ mb = self._getMsgBoxLayer(inst);
+ e = mb.getElement();
+ e.innerHTML = '<span>' + tinyMCE.getLang('lang_spellchecker_swait', '', true) + '</span>';
+ mb.show();
+ mb.moveRelativeTo(co, 'cc');
+
+ if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+ nl = co.getElementsByTagName('select');
+ for (i=0; i<nl.length; i++)
+ nl[i].disabled = true;
+ }
+
+ inst.spellcheckerOn = true;
+ tinyMCE.switchClass(editor_id + '_spellchecker', 'mceMenuButtonSelected');
+
+ self._sendAjax(self.baseURL + "/tinyspell.php", self._ajaxResponse, 'post', args);
+ } else {
+ self._removeWords(inst.getDoc());
+ inst.spellcheckerOn = false;
+ tinyMCE.switchClass(editor_id + '_spellchecker', 'mceMenuButton');
+ }
+
+ return true;
+
+ case "mceSpellCheckReplace":
+ if (inst.spellCheckerElm)
+ tinyMCE.setOuterHTML(inst.spellCheckerElm, value);
+
+ self._checkDone(inst);
+ self._contextMenu.hide();
+ self._menu.hide();
+
+ return true;
+
+ case "mceSpellCheckIgnore":
+ if (inst.spellCheckerElm)
+ self._removeWord(inst.spellCheckerElm);
+
+ self._checkDone(inst);
+ self._contextMenu.hide();
+ self._menu.hide();
+ return true;
+
+ case "mceSpellCheckIgnoreAll":
+ if (inst.spellCheckerElm)
+ self._removeWords(inst.getDoc(), inst.spellCheckerElm.innerHTML);
+
+ self._checkDone(inst);
+ self._contextMenu.hide();
+ self._menu.hide();
+ return true;
+
+ case "mceSpellCheckerSetLang":
+ tinyMCE.hideMenus();
+ inst.spellCheckerLang = value;
+ self._removeWords(inst.getDoc());
+ inst.spellcheckerOn = false;
+ tinyMCE.switchClass(editor_id + '_spellchecker', 'mceMenuButton');
+ return true;
+ }
+
+ // Pass to next handler in chain
+ return false;
+ },
+
+ cleanup : function(type, content, inst) {
+ switch (type) {
+ case "get_from_editor_dom":
+ TinyMCE_SpellCheckerPlugin._removeWords(content);
+ inst.spellcheckerOn = false;
+ break;
+ }
+
+ return content;
+ },
+
+ // Private plugin specific methods
+
+ _displayUI : function(inst) {
+ var self = TinyMCE_SpellCheckerPlugin;
+ var bb = self._getBlockBoxLayer(inst);
+ var mb = self._getMsgBoxLayer(inst);
+ var nl, i;
+ var co = document.getElementById(inst.editorId + '_parent').firstChild;
+
+ if (tinyMCE.isMSIE && !tinyMCE.isOpera) {
+ nl = co.getElementsByTagName('select');
+ for (i=0; i<nl.length; i++)
+ nl[i].disabled = false;
+ }
+
+ bb.hide();
+ mb.hide();
+ },
+
+ _ajaxResponse : function(xml) {
+ var el = xml ? xml.documentElement : null;
+ var inst = tinyMCE.selectedInstance, self = TinyMCE_SpellCheckerPlugin;
+ var cmd = el ? el.getAttribute("cmd") : null, err, id = el ? el.getAttribute("id") : null;
+
+ if (id)
+ inst = tinyMCE.getInstanceById(id.substring(0, id.indexOf('|')));
+
+ self._displayUI(inst);
+
+ // Ignore suggestions for other ajax responses
+ if (cmd == "suggest" && id != inst.editorId + "|" + self._counter)
+ return;
+
+ if (!el) {
+ inst.spellcheckerOn = false;
+ tinyMCE.switchClass(inst.editorId + '_spellchecker', 'mceMenuButton');
+ alert("Could not execute AJAX call, server didn't return valid a XML.");
+ return;
+ }
+
+ err = el.getAttribute("error");
+
+ if (err == "true") {
+ inst.spellcheckerOn = false;
+ tinyMCE.switchClass(inst.editorId + '_spellchecker', 'mceMenuButton');
+ alert(el.getAttribute("msg"));
+ return;
+ }
+
+ switch (cmd) {
+ case "spell":
+ if (xml.documentElement.firstChild) {
+ self._markWords(inst.getDoc(), inst.getBody(), el.firstChild.nodeValue.split(' '));
+ inst.selection.moveToBookmark(inst.spellCheckerBookmark);
+ } else
+ alert(tinyMCE.getLang('lang_spellchecker_no_mpell', '', true));
+
+ self._checkDone(inst);
+
+ break;
+
+ case "suggest":
+ self._buildMenu(el.firstChild ? el.firstChild.nodeValue.split(' ') : null, 10);
+ self._contextMenu.show();
+ break;
+ }
+ },
+
+ _getWordSeparators : function() {
+ var i, re = '', ch = tinyMCE.getParam('spellchecker_word_separator_chars', '\\s!"#$%&()*+,-./:;<=>?@[\]^_{|}§©«®±¶·¸»¼½¾¿×÷¤\u201d\u201c');
+
+ for (i=0; i<ch.length; i++)
+ re += '\\' + ch.charAt(i);
+
+ return re;
+ },
+
+ _getWordList : function(n) {
+ var i, x, s, nv = '', nl = tinyMCE.getNodeTree(n, new Array(), 3), wl = new Array();
+ var re = TinyMCE_SpellCheckerPlugin._getWordSeparators();
+
+ for (i=0; i<nl.length; i++)
+ nv += nl[i].nodeValue + " ";
+
+ nv = nv.replace(new RegExp('([0-9]|[' + re + '])', 'g'), ' ');
+ nv = tinyMCE.trim(nv.replace(/(\s+)/g, ' '));
+
+ nl = nv.split(/\s+/);
+ for (i=0; i<nl.length; i++) {
+ s = false;
+ for (x=0; x<wl.length; x++) {
+ if (wl[x] == nl[i]) {
+ s = true;
+ break;
+ }
+ }
+
+ if (!s)
+ wl[wl.length] = nl[i];
+ }
+
+ return wl.join(' ');
+ },
+
+ _removeWords : function(doc, word) {
+ var i, c, nl = doc.getElementsByTagName("span");
+ var self = TinyMCE_SpellCheckerPlugin;
+ var inst = tinyMCE.selectedInstance, b = inst ? inst.selection.getBookmark() : null;
+
+ word = typeof(word) == 'undefined' ? null : word;
+
+ for (i=nl.length-1; i>=0; i--) {
+ c = tinyMCE.getAttrib(nl[i], 'class');
+
+ if ((c == 'mceItemHiddenSpellWord' || c == 'mceItemHidden') && (word == null || nl[i].innerHTML == word))
+ self._removeWord(nl[i]);
+ }
+
+ if (b)
+ inst.selection.moveToBookmark(b);
+ },
+
+ _checkDone : function(inst) {
+ var i, w = 0, nl = inst.getDoc().getElementsByTagName("span")
+ var self = TinyMCE_SpellCheckerPlugin;
+
+ for (i=nl.length-1; i>=0; i--) {
+ c = tinyMCE.getAttrib(nl[i], 'class');
+
+ if (c == 'mceItemHiddenSpellWord')
+ w++;
+ }
+
+ if (w == 0) {
+ self._removeWords(inst.getDoc());
+ inst.spellcheckerOn = false;
+ tinyMCE.switchClass(inst.editorId + '_spellchecker', 'mceMenuButton');
+ }
+ },
+
+ _removeWord : function(e) {
+ tinyMCE.setOuterHTML(e, e.innerHTML);
+ },
+
+ _markWords : function(doc, n, wl) {
+ var i, nv, nn, nl = tinyMCE.getNodeTree(n, new Array(), 3);
+ var r1, r2, r3, r4, r5, w = '';
+ var re = TinyMCE_SpellCheckerPlugin._getWordSeparators();
+
+ for (i=0; i<wl.length; i++)
+ w += wl[i] + ((i == wl.length-1) ? '' : '|');
+
+ r1 = new RegExp('([' + re + '])(' + w + ')([' + re + '])', 'g');
+ r2 = new RegExp('^(' + w + ')', 'g');
+ r3 = new RegExp('(' + w + ')([' + re + ']?)$', 'g');
+ r4 = new RegExp('^(' + w + ')([' + re + ']?)$', 'g');
+ r5 = new RegExp('(' + w + ')([' + re + '])', 'g');
+
+ for (i=0; i<nl.length; i++) {
+ nv = nl[i].nodeValue;
+ if (r1.test(nv) || r2.test(nv) || r3.test(nv) || r4.test(nv)) {
+ nv = tinyMCE.xmlEncode(nv);
+ nv = nv.replace(r5, '<span class="mceItemHiddenSpellWord">$1</span>$2');
+ nv = nv.replace(r3, '<span class="mceItemHiddenSpellWord">$1</span>$2');
+
+ nn = doc.createElement('span');
+ nn.className = "mceItemHidden";
+ nn.innerHTML = nv;
+
+ // Remove old text node
+ nl[i].parentNode.replaceChild(nn, nl[i]);
+ }
+ }
+ },
+
+ _buildMenu : function(sg, max) {
+ var i, self = TinyMCE_SpellCheckerPlugin, cm = self._contextMenu;
+
+ cm.clear();
+
+ if (sg != null) {
+ cm.addTitle(tinyMCE.getLang('lang_spellchecker_sug', '', true));
+
+ for (i=0; i<sg.length && i<max; i++)
+ cm.addItem(sg[i], 'tinyMCE.execCommand("mceSpellCheckReplace",false,"' + sg[i] + '");');
+
+ cm.addSeparator();
+ cm.addItem(tinyMCE.getLang('lang_spellchecker_ignore_word', '', true), 'tinyMCE.execCommand(\'mceSpellCheckIgnore\');');
+ cm.addItem(tinyMCE.getLang('lang_spellchecker_ignore_words', '', true), 'tinyMCE.execCommand(\'mceSpellCheckIgnoreAll\');');
+ } else
+ cm.addTitle(tinyMCE.getLang('lang_spellchecker_no_sug', '', true));
+
+ cm.update();
+ },
+
+ _getAjaxHTTP : function() {
+ try {
+ return new ActiveXObject('Msxml2.XMLHTTP')
+ } catch (e) {
+ try {
+ return new ActiveXObject('Microsoft.XMLHTTP')
+ } catch (e) {
+ return new XMLHttpRequest();
+ }
+ }
+ },
+
+ /**
+ * Perform AJAX call.
+ *
+ * @param {string} u URL of AJAX service.
+ * @param {function} f Function to call when response arrives.
+ * @param {string} m Request method post or get.
+ * @param {Array} a Array with arguments to send.
+ */
+ _sendAjax : function(u, f, m, a) {
+ var x = TinyMCE_SpellCheckerPlugin._getAjaxHTTP();
+
+ x.open(m, u, true);
+
+ x.onreadystatechange = function() {
+ if (x.readyState == 4)
+ f(x.responseXML);
+ };
+
+ if (m == 'post')
+ x.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
+
+ x.send(a);
+ }
+};
+
+// Register plugin
+tinyMCE.addPlugin('spellchecker', TinyMCE_SpellCheckerPlugin);
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/images/spellchecker.gif b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/images/spellchecker.gif
new file mode 100755
index 0000000..294a9d2
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/images/spellchecker.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/images/wline.gif b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/images/wline.gif
new file mode 100755
index 0000000..7d0a4db
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/images/wline.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/langs/en.js b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/langs/en.js
new file mode 100755
index 0000000..f40b202
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/langs/en.js
@@ -0,0 +1,14 @@
+// UK lang variables
+
+tinyMCE.addToLang('spellchecker',{
+ desc : 'Toggle spellchecker',
+ menu : 'Spellchecker settings',
+ ignore_word : 'Ignore word',
+ ignore_words : 'Ignore all',
+ langs : 'Languages',
+ wait : 'Please wait...',
+ swait : 'Spellchecking, please wait...',
+ sug : 'Suggestions',
+ no_sug : 'No suggestions',
+ no_mpell : 'No misspellings found.'
+});
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php
new file mode 100755
index 0000000..88da57d
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/spellchecker/tinyspell.php
@@ -0,0 +1,133 @@
+<?php
+/**
+ * $RCSfile: tinyspell.php,v $
+ * $Revision: 1.1 $
+ * $Date: 2006/03/14 17:33:47 $
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+ require_once("config.php");
+
+ $id = sanitize($_POST['id'], "loose");
+
+ if (!$spellCheckerConfig['enabled']) {
+ header('Content-type: text/xml; charset=utf-8');
+ echo '<?xml version="1.0" encoding="utf-8" ?><res id="' . $id . '" error="true" msg="You must enable the spellchecker by modifying the config.php file." />';
+ die;
+ }
+
+ // Basic config
+ $defaultLanguage = $spellCheckerConfig['default.language'];
+ $defaultMode = $spellCheckerConfig['default.mode'];
+
+ // Normaly not required to configure
+ $defaultSpelling = $spellCheckerConfig['default.spelling'];
+ $defaultJargon = $spellCheckerConfig['default.jargon'];
+ $defaultEncoding = $spellCheckerConfig['default.encoding'];
+ $outputType = "xml"; // Do not change
+
+ // Get input parameters.
+
+ $check = $_POST['check'];
+ $cmd = sanitize($_POST['cmd']);
+ $lang = sanitize($_POST['lang'], "strict");
+ $mode = sanitize($_POST['mode'], "strict");
+ $spelling = sanitize($_POST['spelling'], "strict");
+ $jargon = sanitize($_POST['jargon'], "strict");
+ $encoding = sanitize($_POST['encoding'], "strict");
+ $sg = sanitize($_POST['sg'], "bool");
+ $words = array();
+
+ $validRequest = true;
+
+ if (empty($check))
+ $validRequest = false;
+
+ if (empty($lang))
+ $lang = $defaultLanguage;
+
+ if (empty($mode))
+ $mode = $defaultMode;
+
+ if (empty($spelling))
+ $spelling = $defaultSpelling;
+
+ if (empty($jargon))
+ $jargon = $defaultJargon;
+
+ if (empty($encoding))
+ $encoding = $defaultEncoding;
+
+ function sanitize($str, $type="strict") {
+ switch ($type) {
+ case "strict":
+ $str = preg_replace("/[^a-zA-Z0-9_\-]/i", "", $str);
+ break;
+ case "loose":
+ $str = preg_replace("/</i", "&gt;", $str);
+ $str = preg_replace("/>/i", "&lt;", $str);
+ break;
+ case "bool":
+ if ($str == "true" || $str == true)
+ $str = true;
+ else
+ $str = false;
+ break;
+ }
+
+ return $str;
+ }
+
+ $result = array();
+ $tinyspell = new $spellCheckerConfig['class']($spellCheckerConfig, $lang, $mode, $spelling, $jargon, $encoding);
+
+ if (count($tinyspell->errorMsg) == 0) {
+ switch($cmd) {
+ case "spell":
+ // Space for non-exec version and \n for the exec version.
+ $words = preg_split("/ |\n/", $check, -1, PREG_SPLIT_NO_EMPTY);
+ $result = $tinyspell->checkWords($words);
+ break;
+ case "suggest":
+ $result = $tinyspell->getSuggestion($check);
+ break;
+ default:
+ // Just use this for now.
+ $tinyspell->errorMsg[] = "No command.";
+ $outputType = $outputType . "error";
+ break;
+ }
+ } else
+ $outputType = $outputType . "error";
+
+ if (!$result)
+ $result = array();
+
+ // Output data
+ switch($outputType) {
+ case "xml":
+ header('Content-type: text/xml; charset=utf-8');
+ echo '<?xml version="1.0" encoding="utf-8" ?>';
+ echo "\n";
+ if (count($result) == 0)
+ echo '<res id="' . $id . '" cmd="'. $cmd .'" />';
+ else
+ echo '<res id="' . $id . '" cmd="'. $cmd .'">'. utf8_encode(implode(" ", $result)) .'</res>';
+
+ break;
+ case "xmlerror";
+ header('Content-type: text/xml; charset=utf-8');
+ echo '<?xml version="1.0" encoding="utf-8" ?>';
+ echo "\n";
+ echo '<res id="' . $id . '" cmd="'. $cmd .'" error="true" msg="'. implode(" ", $tinyspell->errorMsg) .'" />';
+ break;
+ case "html":
+ var_dump($result);
+ break;
+ case "htmlerror":
+ echo "Error";
+ break;
+ }
+?>
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/wordpress/images/toolbars.gif b/wp-inst/wp-includes/js/tinymce/plugins/wordpress/images/toolbars.gif
new file mode 100755
index 0000000..dcb7066
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/wordpress/images/toolbars.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/plugins/wordpress/popups.css b/wp-inst/wp-includes/js/tinymce/plugins/wordpress/popups.css
new file mode 100644
index 0000000..2d97665
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/plugins/wordpress/popups.css
@@ -0,0 +1,354 @@
+/* This file contains the CSS data for all popups in TinyMCE */
+
+body {
+ background-color: #F0F0EE;
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+ scrollbar-3dlight-color: #F0F0EE;
+ scrollbar-arrow-color: #676662;
+ scrollbar-base-color: #F0F0EE;
+ scrollbar-darkshadow-color: #DDDDDD;
+ scrollbar-face-color: #E0E0DD;
+ scrollbar-highlight-color: #F0F0EE;
+ scrollbar-shadow-color: #F0F0EE;
+ scrollbar-track-color: #F5F5F5;
+ margin: 8px;
+}
+
+td {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 11px;
+}
+
+input {
+ background: #FFFFFF;
+ border: 1px solid #cccccc;
+}
+
+td, input, select, textarea {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 10px;
+}
+
+input, select, textarea {
+ border: 1px solid #808080;
+}
+
+.input_noborder {
+ border: 0;
+}
+
+#insert, .updateButton {
+ font-weight: bold;
+ width: 90px;
+ height: 21px;
+ border: 0;
+ background-image: url('../images/insert_button_bg.gif');
+ cursor: pointer;
+}
+
+#cancel {
+ font-weight: bold;
+ width: 90px;
+ height: 21px;
+ border: 0;
+ background-image: url('../images/cancel_button_bg.gif');
+ cursor: pointer;
+}
+
+/* Mozilla only style */
+html>body #insert, html>body #cancel {
+ padding-bottom: 2px;
+}
+
+.title {
+ display: block;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ padding-left: 15px;
+ font-size: 15px;
+}
+
+
+table.charmap {
+ border-style: solid;
+ border-width: 1px;
+ border-color: #AAAAAA;
+}
+
+td.charmap, td.charmapOver {
+ color: #000000;
+ border-color: #AAAAAA;
+ border-style: solid;
+ border-width: 1px;
+ text-align: center;
+ font-size: 12px;
+}
+
+td.charmapOver {
+ background-color: #CCCCCC;
+ cursor: default;
+}
+
+a.charmap {
+ color: #000000;
+ text-decoration: none
+}
+
+.wordWrapCode {
+ vertical-align: middle;
+ border: 1px none #000000;
+ background-color: transparent;
+}
+
+input.radio {
+ border: 1px none #000000;
+ background-color: transparent;
+ vertical-align: middle;
+}
+
+input.checkbox {
+ border: 1px none #000000;
+ background-color: transparent;
+ vertical-align: middle;
+}
+
+.mceButtonNormal, .mceButtonOver, .mceButtonDown, .mceSeparator, .mceButtonDisabled, .mceButtonSelected {
+ margin-left: 1px;
+}
+
+.mceButtonNormal {
+ border-top: 1px solid;
+ border-left: 1px solid;
+ border-bottom: 1px solid;
+ border-right: 1px solid;
+ border-color: #F0F0EE;
+ cursor: default;
+}
+
+.mceButtonOver {
+ border: 1px solid #0A246A;
+ cursor: default;
+ background-color: #B6BDD2;
+}
+
+.mceButtonDown {
+ cursor: default;
+ border: 1px solid #0A246A;
+ background-color: #8592B5;
+}
+
+.mceButtonDisabled {
+ filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+ -moz-opacity:0.3;
+ opacity: 0.3;
+ border-top: 1px solid;
+ border-left: 1px solid;
+ border-bottom: 1px solid;
+ border-right: 1px solid;
+ border-color: #F0F0EE;
+ cursor: default;
+}
+
+.mceActionPanel {
+ margin-top: 5px;
+}
+
+/* Tabs classes */
+
+.tabs {
+ float: left;
+ width: 100%;
+ line-height: normal;
+ background-image: url("../images/xp/tabs_bg.gif");
+}
+
+.tabs ul {
+ margin: 0;
+ padding: 0 0 0;
+ list-style: none;
+}
+
+.tabs li {
+ float: left;
+ background: url("../images/xp/tab_bg.gif") no-repeat left top;
+ margin: 0;
+ margin-left: 0;
+ margin-right: 2px;
+ padding: 0 0 0 10px;
+ line-height: 18px;
+}
+
+.tabs li.current {
+ background: url("../images/xp/tab_sel_bg.gif") no-repeat left top;
+ margin-right: 2px;
+}
+
+.tabs span {
+ float: left;
+ display: block;
+ background: url("../images/xp/tab_end.gif") no-repeat right top;
+ padding: 0px 10px 0 0;
+}
+
+.tabs .current span {
+ background: url("../images/xp/tab_sel_end.gif") no-repeat right top;
+}
+
+.tabs a {
+ text-decoration: none;
+ font-family: Verdana, Arial;
+ font-size: 10px;
+}
+
+.tabs a:link, .tabs a:visited, .tabs a:hover {
+ color: black;
+}
+
+.tabs a:hover {
+}
+
+.tabs .current {
+}
+
+.tabs .current a, .tabs .current a:link, .tabs .current a:visited {
+}
+
+.panel_wrapper div.panel {
+ display: none;
+}
+
+.panel_wrapper div.current {
+ display: block;
+ width: 100%;
+ height: 300px;
+ overflow: visible; /* Should be auto but that breaks Safari */
+}
+
+.panel_wrapper {
+ border: 1px solid #919B9C;
+ border-top: 0px;
+ padding: 10px;
+ padding-top: 5px;
+ clear: both;
+ background-color: white;
+}
+
+fieldset {
+ border: 1px solid #919B9C;
+ font-family: Verdana, Arial;
+ font-size: 10px;
+ padding: 0;
+ margin: 0;
+ padding: 4px;
+}
+
+legend {
+ color: #2B6FB6;
+ font-weight: bold;
+}
+
+.properties {
+ width: 100%;
+}
+
+.properties .column1 {
+}
+
+.properties .column2 {
+ text-align: left;
+}
+
+a:link, a:visited {
+ color: black;
+}
+
+a:hover {
+ color: #2B6FB6;
+}
+
+#plugintable thead {
+ font-weight: bold;
+ background-color: #DDDDDD;
+}
+
+#plugintable, #about #plugintable td {
+ border: 1px solid #919B9C;
+}
+
+#plugintable {
+ width: 99%;
+ margin-top: 10px;
+}
+
+#pluginscontainer {
+ height: 290px;
+ overflow: auto;
+}
+
+/* MSIE Specific styles */
+
+* html .panel_wrapper {
+ width: 100%;
+}
+
+.column {
+ float: left;
+}
+
+h1, h2, h3, h4 {
+ color: #2B6FB6;
+ margin: 0;
+ padding: 0;
+ padding-top: 5px;
+}
+
+h3 {
+ font-size: 14px;
+}
+
+#link .panel_wrapper, #link div.current {
+ height: 125px;
+}
+
+#image .panel_wrapper, #image div.current {
+ height: 190px;
+}
+
+/* Disables the advanced tab in the table plugin. */
+/*
+#table #advanced_tab {
+ display: none;
+}
+*/
+
+/* Disables the border input field and label in the table plugin. */
+/*
+#table #border, #table #borderlabel {
+ display: none;
+}
+*/
+
+#insert, #cancel, .submitbutton {
+ font: 13px Verdana, Arial, Helvetica, sans-serif;
+ height: auto;
+ width: auto;
+ background-color: transparent;
+ background-image: url(../../../../../wp-admin/images/fade-butt.png);
+ background-repeat: repeat;
+ border: 3px double;
+ border-right-color: rgb(153, 153, 153);
+ border-bottom-color: rgb(153, 153, 153);
+ border-left-color: rgb(204, 204, 204);
+ border-top-color: rgb(204, 204, 204);
+ color: rgb(51, 51, 51);
+ padding: 0.25em 0.75em;
+}
+
+#insert:active, #cancel:active, .submitbutton:active {
+ background: #f4f4f4;
+ border-left-color: #999;
+ border-top-color: #999;
+}
+
+
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/bold_es.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/bold_es.gif
new file mode 100644
index 0000000..ea341e6
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/bold_es.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/bold_tw.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/bold_tw.gif
new file mode 100644
index 0000000..8208543
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/bold_tw.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/button_menu.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/button_menu.gif
new file mode 100644
index 0000000..c3d8fa2
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/button_menu.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/help.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/help.gif
new file mode 100644
index 0000000..51a1ee4
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/help.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/italic_es.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/italic_es.gif
new file mode 100644
index 0000000..4572cdb
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/italic_es.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/italic_tw.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/italic_tw.gif
new file mode 100644
index 0000000..4f6eeaa
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/italic_tw.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifycenter.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifycenter.gif
new file mode 100644
index 0000000..42d609a
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifycenter.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifyfull.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifyfull.gif
new file mode 100644
index 0000000..c8504f6
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifyfull.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifyleft.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifyleft.gif
new file mode 100644
index 0000000..e8f7e42
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifyleft.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifyright.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifyright.gif
new file mode 100644
index 0000000..e4cea97
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/justifyright.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/menu_check.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/menu_check.gif
new file mode 100644
index 0000000..50d6afd
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/menu_check.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/opacity.png b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/opacity.png
new file mode 100644
index 0000000..b4217cb
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/opacity.png
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/separator.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/separator.gif
new file mode 100644
index 0000000..4f39b80
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/separator.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/underline_es.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/underline_es.gif
new file mode 100644
index 0000000..551d914
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/underline_es.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/themes/advanced/images/underline_tw.gif b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/underline_tw.gif
new file mode 100644
index 0000000..b715390
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/themes/advanced/images/underline_tw.gif
Binary files differ
diff --git a/wp-inst/wp-includes/js/tinymce/tiny_mce_config.php b/wp-inst/wp-includes/js/tinymce/tiny_mce_config.php
new file mode 100644
index 0000000..651165a
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/tiny_mce_config.php
@@ -0,0 +1,86 @@
+<?php
+ @ require('../../../wp-config.php');
+
+ function wp_translate_tinymce_lang($text) {
+ if ( ! function_exists('__') ) {
+ return $text;
+ } else {
+ $search1 = "/^tinyMCELang\\[(['\"])(.*)\\1\]( ?= ?)(['\"])(.*)\\4/Uem";
+ $replace1 = "'tinyMCELang[\\1\\2\\1]\\3'.stripslashes('\\4').__('\\5').stripslashes('\\4')";
+
+ $search2 = "/ : (['\"])(.*)\\1/Uem";
+ $replace2 = "' : '.stripslashes('\\1').__('\\2').stripslashes('\\1')";
+
+ $search = array($search1, $search2);
+ $replace = array($replace1, $replace2);
+
+ $text = preg_replace($search, $replace, $text);
+
+ return $text;
+ }
+ }
+
+ // Set up init variables
+ $valid_elements = 'p/-div[*],-b[*],-font[*],-ul[*],-ol[*],-li[*],*[*]';
+ $valid_elements = apply_filters('mce_valid_elements', $valid_elements);
+
+ $plugins = array('inlinepopups', 'autosave', 'spellchecker', 'paste', 'wordpress');
+ $plugins = apply_filters('mce_plugins', $plugins);
+ $plugins = implode($plugins, ',');
+
+ $mce_buttons = apply_filters('mce_buttons', array('bold', 'italic', 'strikethrough', 'separator', 'bullist', 'numlist', 'outdent', 'indent', 'separator', 'justifyleft', 'justifycenter', 'justifyright', 'separator', 'link', 'unlink', 'image', 'wp_more', 'separator', 'spellchecker', 'separator', 'code', 'wp_help', 'wp_adv_start', 'wp_adv', 'separator', 'formatselect', 'underline', 'justifyfull', 'forecolor', 'separator', 'pastetext', 'pasteword', 'separator', 'removeformat', 'cleanup', 'separator', 'charmap', 'separator', 'undo', 'redo', 'wp_adv_end'));
+ $mce_buttons = implode($mce_buttons, ',');
+
+ $mce_buttons_2 = apply_filters('mce_buttons_2', array());
+ $mce_buttons_2 = implode($mce_buttons_2, ',');
+
+ $mce_buttons_3 = apply_filters('mce_buttons_3', array());
+ $mce_buttons_3 = implode($mce_buttons_3, ',');
+
+ $mce_browsers = apply_filters('mce_browsers', array('msie', 'gecko', 'opera', 'safari'));
+ $mce_browsers = implode($mce_browsers, ',');
+
+ $mce_popups_css = get_option('siteurl') . '/wp-includes/js/tinymce/plugins/wordpress/popups.css';
+ $mce_css = get_option('siteurl') . '/wp-includes/js/tinymce/plugins/wordpress/wordpress.css';
+ $mce_css = apply_filters('mce_css', $mce_css);
+?>
+
+initArray = {
+ mode : "specific_textareas",
+ editor_selector : "mceEditor",
+ width : "100%",
+ theme : "advanced",
+ theme_advanced_buttons1 : "<?php echo $mce_buttons; ?>",
+ theme_advanced_buttons2 : "<?php echo $mce_buttons_2; ?>",
+ theme_advanced_buttons3 : "<?php echo $mce_buttons_3; ?>",
+ language : "<?php echo strtolower(get_locale()); ?>",
+ theme_advanced_toolbar_location : "top",
+ theme_advanced_toolbar_align : "left",
+ theme_advanced_path_location : "bottom",
+ theme_advanced_resizing : true,
+ browsers : "<?php echo $mce_browsers; ?>",
+ dialog_type : "modal",
+ theme_advanced_resize_horizontal : false,
+ convert_urls : false,
+ relative_urls : false,
+ remove_script_host : false,
+ force_p_newlines : true,
+ force_br_newlines : false,
+ convert_newlines_to_brs : false,
+ remove_linebreaks : false,
+ fix_list_elements : true,
+ content_css : "<?php echo $mce_css; ?>",
+ valid_elements : "<?php echo $valid_elements; ?>",
+ save_callback : 'TinyMCE_wordpressPlugin.saveCallback',
+ imp_version : "<?php echo intval($_GET['ver']); ?>",
+<?php do_action('mce_options'); ?>
+ plugins : "<?php echo $plugins; ?>"
+};
+
+<?php
+ // For people who really REALLY know what they're doing with TinyMCE
+ // You can modify initArray to add, remove, change elements of the config before tinyMCE.init
+ do_action('tinymce_before_init');
+?>
+
+tinyMCE.init(initArray);
diff --git a/wp-inst/wp-includes/js/tinymce/utils/mclayer.js b/wp-inst/wp-includes/js/tinymce/utils/mclayer.js
new file mode 100644
index 0000000..0a7837b
--- /dev/null
+++ b/wp-inst/wp-includes/js/tinymce/utils/mclayer.js
@@ -0,0 +1,212 @@
+/**
+ * $RCSfile: mclayer.js,v $
+ * $Revision: 1.2 $
+ * $Date: 2006/02/06 20:11:09 $
+ *
+ * Moxiecode floating layer script.
+ *
+ * @author Moxiecode
+ * @copyright Copyright © 2004-2006, Moxiecode Systems AB, All rights reserved.
+ */
+
+function MCLayer(id) {
+ this.id = id;
+ this.settings = new Array();
+ this.blockerElement = null;
+ this.isMSIE = navigator.appName == "Microsoft Internet Explorer";
+ this.events = false;
+ this.autoHideCallback = null;
+}
+
+MCLayer.prototype = {
+ moveRelativeTo : function(re, p, a) {
+ var rep = this.getAbsPosition(re);
+ var w = parseInt(re.offsetWidth);
+ var h = parseInt(re.offsetHeight);
+ var x, y;
+
+ switch (p) {
+ case "tl":
+ break;
+
+ case "tr":
+ x = rep.absLeft + w;
+ y = rep.absTop;
+ break;
+
+ case "bl":
+ break;
+
+ case "br":
+ break;
+ }
+
+ this.moveTo(x, y);
+ },
+
+ moveBy : function(dx, dy) {
+ var e = this.getElement();
+ var x = parseInt(e.style.left);
+ var y = parseInt(e.style.top);
+
+ e.style.left = (x + dx) + "px";
+ e.style.top = (y + dy) + "px";
+
+ this.updateBlocker();
+ },
+
+ moveTo : function(x, y) {
+ var e = this.getElement();
+
+ e.style.left = x + "px";
+ e.style.top = y + "px";
+
+ this.updateBlocker();
+ },
+
+ show : function() {
+ MCLayer.visibleLayer = this;
+
+ this.getElement().style.display = 'block';
+ this.updateBlocker();
+ },
+
+ hide : function() {
+ this.getElement().style.display = 'none';
+ this.updateBlocker();
+ },
+
+ setAutoHide : function(s, cb) {
+ this.autoHideCallback = cb;
+ this.registerEventHandlers();
+ },
+
+ getElement : function() {
+ return document.getElementById(this.id);
+ },
+
+ updateBlocker : function() {
+ if (!this.isMSIE)
+ return;
+
+ var e = this.getElement();
+ var b = this.getBlocker();
+ var x = this.parseInt(e.style.left);
+ var y = this.parseInt(e.style.top);
+ var w = this.parseInt(e.offsetWidth);
+ var h = this.parseInt(e.offsetHeight);
+
+ b.style.left = x + 'px';
+ b.style.top = y + 'px';
+ b.style.width = w + 'px';
+ b.style.height = h + 'px';
+ b.style.display = e.style.display;
+ },
+
+ getBlocker : function() {
+ if (!this.blockerElement) {
+ var d = document, b = d.createElement("iframe");
+
+ b.style.cssText = 'display: none; left: 0px; position: absolute; top: 0';
+ b.src = 'javascript:false;';
+ b.frameBorder = '0';
+ b.scrolling = 'no';
+
+ d.body.appendChild(b);
+ this.blockerElement = b;
+ }
+
+ return this.blockerElement;
+ },
+
+ getAbsPosition : function(n) {
+ var p = {absLeft : 0, absTop : 0};
+
+ while (n) {
+ p.absLeft += n.offsetLeft;
+ p.absTop += n.offsetTop;
+ n = n.offsetParent;
+ }
+
+ return p;
+ },
+
+ registerEventHandlers : function() {
+ if (!this.events) {
+ var d = document;
+
+ this.addEvent(d, 'mousedown', MCLayer.prototype.onMouseDown);
+
+ this.events = true;
+ }
+ },
+
+ addEvent : function(o, n, h) {
+ if (o.attachEvent)
+ o.attachEvent("on" + n, h);
+ else
+ o.addEventListener(n, h, false);
+ },
+
+ onMouseDown : function(e) {
+ e = typeof(e) == "undefined" ? window.event : e;
+ var b = document.body;
+ var l = MCLayer.visibleLayer;
+
+ if (l) {
+ var mx = l.isMSIE ? e.clientX + b.scrollLeft : e.pageX;
+ var my = l.isMSIE ? e.clientY + b.scrollTop : e.pageY;
+ var el = l.getElement();
+ var x = parseInt(el.style.left);
+ var y = parseInt(el.style.top);
+ var w = parseInt(el.offsetWidth);
+ var h = parseInt(el.offsetHeight);
+
+ if (!(mx > x && mx < x + w && my > y && my < y + h)) {
+ MCLayer.visibleLayer = null;
+
+ if (l.autoHideCallback && l.autoHideCallback(l, e, mx, my))
+ return true;
+
+ l.hide();
+ }
+ }
+ },
+
+ addCSSClass : function(e, c) {
+ this.removeCSSClass(e, c);
+ var a = this.explode(' ', e.className);
+ a[a.length] = c;
+ e.className = a.join(' ');
+ },
+
+ removeCSSClass : function(e, c) {
+ var a = this.explode(' ', e.className), i;
+
+ for (i=0; i<a.length; i++) {
+ if (a[i] == c)
+ a[i] = '';
+ }
+
+ e.className = a.join(' ');
+ },
+
+ explode : function(d, s) {
+ var ar = s.split(d);
+ var oar = new Array();
+
+ for (var i = 0; i<ar.length; i++) {
+ if (ar[i] != "")
+ oar[oar.length] = ar[i];
+ }
+
+ return oar;
+ },
+
+ parseInt : function(s) {
+ if (s == null || s == '')
+ return 0;
+
+ return parseInt(s);
+ }
+} \ No newline at end of file
diff --git a/wp-inst/wp-includes/script-loader.php b/wp-inst/wp-includes/script-loader.php
new file mode 100644
index 0000000..1d23393
--- /dev/null
+++ b/wp-inst/wp-includes/script-loader.php
@@ -0,0 +1,235 @@
+<?php
+class WP_Scripts {
+ var $scripts = array();
+ var $queue = array();
+ var $printed = array();
+ var $args = array();
+
+ function WP_Scripts() {
+ $this->default_scripts();
+ }
+
+ function default_scripts() {
+ $this->add( 'dbx', '/wp-includes/js/dbx.js', false, '2.02' );
+ $this->add( 'fat', '/wp-includes/js/fat.js', false, '1.0-RC1_3660' );
+ $this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
+ $this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3517' );
+ $this->add( 'colorpicker', '/wp-includes/js/colorpicker.js', false, '3517' );
+ $this->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_gzip.php', false, '04162006' );
+ $this->add( 'wp_tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('tiny_mce'), '04162006' );
+ if ( is_admin() ) {
+ $this->add( 'dbx-admin-key', '/wp-admin/dbx-admin-key-js.php', array('dbx'), '3651' );
+ $this->add( 'listman', '/wp-admin/list-manipulation-js.php', array('sack', 'fat'), '3733' );
+ $this->add( 'ajaxcat', '/wp-admin/cat-js.php', array('listman'), '3684' );
+ $this->add( 'admin-categories', '/wp-admin/categories.js', array('listman'), '3684' );
+ $this->add( 'admin-custom-fields', '/wp-admin/custom-fields.js', array('listman'), '3733' );
+ $this->add( 'admin-comments', '/wp-admin/edit-comments.js', array('listman'), '3736' );
+ $this->add( 'admin-users', '/wp-admin/users.js', array('listman'), '3684' );
+ $this->add( 'xfn', '/wp-admin/xfn.js', false, '3517' );
+ }
+ }
+
+ /**
+ * Prints script tags
+ *
+ * Prints the scripts passed to it or the print queue. Also prints all necessary dependencies.
+ *
+ * @param mixed handles (optional) Scripts to be printed. (void) prints queue, (string) prints that script, (array of strings) prints those scripts.
+ * @return array Scripts that have been printed
+ */
+ function print_scripts( $handles = false ) {
+ // Print the queue if nothing is passed. If a string is passed, print that script. If an array is passed, print those scripts.
+ $handles = false === $handles ? $this->queue : (array) $handles;
+ $handles = $this->all_deps( $handles );
+ $this->_print_scripts( $handles );
+ return $this->printed;
+ }
+
+ /**
+ * Internally used helper function for printing script tags
+ *
+ * @param array handles Hierarchical array of scripts to be printed
+ * @see WP_Scripts::all_deps()
+ */
+ function _print_scripts( $handles ) {
+ global $wp_db_version;
+
+ foreach( array_keys($handles) as $handle ) {
+ if ( !$handles[$handle] )
+ return;
+ elseif ( is_array($handles[$handle]) )
+ $this->_print_scripts( $handles[$handle] );
+ if ( !in_array($handle, $this->printed) && isset($this->scripts[$handle]) ) {
+ $ver = $this->scripts[$handle]->ver ? $this->scripts[$handle]->ver : $wp_db_version;
+ if ( isset($this->args[$handle]) )
+ $ver .= '&' . $this->args[$handle];
+ $src = 0 === strpos($this->scripts[$handle]->src, 'http://') ? $this->scripts[$handle]->src : get_settings( 'siteurl' ) . $this->scripts[$handle]->src;
+ echo "<script type='text/javascript' src='$src?ver=$ver'></script>\n";
+ $this->printed[] = $handle;
+ }
+ }
+ }
+
+
+ /**
+ * Determines dependencies of scripts
+ *
+ * Recursively builds hierarchical array of script dependencies. Does NOT catch infinite loops.
+ *
+ * @param mixed handles Accepts (string) script name or (array of strings) script names
+ * @param bool recursion Used internally when function calls itself
+ * @return array Hierarchical array of dependencies
+ */
+ function all_deps( $handles, $recursion = false ) {
+ if ( ! $handles = (array) $handles )
+ return array();
+ $return = array();
+ foreach ( $handles as $handle ) {
+ $handle = explode('?', $handle);
+ if ( isset($handle[1]) )
+ $this->args[$handle[0]] = $handle[1];
+ $handle = $handle[0];
+ if ( is_null($return[$handle]) ) // Prime the return array with $handles
+ $return[$handle] = true;
+ if ( $this->scripts[$handle]->deps ) {
+ if ( false !== $return[$handle] && array_diff($this->scripts[$handle]->deps, array_keys($this->scripts)) )
+ $return[$handle] = false; // Script required deps which don't exist
+ else
+ $return[$handle] = $this->all_deps( $this->scripts[$handle]->deps, true ); // Build the hierarchy
+ }
+ if ( $recursion && false === $return[$handle] )
+ return false; // Cut the branch
+ }
+ return $return;
+ }
+
+ /**
+ * Adds script
+ *
+ * Adds the script only if no script of that name already exists
+ *
+ * @param string handle Script name
+ * @param string src Script url
+ * @param array deps (optional) Array of script names on which this script depends
+ * @param string ver (optional) Script version (used for cache busting)
+ * @return array Hierarchical array of dependencies
+ */
+ function add( $handle, $src, $deps = array(), $ver = false ) {
+ if ( isset($this->scripts[$handle]) )
+ return false;
+ $this->scripts[$handle] = new _WP_Script( $handle, $src, $deps, $ver );
+ return true;
+ }
+
+ function remove( $handles ) {
+ foreach ( (array) $handles as $handle )
+ unset($this->scripts[$handle]);
+ }
+
+ function enqueue( $handles ) {
+ foreach ( (array) $handles as $handle ) {
+ $handle = explode('?', $handle);
+ if ( !in_array($handle[0], $this->queue) && isset($this->scripts[$handle[0]]) ) {
+ $this->queue[] = $handle[0];
+ if ( isset($handle[1]) )
+ $this->args[$handle[0]] = $handle[1];
+ }
+ }
+ }
+
+ function dequeue( $handles ) {
+ foreach ( (array) $handles as $handle )
+ unset( $this->queue[$handle] );
+ }
+
+ function query( $handle, $list = 'scripts' ) { // scripts, queue, or printed
+ switch ( $list ) :
+ case 'scripts':
+ if ( isset($this->scripts[$handle]) )
+ return $this->scripts[$handle];
+ break;
+ default:
+ if ( in_array($handle, $this->$list) )
+ return true;
+ break;
+ endswitch;
+ return false;
+ }
+
+}
+
+class _WP_Script {
+ var $handle;
+ var $src;
+ var $deps = array();
+ var $ver = false;
+ var $args = false;
+
+ function _WP_Script() {
+ @list($this->handle, $this->src, $this->deps, $this->ver) = func_get_args();
+ if ( !is_array($this->deps) )
+ $this->deps = array();
+ if ( !$this->ver )
+ $this->ver = false;
+ }
+}
+
+/**
+ * Prints script tags in document head
+ *
+ * Called by admin-header.php and by wp_head hook. Since it is called by wp_head on every page load,
+ * the function does not instantiate the WP_Scripts object unless script names are explicitly passed.
+ * Does make use of already instantiated $wp_scripts if present.
+ * Use provided wp_print_scripts hook to register/enqueue new scripts.
+ *
+ * @see WP_Scripts::print_scripts()
+ */
+function wp_print_scripts( $handles = false ) {
+ do_action( 'wp_print_scripts' );
+
+ global $wp_scripts;
+ if ( !is_a($wp_scripts, 'WP_Scripts') ) {
+ if ( !$handles )
+ return array(); // No need to instantiate if nothing's there.
+ else
+ $wp_scripts = new WP_Scripts();
+ }
+
+ return $wp_scripts->print_scripts( $handles );
+}
+
+function wp_register_script( $handle, $src, $deps = array(), $ver = false ) {
+ global $wp_scripts;
+ if ( !is_a($wp_scripts, 'WP_Scripts') )
+ $wp_scripts = new WP_Scripts();
+
+ $wp_scripts->add( $handle, $src, $deps, $ver );
+}
+
+function wp_deregister_script( $handle ) {
+ global $wp_scripts;
+ if ( !is_a($wp_scripts, 'WP_Scripts') )
+ $wp_scripts = new WP_Scripts();
+
+ $wp_scripts->remove( $handle );
+}
+
+/**
+ * Equeues script
+ *
+ * Registers the script if src provided (does NOT overwrite) and enqueues.
+ *
+ * @see WP_Script::add(), WP_Script::enqueue()
+*/
+function wp_enqueue_script( $handle, $src = false, $deps = array(), $ver = false ) {
+ global $wp_scripts;
+ if ( !is_a($wp_scripts, 'WP_Scripts') )
+ $wp_scripts = new WP_Scripts();
+
+ if ( $src ) {
+ $_handle = explode('?', $handle);
+ $wp_scripts->add( $_handle[0], $src, $deps, $ver );
+ }
+ $wp_scripts->enqueue( $handle );
+}
+?>