]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/link-add.php
Wordpress 2.8.5-scripts
[autoinstalls/wordpress.git] / wp-admin / link-add.php
index 8a6553a2ec03df345d38836c4cc04d76476b3759..e0e4489a7de7f2f122174222eac7362309a47da2 100644 (file)
@@ -1,47 +1,30 @@
 <?php
+/**
+ * Add Link Administration Panel.
+ *
+ * @package WordPress
+ * @subpackage Administration
+ */
+
+/** Load WordPress Administration Bootstrap */
 require_once('admin.php');
 
-$title = __('Add Link');
-$this_file = 'link-manager.php';
-$parent_file = 'link-manager.php';
-
-
-$wpvarstoreset = array('action', 'cat_id', 'linkurl', 'name', 'image',
-                       'description', 'visible', 'target', 'category', 'link_id',
-                       'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel',
-                       'notes', 'linkcheck[]');
-for ($i=0; $i<count($wpvarstoreset); $i += 1) {
-    $wpvar = $wpvarstoreset[$i];
-    if (!isset($$wpvar)) {
-        if (empty($_POST["$wpvar"])) {
-            if (empty($_GET["$wpvar"])) {
-                $$wpvar = '';
-            } else {
-                $$wpvar = $_GET["$wpvar"];
-            }
-        } else {
-            $$wpvar = $_POST["$wpvar"];
-        }
-    }
-}
+if ( ! current_user_can('manage_links') )
+       wp_die(__('You do not have sufficient permissions to add links to this blog.'));
 
-$xfn_js = true;
-require('admin-header.php');
-?>
+$title = __('Add New Link');
+$parent_file = 'link-manager.php';
 
-<?php if ($_GET['added']) : ?>
-<div id="message" class="updated fade"><p><?php _e('Link added.'); ?></p></div>
-<?php endif; ?>
+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[]'));
 
-<?php
-       $link = get_default_link_to_edit();
-       include('edit-link-form.php');
-?>
+wp_enqueue_script('link');
+wp_enqueue_script('xfn');
 
-<div class="wrap">
-<?php printf(__('<p>You can drag <a href="%s" title="Link add bookmarklet">Link This</a> to your toolbar and when you click it a window will pop up that will allow you to add whatever site you&#8217;re on to your links! Right now this only works on Mozilla or Netscape, but we&#8217;re working on it.</p>'), "javascript:void(linkmanpopup=window.open('" . get_settings('siteurl') . "/wp-admin/link-add.php?action=popup&amp;linkurl='+escape(location.href)+'&amp;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('edit-link-form.php');
 
-<?php
 require('admin-footer.php');
-?>
+?>
\ No newline at end of file