-
+ 0DD2A87C2627E9528F45A0373FB3116D6820F79757CEF9784EC6867DCFAE06FC3B8B9042E17FD0649275C864600BC05B2947FFC4FBF4C719BA7BA96A30FEF66Dmp-wp/wp-admin/link.php(0 . 0)(1 . 116)
52464 <?php
52465 /**
52466 * Manage link administration actions.
52467 *
52468 * This page is accessed by the link management pages and handles the forms and
52469 * AJAX processes for link actions.
52470 *
52471 * @package WordPress
52472 * @subpackage Administration
52473 */
52474
52475 /** Load WordPress Administration Bootstrap */
52476 require_once ('admin.php');
52477
52478 wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]'));
52479
52480 if ( ! current_user_can('manage_links') )
52481 wp_die( __('You do not have sufficient permissions to edit the links for this blog.') );
52482
52483 if ( !empty($_POST['deletebookmarks']) )
52484 $action = 'deletebookmarks';
52485 if ( !empty($_POST['move']) )
52486 $action = 'move';
52487 if ( !empty($_POST['linkcheck']) )
52488 $linkcheck = $_POST['linkcheck'];
52489
52490 $this_file = 'link-manager.php';
52491
52492 switch ($action) {
52493 case 'deletebookmarks' :
52494 check_admin_referer('bulk-bookmarks');
52495
52496 //for each link id (in $linkcheck[]) change category to selected value
52497 if (count($linkcheck) == 0) {
52498 wp_redirect($this_file);
52499 exit;
52500 }
52501
52502 $deleted = 0;
52503 foreach ($linkcheck as $link_id) {
52504 $link_id = (int) $link_id;
52505
52506 if ( wp_delete_link($link_id) )
52507 $deleted++;
52508 }
52509
52510 wp_redirect("$this_file?deleted=$deleted");
52511 exit;
52512 break;
52513
52514 case 'move' :
52515 check_admin_referer('bulk-bookmarks');
52516
52517 //for each link id (in $linkcheck[]) change category to selected value
52518 if (count($linkcheck) == 0) {
52519 wp_redirect($this_file);
52520 exit;
52521 }
52522 $all_links = join(',', $linkcheck);
52523 // should now have an array of links we can change
52524 //$q = $wpdb->query("update $wpdb->links SET link_category='$category' WHERE link_id IN ($all_links)");
52525
52526 wp_redirect($this_file);
52527 exit;
52528 break;
52529
52530 case 'add' :
52531 check_admin_referer('add-bookmark');
52532
52533 add_link();
52534
52535 wp_redirect( wp_get_referer() . '?added=true' );
52536 exit;
52537 break;
52538
52539 case 'save' :
52540 $link_id = (int) $_POST['link_id'];
52541 check_admin_referer('update-bookmark_' . $link_id);
52542
52543 edit_link($link_id);
52544
52545 wp_redirect($this_file);
52546 exit;
52547 break;
52548
52549 case 'delete' :
52550 $link_id = (int) $_GET['link_id'];
52551 check_admin_referer('delete-bookmark_' . $link_id);
52552
52553 wp_delete_link($link_id);
52554
52555 wp_redirect($this_file);
52556 exit;
52557 break;
52558
52559 case 'edit' :
52560 wp_enqueue_script('link');
52561 wp_enqueue_script('xfn');
52562
52563 $parent_file = 'link-manager.php';
52564 $submenu_file = 'link-manager.php';
52565 $title = __('Edit Link');
52566
52567 $link_id = (int) $_GET['link_id'];
52568
52569 if (!$link = get_link_to_edit($link_id))
52570 wp_die(__('Link not found.'));
52571
52572 include ('edit-link-form.php');
52573 include ('admin-footer.php');
52574 break;
52575
52576 default :
52577 break;
52578 }
52579 ?>