Changeset 8335
- Timestamp:
- 07/15/2008 02:01:08 AM (17 years ago)
- Location:
- branches/crazyhorse
- Files:
-
- 64 edited
- 12 copied
Legend:
- Unmodified
- Added
- Removed
-
branches/crazyhorse/readme.html
r7104 r8335 9 9 <h1 id="logo" style="text-align: center"> 10 10 <img alt="WordPress" src="wp-admin/images/wordpress-logo.png" /> 11 <br /> Version 2. 511 <br /> Version 2.6 12 12 </h1> 13 13 <p style="text-align: center">Semantic Personal Publishing Platform</p> … … 30 30 <h1>Upgrading</h1> 31 31 <p>Before you upgrade anything, make sure you have backup copies of any files you may have modified such as <code>index.php</code>.</p> 32 <h2>Upgrading from any previous WordPress to 2. 5:</h2>32 <h2>Upgrading from any previous WordPress to 2.6:</h2> 33 33 <ol> 34 34 <li>Delete your old WP files, saving ones you've modified.</li> -
branches/crazyhorse/wp-admin/admin-ajax.php
r8277 r8335 31 31 check_ajax_referer( "delete-comment_$id" ); 32 32 if ( !$comment = get_comment( $id ) ) 33 die(' 0');33 die('1'); 34 34 if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) 35 35 die('-1'); 36 36 37 if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) 37 if ( isset($_POST['spam']) && 1 == $_POST['spam'] ) { 38 if ( 'spam' == wp_get_comment_status( $comment->comment_ID ) ) 39 die('1'); 38 40 $r = wp_set_comment_status( $comment->comment_ID, 'spam' ); 39 else41 } else { 40 42 $r = wp_delete_comment( $comment->comment_ID ); 43 } 41 44 42 45 die( $r ? '1' : '0' ); … … 47 50 die('-1'); 48 51 52 $cat = get_category( $id ); 53 if ( !$cat || is_wp_error( $cat ) ) 54 die('1'); 55 49 56 if ( wp_delete_category( $id ) ) 50 57 die('1'); 51 else die('0'); 58 else 59 die('0'); 52 60 break; 53 61 case 'delete-tag' : … … 56 64 die('-1'); 57 65 66 $tag = get_term( $id, 'post_tag' ); 67 if ( !$tag || is_wp_error( $tag ) ) 68 die('1'); 69 58 70 if ( wp_delete_term($id, 'post_tag')) 59 71 die('1'); 60 else die('0'); 72 else 73 die('0'); 61 74 break; 62 75 case 'delete-link-cat' : … … 64 77 if ( !current_user_can( 'manage_categories' ) ) 65 78 die('-1'); 79 80 $cat = get_term( $id, 'link_category' ); 81 if ( !$cat || is_wp_error( $cat ) ) 82 die('1'); 66 83 67 84 $cat_name = get_term_field('name', $id, 'link_category'); … … 95 112 die('-1'); 96 113 114 $link = get_bookmark( $id ); 115 if ( !$link || is_wp_error( $link ) ) 116 die('1'); 117 97 118 if ( wp_delete_link( $id ) ) 98 119 die('1'); 99 else die('0'); 120 else 121 die('0'); 100 122 break; 101 123 case 'delete-meta' : 102 124 check_ajax_referer( "delete-meta_$id" ); 103 125 if ( !$meta = get_post_meta_by_id( $id ) ) 104 die('0'); 126 die('1'); 127 105 128 if ( !current_user_can( 'edit_post', $meta->post_id ) ) 106 129 die('-1'); … … 114 137 die('-1'); 115 138 139 if ( !get_post( $id ) ) 140 die('1'); 141 116 142 if ( wp_delete_post( $id ) ) 117 143 die('1'); … … 124 150 die('-1'); 125 151 152 if ( !get_page( $id ) ) 153 die('1'); 154 126 155 if ( wp_delete_post( $id ) ) 127 156 die('1'); 128 else die('0'); 157 else 158 die('0'); 129 159 break; 130 160 case 'dim-comment' : 131 161 if ( !$comment = get_comment( $id ) ) 132 162 die('0'); 163 133 164 if ( !current_user_can( 'edit_post', $comment->comment_post_ID ) ) 134 165 die('-1'); … … 136 167 die('-1'); 137 168 138 if ( in_array( wp_get_comment_status($comment->comment_ID), array( 'unapproved', 'spam' ) ) ) { 169 $current = wp_get_comment_status( $comment->comment_ID ); 170 if ( $_POST['new'] == $current ) 171 die('1'); 172 173 if ( in_array( $current, array( 'unapproved', 'spam' ) ) ) { 139 174 check_ajax_referer( "approve-comment_$id" ); 140 175 if ( wp_set_comment_status( $comment->comment_ID, 'approve' ) ) -
branches/crazyhorse/wp-admin/admin-header.php
r8270 r8335 67 67 <div id="wpcontent"> 68 68 <div id="wphead"> 69 <h1><a href="<?php echo clean_url( admin_url() ); ?>"><?php if ( '' == get_bloginfo('name' ) ) echo ' '; else echo get_bloginfo('name'); ?></a><span id="viewsite"><a href="<?php echo trailingslashit( get_option('home') ); ?>"><?php _e('Visit Site') ?></a></span></h1>69 <h1><a href="<?php echo clean_url( admin_url() ); ?>"><?php if ( '' == get_bloginfo('name', 'display') ) echo ' '; else echo get_bloginfo('name', 'display'); ?></a><span id="viewsite"><a href="<?php echo trailingslashit( get_option('home') ); ?>"><?php _e('Visit Site') ?></a></span></h1> 70 70 </div> 71 71 -
branches/crazyhorse/wp-admin/admin.php
r8124 r8335 114 114 } 115 115 116 if ( !empty($_REQUEST['action']) ) 117 do_action('admin_action_' . $_REQUEST['action']); 118 116 119 ?> -
branches/crazyhorse/wp-admin/css/colors-classic.css
r8329 r8335 325 325 } 326 326 327 #adminmenu li a #awaiting-mod span {327 #adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span { 328 328 background-color: #d54e21; 329 329 color: #fff; … … 336 336 337 337 338 #adminmenu li a:hover #awaiting-mod span {338 #adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span { 339 339 background-color: #07273E; 340 340 } -
branches/crazyhorse/wp-admin/css/colors-fresh.css
r8329 r8335 302 302 } 303 303 304 #adminmenu li a #awaiting-mod span, # rightnow .reallynow {304 #adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span, #rightnow .reallynow { 305 305 background-color: #d54e21; 306 306 color: #fff; 307 307 } 308 308 309 #adminmenu li a:hover #awaiting-mod span {309 #adminmenu li a:hover #awaiting-mod span, #sidemenu li a:hover #update-plugins span { 310 310 background-color: #264761; 311 311 } -
branches/crazyhorse/wp-admin/css/dashboard-rtl.css
r8116 r8335 23 23 } 24 24 25 div.dashboard-widget-submit input { 26 font-family: sans-serif !important; 27 } 28 25 29 #dashboard-widgets .widget_rss ul li a { 26 30 float:right; … … 64 68 float: right; 65 69 } 70 #dashboard_secondary div.dashboard-widget-content ul li .post { 71 font-family: sans-serif !important; 72 } 66 73 #dashboard_secondary div.dashboard-widget-content ul li a { 67 74 border-right:0 none; 68 75 border-left:1px solid #DADADA; 69 76 } 77 #dashboard_secondary div.dashboard-widget-content ul li a cite { 78 font-family: sans-serif; 79 } -
branches/crazyhorse/wp-admin/css/global-rtl.css
r7908 r8335 1 /* styles for use by people extending the WordPress interface */ 1 //* styles for use by people extending the WordPress interface */ 2 body, td { font-family: sans-serif; } 3 4 textarea, input, select { font-family: sans-serif; } 5 2 6 .alignleft { float: right; } 3 7 .alignright { float: left; } … … 5 9 .textleft { text-align: right; } 6 10 .textright { text-align: left; } 11 12 .wrap h2 { font-family: sans-serif; } 7 13 8 14 .widefat td { -
branches/crazyhorse/wp-admin/css/install-rtl.css
r7398 r8335 1 1 body { 2 font-size: 11px;; 2 font-size: 11px; 3 font-family: sans-serif !important; 3 4 } 4 5 ul, ol { … … 18 19 text-align: left; 19 20 } 21 .submit input, .button, .button-secondary { 22 font-family: sans-serif !important; 23 } 24 h1 { 25 font-family: sans-serif; 26 } -
branches/crazyhorse/wp-admin/css/install.css
r7130 r8335 8 8 width: 700px; 9 9 padding: 1em 2em; 10 -moz-border-radius: 12px; 11 -khtml-border-radius: 12px; 10 12 -webkit-border-radius: 12px; 11 font-size: 62.5%;13 border-radius: 12px; 12 14 } 13 15 … … 26 28 p, li { 27 29 padding-bottom: 2px; 28 font-size: 1 .3em;29 line-height: 1 .8em;30 font-size: 13px; 31 line-height: 18px; 30 32 } 31 33 32 34 code { 33 font-size: 1 .3em;35 font-size: 13px; 34 36 } 35 37 … … 38 40 #logo { margin: 6px 0 14px 0px; border-bottom: none;} 39 41 40 .step a, .step input { font-size: 2em; } 42 .step { 43 margin: 20px 0 15px; 44 } 41 45 42 td input { font-size: 1.5em; } 46 .step input { 47 font-size: 18px; 48 } 49 50 a.button { 51 font-size: 18px; 52 } 43 53 44 54 .step, th { text-align: left; padding: 0; } … … 46 56 .submit input, .button, .button-secondary { 47 57 font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; 48 padding: 6px;49 border: none;58 padding: 5px 7px 7px; 59 border: 1px solid #a3a3a3; 50 60 margin-left: 0; 51 font-size: 13px !important; 52 -moz-border-radius: 2px; 53 -khtml-border-radius: 2px; 54 -webkit-border-radius: 2px; 55 border-radius: 2px; 61 -moz-border-radius: 3px; 62 -khtml-border-radius: 3px; 63 -webkit-border-radius: 3px; 64 border-radius: 3px; 56 65 color: #246; 57 66 background: #e5e5e5; … … 64 73 .submit input:hover, .button:hover, .button-secondary:hover { 65 74 color: #d54e21; 75 border-color: #535353; 66 76 } 67 77 … … 76 86 padding: 10px; 77 87 border-bottom: 8px solid #fff; 88 font-size: 12px; 78 89 } 79 90 80 91 .form-table th { 81 font-size: 1 2px;92 font-size: 13px; 82 93 text-align: left; 83 padding: 1 2px 10px 10px 10px;94 padding: 16px 10px 10px 10px; 84 95 border-bottom: 8px solid #fff; 85 96 width: 110px; … … 101 112 } 102 113 114 .form-table input { 115 line-height: 20px; 116 font-size: 15px; 117 padding: 2px; 118 } 119 103 120 h1 { 104 121 border-bottom: 1px solid #dadada; … … 117 134 #error-page p { 118 135 font-size: 14px; 119 line-height: 1.6em; 136 line-height: 16px; 137 margin: 25px 0 20px; 120 138 } 121 139 122 140 #error-page code { 123 font-size: 1 em;141 font-size: 15px; 124 142 } -
branches/crazyhorse/wp-admin/css/login-rtl.css
r7398 r8335 1 1 body { 2 font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana,sans-serif;2 font-family: sans-serif; 3 3 direction: rtl; 4 } 5 #login form .submit input { 6 font-family: sans-serif !important; 4 7 } 5 8 form { -
branches/crazyhorse/wp-admin/css/media.css
r7988 r8335 33 33 display:block; 34 34 font-weight: bold; 35 font-size: 13px; 35 36 margin-bottom: 0.5em; 36 37 margin: 0 0 0.5em 0; … … 229 230 230 231 .filename { 232 float: left; 231 233 line-height: 36px; 232 234 margin-left: 10px; 233 float: left; 235 overflow: hidden; 236 max-width: 430px; 234 237 } 235 238 #media-upload .describe { … … 277 280 margin: 5px 0; 278 281 } 282 283 .menu_order { 284 float: right; 285 font-size: 11px; 286 margin: 10px 10px 0; 287 } 288 289 .menu_order_input { 290 border: 1px solid #DDDDDD; 291 font-size: 10px; 292 padding: 1px; 293 width: 23px; 294 } 295 296 .ui-sortable-helper { 297 background-color: #fff; 298 border: 1px solid #aaa; 299 opacity: 0.6; 300 filter: alpha(opacity=60); 301 } 302 303 #media-upload th.order-head { 304 width: 25%; 305 text-align: center; 306 } 307 308 #media-upload .widefat { 309 width: 626px; 310 border-style: solid solid none; 311 } 312 313 .sorthelper { 314 z-index: -1; 315 } -
branches/crazyhorse/wp-admin/css/press-this.css
r8242 r8335 89 89 } 90 90 91 /* Header */ 91 92 #wphead { 92 93 border-top: none; 93 }94 95 .button {96 font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif;97 padding: 3px 5px;98 font-size: 12px;99 line-height: 1.5em;100 border-width: 1px;101 border-style: solid;102 -moz-border-radius: 3px;103 -khtml-border-radius: 3px;104 -webkit-border-radius: 3px;105 border-radius: 3px;106 cursor: pointer;107 margin-left: 5px;108 text-decoration: none;109 }110 111 .howto {112 font-size: 11px;113 }114 #newtag { width: 60%; padding: 3px; }115 116 #wphead {117 94 height: 2em; 118 95 padding-top: 8px; 96 } 97 98 .button { 99 font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; 100 padding: 3px 5px; 101 font-size: 12px; 102 line-height: 1.5em; 103 border-width: 1px; 104 border-style: solid; 105 -moz-border-radius: 3px; 106 -khtml-border-radius: 3px; 107 -webkit-border-radius: 3px; 108 border-radius: 3px; 109 cursor: pointer; 110 margin-left: 5px; 111 text-decoration: none; 112 } 113 114 .howto { 115 font-size: 11px; 116 font-style: italic; 117 display: block; 119 118 } 120 119 … … 133 132 134 133 #wphead #viewsite a { 135 font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, 136 sans-serif; 134 font: 12px "Lucida Grande", "Lucida Sans Unicode", Tahoma, Verdana, sans-serif; 137 135 padding: 3px 4px; 138 136 display: block; … … 174 172 } 175 173 174 /* Editor/Main Column */ 175 176 div#container { 177 margin: 0; 178 min-width: 500px; 179 } 180 181 div#container form { 182 margin: 0px; 183 padding: 0px; 184 } 185 186 div#posting { 187 padding-left: 16px; 188 position: absolute; 189 z-index: 1; 190 width: 66%; 191 } 192 193 #post_title { 194 width: 99%; 195 } 196 176 197 .titlewrap { 177 198 border-style: solid; … … 179 200 padding: 2px 3px; 180 201 border-color: #CCCCCC; 181 }182 183 div#container {184 margin: 0;185 min-width: 500px;186 }187 188 div#posting {189 padding-left: 16px;190 position: absolute;191 z-index: 1;192 width: 66%;193 202 } 194 203 … … 200 209 } 201 210 202 div#container form {203 margin: 0px;204 padding: 0px;205 }206 207 div#categories {208 font-size: 85%;209 position: absolute;210 top: 50px;211 right: 16px;212 width: 27%;213 z-index: 2;214 }215 216 div#categories h2 {217 color: #333;218 font-size: 12px;219 margin: .5em 0 0 1em;220 padding: 0;221 }222 223 #categories-all {224 overflow: auto;225 padding: 1em;226 height: 15em;227 }228 229 #categories ul {230 list-style: none;231 padding: 0;232 margin: 0;233 }234 235 211 .editor-container { 236 212 border-width: 1px; … … 240 216 } 241 217 242 #tagsdiv #newtag { 243 margin-right: 5px; 244 width: 16em; 245 } 246 247 #tagchecklist { 248 padding-left: 1em; 249 margin-bottom: 1em; 250 font-size: 12px; 251 overflow: auto; 252 } 253 254 #tagchecklist strong { 255 position: absolute; 256 font-size: .75em; 257 } 258 259 #tagchecklist span { 260 margin-right: .5em; 261 margin-left: 10px; 262 display: block; 263 float: left; 264 font-size: 11px; 265 line-height: 1.8em; 266 white-space: nowrap; 267 cursor: default; 268 } 269 270 #tagchecklist span a { 271 margin: 6px 0pt 0pt -9px; 272 cursor: pointer; 273 width: 10px; 274 height: 10px; 275 display: block; 276 float: left; 277 text-indent: -9999px; 278 overflow: hidden; 279 position: absolute; 280 } 281 282 .howto { 283 font-style: italic; 284 display: block; 285 } 286 287 #post_title { 288 width: 99%; 218 /* Photo Styles */ 219 220 #photo_directions { 221 margin-top: .25em; 222 display: block; 223 position: relative; 224 } 225 226 #photo_directions span { 227 display: block; 228 position: absolute; 229 top: 0; 230 right: 3px; 231 } 232 233 #photo_saving { 234 margin: 0 8px 8px; 235 vertical-align: middle; 289 236 } 290 237 … … 301 248 float: left; 302 249 } 250 303 251 #img_container img { 304 252 width: 75px; … … 315 263 #img_container a:hover, #img_container a:active { 316 264 border: 2px solid #000; 265 } 266 267 /* Submit Column */ 268 269 div#categories { 270 font-size: 85%; 271 position: absolute; 272 top: 50px; 273 right: 16px; 274 width: 27%; 275 z-index: 2; 276 } 277 278 div#categories h2 { 279 color: #333; 280 font-size: 12px; 281 margin: .5em 0 .5em 1em; 282 padding: 0; 283 } 284 285 #categories-all { 286 overflow: auto; 287 padding: 0 1em 1em 1em; 288 height: 15em; 289 } 290 291 #categories ul { 292 list-style: none; 293 padding: 0; 294 margin: 0; 295 } 296 297 #tagsdiv #newtag { 298 padding: 3px; 299 margin-right: 5px; 300 width: 16em; 301 } 302 303 #jaxtag { 304 clear: both; 305 padding-left: 1em; 306 margin: 0; 307 } 308 309 #tagchecklist { 310 padding-left: 1em; 311 margin-bottom: 1em; 312 font-size: 12px; 313 overflow: auto; 314 } 315 316 #tagchecklist strong { 317 position: absolute; 318 font-size: .75em; 319 } 320 321 #tagchecklist span { 322 margin-right: .5em; 323 margin-left: 10px; 324 display: block; 325 float: left; 326 font-size: 11px; 327 line-height: 1.8em; 328 white-space: nowrap; 329 cursor: default; 330 } 331 332 #tagchecklist span a { 333 margin: 6px 0pt 0pt -9px; 334 cursor: pointer; 335 width: 10px; 336 height: 10px; 337 display: block; 338 float: left; 339 text-indent: -9999px; 340 overflow: hidden; 341 position: absolute; 317 342 } 318 343 .submit { … … 326 351 border-bottom-right-radius: 3px; 327 352 margin: 0; 328 padding: 0;353 padding: 10px; 329 354 } 330 355 .submitbox { … … 341 366 border: none; 342 367 text-align: left; 343 padding: 12px 10px 10px 10px;368 padding: 6px 4px; 344 369 font-size: 12px; 345 margin: 10px; 346 370 margin: 2px; 347 371 -moz-border-radius: 3px; 348 372 -khtml-border-radius: 3px; … … 364 388 } 365 389 366 .hidden { 367 display: none; 368 } 369 390 /* Video Styles */ 370 391 .video_split #extra_fields { 371 392 width: 27%; … … 384 405 } 385 406 386 #jaxtag {387 clear: both;388 padding-left: 1em;389 }390 391 407 .ac_results { 392 408 padding: 0; … … 414 430 } 415 431 416 417 432 .photolist { 418 display: none;433 display: none; 419 434 } 420 435 421 436 #extra_fields small { 422 display: block;423 margin-top: .5em;424 padding-bottom: .25em;437 display: block; 438 margin-top: .5em; 439 padding-bottom: .25em; 425 440 } 426 441 427 442 #TB_ajaxContent #options { 428 position: absolute; 429 top: 20px; 430 right: 25px; 431 background: white; 432 padding: 5px; 443 position: absolute; 444 top: 20px; 445 right: 25px; 446 padding: 5px; 433 447 } 434 448 #TB_ajaxContent h3 { 435 margin-bottom: .25em;449 margin-bottom: .25em; 436 450 } 437 451 … … 463 477 } 464 478 465 #photo_directions {466 margin-top: .25em;467 display: block;468 position: relative;469 }470 #photo_directions span {471 display: block;472 position: absolute;473 top: 0;474 right: 3px;475 }476 #photo_saving {477 margin-bottom: 8px;478 }479 480 479 #post_status { 481 480 margin-left: 10px; … … 484 483 } 485 484 485 /* Footer */ 486 486 487 #footer { 487 488 height: 65px; … … 506 507 #footer p a:hover { 507 508 text-decoration: underline; 509 } 510 511 512 /* Utility Classes */ 513 .centered { 514 text-align: center; 515 } 516 517 .hidden { 518 display: none; 519 } -
branches/crazyhorse/wp-admin/css/theme-editor-rtl.css
r7501 r8335 1 #template textarea { 2 font-family: monospace !important; 3 } 1 4 #templateside { 2 5 float:left; -
branches/crazyhorse/wp-admin/gears-manifest.php
r8242 r8335 65 65 { 66 66 "betaManifestVersion" : 1, 67 "version" : "<?php echo $man_version; ?>_200807 01",67 "version" : "<?php echo $man_version; ?>_20080710a", 68 68 "entries" : [ 69 69 <?php echo $defaults; ?> … … 98 98 { "url" : "images/wordpress-logo.png" }, 99 99 { "url" : "images/xit.gif" }, 100 { "url" : "images/loading-publish.gif" }, 101 { "url" : "images/loading.gif" }, 102 { "url" : "images/required.gif" }, 103 { "url" : "images/no.png" }, 104 { "url" : "images/yes.png" }, 100 105 101 106 { "url" : "../wp-includes/images/crystal/archive.png" }, … … 127 132 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/source_editor.js?ver=311" }, 128 133 { "url" : "../wp-includes/js/tinymce/themes/advanced/js/anchor.js?ver=311" }, 129 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311" }, 134 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js?ver=311d" }, 135 { "url" : "../wp-includes/js/tinymce/tiny_mce.js?ver=311" }, 136 { "url" : "../wp-includes/js/tinymce/themes/advanced/editor_template.js?ver=311" }, 137 { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/editor_plugin.js?ver=311" }, 130 138 131 139 { "url" : "../wp-includes/js/tinymce/themes/advanced/source_editor.htm?ver=311" }, … … 141 149 { "url" : "../wp-includes/js/tinymce/plugins/fullscreen/fullscreen.htm?ver=311" }, 142 150 { "url" : "../wp-includes/js/tinymce/plugins/inlinepopups/template.htm?ver=311" }, 143 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311 " },151 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/editimage.html?ver=311d" }, 144 152 { "url" : "../wp-includes/js/tinymce/wp-mce-help.php?ver=311" }, 145 153 … … 154 162 { "url" : "../wp-includes/js/tinymce/plugins/paste/css/pasteword.css?ver=311" }, 155 163 { "url" : "../wp-includes/js/tinymce/plugins/paste/css/blank.css?ver=311" }, 156 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311 " },164 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css?ver=311d" }, 157 165 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/css/editimage-rtl.css?ver=311" }, 158 166 { "url" : "../wp-includes/js/tinymce/wordpress.css?ver=311" }, … … 192 200 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/image.png" }, 193 201 { "url" : "../wp-includes/js/tinymce/plugins/wpeditimage/img/delete.png" }, 194 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/help.gif" } 202 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/help.gif" }, 203 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/image.gif" }, 204 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/media.gif" }, 205 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/video.gif" }, 206 { "url" : "../wp-includes/js/tinymce/plugins/wordpress/img/audio.gif" } 195 207 ]} -
branches/crazyhorse/wp-admin/import/wp-cat2tag.php
r8103 r8335 15 15 echo '</div>'; 16 16 } else { ?> 17 <div class="tablenav"><p style="margin:4px"><a style="display:inline;" class="button-secondary" href="admin.php?import=wp-cat2tag"> Categories to Tags</a>18 <a style="display:inline;" class="button-secondary" href="admin.php?import=wp-cat2tag&step=3"> Tags to Categories</a></p></div>17 <div class="tablenav"><p style="margin:4px"><a style="display:inline;" class="button-secondary" href="admin.php?import=wp-cat2tag"><?php _e( "Categories to Tags" ); ?></a> 18 <a style="display:inline;" class="button-secondary" href="admin.php?import=wp-cat2tag&step=3"><?php _e( "Tags to Categories" ); ?></a></p></div> 19 19 <?php } 20 20 } … … 53 53 echo '<h2>' . sprintf( __ngettext( 'Convert Category to Tag.', 'Convert Categories (%d) to Tags.', $cat_num ), $cat_num ) . '</h2>'; 54 54 echo '<div class="narrow">'; 55 echo '<p>' . __('Hey there. Here you can selectively convert sexisting categories to tags. To get started, check the categories you wish to be converted, then click the Convert button.') . '</p>';55 echo '<p>' . __('Hey there. Here you can selectively convert existing categories to tags. To get started, check the categories you wish to be converted, then click the Convert button.') . '</p>'; 56 56 echo '<p>' . __('Keep in mind that if you convert a category with child categories, the children become top-level orphans.') . '</p></div>'; 57 57 -
branches/crazyhorse/wp-admin/includes/class-wp-filesystem-base.php
r8018 r8335 1 1 <?php 2 2 class WP_Filesystem_Base{ 3 var $verbose = true;3 var $verbose = false; 4 4 var $cache = array(); 5 5 -
branches/crazyhorse/wp-admin/includes/media.php
r8329 r8335 27 27 28 28 function the_media_upload_tabs() { 29 global $redir_tab; 29 30 $tabs = media_upload_tabs(); 30 31 31 32 if ( !empty($tabs) ) { 32 33 echo "<ul id='sidemenu'>\n"; 33 if ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) ) 34 if ( isset($redir_tab) && array_key_exists($redir_tab, $tabs) ) 35 $current = $redir_tab; 36 elseif ( isset($_GET['tab']) && array_key_exists($_GET['tab'], $tabs) ) 34 37 $current = $_GET['tab']; 35 38 else { … … 65 68 function image_add_caption( $html, $id, $alt, $title, $align, $url, $size ) { 66 69 67 if ( empty($alt) ) return $html; 70 // CAPTIONS_OFF is temporary. Do not use it. 71 if ( empty($alt) || ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ) return $html; 68 72 $id = ( 0 < (int) $id ) ? 'attachment_' . $id : ''; 69 73 … … 75 79 if ( empty($align) ) $align = 'none'; 76 80 77 $shcode = '[ wp_caption id="' . $id . '" align="align' . $align78 . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/ wp_caption]';81 $shcode = '[caption id="' . $id . '" align="align' . $align 82 . '" width="' . $width . '" caption="' . $alt . '"]' . $html . '[/caption]'; 79 83 80 84 return apply_filters( 'image_add_caption_shortcode', $shcode, $html ); … … 155 159 $content = $image_meta['caption']; 156 160 } 157 161 158 162 $title = @$desc; 159 163 … … 232 236 $out = <<<EOF 233 237 234 <a href="{$image_upload_iframe_src}&TB_iframe=true" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a>235 <a href="{$video_upload_iframe_src}&TB_iframe=true" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a>236 <a href="{$audio_upload_iframe_src}&TB_iframe=true" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a>237 <a href="{$media_upload_iframe_src}&TB_iframe=true" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a>238 <a href="{$image_upload_iframe_src}&TB_iframe=true" id="add_image" class="thickbox" title='$image_title'><img src='images/media-button-image.gif' alt='$image_title' /></a> 239 <a href="{$video_upload_iframe_src}&TB_iframe=true" id="add_video" class="thickbox" title='$video_title'><img src='images/media-button-video.gif' alt='$video_title' /></a> 240 <a href="{$audio_upload_iframe_src}&TB_iframe=true" id="add_audio" class="thickbox" title='$audio_title'><img src='images/media-button-music.gif' alt='$audio_title' /></a> 241 <a href="{$media_upload_iframe_src}&TB_iframe=true" id="add_media" class="thickbox" title='$media_title'><img src='images/media-button-other.gif' alt='$media_title' /></a> 238 242 239 243 EOF; … … 326 330 } 327 331 328 if ( isset($_POST['save']) ) 332 if ( isset($_POST['save']) ) { 329 333 $errors['upload_notice'] = __('Saved.'); 334 return media_upload_gallery(); 335 } 330 336 331 337 return wp_iframe( 'media_upload_type_form', 'image', $errors, $id ); … … 337 343 $file_array['tmp_name'] = download_url($file); 338 344 $desc = @$desc; 339 345 340 346 $id = media_handle_sideload($file_array, $post_id, $desc); 341 347 $src = $id; 342 348 343 unset($file_array);344 345 349 if ( is_wp_error($id) ) { 346 $errors['upload_error'] = $id;350 @unlink($file_array['tmp_name']); 347 351 return $id; 348 352 } … … 388 392 } 389 393 390 if ( isset($_POST['save']) ) 394 if ( isset($_POST['save']) ) { 391 395 $errors['upload_notice'] = __('Saved.'); 396 return media_upload_gallery(); 397 } 392 398 393 399 return wp_iframe( 'media_upload_type_form', 'audio', $errors, $id ); … … 426 432 } 427 433 428 if ( isset($_POST['save']) ) 434 if ( isset($_POST['save']) ) { 429 435 $errors['upload_notice'] = __('Saved.'); 436 return media_upload_gallery(); 437 } 430 438 431 439 return wp_iframe( 'media_upload_type_form', 'video', $errors, $id ); … … 464 472 } 465 473 466 if ( isset($_POST['save']) ) 474 if ( isset($_POST['save']) ) { 467 475 $errors['upload_notice'] = __('Saved.'); 476 return media_upload_gallery(); 477 } 468 478 469 479 return wp_iframe( 'media_upload_type_form', 'file', $errors, $id ); … … 500 510 if ( substr($post->post_mime_type, 0, 5) == 'image' ) { 501 511 $form_fields['post_title']['required'] = true; 502 $form_fields['post_excerpt']['label'] = __('Caption'); 503 $form_fields['post_excerpt']['helps'][] = __('Alternate text, e.g. "The Mona Lisa"'); 512 513 // CAPTIONS_OFF is temporary. Do not use it. 514 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) { 515 $form_fields['post_excerpt']['label'] = __('Alternate Text'); 516 $form_fields['post_excerpt']['helps'][] = __('Alt text for the image, e.g. "The Mona Lisa"'); 517 } else { 518 $form_fields['post_excerpt']['label'] = __('Caption'); 519 $form_fields['post_excerpt']['helps'][] = __('Also used as alternate text for the image'); 520 } 504 521 505 522 $form_fields['post_content']['label'] = __('Description'); … … 590 607 $link = get_attachment_link($post->ID); 591 608 609 // CAPTIONS_OFF is temporary. Do not use it. 610 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) 611 $alt = __('Alternate Text'); 612 else 613 $alt = __('Caption'); 614 592 615 $form_fields = array( 593 616 'post_title' => array( … … 596 619 ), 597 620 'post_excerpt' => array( 598 'label' => __('Caption'),621 'label' => $alt, 599 622 'value' => $edit_post->post_excerpt, 600 623 ), … … 676 699 677 700 function get_media_item( $attachment_id, $args = null ) { 701 global $redir_tab; 702 678 703 $default_args = array( 'errors' => null, 'send' => true, 'delete' => true, 'toggle' => true ); 679 704 $args = wp_parse_args( $args, $default_args ); … … 723 748 724 749 $display_title = ( !empty( $title ) ) ? $title : $filename; // $title shouldn't ever be empty, but just in case 750 $display_title = wp_html_excerpt($display_title, 60); 751 752 $gallery = ( (isset($_REQUEST['tab']) && 'gallery' == $_REQUEST['tab']) || (isset($redir_tab) && 'gallery' == $redir_tab) ) ? true : false; 753 $order = ''; 754 755 foreach ( $form_fields as $key => $val ) { 756 if ( 'menu_order' == $key ) { 757 if ( $gallery ) 758 $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>'; 759 else 760 $order = '<input type="hidden" name="attachments['.$attachment_id.'][menu_order]" value="'.$val['value'].'" />'; 761 762 unset($form_fields['menu_order']); 763 break; 764 } 765 } 725 766 726 767 $item = " 727 768 $type 728 769 $toggle_links 770 $order 729 771 <div class='filename new'>$display_title</div> 730 772 <table class='slidetoggle describe $class'> … … 960 1002 </div> 961 1003 1004 <script type="text/javascript"> 1005 //<![CDATA[ 1006 var addExtImage = { 1007 1008 width : '', 1009 height : '', 1010 align : 'alignnone', 1011 1012 insert : function() { 1013 var t = this, html, f = document.forms[0], cls, title = '', alt = '', caption = null; 1014 1015 if ( '' == f.src.value || '' == t.width ) return false; 1016 1017 if ( f.title.value ) { 1018 title = f.title.value.replace(/['"<>]+/g, ''); 1019 title = ' title="'+title+'"'; 1020 } 1021 1022 if ( f.alt.value ) { 1023 alt = f.alt.value.replace(/['"<>]+/g, ''); 1024 <?php if ( ! defined('CAPTIONS_OFF') || true != CAPTIONS_OFF ) { // CAPTIONS_OFF is temporary. Do not use it. ?> 1025 caption = f.alt.value.replace(/'/g, ''').replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>'); 1026 <?php } ?> 1027 } 1028 1029 cls = caption ? '' : ' class="'+t.align+'"'; 1030 1031 html = '<img alt="'+alt+'" src="'+f.src.value+'"'+title+cls+' width="'+t.width+'" height="'+t.height+'" />'; 1032 1033 if ( f.url.value ) 1034 html = '<a href="'+f.url.value+'">'+html+'</a>'; 1035 1036 if ( caption ) 1037 html = '[caption id="" align="'+t.align+'" width="'+t.width+'" caption="'+caption+'"]'+html+'[/caption]'; 1038 1039 var win = window.dialogArguments || opener || parent || top; 1040 win.send_to_editor(html); 1041 }, 1042 1043 resetImageData : function() { 1044 var t = addExtImage; 1045 1046 t.width = t.height = ''; 1047 document.getElementById('go_button').style.color = '#bbb'; 1048 if ( ! document.forms[0].src.value ) 1049 document.getElementById('status_img').src = 'images/required.gif'; 1050 else document.getElementById('status_img').src = 'images/no.png'; 1051 }, 1052 1053 updateImageData : function() { 1054 var t = addExtImage; 1055 1056 t.width = t.preloadImg.width; 1057 t.height = t.preloadImg.height; 1058 document.getElementById('go_button').style.color = '#333'; 1059 document.getElementById('status_img').src = 'images/yes.png'; 1060 }, 1061 1062 getImageData : function() { 1063 var t = addExtImage, src = document.forms[0].src.value; 1064 1065 if ( ! src ) { 1066 t.resetImageData(); 1067 return false; 1068 } 1069 document.getElementById('status_img').src = 'images/loading.gif'; 1070 t.preloadImg = new Image(); 1071 t.preloadImg.onload = t.updateImageData; 1072 t.preloadImg.onerror = t.resetImageData; 1073 t.preloadImg.src = src; 1074 } 1075 } 1076 //]]> 1077 </script> 1078 962 1079 <div id="media-items"> 963 1080 <div class="media-item media-blank"> … … 971 1088 972 1089 function media_upload_gallery_form($errors) { 1090 global $redir_tab; 1091 1092 $redir_tab = 'gallery'; 973 1093 media_upload_header(); 974 1094 975 1095 $post_id = intval($_REQUEST['post_id']); 976 977 1096 $form_action_url = admin_url("media-upload.php?type={$GLOBALS['type']}&tab=gallery&post_id=$post_id"); 978 979 1097 ?> 980 1098 … … 994 1112 <?php wp_nonce_field('media-form'); ?> 995 1113 <?php //media_upload_form( $errors ); ?> 996 1114 <table class="widefat"> 1115 <thead><tr> 1116 <th><?php _e('Media'); ?></th> 1117 <th class="order-head"><?php _e('Order'); ?></th> 1118 </tr></thead> 1119 </table> 997 1120 <div id="media-items"> 998 1121 <?php echo get_media_items($post_id, $errors); ?> 999 1122 </div> 1123 <p class="ml-submit"> 1000 1124 <input type="submit" class="button savebutton" name="save" value="<?php echo attribute_escape( __( 'Save all changes' ) ); ?>" /> 1001 1125 <input type="submit" class="button insert-gallery" name="insert-gallery" value="<?php echo attribute_escape( __( 'Insert gallery into post' ) ); ?>" /> … … 1003 1127 <input type="hidden" name="type" value="<?php echo attribute_escape( $GLOBALS['type'] ); ?>" /> 1004 1128 <input type="hidden" name="tab" value="<?php echo attribute_escape( $GLOBALS['tab'] ); ?>" /> 1129 </p> 1005 1130 </form> 1006 1131 <?php … … 1154 1279 1155 1280 function type_form_image() { 1156 return'1281 $form = ' 1157 1282 <table class="describe"><tbody> 1158 1283 <tr> 1284 <th valign="top" scope="row" class="label" style="width:120px;"> 1285 <span class="alignleft"><label for="src">' . __('Source') . '</label></span> 1286 <span class="alignright"><img id="status_img" src="images/required.gif" title="required" alt="required" /></span> 1287 </th> 1288 <td class="field"><input id="src" name="src" value="" type="text" aria-required="true" onblur="addExtImage.getImageData()"></td> 1289 </tr> 1290 1291 <tr> 1159 1292 <th valign="top" scope="row" class="label"> 1160 <span class="alignleft"><label for=" insertonly[src]">' . __('Image URL') . '</label></span>1293 <span class="alignleft"><label for="title">' . __('Image Title') . '</label></span> 1161 1294 <span class="alignright"><abbr title="required" class="required">*</abbr></span> 1162 1295 </th> 1163 <td class="field"><input id="insertonly[src]" name="insertonly[src]" value="" type="text" aria-required="true"></td> 1164 </tr> 1296 <td class="field"><p><input id="title" name="title" value="" type="text" aria-required="true" /></p></td> 1297 </tr> 1298 '; 1299 // CAPTIONS_OFF is temporary. Do not use it. 1300 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) { 1301 $form .= ' 1165 1302 <tr> 1166 1303 <th valign="top" scope="row" class="label"> 1167 <span class="alignleft"><label for="insertonly[alt]">' . __('Description') . '</label></span> 1168 <span class="alignright"><abbr title="required" class="required">*</abbr></span> 1304 <span class="alignleft"><label for="alt">' . __('Alternate Text') . '</label></span> 1169 1305 </th> 1170 <td class="field"><input id="insertonly[alt]" name="insertonly[alt]" value="" type="text" aria-required="true"></td> 1171 </tr> 1172 <tr><td></td><td class="help">' . __('Alternate text, e.g. "The Mona Lisa"') . '</td></tr> 1306 <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" /> 1307 <p class="help">' . __('Alt text for the image, e.g. "The Mona Lisa"') . '</p></td> 1308 </tr> 1309 '; 1310 1311 } else { 1312 $form .= ' 1313 <tr> 1314 <th valign="top" scope="row" class="label"> 1315 <span class="alignleft"><label for="alt">' . __('Image Caption') . '</label></span> 1316 </th> 1317 <td class="field"><input id="alt" name="alt" value="" type="text" aria-required="true" /> 1318 <p class="help">' . __('Also used as alternate text for the image') . '</p></td> 1319 </tr> 1320 '; 1321 } 1322 $form .= ' 1173 1323 <tr class="align"> 1174 <th valign="top" scope="row" class="label">< label for="insertonly[align]">' . __('Alignment') . '</label></th>1324 <th valign="top" scope="row" class="label"><p><label for="align">' . __('Alignment') . '</label></p></th> 1175 1325 <td class="field"> 1176 <input name=" insertonly[align]" id="image-align-none-0" value="none" type="radio" checked="checked" />1177 <label for=" image-align-none-0" class="align image-align-none-label">' . __('None') . '</label>1178 <input name=" insertonly[align]" id="image-align-left-0" value="left" type="radio" />1179 <label for=" image-align-left-0" class="align image-align-left-label">' . __('Left') . '</label>1180 <input name=" insertonly[align]" id="image-align-center-0" value="center" type="radio" />1181 <label for=" image-align-center-0" class="align image-align-center-label">' . __('Center') . '</label>1182 <input name=" insertonly[align]" id="image-align-right-0" value="right" type="radio" />1183 <label for=" image-align-right-0" class="align image-align-right-label">' . __('Right') . '</label>1326 <input name="align" id="align-none" value="alignnone" onclick="addExtImage.align=this.value" type="radio" checked="checked" /> 1327 <label for="align-none" class="align image-align-none-label">' . __('None') . '</label> 1328 <input name="align" id="align-left" value="alignleft" onclick="addExtImage.align=this.value" type="radio" /> 1329 <label for="align-left" class="align image-align-left-label">' . __('Left') . '</label> 1330 <input name="align" id="align-center" value="aligncenter" onclick="addExtImage.align=this.value" type="radio" /> 1331 <label for="align-center" class="align image-align-center-label">' . __('Center') . '</label> 1332 <input name="align" id="align-right" value="alignright" onclick="addExtImage.align=this.value" type="radio" /> 1333 <label for="align-right" class="align image-align-right-label">' . __('Right') . '</label> 1184 1334 </td> 1185 1335 </tr> 1336 1337 <tr> 1338 <th valign="top" scope="row" class="label"> 1339 <span class="alignleft"><label for="url">' . __('Link URL') . '</label></span> 1340 </th> 1341 <td class="field"><input id="url" name="url" value="" type="text" /><br /> 1342 1343 <button type="button" class="button" value="" onclick="document.forms[0].url.value=null">' . __('None') . '</button> 1344 <button type="button" class="button" value="" onclick="document.forms[0].url.value=document.forms[0].src.value">' . __('Link to image') . '</button> 1345 <p class="help">' . __('Enter a link URL or click above for presets.') . '</p></td> 1346 </tr> 1347 1186 1348 <tr> 1187 1349 <td></td> 1188 1350 <td> 1189 <input type=" submit" class="button" name="insertonlybutton" value="' . attribute_escape(__('Insert into Post')) . '" />1351 <input type="button" class="button" id="go_button" style="color:#bbb;" onclick="addExtImage.insert()" value="' . attribute_escape(__('Insert into Post')) . '" /> 1190 1352 </td> 1191 1353 </tr> 1192 1354 </tbody></table> 1193 1355 '; 1356 1357 return $form; 1194 1358 } 1195 1359 … … 1278 1442 } 1279 1443 1444 // support a GET parameter for disabling the flash uploader 1445 function media_upload_use_flash($flash) { 1446 if ( array_key_exists('flash', $_REQUEST) ) 1447 $flash = !empty($_REQUEST['flash']); 1448 return $flash; 1449 } 1450 1451 add_filter('flash_uploader', 'media_upload_use_flash'); 1452 1453 function media_upload_flash_bypass() { 1454 echo '<p class="upload-flash-bypass">'; 1455 printf( __('You are using the Flash uploader. Problems? Try the <a href="%s">Browser uploader</a> instead.'), clean_url(add_query_arg('flash', 0)) ); 1456 echo '</p>'; 1457 } 1458 1459 add_action('post-flash-upload-ui', 'media_upload_flash_bypass'); 1460 1461 function media_upload_html_bypass() { 1462 echo '<p class="upload-html-bypass">'; 1463 if ( array_key_exists('flash', $_REQUEST) ) 1464 // the user manually selected the browser uploader, so let them switch back to Flash 1465 printf( __('You are using the Browser uploader. Try the <a href="%s">Flash uploader</a> instead.'), clean_url(add_query_arg('flash', 1)) ); 1466 else 1467 // the user probably doesn't have Flash 1468 printf( __('You are using the Browser uploader.') ); 1469 1470 echo '</p>'; 1471 } 1472 1473 add_action('post-flash-upload-ui', 'media_upload_flash_bypass'); 1474 add_action('post-html-upload-ui', 'media_upload_html_bypass'); 1475 1476 // make sure the GET parameter sticks when we submit a form 1477 function media_upload_bypass_url($url) { 1478 if ( array_key_exists('flash', $_REQUEST) ) 1479 $url = add_query_arg('flash', intval($_REQUEST['flash'])); 1480 return $url; 1481 } 1482 1483 add_filter('media_upload_form_url', 'media_upload_bypass_url'); 1484 1485 1486 1280 1487 add_filter('async_upload_image', 'get_media_item', 10, 2); 1281 1488 add_filter('async_upload_audio', 'get_media_item', 10, 2); -
branches/crazyhorse/wp-admin/includes/plugin.php
r8124 r8335 471 471 $parent = get_admin_page_parent(); 472 472 473 $page_type = 'admin'; 473 474 if ( empty ( $parent_page ) || 'admin.php' == $parent_page ) { 474 475 if ( isset( $admin_page_hooks[$plugin_page] )) … … 477 478 if ( isset( $admin_page_hooks[$parent] )) 478 479 $page_type = $admin_page_hooks[$parent]; 479 } else { 480 if ( isset( $admin_page_hooks[$parent_page] ) ) { 481 $page_type = $admin_page_hooks[$parent_page]; 482 } else { 483 $page_type = 'admin'; 484 } 480 } else if ( isset( $admin_page_hooks[$parent_page] ) ) { 481 $page_type = $admin_page_hooks[$parent_page]; 485 482 } 486 483 -
branches/crazyhorse/wp-admin/includes/post.php
r8143 r8335 94 94 $mn = $_POST['mn']; 95 95 $ss = $_POST['ss']; 96 $aa = ($aa <= 0 ) ? date('Y') : $aa; 97 $mm = ($mm <= 0 ) ? date('n') : $mm; 96 98 $jj = ($jj > 31 ) ? 31 : $jj; 99 $jj = ($jj <= 0 ) ? date('j') : $jj; 97 100 $hh = ($hh > 23 ) ? $hh -24 : $hh; 98 101 $mn = ($mn > 59 ) ? $mn -60 : $mn; … … 744 747 convert_urls : false, 745 748 apply_source_formatting : false, 746 remove_linebreaks : false,749 remove_linebreaks : true, 747 750 accessibility_focus : false, 748 751 tab_focus : ":next", 749 752 plugins : "safari,inlinepopups", 750 753 entities : "38,amp,60,lt,62,gt", 751 force_p_newlines : true 754 force_p_newlines : true, 755 save_callback : 'switchEditors.saveCallback' 752 756 }); 753 757 }; -
branches/crazyhorse/wp-admin/includes/template.php
r8288 r8335 526 526 527 527 /* 528 * displays pages in hierarchical order 528 * displays pages in hierarchical order with paging support 529 529 */ 530 531 530 function page_rows($pages, $pagenum = 1, $per_page = 20) { 532 531 $level = 0; … … 539 538 } 540 539 541 // splice pages into two parts: those without parent and those with parent 542 $top_level_pages = array(); 543 $children_pages = array(); 544 545 // If searching, ignore hierarchy and treat everything as top level, otherwise split 546 // into top level and children 540 /* 541 * arrange pages into two parts: top level pages and children_pages 542 * children_pages is two dimensional array, eg. 543 * children_pages[10][] contains all sub-pages whose parent is 10. 544 * It only takes O(N) to arrange this and it takes O(1) for subsequent lookup operations 545 * If searching, ignore hierarchy and treat everything as top level 546 */ 547 547 if ( empty($_GET['s']) ) { 548 549 $top_level_pages = array(); 550 $children_pages = array(); 551 548 552 foreach ( $pages as $page ) { 553 549 554 // catch and repair bad pages 550 555 if ( $page->post_parent == $page->ID ) { … … 557 562 $top_level_pages[] = $page; 558 563 else 559 $children_pages[ ] = $page;564 $children_pages[ $page->post_parent ][] = $page; 560 565 } 561 566 … … 566 571 $start = ($pagenum - 1) * $per_page; 567 572 $end = $start + $per_page; 573 568 574 foreach ( $pages as $page ) { 569 575 if ( $count >= $end ) 570 576 break; 571 577 572 $i++;573 574 578 if ( $count >= $start ) 575 579 echo "\t" . display_page_row( $page, $level ); … … 580 584 _page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page ); 581 585 } 582 } 583 584 function _page_rows( $pages, &$count, $parent, $level, $pagenum, $per_page ) { 586 587 // if it is the last pagenum and there are orphaned pages, display them with paging as well 588 if ( isset($children_pages) && $count < $end ){ 589 foreach( $children_pages as $orphans ){ 590 foreach ( $orphans as $op ) { 591 if ( $count >= $end ) 592 break; 593 if ( $count >= $start ) 594 echo "\t" . display_page_row( $op, 0 ); 595 $count++; 596 } 597 } 598 } 599 } 600 601 /* 602 * Given a top level page ID, display the nested hierarchy of sub-pages 603 * together with paging support 604 */ 605 function _page_rows( &$children_pages, &$count, $parent, $level, $pagenum, $per_page ) { 606 607 if ( ! isset( $children_pages[$parent] ) ) 608 return; 609 585 610 $start = ($pagenum - 1) * $per_page; 586 611 $end = $start + $per_page; 587 $i = -1; 588 foreach ( $pages as $page ) { 612 613 foreach ( $children_pages[$parent] as $page ) { 614 589 615 if ( $count >= $end ) 590 616 break; 591 592 $i++; 593 594 if ( $page->post_parent != $parent ) 595 continue; 596 617 597 618 // If the page starts in a subtree, print the parents. 598 619 if ( $count == $start && $page->post_parent > 0 ) { … … 615 636 if ( $count >= $start ) 616 637 echo "\t" . display_page_row( $page, $level ); 617 618 unset($pages[$i]); // Prune the working set 638 619 639 $count++; 620 640 621 _page_rows( $pages, $count, $page->ID, $level + 1, $pagenum, $per_page ); 622 } 641 _page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page ); 642 } 643 644 unset( $children_pages[$parent] ); //required in order to keep track of orphans 623 645 } 624 646 … … 758 780 759 781 if ( current_user_can('edit_post', $comment->comment_post_ID) ) { 760 $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3 ' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | ';761 $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3 ' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | ';782 $actions['approve'] = "<a href='$approve_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' title='" . __( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a> | '; 783 $actions['unapprove'] = "<a href='$unapprove_url' class='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' title='" . __( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a> | '; 762 784 $actions['edit'] = "<a href='comment.php?action=editcomment&c={$comment->comment_ID}' title='" . __('Edit comment') . "'>". __('Edit') . '</a> | '; 763 785 $actions['spam'] = "<a href='$spam_url' class='delete:the-comment-list:comment-$comment->comment_ID::spam=1' title='" . __( 'Mark this comment as spam' ) . "'>" . __( 'Spam' ) . '</a> | '; -
branches/crazyhorse/wp-admin/includes/update.php
r8060 r8335 53 53 echo "<span id='wp-version-message'>$msg</span>"; 54 54 } 55 56 function wp_update_plugins() {57 global $wp_version;58 59 if ( !function_exists('fsockopen') )60 return false;61 62 $plugins = get_plugins();63 $active = get_option( 'active_plugins' );64 $current = get_option( 'update_plugins' );65 66 $new_option = '';67 $new_option->last_checked = time();68 69 $plugin_changed = false;70 foreach ( $plugins as $file => $p ) {71 $new_option->checked[ $file ] = $p['Version'];72 73 if ( !isset( $current->checked[ $file ] ) ) {74 $plugin_changed = true;75 continue;76 }77 78 if ( strval($current->checked[ $file ]) !== strval($p['Version']) )79 $plugin_changed = true;80 }81 82 if (83 isset( $current->last_checked ) &&84 43200 > ( time() - $current->last_checked ) &&85 !$plugin_changed86 )87 return false;88 89 $to_send->plugins = $plugins;90 $to_send->active = $active;91 $send = serialize( $to_send );92 93 $request = 'plugins=' . urlencode( $send );94 $http_request = "POST /plugins/update-check/1.0/ HTTP/1.0\r\n";95 $http_request .= "Host: api.wordpress.org\r\n";96 $http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n";97 $http_request .= "Content-Length: " . strlen($request) . "\r\n";98 $http_request .= 'User-Agent: WordPress/' . $wp_version . '; ' . get_bloginfo('url') . "\r\n";99 $http_request .= "\r\n";100 $http_request .= $request;101 102 $response = '';103 if( false != ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3) ) && is_resource($fs) ) {104 fwrite($fs, $http_request);105 106 while ( !feof($fs) )107 $response .= fgets($fs, 1160); // One TCP-IP packet108 fclose($fs);109 $response = explode("\r\n\r\n", $response, 2);110 }111 112 $response = unserialize( $response[1] );113 114 if ( $response )115 $new_option->response = $response;116 117 update_option( 'update_plugins', $new_option );118 }119 add_action( 'load-plugins.php', 'wp_update_plugins' );120 55 121 56 function wp_plugin_update_row( $file, $plugin_data ) { -
branches/crazyhorse/wp-admin/includes/widgets.php
r8063 r8335 65 65 // it's a multi-widget. We only need to show it in the list once. 66 66 $already_shown[] = $widget['callback']; 67 $num = (int) array_pop( explode( '-', $widget['id'] ) );67 $num = (int) array_pop( $ids = explode( '-', $widget['id'] ) ); 68 68 $id_base = $wp_registered_widget_controls[$widget['id']]['id_base']; 69 69 // so that we always add a new one when clicking "add" -
branches/crazyhorse/wp-admin/install.php
r8242 r8335 55 55 </tr> 56 56 </table> 57 < input type="submit" name="Submit" value="<?php _e('Install WordPress'); ?>" class="button" />57 <p class="step"><input type="submit" name="Submit" value="<?php _e('Install WordPress'); ?>" class="button" /></p> 58 58 </form> 59 59 … … 99 99 </table> 100 100 101 <p ><a href="../wp-login.php" class="button"><?php _e('Log In'); ?></a>101 <p class="step"><a href="../wp-login.php" class="button"><?php _e('Log In'); ?></a></p> 102 102 103 103 <?php -
branches/crazyhorse/wp-admin/js/editor.js
r8242 r8335 53 53 content = content.replace(new RegExp('\\s*<div', 'mg'), '\n<div'); 54 54 content = content.replace(new RegExp('</div>\\s*', 'mg'), '</div>\n'); 55 content = content.replace(new RegExp('\\s*\\[wp_caption([^\\[]+)\\[/wp_caption\\]\\s*', 'gi'), '\n\n[wp_caption$1[/wp_caption]\n\n'); 55 content = content.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n'); 56 content = content.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption'); 56 57 57 58 var blocklist2 = 'blockquote|ul|ol|li|table|thead|tr|th|td|h[1-6]|pre'; … … 166 167 pee = pee.replace(new RegExp('(</?(?:'+blocklist+')[^>]*>)\\s*<br />', 'gi'), "$1"); 167 168 pee = pee.replace(new RegExp('<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)', 'gi'), '$1'); 168 pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[ wp_caption([^\\[]+)\\[/wp_caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[wp_caption$1[/wp_caption]');169 pee = pee.replace(new RegExp('(?:<p>|<br ?/?>)*\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*(?:</p>|<br ?/?>)*', 'gi'), '[caption$1[/caption]'); 169 170 // pee = pee.replace(new RegExp('^((?: )*)\\s', 'mg'), '$1 '); 170 171 -
branches/crazyhorse/wp-admin/js/gallery.js
r7974 r8335 5 5 items: '.media-item', 6 6 placeholder: 'sorthelper', 7 axis: 'y', 8 distance: 2, 7 9 update: galleryReorder 8 10 } ); … … 11 13 // When an update has occurred, adjust the order for each item 12 14 var galleryReorder = function(e, sort) { 13 jQuery.each(sort[' instance'].toArray(), function(i, id) {14 jQuery('#' + id + ' .menu_order input')[0].value = i;15 jQuery.each(sort['element'].sortable('toArray'), function(i, id) { 16 jQuery('#' + id + ' .menu_order input')[0].value = (1+i); 15 17 }); 16 18 } … … 19 21 gallerySortableInit(); 20 22 }); 23 24 jQuery(document).ready(function($){ 25 $('.menu_order_input').each(function(){ 26 if ( this.value == '0' ) this.value = ''; 27 }); 28 }); -
branches/crazyhorse/wp-admin/js/media-upload.js
r8242 r8335 6 6 ed.selection.moveToBookmark(tinymce.EditorManager.activeEditor.windowManager.bookmark); 7 7 8 if ( h.indexOf('[caption') != -1 ) 9 h = ed.plugins.wpeditimage._do_shcode(h); 10 8 11 ed.execCommand('mceInsertContent', false, h); 9 ed.execCommand('mceCleanup');10 12 } else 11 13 edInsertContent(edCanvas, h); -
branches/crazyhorse/wp-admin/press-this.php
r8242 r8335 2 2 require_once('admin.php'); 3 3 4 if ( ! current_user_can('publish_posts') ) wp_die( __( 'Cheatin’ uh?' )); ?> 5 6 <?php 4 if ( ! current_user_can('publish_posts') ) wp_die( __( 'Cheatin’ uh?' ) ); 7 5 8 6 function preg_quote2($string) { 9 7 return str_replace('/', '\/', preg_quote($string)); 10 8 } 9 function aposfix($text) { 10 $translation_table[chr(34)] = '"'; 11 $translation_table[chr(38)] = '&'; 12 $translation_table[chr(39)] = '''; 13 return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($text, $translation_table)); 14 } 11 15 function press_it() { 12 16 // define some basic variables 13 $quick['post_status'] = $_REQUEST['post_status'];17 $quick['post_status'] = isset($_REQUEST['publish']) ? 'publish' : 'draft'; 14 18 $quick['post_category'] = $_REQUEST['post_category']; 15 19 $quick['tags_input'] = $_REQUEST['tags_input']; 16 20 $quick['post_title'] = $_REQUEST['post_title']; 17 21 $quick['post_content'] = ''; 18 22 19 23 // insert the post with nothing in it, to get an ID 20 24 $post_ID = wp_insert_post($quick, true); 21 25 22 26 $content = ''; 23 27 switch ( $_REQUEST['post_type'] ) { … … 26 30 $content .= $_REQUEST['content']; 27 31 break; 28 32 29 33 case 'photo': 30 34 $content = $_REQUEST['content']; 31 32 foreach( $_REQUEST['photo_src'] as $key => $image) {33 #quote for matching35 36 foreach( (array) $_REQUEST['photo_src'] as $key => $image) { 37 // escape quote for matching 34 38 $quoted = preg_quote2($image); 35 39 36 40 // see if files exist in content - we don't want to upload non-used selected files. 37 preg_match('/'.$quoted.'/', $_REQUEST['content'], $matches[0]); 38 if($matches[0]) { 41 if( strpos($_REQUEST['content'], $quoted) !== false ) { 39 42 $upload = media_sideload_image($image, $post_ID, $_REQUEST['photo_description'][$key]); 40 43 // Replace the POSTED content <img> with correct uploaded ones. … … 42 45 } 43 46 } 44 47 45 48 break; 46 49 47 50 case "video": 48 51 if($_REQUEST['embed_code']) 49 52 $content .= $_REQUEST['embed_code']."\n\n"; 50 53 $content .= $_REQUEST['content']; 51 break; 54 break; 52 55 } 53 #set the post_content54 $quick['post_content'] = str_replace('<br />', "\n", preg_replace('/<\/?p>/','',$content));55 56 #error handling for $post56 // set the post_content 57 $quick['post_content'] = $content; 58 59 // error handling for $post 57 60 if ( is_wp_error($post_ID)) { 58 61 wp_die($id); 59 62 wp_delete_post($post_ID); 60 #error handling for media_sideload63 // error handling for media_sideload 61 64 } elseif ( is_wp_error($upload)) { 62 65 wp_die($upload); 63 66 wp_delete_post($post_ID); 64 } else { 67 } else { 65 68 $quick['ID'] = $post_ID; 66 69 wp_update_post($quick); … … 69 72 } 70 73 71 #For submitted posts.74 // For submitted posts. 72 75 if ( 'post' == $_REQUEST['action'] ) { 73 76 check_admin_referer('press-this'); $post_ID = press_it(); ?> 74 75 77 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 76 78 <html xmlns="http://www.w3.org/1999/xhtml" <?php do_action('admin_xml_ns'); ?> <?php language_attributes(); ?>> … … 81 83 add_thickbox(); 82 84 wp_enqueue_style('press-this'); 85 wp_enqueue_style('press-this-ie'); 83 86 wp_enqueue_style( 'colors' ); 84 87 wp_enqueue_script('post'); … … 90 93 </head> 91 94 <body class="press-this"> 92 93 95 <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&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> 94 95 96 <div id="footer"> 96 97 <p><?php … … 101 102 </div> 102 103 <?php do_action('admin_footer', ''); ?> 103 104 104 </body> 105 105 </html> … … 107 107 } 108 108 109 110 function aposfix($text) {111 $translation_table[chr(34)] = '"';112 $translation_table[chr(38)] = '&';113 $translation_table[chr(39)] = ''';114 return preg_replace("/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/","&" , strtr($text, $translation_table));115 }116 117 109 // Ajax Requests 118 110 $title = wp_specialchars(aposfix(stripslashes($_GET['t']))); 119 111 120 $selection = str_replace("\n", "<br />", aposfix( stripslashes($_GET['s']) ) ); 112 $selection = trim( aposfix( stripslashes($_GET['s']) ) ); 113 if ( ! empty($selection) ) { 114 $selection = preg_replace('/(\r?\n|\r)/', '</p><p>', $selection); 115 $selection = '<p>'.str_replace('<p></p>', '', $selection).'</p>'; 116 } 117 121 118 $url = clean_url($_GET['u']); 122 119 $image = $_GET['i']; … … 127 124 tb_remove(); 128 125 }); 129 126 130 127 jQuery('.select').click(function() { 131 128 image_selector(); … … 136 133 <input id="this_photo_description" name="photo_description" class="text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo attribute_escape($title);?>"/> 137 134 </div> 138 139 <p ><input type="hidden" name="this_photo" value="<?php echo attribute_escape($image); ?>" id="this_photo" />140 <a href="#" class="select"><img src="<?php echo clean_url($image); ?>" width="475"alt="<?php echo attribute_escape(__('Click to insert.')); ?>" title="<?php echo attribute_escape(__('Click to insert.')); ?>" /></a></p>141 142 <p id="options"><a href="#" class="select "><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p>135 136 <p class="centered"><input type="hidden" name="this_photo" value="<?php echo attribute_escape($image); ?>" id="this_photo" /> 137 <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> 138 139 <p id="options"><a href="#" class="select button"><?php _e('Insert Image'); ?></a> <a href="#" class="cancel button"><?php _e('Cancel'); ?></a></p> 143 140 <?php die; 144 141 } … … 149 146 tb_remove(); 150 147 }); 151 148 152 149 jQuery('.select').click(function() { 153 150 image_selector(); … … 158 155 <input id="this_photo" name="this_photo" class="text" onkeypress="if(event.keyCode==13) image_selector();" /> 159 156 </div> 160 161 157 158 162 159 <h3 id="title"><label for="post_title"><?php _e('Description') ?></label></h3> 163 160 <div class="titlewrap"> 164 161 <input id="this_photo_description" name="photo_description" class="text" onkeypress="if(event.keyCode==13) image_selector();" value="<?php echo attribute_escape($title);?>"/> 165 162 </div> 166 163 167 164 <p id="options"><a href="#" class="select"><?php _e('Insert Image'); ?></a> | <a href="#" class="cancel"><?php _e('Cancel'); ?></a></p> 168 165 <?php die; … … 179 176 if($_REQUEST['ajax'] == 'photo_images') { 180 177 function get_images_from_uri($uri) { 181 if( preg_match('/\.(jpg|jpe|jpeg|png|gif)/', $uri) && !strpos($uri,'blogger.com'))178 if( preg_match('/\.(jpg|jpe|jpeg|png|gif)/', $uri) && !strpos($uri,'blogger.com') ) 182 179 return "'".$uri."'"; 183 180 184 181 $content = wp_remote_fopen($uri); 185 182 if ( false === $content ) return ''; 186 183 187 184 $host = parse_url($uri); 188 189 $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif) )(\2)([^>\/]*)\/*>/is';185 186 $pattern = '/<img ([^>]*)src=(\"|\')([^<>]+?\.(png|jpeg|jpg|jpe|gif)[^<>\'\"]*)(\2)([^>\/]*)\/*>/is'; 190 187 preg_match_all($pattern, $content, $matches); 191 188 192 189 if ( empty($matches[1]) ) return ''; 193 190 194 191 $sources = array(); 195 192 foreach ($matches[3] as $src) { … … 199 196 else 200 197 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$host['path'].'/'.$src); 201 198 202 199 $sources[] = clean_url($src); 203 200 } 204 201 return "'" . implode("','", $sources) . "'"; 205 202 } 206 203 207 204 $url = urldecode($url); 208 205 $url = str_replace(' ', '%20', $url); 209 206 echo 'new Array('.get_images_from_uri($url).')'; 210 die; 207 die; 211 208 } 212 209 213 210 if($_REQUEST['ajax'] == 'photo_js') { ?> 214 215 216 211 // gather images and load some default JS 217 218 212 var last = null 219 213 var img, img_tag, aspect, w, h, skip, i, strtoappend = ""; … … 228 222 }).responseText 229 223 ); 230 224 231 225 for (i = 0; i < my_src.length; i++) { 232 226 img = new Image(); … … 239 233 aspect = img.width / img.height; 240 234 scale = (aspect > 1) ? (75 / img.width) : (75 / img.height); 241 235 242 236 w = img.width; 243 237 h = img.height; 244 238 245 239 if (scale < 1) { 246 240 w = parseInt(img.width * scale); … … 251 245 if (!skip) strtoappend += '<a href="?ajax=thickbox&i=' + img.src + '&u=<?php echo $url; ?>&height=400&width=500" title="" class="thickbox"><img src="' + img.src + '" ' + img_attr + '/></a>'; 252 246 } 253 247 254 248 function pick(img, desc) { 255 249 if (img) { … … 258 252 jQuery('.photolist').append('<input name="photo_src[' + length + ']" value="' + img +'" type="hidden"/>'); 259 253 jQuery('.photolist').append('<input name="photo_description[' + length + ']" value="' + desc +'" type="hidden"/>'); 260 append_editor( '<img src="' + img +'" alt="' + desc + '" />');254 append_editor("\n\n" + '<p><img src="' + img +'" alt="' + desc + '" /></p>'); 261 255 } 262 256 tinyMCE.activeEditor.resizeToContent(); 263 257 return false; 264 258 } 265 259 266 260 function image_selector() { 267 261 tb_remove(); … … 271 265 return false; 272 266 } 273 267 274 268 jQuery(document).ready(function() { 275 269 jQuery('#img_container').html(strtoappend); … … 277 271 tb_init('a.thickbox, area.thickbox, input.thickbox'); 278 272 }); 279 280 <?php die; } 273 274 <?php die; 275 } 281 276 282 277 if($_REQUEST['ajax'] == 'photo') { ?> … … 288 283 <div id="img_container"></div> 289 284 </div> 290 <?php die; } 285 <?php die; 286 } 291 287 ?> 292 288 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> … … 299 295 add_thickbox(); 300 296 wp_enqueue_style('press-this'); 297 wp_enqueue_style('press-this-ie'); 301 298 wp_enqueue_style( 'colors' ); 302 299 wp_enqueue_script( 'post' ); 300 wp_enqueue_script('editor_functions'); 303 301 304 302 wp_teeny_mce(); … … 314 312 // add the quickadd form 315 313 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>'); 316 314 317 315 jQuery('#tagadd').click( tag_flush_to_text ); 318 316 jQuery('#newtag').focus(function() { … … 328 326 jQuery('#publish').click( tag_save_on_publish ); 329 327 jQuery('#save-post').click( tag_save_on_publish ); 330 328 331 329 function set_menu(type) { 332 330 jQuery('#text_button').removeClass('ui-tabs-selected'); … … 335 333 jQuery("#post_type").val(type); 336 334 } 337 335 338 336 function set_editor(text) { 339 340 if(tinyMCE.activeEditor) tinyMCE.activeEditor.setContent(''); 341 if(tinyMCE.activeEditor) tinyMCE.execCommand('mceInsertContent' ,false, text); 342 } 343 337 if ( '' == text || '<p></p>' == text ) text = '<p><br /></p>'; 338 if ( tinyMCE.activeEditor ) tinyMCE.execCommand('mceSetContent', false, text); 339 } 340 344 341 function append_editor(text) { 345 if (tinyMCE.activeEditor) tinyMCE.execCommand('mceInsertContent' ,false, text);346 } 347 342 if ( '' != text && tinyMCE.activeEditor ) tinyMCE.execCommand('mceInsertContent', false, text); 343 } 344 348 345 function set_title(title) { jQuery("#content_type").text(title); } 349 346 … … 355 352 set_menu('text'); 356 353 set_title('<?php _e('Post') ?>'); 354 <?php if ($selection) { ?> 355 set_editor('<?php echo $selection; ?><p><a href="<?php echo $url ?>"><?php echo $title; ?></a>.</p>'); 356 <?php } else { ?> 357 set_editor('<p><a href="<?php echo $url ?>"><?php echo $title; ?></a></p>'); 358 <?php } ?> 357 359 return false; 358 360 break; … … 360 362 set_menu('quote'); 361 363 set_title('<?php _e('Quote') ?>'); 362 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>");364 set_editor('<blockquote><?php echo $selection; ?> <p><cite><a href="<?php echo $url; ?>"><?php echo $title; ?> </a> </cite> </p></blockquote>'); 363 365 return false; 364 366 break; … … 366 368 set_menu('video'); 367 369 set_title('<?php _e('Caption') ?>'); 368 369 370 jQuery('#extra_fields').show(); 370 371 jQuery('body').addClass('video_split'); 371 372 jQuery('#extra_fields').load('<?php echo clean_url($_SERVER['PHP_SELF']); ?>', { ajax: 'video', s: '<?php echo attribute_escape($selection); ?>'}, function() { 372 373 <?php 374 $content = ''; 373 375 if ( preg_match("/youtube\.com\/watch/i", $url) ) { 374 list($domain, $video_id) = split("v=", $url);375 $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>'; ?>376 377 <?php} elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) {378 379 list($domain, $video_id) = split(".com/", $url);380 $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 . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /> <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>'; 381 382 if ( trim($selection) == '' )383 $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>'; 384 } else {376 list($domain, $video_id) = split("v=", $url); 377 $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>'; 378 379 } elseif ( preg_match("/vimeo\.com\/[0-9]+/i", $url) ) { 380 list($domain, $video_id) = split(".com/", $url); 381 $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 . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" /> <embed src="http://www.vimeo.com/moogaloop.swf?clip_id=' . $video_id . '&server=www.vimeo.com&show_title=1&show_byline=1&show_portrait=0&color=&fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="225"></embed></object>'; 382 383 if ( trim($selection) == '' ) 384 $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>'; 385 386 } elseif ( strpos( $selection, '<object' ) !== false ) { 385 387 $content = $selection; 386 } ?> 388 } 389 ?> 387 390 jQuery('#embed_code').prepend('<?php echo htmlentities($content); ?>'); 388 389 set_editor( "<?php echo $title; ?>");391 392 set_editor('<a href="<?php echo $url ?>"><?php echo $title; ?></a>.'); 390 393 }); 391 394 return false; … … 395 398 set_title('<?php _e('Post') ?>'); 396 399 <?php if ($selection) { ?> 397 set_editor("<?php echo format_to_edit($selection); ?>"); 400 set_editor('<?php echo $selection; ?><p><a href="<?php echo $url ?>"><?php echo $title; ?></a></p>'); 401 <?php } else { ?> 402 set_editor('<p><a href="<?php echo $url ?>"><?php echo $title; ?></a></p>'); 398 403 <?php } ?> 399 404 jQuery('#extra_fields').show(); … … 414 419 } 415 420 } 416 421 417 422 jQuery(document).ready(function() { 418 423 jQuery('#menu li').click(function (){ … … 421 426 show(tab_name); 422 427 }); 423 424 428 // Set default tabs 425 429 <?php if ( preg_match("/youtube\.com\/watch/i", $url) ) { ?> … … 431 435 <?php } ?> 432 436 }); 433 437 434 438 </script> 435 439 </head> … … 454 458 <input name="post_title" id="post_title" class="text" value="<?php echo attribute_escape($title);?>"/> 455 459 </div> 456 460 457 461 <div id="extra_fields" style="display: none"></div> 458 462 459 463 <div class="editor_area"> 460 464 <h2 id="content_type"><label for="content"><?php _e('Post') ?></label></h2> 461 465 <div class="editor-container"> 462 <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>466 <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> 463 467 </div> 464 468 </div> 465 469 </div> 466 470 467 471 <div id="categories"> 468 472 <div class="submitbox" id="submitpost"> 469 <div id="previewview"></div> 470 <div class="inside"> 471 <h2><?php _e('Categories') ?></h2> 472 <div id="categories-all"> 473 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> 474 <?php wp_category_checklist() ?> 475 </ul> 473 <div id="previewview"></div> 474 <div class="inside"> 475 <h2><?php _e('Categories') ?></h2> 476 <div id="categories-all"> 477 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> 478 <?php wp_category_checklist() ?> 479 </ul> 480 </div> 481 482 <h2><?php _e('Tags') ?></h2> 483 <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> 484 <div id="tagchecklist"></div> 476 485 </div> 477 <h2><?php _e('Tags') ?></h2> 478 <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> 479 <div id="tagchecklist"></div> 486 487 <p class="submit"> 488 <input type="submit" name="draft" value="<?php _e('Save') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/> 489 <input type="submit" name="publish" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/> 490 <img src="images/loading-publish.gif" alt="" id="photo_saving" style="display:none;"/> 491 </p> 480 492 </div> 481 <div id="post_status">482 <input type="radio" name="post_status" value="publish" checked="checked" id="published" /> <label for="published"><?php _e('Published'); ?></label>483 <input type="radio" name="post_status" value="draft" id="unpublished" /> <label for="unpublished"><?php _e('Unpublished'); ?></label>484 </div>485 <p class="submit">486 <input type="submit" value="<?php _e('Publish') ?>" onclick="document.getElementById('photo_saving').style.display = '';"/>487 <img src="images/loading-publish.gif" alt="" id="photo_saving" style="display:none;"/>488 </p>489 493 </div> 490 494 </form> -
branches/crazyhorse/wp-admin/revision.php
r8242 r8335 47 47 if ( $left_revision->ID == $right_revision->ID ) { 48 48 $redirect = get_edit_post_link( $left_revision->ID ); 49 include( 'js/revisions-js.php' ); 49 50 break; 50 51 } -
branches/crazyhorse/wp-admin/rtl.css
r8116 r8335 5 5 } 6 6 7 body, td { 8 font-family: Tahoma,Verdana,sans-serif; 7 body, td, .submit input, .button, .button-secondary, .button-highlighted, #your-profile legend, .quicktags, .search, #wpcontent select, #wphead #viewsite a, #wphead h1 { 8 font-family: sans-serif !important; 9 } 10 11 .code, #quicktags #ed_code { 12 font-family: monospace !important; 9 13 } 10 14 … … 66 70 display:block; 67 71 float:right; 68 font:700 16px/100% "Times New Roman", Times,serif;72 font:700 16px/100% sans-serif; 69 73 margin:0 0 0 10px; 70 74 padding:5px 7px 9px … … 79 83 { 80 84 background:url(images/comment-stalk-rtl.gif) -309px bottom !important; 81 font-family: Tahoma, Verdana, sans-serif;85 font-family: sans-serif !important; 82 86 margin-left:-45px; 83 87 margin-right:.2em; -
branches/crazyhorse/wp-admin/setup-config.php
r8242 r8335 63 63 <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’re all ready…</p> 64 64 65 <p ><a href="setup-config.php?step=1" class="button">Let’s go!</a></p>65 <p class="step"><a href="setup-config.php?step=1" class="button">Let’s go!</a></p> 66 66 <?php 67 67 break; … … 99 99 </tr> 100 100 </table> 101 <h2 class="step"> 102 <input name="submit" type="submit" value="Submit" class="button" /> 103 </h2> 101 <p class="step"><input name="submit" type="submit" value="Submit" class="button" /></p> 104 102 </form> 105 103 <?php … … 155 153 <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…</p> 156 154 157 <p ><a href="install.php" class="button">Run the install</a></p>155 <p class="step"><a href="install.php" class="button">Run the install</a></p> 158 156 <?php 159 157 break; -
branches/crazyhorse/wp-admin/upgrade.php
r7979 r8335 26 26 <h2><?php _e('No Upgrade Required'); ?></h2> 27 27 <p><?php _e('Your WordPress database is already up-to-date!'); ?></p> 28 < h2 class="step"><a href="<?php echo get_option('home'); ?>/"><?php _e('Continue'); ?></a></h2>28 <p class="step"><a class="button" href="<?php echo get_option('home'); ?>/"><?php _e('Continue'); ?></a></p> 29 29 30 30 <?php else : … … 38 38 <p><?php _e('Your WordPress database is out-of-date, and must be upgraded before you can continue.'); ?></p> 39 39 <p><?php _e('The upgrade process may take a while, so please be patient.'); ?></p> 40 < h2 class="step"><a href="upgrade.php?step=1&backto=<?php echo $goback; ?>"><?php _e('Upgrade WordPress'); ?></a></h2>40 <p class="step"><a class="button" href="upgrade.php?step=1&backto=<?php echo $goback; ?>"><?php _e('Upgrade WordPress'); ?></a></p> 41 41 <?php 42 42 break; … … 53 53 <h2><?php _e('Upgrade Complete'); ?></h2> 54 54 <p><?php _e('Your WordPress database has been successfully upgraded!'); ?></p> 55 < h2 class="step"><a href="<?php echo $backto; ?>"><?php _e('Continue'); ?></a></h2>55 <p class="step"><a class="button" href="<?php echo $backto; ?>"><?php _e('Continue'); ?></a></p> 56 56 57 57 <!-- -
branches/crazyhorse/wp-admin/wp-admin.css
r8329 r8335 725 725 } 726 726 727 #adminmenu li a #awaiting-mod {727 #adminmenu li a #awaiting-mod, #sidemenu li a #update-plugins { 728 728 position: absolute; 729 729 margin-top: 0.2em; … … 735 735 } 736 736 737 #adminmenu li a .count-0 {737 #adminmenu li a .count-0, #sidemenu li a .count-0 { 738 738 display: none; 739 739 } … … 775 775 } 776 776 777 #adminmenu li a:hover #awaiting-mod {777 #adminmenu li a:hover #awaiting-mod, #sidemenu li a:hover #update-plugins { 778 778 background-position: -80px bottom; 779 779 } 780 780 781 #adminmenu li a #awaiting-mod span {781 #adminmenu li a #awaiting-mod span, #sidemenu li a #update-plugins span { 782 782 top: -0.8em; 783 783 right: 0; -
branches/crazyhorse/wp-app.php
r8242 r8335 198 198 // check to see if AtomPub is enabled 199 199 if( !get_option( 'enable_app' ) ) 200 $this-> not_allowed( sprintf( __( 'AtomPub services are disabled on this blog. An admin user can enable them at %s' ), admin_url('options-writing.php') ) );200 $this->forbidden( sprintf( __( 'AtomPub services are disabled on this blog. An admin user can enable them at %s' ), admin_url('options-writing.php') ) ); 201 201 202 202 // dispatch … … 940 940 } 941 941 942 function forbidden($reason='') { 943 log_app('Status','403: Forbidden'); 944 header('Content-Type: text/plain'); 945 status_header('403'); 946 echo $reason; 947 exit; 948 } 949 942 950 function not_found() { 943 951 log_app('Status','404: Not Found'); -
branches/crazyhorse/wp-config-sample.php
r7971 r8335 8 8 define('DB_COLLATE', ''); 9 9 10 // Change SECRET_KEY to a unique phrase. You won't have to remember it later, 11 // so make it long and complicated. You can visit http://api.wordpress.org/secret-key/1.0/ 12 // to get a secret key generated for you, or just make something up. 13 define('SECRET_KEY', 'put your unique phrase here'); // Change this to a unique phrase. 10 // Change each KEY to a different unique phrase. You won't have to remember the phrases later, 11 // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/ 12 // to get keys generated for you, or just make something up. Each key should have a different phrase. 13 define('AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. 14 define('SECURE_AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. 15 define('LOGGED_IN_KEY', 'put your unique phrase here'); // Change this to a unique phrase. 14 16 15 17 // You can have multiple installations in one database if you give each a unique prefix -
branches/crazyhorse/wp-content/themes/classic/style.css
r8242 r8335 323 323 /* Captions & aligment */ 324 324 .aligncenter, 325 d l.aligncenter {325 div.aligncenter { 326 326 display: block; 327 327 margin-left: auto; … … 337 337 } 338 338 339 .wp _caption {339 .wp-caption { 340 340 border: 1px solid #ddd; 341 341 text-align: center; … … 349 349 } 350 350 351 .wp _caption img {351 .wp-caption img { 352 352 margin: 0; 353 353 padding: 0; … … 355 355 } 356 356 357 .wp _caption_dd{357 .wp-caption p.wp-caption-text { 358 358 font-size: 11px; 359 359 line-height: 17px; -
branches/crazyhorse/wp-content/themes/default/style.css
r8242 r8335 291 291 292 292 .postmetadata { 293 clear: left;293 clear: both; 294 294 } 295 295 … … 641 641 /* Captions */ 642 642 .aligncenter, 643 d l.aligncenter {643 div.aligncenter { 644 644 display: block; 645 645 margin-left: auto; … … 647 647 } 648 648 649 .wp _caption {649 .wp-caption { 650 650 border: 1px solid #ddd; 651 651 text-align: center; … … 659 659 } 660 660 661 .wp _caption img {661 .wp-caption img { 662 662 margin: 0; 663 663 padding: 0; … … 665 665 } 666 666 667 .wp _caption_dd{667 .wp-caption p.wp-caption-text { 668 668 font-size: 11px; 669 669 line-height: 17px; -
branches/crazyhorse/wp-includes/category-template.php
r8151 r8335 1 1 <?php 2 2 3 function get_category_children($id, $before = '/', $after = '' ) {3 function get_category_children($id, $before = '/', $after = '', $visited=array()) { 4 4 if ( 0 == $id ) 5 5 return ''; … … 15 15 if ( is_wp_error( $category ) ) 16 16 return $category; 17 if ( $category->parent == $id ) { 17 if ( $category->parent == $id && !in_array($category->term_id, $visited) ) { 18 $visited[] = $category->term_id; 18 19 $chain .= $before.$category->term_id.$after; 19 20 $chain .= get_category_children($category->term_id, $before, $after); … … 45 46 } 46 47 47 function get_category_parents($id, $link = FALSE, $separator = '/', $nicename = FALSE ){48 function get_category_parents($id, $link = FALSE, $separator = '/', $nicename = FALSE, $visited = array()){ 48 49 $chain = ''; 49 50 $parent = &get_category($id); … … 56 57 $name = $parent->cat_name; 57 58 58 if ( $parent->parent && ($parent->parent != $parent->term_id) ) 59 $chain .= get_category_parents($parent->parent, $link, $separator, $nicename); 59 if ( $parent->parent && ($parent->parent != $parent->term_id) && !in_array($parent->parent, $visited) ) { 60 $visited[] = $parent->parent; 61 $chain .= get_category_parents($parent->parent, $link, $separator, $nicename, $visited); 62 } 60 63 61 64 if ( $link ) … … 416 419 $tag_id = $tag_ids[$tag]; 417 420 $tag_link = clean_url($tag_links[$tag]); 418 $tag = str_replace(' ', ' ', wp_specialchars( $tag ));419 421 $a[] = "<a href='$tag_link' class='tag-link-$tag_id' title='" . attribute_escape( sprintf( __ngettext('%d topic','%d topics',$count), $count ) ) . "'$rel style='font-size: " . 420 422 ( $smallest + ( ( $count - $min_count ) * $font_step ) ) -
branches/crazyhorse/wp-includes/class.wp-scripts.php
r7976 r8335 51 51 52 52 $src = $this->registered[$handle]->src; 53 if ( !preg_match('|^https?://|', $src) ) {53 if ( !preg_match('|^https?://|', $src) && !preg_match('|^' . preg_quote(WP_CONTENT_URL) . '|', $src) ) { 54 54 $src = $this->base_url . $src; 55 55 } -
branches/crazyhorse/wp-includes/class.wp-styles.php
r7976 r8335 60 60 61 61 function _css_href( $src, $ver, $handle ) { 62 if ( !preg_match('|^https?://|', $src) ) {62 if ( !preg_match('|^https?://|', $src) && !preg_match('|^' . preg_quote(WP_CONTENT_URL) . '|', $src) ) { 63 63 $src = $this->base_url . $src; 64 64 } -
branches/crazyhorse/wp-includes/classes.php
r8151 r8335 92 92 $request_match = $request; 93 93 foreach ($rewrite as $match => $query) { 94 // Don't try to match against AtomPub calls 95 if ( $req_uri == 'wp-app.php' ) 96 break; 97 94 98 // If the requesting file is the anchor of the match, prepend it 95 99 // to the path info. -
branches/crazyhorse/wp-includes/deprecated.php
r7130 r8335 1065 1065 * @author Dougal 1066 1066 * @since 1.0.1 1067 * @deprecated Use get_categories()1068 * @see get_categories()1067 * @deprecated Use wp_list_bookmarks() 1068 * @see wp_list_bookmarks() 1069 1069 * 1070 1070 * @param string $order Sort link categories by 'name' or 'id' … … 1072 1072 */ 1073 1073 function get_links_list($order = 'name', $deprecated = '') { 1074 _deprecated_function(__FUNCTION__, '0.0', ' get_categories()');1074 _deprecated_function(__FUNCTION__, '0.0', 'wp_list_bookmarks()'); 1075 1075 1076 1076 $order = strtolower($order); -
branches/crazyhorse/wp-includes/feed.php
r7244 r8335 1 1 <?php 2 2 /** 3 * WordPress Feed API 4 * 5 * Many of the functions used in here belong in The Loop, or The Loop for the 6 * Feeds. 7 * 8 * @package WordPress 9 * @subpackage Feed 10 */ 11 12 /** 13 * RSS container for the bloginfo function. 14 * 15 * You can retrieve anything that you can using the get_bloginfo() function. 16 * Everything will be stripped of tags and characters converted, when the values 17 * are retrieved for use in the feeds. 18 * 19 * @package WordPress 20 * @subpackage Feed 21 * @since 1.5.1 22 * @uses apply_filters() Calls 'get_bloginfo_rss' hook with two parameters. 23 * @see get_bloginfo() For the list of possible values to display. 24 * 25 * @param string $show See get_bloginfo() for possible values. 26 * @return string 27 */ 3 28 function get_bloginfo_rss($show = '') { 4 29 $info = strip_tags(get_bloginfo($show)); … … 6 31 } 7 32 33 /** 34 * Display RSS container for the bloginfo function. 35 * 36 * You can retrieve anything that you can using the get_bloginfo() function. 37 * Everything will be stripped of tags and characters converted, when the values 38 * are retrieved for use in the feeds. 39 * 40 * @package WordPress 41 * @subpackage Feed 42 * @since 0.71 43 * @uses apply_filters() Calls 'bloginfo_rss' hook with two parameters. 44 * @see get_bloginfo() For the list of possible values to display. 45 * 46 * @param string $show See get_bloginfo() for possible values. 47 */ 8 48 function bloginfo_rss($show = '') { 9 49 echo apply_filters('bloginfo_rss', get_bloginfo_rss($show), $show); 10 50 } 11 51 52 /** 53 * Retrieve the default feed. 54 * 55 * The default feed is 'rss2', unless a plugin changes it through the 56 * 'default_feed' filter. 57 * 58 * @package WordPress 59 * @subpackage Feed 60 * @since 2.5 61 * @uses apply_filters() Calls 'default_feed' hook on the default feed string. 62 * 63 * @return string Default feed, or for example 'rss2', 'atom', etc. 64 */ 12 65 function get_default_feed() { 13 66 return apply_filters('default_feed', 'rss2'); 14 67 } 15 68 69 /** 70 * Retrieve the blog title for the feed title. 71 * 72 * @package WordPress 73 * @subpackage Feed 74 * @since 2.2.0 75 * @uses apply_filters() Calls 'get_wp_title_rss' hook on title. 76 * @uses wp_title() See function for $sep parameter usage. 77 * 78 * @param string $sep Optional.How to separate the title. See wp_title() for more info. 79 * @return string Error message on failure or blog title on success. 80 */ 16 81 function get_wp_title_rss($sep = '»') { 17 82 $title = wp_title($sep, false); … … 22 87 } 23 88 89 /** 90 * Display the blog title for display of the feed title. 91 * 92 * @package WordPress 93 * @subpackage Feed 94 * @since 2.2.0 95 * @uses apply_filters() Calls 'wp_title_rss' on the blog title. 96 * @see wp_title() $sep parameter usage. 97 * 98 * @param string $sep Optional. 99 */ 24 100 function wp_title_rss($sep = '»') { 25 101 echo apply_filters('wp_title_rss', get_wp_title_rss($sep)); 26 102 } 27 103 104 /** 105 * Retrieve the current post title for the feed. 106 * 107 * @package WordPress 108 * @subpackage Feed 109 * @since 2.0.0 110 * @uses apply_filters() Calls 'the_title_rss' on the post title. 111 * 112 * @return string Current post title. 113 */ 28 114 function get_the_title_rss() { 29 115 $title = get_the_title(); … … 32 118 } 33 119 34 120 /** 121 * Display the post title in the feed. 122 * 123 * @package WordPress 124 * @subpackage Feed 125 * @since 0.71 126 * @uses get_the_title_rss() Used to retrieve current post title. 127 */ 35 128 function the_title_rss() { 36 129 echo get_the_title_rss(); 37 130 } 38 131 39 132 /** 133 * Display the post content for the feed. 134 * 135 * For encoding the html or the $encode_html parameter, there are three possible 136 * values. '0' will make urls footnotes and use make_url_footnote(). '1' will 137 * encode special characters and automatically display all of the content. The 138 * value of '2' will strip all HTML tags from the content. 139 * 140 * Also note that you cannot set the amount of words and not set the html 141 * encoding. If that is the case, then the html encoding will default to 2, 142 * which will strip all HTML tags. 143 * 144 * To restrict the amount of words of the content, you can use the cut 145 * parameter. If the content is less than the amount, then there won't be any 146 * dots added to the end. If there is content left over, then dots will be added 147 * and the rest of the content will be removed. 148 * 149 * @package WordPress 150 * @subpackage Feed 151 * @since 0.71 152 * @uses apply_filters() Calls 'the_content_rss' on the content before processing. 153 * @see get_the_content() For the $more_link_text, $stripteaser, and $more_file 154 * parameters. 155 * 156 * @param string $more_link_text Optional. Text to display when more content is available but not displayed. 157 * @param int|bool $stripteaser Optional. Default is 0. 158 * @param string $more_file Optional. 159 * @param int $cut Optional. Amount of words to keep for the content. 160 * @param int $encode_html Optional. How to encode the content. 161 */ 40 162 function the_content_rss($more_link_text='(more...)', $stripteaser=0, $more_file='', $cut = 0, $encode_html = 0) { 41 163 $content = get_the_content($more_link_text, $stripteaser, $more_file); … … 60 182 $use_dotdotdot = 0; 61 183 } 184 185 /** @todo Check performance, might be faster to use array slice instead. */ 62 186 for ( $i=0; $i<$k; $i++ ) 63 187 $excerpt .= $blah[$i].' '; … … 69 193 } 70 194 71 195 /** 196 * Display the post excerpt for the feed. 197 * 198 * @package WordPress 199 * @subpackage Feed 200 * @since 0.71 201 * @uses apply_filters() Calls 'the_excerpt_rss' hook on the excerpt. 202 */ 72 203 function the_excerpt_rss() { 73 204 $output = get_the_excerpt(); … … 75 206 } 76 207 208 /** 209 * Display the permalink to the post for use in feeds. 210 * 211 * @package WordPress 212 * @subpackage Feed 213 * @since 2.3.0 214 * @uses apply_filters() Call 'the_permalink_rss' on the post permalink 215 */ 77 216 function the_permalink_rss() { 78 217 echo apply_filters('the_permalink_rss', get_permalink()); 79 80 } 81 218 } 219 220 /** 221 * Display the feed GUID for the current comment. 222 * 223 * @package WordPress 224 * @subpackage Feed 225 * @since unknown 226 */ 82 227 function comment_guid() { 83 228 echo get_comment_guid(); 84 229 } 85 230 231 /** 232 * Retrieve the feed GUID for the current comment. 233 * 234 * @package WordPress 235 * @subpackage Feed 236 * @since unknown 237 * 238 * @return bool|string false on failure or guid for comment on success. 239 */ 86 240 function get_comment_guid() { 87 241 global $comment; … … 93 247 } 94 248 249 /** 250 * Display the link to the comments. 251 * 252 * @since 1.5.0 253 */ 95 254 function comment_link() { 96 255 echo get_comment_link(); 97 256 } 98 257 258 /** 259 * Retrieve the current comment author for use in the feeds. 260 * 261 * @package WordPress 262 * @subpackage Feed 263 * @since 2.0.0 264 * @uses apply_filters() Calls 'comment_author_rss' hook on comment author. 265 * @uses get_comment_author() 266 * 267 * @return string Comment Author 268 */ 99 269 function get_comment_author_rss() { 100 270 return apply_filters('comment_author_rss', get_comment_author() ); 101 271 } 102 272 273 /** 274 * Display the current comment author in the feed. 275 * 276 * @package WordPress 277 * @subpackage Feed 278 * @since 1.0.0 279 */ 103 280 function comment_author_rss() { 104 281 echo get_comment_author_rss(); 105 282 } 106 283 284 /** 285 * Display the current comment content for use in the feeds. 286 * 287 * @package WordPress 288 * @subpackage Feed 289 * @since 1.0.0 290 * @uses apply_filters() Calls 'comment_text_rss' filter on comment content. 291 * @uses get_comment_text() 292 */ 107 293 function comment_text_rss() { 108 294 $comment_text = get_comment_text(); … … 111 297 } 112 298 299 /** 300 * Retrieve all of the post categories, formatted for use in feeds. 301 * 302 * All of the categories for the current post in the feed loop, will be 303 * retrieved and have feed markup added, so that they can easily be added to the 304 * RSS2, Atom, or RSS1 and RSS0.91 RDF feeds. 305 * 306 * @package WordPress 307 * @subpackage Feed 308 * @since 2.1.0 309 * @uses apply_filters() 310 * 311 * @param string $type Optional, default is 'rss'. Either 'rss', 'atom', or 'rdf'. 312 * @return string All of the post categories for displaying in the feed. 313 */ 113 314 function get_the_category_rss($type = 'rss') { 114 315 $categories = get_the_category(); … … 143 344 } 144 345 346 /** 347 * Display the post categories in the feed. 348 * 349 * @package WordPress 350 * @subpackage Feed 351 * @since 0.71 352 * @see get_the_category_rss() For better explanation. 353 * 354 * @param string $type Optional, default is 'rss'. Either 'rss', 'atom', or 'rdf'. 355 */ 145 356 function the_category_rss($type = 'rss') { 146 357 echo get_the_category_rss($type); 147 358 } 148 359 360 /** 361 * Display the HTML type based on the blog setting. 362 * 363 * The two possible values are either 'xhtml' or 'html'. 364 * 365 * @package WordPress 366 * @subpackage Feed 367 * @since 2.2.0 368 */ 149 369 function html_type_rss() { 150 370 $type = get_bloginfo('html_type'); … … 156 376 } 157 377 158 378 /** 379 * Display the rss enclosure for the current post. 380 * 381 * Uses the global $post to check whether the post requires a password and if 382 * the user has the password for the post. If not then it will return before 383 * displaying. 384 * 385 * Also uses the function get_post_custom() to get the post's 'enclosure' 386 * metadata field and parses the value to display the enclosure(s). The 387 * enclosure(s) consist of enclosure HTML tag(s) with a URI and other 388 * attributes. 389 * 390 * @package WordPress 391 * @subpackage Template 392 * @since 1.5.0 393 * @uses apply_filters() Calls 'rss_enclosure' hook on rss enclosure. 394 * @uses get_post_custom() To get the current post enclosure metadata. 395 */ 159 396 function rss_enclosure() { 160 397 global $post; … … 172 409 } 173 410 411 /** 412 * Display the atom enclosure for the current post. 413 * 414 * Uses the global $post to check whether the post requires a password and if 415 * the user has the password for the post. If not then it will return before 416 * displaying. 417 * 418 * Also uses the function get_post_custom() to get the post's 'enclosure' 419 * metadata field and parses the value to display the enclosure(s). The 420 * enclosure(s) consist of link HTML tag(s) with a URI and other attributes. 421 * 422 * @package WordPress 423 * @subpackage Template 424 * @since 2.2.0 425 * @uses apply_filters() Calls 'atom_enclosure' hook on atom enclosure. 426 * @uses get_post_custom() To get the current post enclosure metadata. 427 */ 174 428 function atom_enclosure() { 175 429 global $post; … … 188 442 189 443 /** 190 * prep_atom_text_construct() - Determine the type of a given string of data444 * Determine the type of a string of data with the data formatted. 191 445 * 192 446 * Tell whether the type is text, html, or xhtml, per RFC 4287 section 3.1. … … 203 457 * @since 2.5 204 458 * 205 * @param string $data input string206 * @return array $resultarray(type, value)459 * @param string $data Input string 460 * @return array array(type, value) 207 461 */ 208 462 function prep_atom_text_construct($data) { … … 233 487 234 488 /** 235 * self_link() - Generate a correct link for the atom:self elemet236 * 237 * Echo the link for the currently displayed feed in a XSS safe way.489 * Display the link for the currently displayed feed in a XSS safe way. 490 * 491 * Generate a correct link for the atom:self element. 238 492 * 239 493 * @package WordPress 240 494 * @subpackage Feed 241 495 * @since 2.5 242 *243 496 */ 244 497 function self_link() { -
branches/crazyhorse/wp-includes/formatting.php
r8103 r8335 4 4 global $wp_cockneyreplace; 5 5 $next = true; 6 $has_pre_parent = false; 6 7 $output = ''; 7 8 $curl = ''; … … 27 28 $curl = $textarr[$i]; 28 29 29 if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next ) { // If it's not a tag30 if (isset($curl{0}) && '<' != $curl{0} && '[' != $curl{0} && $next && !$has_pre_parent) { // If it's not a tag 30 31 // static strings 31 32 $curl = str_replace($static_characters, $static_replacements, $curl); 32 33 // regular expressions 33 34 $curl = preg_replace($dynamic_characters, $dynamic_replacements, $curl); 34 } elseif (strpos($curl, '<code') !== false || strpos($curl, '< pre') !== false || strpos($curl, '<kbd') !== false || strpos($curl, '<style') !== false || strpos($curl, '<script') !== false) {35 } elseif (strpos($curl, '<code') !== false || strpos($curl, '<kbd') !== false || strpos($curl, '<style') !== false || strpos($curl, '<script') !== false) { 35 36 $next = false; 37 } elseif (strpos($curl, '<pre') !== false) { 38 $has_pre_parent = true; 39 } elseif (strpos($curl, '</pre>') !== false) { 40 $has_pre_parent = false; 36 41 } else { 37 42 $next = true; … … 1125 1130 if ( empty($text) ) return apply_filters('richedit_pre', ''); 1126 1131 1127 $output = $text; 1128 $output = convert_chars($output); 1132 $output = convert_chars($text); 1129 1133 $output = wpautop($output); 1130 1131 // These must be double-escaped or planets will collide. 1132 $output = str_replace('<', '&lt;', $output); 1133 $output = str_replace('>', '&gt;', $output); 1134 1135 // These should be entities too 1136 $output = str_replace('<', '<', $output); 1137 $output = str_replace('>', '>', $output); 1138 1134 $output = htmlspecialchars($output, ENT_NOQUOTES); 1135 1139 1136 return apply_filters('richedit_pre', $output); 1140 1137 } -
branches/crazyhorse/wp-includes/functions.php
r8242 r8335 491 491 $newvalue = sanitize_option( $option_name, $newvalue ); 492 492 493 $oldvalue = get_option( $safe_option_name ); 494 495 $newvalue = apply_filters( 'pre_update_option_' . $option_name, $newvalue, $oldvalue ); 496 493 497 // If the new and old values are the same, no need to update. 494 $oldvalue = get_option( $safe_option_name );495 498 if ( $newvalue === $oldvalue ) 496 499 return false; … … 1493 1496 $url = trailingslashit( $siteurl ) . UPLOADS; 1494 1497 } 1495 1498 1499 $bdir = $dir; 1500 $burl = $url; 1501 1496 1502 $subdir = ''; 1497 1503 if ( get_option( 'uploads_use_yearmonth_folders' ) ) { … … 1513 1519 } 1514 1520 1515 $uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, ' error' => false );1521 $uploads = array( 'path' => $dir, 'url' => $url, 'subdir' => $subdir, 'basedir' => $bdir, 'baseurl' => $burl, 'error' => false ); 1516 1522 return apply_filters( 'upload_dir', $uploads ); 1517 1523 } … … 2254 2260 */ 2255 2261 function is_ssl() { 2256 return ( 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false;2262 return ( isset($_SERVER['HTTPS']) && 'on' == strtolower($_SERVER['HTTPS']) ) ? true : false; 2257 2263 } 2258 2264 -
branches/crazyhorse/wp-includes/js/tinymce/langs/wp-langs.php
r8242 r8335 396 396 wp_help_desc:"' . mce_escape( __('Help') ) . ' (Alt+Shift+H)", 397 397 wp_more_alt:"' . mce_escape( __('More...') ) . '", 398 wp_page_alt:"' . mce_escape( __('Next page...') ) . '" 398 wp_page_alt:"' . mce_escape( __('Next page...') ) . '", 399 add_media:"' . mce_escape( __('Add Media') ) . '", 400 add_image:"' . mce_escape( __('Add an Image') ) . '", 401 add_video:"' . mce_escape( __('Add Video') ) . '", 402 add_audio:"' . mce_escape( __('Add Audio') ) . '" 399 403 }); 400 404 … … 408 412 medium:"' . mce_escape( __('Medium') ) . '", 409 413 full_size:"' . mce_escape( __('Full Size') ) . '", 410 alt_help:"' . js_escape( __('Alternate text, e.g. "The Mona Lisa"') ) . '",411 414 current_link:"' . mce_escape( __('Current Link') ) . '", 412 415 link_to_img:"' . mce_escape( __('Link to Image') ) . '", … … 431 434 s120:"' . mce_escape( __('120%') ) . '", 432 435 s130:"' . mce_escape( __('130%') ) . '", 433 caption:"' . mce_escape( __('Caption') ) . '" 436 img_title:"' . mce_escape( __('Edit Image Title') ) . '", 437 caption:"' . mce_escape( __('Edit Image Caption') ) . '", 438 alt:"' . mce_escape( __('Edit Alternate Text') ) . '" 434 439 }); 435 440 '; -
branches/crazyhorse/wp-includes/js/tinymce/plugins/wordpress/editor_plugin.js
r8242 r8335 90 90 }); 91 91 92 // Add Media buttons 93 ed.addButton('add_media', { 94 title : 'wordpress.add_media', 95 image : url + '/img/media.gif', 96 onclick : function() { 97 tb_show('', tinymce.DOM.get('add_media').href); 98 tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); 99 } 100 }); 101 102 ed.addButton('add_image', { 103 title : 'wordpress.add_image', 104 image : url + '/img/image.gif', 105 onclick : function() { 106 tb_show('', tinymce.DOM.get('add_image').href); 107 tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); 108 } 109 }); 110 111 ed.addButton('add_video', { 112 title : 'wordpress.add_video', 113 image : url + '/img/video.gif', 114 onclick : function() { 115 tb_show('', tinymce.DOM.get('add_video').href); 116 tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); 117 } 118 }); 119 120 ed.addButton('add_audio', { 121 title : 'wordpress.add_audio', 122 image : url + '/img/audio.gif', 123 onclick : function() { 124 tb_show('', tinymce.DOM.get('add_audio').href); 125 tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); 126 } 127 }); 128 129 // Add Media buttons to fullscreen 130 ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { 131 if ( 'mceFullScreen' != cmd ) return; 132 if ( 'mce_fullscreen' != ed.id ) 133 ed.settings.theme_advanced_buttons1 += ',|,add_image,add_video,add_audio,add_media'; 134 }); 135 92 136 // Add class "alignleft", "alignright" and "aligncenter" when selecting align for images. 93 ed.onExecCommand.add(function( ed, cmd ) { 94 var n, bl, dom = ed.dom; 95 96 if ( 'JustifyCenter' == cmd ) { 97 tinymce.each(dom.select('img'), function(n) { 98 var v = n.className; 99 100 if (v.indexOf('aligncenter') == -1) { 101 dom.getParent(n, function(P) { 102 if (P && P.style && P.style.textAlign == 'center') 103 dom.setStyle(P, 'textAlign', ''); 104 }); 105 } 106 }); 107 108 ed.execCommand('mceRepaint'); 109 } 110 }); 111 112 ed.onBeforeExecCommand.add(function( ed, cmd ) { 113 var n, dir, xdir, bl, dom = ed.dom; 114 115 if ( ( cmd.indexOf('Justify') != -1 ) && ( n = ed.selection.getNode() ) ) { 116 if ( 'JustifyFull' == cmd || n.nodeName !== 'IMG' ) return; 117 dir = cmd.substring(7).toLowerCase(); 118 119 if ( ed.queryCommandState( cmd ) ) { 120 n.className = n.className.replace(/align[^ '"]+\s?/g, ''); 121 dom.addClass( n, "alignnone" ); 122 } else if ( 'JustifyCenter' == cmd ) { 123 n.className = n.className.replace(/alignleft\s?|alignright\s?|alignnone\s?/g, ''); 124 if ( dom.hasClass( n, "aligncenter" ) ) { 125 dom.removeClass( n, "aligncenter" ); 126 dom.addClass( n, "alignnone" ); 127 } else 128 dom.addClass( n, "aligncenter" ); 129 130 } else { 131 n.className = n.className.replace(/align[^ '"]+\s?/g, ''); 132 dom.addClass( n, "align"+dir ); 133 } 134 } 135 }); 136 137 // Word count if script is loaded 138 if ( 'undefined' != typeof wpWordCount ) { 139 var last = 0; 140 ed.onKeyUp.add(function(ed, e) { 141 if ( e.keyCode == last ) return; 142 if ( 13 == e.keyCode || 8 == last || 46 == last ) wpWordCount.wc( ed.getContent({format : 'raw'}) ); 143 last = e.keyCode; 144 }); 145 }; 146 147 // Add listeners to handle more break 137 ed.addCommand('JustifyLeft', function() { 138 var n = ed.selection.getNode(); 139 140 if ( n.nodeName != 'IMG' ) 141 ed.editorCommands.mceJustify('JustifyLeft', 'left'); 142 else ed.plugins.wordpress.do_align(n, 'alignleft'); 143 }); 144 145 ed.addCommand('JustifyRight', function() { 146 var n = ed.selection.getNode(); 147 148 if ( n.nodeName != 'IMG' ) 149 ed.editorCommands.mceJustify('JustifyRight', 'right'); 150 else ed.plugins.wordpress.do_align(n, 'alignright'); 151 }); 152 153 ed.addCommand('JustifyCenter', function() { 154 var n = ed.selection.getNode(), P = ed.dom.getParent(n, 'p'), DL = ed.dom.getParent(n, 'dl'); 155 156 if ( n.nodeName == 'IMG' && ( P || DL ) ) 157 ed.plugins.wordpress.do_align(n, 'aligncenter'); 158 else ed.editorCommands.mceJustify('JustifyCenter', 'center'); 159 }); 160 161 // Word count if script is loaded 162 if ( 'undefined' != typeof wpWordCount ) { 163 var last = 0; 164 ed.onKeyUp.add(function(ed, e) { 165 if ( e.keyCode == last ) return; 166 if ( 13 == e.keyCode || 8 == last || 46 == last ) wpWordCount.wc( ed.getContent({format : 'raw'}) ); 167 last = e.keyCode; 168 }); 169 }; 170 171 // Add listeners to handle more break 148 172 t._handleMoreBreak(ed, url); 149 173 … … 184 208 185 209 // Internal functions 210 do_align : function(n, a) { 211 var P, DL, DIV, cls, c, ed = tinyMCE.activeEditor; 212 213 P = ed.dom.getParent(n, 'p'); 214 DL = ed.dom.getParent(n, 'dl'); 215 DIV = ed.dom.getParent(n, 'div'); 216 217 if ( DL && DIV ) { 218 cls = ed.dom.hasClass(DL, a) ? 'alignnone' : a; 219 DL.className = DL.className.replace(/align[^ '"]+\s?/g, ''); 220 ed.dom.addClass(DL, cls); 221 c = (cls == 'aligncenter') ? ed.dom.addClass(DIV, 'mceIEcenter') : ed.dom.removeClass(DIV, 'mceIEcenter'); 222 } else if ( P ) { 223 cls = ed.dom.hasClass(n, a) ? 'alignnone' : a; 224 n.className = n.className.replace(/align[^ '"]+\s?/g, ''); 225 ed.dom.addClass(n, cls); 226 if ( cls == 'aligncenter' ) 227 ed.dom.setStyle(P, 'textAlign', 'center'); 228 else if (P.style && P.style.textAlign == 'center') 229 ed.dom.setStyle(P, 'textAlign', ''); 230 } 231 232 ed.execCommand('mceRepaint'); 233 }, 186 234 187 235 // Resizes the iframe by a relative height value -
branches/crazyhorse/wp-includes/js/tinymce/plugins/wpeditimage/css/editimage.css
r8242 r8335 63 63 } 64 64 65 #media-upload #basic th.label { 66 padding: 5px 5px 5px 0; 67 } 68 65 69 .show-align { 66 70 height: 200px; -
branches/crazyhorse/wp-includes/js/tinymce/plugins/wpeditimage/editimage.html
r8242 r8335 5 5 <title></title> 6 6 7 <script type="text/javascript" src="js/editimage.js?ver=311 "></script>7 <script type="text/javascript" src="js/editimage.js?ver=311d"></script> 8 8 <script type="text/javascript" src="../../utils/form_utils.js?ver=311"></script> 9 9 10 <link rel="stylesheet" href="css/editimage.css?ver=311 " type="text/css" media="all" />11 <link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta 1" type="text/css" media="all" />10 <link rel="stylesheet" href="css/editimage.css?ver=311d" type="text/css" media="all" /> 11 <link rel="stylesheet" href="../../../../../wp-admin/css/media.css?ver=2.6-beta3" type="text/css" media="all" /> 12 12 <script type="text/javascript"> 13 13 if ( 'rtl' == tinyMCEPopup.editor.getParam('directionality','') ) … … 75 75 </tr> 76 76 77 <tr class="">77 <tr> 78 78 <th valign="top" scope="row" class="label"> 79 79 <label for="img_title"> 80 <span class="alignleft">{#advanced_dlg.link_titlefield}</span> 81 <span class="alignright"><abbr title="required" class="required">*</abbr></span> 80 <span class="alignleft">{#wpeditimage.img_title}</span> 82 81 </label> 83 82 </th> … … 87 86 </tr> 88 87 89 <tr class="post_excerpt">90 <th valign="top" scope="row" class="label"> 91 <label for="img_ alt">88 <tr id="cap_field"> 89 <th valign="top" scope="row" class="label"> 90 <label for="img_cap"> 92 91 <span class="alignleft">{#wpeditimage.caption}</span> 93 92 </label> 94 93 </th> 95 94 <td class="field"> 96 <input type="text" id="img_alt" name="img_alt" value="" size="60" /> 97 <p class="help">{#wpeditimage.alt_help}</p> 98 </td> 99 </tr> 100 101 <tr class="url"> 95 <input type="text" id="img_cap" name="img_cap" value="" size="60" /> 96 </td> 97 </tr> 98 99 <tr> 102 100 <th valign="top" scope="row" class="label"> 103 101 <label for="link_href"> … … 131 129 </td> 132 130 </tr> 131 132 <tr> 133 <th valign="top" scope="row" class="label"> 134 <label for="img_alt"> 135 <span class="alignleft">{#wpeditimage.alt}</span> 136 </label> 137 </th> 138 <td class="field"> 139 <input type="text" id="img_alt" name="img_alt" value="" size="60" /> 140 </td> 141 </tr> 133 142 134 143 <tr id="img_dim"> -
branches/crazyhorse/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin.js
r8242 r8335 16 16 return; 17 17 18 tb_show('', url + '/editimage.html? TB_iframe=true');18 tb_show('', url + '/editimage.html?ver=311c&TB_iframe=true'); 19 19 tinymce.DOM.setStyle( ['TB_overlay','TB_window','TB_load'], 'z-index', '999999' ); 20 20 }); … … 22 22 ed.onInit.add(function(ed) { 23 23 tinymce.dom.Event.add(ed.getWin(), 'scroll', function(e) { 24 24 ed.plugins.wpeditimage.hideButtons(); 25 25 }); 26 26 }); … … 28 28 ed.onBeforeExecCommand.add(function(ed, cmd, ui, val) { 29 29 ed.plugins.wpeditimage.hideButtons(); 30 30 }); 31 31 32 32 ed.onSaveContent.add(function(ed, o) { 33 33 ed.plugins.wpeditimage.hideButtons(); 34 34 }); 35 35 36 36 ed.onMouseUp.add(function(ed, e) { 37 if ( ! tinymce.isOpera ) return; 38 if ( e.target.nodeName == 'IMG' ) 39 ed.plugins.wpeditimage.showButtons(e.target); 37 if ( tinymce.isOpera ) { 38 if ( e.target.nodeName == 'IMG' ) 39 ed.plugins.wpeditimage.showButtons(e.target); 40 } else if ( ! tinymce.isWebKit ) { 41 var n = ed.selection.getNode(), DL; 42 43 if ( n.nodeName == 'IMG' && (DL = ed.dom.getParent(n, 'DL')) ) { 44 window.setTimeout(function(){ 45 var ed = tinyMCE.activeEditor, n = ed.selection.getNode(), DL = ed.dom.getParent(n, 'DL'); 46 47 if ( n.width != (parseInt(ed.dom.getStyle(DL, 'width')) - 10) ) { 48 ed.dom.setStyle(DL, 'width', parseInt(n.width)+10); 49 ed.execCommand('mceRepaint'); 50 } 51 }, 100); 52 } 53 } 40 54 }); 41 55 … … 64 78 65 79 ed.onBeforeSetContent.add(function(ed, o) { 66 67 80 o.content = t._do_shcode(o.content); 81 }); 68 82 69 83 ed.onPostProcess.add(function(ed, o) { … … 74 88 75 89 _do_shcode : function(co) { 76 return co.replace(/\[wp_caption([^\]]+)\]([\s\S]+?)\[\/wp_caption\][\s\u00a0]*/g, function(a,b,c){ 77 var id = b.match(/id=['"]([^'"]+)/), cls = b.match(/align=['"]([^'"]+)/); 78 var w = b.match(/width=['"]([0-9]+)/), cap = b.match(/caption=['"]([^'"]+)/); 90 return co.replace(/\[(?:wp_)?caption([^\]]+)\]([\s\S]+?)\[\/(?:wp_)?caption\][\s\u00a0]*/g, function(a,b,c){ 91 b = b.replace(/\\'|\\'|\\'/g, ''').replace(/\\"|\\"/g, '"'); 92 c = c.replace(/\\'|\\'/g, ''').replace(/\\"/g, '"'); 93 var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/align=['"]([^'"]+)/i); 94 var w = b.match(/width=['"]([0-9]+)/), cap = b.match(/caption=['"]([^'"]+)/i); 79 95 80 96 id = ( id && id[1] ) ? id[1] : ''; … … 86 102 var div_cls = (cls == 'aligncenter') ? 'mceTemp mceIEcenter' : 'mceTemp'; 87 103 88 return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp _caption '+cls+'" style="width: '+(10+parseInt(w))+89 'px"><dt class="wp _caption_dt">'+c+'</dt><dd class="wp_caption_dd">'+cap+'</dd></dl></div>';104 return '<div class="'+div_cls+'"><dl id="'+id+'" class="wp-caption '+cls+'" style="width: '+(10+parseInt(w))+ 105 'px"><dt class="wp-caption-dt">'+c+'</dt><dd class="wp-caption-dd">'+cap+'</dd></dl></div>'; 90 106 }); 91 107 }, 92 108 93 109 _get_shcode : function(co) { 94 return co.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>( [^<]+)<\/dd>\s*<\/dl>\s*<\/div>\s*/g, function(a,b,c,cap){95 var id = b.match(/id=['"]([^'"]+)/ ), cls = b.match(/class=['"]([^'"]+)/);110 return co.replace(/<div class="mceTemp[^"]*">\s*<dl([^>]+)>\s*<dt[^>]+>([\s\S]+?)<\/dt>\s*<dd[^>]+>(.+?)<\/dd>\s*<\/dl>\s*<\/div>\s*/gi, function(a,b,c,cap){ 111 var id = b.match(/id=['"]([^'"]+)/i), cls = b.match(/class=['"]([^'"]+)/i); 96 112 var w = c.match(/width=['"]([0-9]+)/); 97 113 … … 101 117 102 118 if ( ! w || ! cap ) return c; 103 cls = cls ? cls.match(/align[^ '"]+/) : ''; 104 105 return '[wp_caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/wp_caption]'; 106 }); 107 }, 108 109 _fixCenter : function(c) { 110 var ed = tinyMCE.activeEditor; 111 112 tinymce.each(ed.dom.select('img', c), function(n) { 113 if ( ed.dom.hasClass(n, 'aligncenter') ) { 114 var P = ed.dom.getParent(n, 'p'); 115 if ( tinymce.isIE ) 116 ed.dom.addClass(P, 'mce_iecenter'); 117 if ( P.style && P.style.textAlign == 'center' ) 118 ed.dom.setStyle(P, 'textAlign', ''); 119 } 119 cls = cls.match(/align[^ '"]+/) || 'alignnone'; 120 cap = cap.replace(/<\S[^<>]*>/gi, '').replace(/'/g, ''').replace(/"/g, '"'); 121 122 return '[caption id="'+id+'" align="'+cls+'" width="'+w+'" caption="'+cap+'"]'+c+'[/caption]'; 120 123 }); 121 124 }, … … 173 176 ed.execCommand("WP_EditImage"); 174 177 this.parentNode.style.display = 'none'; 175 } 178 }; 176 179 177 180 var wp_delimgbtn = DOM.add('wp_editbtns', 'img', { … … 197 200 return false; 198 201 } 199 } 202 }; 200 203 }, 201 204 -
branches/crazyhorse/wp-includes/js/tinymce/plugins/wpeditimage/js/editimage.js
r8242 r8335 246 246 247 247 setup : function() { 248 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 ;248 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; 249 249 document.dir = tinyMCEPopup.editor.getParam('directionality',''); 250 251 if ( ! tinyMCEPopup.editor.getParam('wpeditimage_do_captions', true) ) 252 t.I('cap_field').style.display = 'none'; 253 250 254 tinyMCEPopup.restoreSelection(); 251 255 el = ed.selection.getNode(); … … 256 260 t.getImageData(); 257 261 c = ed.dom.getAttrib(el, 'class'); 258 caption = t.img_alt = ed.dom.getAttrib(el, 'alt');259 262 260 263 if ( DL = dom.getParent(el, 'dl') ) { 261 264 var dlc = ed.dom.getAttrib(DL, 'class'); 262 265 dlc = dlc.match(/align[^ "']+/i); 263 if ( ! dom.hasClass(el, dlc) )266 if ( dlc && ! dom.hasClass(el, dlc) ) { 264 267 c += ' '+dlc; 265 268 tinymce.trim(c); 269 } 270 266 271 tinymce.each(DL.childNodes, function(e) { 267 if ( e.nodeName == 'DD' ) {272 if ( e.nodeName == 'DD' && dom.hasClass(e, 'wp-caption-dd') ) { 268 273 caption = e.innerHTML; 269 274 return; … … 272 277 } 273 278 279 f.img_cap.value = caption; 274 280 f.img_title.value = ed.dom.getAttrib(el, 'title'); 275 f.img_alt.value = caption;281 f.img_alt.value = ed.dom.getAttrib(el, 'alt'); 276 282 f.border.value = ed.dom.getAttrib(el, 'border'); 277 283 f.vspace.value = ed.dom.getAttrib(el, 'vspace'); … … 356 362 } 357 363 358 if ( f.img_ alt.value != '' && f.width.value != '' ) {364 if ( f.img_cap.value != '' && f.width.value != '' ) { 359 365 do_caption = 1; 360 366 img_class = img_class.replace( /align[^ "']+\s?/gi, '' ); … … 371 377 src : f.img_src.value, 372 378 title : f.img_title.value, 373 alt : t.img_alt,379 alt : f.img_alt.value, 374 380 width : f.width.value, 375 381 height : f.height.value, … … 378 384 }); 379 385 380 if ( ! f.link_href.value ) { 381 if ( A ) { 382 b = ed.selection.getBookmark(); 383 ed.dom.remove(A, 1); 384 ed.selection.moveToBookmark(b); 385 } 386 } else { 386 if ( f.link_href.value ) { 387 387 // Create new anchor elements 388 388 if ( A == null ) { 389 if ( ! f.link_href.value.match(/https?:\/\// ) )389 if ( ! f.link_href.value.match(/https?:\/\//i) ) 390 390 f.link_href.value = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.link_href.value); 391 391 … … 428 428 if ( DL ) { 429 429 ed.dom.setAttribs(DL, { 430 'class' : 'wp _caption '+t.align,430 'class' : 'wp-caption '+t.align, 431 431 style : 'width: '+cap_width+'px;' 432 432 }); 433 433 434 if ( DIV ) 434 if ( DIV ) 435 435 ed.dom.setAttrib(DIV, 'class', div_cls); 436 436 437 if ( (DT = ed.dom.getParent(el, 'dt')) && (DD = DT.nextSibling) && ed.dom.hasClass(DD, 'wp _caption_dd') )438 ed.dom.setHTML(DD, f.img_ alt.value);437 if ( (DT = ed.dom.getParent(el, 'dt')) && (DD = DT.nextSibling) && ed.dom.hasClass(DD, 'wp-caption-dd') ) 438 ed.dom.setHTML(DD, f.img_cap.value); 439 439 440 440 } else { 441 var lnk = '', pa; 441 442 if ( (id = f.img_classes.value.match( /wp-image-([0-9]{1,6})/ )) && id[1] ) 442 443 cap_id = 'attachment_'+id[1]; 443 444 444 if ( f.link_href.value ) html = ed.dom.getOuterHTML(ed.dom.getParent(el, 'a')); 445 else html = ed.dom.getOuterHTML(el); 446 447 html = '<dl id="'+cap_id+'" class="wp_caption '+t.align+'" style="width: '+cap_width+ 448 'px"><dt class="wp_caption_dt">'+html+'</dt><dd class="wp_caption_dd">'+f.img_alt.value+'</dd></dl>'; 445 if ( f.link_href.value && (lnk = ed.dom.getParent(el, 'a')) ) { 446 if ( lnk.childNodes.length == 1 ) 447 html = ed.dom.getOuterHTML(lnk); 448 else { 449 html = ed.dom.getOuterHTML(lnk); 450 html = html.match(/<a[^>]+>/i); 451 html = html+ed.dom.getOuterHTML(el)+'</a>'; 452 } 453 } else html = ed.dom.getOuterHTML(el); 454 455 html = '<dl id="'+cap_id+'" class="wp-caption '+t.align+'" style="width: '+cap_width+ 456 'px"><dt class="wp-caption-dt">'+html+'</dt><dd class="wp-caption-dd">'+f.img_cap.value+'</dd></dl>'; 449 457 450 458 cap = ed.dom.create('div', {'class': div_cls}, html); … … 452 460 if ( P ) { 453 461 P.parentNode.insertBefore(cap, P); 454 ed.dom.remove(P); 462 if ( P.childNodes.length == 1 ) 463 ed.dom.remove(P); 464 else if ( lnk && lnk.childNodes.length == 1 ) 465 ed.dom.remove(lnk); 466 else ed.dom.remove(el); 467 } else if ( pa = ed.dom.getParent(el, 'TD,TH,LI') ) { 468 pa.appendChild(cap); 469 if ( lnk && lnk.childNodes.length == 1 ) 470 ed.dom.remove(lnk); 471 else ed.dom.remove(el); 455 472 } 456 473 } 457 474 458 tinyMCEPopup.execCommand("mceEndUndoLevel");459 ed.execCommand('mceRepaint');460 tinyMCEPopup.close();461 return;462 475 } else { 463 if ( DL ) { 464 if ( f.link_href.value ) html = ed.dom.getOuterHTML(ed.dom.getParent(el, 'a')); 476 if ( DL && DIV ) { 477 var aa; 478 if ( f.link_href.value && (aa = ed.dom.getParent(el, 'a')) ) html = ed.dom.getOuterHTML(aa); 465 479 else html = ed.dom.getOuterHTML(el); 466 480 467 481 P = ed.dom.create('p', {}, html); 468 DL.parentNode.insertBefore(P,DL); 469 ed.dom.remove(DL.childNodes); 470 ed.dom.remove(DL); 482 DIV.parentNode.insertBefore(P, DIV); 483 ed.dom.remove(DIV); 471 484 } 472 485 } … … 478 491 if ( P && P.style && P.style.textAlign == 'center' ) 479 492 ed.dom.setStyle(P, 'textAlign', ''); 493 } 494 495 if ( ! f.link_href.value && A ) { 496 b = ed.selection.getBookmark(); 497 ed.dom.remove(A, 1); 498 ed.selection.moveToBookmark(b); 480 499 } 481 500 -
branches/crazyhorse/wp-includes/js/tinymce/tiny_mce_config.php
r8242 r8335 130 130 $mce_buttons_4 = apply_filters('mce_buttons_4', array()); 131 131 $mce_buttons_4 = implode($mce_buttons_4, ','); 132 133 $do_captions = ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) ? false : true; 132 134 133 135 // TinyMCE init settings … … 164 166 'content_css' => "$mce_css", 165 167 'save_callback' => 'switchEditors.saveCallback', 168 'wpeditimage_do_captions' => $do_captions, 166 169 'plugins' => "$plugins", 167 170 // pass-through the settings for compression and caching, so they can be changed with "tiny_mce_before_init" … … 223 226 if ( $disk_cache ) { 224 227 225 $cacheKey = apply_filters('tiny_mce_version', '20080 626');228 $cacheKey = apply_filters('tiny_mce_version', '20080710'); 226 229 227 230 foreach ( $initArray as $v ) -
branches/crazyhorse/wp-includes/js/tinymce/wordpress.css
r8242 r8335 16 16 } 17 17 18 .wp _caption {18 .wp-caption { 19 19 border: 1px solid #ddd; 20 20 text-align: center; … … 28 28 } 29 29 30 .wp _caption img {30 .wp-caption img { 31 31 margin: 0; 32 32 padding: 0; … … 34 34 } 35 35 36 .wp _caption_dd {36 .wp-caption-dd { 37 37 font-size: 11px; 38 38 line-height: 17px; -
branches/crazyhorse/wp-includes/link-template.php
r8242 r8335 746 746 function get_shortcut_link() { 747 747 $link = "javascript: 748 var d=document; 749 var w=window; 750 var e=w.getSelection; 751 var k=d.getSelection; 752 var x=d.selection; 753 var s=(e?e():(k)?k():(x?x.createRange().text:0)); 754 var f='" . admin_url('press-this.php') . "'; 755 var l=d.location; 756 var e=encodeURIComponent; 757 var u= '?u=' + e(l.href); 758 var t= '&t=' + e(d.title); 759 var s= '&s=' + e(s); 760 var v='&v=1'; 761 var g= f+u+t+s+v; 748 var d=document, 749 w=window, 750 e=w.getSelection, 751 k=d.getSelection, 752 x=d.selection, 753 s=(e?e():(k)?k():(x?x.createRange().text:0)), 754 f='" . admin_url('press-this.php') . "', 755 l=d.location, 756 e=encodeURIComponent, 757 g=f+'?u='+e(l.href)+'&t='+e(d.title)+'&s='+e(s)+'&v=2'; 762 758 function a(){ 763 759 if(!w.open(g,'t','toolbar=0,resizable=0,scrollbars=1,status=1,width=700,height=500')){ 764 760 l.href=g; 765 761 } 766 } 767 if (/Firefox/.test(navigator.userAgent)){768 setTimeout(a,0);769 }else{770 a();771 } 772 void(0);";762 }"; 763 if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) 764 $link .= 'setTimeout(a,0);'; 765 else 766 $link .= 'a();'; 767 768 $link .= "void(0);"; 773 769 774 770 $link = str_replace(array("\r", "\n", "\t"), '', $link); … … 777 773 } 778 774 779 // return the site_url option, using https if is_ssl() is true 780 // if $scheme is 'http' or 'https' it will override is_ssl() 775 /** Return the site url 776 * 777 * 778 * @package WordPress 779 * @since 2.6 780 * 781 * Returns the 'site_url' option with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise. 782 * If $scheme is 'http' or 'https', is_ssl() is overridden. 783 * 784 * @param string $path Optional path relative to the site url 785 * @param string $scheme Optional scheme to give the site url context. Currently 'http','https', 'login', 'login_post', or 'admin' 786 * @return string Site url link with optional path appended 787 */ 781 788 function site_url($path = '', $scheme = null) { 782 789 // should the list of allowed schemes be maintained elsewhere? … … 800 807 } 801 808 809 /** Return the admin url 810 * 811 * 812 * @package WordPress 813 * @since 2.6 814 * 815 * Returns the url to the admin area 816 * 817 * @param string $path Optional path relative to the admin url 818 * @return string Admin url link with optional path appended 819 */ 802 820 function admin_url($path = '') { 803 global $_wp_admin_url;804 805 821 $url = site_url('wp-admin/', 'admin'); 806 822 … … 811 827 } 812 828 829 /** Return the includes url 830 * 831 * 832 * @package WordPress 833 * @since 2.6 834 * 835 * Returns the url to the includes directory 836 * 837 * @param string $path Optional path relative to the includes url 838 * @return string Includes url link with optional path appended 839 */ 813 840 function includes_url($path = '') { 814 global $_wp_includes_url;815 816 841 $url = site_url() . '/' . WPINC . '/'; 817 842 … … 822 847 } 823 848 849 /** Return the content url 850 * 851 * 852 * @package WordPress 853 * @since 2.6 854 * 855 * Returns the url to the content directory 856 * 857 * @param string $path Optional path relative to the content url 858 * @return string Content url link with optional path appended 859 */ 860 function content_url($path = '') { 861 $scheme = ( is_ssl() ? 'https' : 'http' ); 862 $url = WP_CONTENT_URL; 863 if ( 0 === strpos($url, 'http') ) { 864 if ( is_ssl() ) 865 $url = str_replace( 'http://', "{$scheme}://", $url ); 866 } 867 868 if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 869 $url .= '/' . ltrim($path, '/'); 870 871 return $url; 872 } 873 874 /** Return the plugins url 875 * 876 * 877 * @package WordPress 878 * @since 2.6 879 * 880 * Returns the url to the plugins directory 881 * 882 * @param string $path Optional path relative to the plugins url 883 * @return string Plugins url link with optional path appended 884 */ 885 function plugins_url($path = '') { 886 $scheme = ( is_ssl() ? 'https' : 'http' ); 887 $url = WP_PLUGIN_URL; 888 if ( 0 === strpos($url, 'http') ) { 889 if ( is_ssl() ) 890 $url = str_replace( 'http://', "{$scheme}://", $url ); 891 } 892 893 if ( !empty($path) && is_string($path) && strpos($path, '..') === false ) 894 $url .= '/' . ltrim($path, '/'); 895 896 return $url; 897 } 898 824 899 ?> -
branches/crazyhorse/wp-includes/media.php
r8242 r8335 74 74 elseif ( $size == 'thumbnail' ) { 75 75 // fall back to the old thumbnail 76 if ( $thumb_file = wp_get_attachment_thumb_file() && $info = getimagesize($thumb_file) ) {76 if ( ($thumb_file = wp_get_attachment_thumb_file($id)) && $info = getimagesize($thumb_file) ) { 77 77 $img_url = str_replace(basename($img_url), basename($thumb_file), $img_url); 78 78 $width = $info[0]; … … 275 275 276 276 function image_get_intermediate_size($post_id, $size='thumbnail') { 277 if ( ! $imagedata = wp_get_attachment_metadata( $post_id) )277 if ( !is_array( $imagedata = wp_get_attachment_metadata( $post_id ) ) ) 278 278 return false; 279 279 … … 351 351 } 352 352 353 add_shortcode('wp_caption', 'wp_caption_shortcode'); 354 355 function wp_caption_shortcode($attr, $content = null) { 356 353 add_shortcode('wp_caption', 'img_caption_shortcode'); 354 add_shortcode('caption', 'img_caption_shortcode'); 355 356 function img_caption_shortcode($attr, $content = null) { 357 358 if ( defined('CAPTIONS_OFF') && true == CAPTIONS_OFF ) 359 return $content; 360 357 361 // Allow plugins/themes to override the default caption template. 358 $output = apply_filters(' wp_caption_shortcode', '', $attr, $content);362 $output = apply_filters('img_caption_shortcode', '', $attr, $content); 359 363 if ( $output != '' ) 360 364 return $output; … … 372 376 if ( $id ) $id = 'id="' . $id . '" '; 373 377 374 return '<d l ' . $id . 'class="wp_caption ' . $align . '" style="width: ' . (10 + (int) $width) . 'px">'375 . '<dt class="wp_caption_dt">' . $content . '</dt><dd class="wp_caption_dd">' . $caption . '</dd></dl>';378 return '<div ' . $id . 'class="wp-caption ' . $align . '" style="width: ' . (10 + (int) $width) . 'px">' 379 . $content . '<p class="wp-caption-text">' . $caption . '</p></div>'; 376 380 } 377 381 -
branches/crazyhorse/wp-includes/pluggable.php
r8242 r8335 828 828 $location = 'http:' . $location; 829 829 830 $lp = parse_url($location); 830 // In php 5 parse_url may fail if the URL query part contains http://, bug #38143 831 $test = ( $cut = strpos($location, '?') ) ? substr( $location, 0, $cut ) : $location; 832 833 $lp = parse_url($test); 831 834 $wpp = parse_url(get_option('home')); 832 835 -
branches/crazyhorse/wp-includes/post.php
r8242 r8335 2425 2425 if ( !$post =& get_post( $post_id ) ) 2426 2426 return false; 2427 if ( ! $imagedata = wp_get_attachment_metadata( $post->ID) )2427 if ( !is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) ) 2428 2428 return false; 2429 2429 -
branches/crazyhorse/wp-includes/script-loader.php
r8242 r8335 35 35 $scripts->add( 'editor', false, $visual_editor, '20080321' ); 36 36 37 $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '200807 01' );37 $scripts->add( 'editor_functions', '/wp-admin/js/editor.js', false, '20080710' ); 38 38 39 39 // Modify this version when tinyMCE plugins are changed. 40 $mce_version = apply_filters('tiny_mce_version', '200807 01');40 $mce_version = apply_filters('tiny_mce_version', '20080710'); 41 41 $scripts->add( 'tiny_mce', '/wp-includes/js/tinymce/tiny_mce_config.php', array('editor_functions'), $mce_version ); 42 42 … … 74 74 $scripts->add( 'schedule', '/wp-includes/js/jquery/jquery.schedule.js', array('jquery'), '20'); 75 75 $scripts->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.js', array('jquery'), '3.1-20080430'); 76 $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2. 1.0');77 $scripts->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2. 1.0');76 $scripts->add( 'swfupload', '/wp-includes/js/swfupload/swfupload.js', false, '2.0.2-20080430'); 77 $scripts->add( 'swfupload-degrade', '/wp-includes/js/swfupload/plugins/swfupload.graceful_degradation.js', array('swfupload'), '2.0.2'); 78 78 $scripts->localize( 'swfupload-degrade', 'uploadDegradeOptions', array( 79 79 'is_lighttpd_before_150' => is_lighttpd_before_150(), 80 80 ) ); 81 $scripts->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2. 1.0');82 $scripts->add( 'swfupload-handlers', '/wp-includes/js/swfupload/handlers.js', array('swfupload'), '2. 1.0');81 $scripts->add( 'swfupload-queue', '/wp-includes/js/swfupload/plugins/swfupload.queue.js', array('swfupload'), '2.0.2'); 82 $scripts->add( 'swfupload-handlers', '/wp-includes/js/swfupload/handlers.js', array('swfupload'), '2.0.2-20080407'); 83 83 // these error messages came from the sample swfupload js, they might need changing. 84 84 $scripts->localize( 'swfupload-handlers', 'swfuploadL10n', array( … … 159 159 'edit' => __('Edit'), 160 160 ) ); 161 $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080 520' );162 $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '200807 01' );161 $scripts->add( 'admin-gallery', '/wp-admin/js/gallery.js', array( 'jquery-ui-sortable' ), '20080709' ); 162 $scripts->add( 'media-upload', '/wp-admin/js/media-upload.js', array( 'thickbox' ), '20080710' ); 163 163 $scripts->localize( 'upload', 'uploadL10n', array( 164 164 'browseTitle' => attribute_escape(__('Browse your files')), … … 212 212 $styles->text_direction = 'rtl' == get_bloginfo( 'text_direction' ) ? 'rtl' : 'ltr'; 213 213 214 $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets' );214 $rtl_styles = array( 'global', 'colors', 'dashboard', 'ie', 'install', 'login', 'media', 'theme-editor', 'upload', 'widgets', 'press-this', 'press-this-ie' ); 215 215 216 216 $styles->add( 'wp-admin', '/wp-admin/wp-admin.css' ); … … 225 225 226 226 $styles->add( 'global', '/wp-admin/css/global.css' ); 227 $styles->add( 'media', '/wp-admin/css/media.css', array(), '20080 523' );227 $styles->add( 'media', '/wp-admin/css/media.css', array(), '20080709' ); 228 228 $styles->add( 'widgets', '/wp-admin/css/widgets.css' ); 229 229 $styles->add( 'dashboard', '/wp-admin/css/dashboard.css' ); 230 $styles->add( 'install', '/wp-admin/css/install.css' );230 $styles->add( 'install', '/wp-admin/css/install.css', array(), '20080708' ); 231 231 $styles->add( 'theme-editor', '/wp-admin/css/theme-editor.css' ); 232 $styles->add( 'press-this', '/wp-admin/css/press-this.css' ); 232 $styles->add( 'press-this', '/wp-admin/css/press-this.css', array(), '20080710' ); 233 $styles->add( 'press-this-ie', '/wp-admin/css/press-this-ie.css', array(), '20080710' ); 234 $styles->add_data( 'press-this-ie', 'conditional', 'gte IE 6' ); 233 235 $styles->add( 'thickbox', '/wp-includes/js/thickbox/thickbox.css', array(), '20080613' ); 234 236 $styles->add( 'login', '/wp-admin/css/login.css' ); -
branches/crazyhorse/wp-includes/theme.php
r8040 r8335 338 338 339 339 function get_theme_root_uri() { 340 return apply_filters('theme_root_uri', WP_CONTENT_URL . "/themes", get_option('siteurl'));340 return apply_filters('theme_root_uri', content_url('themes'), get_option('siteurl')); 341 341 } 342 342 … … 487 487 return; 488 488 489 $_GET[template] = preg_replace('|[^a-z0-9 ]|i', '', $_GET[template]);489 $_GET[template] = preg_replace('|[^a-z0-9_-]|i', '', $_GET[template]); 490 490 491 491 add_filter('template', create_function('', "return '$_GET[template]';") ); 492 492 493 493 if ( isset($_GET['stylesheet']) ) { 494 $_GET[stylesheet] = preg_replace('|[^a-z0-9 ]|i', '', $_GET[stylesheet]);494 $_GET[stylesheet] = preg_replace('|[^a-z0-9_-]|i', '', $_GET[stylesheet]); 495 495 add_filter('stylesheet', create_function('', "return '$_GET[stylesheet]';") ); 496 496 } -
branches/crazyhorse/wp-includes/update.php
r7237 r8335 11 11 * 12 12 * The WordPress version, PHP version, and Locale is sent. Checks against the WordPress server at 13 * api.wordpress.org server. Will only check if PHP has fsockopen enabled and WordPress isn't installing.13 * api.wordpress.org. Will only check if PHP has fsockopen enabled and WordPress isn't installing. 14 14 * 15 15 * @package WordPress … … 20 20 */ 21 21 function wp_version_check() { 22 if ( !function_exists('fsockopen') || strpos($_SERVER['PHP_SELF'], 'install.php') !== false ||defined('WP_INSTALLING') )22 if ( !function_exists('fsockopen') || defined('WP_INSTALLING') ) 23 23 return; 24 24 … … 70 70 update_option( 'update_core', $new_option ); 71 71 } 72 73 72 add_action( 'init', 'wp_version_check' ); 74 73 74 /** 75 * wp_update_plugins() - Check plugin versions against the latest versions hosted on WordPress.org. 76 * 77 * The WordPress version, PHP version, and Locale is sent along with a list of all plugins installed. 78 * Checks against the WordPress server at api.wordpress.org. 79 * Will only check if PHP has fsockopen enabled and WordPress isn't installing. 80 * 81 * @package WordPress 82 * @since 2.3 83 * @uses $wp_version Used to notidy the WordPress version. 84 * 85 * @return mixed Returns null if update is unsupported. Returns false if check is too soon. 86 */ 87 function wp_update_plugins() { 88 global $wp_version; 89 90 if ( !function_exists('fsockopen') || defined('WP_INSTALLING') ) 91 return false; 92 93 $current = get_option( 'update_plugins' ); 94 95 $time_not_changed = isset( $current->last_checked ) && 43200 > ( time() - $current->last_checked ); 96 97 // If running blog-side, bail unless we've not checked in the last 12 hours 98 if ( !function_exists( 'get_plugins' ) ) { 99 if ( $time_not_changed ) 100 return false; 101 require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 102 } 103 104 $plugins = get_plugins(); 105 $active = get_option( 'active_plugins' ); 106 107 $new_option = ''; 108 $new_option->last_checked = time(); 109 110 $plugin_changed = false; 111 foreach ( $plugins as $file => $p ) { 112 $new_option->checked[ $file ] = $p['Version']; 113 114 if ( !isset( $current->checked[ $file ] ) ) { 115 $plugin_changed = true; 116 continue; 117 } 118 119 if ( strval($current->checked[ $file ]) !== strval($p['Version']) ) 120 $plugin_changed = true; 121 } 122 123 // Bail if we've checked in the last 12 hours and if nothing has changed 124 if ( $time_not_changed && !$plugin_changed ) 125 return false; 126 127 $to_send->plugins = $plugins; 128 $to_send->active = $active; 129 $send = serialize( $to_send ); 130 131 $request = 'plugins=' . urlencode( $send ); 132 $http_request = "POST /plugins/update-check/1.0/ HTTP/1.0\r\n"; 133 $http_request .= "Host: api.wordpress.org\r\n"; 134 $http_request .= "Content-Type: application/x-www-form-urlencoded; charset=" . get_option('blog_charset') . "\r\n"; 135 $http_request .= "Content-Length: " . strlen($request) . "\r\n"; 136 $http_request .= 'User-Agent: WordPress/' . $wp_version . '; ' . get_bloginfo('url') . "\r\n"; 137 $http_request .= "\r\n"; 138 $http_request .= $request; 139 140 $response = ''; 141 if( false != ( $fs = @fsockopen( 'api.wordpress.org', 80, $errno, $errstr, 3) ) && is_resource($fs) ) { 142 fwrite($fs, $http_request); 143 144 while ( !feof($fs) ) 145 $response .= fgets($fs, 1160); // One TCP-IP packet 146 fclose($fs); 147 $response = explode("\r\n\r\n", $response, 2); 148 } 149 150 $response = unserialize( $response[1] ); 151 152 if ( $response ) 153 $new_option->response = $response; 154 155 update_option( 'update_plugins', $new_option ); 156 } 157 if ( defined( 'WP_ADMIN' ) && WP_ADMIN ) 158 add_action( 'admin_init', 'wp_update_plugins' ); 159 else 160 add_action( 'init', 'wp_update_plugins' ); 161 75 162 ?> -
branches/crazyhorse/wp-includes/widgets.php
r8242 r8335 462 462 function wp_widget_search($args) { 463 463 extract($args); 464 ?> 465 <?php echo $before_widget; ?> 466 <form id="searchform" method="get" action="<?php bloginfo('home'); ?>"> 467 <div> 464 $searchform_template = get_template_directory() . '/searchform.php'; 465 466 echo $before_widget; 467 468 // Use current theme search form if it exists 469 if ( file_exists($searchform_template) ) { 470 include_once($searchform_template); 471 } else { ?> 472 <form id="searchform" method="get" action="<?php bloginfo('url'); ?>/"><div> 468 473 <label class="hidden" for="s"><?php _e('Search for:'); ?></label> 469 <input type="text" name="s" id="s" size="15" /><br/>474 <input type="text" name="s" id="s" size="15" value="<?php the_search_query(); ?>" /> 470 475 <input type="submit" value="<?php echo attribute_escape(__('Search')); ?>" /> 471 </div>472 </form>473 <?php echo $after_widget; ?>474 <?php 476 </div></form> 477 <?php } 478 479 echo $after_widget; 475 480 } 476 481 -
branches/crazyhorse/wp-includes/wp-db.php
r8242 r8335 686 686 else 687 687 return false; 688 return $this->query( "UPDATE $table SET " . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres ) . ' LIMIT 1' ); 688 689 return $this->query( "UPDATE $table SET " . implode( ', ', $bits ) . ' WHERE ' . implode( ' AND ', $wheres ) ); 689 690 } 690 691 -
branches/crazyhorse/wp-includes/wp-diff.php
r7747 r8335 309 309 function _splitOnWords($string, $newlineEscape = "\n") { 310 310 $string = str_replace("\0", '', $string); 311 $words = preg_split( '/([^\w])/ ', $string, -1, PREG_SPLIT_DELIM_CAPTURE );311 $words = preg_split( '/([^\w])/u', $string, -1, PREG_SPLIT_DELIM_CAPTURE ); 312 312 $words = str_replace( "\n", $newlineEscape, $words ); 313 313 return $words; -
branches/crazyhorse/wp-login.php
r8242 r8335 54 54 wp_admin_css( 'login', true ); 55 55 wp_admin_css( 'colors-fresh', true ); 56 ?> 57 <script type="text/javascript"> 58 function focusit() { 59 document.getElementById('user_login').focus(); 60 } 61 window.onload = focusit; 62 </script> 63 <?php do_action('login_head'); ?> 56 do_action('login_head'); ?> 64 57 </head> 65 58 <body class="login"> … … 335 328 <p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('« Back to %s'), get_bloginfo('title', 'display' )); ?></a></p> 336 329 330 <script type="text/javascript"> 331 try{document.getElementById('user_login').focus();}catch(e){} 332 </script> 337 333 </body> 338 334 </html> … … 400 396 <p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('« Back to %s'), get_bloginfo('title', 'display' )); ?></a></p> 401 397 398 <script type="text/javascript"> 399 try{document.getElementById('user_login').focus();}catch(e){} 400 </script> 402 401 </body> 403 402 </html> … … 482 481 <p id="backtoblog"><a href="<?php bloginfo('url'); ?>/" title="<?php _e('Are you lost?') ?>"><?php printf(__('« Back to %s'), get_bloginfo('title', 'display' )); ?></a></p> 483 482 483 <script type="text/javascript"> 484 try{document.getElementById('user_login').focus();}catch(e){} 485 </script> 484 486 </body> 485 487 </html>
Note: See TracChangeset
for help on using the changeset viewer.