Changeset 639648 for wp-multi-network
- Timestamp:
- 12/15/2012 11:37:08 AM (13 years ago)
- File:
-
- 1 edited
-
wp-multi-network/trunk/wpmn-admin.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-multi-network/trunk/wpmn-admin.php
r639635 r639648 22 22 add_action( 'admin_menu', array( &$this, 'admin_menu' ) ); 23 23 add_action( 'network_admin_menu', array( &$this, 'network_admin_menu' ) ); 24 24 25 25 add_filter( 'manage_sites_action_links', array( &$this, 'add_move_blog_link' ), 10, 3 ); 26 26 if( ! has_action( 'manage_sites_action_links' ) ) { … … 48 48 } 49 49 } ); 50 50 51 51 /** add field to signal javascript is enabled */ 52 52 jQuery(document.createElement('input')) … … 55 55 .attr( 'value', 'true' ) 56 56 .appendTo( '#site-assign-form' ); 57 57 58 58 /** Handle clicks to add/remove sites to/from selected list */ 59 59 jQuery( 'input[name=assign]' ).click( function() { move( 'from', 'to' ); }); 60 60 jQuery( 'input[name=unassign]' ).click( function() { move( 'to', 'from' ); }); 61 61 62 62 /** Select all sites in "selected" box when submitting */ 63 63 jQuery( '#site-assign-form' ).submit( function() { … … 79 79 <?php 80 80 } 81 81 82 82 /** 83 83 * Add the Move action to Sites page on WP >= 3.1 … … 92 92 return $actions; 93 93 } 94 94 95 95 /** 96 96 * Legacy - add a Move link on Sites page on WP < 3.1 … … 117 117 118 118 // add_submenu_page( 'settings.php', __('Networks Settings'), __('Networks Settings'), 'manage_network_options', 'networks-settings', array( &$this, 'networks_settings_page' ) ); 119 119 120 120 require dirname(__FILE__) . '/includes/class-wp-ms-networks-list-table.php'; 121 121 add_filter( 'manage_' . $page . '-network' . '_columns', array( new WP_MS_Networks_List_Table(), 'get_columns' ), 0 ); 122 122 123 123 } 124 124 … … 208 208 209 209 function all_networks() { 210 211 $wp_list_table = new WP_MS_Networks_List_Table(); 210 $wp_list_table = new WP_MS_Networks_List_Table(); 212 211 $wp_list_table->prepare_items(); ?> 213 212 214 213 <div class="wrap"> 215 <?php screen_icon('ms-admin'); ?> 216 <h2><?php _e('Networks') ?> 217 218 <?php $this->feedback() ?> 214 <?php screen_icon( 'ms-admin' ); ?> 215 <h2><?php _e( 'Networks' ) ?> 219 216 220 217 <?php if ( current_user_can( 'manage_network_options' ) ) : ?> 221 218 222 <a href="<?php echo add_query_arg(array('page'=>'add-new-network'), $this->admin_url())?>" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'site' ); ?></a>223 224 <?php endif; ?>225 226 <?phpif ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) {219 <a href="<?php echo add_query_arg( array('page' => 'add-new-network' ), $this->admin_url() ); ?>" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'site' ); ?></a> 220 221 <?php endif; 222 223 if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) { 227 224 printf( '<span class="subtitle">' . __( 'Search results for “%s”' ) . '</span>', esc_html( $_REQUEST['s'] ) ); 228 225 } ?> 229 226 </h2> 230 227 231 228 <form action="" method="get" id="domain-search"> 232 229 <?php $wp_list_table->search_box( __( 'Search Networks' ), 'networks' ); ?> 233 230 <input type="hidden" name="action" value="domains" /> 234 231 </form> 235 232 236 233 <form id="form-domain-list" action="admin.php?action=domains" method="post"> 237 234 <?php $wp_list_table->display(); ?> 238 235 </form> 239 236 </div> 237 240 238 <?php 241 239 } … … 245 243 246 244 // Strip off URL parameters 247 $query_str = remove_query_arg( array(245 $query_str = remove_query_arg( array( 248 246 'action', 'id', 'updated', 'deleted' 249 )); 250 251 ?> 252 253 <div id="icon-ms-admin" class="icon32"></div> 254 <h2><?php _e( 'Networks' ) ?></h2> 255 256 <div id="col-container"> 257 <p><?php _e( 'A site will be created at the root of the new network' ); ?>.</p> 258 <form method="POST" action="<?php echo add_query_arg( array( 'action' => 'addnetwork' ), $query_str ); ?>"> 259 <table class="form-table"> 260 <tr><th scope="row"><label for="newName"><?php _e( 'Network Name' ); ?>:</label></th><td><input type="text" name="name" id="newName" title="<?php _e( 'A friendly name for your new network' ); ?>" /></td></tr> 261 <tr><th scope="row"><label for="newDom"><?php _e( 'Domain' ); ?>:</label></th><td> http://<input type="text" name="domain" id="newDom" title="<?php _e( 'The domain for your new network' ); ?>" /></td></tr> 262 <tr><th scope="row"><label for="newPath"><?php _e( 'Path' ); ?>:</label></th><td><input type="text" name="path" id="newPath" title="<?php _e( 'If you are unsure, put in /' ); ?>" /></td></tr> 263 <tr><th scope="row"><label for="newSite"><?php _e( 'Site Name' ); ?>:</label></th><td><input type="text" name="newSite" id="newSite" title="<?php _e( 'The name for the new network\'s site.' ); ?>" /></td></tr> 264 </table> 265 <div class="metabox-holder meta-box-sortables" id="advanced_network_options"> 266 <div class="postbox if-js-closed"> 267 <div title="Click to toggle" class="handlediv"><br/></div> 268 <h3><span><?php _e( 'Clone Network Options' ); ?></span></h3> 269 <div class="inside"> 270 <table class="form-table"> 271 <tr> 272 <th scope="row"><label for="cloneNetwork"><?php _e( 'Clone Network' ); ?>:</label></th> 273 <?php $network_list = $wpdb->get_results( 'SELECT id, domain FROM ' . $wpdb->site, ARRAY_A ); ?> 274 <td colspan="2"> 275 <select name="cloneNetwork" id="cloneNetwork"> 276 <option value="0"><?php _e( 'Do Not Clone' ); ?></option> 277 <?php foreach ( $network_list as $network ) { ?> 278 <option value="<?php echo $network['id'] ?>" <?php selected( $network['id'] ) ?>><?php echo $network['domain'] ?></option> 279 <?php } ?> 280 </select> 281 </td> 282 </tr> 283 <tr> 284 <?php 285 $class = ''; 286 $all_network_options = $wpdb->get_results( 'SELECT DISTINCT meta_key FROM ' . $wpdb->sitemeta ); 287 $known_networkmeta_options = network_options_to_copy(); 288 $known_networkmeta_options = apply_filters( 'manage_sitemeta_descriptions', $known_networkmeta_options ); 289 ?> 290 291 <td colspan="3"> 292 <table class="widefat"> 293 <thead> 294 <tr> 295 <th scope="col" class="check-column"></th> 296 <th scope="col"><?php _e( 'Meta Value' ); ?></th> 297 <th scope="col"><?php _e( 'Description' ); ?></th> 298 </tr> 299 </thead> 300 <tbody> 301 302 <?php foreach ( $all_network_options as $count => $option ) { ?> 303 304 <tr class="<?php echo $class = ('alternate' == $class) ? '' : 'alternate'; ?>"> 305 <th scope="row" class="check-column"><input type="checkbox" id="option_<?php echo $count; ?>" name="options_to_clone[<?php echo $option->meta_key; ?>]"<?php echo (array_key_exists( $option->meta_key, network_options_to_copy() ) ? ' checked' : '' ); ?> /></th> 306 <td><label for="option_<?php echo $count; ?>"><?php echo $option->meta_key; ?></label></td> 307 <td><label for="option_<?php echo $count; ?>"><?php echo (array_key_exists( $option->meta_key, $known_networkmeta_options ) ? __( $known_networkmeta_options[$option->meta_key] ) : '' ); ?></label></td> 247 ) ); ?> 248 249 <div class="wrap"> 250 <?php screen_icon( 'ms-admin' ); ?> 251 <h2><?php _e( 'Networks' ) ?></h2> 252 253 <div id="col-container"> 254 <p><?php _e( 'A site will be created at the root of the new network' ); ?>.</p> 255 <form method="POST" action="<?php echo add_query_arg( array( 'action' => 'addnetwork' ), $query_str ); ?>"> 256 <table class="form-table"> 257 <tr><th scope="row"><label for="newName"><?php _e( 'Network Name' ); ?>:</label></th><td><input type="text" name="name" id="newName" title="<?php _e( 'A friendly name for your new network' ); ?>" /></td></tr> 258 <tr><th scope="row"><label for="newDom"><?php _e( 'Domain' ); ?>:</label></th><td> http://<input type="text" name="domain" id="newDom" title="<?php _e( 'The domain for your new network' ); ?>" /></td></tr> 259 <tr><th scope="row"><label for="newPath"><?php _e( 'Path' ); ?>:</label></th><td><input type="text" name="path" id="newPath" title="<?php _e( 'If you are unsure, put in /' ); ?>" /></td></tr> 260 <tr><th scope="row"><label for="newSite"><?php _e( 'Site Name' ); ?>:</label></th><td><input type="text" name="newSite" id="newSite" title="<?php _e( 'The name for the new network\'s site.' ); ?>" /></td></tr> 261 </table> 262 <div class="metabox-holder meta-box-sortables" id="advanced_network_options"> 263 <div class="postbox if-js-closed"> 264 <div title="Click to toggle" class="handlediv"><br/></div> 265 <h3><span><?php _e( 'Clone Network Options' ); ?></span></h3> 266 <div class="inside"> 267 <table class="form-table"> 268 <tr> 269 <th scope="row"><label for="cloneNetwork"><?php _e( 'Clone Network' ); ?>:</label></th> 270 <?php $network_list = $wpdb->get_results( 'SELECT id, domain FROM ' . $wpdb->site, ARRAY_A ); ?> 271 <td colspan="2"> 272 <select name="cloneNetwork" id="cloneNetwork"> 273 <option value="0"><?php _e( 'Do Not Clone' ); ?></option> 274 <?php foreach ( $network_list as $network ) { ?> 275 <option value="<?php echo $network['id'] ?>" <?php selected( $network['id'] ) ?>><?php echo $network['domain'] ?></option> 276 <?php } ?> 277 </select> 278 </td> 279 </tr> 280 <tr> 281 <?php 282 $class = ''; 283 $all_network_options = $wpdb->get_results( 'SELECT DISTINCT meta_key FROM ' . $wpdb->sitemeta ); 284 $known_networkmeta_options = network_options_to_copy(); 285 $known_networkmeta_options = apply_filters( 'manage_sitemeta_descriptions', $known_networkmeta_options ); 286 ?> 287 288 <td colspan="3"> 289 <table class="widefat"> 290 <thead> 291 <tr> 292 <th scope="col" class="check-column"></th> 293 <th scope="col"><?php _e( 'Meta Value' ); ?></th> 294 <th scope="col"><?php _e( 'Description' ); ?></th> 308 295 </tr> 309 310 <?php } ?> 311 312 </tbody> 313 </table> 314 </td> 315 </tr> 316 </table> 296 </thead> 297 <tbody> 298 299 <?php foreach ( $all_network_options as $count => $option ) { ?> 300 301 <tr class="<?php echo $class = ('alternate' == $class) ? '' : 'alternate'; ?>"> 302 <th scope="row" class="check-column"><input type="checkbox" id="option_<?php echo $count; ?>" name="options_to_clone[<?php echo $option->meta_key; ?>]"<?php echo (array_key_exists( $option->meta_key, network_options_to_copy() ) ? ' checked' : '' ); ?> /></th> 303 <td><label for="option_<?php echo $count; ?>"><?php echo $option->meta_key; ?></label></td> 304 <td><label for="option_<?php echo $count; ?>"><?php echo (array_key_exists( $option->meta_key, $known_networkmeta_options ) ? __( $known_networkmeta_options[$option->meta_key] ) : '' ); ?></label></td> 305 </tr> 306 307 <?php } ?> 308 309 </tbody> 310 </table> 311 </td> 312 </tr> 313 </table> 314 </div> 317 315 </div> 318 316 </div> 319 </div> 320 321 <input type="submit" class="button" name="add" value="<?php _e( 'Create Network' ); ?>" /> 322 323 </ form>317 318 <input type="submit" class="button" name="add" value="<?php _e( 'Create Network' ); ?>" /> 319 320 </form> 321 </div> 324 322 </div> 325 323 … … 360 358 } ?> 361 359 362 <div id="icon-ms-admin" class="icon32"></div> 363 <h2><?php _e( 'WP Multi-Network' ) ?></h2> 364 <h3><?php echo __( 'Moving' ) . ' ' . stripslashes( $details->option_value ); ?></h3> 365 <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> 366 <table class="widefat"> 367 <thead> 368 <tr> 369 <th scope="col"><?php _e( 'From' ); ?>:</th> 370 <th scope="col"><label for="to"><?php _e( 'To' ); ?>:</label></th> 371 </tr> 372 </thead> 373 <tr> 374 <td><?php echo $myNetwork->domain; ?></td> 375 <td> 376 <select name="to" id="to"> 377 <option value="0"><?php _e( 'Select a Network' ); ?></option> 378 <?php 379 foreach ( $sites as $network ) { 380 if ( $network->id != $myNetwork->id ) : ?> 381 <option value="<?php echo $network->id ?>"><?php echo $network->domain; ?></option> 382 <?php 383 endif; 384 } 385 ?> 386 </select> 387 </td> 388 </tr> 389 </table> 390 <br /> 391 <?php if ( has_action( 'add_move_blog_option' ) ) : ?> 360 <div class="wrap"> 361 <?php screen_icon( 'ms-admin' ); ?> 362 <h2><?php _e( 'Networks' ) ?></h2> 363 <h3><?php echo __( 'Moving' ) . ' ' . stripslashes( $details->option_value ); ?></h3> 364 <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> 392 365 <table class="widefat"> 393 366 <thead> 394 <tr scope="col"><th colspan="2"><?php _e( 'Options' ); ?>:</th></tr> 367 <tr> 368 <th scope="col"><?php _e( 'From' ); ?>:</th> 369 <th scope="col"><label for="to"><?php _e( 'To' ); ?>:</label></th> 370 </tr> 395 371 </thead> 396 <?php do_action( 'add_move_blog_option', $site->blog_id ); ?> 372 <tr> 373 <td><?php echo $myNetwork->domain; ?></td> 374 <td> 375 <select name="to" id="to"> 376 <option value="0"><?php _e( 'Select a Network' ); ?></option> 377 <?php 378 foreach ( $sites as $network ) { 379 if ( $network->id != $myNetwork->id ) : ?> 380 <option value="<?php echo $network->id ?>"><?php echo $network->domain; ?></option> 381 <?php 382 endif; 383 } 384 ?> 385 </select> 386 </td> 387 </tr> 397 388 </table> 398 389 <br /> 399 <?php endif; ?> 400 <div> 401 <input type="hidden" name="from" value="<?php echo $site->site_id; ?>" /> 402 <input class="button" type="submit" name="move" value="<?php _e( 'Move Site' ); ?>" /> 403 <a class="button" href="./sites.php"><?php _e( 'Cancel' ); ?></a> 404 </div> 405 </form> 390 <?php if ( has_action( 'add_move_blog_option' ) ) : ?> 391 <table class="widefat"> 392 <thead> 393 <tr scope="col"><th colspan="2"><?php _e( 'Options' ); ?>:</th></tr> 394 </thead> 395 <?php do_action( 'add_move_blog_option', $site->blog_id ); ?> 396 </table> 397 <br /> 398 <?php endif; ?> 399 <div> 400 <input type="hidden" name="from" value="<?php echo $site->site_id; ?>" /> 401 <input class="button" type="submit" name="move" value="<?php _e( 'Move Site' ); ?>" /> 402 <a class="button" href="./sites.php"><?php _e( 'Cancel' ); ?></a> 403 </div> 404 </form> 405 </div> 406 406 <?php 407 407 } … … 467 467 468 468 ?> 469 <div id="icon-ms-admin" class="icon32"></div> 470 <h2><?php _e( 'WP Multi-Network' ) ?></h2> 471 <h3><?php _e( 'Assign Sites to' ); ?>: http://<?php echo $network->domain . $network->path ?></h3> 472 <noscript> 473 <div id="message" class="updated"><p><?php _e( 'Select the blogs you want to assign to this network from the column at left, and click "Update Assignments."' ); ?></p></div> 474 </noscript> 475 <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> 476 <table class="widefat"> 477 <thead> 469 <div class="wrap"> 470 <?php screen_icon( 'ms-admin' ); ?> 471 <h2><?php _e( 'Networks' ) ?></h2> 472 <h3><?php _e( 'Assign Sites to' ); ?>: http://<?php echo $network->domain . $network->path ?></h3> 473 <noscript> 474 <div id="message" class="updated"><p><?php _e( 'Select the blogs you want to assign to this network from the column at left, and click "Update Assignments."' ); ?></p></div> 475 </noscript> 476 <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> 477 <table class="widefat"> 478 <thead> 479 <tr> 480 <th><?php _e( 'Available' ); ?></th> 481 <th style="width: 2em;"></th> 482 <th><?php _e( 'Assigned' ); ?></th> 483 </tr> 484 </thead> 478 485 <tr> 479 <th><?php _e( 'Available' ); ?></th> 480 <th style="width: 2em;"></th> 481 <th><?php _e( 'Assigned' ); ?></th> 482 </tr> 483 </thead> 484 <tr> 485 <td> 486 <select name="from[]" id="from" multiple style="height: auto; width: 98%;"> 487 <?php 488 foreach ( $sites as $site ) { 489 if ( $site->site_id != $network->id ) 490 echo '<option value="' . $site->blog_id . '">' . $site->name . ' (' . $site->domain . ')</option>'; 491 } 492 ?> 493 </select> 494 </td> 495 <td> 496 <input type="button" name="unassign" id="unassign" value="<<" /><br /> 497 <input type="button" name="assign" id="assign" value=">>" /> 498 </td> 499 <td valign="top"> 500 <?php if ( ! ENABLE_NETWORK_ZERO ) { ?> 501 <ul style="margin: 0; padding: 0; list-style-type: none;"> 502 <?php foreach ( $sites as $site ) { ?> 503 <?php if ( $site->site_id == $network->id ) { ?> 504 <li><?php echo $site->name . ' (' . $site->domain . ')'; ?></li> 505 <?php } ?> 506 <?php } ?> 507 </ul> 508 <?php } ?> 509 <select name="to[]" id="to" multiple style="height: auto; width: 98%"> 486 <td> 487 <select name="from[]" id="from" multiple style="height: auto; width: 98%;"> 510 488 <?php 511 if ( ENABLE_NETWORK_ZERO ) { 512 foreach ( $sites as $site ) { 513 if ( $site->site_id == $network->id ) 514 echo '<option value="' . $site->blog_id . '">' . $site->name . ' (' . $site->domain . ')</option>'; 515 } 489 foreach ( $sites as $site ) { 490 if ( $site->site_id != $network->id ) 491 echo '<option value="' . $site->blog_id . '">' . $site->name . ' (' . $site->domain . ')</option>'; 516 492 } 517 493 ?> 518 </select> 519 </td> 520 </tr> 521 </table> 522 <br class="clear" /> 523 <?php if ( has_action( 'add_move_blog_option' ) ) : ?> 524 <table class="widefat"> 525 <thead> 526 <tr scope="col"><th colspan="2"><?php _e( 'Options' ); ?>:</th></tr> 527 </thead> 528 <?php do_action( 'add_move_blog_option', $site->blog_id ); ?> 494 </select> 495 </td> 496 <td> 497 <input type="button" name="unassign" id="unassign" value="<<" /><br /> 498 <input type="button" name="assign" id="assign" value=">>" /> 499 </td> 500 <td valign="top"> 501 <?php if ( ! ENABLE_NETWORK_ZERO ) { ?> 502 <ul style="margin: 0; padding: 0; list-style-type: none;"> 503 <?php foreach ( $sites as $site ) { ?> 504 <?php if ( $site->site_id == $network->id ) { ?> 505 <li><?php echo $site->name . ' (' . $site->domain . ')'; ?></li> 506 <?php } ?> 507 <?php } ?> 508 </ul> 509 <?php } ?> 510 <select name="to[]" id="to" multiple style="height: auto; width: 98%"> 511 <?php 512 if ( ENABLE_NETWORK_ZERO ) { 513 foreach ( $sites as $site ) { 514 if ( $site->site_id == $network->id ) 515 echo '<option value="' . $site->blog_id . '">' . $site->name . ' (' . $site->domain . ')</option>'; 516 } 517 } 518 ?> 519 </select> 520 </td> 521 </tr> 529 522 </table> 530 <br /> 531 <?php endif; ?> 532 <input type="submit" name="reassign" value="<?php _e( 'Update Assigments' ); ?>" class="button" /> 533 <a href="<?php echo $this->admin_url(); ?>"><?php _e( 'Cancel' ); ?></a> 534 </form> 523 <br class="clear" /> 524 <?php if ( has_action( 'add_move_blog_option' ) ) : ?> 525 <table class="widefat"> 526 <thead> 527 <tr scope="col"><th colspan="2"><?php _e( 'Options' ); ?>:</th></tr> 528 </thead> 529 <?php do_action( 'add_move_blog_option', $site->blog_id ); ?> 530 </table> 531 <br /> 532 <?php endif; ?> 533 <input type="submit" name="reassign" value="<?php _e( 'Update Assigments' ); ?>" class="button" /> 534 <a href="<?php echo $this->admin_url(); ?>"><?php _e( 'Cancel' ); ?></a> 535 </form> 536 </div> 535 537 <?php 536 538 } … … 589 591 590 592 ?> 591 <div id="icon-ms-admin" class="icon32"></div> 592 <h2><?php _e( 'WP Multi-Network' ) ?></h2> 593 <h3><?php _e( 'Edit Network' ); ?>: http://<?php echo $network->domain . $network->path ?></h3> 594 <form method="post" action="<?php echo remove_query_arg( 'action' ); ?>"> 595 <table class="form-table"> 596 <tr class="form-field"><th scope="row"><label for="domain"><?php _e( 'Domain' ); ?></label></th><td> http://<input type="text" id="domain" name="domain" value="<?php echo $network->domain; ?>"></td></tr> 597 <tr class="form-field"><th scope="row"><label for="path"><?php _e( 'Path' ); ?></label></th><td><input type="text" id="path" name="path" value="<?php echo $network->path; ?>" /></td></tr> 598 </table> 599 <?php if ( has_action( 'add_edit_network_option' ) ) : ?> 600 <h3><?php _e( 'Options:' ) ?></h3> 593 <div class="wrap"> 594 <?php screen_icon( 'ms-admin' ); ?> 595 <h2><?php _e( 'Networks' ) ?></h2> 596 <h3><?php _e( 'Edit Network' ); ?>: http://<?php echo $network->domain . $network->path ?></h3> 597 <form method="post" action="<?php echo remove_query_arg( 'action' ); ?>"> 601 598 <table class="form-table"> 602 <?php do_action( 'add_edit_network_option' ); ?> 599 <tr class="form-field"><th scope="row"><label for="domain"><?php _e( 'Domain' ); ?></label></th><td> http://<input type="text" id="domain" name="domain" value="<?php echo $network->domain; ?>"></td></tr> 600 <tr class="form-field"><th scope="row"><label for="path"><?php _e( 'Path' ); ?></label></th><td><input type="text" id="path" name="path" value="<?php echo $network->path; ?>" /></td></tr> 603 601 </table> 604 <?php endif; ?> 605 <p> 606 <input type="hidden" name="networkId" value="<?php echo $network->id; ?>" /> 607 <input class="button" type="submit" name="update" value="<?php _e( 'Update Network' ); ?>" /> 608 <a href="<?php echo $this->admin_url(); ?>"><?php _e( 'Cancel' ); ?></a> 609 </p> 610 </form> 602 <?php if ( has_action( 'add_edit_network_option' ) ) : ?> 603 <h3><?php _e( 'Options:' ) ?></h3> 604 <table class="form-table"> 605 <?php do_action( 'add_edit_network_option' ); ?> 606 </table> 607 <?php endif; ?> 608 <p> 609 <input type="hidden" name="networkId" value="<?php echo $network->id; ?>" /> 610 <input class="button" type="submit" name="update" value="<?php _e( 'Update Network' ); ?>" /> 611 <a href="<?php echo $this->admin_url(); ?>"><?php _e( 'Cancel' ); ?></a> 612 </p> 613 </form> 614 </div> 611 615 <?php 612 616 } … … 634 638 $sites = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->blogs} WHERE site_id = %d", (int) $_GET['id'] ) ); ?> 635 639 636 <form method="POST" action="<?php echo remove_query_arg( 'action' ); ?>"> 637 <div> 638 <div id="icon-ms-admin" class="icon32"></div> 639 <h2><?php _e( 'WP Multi-Network' ); ?></h2> 640 <h3><?php _e( 'Delete Network' ); ?>: <?php echo $network->domain . $network->path; ?></h3> 641 <?php 642 if ( $sites ) { 643 if ( RESCUE_ORPHANED_BLOGS && ENABLE_NETWORK_ZERO ) { 640 <div class="wrap"> 641 <?php screen_icon( 'ms-admin' ); ?> 642 <h2><?php _e( 'Networks' ) ?></h2> 643 <h3><?php _e( 'Delete Network' ); ?>: <?php echo $network->domain . $network->path; ?></h3> 644 <form method="POST" action="<?php echo remove_query_arg( 'action' ); ?>"> 645 <?php 646 if ( $sites ) { 647 if ( RESCUE_ORPHANED_BLOGS && ENABLE_NETWORK_ZERO ) { 648 649 ?> 650 <div id="message" class="error"> 651 <p><?php _e( 'There are blogs associated with this network. ' ); 652 _e( 'Deleting it will move them to the holding network.' ); ?></p> 653 <p><label for="override"><?php _e( 'If you still want to delete this network, check the following box' ); ?>:</label> <input type="checkbox" name="override" id="override" /></p> 654 </div> 655 <?php } else { ?> 656 <div id="message" class="error"> 657 <p><?php _e( 'There are blogs associated with this network. ' ); 658 _e( 'Deleting it will delete those blogs as well.' ); ?></p> 659 <p><label for="override"><?php _e( 'If you still want to delete this network, check the following box' ); ?>:</label> <input type="checkbox" name="override" id="override" /></p> 660 </div> 661 <?php 662 } 663 } 644 664 645 665 ?> 646 <div id="message" class="error">647 <p><?php _e( 'There are blogs associated with this network. ' );648 _e( 'Deleting it will move them to the holding network.' ); ?></p>649 <p><label for="override"><?php _e( 'If you still want to delete this network, check the following box' ); ?>:</label> <input type="checkbox" name="override" id="override" /></p>650 </div>651 <?php } else { ?>652 <div id="message" class="error">653 <p><?php _e( 'There are blogs associated with this network. ' );654 _e( 'Deleting it will delete those blogs as well.' ); ?></p>655 <p><label for="override"><?php _e( 'If you still want to delete this network, check the following box' ); ?>:</label> <input type="checkbox" name="override" id="override" /></p>656 </div>657 <?php658 }659 }660 661 ?>662 666 <p><?php _e( 'Are you sure you want to delete this network?' ); ?></p> 663 667 <input type="submit" name="delete" value="<?php _e( 'Delete Network' ); ?>" class="button" /> <a href="<?php echo $this->admin_url(); ?>"><?php _e( 'Cancel' ); ?></a> 664 </ div>665 </ form>668 </form> 669 </div> 666 670 <?php 667 671 } … … 713 717 $sites = $wpdb->get_results( "SELECT * FROM {$wpdb->blogs} WHERE site_id IN (" . implode( ',', $allnetworks ) . ')' ); ?> 714 718 715 <form method="POST" action="<?php echo $this->admin_url(); ?>"><div> 716 <div id="icon-ms-admin" class="icon32"></div> 717 <h2><?php _e( 'WP Multi-Network' ) ?></h2> 718 <h3><?php _e( 'Delete Multiple Networks' ); ?></h3> 719 <?php 720 if ( $sites ) { 721 if ( RESCUE_ORPHANED_BLOGS && ENABLE_NETWORK_ZERO ) { 722 723 ?> 719 <div class="wrap"> 720 <?php screen_icon( 'ms-admin' ); ?> 721 <h2><?php _e( 'Networks' ) ?></h2> 722 <h3><?php _e( 'Delete Multiple Networks' ); ?></h3> 723 <form method="POST" action="<?php echo $this->admin_url(); ?>"><div> 724 <?php if ( $sites ) { 725 if ( RESCUE_ORPHANED_BLOGS && ENABLE_NETWORK_ZERO ) { ?> 724 726 <div id="message" class="error"> 725 727 <h3><?php _e( 'You have selected the following networks for deletion' ); ?>:</h3> 726 728 <ul> 727 <?php foreach ( $network as $deleted_network ) { ?>729 <?php foreach ( $network as $deleted_network ) { ?> 728 730 <li><input type="hidden" name="deleted_networks[]" value="<?php echo $deleted_network->id; ?>" /><?php echo $deleted_network->domain . $deleted_network->path ?></li> 729 <?php } ?>731 <?php } ?> 730 732 </ul> 731 733 <p><?php _e( 'There are blogs associated with one or more of these networks. Deleting them will move these blgos to the holding network.' ); ?></p> 732 734 <p><label for="override"><?php _e( 'If you still want to delete these networks, check the following box' ); ?>:</label> <input type="checkbox" name="override" id="override" /></p> 733 735 </div> 734 <?php } else { ?>736 <?php } else { ?> 735 737 <div id="message" class="error"> 736 738 <h3><?php _e( 'You have selected the following networks for deletion' ); ?>:</h3> 737 739 <ul> 738 <?php foreach ( $network as $deleted_network ) { ?>740 <?php foreach ( $network as $deleted_network ) { ?> 739 741 <li><input type="hidden" name="deleted_networks[]" value="<?php echo $deleted_network->id; ?>" /><?php echo $deleted_network->domain . $deleted_network->path ?></li> 740 <?php } ?>742 <?php } ?> 741 743 </ul> 742 744 <p><?php _e( 'There are blogs associated with one or more of these networks. Deleting them will delete those blogs as well.' ); ?></p> 743 745 <p><label for="override"><?php _e( 'If you still want to delete these networks, check the following box' ); ?>:</label> <input type="checkbox" name="override" id="override" /></p> 744 746 </div> 745 <?php 746 } 747 } else { 748 749 ?> 747 <?php 748 } 749 } else { ?> 750 750 <div id="message"> 751 751 <h3><?php _e( 'You have selected the following networks for deletion' ); ?>:</h3> 752 752 <ul> 753 <?php foreach ( $network as $deleted_network ) { ?>753 <?php foreach ( $network as $deleted_network ) { ?> 754 754 <li><input type="hidden" name="deleted_networks[]" value="<?php echo $deleted_network->id; ?>" /><?php echo $deleted_network->domain . $deleted_network->path ?></li> 755 <?php } ?>755 <?php } ?> 756 756 </ul> 757 757 </div> 758 <?php } ?>758 <?php } ?> 759 759 <p><?php _e( 'Are you sure you want to delete these networks?' ); ?></p> 760 760 <input type="submit" name="delete_multiple" value="<?php _e( 'Delete Networks' ); ?>" class="button" /> <input type="submit" name="cancel" value="<?php _e( 'Cancel' ); ?>" class="button" /> 761 </div></form> 761 </form> 762 </div> 763 762 764 <?php 763 765 } 764 766 } 765 767 766 768 /** 767 769 * Admin page for users who are network admins on another network, but possibly not the current one 768 770 */ 769 771 function my_networks_page() { 770 771 } 772 772 773 } 774 773 775 /** 774 * Admin page for Networks settings - 776 * Admin page for Networks settings - 775 777 */ 776 778 function networks_settings_page() { 777 779 778 780 } 779 781 } 780 781 ?>
Note: See TracChangeset
for help on using the changeset viewer.