Changeset 8219
- Timestamp:
- 06/30/2008 11:33:02 PM (17 years ago)
- Location:
- branches/crazyhorse
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/crazyhorse/wp-admin/admin-ajax.php
r8011 r8219 594 594 die(get_sample_permalink_html($post_id, $title, $slug)); 595 595 break; 596 case 'meta-box-order': 597 check_ajax_referer( 'meta-box-order' ); 598 update_user_option( $GLOBALS['current_user']->ID, "meta-box-order_$_POST[page]", $_POST['order'] ); 599 die('1'); 600 break; 596 601 default : 597 602 do_action( 'wp_ajax_' . $_POST['action'] ); -
branches/crazyhorse/wp-admin/edit-form-advanced.php
r8124 r8219 34 34 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div> 35 35 <?php endif; ?> 36 37 <?php 38 39 // All meta boxes should be defined and added before the first do_meta_boxes() call (or potentially during the do_meta_boxes action). 40 41 function post_tags_meta_box($post) { 42 ?> 43 <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> 44 <div id="tagchecklist"></div> 45 <?php 46 } 47 add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'normal', 'core'); 48 49 function post_categories_meta_box($post) { 50 ?> 51 <div id="category-adder" class="wp-hidden-children"> 52 <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4> 53 <p id="category-add" class="wp-hidden-child"> 54 <label class="hidden" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" aria-required="true"/> 55 <label class="hidden" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?> 56 <input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _e( 'Add' ); ?>" tabindex="3" /> 57 <?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?> 58 <span id="category-ajax-response"></span> 59 </p> 60 </div> 61 62 <ul id="category-tabs"> 63 <li class="ui-tabs-selected"><a href="#categories-all" tabindex="3"><?php _e( 'All Categories' ); ?></a></li> 64 <li class="wp-no-js-hidden"><a href="#categories-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li> 65 </ul> 66 67 <div id="categories-pop" class="ui-tabs-panel" style="display: none;"> 68 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear" > 69 <?php $popular_ids = wp_popular_terms_checklist('category'); ?> 70 </ul> 71 </div> 72 73 <div id="categories-all" class="ui-tabs-panel"> 74 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear"> 75 <?php wp_category_checklist($post->ID, false, false, $popular_ids) ?> 76 </ul> 77 </div> 78 <?php 79 } 80 add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'normal', 'core'); 81 82 function post_excerpt_meta_box($post) { 83 ?> 84 <label class="hidden" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea> 85 <p><?php _e('Excerpts are optional hand-crafted summaries of your content. You can <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" target="_blank">use them in your template</a>'); ?></p> 86 <?php 87 } 88 add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'advanced', 'core'); 89 90 function post_trackback_meta_box($post) { 91 $form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />'; 92 if ('' != $post->pinged) { 93 $pings = '<p>'. __('Already pinged:') . '</p><ul>'; 94 $already_pinged = explode("\n", trim($post->pinged)); 95 foreach ($already_pinged as $pinged_url) { 96 $pings .= "\n\t<li>" . wp_specialchars($pinged_url) . "</li>"; 97 } 98 $pings .= '</ul>'; 99 } 100 101 ?> 102 <p><label for="trackback"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p> 103 <p><?php _e('Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress blogs they’ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p> 104 <?php 105 if ( ! empty($pings) ) 106 echo $pings; 107 } 108 add_meta_box('trackbacksdiv', __('Trackbacks'), 'post_trackback_meta_box', 'post', 'advanced', 'core'); 109 110 function post_custom_meta_box($post) { 111 ?> 112 <div id="postcustomstuff"> 113 <table cellpadding="3"> 114 <?php 115 $metadata = has_meta($post->ID); 116 list_meta($metadata); 117 ?> 118 119 </table> 120 <?php 121 meta_form(); 122 ?> 123 <div id="ajax-response"></div> 124 </div> 125 <p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p> 126 <?php 127 } 128 add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'advanced', 'core'); 129 130 do_action('dbx_post_advanced'); 131 132 function post_comment_status_meta_box($post) { 133 ?> 134 <input name="advanced_view" type="hidden" value="1" /> 135 <p><label for="comment_status" class="selectit"> 136 <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> /> 137 <?php _e('Allow Comments') ?></label></p> 138 <p><label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label></p> 139 <p><?php _e('These settings apply to this post only. “Pings” are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p> 140 <?php 141 } 142 add_meta_box('commentstatusdiv', __('Comments & Pings'), 'post_comment_status_meta_box', 'post', 'advanced', 'core'); 143 144 function post_password_meta_box($post) { 145 ?> 146 <p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p> 147 <p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p> 148 <?php 149 } 150 add_meta_box('passworddiv', __('Password Protect This Post'), 'post_password_meta_box', 'post', 'advanced', 'core'); 151 152 function post_slug_meta_box($post) { 153 ?> 154 <label class="hidden" for="post_name"><?php _e('Post Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" /> 155 <?php 156 } 157 add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'advanced', 'core'); 158 159 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM 160 if ( $post->post_author && !in_array($post->post_author, $authors) ) 161 $authors[] = $post->post_author; 162 if ( $authors && count( $authors ) > 1 ) : 163 function post_author_meta_box($post) { 164 global $current_user, $user_ID; 165 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM 166 if ( $post->post_author && !in_array($post->post_author, $authors) ) 167 $authors[] = $post->post_author; 168 ?> 169 <label class="hidden" for="post_author_override"><?php _e('Post Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?> 170 <?php 171 } 172 add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'advanced', 'core'); 173 endif; 174 175 if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) : 176 function post_revisions_meta_box($post) { 177 wp_list_post_revisions(); 178 } 179 add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'advanced', 'core'); 180 endif; 181 182 ?> 36 183 37 184 <form name="post" action="post.php" method="post" id="post"> … … 81 228 82 229 <div id="poststuff"> 230 231 <div id="side-info-column"> 83 232 84 233 <div class="submitbox" id="submitpost"> … … 173 322 </p> 174 323 324 </div> 325 175 326 <div class="side-info"> 176 327 <h5><?php _e('Related') ?></h5> … … 193 344 194 345 <?php do_action('submitpost_box'); ?> 346 347 <?php do_meta_boxes('post', 'side', $post); ?> 348 195 349 </div> 196 350 … … 218 372 <?php wp_nonce_field( 'getpermalink', 'getpermalinknonce', false ); ?> 219 373 <?php wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false ); ?> 374 <?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?> 220 375 </div> 221 376 … … 223 378 <?php echo $form_prevstatus ?> 224 379 225 <?php226 function post_tags_meta_box($post) {227 ?>228 <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>229 <div id="tagchecklist"></div>230 <?php231 }232 add_meta_box('tagsdiv', __('Tags'), 'post_tags_meta_box', 'post', 'normal', 'core');233 234 function post_categories_meta_box($post) {235 ?>236 <div id="category-adder" class="wp-hidden-children">237 <h4><a id="category-add-toggle" href="#category-add" class="hide-if-no-js" tabindex="3"><?php _e( '+ Add New Category' ); ?></a></h4>238 <p id="category-add" class="wp-hidden-child">239 <label class="hidden" for="newcat"><?php _e( 'Add New Category' ); ?></label><input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" tabindex="3" aria-required="true"/>240 <label class="hidden" for="newcat_parent"><?php _e('Parent category'); ?>:</label><?php wp_dropdown_categories( array( 'hide_empty' => 0, 'name' => 'newcat_parent', 'orderby' => 'name', 'hierarchical' => 1, 'show_option_none' => __('Parent category'), 'tab_index' => 3 ) ); ?>241 <input type="button" id="category-add-sumbit" class="add:categorychecklist:category-add button" value="<?php _e( 'Add' ); ?>" tabindex="3" />242 <?php wp_nonce_field( 'add-category', '_ajax_nonce', false ); ?>243 <span id="category-ajax-response"></span>244 </p>245 </div>246 247 <ul id="category-tabs">248 <li class="ui-tabs-selected"><a href="#categories-all" tabindex="3"><?php _e( 'All Categories' ); ?></a></li>249 <li class="wp-no-js-hidden"><a href="#categories-pop" tabindex="3"><?php _e( 'Most Used' ); ?></a></li>250 </ul>251 252 <div id="categories-pop" class="ui-tabs-panel" style="display: none;">253 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear" >254 <?php $popular_ids = wp_popular_terms_checklist('category'); ?>255 </ul>256 </div>257 258 <div id="categories-all" class="ui-tabs-panel">259 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">260 <?php wp_category_checklist($post->ID, false, false, $popular_ids) ?>261 </ul>262 </div>263 <?php264 }265 add_meta_box('categorydiv', __('Categories'), 'post_categories_meta_box', 'post', 'normal', 'core');266 ?>267 268 380 <?php do_meta_boxes('post', 'normal', $post); ?> 269 381 … … 273 385 274 386 <?php 275 function post_excerpt_meta_box($post) {276 ?>277 <label class="hidden" for="excerpt"><?php _e('Excerpt') ?></label><textarea rows="1" cols="40" name="excerpt" tabindex="6" id="excerpt"><?php echo $post->post_excerpt ?></textarea>278 <p><?php _e('Excerpts are optional hand-crafted summaries of your content. You can <a href="http://codex.wordpress.org/Template_Tags/the_excerpt" target="_blank">use them in your template</a>'); ?></p>279 <?php280 }281 add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', 'post', 'advanced', 'core');282 283 function post_trackback_meta_box($post) {284 $form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. attribute_escape( str_replace("\n", ' ', $post->to_ping) ) .'" />';285 if ('' != $post->pinged) {286 $pings = '<p>'. __('Already pinged:') . '</p><ul>';287 $already_pinged = explode("\n", trim($post->pinged));288 foreach ($already_pinged as $pinged_url) {289 $pings .= "\n\t<li>" . wp_specialchars($pinged_url) . "</li>";290 }291 $pings .= '</ul>';292 }293 294 ?>295 <p><label for="trackback"><?php _e('Send trackbacks to:'); ?></label> <?php echo $form_trackback; ?><br /> (<?php _e('Separate multiple URLs with spaces'); ?>)</p>296 <p><?php _e('Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress blogs they’ll be notified automatically using <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">pingbacks</a>, no other action necessary.'); ?></p>297 <?php298 if ( ! empty($pings) )299 echo $pings;300 }301 add_meta_box('trackbacksdiv', __('Trackbacks'), 'post_trackback_meta_box', 'post', 'advanced', 'core');302 303 function post_custom_meta_box($post) {304 ?>305 <div id="postcustomstuff">306 <table cellpadding="3">307 <?php308 $metadata = has_meta($post->ID);309 list_meta($metadata);310 ?>311 312 </table>313 <?php314 meta_form();315 ?>316 <div id="ajax-response"></div>317 </div>318 <p><?php _e('Custom fields can be used to add extra metadata to a post that you can <a href="http://codex.wordpress.org/Using_Custom_Fields" target="_blank">use in your theme</a>.'); ?></p>319 <?php320 }321 add_meta_box('postcustom', __('Custom Fields'), 'post_custom_meta_box', 'post', 'advanced', 'core');322 323 do_action('dbx_post_advanced');324 325 function post_comment_status_meta_box($post) {326 ?>327 <input name="advanced_view" type="hidden" value="1" />328 <p><label for="comment_status" class="selectit">329 <input name="comment_status" type="checkbox" id="comment_status" value="open" <?php checked($post->comment_status, 'open'); ?> />330 <?php _e('Allow Comments') ?></label></p>331 <p><label for="ping_status" class="selectit"><input name="ping_status" type="checkbox" id="ping_status" value="open" <?php checked($post->ping_status, 'open'); ?> /> <?php _e('Allow Pings') ?></label></p>332 <p><?php _e('These settings apply to this post only. “Pings” are <a href="http://codex.wordpress.org/Introduction_to_Blogging#Managing_Comments" target="_blank">trackbacks and pingbacks</a>.'); ?></p>333 <?php334 }335 add_meta_box('commentstatusdiv', __('Comments & Pings'), 'post_comment_status_meta_box', 'post', 'advanced', 'core');336 337 function post_password_meta_box($post) {338 ?>339 <p><label class="hidden" for="post_password"><?php _e('Password Protect This Post') ?></label><input name="post_password" type="text" size="25" id="post_password" value="<?php echo attribute_escape( $post->post_password ); ?>" /></p>340 <p><?php _e('Setting a password will require people who visit your blog to enter the above password to view this post and its comments.'); ?></p>341 <?php342 }343 add_meta_box('passworddiv', __('Password Protect This Post'), 'post_password_meta_box', 'post', 'advanced', 'core');344 345 function post_slug_meta_box($post) {346 ?>347 <label class="hidden" for="post_name"><?php _e('Post Slug') ?></label><input name="post_name" type="text" size="13" id="post_name" value="<?php echo attribute_escape( $post->post_name ); ?>" />348 <?php349 }350 add_meta_box('slugdiv', __('Post Slug'), 'post_slug_meta_box', 'post', 'advanced', 'core');351 352 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM353 if ( $post->post_author && !in_array($post->post_author, $authors) )354 $authors[] = $post->post_author;355 if ( $authors && count( $authors ) > 1 ) :356 function post_author_meta_box($post) {357 global $current_user, $user_ID;358 $authors = get_editable_user_ids( $current_user->id ); // TODO: ROLE SYSTEM359 if ( $post->post_author && !in_array($post->post_author, $authors) )360 $authors[] = $post->post_author;361 ?>362 <label class="hidden" for="post_author_override"><?php _e('Post Author'); ?></label><?php wp_dropdown_users( array('include' => $authors, 'name' => 'post_author_override', 'selected' => empty($post->ID) ? $user_ID : $post->post_author) ); ?>363 <?php364 }365 add_meta_box('authordiv', __('Post Author'), 'post_author_meta_box', 'post', 'advanced', 'core');366 endif;367 368 if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) :369 function post_revisions_meta_box($post) {370 wp_list_post_revisions();371 }372 add_meta_box('revisionsdiv', __('Post Revisions'), 'post_revisions_meta_box', 'post', 'advanced', 'core');373 endif;374 387 375 388 do_meta_boxes('post', 'advanced', $post); 376 389 377 390 do_action('dbx_post_sidebar'); 391 378 392 ?> 379 393 </div> -
branches/crazyhorse/wp-admin/includes/template.php
r8147 r8219 1135 1135 global $wp_meta_boxes; 1136 1136 1137 1138 1137 if ( !isset($wp_meta_boxes) ) 1139 1138 $wp_meta_boxes = array(); … … 1143 1142 $wp_meta_boxes[$page][$context] = array(); 1144 1143 1144 foreach ( array_keys($wp_meta_boxes[$page]) as $a_context ) { 1145 1145 foreach ( array('high', 'core', 'default', 'low') as $a_priority ) { 1146 if ( !isset($wp_meta_boxes[$page][$ context][$a_priority][$id]) )1146 if ( !isset($wp_meta_boxes[$page][$a_context][$a_priority][$id]) ) 1147 1147 continue; 1148 1148 1149 // If a core box was previously added or removed by a plugin, don't add. 1149 1150 if ( 'core' == $priority ) { 1150 1151 // If core box previously deleted, don't add 1151 if ( false === $wp_meta_boxes[$page][$ context][$a_priority][$id] )1152 if ( false === $wp_meta_boxes[$page][$a_context][$a_priority][$id] ) 1152 1153 return; 1153 1154 // If box was added with default priority, give it core priority to maintain sort order 1154 1155 if ( 'default' == $a_priority ) { 1155 $wp_meta_boxes[$page][$ context]['core'][$id] = $wp_meta_boxes[$page][$context]['default'][$id];1156 unset($wp_meta_boxes[$page][$ context]['default'][$id]);1156 $wp_meta_boxes[$page][$a_context]['core'][$id] = $wp_meta_boxes[$page][$a_context]['default'][$id]; 1157 unset($wp_meta_boxes[$page][$a_context]['default'][$id]); 1157 1158 } 1158 1159 return; 1159 1160 } 1160 1161 // If no priority given and id already present, use existing priority 1161 if ( empty($priority) ) 1162 if ( empty($priority) ) { 1162 1163 $priority = $a_priority; 1163 // An id can be in only one priority 1164 if ( $priority != $a_priority ) 1165 unset($wp_meta_boxes[$page][$context][$a_priority][$id]); 1164 // else if we're adding to the sorted priortiy, we don't know the title or callback. Glab them from the previously added context/priority. 1165 } elseif ( 'sorted' == $priority ) { 1166 $title = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['title']; 1167 $callback = $wp_meta_boxes[$page][$a_context][$a_priority][$id]['callback']; 1168 } 1169 // An id can be in only one priority and one context 1170 if ( $priority != $a_priority || $context != $a_context ) 1171 unset($wp_meta_boxes[$page][$a_context][$a_priority][$id]); 1172 } 1166 1173 } 1167 1174 1168 1175 if ( empty($priority) ) 1169 $priority = low;1176 $priority = 'low'; 1170 1177 1171 1178 if ( !isset($wp_meta_boxes[$page][$context][$priority]) ) … … 1177 1184 function do_meta_boxes($page, $context, $object) { 1178 1185 global $wp_meta_boxes; 1186 static $already_sorted = false; 1179 1187 1180 1188 do_action('do_meta_boxes', $page, $context, $object); 1181 1189 1182 if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) ) 1183 return; 1184 1185 foreach ( array('high', 'core', 'default', 'low') as $priority ) { 1186 foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) { 1187 if ( false === $box ) 1188 continue; 1189 echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '">' . "\n"; 1190 echo "<h3>{$box['title']}</h3>\n"; 1191 echo '<div class="inside">' . "\n"; 1192 call_user_func($box['callback'], $object, $box); 1193 echo "</div>\n"; 1194 echo "</div>\n"; 1195 } 1196 } 1190 echo "<div id='$context-sortables' class='meta-box-sortables'>\n"; 1191 1192 do { 1193 // Grab the ones the user has manually sorted. Pull them out of their previous context/priority and into the one the user chose 1194 if ( !$already_sorted && $sorted = get_user_option( "meta-box-order_$page" ) ) { 1195 foreach ( $sorted as $box_context => $ids ) 1196 foreach ( explode(',', $ids) as $id ) 1197 if ( $id ) 1198 add_meta_box( $id, null, null, $page, $box_context, 'sorted' ); 1199 } 1200 $already_sorted = true; 1201 1202 if ( !isset($wp_meta_boxes) || !isset($wp_meta_boxes[$page]) || !isset($wp_meta_boxes[$page][$context]) ) 1203 break; 1204 1205 1206 foreach ( array('high', 'sorted', 'core', 'default', 'low') as $priority ) { 1207 foreach ( (array) $wp_meta_boxes[$page][$context][$priority] as $box ) { 1208 if ( false === $box ) 1209 continue; 1210 echo '<div id="' . $box['id'] . '" class="postbox ' . postbox_classes($box['id'], $page) . '">' . "\n"; 1211 echo "<h3>{$box['title']}</h3>\n"; 1212 echo '<div class="inside">' . "\n"; 1213 call_user_func($box['callback'], $object, $box); 1214 echo "</div>\n"; 1215 echo "</div>\n"; 1216 } 1217 } 1218 } while(0); 1219 1220 echo "</div>"; 1221 1197 1222 } 1198 1223 -
branches/crazyhorse/wp-admin/js/post.js
r7956 r8219 71 71 // postboxes 72 72 add_postbox_toggles('post'); 73 74 var postingMetaBox = false; // post once, not once per sortable 75 jQuery('.meta-box-sortables').sortable( { 76 connectWith: [ '.meta-box-sortables' ], 77 handle: 'h3', 78 update: function() { 79 if ( postingMetaBox ) { 80 return; 81 } 82 postingMetaBox = true; 83 var postVars = { 84 action: 'meta-box-order', 85 _ajax_nonce: jQuery('#meta-box-order-nonce').val(), 86 page: 'post' 87 } 88 jQuery('.meta-box-sortables').each( function() { 89 postVars["order[" + this.id.split('-')[0] + "]"] = jQuery(this).sortable( 'toArray' ).join(','); 90 } ); 91 jQuery.post( postboxL10n.requestFile, postVars, function() { 92 postingMetaBox = false; 93 } ); 94 } 95 } ); 73 96 74 97 // Editable slugs -
branches/crazyhorse/wp-admin/js/postbox.js
r7290 r8219 1 1 function add_postbox_toggles(page) { 2 jQuery('.postbox h3'). prepend('<a class="togbox">+</a> ');3 jQuery('.postbox h3').click( function() { jQuery(jQuery(this).parent().get(0)).toggleClass('closed'); save_postboxes_state(page); } );2 jQuery('.postbox h3').before('<a class="togbox">+</a> '); 3 jQuery('.postbox a.togbox').click( function() { jQuery(jQuery(this).parent().get(0)).toggleClass('closed'); save_postboxes_state(page); } ); 4 4 } 5 5 -
branches/crazyhorse/wp-admin/wp-admin.css
r8124 r8219 931 931 /* Post Screen */ 932 932 933 .meta-box-sortables { 934 min-height: 50px; 935 } 936 937 .postbox { 938 position: relative; 939 } 940 933 941 #tagsdiv #newtag { 934 942 margin-right: 5px; … … 1134 1142 display: block; 1135 1143 height: 37px; 1136 margin-left: - 21px;1137 margin-top: - 10px;1144 margin-left: -14px; 1145 margin-top: -3px; 1138 1146 overflow: hidden; 1139 1147 position: absolute; … … 1162 1170 } 1163 1171 1164 .submitbox{1172 #side-info-column { 1165 1173 width: 220px; 1166 1174 float: right; -
branches/crazyhorse/wp-includes/script-loader.php
r8151 r8219 127 127 $scripts->add( 'xfn', '/wp-admin/js/xfn.js', false, '3517' ); 128 128 $scripts->add( 'upload', '/wp-admin/js/upload.js', array('jquery'), '20070518' ); 129 $scripts->add( 'postbox', '/wp-admin/js/postbox.js', array('jquery'), '20080 128' );129 $scripts->add( 'postbox', '/wp-admin/js/postbox.js', array('jquery'), '20080630' ); 130 130 $scripts->localize( 'postbox', 'postboxL10n', array( 131 131 'requestFile' => admin_url('admin-ajax.php'), … … 137 137 'cancel' => __('Cancel'), 138 138 ) ); 139 $scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', ' wp-lists', 'postbox', 'slug'), '20080519' );139 $scripts->add( 'post', '/wp-admin/js/post.js', array('suggest', 'jquery-ui-tabs', 'jquery-ui-sortable', 'wp-lists', 'postbox', 'slug'), '20080630' ); 140 140 $scripts->localize( 'post', 'postL10n', array( 141 141 'tagsUsed' => __('Tags used on this post:'),
Note: See TracChangeset
for help on using the changeset viewer.