]> scripts.mit.edu Git - autoinstalls/wordpress.git/blob - wp-admin/edit-link-form.php
Wordpress 3.0.2
[autoinstalls/wordpress.git] / wp-admin / edit-link-form.php
1 <?php
2 /**
3  * Edit links form for inclusion in administration panels.
4  *
5  * @package WordPress
6  * @subpackage Administration
7  */
8
9 // don't load directly
10 if ( !defined('ABSPATH') )
11         die('-1');
12
13 if ( ! empty($link_id) ) {
14         $heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );
15         $submit_text = __('Update Link');
16         $form = '<form name="editlink" id="editlink" method="post" action="link.php">';
17         $nonce_action = 'update-bookmark_' . $link_id;
18 } else {
19         $heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' );
20         $submit_text = __('Add Link');
21         $form = '<form name="addlink" id="addlink" method="post" action="link.php">';
22         $nonce_action = 'add-bookmark';
23 }
24
25 require_once('./includes/meta-boxes.php');
26
27 add_meta_box('linksubmitdiv', __('Save'), 'link_submit_meta_box', 'link', 'side', 'core');
28 add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', 'link', 'normal', 'core');
29 add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'normal', 'core');
30 add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'normal', 'core');
31 add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core');
32
33 do_action('add_meta_boxes', 'link', $link);
34 do_action('add_meta_boxes_link', $link);
35
36 do_action('do_meta_boxes', 'link', 'normal', $link);
37 do_action('do_meta_boxes', 'link', 'advanced', $link);
38 do_action('do_meta_boxes', 'link', 'side', $link);
39
40 add_contextual_help($current_screen,
41         '<p>' . __( 'You can add or edit links on this screen by entering information in each of the boxes. Only the link&#8217;s web address and name (the text you want to display on your site as the link) are required fields.' ) . '</p>' .
42         '<p>' . __( 'The boxes for link name, web address, and description have fixed positions, while the others may be repositioned using drag and drop. You can also hide boxes you don&#8217;t use in the Screen Options tab, or minimize boxes by clicking on the title bar of the box.' ) . '</p>' .
43         '<p>' . __( 'XFN stands for <a href="http://gmpg.org/xfn/" target="_blank">XHTML Friends Network</a>, which is optional. WordPress allows the generation of XFN attributes to show how you are related to the authors/owners of the site to which you are linking.' ) . '</p>' .
44         '<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
45         '<p>' . __( '<a href="http://codex.wordpress.org/Links_Add_New_SubPanel" target="_blank">Documentation on Creating Links</a>' ) . '</p>' .
46         '<p>' . __( '<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>' ) . '</p>'
47 );
48
49 require_once ('admin-header.php');
50
51 ?>
52 <div class="wrap">
53 <?php screen_icon(); ?>
54 <h2><?php echo esc_html( $title ); ?></h2>
55
56 <?php if ( isset( $_GET['added'] ) ) : ?>
57 <div id="message" class="updated"><p><?php _e('Link added.'); ?></p></div>
58 <?php endif; ?>
59
60 <?php
61 if ( !empty($form) )
62         echo $form;
63 if ( !empty($link_added) )
64         echo $link_added;
65
66 wp_nonce_field( $nonce_action );
67 wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
68 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
69
70 <div id="poststuff" class="metabox-holder<?php echo 2 == $screen_layout_columns ? ' has-right-sidebar' : ''; ?>">
71
72 <div id="side-info-column" class="inner-sidebar">
73 <?php
74
75 do_action('submitlink_box');
76 $side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
77
78 ?>
79 </div>
80
81 <div id="post-body">
82 <div id="post-body-content">
83 <div id="namediv" class="stuffbox">
84 <h3><label for="link_name"><?php _e('Name') ?></label></h3>
85 <div class="inside">
86         <input type="text" name="link_name" size="30" tabindex="1" value="<?php echo esc_attr($link->link_name); ?>" id="link_name" />
87     <p><?php _e('Example: Nifty blogging software'); ?></p>
88 </div>
89 </div>
90
91 <div id="addressdiv" class="stuffbox">
92 <h3><label for="link_url"><?php _e('Web Address') ?></label></h3>
93 <div class="inside">
94         <input type="text" name="link_url" size="30" class="code" tabindex="1" value="<?php echo esc_attr($link->link_url); ?>" id="link_url" />
95     <p><?php _e('Example: <code>http://wordpress.org/</code> &#8212; don&#8217;t forget the <code>http://</code>'); ?></p>
96 </div>
97 </div>
98
99 <div id="descriptiondiv" class="stuffbox">
100 <h3><label for="link_description"><?php _e('Description') ?></label></h3>
101 <div class="inside">
102         <input type="text" name="link_description" size="30" tabindex="1" value="<?php echo isset($link->link_description) ? esc_attr($link->link_description) : ''; ?>" id="link_description" />
103     <p><?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?></p>
104 </div>
105 </div>
106
107 <?php
108
109 do_meta_boxes('link', 'normal', $link);
110
111 do_meta_boxes('link', 'advanced', $link);
112
113 if ( $link_id ) : ?>
114 <input type="hidden" name="action" value="save" />
115 <input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
116 <input type="hidden" name="order_by" value="<?php echo esc_attr($order_by); ?>" />
117 <input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
118 <?php else: ?>
119 <input type="hidden" name="action" value="add" />
120 <?php endif; ?>
121
122 </div>
123 </div>
124 </div>
125
126 </form>
127 </div>