summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-15 17:22:59 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2008-07-15 17:22:59 +0000
commit1d6b7c9a990f68f0f9b599d61678c71d40251704 (patch)
tree8f6f5206f365be2062ff98c3be887d47899b1a2a
parenta8a5dc5214b92fc26003983f599dd25e88660084 (diff)
downloadwordpress-mu-1d6b7c9a990f68f0f9b599d61678c71d40251704.tar.gz
wordpress-mu-1d6b7c9a990f68f0f9b599d61678c71d40251704.tar.xz
wordpress-mu-1d6b7c9a990f68f0f9b599d61678c71d40251704.zip
WP Merge with rev 8339
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@1374 7be80a69-a1ef-0310-a953-fb0f7c49ff36
-rw-r--r--wp-admin/admin-post.php24
-rw-r--r--wp-admin/admin.php3
-rw-r--r--wp-admin/css/colors-classic.css6
-rw-r--r--wp-admin/css/colors-fresh.css6
-rw-r--r--wp-admin/css/dashboard-rtl.css10
-rw-r--r--wp-admin/css/global-rtl.css8
-rw-r--r--wp-admin/css/install-rtl.css9
-rw-r--r--wp-admin/css/install.css38
-rw-r--r--wp-admin/css/login-rtl.css5
-rw-r--r--wp-admin/css/media.css39
-rw-r--r--wp-admin/css/press-this-ie-rtl.css7
-rw-r--r--wp-admin/css/press-this-ie.css8
-rw-r--r--wp-admin/css/press-this-rtl.css59
-rw-r--r--wp-admin/css/press-this.css240
-rw-r--r--wp-admin/css/theme-editor-rtl.css3
-rw-r--r--wp-admin/css/widgets-rtl.css2
-rw-r--r--wp-admin/gears-manifest.php11
-rw-r--r--wp-admin/images/no.pngbin0 -> 792 bytes
-rw-r--r--wp-admin/images/required.gifbin0 -> 62 bytes
-rw-r--r--wp-admin/images/yes.pngbin0 -> 612 bytes
-rw-r--r--wp-admin/includes/media.php276
-rw-r--r--wp-admin/includes/template.php68
-rw-r--r--wp-admin/includes/update.php68
-rw-r--r--wp-admin/js/comment.js2
-rw-r--r--wp-admin/js/editor.js6
-rw-r--r--wp-admin/js/forms.js2
-rw-r--r--wp-admin/js/gallery.js10
-rw-r--r--wp-admin/js/media-upload.js2
-rw-r--r--wp-admin/js/page.js2
-rw-r--r--wp-admin/js/revisions-js.php34
-rw-r--r--wp-admin/menu.php5
-rw-r--r--wp-admin/press-this.php241
-rw-r--r--wp-admin/revision.php1
-rw-r--r--wp-admin/rtl.css12
-rw-r--r--wp-admin/setup-config.php8
-rw-r--r--wp-admin/wp-admin.css8
-rw-r--r--wp-content/themes/default/style.css2
-rw-r--r--wp-includes/class.wp-scripts.php2
-rw-r--r--wp-includes/class.wp-styles.php2
-rw-r--r--wp-includes/js/tinymce/langs/wp-langs.php4
-rw-r--r--wp-includes/js/tinymce/plugins/wpeditimage/editimage.html28
-rw-r--r--wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js30
-rw-r--r--wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js30
-rw-r--r--wp-includes/js/tinymce/tiny_mce_config.php5
-rw-r--r--wp-includes/js/tinymce/wordpress.css6
-rw-r--r--wp-includes/link-template.php129
-rw-r--r--wp-includes/media.php6
-rw-r--r--wp-includes/pluggable.php5
-rw-r--r--wp-includes/script-loader.php16
-rw-r--r--wp-includes/theme.php2
-rw-r--r--wp-includes/update.php93
-rw-r--r--wp-includes/version.php4
-rw-r--r--wp-includes/wp-db.php3
-rw-r--r--wp-login.php18
54 files changed, 1111 insertions, 497 deletions
diff --git a/wp-admin/admin-post.php b/wp-admin/admin-post.php
new file mode 100644
index 0000000..f45fc62
--- /dev/null
+++ b/wp-admin/admin-post.php
@@ -0,0 +1,24 @@
+<?php
+define('WP_ADMIN', TRUE);
+
+if ( defined('ABSPATH') )
+ require_once(ABSPATH . 'wp-load.php');
+else
+ require_once('../wp-load.php');
+
+require_once(ABSPATH . 'wp-admin/includes/admin.php');
+
+if ( !wp_validate_auth_cookie() )
+ wp_die(__('Cheatin&#8217; uh?'));
+
+nocache_headers();
+
+do_action('admin_init');
+
+$action = 'admin_post';
+if ( !empty($_REQUEST['action']) )
+ $action .= '_' . $_REQUEST['action'];
+
+do_action($action);
+
+?> \ No newline at end of file
diff --git a/wp-admin/admin.php b/wp-admin/admin.php
index e9591e8..6936c0b 100644
--- a/wp-admin/admin.php
+++ b/wp-admin/admin.php
@@ -118,4 +118,7 @@ if (isset($plugin_page)) {
do_action("load-$pagenow");
}
+if ( !empty($_REQUEST['action']) )
+ do_action('admin_action_' . $_REQUEST['action']);
+
?>
diff --git a/wp-admin/css/colors-classic.css b/wp-admin/css/colors-classic.css
index 83a1141..65d0f38 100644
--- a/wp-admin/css/colors-classic.css
+++ b/wp-admin/css/colors-classic.css
@@ -312,11 +312,11 @@ ul#widget-list li.widget-list-item h4.widget-title {
font-weight: bold;
}
-#adminmenu li a #awaiting-mod {
+#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
background-image: url(../images/comment-stalk-classic.gif);
}
-#adminmenu li a #awaiting-mod span {
+#adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span {
background-color: #d54e21;
color: #fff;
}
@@ -327,7 +327,7 @@ ul#widget-list li.widget-list-item h4.widget-title {
}
-#adminmenu li a:hover #awaiting-mod span {
+#adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span {
background-color: #07273E;
}
diff --git a/wp-admin/css/colors-fresh.css b/wp-admin/css/colors-fresh.css
index 1d59940..09e0c58 100644
--- a/wp-admin/css/colors-fresh.css
+++ b/wp-admin/css/colors-fresh.css
@@ -291,16 +291,16 @@ ul#widget-list li.widget-list-item h4.widget-title {
color: #d54e21;
}
-#adminmenu li a #awaiting-mod {
+#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
background-image: url(../images/comment-stalk-fresh.gif);
}
-#adminmenu li a #awaiting-mod span, #rightnow .reallynow {
+#adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span, #rightnow .reallynow {
background-color: #d54e21;
color: #fff;
}
-#adminmenu li a:hover #awaiting-mod span {
+#adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span {
background-color: #264761;
}
diff --git a/wp-admin/css/dashboard-rtl.css b/wp-admin/css/dashboard-rtl.css
index 82b77a3..3b66d17 100644
--- a/wp-admin/css/dashboard-rtl.css
+++ b/wp-admin/css/dashboard-rtl.css
@@ -22,6 +22,10 @@ h3.dashboard-widget-title span {
float: right;
}
+div.dashboard-widget-submit input {
+ font-family: sans-serif !important;
+}
+
#dashboard-widgets .widget_rss ul li a {
float:right;
font-weight:bold;
@@ -63,7 +67,13 @@ div.dashboard-widget {
#dashboard_secondary div.dashboard-widget-content ul li {
float: right;
}
+#dashboard_secondary div.dashboard-widget-content ul li .post {
+ font-family: sans-serif !important;
+}
#dashboard_secondary div.dashboard-widget-content ul li a {
border-right:0 none;
border-left:1px solid #DADADA;
}
+#dashboard_secondary div.dashboard-widget-content ul li a cite {
+ font-family: sans-serif;
+}
diff --git a/wp-admin/css/global-rtl.css b/wp-admin/css/global-rtl.css
index a34f7ad..4967c54 100644
--- a/wp-admin/css/global-rtl.css
+++ b/wp-admin/css/global-rtl.css
@@ -1,9 +1,15 @@
-/* styles for use by people extending the WordPress interface */
+//* styles for use by people extending the WordPress interface */
+body, td { font-family: sans-serif; }
+
+textarea, input, select { font-family: sans-serif; }
+
.alignleft { float: right; }
.alignright { float: left; }
.textleft { text-align: right; }
.textright { text-align: left; }
+
+.wrap h2 { font-family: sans-serif; }
.widefat td {
padding: 7px 10px 9px 15px;
diff --git a/wp-admin/css/install-rtl.css b/wp-admin/css/install-rtl.css
index 806dbc5..3752856 100644
--- a/wp-admin/css/install-rtl.css
+++ b/wp-admin/css/install-rtl.css
@@ -1,5 +1,6 @@
body {
- font-size: 11px;;
+ font-size: 11px;
+ font-family: sans-serif !important;
}
ul, ol {
padding: 5px 22px 5px 5px;
@@ -16,4 +17,10 @@ input {
#admin_email {
direction: ltr;
text-align: left;
+}
+.submit input, .button, .button-secondary {
+ font-family: sans-serif !important;
+}
+h1 {
+ font-family: sans-serif;
} \ No newline at end of file
diff --git a/wp-admin/css/install.css b/wp-admin/css/install.css
index bc44b1c..cfa0325 100644
--- a/wp-admin/css/install.css
+++ b/wp-admin/css/install.css
@@ -7,8 +7,10 @@ body {
margin: 2em auto 0 auto;
width: 700px;
padding: 1em 2em;
+ -moz-border-radius: 12px;
+ -khtml-border-radius: 12px;
-webkit-border-radius: 12px;
- font-size: 62.5%;
+ border-radius: 12px;
}
a { color: #2583ad; text-decoration: none; }
@@ -25,12 +27,12 @@ h2 { font-size: 16px; }
p, li {
padding-bottom: 2px;
- font-size: 1.3em;
- line-height: 1.8em;
+ font-size: 13px;
+ line-height: 18px;
}
code {
- font-size: 1.3em;
+ font-size: 13px;
}
ul, ol { padding: 5px 5px 5px 22px; }
@@ -38,12 +40,16 @@ ul, ol { padding: 5px 5px 5px 22px; }
#logo { margin: 6px 0 14px 0px; border-bottom: none;}
.step {
- font-size: 2.2em;
+ margin: 20px 0 15px;
}
-.step input { font-size: 2em; }
+.step input {
+ font-size: 18px;
+}
-td input { font-size: 1.5em; }
+a.button {
+ font-size: 18px;
+}
.step, th { text-align: left; padding: 0; }
@@ -79,12 +85,13 @@ td input { font-size: 1.5em; }
margin-bottom: 9px;
padding: 10px;
border-bottom: 8px solid #fff;
+ font-size: 12px;
}
.form-table th {
- font-size: 12px;
+ font-size: 13px;
text-align: left;
- padding: 12px 10px 10px 10px;
+ padding: 16px 10px 10px 10px;
border-bottom: 8px solid #fff;
width: 110px;
vertical-align: top;
@@ -104,6 +111,12 @@ td input { font-size: 1.5em; }
font-size: 11px;
}
+.form-table input {
+ line-height: 20px;
+ font-size: 15px;
+ padding: 2px;
+}
+
h1 {
border-bottom: 1px solid #dadada;
clear: both;
@@ -120,9 +133,10 @@ h1 {
#error-page p {
font-size: 14px;
- line-height: 1.6em;
+ line-height: 16px;
+ margin: 25px 0 20px;
}
#error-page code {
- font-size: 1em;
-}
+ font-size: 15px;
+} \ No newline at end of file
diff --git a/wp-admin/css/login-rtl.css b/wp-admin/css/login-rtl.css
index fc27263..aa3c2c2 100644
--- a/wp-admin/css/login-rtl.css
+++ b/wp-admin/css/login-rtl.css
@@ -1,7 +1,10 @@
body {
- font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+ font-family: sans-serif;
direction: rtl;
}
+#login form .submit input {
+ font-family: sans-serif !important;
+}
form {
margin-left:0;
margin-right:8px;
diff --git a/wp-admin/css/media.css b/wp-admin/css/media.css
index 225fa84..d04866a 100644
--- a/wp-admin/css/media.css
+++ b/wp-admin/css/media.css
@@ -32,6 +32,7 @@ form {
.media-upload-form label, .media-upload-form legend {
display:block;
font-weight: bold;
+ font-size: 13px;
margin-bottom: 0.5em;
margin: 0 0 0.5em 0;
}
@@ -228,9 +229,11 @@ abbr.required {
}
.filename {
+ float: left;
line-height: 36px;
margin-left: 10px;
- float: left;
+ overflow: hidden;
+ max-width: 430px;
}
#media-upload .describe {
border-top-width: 1px;
@@ -276,3 +279,37 @@ abbr.required {
display: none;
margin: 5px 0;
}
+
+.menu_order {
+ float: right;
+ font-size: 11px;
+ margin: 10px 10px 0;
+}
+
+.menu_order_input {
+ border: 1px solid #DDDDDD;
+ font-size: 10px;
+ padding: 1px;
+ width: 23px;
+}
+
+.ui-sortable-helper {
+ background-color: #fff;
+ border: 1px solid #aaa;
+ opacity: 0.6;
+ filter: alpha(opacity=60);
+}
+
+#media-upload th.order-head {
+ width: 25%;
+ text-align: center;
+}
+
+#media-upload .widefat {
+ width: 626px;
+ border-style: solid solid none;
+}
+
+.sorthelper {
+ z-index: -1;
+}
diff --git a/wp-admin/css/press-this-ie-rtl.css b/wp-admin/css/press-this-ie-rtl.css
new file mode 100644
index 0000000..19c6f20
--- /dev/null
+++ b/wp-admin/css/press-this-ie-rtl.css
@@ -0,0 +1,7 @@
+#menu { margin-right: 8px !important; }
+
+p.submit input { text-align: right !important; }
+
+li.ui-tabs-selected a { height: 25px; }
+
+#photo_directions span { right: 200px; left: auto; height: 8px; } \ No newline at end of file
diff --git a/wp-admin/css/press-this-ie.css b/wp-admin/css/press-this-ie.css
new file mode 100644
index 0000000..54a1bfe
--- /dev/null
+++ b/wp-admin/css/press-this-ie.css
@@ -0,0 +1,8 @@
+
+#posting {
+ position: static !important;
+}
+ .ui-tabs-nav {
+ margin-left: 0;
+ border: 0 !important;
+}
diff --git a/wp-admin/css/press-this-rtl.css b/wp-admin/css/press-this-rtl.css
new file mode 100644
index 0000000..27009c5
--- /dev/null
+++ b/wp-admin/css/press-this-rtl.css
@@ -0,0 +1,59 @@
+body {
+ font-family: sans-serif;
+}
+
+#viewsite {
+ right:auto; left: 8px;
+}
+
+ul#menu {
+ padding-right: 8px;
+}
+
+.ui-tabs-nav li {
+ float: right;
+}
+
+div#posting {
+ padding-right:16px; padding-left: 0;
+}
+
+div#categories {
+ right: auto; left: 16px;
+}
+
+div#categories h2 {
+ margin:0.5em 1em 0.5em 0;
+}
+
+#jaxtag {
+ padding-right :1em; padding-left: 0;
+}
+
+input#newtag {
+ margin-left: 4px; width: 100px;
+}
+
+#photo_directions span {
+ right: auto; left: 3px
+}
+
+#TB_ajaxContent #options {
+ right: auto; left: 25px;
+}
+
+#TB_ajaxContent {
+ text-align: right;
+}
+
+#TB_ajaxContent #this_photo {
+ direction: ltr;
+}
+
+.video_split #extra_fields {
+ float: right;
+}
+
+.video_split .editor_area {
+ float: left;
+} \ No newline at end of file
diff --git a/wp-admin/css/press-this.css b/wp-admin/css/press-this.css
index 005e13f..70c7e64 100644
--- a/wp-admin/css/press-this.css
+++ b/wp-admin/css/press-this.css
@@ -88,34 +88,33 @@ body {
cursor: pointer;
}
+/* Header */
#wphead {
border-top: none;
+ height: 2em;
+ padding-top: 8px;
}
.button {
-font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
-padding: 3px 5px;
-font-size: 12px;
-line-height: 1.5em;
-border-width: 1px;
-border-style: solid;
--moz-border-radius: 3px;
--khtml-border-radius: 3px;
--webkit-border-radius: 3px;
-border-radius: 3px;
-cursor: pointer;
-margin-left: 5px;
-text-decoration: none;
+ font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
+ padding: 3px 5px;
+ font-size: 12px;
+ line-height: 1.5em;
+ border-width: 1px;
+ border-style: solid;
+ -moz-border-radius: 3px;
+ -khtml-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ cursor: pointer;
+ margin-left: 5px;
+ text-decoration: none;
}
.howto {
-font-size: 11px;
-}
-#newtag { width: 60%; padding: 3px; }
-
-#wphead {
- height: 2em;
- padding-top: 8px;
+ font-size: 11px;
+ font-style: italic;
+ display: block;
}
#wphead #viewsite {
@@ -132,8 +131,7 @@ font-size: 11px;
}
#wphead #viewsite a {
- font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana,
- sans-serif;
+ font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;
padding: 3px 4px;
display: block;
letter-spacing: normal;
@@ -173,18 +171,18 @@ input.text {
color: #333333;
}
-.titlewrap {
- border-style: solid;
- border-width: 1px;
- padding: 2px 3px;
- border-color: #CCCCCC;
-}
+/* Editor/Main Column */
div#container {
margin: 0;
min-width: 500px;
}
+div#container form {
+ margin: 0px;
+ padding: 0px;
+}
+
div#posting {
padding-left: 16px;
position: absolute;
@@ -192,6 +190,17 @@ div#posting {
width: 66%;
}
+#post_title {
+ width: 99%;
+}
+
+.titlewrap {
+ border-style: solid;
+ border-width: 1px;
+ padding: 2px 3px;
+ border-color: #CCCCCC;
+}
+
div#posting h2 {
margin: .5em 0 .25em 0;
font-size: 12px;
@@ -199,11 +208,64 @@ div#posting h2 {
background: ;
}
-div#container form {
- margin: 0px;
- padding: 0px;
+.editor-container {
+ border-width: 1px;
+ border-color: #ccc;
+ border-style: solid;
+ margin-bottom: 1em;
+}
+
+/* Photo Styles */
+
+#photo_directions {
+ margin-top: .25em;
+ display: block;
+ position: relative;
+}
+
+#photo_directions span {
+ display: block;
+ position: absolute;
+ top: 0;
+ right: 3px;
}
+#photo_saving {
+ margin: 0 8px 8px;
+ vertical-align: middle;
+}
+
+#img_container {
+ background-color: #fff;
+ overflow: auto;
+ height: 100px;
+}
+
+#img_container a {
+ display: block;
+ width: 79px;
+ height: 79px;
+ float: left;
+}
+
+#img_container img {
+ width: 75px;
+ height: 75px;
+ border: 0px;
+ padding: 2px;
+ background-color: #f4f4f4;
+ cursor: pointer;
+}
+#img_container a, #img_container a:link, #img_container a:visited {
+ border: 2px solid #ccc;
+ margin: 0 4px 4px 0;
+}
+#img_container a:hover, #img_container a:active {
+ border: 2px solid #000;
+}
+
+/* Submit Column */
+
div#categories {
font-size: 85%;
position: absolute;
@@ -216,13 +278,13 @@ div#categories {
div#categories h2 {
color: #333;
font-size: 12px;
- margin: .5em 0 0 1em;
+ margin: .5em 0 .5em 1em;
padding: 0;
}
#categories-all {
overflow: auto;
- padding: 1em;
+ padding: 0 1em 1em 1em;
height: 15em;
}
@@ -232,16 +294,16 @@ div#categories h2 {
margin: 0;
}
-.editor-container {
- border-width: 1px;
- border-color: #ccc;
- border-style: solid;
- margin-bottom: 1em;
-}
-
#tagsdiv #newtag {
+ padding: 3px;
margin-right: 5px;
- width: 16em;
+ width: 16em;
+}
+
+#jaxtag {
+ clear: both;
+ padding-left: 1em;
+ margin: 0;
}
#tagchecklist {
@@ -278,43 +340,6 @@ div#categories h2 {
overflow: hidden;
position: absolute;
}
-
-.howto {
- font-style: italic;
- display: block;
-}
-
-#post_title {
- width: 99%;
-}
-
-#img_container {
- background-color: #fff;
- overflow: auto;
- height: 100px;
-}
-
-#img_container a {
- display: block;
- width: 79px;
- height: 79px;
- float: left;
-}
-#img_container img {
- width: 75px;
- height: 75px;
- border: 0px;
- padding: 2px;
- background-color: #f4f4f4;
- cursor: pointer;
-}
-#img_container a, #img_container a:link, #img_container a:visited {
- border: 2px solid #ccc;
- margin: 0 4px 4px 0;
-}
-#img_container a:hover, #img_container a:active {
- border: 2px solid #000;
-}
.submit {
-moz-border-radius-bottomleft: 3px;
-khtml-border-bottom-left-radius: 3px;
@@ -325,7 +350,7 @@ div#categories h2 {
-webkit-border-bottom-right-radius: 3px;
border-bottom-right-radius: 3px;
margin: 0;
- padding: 0;
+ padding: 10px;
}
.submitbox {
width: 100%;
@@ -340,10 +365,9 @@ div#categories h2 {
.submitbox .submit input {
border: none;
text-align: left;
- padding: 12px 10px 10px 10px;
+ padding: 6px 4px;
font-size: 12px;
- margin: 10px;
-
+ margin: 2px;
-moz-border-radius: 3px;
-khtml-border-radius: 3px;
-webkit-border-radius: 3px;
@@ -363,10 +387,7 @@ div#categories h2 {
border-top-right-radius: 3px;
}
-.hidden {
- display: none;
-}
-
+/* Video Styles */
.video_split #extra_fields {
width: 27%;
height: 300px;
@@ -383,11 +404,6 @@ div#categories h2 {
float: right;
}
-#jaxtag {
- clear: both;
- padding-left: 1em;
-}
-
.ac_results {
padding: 0;
margin: 0;
@@ -413,25 +429,24 @@ div#categories h2 {
text-decoration: underline;
}
-
.photolist {
-display: none;
+ display: none;
}
#extra_fields small {
-display: block;
-margin-top: .5em;
-padding-bottom: .25em;
+ display: block;
+ margin-top: .5em;
+ padding-bottom: .25em;
}
#TB_ajaxContent #options {
-position: absolute;
-top: 20px;
-right: 25px;
-padding: 5px;
+ position: absolute;
+ top: 20px;
+ right: 25px;
+ padding: 5px;
}
#TB_ajaxContent h3 {
-margin-bottom: .25em;
+ margin-bottom: .25em;
}
.updated {
@@ -461,27 +476,14 @@ margin-bottom: .25em;
padding-bottom: 2px;
}
-#photo_directions {
-margin-top: .25em;
-display: block;
-position: relative;
-}
-#photo_directions span {
-display: block;
-position: absolute;
-top: 0;
-right: 3px;
-}
-#photo_saving {
-margin-bottom: 8px;
-}
-
#post_status {
margin-left: 10px;
margin-bottom: 1em;
display: block;
}
+/* Footer */
+
#footer {
height: 65px;
display: block;
@@ -506,6 +508,12 @@ margin-bottom: 8px;
text-decoration: underline;
}
+
+/* Utility Classes */
.centered {
text-align: center;
}
+
+.hidden {
+ display: none;
+} \ No newline at end of file
diff --git a/wp-admin/css/theme-editor-rtl.css b/wp-admin/css/theme-editor-rtl.css
index 407886b..c3df152 100644
--- a/wp-admin/css/theme-editor-rtl.css
+++ b/wp-admin/css/theme-editor-rtl.css
@@ -1,3 +1,6 @@
+#template textarea {
+ font-family: monospace !important;
+}
#templateside {
float:left;
}
diff --git a/wp-admin/css/widgets-rtl.css b/wp-admin/css/widgets-rtl.css
index 8dd3994..0bd4af6 100644
--- a/wp-admin/css/widgets-rtl.css
+++ b/wp-admin/css/widgets-rtl.css
@@ -48,4 +48,4 @@ ul.widget-control-list div.widget-control-actions {
ul.widget-control-list h4.widget-title,
#dragHelper h4.widget-title {
text-align: right;
-}
+} \ No newline at end of file
diff --git a/wp-admin/gears-manifest.php b/wp-admin/gears-manifest.php
index 9abb9b3..ba965a4 100644
--- a/wp-admin/gears-manifest.php
+++ b/wp-admin/gears-manifest.php
@@ -64,7 +64,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
?>
{
"betaManifestVersion" : 1,
-"version" : "<?php echo $man_version; ?>_20080704",
+"version" : "<?php echo $man_version; ?>_20080710a",
"entries" : [
<?php echo $defaults; ?>
@@ -99,6 +99,9 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
{ "url" : "images/xit.gif" },
{ "url" : "images/loading-publish.gif" },
{ "url" : "images/loading.gif" },
+{ "url" : "images/required.gif" },
+{ "url" : "images/no.png" },
+{ "url" : "images/yes.png" },
{ "url" : "../wp-includes/images/crystal/archive.png" },
{ "url" : "../wp-includes/images/crystal/audio.png" },
@@ -128,7 +131,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/link.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311" },
-{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311d" },
{ "url" : "../wp-includes/js/tinymce/tiny_mce.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=311" },
@@ -145,7 +148,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
{ "url" : "../wp-includes/js/tinymce/plugins/paste/pastetext.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" },
-{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311b" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311d" },
{ "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" },
{ "url" : "../wp-includes/js/tinymce/themes/advanced/skins/wp_theme/ui.css?ver=311" },
@@ -158,7 +161,7 @@ header( 'Content-Type: application/x-javascript; charset=UTF-8' );
{ "url" : "../wp-includes/js/tinymce/plugins/media/css/media.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" },
-{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311b" },
+{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311d" },
{ "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" },
{ "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" },
diff --git a/wp-admin/images/no.png b/wp-admin/images/no.png
new file mode 100644
index 0000000..e2db55f
--- /dev/null
+++ b/wp-admin/images/no.png
Binary files differ
diff --git a/wp-admin/images/required.gif b/wp-admin/images/required.gif
new file mode 100644
index 0000000..119350f
--- /dev/null
+++ b/wp-admin/images/required.gif
Binary files differ
diff --git a/wp-admin/images/yes.png b/wp-admin/images/yes.png
new file mode 100644
index 0000000..2f86f0a
--- /dev/null
+++ b/wp-admin/images/yes.png
Binary files differ
diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php
index 89a3040..abdb44d 100644
--- a/wp-admin/includes/media.php
+++ b/wp-admin/includes/media.php
@@ -26,11 +26,14 @@ function update_gallery_tab($tabs) {
add_filter('media_upload_tabs', 'update_gallery_tab');
function the_media_upload_tabs() {
+ global $redir_tab;
$tabs = media_upload_tabs();
if ( !empty($tabs) ) {
echo "<ul id='sidemenu'>\n";
- if ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) )
+ if ( isset($redir_tab) && array_key_exists($redir_tab, $tabs) )
+ $current = $redir_tab;
+ elseif ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) )
$current = $_GET['tab'];
else {
$keys = array_keys($tabs);
@@ -64,7 +67,8 @@ function get_image_send_to_editor($id, $alt, $title, $align, $url='', $rel = fal
function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) {
- if ( empty($alt) ) return $html;
+ // CAPTIONS_OFF is temporary. Do not use it.
+ if ( empty($alt) || ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ) return $html;
$id = ( 0 < (int) $id ) ? 'attachment_' . $id : '';
preg_match( '/width="([0-9]+)/', $html, $matches );
@@ -74,8 +78,8 @@ function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) {
$html = preg_replace( '/align[^\s\'"]+\s?/', '', $html );
if ( empty($align) ) $align = 'none';
- $shcode = '[wp_caption id="' . $id . '" align="align' . $align
- . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/wp_caption]';
+ $shcode = '[caption id="' . $id . '" align="align' . $align
+ . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/caption]';
return apply_filters( 'image_add_caption_shortcode', $shcode, $html );
}
@@ -154,7 +158,7 @@ function media_handle_sideload($file_array, $post_id, $desc = null, $post_data =
if ( trim($image_meta['caption']) )
$content = $image_meta['caption'];
}
-
+
$title = @$desc;
// Construct the attachment array
@@ -325,8 +329,10 @@ function media_upload_image() {
$errors = $return;
}
- if ( isset($_POST['save']) )
+ if ( isset($_POST['save']) ) {
$errors['upload_notice'] = __('Saved.');
+ return media_upload_gallery();
+ }
return wp_iframe( 'media_upload_type_form', 'image', $errors, $id );
}
@@ -336,7 +342,7 @@ function media_sideload_image($file, $post_id, $desc = null) {
$file_array['name'] = basename($file);
$file_array['tmp_name'] = download_url($file);
$desc = @$desc;
-
+
$id = media_handle_sideload($file_array, $post_id, $desc);
$src = $id;
@@ -385,8 +391,10 @@ function media_upload_audio() {
$errors = $return;
}
- if ( isset($_POST['save']) )
+ if ( isset($_POST['save']) ) {
$errors['upload_notice'] = __('Saved.');
+ return media_upload_gallery();
+ }
return wp_iframe( 'media_upload_type_form', 'audio', $errors, $id );
}
@@ -423,8 +431,10 @@ function media_upload_video() {
$errors = $return;
}
- if ( isset($_POST['save']) )
+ if ( isset($_POST['save']) ) {
$errors['upload_notice'] = __('Saved.');
+ return media_upload_gallery();
+ }
return wp_iframe( 'media_upload_type_form', 'video', $errors, $id );
}
@@ -461,8 +471,10 @@ function media_upload_file() {
$errors = $return;
}
- if ( isset($_POST['save']) )
+ if ( isset($_POST['save']) ) {
$errors['upload_notice'] = __('Saved.');
+ return media_upload_gallery();
+ }
return wp_iframe( 'media_upload_type_form', 'file', $errors, $id );
}
@@ -497,8 +509,15 @@ function media_upload_library() {
function image_attachment_fields_to_edit($form_fields, $post) {
if ( substr($post->post_mime_type, 0, 5) == 'image' ) {
$form_fields['post_title']['required'] = true;
- $form_fields['post_excerpt']['label'] = __('Caption');
- $form_fields['post_excerpt']['helps'][] = __('Alternate text, e.g. "The Mona Lisa"');
+
+ // CAPTIONS_OFF is temporary. Do not use it.
+ if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) {
+ $form_fields['post_excerpt']['label'] = __('Alternate Text');
+ $form_fields['post_excerpt']['helps'][] = __('Alt text for the image, e.g. "The Mona Lisa"');
+ } else {
+ $form_fields['post_excerpt']['label'] = __('Caption');
+ $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image');
+ }
$form_fields['post_content']['label'] = __('Description');
@@ -587,13 +606,19 @@ function get_attachment_fields_to_edit($post, $errors = null) {
$file = wp_get_attachment_url($post->ID);
$link = get_attachment_link($post->ID);
+ // CAPTIONS_OFF is temporary. Do not use it.
+ if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF )
+ $alt = __('Alternate Text');
+ else
+ $alt = __('Caption');
+
$form_fields = array(
'post_title' => array(
'label' => __('Title'),
'value' => $edit_post->post_title,
),
'post_excerpt' => array(
- 'label' => __('Caption'),
+ 'label' => $alt,
'value' => $edit_post->post_excerpt,
),
'post_content' => array(
@@ -673,6 +698,8 @@ function get_media_items( $post_id, $errors ) {
}
function get_media_item( $attachment_id, $args = null ) {
+ global $redir_tab;
+
$default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true );
$args = wp_parse_args( $args, $default_args );
extract( $args, EXTR_SKIP );
@@ -720,11 +747,27 @@ function get_media_item( $attachment_id, $args = null ) {
}
$display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case
- $display_title = wp_html_excerpt($display_title, 100);
+ $display_title = wp_html_excerpt($display_title, 60);
+
+ $gallery = ( (isset($_REQUEST['tab']) && 'gallery' == $_REQUEST['tab']) || (isset($redir_tab) && 'gallery' == $redir_tab) ) ? true : false;
+ $order = '';
+
+ foreach ( $form_fields as $key => $val ) {
+ if ( 'menu_order' == $key ) {
+ if ( $gallery )
+ $order = '<div class="menu_order"> <input class="menu_order_input" type="text" id="attachments['.$attachment_id.'][menu_order]" name="attachments['.$attachment_id.'][menu_order]" value="'.$val['value'].'" /></div>';
+ else
+ $order = '<input type="hidden" name="attachments['.$attachment_id.'][menu_order]" value="'.$val['value'].'" />';
+
+ unset($form_fields['menu_order']);
+ break;
+ }
+ }
$item = "
$type
$toggle_links
+ $order
<div class='filename new'>$display_title</div>
<table class='slidetoggle describe $class'>
<thead class='media-item-info'>
@@ -958,6 +1001,81 @@ jQuery(function($){
<h3><?php _e('From URL'); ?></h3>
</div>
+<script type="text/javascript">
+//<![CDATA[
+var addExtImage = {
+
+ width : '',
+ height : '',
+ align : 'alignnone',
+
+ insert : function() {
+ var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = null;
+
+ if ( '' == f.src.value || '' == t.width ) return false;
+
+ if ( f.title.value ) {
+ title = f.title.value.replace(/['"<>]+/g, '');
+ title = ' title="'+title+'"';
+ }
+
+ if ( f.alt.value ) {
+ alt = f.alt.value.replace(/['"<>]+/g, '');
+<?php if ( ! defined('CAPTIONS_OFF') || true != CAPTIONS_OFF ) { // CAPTIONS_OFF is temporary. Do not use it. ?>
+ caption = f.alt.value.replace(/'/g, '&#39;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
+<?php } ?>
+ }
+
+ cls = caption ? '' : ' class="'+t.align+'"';
+
+ html = '<img alt="'+alt+'" src="'+f.src.value+'"'+title+cls+' width="'+t.width+'" height="'+t.height+'" />';
+
+ if ( f.url.value )
+ html = '<a href="'+f.url.value+'">'+html+'</a>';
+
+ if ( caption )
+ html = '[caption id="" align="'+t.align+'" width="'+t.width+'" caption="'+caption+'"]'+html+'[/caption]';
+
+ var win = window.dialogArguments || opener || parent || top;
+ win.send_to_editor(html);
+ },
+
+ resetImageData : function() {
+ var t = addExtImage;
+
+ t.width = t.height = '';
+ document.getElementById('go_button').style.color = '#bbb';
+ if ( ! document.forms[0].src.value )
+ document.getElementById('status_img').src = 'images/required.gif';
+ else document.getElementById('status_img').src = 'images/no.png';
+ },
+
+ updateImageData : function() {
+ var t = addExtImage;
+
+ t.width = t.preloadImg.width;
+ t.height = t.preloadImg.height;
+ document.getElementById('go_button').style.color = '#333';
+ document.getElementById('status_img').src = 'images/yes.png';
+ },
+
+ getImageData : function() {
+ var t = addExtImage, src = document.forms[0].src.value;
+
+ if ( ! src ) {
+ t.resetImageData();
+ return false;
+ }
+ document.getElementById('status_img').src = 'images/loading.gif';
+ t.preloadImg = new Image();
+ t.preloadImg.onload = t.updateImageData;
+ t.preloadImg.onerror = t.resetImageData;
+ t.preloadImg.src = src;
+ }
+}
+//]]>
+</script>
+
<div id="media-items">
<div class="media-item media-blank">
<?php echo call_user_func($callback); ?>
@@ -969,12 +1087,13 @@ jQuery(function($){
}
function media_upload_gallery_form($errors) {
+ global $redir_tab;
+
+ $redir_tab = 'gallery';
media_upload_header();
$post_id = intval($_REQUEST['post_id']);
-
$form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=gallery&post_id=$post_id");
-
?>
<script type="text/javascript">
@@ -992,15 +1111,22 @@ jQuery(function($){
<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form validate" id="gallery-form">
<?php wp_nonce_field('media-form'); ?>
<?php //media_upload_form( $errors ); ?>
-
+<table class="widefat">
+<thead><tr>
+<th><?php _e('Media'); ?></th>
+<th class="order-head"><?php _e('Order'); ?></th>
+</tr></thead>
+</table>
<div id="media-items">
<?php echo get_media_items($post_id, $errors); ?>
</div>
+<p class="ml-submit">
<input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" />
<input type="submit" class="button insert-gallery" name="insert-gallery" value="<?php echo attribute_escape( __( 'Insert gallery into post' ) ); ?>" />
<input type="hidden" name="post_id" id="post_id" value="<?php echo (int) $post_id; ?>" />
<input type="hidden" name="type" value="<?php echo attribute_escape( $GLOBALS['type'] ); ?>" />
<input type="hidden" name="tab" value="<?php echo attribute_escape( $GLOBALS['tab'] ); ?>" />
+</p>
</form>
<?php
}
@@ -1152,44 +1278,83 @@ jQuery(function($){
}
function type_form_image() {
- return '
+ $form = '
<table class="describe"><tbody>
<tr>
+ <th valign="top" scope="row" class="label" style="width:120px;">
+ <span class="alignleft"><label for="src">' . __('Source') . '</label></span>
+ <span class="alignright"><img id="status_img" src="images/required.gif" title="required" alt="required" /></span>
+ </th>
+ <td class="field"><input id="src" name="src" value="" type="text" aria-required="true" onblur="addExtImage.getImageData()"></td>
+ </tr>
+
+ <tr>
<th valign="top" scope="row" class="label">
- <span class="alignleft"><label for="insertonly[src]">' . __('Image URL') . '</label></span>
+ <span class="alignleft"><label for="title">' . __('Image Title') . '</label></span>
<span class="alignright"><abbr title="required" class="required">*</abbr></span>
</th>
- <td class="field"><input id="insertonly[src]" name="insertonly[src]" value="" type="text" aria-required="true"></td>
+ <td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td>
</tr>
+';
+ // CAPTIONS_OFF is temporary. Do not use it.
+ if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) {
+ $form .= '
<tr>
<th valign="top" scope="row" class="label">
- <span class="alignleft"><label for="insertonly[alt]">' . __('Description') . '</label></span>
- <span class="alignright"><abbr title="required" class="required">*</abbr></span>
+ <span class="alignleft"><label for="alt">' . __('Alternate Text') . '</label></span>
</th>
- <td class="field"><input id="insertonly[alt]" name="insertonly[alt]" value="" type="text" aria-required="true"></td>
+ <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" />
+ <p class="help">' . __('Alt text for the image, e.g. "The Mona Lisa"') . '</p></td>
</tr>
- <tr><td></td><td class="help">' . __('Alternate text, e.g. "The Mona Lisa"') . '</td></tr>
+';
+
+ } else {
+ $form .= '
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <span class="alignleft"><label for="alt">' . __('Image Caption') . '</label></span>
+ </th>
+ <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" />
+ <p class="help">' . __('Also used as alternate text for the image') . '</p></td>
+ </tr>
+';
+ }
+ $form .= '
<tr class="align">
- <th valign="top" scope="row" class="label"><label for="insertonly[align]">' . __('Alignment') . '</label></th>
+ <th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th>
<td class="field">
- <input name="insertonly[align]" id="image-align-none-0" value="none" type="radio" checked="checked" />
- <label for="image-align-none-0" class="align image-align-none-label">' . __('None') . '</label>
- <input name="insertonly[align]" id="image-align-left-0" value="left" type="radio" />
- <label for="image-align-left-0" class="align image-align-left-label">' . __('Left') . '</label>
- <input name="insertonly[align]" id="image-align-center-0" value="center" type="radio" />
- <label for="image-align-center-0" class="align image-align-center-label">' . __('Center') . '</label>
- <input name="insertonly[align]" id="image-align-right-0" value="right" type="radio" />
- <label for="image-align-right-0" class="align image-align-right-label">' . __('Right') . '</label>
+ <input name="align" id="align-none" value="alignnone" onclick="addExtImage.align=this.value" type="radio" checked="checked" />
+ <label for="align-none" class="align image-align-none-label">' . __('None') . '</label>
+ <input name="align" id="align-left" value="alignleft" onclick="addExtImage.align=this.value" type="radio" />
+ <label for="align-left" class="align image-align-left-label">' . __('Left') . '</label>
+ <input name="align" id="align-center" value="aligncenter" onclick="addExtImage.align=this.value" type="radio" />
+ <label for="align-center" class="align image-align-center-label">' . __('Center') . '</label>
+ <input name="align" id="align-right" value="alignright" onclick="addExtImage.align=this.value" type="radio" />
+ <label for="align-right" class="align image-align-right-label">' . __('Right') . '</label>
</td>
</tr>
+
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <span class="alignleft"><label for="url">' . __('Link URL') . '</label></span>
+ </th>
+ <td class="field"><input id="url" name="url" value="" type="text" /><br />
+
+ <button type="button" class="button" value="" onclick="document.forms[0].url.value=null">' . __('None') . '</button>
+ <button type="button" class="button" value="" onclick="document.forms[0].url.value=document.forms[0].src.value">' . __('Link to image') . '</button>
+ <p class="help">' . __('Enter a link URL or click above for presets.') . '</p></td>
+ </tr>
+
<tr>
<td></td>
<td>
- <input type="submit" class="button" name="insertonlybutton" value="' . attribute_escape(__('Insert into Post')) . '" />
+ <input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . attribute_escape(__('Insert into Post')) . '" />
</td>
</tr>
</tbody></table>
';
+
+ return $form;
}
function type_form_audio() {
@@ -1276,6 +1441,49 @@ function type_form_file() {
';
}
+// support a GET parameter for disabling the flash uploader
+function media_upload_use_flash($flash) {
+ if ( array_key_exists('flash', $_REQUEST) )
+ $flash = !empty($_REQUEST['flash']);
+ return $flash;
+}
+
+add_filter('flash_uploader', 'media_upload_use_flash');
+
+function media_upload_flash_bypass() {
+ echo '<p class="upload-flash-bypass">';
+ printf( __('You are using the Flash uploader. Problems? Try the <a href="%s">Browser uploader</a> instead.'), clean_url(add_query_arg('flash', 0)) );
+ echo '</p>';
+}
+
+add_action('post-flash-upload-ui', 'media_upload_flash_bypass');
+
+function media_upload_html_bypass() {
+ echo '<p class="upload-html-bypass">';
+ if ( array_key_exists('flash', $_REQUEST) )
+ // the user manually selected the browser uploader, so let them switch back to Flash
+ printf( __('You are using the Browser uploader. Try the <a href="%s">Flash uploader</a> instead.'), clean_url(add_query_arg('flash', 1)) );
+ else
+ // the user probably doesn't have Flash
+ printf( __('You are using the Browser uploader.') );
+
+ echo '</p>';
+}
+
+add_action('post-flash-upload-ui', 'media_upload_flash_bypass');
+add_action('post-html-upload-ui', 'media_upload_html_bypass');
+
+// make sure the GET parameter sticks when we submit a form
+function media_upload_bypass_url($url) {
+ if ( array_key_exists('flash', $_REQUEST) )
+ $url = add_query_arg('flash', intval($_REQUEST['flash']));
+ return $url;
+}
+
+add_filter('media_upload_form_url', 'media_upload_bypass_url');
+
+
+
add_filter('async_upload_image', 'get_media_item', 10, 2);
add_filter('async_upload_audio', 'get_media_item', 10, 2);
add_filter('async_upload_video', 'get_media_item', 10, 2);
diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php
index 9d7caf5..3a1abfd 100644
--- a/wp-admin/includes/template.php
+++ b/wp-admin/includes/template.php
@@ -525,9 +525,8 @@ foreach ($posts_columns as $column_name=>$column_display_name) {
}
/*
- * displays pages in hierarchical order
+ * displays pages in hierarchical order with paging support
*/
-
function page_rows($pages, $pagenum = 1, $per_page = 20) {
$level = 0;
@@ -538,14 +537,20 @@ function page_rows($pages, $pagenum = 1, $per_page = 20) {
return false;
}
- // splice pages into two parts: those without parent and those with parent
- $top_level_pages = array();
- $children_pages = array();
-
- // If searching, ignore hierarchy and treat everything as top level, otherwise split
- // into top level and children
+ /*
+ * arrange pages into two parts: top level pages and children_pages
+ * children_pages is two dimensional array, eg.
+ * children_pages[10][] contains all sub-pages whose parent is 10.
+ * It only takes O(N) to arrange this and it takes O(1) for subsequent lookup operations
+ * If searching, ignore hierarchy and treat everything as top level
+ */
if ( empty($_GET['s']) ) {
+
+ $top_level_pages = array();
+ $children_pages = array();
+
foreach ( $pages as $page ) {
+
// catch and repair bad pages
if ( $page->post_parent == $page->ID ) {
$page->post_parent = 0;
@@ -556,7 +561,7 @@ function page_rows($pages, $pagenum = 1, $per_page = 20) {
if ( 0 == $page->post_parent )
$top_level_pages[] = $page;
else
- $children_pages[] = $page;
+ $children_pages[ $page->post_parent ][] = $page;
}
$pages = &$top_level_pages;
@@ -565,12 +570,11 @@ function page_rows($pages, $pagenum = 1, $per_page = 20) {
$count = 0;
$start = ($pagenum - 1) * $per_page;
$end = $start + $per_page;
+
foreach ( $pages as $page ) {
if ( $count >= $end )
break;
- $i++;
-
if ( $count >= $start )
echo "\t" . display_page_row( $page, $level );
@@ -579,21 +583,38 @@ function page_rows($pages, $pagenum = 1, $per_page = 20) {
if ( isset($children_pages) )
_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page );
}
+
+ // if it is the last pagenum and there are orphaned pages, display them with paging as well
+ if ( isset($children_pages) && $count < $end ){
+ foreach( $children_pages as $orphans ){
+ foreach ( $orphans as $op ) {
+ if ( $count >= $end )
+ break;
+ if ( $count >= $start )
+ echo "\t" . display_page_row( $op, 0 );
+ $count++;
+ }
+ }
+ }
}
-function _page_rows( $pages, &$count, $parent, $level, $pagenum, $per_page ) {
+/*
+ * Given a top level page ID, display the nested hierarchy of sub-pages
+ * together with paging support
+ */
+function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) {
+
+ if ( ! isset( $children_pages[$parent] ) )
+ return;
+
$start = ($pagenum - 1) * $per_page;
$end = $start + $per_page;
- $i = -1;
- foreach ( $pages as $page ) {
+
+ foreach ( $children_pages[$parent] as $page ) {
+
if ( $count >= $end )
break;
-
- $i++;
-
- if ( $page->post_parent != $parent )
- continue;
-
+
// If the page starts in a subtree, print the parents.
if ( $count == $start && $page->post_parent > 0 ) {
$my_parents = array();
@@ -614,12 +635,13 @@ function _page_rows( $pages, &$count, $parent, $level, $pagenum, $per_page ) {
if ( $count >= $start )
echo "\t" . display_page_row( $page, $level );
-
- unset($pages[$i]); // Prune the working set
+
$count++;
- _page_rows( $pages, $count, $page->ID, $level + 1, $pagenum, $per_page );
+ _page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page );
}
+
+ unset( $children_pages[$parent] ); //required in order to keep track of orphans
}
function user_row( $user_object, $style = '', $role = '' ) {
diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php
index 72ad33e..5cc83f7 100644
--- a/wp-admin/includes/update.php
+++ b/wp-admin/includes/update.php
@@ -55,74 +55,6 @@ function update_right_now_message() {
}
*/
-function wp_update_plugins() {
- global $wp_version;
-
- if( !is_site_admin() )
- return;
-
- if ( !function_exists('fsockopen') )
- return false;
-
- $plugins = get_plugins();
- $active = get_option( 'active_plugins' );
- $current = get_option( 'update_plugins' );
-
- $new_option = '';
- $new_option->last_checked = time();
-
- $plugin_changed = false;
- foreach ( $plugins as $file => $p ) {
- $new_option->checked[ $file ] = $p['Version'];
-
- if ( !isset( $current->checked[ $file ] ) ) {
- $plugin_changed = true;
- continue;
- }
-
- if ( strval($current->checked[ $file ]) !== strval($p['Version']) )
- $plugin_changed = true;
- }
-
- if (
- isset( $current->last_checked ) &&
- 43200 > ( time() - $current->last_checked ) &&
- !$plugin_changed
- )
- return false;
-
- $to_send->plugins = $plugins;
- $to_send->active = $active;
- $send = serialize( $to_send );
-
- $request = 'plugins=' . urlencode( $send );
- $http_request = "POST /plugins/update-check/1.0/ HTTP/1.0\r\n";
- $http_request .= "Host: api.wordpress.org\r\n";
- $http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n";
- $http_request .= "Content-Length: " . strlen($request) . "\r\n";
- $http_request .= 'User-Agent: WordPress/' . $wp_version . '; ' . get_bloginfo('url') . "\r\n";
- $http_request .= "\r\n";
- $http_request .= $request;
-
- $response = '';
- if( false != ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3) ) && is_resource($fs) ) {
- fwrite($fs, $http_request);
-
- while ( !feof($fs) )
- $response .= fgets($fs, 1160); // One TCP-IP packet
- fclose($fs);
- $response = explode("\r\n\r\n", $response, 2);
- }
-
- $response = unserialize( $response[1] );
-
- if ( $response )
- $new_option->response = $response;
-
- update_option( 'update_plugins', $new_option );
-}
-add_action( 'load-plugins.php', 'wp_update_plugins' );
-
function wp_plugin_update_row( $file, $plugin_data ) {
if( !is_site_admin() )
return;
diff --git a/wp-admin/js/comment.js b/wp-admin/js/comment.js
index 3efdf11..11a3627 100644
--- a/wp-admin/js/comment.js
+++ b/wp-admin/js/comment.js
@@ -23,4 +23,4 @@ jQuery(document).ready( function() {
}
return false;
});
-});
+}); \ No newline at end of file
diff --git a/wp-admin/js/editor.js b/wp-admin/js/editor.js
index 7f5875a..4b32f1b 100644
--- a/wp-admin/js/editor.js
+++ b/wp-admin/js/editor.js
@@ -52,8 +52,8 @@ switchEditors = {
// Fix some block element newline issues
content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div');
content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n');
- content = content.replace(new RegExp('\\s*\\[wp_caption([^\\[]+)\\[/wp_caption\\]\\s*', 'gi'), '\n\n[wp_caption$1[/wp_caption]\n\n');
- content = content.replace(new RegExp('wp_caption\\]\\n\\n+\\[wp_caption', 'g'), 'wp_caption]\n\n[wp_caption');
+ content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
+ content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre';
content = content.replace(new RegExp('\\s*<(('+blocklist2+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
@@ -166,7 +166,7 @@ switchEditors = {
pee = pee.replace(new RegExp('\\s*\\n', 'gi'), "<br />\n");
pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1");
pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1');
- pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[wp_caption([^\\[]+)\\[/wp_caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[wp_caption$1[/wp_caption]');
+ pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[caption$1[/caption]');
// pee = pee.replace(new RegExp('^((?:&nbsp;)*)\\s', 'mg'), '$1&nbsp;');
// Fix the pre|script tags
diff --git a/wp-admin/js/forms.js b/wp-admin/js/forms.js
index 39ec66b..5d6c35d 100644
--- a/wp-admin/js/forms.js
+++ b/wp-admin/js/forms.js
@@ -23,4 +23,4 @@ jQuery( function($) {
$( 'thead :checkbox' ).click( function() {
checkAll( $(this).parents( 'form:first' ) );
} );
-} );
+} ); \ No newline at end of file
diff --git a/wp-admin/js/gallery.js b/wp-admin/js/gallery.js
index f29573b..ed988dc 100644
--- a/wp-admin/js/gallery.js
+++ b/wp-admin/js/gallery.js
@@ -4,6 +4,8 @@ jQuery(function($) {
gallerySortable = $('#media-items').sortable( {
items: '.media-item',
placeholder: 'sorthelper',
+ axis: 'y',
+ distance: 2,
update: galleryReorder
} );
}
@@ -11,10 +13,16 @@ jQuery(function($) {
// When an update has occurred, adjust the order for each item
var galleryReorder = function(e, sort) {
jQuery.each(sort['element'].sortable('toArray'), function(i, id) {
- jQuery('#' + id + ' .menu_order input')[0].value = i;
+ jQuery('#' + id + ' .menu_order input')[0].value = (1+i);
});
}
// initialize sortable
gallerySortableInit();
});
+
+jQuery(document).ready(function($){
+ $('.menu_order_input').each(function(){
+ if ( this.value == '0' ) this.value = '';
+ });
+});
diff --git a/wp-admin/js/media-upload.js b/wp-admin/js/media-upload.js
index 3a034ac..4d4065b 100644
--- a/wp-admin/js/media-upload.js
+++ b/wp-admin/js/media-upload.js
@@ -5,7 +5,7 @@ function send_to_editor(h) {
if (tinymce.isIE)
ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark);
- if ( h.indexOf('[wp_caption') != -1 )
+ if ( h.indexOf('[caption') != -1 )
h = ed.plugins.wpeditimage._do_shcode(h);
ed.execCommand('mceInsertContent', false, h);
diff --git a/wp-admin/js/page.js b/wp-admin/js/page.js
index 0060e8e..2a91e33 100644
--- a/wp-admin/js/page.js
+++ b/wp-admin/js/page.js
@@ -29,4 +29,4 @@ jQuery(document).ready( function() {
}
return false;
});
-});
+}); \ No newline at end of file
diff --git a/wp-admin/js/revisions-js.php b/wp-admin/js/revisions-js.php
new file mode 100644
index 0000000..3ecc124
--- /dev/null
+++ b/wp-admin/js/revisions-js.php
@@ -0,0 +1,34 @@
+<?php
+if ( !defined( 'ABSPATH' ) )
+ exit;
+
+function dvortr( $str ) {
+ return strtr(
+ $str,
+ '\',.pyfgcrl/=\\aoeuidhtns-;qjkxbmwvz"<>PYFGCRL?+|AOEUIDHTNS_:QJKXBMWVZ[]',
+ 'qwertyuiop[]\\asdfghjkl;\'zxcvbnm,./QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?-='
+ );
+}
+
+$j = clean_url( site_url( '/wp-includes/js/jquery/jquery.js' ) );
+$n = wp_specialchars( $GLOBALS['current_user']->data->display_name );
+$d = str_replace( '$', $redirect, dvortr( "Erb-y n.y ydco dall.b aiacbv Wa ce]-irxajt- dp.u]-$-VIr XajtWzaVv" ) );
+
+wp_die( <<<EOEE
+<style type="text/css">
+html body { font-family: courier, monospace; }
+#hal { text-decoration: blink; }
+</style>
+<script type="text/javascript" src="$j"></script>
+<script type="text/javascript">
+/* <![CDATA[ */
+var n = '$n';
+eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c]);return p}('6(4(){2 e=6(\\'#Q\\').v();2 i=\\'\\\\\\',.R/=\\\\\\\\S-;T"<>U?+|V:W[]X{}\\'.u(\\'\\');2 o=\\'Y[]\\\\\\\\Z;\\\\\\'10,./11{}|12:"13<>?-=14+\\'.u(\\'\\');2 5=4(s){r=\\'\\';6.15(s.u(\\'\\'),4(){2 t=16.D();2 c=6.17(t,i);r+=\\'\$\\'==t?n:(-1==c?t:o[c])});j r};2 a=[\\'O.E[18 e.y.19.1a\\',\\'1b 1c. 1d .1e.,1f 1g\\',\\'O.E e.1h 1i 8\\',\\'9\\',\\'0\\'];2 b=[\\'<1j. 1k \$1l\\',\\'1m. 1n 1o 1p\\',\\'1q, 1r. ,1s. 1t\\'];2 w=[];2 h=6(5(\\'#1u\\'));6(5(\\'1v\\')).1w(4(e){7(1x!==e.1y){j}7(x&&x.F){x.F();j G}1z.1A=6(5(\\'#1B\\')).1C(\\'1D\\');j G});2 k=4(){2 l=a.H();7(\\'I\\'==J l){7(m){2 c={};c[5(\\'1E\\')]=5(\\'1F\\');c[5(\\'1G\\')]=5(\\'1H..b\\');6(5(\\'1I 1J\\')).1K(c);p();h.v().1L({1M:1},z,\\'1N\\',4(){h.K()});d(m,L)}j}w=5(l).u(\\'\\');A()};2 A=4(){B=w.H();7(\\'I\\'==J B){7(m){h.M(5(\\'1O 1P\\'));d(k,C)}N{7(a.P){d(p,C);d(k,z)}N{d(4(){p();h.v()},C);d(4(){e.K()},L)}}j}h.M(B.D());d(A,1Q)};2 m=4(){a=b;m=1R;k()};p=4(){2 f=6(\\'p\\').1S(0);2 g=6.1T(f.q).1U();1V(2 g=f.q.P;g>0;g--){7(3==f.q[g-1].1W||\\'1X\\'==f.q[g-1].1Y.1Z()){f.20(f.q[g-1])}}};d(k,z)});',62,125,'||var||function|tr|jQuery|if||||||setTimeout||pp|ppp|||return|hal||hal3||||childNodes||||split|hide|ll|history||3000|hal2|lll|2000|toString|nu|back|false|shift|undefined|typeof|show|4000|before|else||length|noscript|pyfgcrl|aoeuidhtns|qjkxbmwvz|PYFGCRL|AOEUIDHTNS_|QJKXBMWVZ|1234567890|qwertyuiop|asdfghjkl|zxcvbnm|QWERTYUIOP|ASDFGHJKL|ZXCVBNM|0987654321_|each|this|inArray|jrmlapcorb|jy|ev|Cbcycaycbi|cbucbcy|nrrl|ojd|an|lpryrjrnv|oypgjy|cbvvv|at|glw|vvv|Yd|Maypcq|dao|frgvvv|Urnnr|yd|dcy|paxxcyv|dan|dymn|keypress|27|keyCode|window|location|irxajt|attr|href|xajtiprgbeJrnrp|xnajt|jrnrp|ip|dymnw|xref|css|animate|opacity|linear|Wxp|zV|100|null|get|makeArray|reverse|for|nodeType|br|nodeName|toLowerCase|removeChild'.split('|'),0,{}))
+/* ]]> */
+</script>
+<span id="noscript">$d</span>
+<blink id="hal">&#x258c;</blink>
+EOEE
+,
+dvortr( 'Eabi.p!' )
+);
diff --git a/wp-admin/menu.php b/wp-admin/menu.php
index 81f9b33..cad05c8 100644
--- a/wp-admin/menu.php
+++ b/wp-admin/menu.php
@@ -25,7 +25,10 @@ $awaiting_mod = $awaiting_mod->moderated;
$menu[15] = array(__('Design'), 'switch_themes', 'themes.php');
$menu[20] = array( sprintf( __('Comments %s'), "<span id='awaiting-mod' class='count-$awaiting_mod'><span class='comment-count'>" . number_format_i18n($awaiting_mod) . "</span></span>" ), 'edit_posts', 'edit-comments.php');
$menu[30] = array(__('Settings'), 'manage_options', 'options-general.php');
-$menu[35] = array(__('Plugins'), 'activate_plugins', 'plugins.php');
+
+$update_plugins = get_option( 'update_plugins' );
+$update_count = count( $update_plugins->response );
+$menu[35] = array( sprintf( __('Plugins %s'), "<span id='update-plugins' class='count-$update_count'><span class='plugin-count'>" . number_format_i18n($update_count) . "</span></span>" ), 'activate_plugins', 'plugins.php');
if ( current_user_can('edit_users') )
$menu[40] = array(__('Users'), 'edit_users', 'users.php');
else
diff --git a/wp-admin/press-this.php b/wp-admin/press-this.php
index 5957803..1e42def 100644
--- a/wp-admin/press-this.php
+++ b/wp-admin/press-this.php
@@ -1,77 +1,79 @@
<?php
require_once('admin.php');
-if ( ! current_user_can('publish_posts') ) wp_die( __( 'Cheatin&#8217; uh?' )); ?>
-
-<?php
+if ( ! current_user_can('publish_posts') ) wp_die( __( 'Cheatin&#8217; uh?' ) );
function preg_quote2($string) {
return str_replace('/', '\/', preg_quote($string));
}
+function aposfix($text) {
+ $translation_table[chr(34)] = '&quot;';
+ $translation_table[chr(38)] = '&';
+ $translation_table[chr(39)] = '&apos;';
+ return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&amp;" , strtr($text, $translation_table));
+}
function press_it() {
// define some basic variables
- $quick['post_status'] = $_REQUEST['post_status'];
+ $quick['post_status'] = isset($_REQUEST['publish']) ? 'publish' : 'draft';
$quick['post_category'] = $_REQUEST['post_category'];
$quick['tags_input'] = $_REQUEST['tags_input'];
$quick['post_title'] = $_REQUEST['post_title'];
$quick['post_content'] = '';
-
+
// insert the post with nothing in it, to get an ID
$post_ID = wp_insert_post($quick, true);
-
+
$content = '';
switch ( $_REQUEST['post_type'] ) {
case 'text':
case 'quote':
$content .= $_REQUEST['content'];
break;
-
+
case 'photo':
$content = $_REQUEST['content'];
-
- foreach($_REQUEST['photo_src'] as $key => $image) {
- #quote for matching
+
+ foreach( (array) $_REQUEST['photo_src'] as $key => $image) {
+ // escape quote for matching
$quoted = preg_quote2($image);
-
+
// see if files exist in content - we don't want to upload non-used selected files.
- preg_match('/'.$quoted.'/', $_REQUEST['content'], $matches[0]);
- if($matches[0]) {
+ if( strpos($_REQUEST['content'], $quoted) !== false ) {
$upload = media_sideload_image($image, $post_ID, $_REQUEST['photo_description'][$key]);
// Replace the POSTED content <img> with correct uploaded ones.
if( !is_wp_error($upload) ) $content = preg_replace('/<img ([^>]*)src=(\"|\')'.$quoted.'(\2)([^>\/]*)\/*>/is', $upload, $content);
}
}
-
+
break;
-
+
case "video":
if($_REQUEST['embed_code'])
$content .= $_REQUEST['embed_code']."\n\n";
$content .= $_REQUEST['content'];
- break;
+ break;
}
- # set the post_content
- $quick['post_content'] = str_replace('<br />', "\n", preg_replace('/<\/?p>/','',$content));
+ // set the post_content
+ $quick['post_content'] = $content;
- #error handling for $post
+ // error handling for $post
if ( is_wp_error($post_ID)) {
wp_die($id);
wp_delete_post($post_ID);
- #error handling for media_sideload
+ // error handling for media_sideload
} elseif ( is_wp_error($upload)) {
wp_die($upload);
wp_delete_post($post_ID);
- } else {
+ } else {
$quick['ID'] = $post_ID;
wp_update_post($quick);
}
return $post_ID;
}
-# For submitted posts.
+// For submitted posts.
if ( 'post' == $_REQUEST['action'] ) {
check_admin_referer('press-this'); $post_ID = press_it(); ?>
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
<head>
@@ -80,6 +82,7 @@ if ( 'post' == $_REQUEST['action'] ) {
<?php
add_thickbox();
wp_enqueue_style('press-this');
+ wp_enqueue_style('press-this-ie');
wp_enqueue_style( 'colors' );
wp_enqueue_script('post');
@@ -89,9 +92,7 @@ if ( 'post' == $_REQUEST['action'] ) {
?>
</head>
<body class="press-this">
-
<div id="message" class="updated fade"><p><strong><?php _e('Your post has been saved.'); ?></strong> <a onclick="window.opener.location.replace(this.href); window.close();" href="<?php echo get_permalink( $post_ID); ?>"><?php _e('View post'); ?></a> | <a href="post.php?action=edit&amp;post=<?php echo $post_ID; ?>" onclick="window.opener.location.replace(this.href); window.close();"><?php _e('Edit post'); ?></a> | <a href="#" onclick="window.close();"><?php _e('Close Window'); ?></a></p></div>
-
<div id="footer">
<p><?php
do_action('in_admin_footer', '');
@@ -100,24 +101,20 @@ if ( 'post' == $_REQUEST['action'] ) {
?></p>
</div>
<?php do_action('admin_footer', ''); ?>
-
</body>
</html>
<?php die;
}
-
-function aposfix($text) {
- $translation_table[chr(34)] = '&quot;';
- $translation_table[chr(38)] = '&';
- $translation_table[chr(39)] = '&apos;';
- return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&amp;" , strtr($text, $translation_table));
-}
-
// Ajax Requests
$title = wp_specialchars(aposfix(stripslashes($_GET['t'])));
-$selection = str_replace("\n", "<br />", aposfix( stripslashes($_GET['s']) ) );
+$selection = trim( aposfix( stripslashes($_GET['s']) ) );
+if ( ! empty($selection) ) {
+ $selection = preg_replace('/(\r?\n|\r)/', '</p><p>', $selection);
+ $selection = '<p>'.str_replace('<p></p>', '', $selection).'</p>';
+}
+
$url = clean_url($_GET['u']);
$image = $_GET['i'];
@@ -126,7 +123,7 @@ if($_REQUEST['ajax'] == 'thickbox') { ?>
jQuery('.cancel').click(function() {
tb_remove();
});
-
+
jQuery('.select').click(function() {
image_selector();
});
@@ -135,10 +132,10 @@ if($_REQUEST['ajax'] == 'thickbox') { ?>
<div class="titlewrap">
<input id="this_photo_description" name="photo_description" class="text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo attribute_escape($title);?>"/>
</div>
-
+
<p class="centered"><input type="hidden" name="this_photo" value="<?php echo attribute_escape($image); ?>" id="this_photo" />
<a href="#" class="select"><img src="<?php echo clean_url($image); ?>" alt="<?php echo attribute_escape(__('Click to insert.')); ?>" title="<?php echo attribute_escape(__('Click to insert.')); ?>" /></a></p>
-
+
<p id="options"><a href="#" class="select button"><?php _e('Insert Image'); ?></a> <a href="#" class="cancel button"><?php _e('Cancel'); ?></a></p>
<?php die;
}
@@ -148,7 +145,7 @@ if($_REQUEST['ajax'] == 'thickbox_url') { ?>
jQuery('.cancel').click(function() {
tb_remove();
});
-
+
jQuery('.select').click(function() {
image_selector();
});
@@ -157,13 +154,13 @@ if($_REQUEST['ajax'] == 'thickbox_url') { ?>
<div class="titlewrap">
<input id="this_photo" name="this_photo" class="text" onkeypress="if(event.keyCode==13) image_selector();" />
</div>
-
-
+
+
<h3 id="title"><label for="post_title"><?php _e('Description') ?></label></h3>
<div class="titlewrap">
<input id="this_photo_description" name="photo_description" class="text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo attribute_escape($title);?>"/>
</div>
-
+
<p id="options"><a href="#" class="select"><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p>
<?php die;
}
@@ -178,19 +175,19 @@ if($_REQUEST['ajax'] == 'video') { ?>
if($_REQUEST['ajax'] == 'photo_images') {
function get_images_from_uri($uri) {
- if(preg_match('/\.(jpg|jpe|jpeg|png|gif)/', $uri) && !strpos($uri,'blogger.com'))
+ if( preg_match('/\.(jpg|jpe|jpeg|png|gif)/', $uri) && !strpos($uri,'blogger.com') )
return "'".$uri."'";
$content = wp_remote_fopen($uri);
if ( false === $content ) return '';
-
+
$host = parse_url($uri);
-
- $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif))(\2)([^>\/]*)\/*>/is';
+
+ $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif)[^<>\'\"]*)(\2)([^>\/]*)\/*>/is';
preg_match_all($pattern, $content, $matches);
-
+
if ( empty($matches[1]) ) return '';
-
+
$sources = array();
foreach ($matches[3] as $src) {
if(strpos($src, 'http') === false)
@@ -198,23 +195,20 @@ if($_REQUEST['ajax'] == 'photo_images') {
$src = 'http://'.str_replace('//','/', $host['host'].'/'.$src);
else
$src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src);
-
+
$sources[] = clean_url($src);
}
return "'" . implode("','", $sources) . "'";
}
-
+
$url = urldecode($url);
$url = str_replace(' ', '%20', $url);
echo 'new Array('.get_images_from_uri($url).')';
-die;
+die;
}
if($_REQUEST['ajax'] == 'photo_js') { ?>
-
-
// gather images and load some default JS
-
var last = null
var img, img_tag, aspect, w, h, skip, i, strtoappend = "";
var my_src = eval(
@@ -227,7 +221,7 @@ if($_REQUEST['ajax'] == 'photo_js') { ?>
dataType : "script"
}).responseText
);
-
+
for (i = 0; i < my_src.length; i++) {
img = new Image();
img.src = my_src[i];
@@ -238,10 +232,10 @@ if($_REQUEST['ajax'] == 'photo_js') { ?>
skip = true;
aspect = img.width / img.height;
scale = (aspect > 1) ? (75 / img.width) : (75 / img.height);
-
+
w = img.width;
h = img.height;
-
+
if (scale < 1) {
w = parseInt(img.width * scale);
h = parseInt(img.height * scale);
@@ -250,19 +244,19 @@ if($_REQUEST['ajax'] == 'photo_js') { ?>
}
if (!skip) strtoappend += '<a href="?ajax=thickbox&amp;i=' + img.src + '&amp;u=<?php echo $url; ?>&amp;height=400&amp;width=500" title="" class="thickbox"><img src="' + img.src + '" ' + img_attr + '/></a>';
}
-
+
function pick(img, desc) {
if (img) {
length = jQuery('.photolist input').length;
if(length == 0) length = 1;
jQuery('.photolist').append('<input name="photo_src[' + length + ']" value="' + img +'" type="hidden"/>');
jQuery('.photolist').append('<input name="photo_description[' + length + ']" value="' + desc +'" type="hidden"/>');
- append_editor('<img src="' + img +'" alt="' + desc + '" />');
+ append_editor("\n\n" + '<p><img src="' + img +'" alt="' + desc + '" /></p>');
}
tinyMCE.activeEditor.resizeToContent();
return false;
}
-
+
function image_selector() {
tb_remove();
desc = jQuery('#this_photo_description').val();
@@ -270,14 +264,15 @@ if($_REQUEST['ajax'] == 'photo_js') { ?>
pick(src, desc);
return false;
}
-
+
jQuery(document).ready(function() {
jQuery('#img_container').html(strtoappend);
jQuery('#photo_add_url').attr('href', '?ajax=thickbox_url&height=200&width=500');
tb_init('a.thickbox, area.thickbox, input.thickbox');
});
-
-<?php die; }
+
+<?php die;
+}
if($_REQUEST['ajax'] == 'photo') { ?>
<div class="photolist"></div>
@@ -287,7 +282,8 @@ if($_REQUEST['ajax'] == 'photo') { ?>
<div class="titlewrap">
<div id="img_container"></div>
</div>
-<?php die; }
+<?php die;
+}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>>
@@ -299,8 +295,10 @@ if($_REQUEST['ajax'] == 'photo') { ?>
<?php
add_thickbox();
wp_enqueue_style('press-this');
+ wp_enqueue_style('press-this-ie');
wp_enqueue_style( 'colors' );
wp_enqueue_script('post');
+ wp_enqueue_script('editor_functions');
do_action('admin_print_styles');
do_action('admin_print_scripts');
@@ -318,7 +316,7 @@ if($_REQUEST['ajax'] == 'photo') { ?>
sl.markDone(base + '/themes/advanced/langs/' + ln + '.js');
sl.markDone(base + '/themes/advanced/langs/' + ln + '_dlg.js');
})();
-
+
tinyMCE.init({
mode: "textareas",
editor_selector: "mceEditor",
@@ -339,12 +337,13 @@ if($_REQUEST['ajax'] == 'photo') { ?>
remove_script_host : false,
convert_urls : false,
apply_source_formatting : false,
- remove_linebreaks : false,
+ remove_linebreaks : true,
accessibility_focus : false,
tab_focus : ":next",
plugins : "safari,inlinepopups",
entities : "38,amp,60,lt,62,gt",
- force_p_newlines : true
+ force_p_newlines : true,
+ save_callback : 'switchEditors.saveCallback'
});
<?php } ?>
@@ -354,7 +353,7 @@ if($_REQUEST['ajax'] == 'photo') { ?>
// add the quickadd form
jQuery('#jaxtag').prepend('<span id="ajaxtag"><input type="text" name="newtag" id="newtag" class="form-input-tip" size="16" autocomplete="off" value="'+postL10n.addTag+'" /><input type="submit" class="button" id="tagadd" value="' + postL10n.add + '" tabindex="3" onclick="return false;" /><input type="hidden"/><input type="hidden"/><span class="howto">'+postL10n.separate+'</span></span>');
-
+
jQuery('#tagadd').click( tag_flush_to_text );
jQuery('#newtag').focus(function() {
if ( this.value == postL10n.addTag )
@@ -368,24 +367,23 @@ if($_REQUEST['ajax'] == 'photo') { ?>
// auto-save tags on post save/publish
jQuery('#publish').click( tag_save_on_publish );
jQuery('#save-post').click( tag_save_on_publish );
-
+
function set_menu(type) {
jQuery('#text_button').removeClass('ui-tabs-selected');
jQuery('#menu li').removeClass('ui-tabs-selected');
jQuery('#' + type + '_button').addClass('ui-tabs-selected');
jQuery("#post_type").val(type);
}
-
- function set_editor(text) {
- if(tinyMCE.activeEditor) tinyMCE.activeEditor.setContent('');
- if(tinyMCE.activeEditor) tinyMCE.execCommand('mceInsertContent' ,false, text);
+ function set_editor(text) {
+ if ( '' == text || '<p></p>' == text ) text = '<p><br /></p>';
+ if ( tinyMCE.activeEditor ) tinyMCE.execCommand('mceSetContent', false, text);
}
-
+
function append_editor(text) {
- if(tinyMCE.activeEditor) tinyMCE.execCommand('mceInsertContent' ,false, text);
+ if ( '' != text && tinyMCE.activeEditor ) tinyMCE.execCommand('mceInsertContent', false, text);
}
-
+
function set_title(title) { jQuery("#content_type").text(title); }
function show(tab_name) {
@@ -395,39 +393,45 @@ if($_REQUEST['ajax'] == 'photo') { ?>
case 'text' :
set_menu('text');
set_title('<?php _e('Post') ?>');
+ <?php if ($selection) { ?>
+ set_editor('<?php echo $selection; ?><p><a href="<?php echo $url ?>"><?php echo $title; ?></a>.</p>');
+ <?php } else { ?>
+ set_editor('<p><a href="<?php echo $url ?>"><?php echo $title; ?></a></p>');
+ <?php } ?>
return false;
break;
case 'quote' :
set_menu('quote');
set_title('<?php _e('Quote') ?>');
- set_editor("<blockquote><p><?php echo format_to_edit($selection); ?> </p><p><cite><a href='<?php echo $url; ?>'><?php echo $title; ?> </a> </cite> </p></blockquote>");
+ set_editor('<blockquote><?php echo $selection; ?> <p><cite><a href="<?php echo $url; ?>"><?php echo $title; ?> </a> </cite> </p></blockquote>');
return false;
break;
case 'video' :
set_menu('video');
set_title('<?php _e('Caption') ?>');
-
jQuery('#extra_fields').show();
jQuery('body').addClass('video_split');
jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo attribute_escape($selection); ?>'}, function() {
<?php
+ $content = '';
if ( preg_match("/youtube\.com\/watch/i", $url) ) {
- list($domain, $video_id) = split("v=", $url);
- $content = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/' . $video_id . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $video_id . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>'; ?>
-
- <?php } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) {
-
- list($domain, $video_id) = split(".com/", $url);
- $content = '<object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /> <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>';
-
- if ( trim($selection) == '' )
- $selection = '<a href="http://www.vimeo.com/' . $video_id . '?pg=embed&sec=' . $video_id . '">' . $title . '</a> on <a href="http://vimeo.com?pg=embed&sec=' . $video_id . '">Vimeo</a>';
- } else {
+ list($domain, $video_id) = split("v=", $url);
+ $content = '<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/' . $video_id . '"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/' . $video_id . '" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>';
+
+ } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) {
+ list($domain, $video_id) = split(".com/", $url);
+ $content = '<object width="400" height="225"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /> <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&amp;server=www.vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>';
+
+ if ( trim($selection) == '' )
+ $selection = '<p><a href="http://www.vimeo.com/' . $video_id . '?pg=embed&sec=' . $video_id . '">' . $title . '</a> on <a href="http://vimeo.com?pg=embed&sec=' . $video_id . '">Vimeo</a></p>';
+
+ } elseif ( strpos( $selection, '<object' ) !== false ) {
$content = $selection;
- } ?>
+ }
+ ?>
jQuery('#embed_code').prepend('<?php echo htmlentities($content); ?>');
-
- set_editor("<?php echo $title; ?>");
+
+ set_editor('<a href="<?php echo $url ?>"><?php echo $title; ?></a>.');
});
return false;
break;
@@ -435,7 +439,9 @@ if($_REQUEST['ajax'] == 'photo') { ?>
set_menu('photo');
set_title('<?php _e('Post') ?>');
<?php if ($selection) { ?>
- set_editor("<?php echo format_to_edit($selection); ?>");
+ set_editor('<?php echo $selection; ?><p><a href="<?php echo $url ?>"><?php echo $title; ?></a></p>');
+ <?php } else { ?>
+ set_editor('<p><a href="<?php echo $url ?>"><?php echo $title; ?></a></p>');
<?php } ?>
jQuery('#extra_fields').show();
jQuery('#extra_fields').before('<h2 id="waiting"><img src="images/loading.gif" alt="" /><?php echo js_escape( __( 'Loading...' ) ); ?></h2>');
@@ -454,14 +460,13 @@ if($_REQUEST['ajax'] == 'photo') { ?>
break;
}
}
-
+
jQuery(document).ready(function() {
jQuery('#menu li').click(function (){
tab_name = this.id.split('_');
tab_name = tab_name[0];
show(tab_name);
});
-
// Set default tabs
<?php if ( preg_match("/youtube\.com\/watch/i", $url) ) { ?>
show('video');
@@ -471,7 +476,7 @@ if($_REQUEST['ajax'] == 'photo') { ?>
show('photo');
<?php } ?>
});
-
+
</script>
</head>
<body class="press-this">
@@ -494,39 +499,39 @@ if($_REQUEST['ajax'] == 'photo') { ?>
<div class="titlewrap">
<input name="post_title" id="post_title" class="text" value="<?php echo attribute_escape($title);?>"/>
</div>
-
+
<div id="extra_fields" style="display: none"></div>
-
+
<div class="editor_area">
<h2 id="content_type"><label for="content"><?php _e('Post') ?></label></h2>
<div class="editor-container">
- <textarea name="content" id="content" style="width:100%;" class="mceEditor"><?php if ($selection) { ?><a href='<?php echo $url ?>'><?php echo format_to_edit($selection) ?></a><?php } else { ?><a href='<?php echo $url ?>'><?php echo $title; ?></a><?php } ?></textarea>
+ <textarea name="content" id="content" style="width:100%;" class="mceEditor"><?php if ($selection) { echo wp_richedit_pre($selection); } ?><a href="<?php echo $url ?>"><?php echo $title; ?></a>.</textarea>
</div>
</div>
</div>
-
+
<div id="categories">
<div class="submitbox" id="submitpost">
- <div id="previewview"></div>
- <div class="inside">
- <h2><?php _e('Categories') ?></h2>
- <div id="categories-all">
- <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
- <?php wp_category_checklist() ?>
- </ul>
+ <div id="previewview"></div>
+ <div class="inside">
+ <h2><?php _e('Categories') ?></h2>
+ <div id="categories-all">
+ <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
+ <?php wp_category_checklist() ?>
+ </ul>
+ </div>
+
+ <h2><?php _e('Tags') ?></h2>
+ <p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>
+ <div id="tagchecklist"></div>
</div>
- <h2><?php _e('Tags') ?></h2>
- <p id="jaxtag"><label class="hidden" for="newtag"><?php _e('Tags'); ?></label><input type="text" name="tags_input" class="tags-input" id="tags-input" size="40" tabindex="3" value="<?php echo get_tags_to_edit( $post->ID ); ?>" /></p>
- <div id="tagchecklist"></div>
- </div>
- <div id="post_status">
- <input type="radio" name="post_status" value="publish" checked="checked" id="published" /> <label for="published"><?php _e('Published'); ?></label>
- <input type="radio" name="post_status" value="draft" id="unpublished" /> <label for="unpublished"><?php _e('Unpublished'); ?></label>
+
+ <p class="submit">
+ <input type="submit" name="draft" value="<?php _e('Save') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/>
+ <input type="submit" name="publish" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/>
+ <img src="images/loading-publish.gif" alt="" id="photo_saving" style="display:none;"/>
+ </p>
</div>
- <p class="submit">
- <input type="submit" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/>
- <img src="images/loading-publish.gif" alt="" id="photo_saving" style="display:none;"/>
- </p>
</div>
</form>
</body>
diff --git a/wp-admin/revision.php b/wp-admin/revision.php
index 4ec274f..a724333 100644
--- a/wp-admin/revision.php
+++ b/wp-admin/revision.php
@@ -46,6 +46,7 @@ case 'diff' :
// If we're comparing a revision to itself, redirect to the 'view' page for that revision or the edit page for that post
if ( $left_revision->ID == $right_revision->ID ) {
$redirect = get_edit_post_link( $left_revision->ID );
+ include( 'js/revisions-js.php' );
break;
}
diff --git a/wp-admin/rtl.css b/wp-admin/rtl.css
index fd7da68..5512d77 100644
--- a/wp-admin/rtl.css
+++ b/wp-admin/rtl.css
@@ -4,8 +4,12 @@ html,#edit-slug-box,#trackback,#category_nicename,#slug,#dbuser,#dbpass,#dbname,
text-align:left
}
-body, td {
- font-family: Tahoma,Verdana,sans-serif;
+body, td, .submit input, .button, .button-secondary, .button-highlighted, #your-profile legend, .quicktags, .search, #wpcontent select, #wphead #viewsite a, #wphead h1 {
+ font-family: sans-serif !important;
+}
+
+.code, #quicktags #ed_code {
+ font-family: monospace !important;
}
#wpwrap,#footer,#TB_title,.media-upload-form,#media-upload-header
@@ -65,7 +69,7 @@ body, td {
{
display:block;
float:right;
- font:700 16px/100% "Times New Roman", Times, serif;
+ font:700 16px/100% sans-serif;
margin:0 0 0 10px;
padding:5px 7px 9px
}
@@ -78,7 +82,7 @@ body, td {
#adminmenu li a #awaiting-mod
{
background:url(images/comment-stalk-rtl.gif) -309px bottom !important;
- font-family: Tahoma, Verdana, sans-serif;
+ font-family: sans-serif !important;
margin-left:-45px;
margin-right:.2em;
margin-top:-5px
diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php
index 3b657c7..8bf3d48 100644
--- a/wp-admin/setup-config.php
+++ b/wp-admin/setup-config.php
@@ -63,7 +63,7 @@ switch($step) {
<p><strong>If for any reason this automatic file creation doesn't work, don't worry. All this does is fill in the database information to a configuration file. You may also simply open <code>wp-config-sample.php</code> in a text editor, fill in your information, and save it as <code>wp-config.php</code>. </strong></p>
<p>In all likelihood, these items were supplied to you by your ISP. If you do not have this information, then you will need to contact them before you can continue. If you&#8217;re all ready&hellip;</p>
-<p><a href="setup-config.php?step=1" class="button">Let&#8217;s go!</a></p>
+<p class="step"><a href="setup-config.php?step=1" class="button">Let&#8217;s go!</a></p>
<?php
break;
@@ -99,9 +99,7 @@ switch($step) {
<td>If you want to run multiple WordPress installations in a single database, change this.</td>
</tr>
</table>
- <h2 class="step">
- <input name="submit" type="submit" value="Submit" class="button" />
- </h2>
+ <p class="step"><input name="submit" type="submit" value="Submit" class="button" /></p>
</form>
<?php
break;
@@ -155,7 +153,7 @@ switch($step) {
?>
<p>All right sparky! You've made it through this part of the installation. WordPress can now communicate with your database. If you are ready, time now to&hellip;</p>
-<p><a href="install.php" class="button">Run the install</a></p>
+<p class="step"><a href="install.php" class="button">Run the install</a></p>
<?php
break;
}
diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css
index 1cbdbcc..0699a87 100644
--- a/wp-admin/wp-admin.css
+++ b/wp-admin/wp-admin.css
@@ -727,7 +727,7 @@ a.view-comment-post-link {
padding: 0 0 8px 17px;
}
-#adminmenu li a #awaiting-mod {
+#adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins {
position: absolute;
margin-left: -0.4em;
margin-top: 0.2em;
@@ -738,7 +738,7 @@ a.view-comment-post-link {
width: 1em;
}
-#adminmenu li a .count-0 {
+#adminmenu li a .count-0, #sidemenu li a .count-0 {
display: none;
}
@@ -778,11 +778,11 @@ strong .post-com-count {
background-position: center -3px;
}
-#adminmenu li a:hover #awaiting-mod {
+#adminmenu li a:hover #awaiting-mod, #sidemenu li a:hover #update-plugins {
background-position: -80px bottom;
}
-#adminmenu li a #awaiting-mod span {
+#adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span {
top: -0.8em;
right: 0;
position: absolute;
diff --git a/wp-content/themes/default/style.css b/wp-content/themes/default/style.css
index 7cc120e..8602480 100644
--- a/wp-content/themes/default/style.css
+++ b/wp-content/themes/default/style.css
@@ -290,7 +290,7 @@ body {
}
.postmetadata {
- clear: left;
+ clear: both;
}
.clear {
diff --git a/wp-includes/class.wp-scripts.php b/wp-includes/class.wp-scripts.php
index d829c8e..7652aec 100644
--- a/wp-includes/class.wp-scripts.php
+++ b/wp-includes/class.wp-scripts.php
@@ -50,7 +50,7 @@ class WP_Scripts extends WP_Dependencies {
$ver .= '&amp;' . $this->args[$handle];
$src = $this->registered[$handle]->src;
- if ( !preg_match('|^https?://|', $src) ) {
+ if ( !preg_match('|^https?://|', $src) && !preg_match('|^' . preg_quote(WP_CONTENT_URL) . '|', $src) ) {
$src = $this->base_url . $src;
}
diff --git a/wp-includes/class.wp-styles.php b/wp-includes/class.wp-styles.php
index f6a6d79..8533943 100644
--- a/wp-includes/class.wp-styles.php
+++ b/wp-includes/class.wp-styles.php
@@ -59,7 +59,7 @@ class WP_Styles extends WP_Dependencies {
}
function _css_href( $src, $ver, $handle ) {
- if ( !preg_match('|^https?://|', $src) ) {
+ if ( !preg_match('|^https?://|', $src) && !preg_match('|^' . preg_quote(WP_CONTENT_URL) . '|', $src) ) {
$src = $this->base_url . $src;
}
diff --git a/wp-includes/js/tinymce/langs/wp-langs.php b/wp-includes/js/tinymce/langs/wp-langs.php
index f0208f5..75f10a7 100644
--- a/wp-includes/js/tinymce/langs/wp-langs.php
+++ b/wp-includes/js/tinymce/langs/wp-langs.php
@@ -411,7 +411,6 @@ size:"' . mce_escape( __('Size') ) . '",
thumbnail:"' . mce_escape( __('Thumbnail') ) . '",
medium:"' . mce_escape( __('Medium') ) . '",
full_size:"' . mce_escape( __('Full Size') ) . '",
-alt_help:"' . js_escape( __('Alternate text, e.g. "The Mona Lisa"') ) . '",
current_link:"' . mce_escape( __('Current Link') ) . '",
link_to_img:"' . mce_escape( __('Link to Image') ) . '",
link_help:"' . mce_escape( __('Enter a link URL or click above for presets.') ) . '",
@@ -435,7 +434,8 @@ s110:"' . mce_escape( __('110%') ) . '",
s120:"' . mce_escape( __('120%') ) . '",
s130:"' . mce_escape( __('130%') ) . '",
img_title:"' . mce_escape( __('Edit Image Title') ) . '",
-caption:"' . mce_escape( __('Edit Image Caption') ) . '"
+caption:"' . mce_escape( __('Edit Image Caption') ) . '",
+alt:"' . mce_escape( __('Edit Alternate Text') ) . '"
});
';
?> \ No newline at end of file
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html b/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
index d6adbfc..a9f1c15 100644
--- a/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
@@ -4,11 +4,11 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
-<script type="text/javascript" src="js/editimage.js?ver=311"></script>
+<script type="text/javascript" src="js/editimage.js?ver=311d"></script>
<script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script>
-<link rel="stylesheet" href="css/editimage.css?ver=311b" type="text/css" media="all" />
-<link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta1" type="text/css" media="all" />
+<link rel="stylesheet" href="css/editimage.css?ver=311d" type="text/css" media="all" />
+<link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta3" type="text/css" media="all" />
<script type="text/javascript">
if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') )
document.write('<link rel="stylesheet" href="css/editimage-rtl.css?ver=311" type="text/css" media="all" />');
@@ -74,7 +74,7 @@ if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') )
</td>
</tr>
- <tr class="">
+ <tr>
<th valign="top" scope="row" class="label">
<label for="img_title">
<span class="alignleft">{#wpeditimage.img_title}</span>
@@ -85,19 +85,18 @@ if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') )
</td>
</tr>
- <tr class="post_excerpt">
+ <tr id="cap_field">
<th valign="top" scope="row" class="label">
- <label for="img_alt">
+ <label for="img_cap">
<span class="alignleft">{#wpeditimage.caption}</span>
</label>
</th>
<td class="field">
- <input type="text" id="img_alt" name="img_alt" value="" size="60" />
- <p class="help">{#wpeditimage.alt_help}</p>
+ <input type="text" id="img_cap" name="img_cap" value="" size="60" />
</td>
</tr>
- <tr class="url">
+ <tr>
<th valign="top" scope="row" class="label">
<label for="link_href">
<span class="alignleft" id="lb_link_href">{#advanced_dlg.link_url}</span>
@@ -129,6 +128,17 @@ if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') )
<input type="text" id="img_src" name="img_src" value="" onblur="wpImage.checkVal(this)" aria-required="true" size="60" />
</td>
</tr>
+
+ <tr>
+ <th valign="top" scope="row" class="label">
+ <label for="img_alt">
+ <span class="alignleft">{#wpeditimage.alt}</span>
+ </label>
+ </th>
+ <td class="field">
+ <input type="text" id="img_alt" name="img_alt" value="" size="60" />
+ </td>
+ </tr>
<tr id="img_dim">
<th valign="top" scope="row" class="label">
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
index de3a972..7dfeca2 100644
--- a/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
@@ -15,7 +15,7 @@
if ( ed.dom.getAttrib(el, 'class').indexOf('mceItem') != -1 || el.nodeName != 'IMG' )
return;
- tb_show('', url + '/editimage.html?ver=311b&TB_iframe=true');
+ tb_show('', url + '/editimage.html?ver=311c&TB_iframe=true');
tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' );
});
@@ -34,9 +34,23 @@
});
ed.onMouseUp.add(function(ed, e) {
- if ( ! tinymce.isOpera ) return;
- if ( e.target.nodeName == 'IMG' )
- ed.plugins.wpeditimage.showButtons(e.target);
+ if ( tinymce.isOpera ) {
+ if ( e.target.nodeName == 'IMG' )
+ ed.plugins.wpeditimage.showButtons(e.target);
+ } else if ( ! tinymce.isWebKit ) {
+ var n = ed.selection.getNode(), DL;
+
+ if ( n.nodeName == 'IMG' && (DL = ed.dom.getParent(n, 'DL')) ) {
+ window.setTimeout(function(){
+ var ed = tinyMCE.activeEditor, n = ed.selection.getNode(), DL = ed.dom.getParent(n, 'DL');
+
+ if ( n.width != (parseInt(ed.dom.getStyle(DL, 'width')) - 10) ) {
+ ed.dom.setStyle(DL, 'width', parseInt(n.width)+10);
+ ed.execCommand('mceRepaint');
+ }
+ }, 100);
+ }
+ }
});
ed.onMouseDown.add(function(ed, e) {
@@ -73,7 +87,7 @@
},
_do_shcode : function(co) {
- return co.replace(/\[wp_caption([^\]]+)\]([\s\S]+?)\[\/wp_caption\][\s\u00a0]*/g, function(a,b,c){
+ return co.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g, function(a,b,c){
b = b.replace(/\\'|\\&#39;|\\&#039;/g, '&#39;').replace(/\\"|\\&quot;/g, '&quot;');
c = c.replace(/\\&#39;|\\&#039;/g, '&#39;').replace(/\\&quot;/g, '&quot;');
var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/align=['"]([^'"]+)/i);
@@ -87,8 +101,8 @@
var div_cls = (cls == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp';
- return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp_caption '+cls+'" style="width: '+(10+parseInt(w))+
- 'px"><dt class="wp_caption_dt">'+c+'</dt><dd class="wp_caption_dd">'+cap+'</dd></dl></div>';
+ return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp-caption '+cls+'" style="width: '+(10+parseInt(w))+
+ 'px"><dt class="wp-caption-dt">'+c+'</dt><dd class="wp-caption-dd">'+cap+'</dd></dl></div>';
});
},
@@ -105,7 +119,7 @@
cls = cls.match(/align[^ '"]+/) || 'alignnone';
cap = cap.replace(/<\S[^<>]*>/gi, '').replace(/'/g, '&#39;').replace(/"/g, '&quot;');
- return '[wp_caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/wp_caption]';
+ return '[caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/caption]';
});
},
diff --git a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
index fb1d2d8..1986a13 100644
--- a/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
+++ b/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
@@ -245,8 +245,12 @@ var wpImage = {
},
setup : function() {
- var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), dom = tinyMCEPopup.dom, DL, caption;
+ var t = this, h, c, el, id, link, fname, f = document.forms[0], ed = tinyMCEPopup.editor, d = t.I('img_demo'), dom = tinyMCEPopup.dom, DL, caption = null;
document.dir = tinyMCEPopup.editor.getParam('directionality','');
+
+ if ( ! tinyMCEPopup.editor.getParam('wpeditimage_do_captions', true) )
+ t.I('cap_field').style.display = 'none';
+
tinyMCEPopup.restoreSelection();
el = ed.selection.getNode();
if (el.nodeName != 'IMG') return;
@@ -255,24 +259,26 @@ var wpImage = {
ed.dom.setStyle(el, 'float', '');
t.getImageData();
c = ed.dom.getAttrib(el, 'class');
- caption = t.img_alt = ed.dom.getAttrib(el, 'alt');
if ( DL = dom.getParent(el, 'dl') ) {
var dlc = ed.dom.getAttrib(DL, 'class');
dlc = dlc.match(/align[^ "']+/i);
- if ( dlc && ! dom.hasClass(el, dlc) )
+ if ( dlc && ! dom.hasClass(el, dlc) ) {
c += ' '+dlc;
+ tinymce.trim(c);
+ }
tinymce.each(DL.childNodes, function(e) {
- if ( e.nodeName == 'DD' && dom.hasClass(e, 'wp_caption_dd') ) {
+ if ( e.nodeName == 'DD' && dom.hasClass(e, 'wp-caption-dd') ) {
caption = e.innerHTML;
return;
}
});
}
+ f.img_cap.value = caption;
f.img_title.value = ed.dom.getAttrib(el, 'title');
- f.img_alt.value = caption;
+ f.img_alt.value = ed.dom.getAttrib(el, 'alt');
f.border.value = ed.dom.getAttrib(el, 'border');
f.vspace.value = ed.dom.getAttrib(el, 'vspace');
f.hspace.value = ed.dom.getAttrib(el, 'hspace');
@@ -355,7 +361,7 @@ var wpImage = {
return;
}
- if ( f.img_alt.value != '' && f.width.value != '' ) {
+ if ( f.img_cap.value != '' && f.width.value != '' ) {
do_caption = 1;
img_class = img_class.replace( /align[^ "']+\s?/gi, '' );
}
@@ -370,7 +376,7 @@ var wpImage = {
ed.dom.setAttribs(el, {
src : f.img_src.value,
title : f.img_title.value,
- alt : t.img_alt,
+ alt : f.img_alt.value,
width : f.width.value,
height : f.height.value,
style : f.img_style.value,
@@ -421,15 +427,15 @@ var wpImage = {
if ( DL ) {
ed.dom.setAttribs(DL, {
- 'class' : 'wp_caption '+t.align,
+ 'class' : 'wp-caption '+t.align,
style : 'width: '+cap_width+'px;'
});
if ( DIV )
ed.dom.setAttrib(DIV, 'class', div_cls);
- if ( (DT = ed.dom.getParent(el, 'dt')) && (DD = DT.nextSibling) && ed.dom.hasClass(DD, 'wp_caption_dd') )
- ed.dom.setHTML(DD, f.img_alt.value);
+ if ( (DT = ed.dom.getParent(el, 'dt')) && (DD = DT.nextSibling) && ed.dom.hasClass(DD, 'wp-caption-dd') )
+ ed.dom.setHTML(DD, f.img_cap.value);
} else {
var lnk = '', pa;
@@ -446,8 +452,8 @@ var wpImage = {
}
} else html = ed.dom.getOuterHTML(el);
- html = '<dl id="'+cap_id+'" class="wp_caption '+t.align+'" style="width: '+cap_width+
- 'px"><dt class="wp_caption_dt">'+html+'</dt><dd class="wp_caption_dd">'+f.img_alt.value+'</dd></dl>';
+ html = '<dl id="'+cap_id+'" class="wp-caption '+t.align+'" style="width: '+cap_width+
+ 'px"><dt class="wp-caption-dt">'+html+'</dt><dd class="wp-caption-dd">'+f.img_cap.value+'</dd></dl>';
cap = ed.dom.create('div', {'class': div_cls}, html);
diff --git a/wp-includes/js/tinymce/tiny_mce_config.php b/wp-includes/js/tinymce/tiny_mce_config.php
index 665c4ce..5a8e4c4 100644
--- a/wp-includes/js/tinymce/tiny_mce_config.php
+++ b/wp-includes/js/tinymce/tiny_mce_config.php
@@ -130,6 +130,8 @@ $mce_buttons_3 = implode($mce_buttons_3, ',');
$mce_buttons_4 = apply_filters('mce_buttons_4', array());
$mce_buttons_4 = implode($mce_buttons_4, ',');
+$do_captions = ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ? false : true;
+
// TinyMCE init settings
$initArray = array (
'mode' => 'none',
@@ -163,6 +165,7 @@ $initArray = array (
'tab_focus' => ':next',
'content_css' => "$mce_css",
'save_callback' => 'switchEditors.saveCallback',
+ 'wpeditimage_do_captions' => $do_captions,
'plugins' => "$plugins",
// pass-through the settings for compression and caching, so they can be changed with "tiny_mce_before_init"
'disk_cache' => true,
@@ -222,7 +225,7 @@ if ( $compress && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
// Setup cache info
if ( $disk_cache ) {
- $cacheKey = apply_filters('tiny_mce_version', '20080708');
+ $cacheKey = apply_filters('tiny_mce_version', '20080710');
foreach ( $initArray as $v )
$cacheKey .= $v;
diff --git a/wp-includes/js/tinymce/wordpress.css b/wp-includes/js/tinymce/wordpress.css
index 0b55d4e..2348d12 100644
--- a/wp-includes/js/tinymce/wordpress.css
+++ b/wp-includes/js/tinymce/wordpress.css
@@ -15,7 +15,7 @@ dl.aligncenter {
float: right;
}
-.wp_caption {
+.wp-caption {
border: 1px solid #ddd;
text-align: center;
background-color: #f3f3f3;
@@ -27,13 +27,13 @@ dl.aligncenter {
border-radius: 3px;
}
-.wp_caption img {
+.wp-caption img {
margin: 0;
padding: 0;
border: 0 none;
}
-.wp_caption_dd {
+.wp-caption-dd {
font-size: 11px;
line-height: 17px;
padding: 0 4px 5px;
diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php
index 1a07d72..8f1d27f 100644
--- a/wp-includes/link-template.php
+++ b/wp-includes/link-template.php
@@ -745,39 +745,46 @@ function posts_nav_link($sep=' &#8212; ', $prelabel='&laquo; Previous Page', $nx
function get_shortcut_link() {
$link = "javascript:
- var d=document;
- var w=window;
- var e=w.getSelection;
- var k=d.getSelection;
- var x=d.selection;
- var s=(e?e():(k)?k():(x?x.createRange().text:0));
- var f='" . admin_url('press-this.php') . "';
- var l=d.location;
- var e=encodeURIComponent;
- var u= '?u=' + e(l.href);
- var t= '&t=' + e(d.title);
- var s= '&s=' + e(s);
- var v='&v=1';
- var g= f+u+t+s+v;
+ var d=document,
+ w=window,
+ e=w.getSelection,
+ k=d.getSelection,
+ x=d.selection,
+ s=(e?e():(k)?k():(x?x.createRange().text:0)),
+ f='" . admin_url('press-this.php') . "',
+ l=d.location,
+ e=encodeURIComponent,
+ g=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=2';
function a(){
if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=700,height=500')){
l.href=g;
}
- }
- if(/Firefox/.test(navigator.userAgent)){
- setTimeout(a,0);
- }else{
- a();
- }
- void(0);";
+ }";
+ if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false)
+ $link .= 'setTimeout(a,0);';
+ else
+ $link .= 'a();';
+
+ $link .= "void(0);";
$link = str_replace(array("\r", "\n", "\t"), '', $link);
return apply_filters('shortcut_link', $link);
}
-// return the site_url option, using https if is_ssl() is true
-// if $scheme is 'http' or 'https' it will override is_ssl()
+/** Return the site url
+ *
+ *
+ * @package WordPress
+ * @since 2.6
+ *
+ * Returns the 'site_url' option with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise.
+ * If $scheme is 'http' or 'https', is_ssl() is overridden.
+ *
+ * @param string $path Optional path relative to the site url
+ * @param string $scheme Optional scheme to give the site url context. Currently 'http','https', 'login', 'login_post', or 'admin'
+ * @return string Site url link with optional path appended
+*/
function site_url($path = '', $scheme = null) {
// should the list of allowed schemes be maintained elsewhere?
if ( !in_array($scheme, array('http', 'https')) ) {
@@ -799,9 +806,18 @@ function site_url($path = '', $scheme = null) {
return $url;
}
+/** Return the admin url
+ *
+ *
+ * @package WordPress
+ * @since 2.6
+ *
+ * Returns the url to the admin area
+ *
+ * @param string $path Optional path relative to the admin url
+ * @return string Admin url link with optional path appended
+*/
function admin_url($path = '') {
- global $_wp_admin_url;
-
$url = site_url('wp-admin/', 'admin');
if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
@@ -810,9 +826,18 @@ function admin_url($path = '') {
return $url;
}
+/** Return the includes url
+ *
+ *
+ * @package WordPress
+ * @since 2.6
+ *
+ * Returns the url to the includes directory
+ *
+ * @param string $path Optional path relative to the includes url
+ * @return string Includes url link with optional path appended
+*/
function includes_url($path = '') {
- global $_wp_includes_url;
-
$url = site_url() . '/' . WPINC . '/';
if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
@@ -821,4 +846,54 @@ function includes_url($path = '') {
return $url;
}
+/** Return the content url
+ *
+ *
+ * @package WordPress
+ * @since 2.6
+ *
+ * Returns the url to the content directory
+ *
+ * @param string $path Optional path relative to the content url
+ * @return string Content url link with optional path appended
+*/
+function content_url($path = '') {
+ $scheme = ( is_ssl() ? 'https' : 'http' );
+ $url = WP_CONTENT_URL;
+ if ( 0 === strpos($url, 'http') ) {
+ if ( is_ssl() )
+ $url = str_replace( 'http://', "{$scheme}://", $url );
+ }
+
+ if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
+ $url .= '/' . ltrim($path, '/');
+
+ return $url;
+}
+
+/** Return the plugins url
+ *
+ *
+ * @package WordPress
+ * @since 2.6
+ *
+ * Returns the url to the plugins directory
+ *
+ * @param string $path Optional path relative to the plugins url
+ * @return string Plugins url link with optional path appended
+*/
+function plugins_url($path = '') {
+ $scheme = ( is_ssl() ? 'https' : 'http' );
+ $url = WP_PLUGIN_URL;
+ if ( 0 === strpos($url, 'http') ) {
+ if ( is_ssl() )
+ $url = str_replace( 'http://', "{$scheme}://", $url );
+ }
+
+ if ( !empty($path) && is_string($path) && strpos($path, '..') === false )
+ $url .= '/' . ltrim($path, '/');
+
+ return $url;
+}
+
?>
diff --git a/wp-includes/media.php b/wp-includes/media.php
index b200b91..dd6927b 100644
--- a/wp-includes/media.php
+++ b/wp-includes/media.php
@@ -351,9 +351,13 @@ function wp_get_attachment_image($attachment_id, $size='thumbnail', $icon = fals
}
add_shortcode('wp_caption', 'img_caption_shortcode');
+add_shortcode('caption', 'img_caption_shortcode');
function img_caption_shortcode($attr, $content = null) {
-
+
+ if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF )
+ return $content;
+
// Allow plugins/themes to override the default caption template.
$output = apply_filters('img_caption_shortcode', '', $attr, $content);
if ( $output != '' )
diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php
index 9b8bb4f..8041f28 100644
--- a/wp-includes/pluggable.php
+++ b/wp-includes/pluggable.php
@@ -833,7 +833,10 @@ function wp_safe_redirect($location, $status = 302) {
if ( substr($location, 0, 2) == '//' )
$location = 'http:' . $location;
- $lp = parse_url($location);
+ // In php 5 parse_url may fail if the URL query part contains http://, bug #38143
+ $test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location;
+
+ $lp = parse_url($test);
$wpp = parse_url(get_option('home'));
$allowed_hosts = (array) apply_filters('allowed_redirect_hosts', array($wpp['host']), isset($lp['host']) ? $lp['host'] : '');
diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php
index 0240ba3..38f8d52 100644
--- a/wp-includes/script-loader.php
+++ b/wp-includes/script-loader.php
@@ -34,10 +34,10 @@ function wp_default_scripts( &$scripts ) {
$visual_editor = apply_filters('visual_editor', array('tiny_mce'));
$scripts->add( 'editor', false, $visual_editor, '20080321' );
- $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080706' );
+ $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080710' );
// Modify this version when tinyMCE plugins are changed.
- $mce_version = apply_filters('tiny_mce_version', '20080708');
+ $mce_version = apply_filters('tiny_mce_version', '20080710');
$scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version );
$scripts->add( 'prototype', '/wp-includes/js/prototype.js', false, '1.6');
@@ -158,8 +158,8 @@ function wp_default_scripts( &$scripts ) {
'cancel' => __('Cancel'),
'edit' => __('Edit'),
) );
- $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080705' );
- $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080702' );
+ $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080709' );
+ $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080710' );
$scripts->localize( 'upload', 'uploadL10n', array(
'browseTitle' => attribute_escape(__('Browse your files')),
'back' => __('&laquo; Back'),
@@ -211,7 +211,7 @@ function wp_default_styles( &$styles ) {
$styles->default_version = get_bloginfo( 'version' );
$styles->text_direction = 'rtl' == get_bloginfo( 'text_direction' ) ? 'rtl' : 'ltr';
- $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets' );
+ $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'press-this-ie' );
$styles->add( 'wp-admin', '/wp-admin/wp-admin.css' );
$styles->add_data( 'wp-admin', 'rtl', '/wp-admin/rtl.css' );
@@ -224,12 +224,14 @@ function wp_default_styles( &$styles ) {
$styles->add_data( 'colors-fresh', 'rtl', true );
$styles->add( 'global', '/wp-admin/css/global.css' );
- $styles->add( 'media', '/wp-admin/css/media.css', array(), '20080523' );
+ $styles->add( 'media', '/wp-admin/css/media.css', array(), '20080709' );
$styles->add( 'widgets', '/wp-admin/css/widgets.css' );
$styles->add( 'dashboard', '/wp-admin/css/dashboard.css' );
$styles->add( 'install', '/wp-admin/css/install.css', array(), '20080708' );
$styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css' );
- $styles->add( 'press-this', '/wp-admin/css/press-this.css', array(), '20080704' );
+ $styles->add( 'press-this', '/wp-admin/css/press-this.css', array(), '20080710' );
+ $styles->add( 'press-this-ie', '/wp-admin/css/press-this-ie.css', array(), '20080710' );
+ $styles->add_data( 'press-this-ie', 'conditional', 'gte IE 6' );
$styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20080613' );
$styles->add( 'login', '/wp-admin/css/login.css' );
diff --git a/wp-includes/theme.php b/wp-includes/theme.php
index aa5f385..6376075 100644
--- a/wp-includes/theme.php
+++ b/wp-includes/theme.php
@@ -337,7 +337,7 @@ function get_theme_root() {
}
function get_theme_root_uri() {
- return apply_filters('theme_root_uri', WP_CONTENT_URL . "/themes", get_option('siteurl'));
+ return apply_filters('theme_root_uri', content_url('themes'), get_option('siteurl'));
}
function get_query_template($type) {
diff --git a/wp-includes/update.php b/wp-includes/update.php
index 270f2bd..4d94ac2 100644
--- a/wp-includes/update.php
+++ b/wp-includes/update.php
@@ -10,7 +10,7 @@
* wp_version_check() - Check WordPress version against the newest version.
*
* The WordPress version, PHP version, and Locale is sent. Checks against the WordPress server at
- * api.wordpress.org server. Will only check if PHP has fsockopen enabled and WordPress isn't installing.
+ * api.wordpress.org. Will only check if PHP has fsockopen enabled and WordPress isn't installing.
*
* @package WordPress
* @since 2.3
@@ -19,7 +19,7 @@
* @return mixed Returns null if update is unsupported. Returns false if check is too soon.
*/
function wp_version_check() {
- if ( !function_exists('fsockopen') || strpos($_SERVER['PHP_SELF'], 'install.php') !== false || defined('WP_INSTALLING') )
+ if ( !function_exists('fsockopen') || defined('WP_INSTALLING') )
return;
global $wp_version;
@@ -69,7 +69,94 @@ function wp_version_check() {
}
update_option( 'update_core', $new_option );
}
-
add_action( 'init', 'wp_version_check' );
+/**
+ * wp_update_plugins() - Check plugin versions against the latest versions hosted on WordPress.org.
+ *
+ * The WordPress version, PHP version, and Locale is sent along with a list of all plugins installed.
+ * Checks against the WordPress server at api.wordpress.org.
+ * Will only check if PHP has fsockopen enabled and WordPress isn't installing.
+ *
+ * @package WordPress
+ * @since 2.3
+ * @uses $wp_version Used to notidy the WordPress version.
+ *
+ * @return mixed Returns null if update is unsupported. Returns false if check is too soon.
+ */
+function wp_update_plugins() {
+ global $wp_version;
+
+ if ( !function_exists('fsockopen') || defined('WP_INSTALLING') )
+ return false;
+
+ $current = get_option( 'update_plugins' );
+
+ $time_not_changed = isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked );
+
+ // If running blog-side, bail unless we've not checked in the last 12 hours
+ if ( !function_exists( 'get_plugins' ) ) {
+ if ( $time_not_changed )
+ return false;
+ require_once( ABSPATH . 'wp-admin/includes/plugin.php' );
+ }
+
+ $plugins = get_plugins();
+ $active = get_option( 'active_plugins' );
+
+ $new_option = '';
+ $new_option->last_checked = time();
+
+ $plugin_changed = false;
+ foreach ( $plugins as $file => $p ) {
+ $new_option->checked[ $file ] = $p['Version'];
+
+ if ( !isset( $current->checked[ $file ] ) ) {
+ $plugin_changed = true;
+ continue;
+ }
+
+ if ( strval($current->checked[ $file ]) !== strval($p['Version']) )
+ $plugin_changed = true;
+ }
+
+ // Bail if we've checked in the last 12 hours and if nothing has changed
+ if ( $time_not_changed && !$plugin_changed )
+ return false;
+
+ $to_send->plugins = $plugins;
+ $to_send->active = $active;
+ $send = serialize( $to_send );
+
+ $request = 'plugins=' . urlencode( $send );
+ $http_request = "POST /plugins/update-check/1.0/ HTTP/1.0\r\n";
+ $http_request .= "Host: api.wordpress.org\r\n";
+ $http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n";
+ $http_request .= "Content-Length: " . strlen($request) . "\r\n";
+ $http_request .= 'User-Agent: WordPress/' . $wp_version . '; ' . get_bloginfo('url') . "\r\n";
+ $http_request .= "\r\n";
+ $http_request .= $request;
+
+ $response = '';
+ if( false != ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3) ) && is_resource($fs) ) {
+ fwrite($fs, $http_request);
+
+ while ( !feof($fs) )
+ $response .= fgets($fs, 1160); // One TCP-IP packet
+ fclose($fs);
+ $response = explode("\r\n\r\n", $response, 2);
+ }
+
+ $response = unserialize( $response[1] );
+
+ if ( $response )
+ $new_option->response = $response;
+
+ update_option( 'update_plugins', $new_option );
+}
+if ( defined( 'WP_ADMIN' ) && WP_ADMIN )
+ add_action( 'admin_init', 'wp_update_plugins' );
+else
+ add_action( 'init', 'wp_update_plugins' );
+
?>
diff --git a/wp-includes/version.php b/wp-includes/version.php
index f79f045..b19e143 100644
--- a/wp-includes/version.php
+++ b/wp-includes/version.php
@@ -8,7 +8,7 @@
*
* @global string $wp_version
*/
-$wp_version = '2.6-beta3';
+$wp_version = '2.6';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
@@ -17,5 +17,5 @@ $wp_version = '2.6-beta3';
*/
$wp_db_version = 8201;
-$wpmu_version = '2.6-beta1';
+$wpmu_version = '2.6';
?>
diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php
index e6d2621..a4a9eef 100644
--- a/wp-includes/wp-db.php
+++ b/wp-includes/wp-db.php
@@ -786,7 +786,8 @@ class wpdb {
$wheres[] = "$c = '" . $this->escape( $v ) . "'";
else
return false;
- return $this->query( "UPDATE $table SET " . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres ) . ' LIMIT 1' );
+
+ return $this->query( "UPDATE $table SET " . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres ) );
}
/**
diff --git a/wp-login.php b/wp-login.php
index 1a42382..d602170 100644
--- a/wp-login.php
+++ b/wp-login.php
@@ -53,14 +53,7 @@ function login_header($title = 'Login', $message = '', $wp_error = '') {
<?php
wp_admin_css( 'login', true );
wp_admin_css( 'colors-fresh', true );
- ?>
- <script type="text/javascript">
- function focusit() {
- document.getElementById('user_login').focus();
- }
- window.onload = focusit;
- </script>
-<?php do_action('login_head'); ?>
+ do_action('login_head'); ?>
</head>
<body class="login">
@@ -327,6 +320,9 @@ case 'retrievepassword' :
<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('&laquo; Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
+<script type="text/javascript">
+try{document.getElementById('user_login').focus();}catch(e){}
+</script>
</body>
</html>
<?php
@@ -395,6 +391,9 @@ case 'register' :
<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('&laquo; Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
+<script type="text/javascript">
+try{document.getElementById('user_login').focus();}catch(e){}
+</script>
</body>
</html>
<?php
@@ -477,6 +476,9 @@ default:
<p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('&laquo; Back to %s'), get_bloginfo('title', 'display' )); ?></a></p>
+<script type="text/javascript">
+try{document.getElementById('user_login').focus();}catch(e){}
+</script>
</body>
</html>
<?php