Changeset 4276
- Timestamp:
- 10/03/2006 03:40:26 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/upload-functions.php
r4274 r4276 304 304 305 305 echo "<form action='' id='browse-form'><input type='hidden' id='nonce-value' value='" . wp_create_nonce( 'inlineuploading' ) . "' /></form>\n"; 306 307 // echo $total;308 306 break; 309 307 endswitch; -
trunk/wp-admin/upload-js.php
r4274 r4276 166 166 if ( filesEl ) 167 167 filesEl.hide(); 168 var navEl = $('current-tab-nav'); 169 if ( navEl ) 170 navEl.hide(); 168 171 this.grabImageData(id); 169 172 }, … … 174 177 if ( filesEl ) 175 178 filesEl.show(); 179 var navEl = $('current-tab-nav'); 180 if ( navEl ) 181 navEl.show(); 176 182 } 177 183 if ( !this.ID ) -
trunk/wp-admin/upload-rtl.css
r4274 r4276 3 3 #upload-menu li { margin: 0 .75em 0 0; } 4 4 5 #upload-menu .current a{5 #upload-menu .current div { 6 6 border-right: 0; 7 7 border-left: 2px solid #448abd; -
trunk/wp-admin/upload.css
r4274 r4276 15 15 #upload-menu li { margin: 0 0 0 .75em; } 16 16 17 #upload-menu a{18 display: block;17 #upload-menu li div { 18 color: #000; 19 19 padding: 5px; 20 border-top: 3px solid #fff; 21 } 22 23 #upload-menu li a { 20 24 color: #000; 21 border-top: 3px solid #fff;22 25 text-decoration: none; 23 26 border-bottom: none; 24 27 } 25 28 26 #upload-menu .current a { 29 #upload-menu li span a.page-numbers { color: #00019b; } 30 31 #upload-menu .current div { 27 32 background: #dfe8f1; 28 33 border-right: 2px solid #448abd; 29 34 } 30 35 31 #upload-menu a:hover {36 #upload-menu div:hover { 32 37 background: #dfe8f1; 33 38 color: #000; -
trunk/wp-admin/upload.php
r4274 r4276 25 25 $all_atts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment'"); 26 26 $post_atts = 0; 27 27 28 if ( $pid ) { 28 $wp_upload_tabs['upload'] = array(__('Upload'), 'upload_files', 'wp_upload_tab_upload'); 29 // 0 => tab display name, 1 => required cap, 2 => function that produces tab content, 3 => total number objects OR array(total, objects per page), 4 => add_query_args 30 $wp_upload_tabs['upload'] = array(__('Upload'), 'upload_files', 'wp_upload_tab_upload', 0); 29 31 if ( $all_atts && $post_atts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_type = 'attachment' AND post_parent = '$post_id'") ) 30 $wp_upload_tabs['browse'] = array(__('Browse'), 'upload_files', "wp_upload_tab_browse" );32 $wp_upload_tabs['browse'] = array(__('Browse'), 'upload_files', "wp_upload_tab_browse", $action ? 0 : $post_atts); 31 33 if ( $post_atts < $all_atts ) 32 $wp_upload_tabs['browse-all'] = array(__('Browse All'), 'upload_files', 'wp_upload_tab_browse' );34 $wp_upload_tabs['browse-all'] = array(__('Browse All'), 'upload_files', 'wp_upload_tab_browse', $action ? 0 : $all_atts); 33 35 } else 34 $wp_upload_tabs['browse-all'] = array(__('Browse All'), 'upload_files', 'wp_upload_tab_browse' );36 $wp_upload_tabs['browse-all'] = array(__('Browse All'), 'upload_files', 'wp_upload_tab_browse', $action ? 0 : $all_atts); 35 37 36 38 $wp_upload_tabs = array_merge($wp_upload_tabs, apply_filters( 'wp_upload_tabs', array() )); … … 55 57 foreach ( $wp_upload_tabs as $t => $tab_array ) { // We've already done the current_user_can check 56 58 $class = 'upload-tab'; 57 $href = add_query_arg( array('tab' => $t, 'ID' => '', 'action' => '' ) );58 if ( isset($tab_array[ 3]) && is_array($tab_array[3]) )59 add_query_arg( $tab_array[ 3], $href );59 $href = add_query_arg( array('tab' => $t, 'ID' => '', 'action' => '', 'paged' => '') ); 60 if ( isset($tab_array[4]) && is_array($tab_array[4]) ) 61 add_query_arg( $tab_array[4], $href ); 60 62 $_href = wp_specialchars( $href, 1 ); 61 if ( $tab == $t ) 63 $page_links = ''; 64 if ( $tab == $t ) { 62 65 $class .= ' current'; 63 echo "\t<li class='$class left'><a href='$_href' title='{$tab_array[0]}'>{$tab_array[0]}</a></li>\n"; 66 if ( $tab_array[3] ) { 67 if ( is_array($tab_array[3]) ) { 68 $total = $tab_array[3][0]; 69 $per = $tab_array[3][1]; 70 } else { 71 $total = $tab_array[3]; 72 $per = 10; 73 } 74 $page_links = paginate_links( array( 75 'base' => add_query_arg( 'paged', '%#%' ), 76 'format' => '', 77 'total' => ceil($total / $per), 78 'current' => $paged ? $paged : 1, 79 'prev_text' => '«', 80 'next_text' => '»' 81 )); 82 if ( $page_links ) 83 $page_links = "<span id='current-tab-nav'>: $page_links</span>"; 84 } 85 } 86 87 echo "\t<li class='$class left'><div><a href='$_href' title='{$tab_array[0]}'>{$tab_array[0]}</a>$page_links</div></li>\n"; 64 88 } 89 unset($t, $tab_array, $href, $_href, $page_links, $total, $per, $class); 65 90 echo "</ul>\n\n"; 66 91 -
trunk/wp-includes/general-template.php
r4275 r4276 903 903 // Who knows what else people pass in $args 904 904 $total = (int) $total; 905 if ( $total < 2 ) 906 return; 905 907 $current = (int) $current; 906 908 $end_size = 0 < (int) $end_size ? (int) $end_size : 1; // Out of bounds? Make it the default. … … 913 915 914 916 if ( $prev_next && $current && 1 < $current ) : 915 $link = str_replace('%_%', 2 == $current ? '' : str_replace('%#%', $current - 1, $format), $base); 917 $link = str_replace('%_%', 2 == $current ? '' : $format, $base); 918 $link = str_replace('%#%', $current - 1, $link); 916 919 if ( $add_args ) 917 920 $link = add_query_arg( $add_args, $link ); … … 924 927 else : 925 928 if ( $show_all || ( $n <= $end_size || ( $current && $n >= $current - $mid_size && $n <= $current + $mid_size ) || $n > $total - $end_size ) ) : 926 $link = str_replace('%_%', 1 == $n ? '' : str_replace('%#%', $n, $format), $base); 929 $link = str_replace('%_%', 1 == $n ? '' : $format, $base); 930 $link = str_replace('%#%', $n, $link); 927 931 if ( $add_args ) 928 932 $link = add_query_arg( $add_args, $link ); … … 936 940 endfor; 937 941 if ( $prev_next && $current && ( $current < $total || -1 == $total ) ) : 938 $link = str_replace('%_%', str_replace('%#%', $current + 1, $format), $base); 942 $link = str_replace('%_%', $format, $base); 943 $link = str_replace('%#%', $current + 1, $link); 939 944 if ( $add_args ) 940 945 $link = add_query_arg( $add_args, $link );
Note: See TracChangeset
for help on using the changeset viewer.