<?php
-require_once('admin.php');
+/**
+ * Add Link Administration Screen.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
-$title = __('Add Link');
-$this_file = 'link-manager.php';
-$parent_file = 'link-manager.php';
+/** Load WordPress Administration Bootstrap */
+require_once( dirname( __FILE__ ) . '/admin.php' );
+if ( ! current_user_can('manage_links') )
+ wp_die(__('Sorry, you are not allowed to add links to this site.'));
-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[]'));
+$title = __('Add New Link');
+$parent_file = 'link-manager.php';
-wp_enqueue_script( array('xfn', 'dbx-admin-key?pagenow=link.php') );
-if ( current_user_can( 'manage_categories' ) )
- wp_enqueue_script( 'ajaxlinkcat' );
-require('admin-header.php');
-?>
+wp_reset_vars( array('action', 'cat_id', 'link_id' ) );
-<?php if ($_GET['added'] && '' != $_POST['link_name']) : ?>
-<div id="message" class="updated fade"><p><?php _e('Link added.'); ?></p></div>
-<?php endif; ?>
+wp_enqueue_script('link');
+wp_enqueue_script('xfn');
-<?php
- $link = get_default_link_to_edit();
- include('edit-link-form.php');
-?>
+if ( wp_is_mobile() )
+ wp_enqueue_script( 'jquery-touch-punch' );
-<div id="wp-link-bookmarklet" class="wrap">
-<h3><?php _e('Add Link Bookmarklet'); ?></h3>
-<p><?php _e('Right click on the following link and choose “Bookmark This Link...” or “Add to Favorites...” to create a Link This shortcut.'); ?></p>
-<?php printf('<p><a href="%s" title="'.__('Link add bookmarklet').'">'.__('Link This').'</a></p>', "javascript:void(linkmanpopup=window.open('" . get_option('siteurl') . "/wp-admin/link-add.php?action=popup&linkurl='+escape(location.href)+'&name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();") ?>
-</div>
+$link = get_default_link_to_edit();
+include( ABSPATH . 'wp-admin/edit-link-form.php' );
-<?php
-require('admin-footer.php');
-?>
+require( ABSPATH . 'wp-admin/admin-footer.php' );