Make WordPress Core


Ignore:
Timestamp:
08/20/2008 09:42:31 PM (16 years ago)
Author:
ryan
Message:

Collapse crazyhorse to trunk. Incoming! see #7552

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-link-form.php

    r8656 r8691  
    88
    99if ( ! empty($link_id) ) {
    10     /**
    11      * @var string
    12      */
    13     $heading = __('Edit Link');
     10    $heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );
    1411    $submit_text = __('Save Changes');
    1512    $form = '<form name="editlink" id="editlink" method="post" action="link.php">';
    1613    $nonce_action = 'update-bookmark_' . $link_id;
    1714} else {
    18     $heading = __('Add Link');
     15    $heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' );
    1916    $submit_text = __('Add Link');
    2017    $form = '<form name="addlink" id="addlink" method="post" action="link.php">';
     
    4138?>
    4239
    43 <?php echo $form ?>
    44 <?php wp_nonce_field($nonce_action); ?>
    45 <?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
    46 
    47 <div class="wrap">
    48 <h2><?php echo $heading; ?></h2>
    49 
    50 <div id="poststuff">
    51 
     40<?php function link_submit_meta_box($link) { ?>
    5241<div class="submitbox" id="submitlink">
    5342
    54 <div id="previewview">
    55 <?php if ( !empty($link_id) ) { ?>
    56 <a href="<?php echo $link->link_url; ?>" target="_blank"><?php _e('Visit Link'); ?></a>
    57 <?php } ?>
    58 </div>
    59 
    60 <div class="inside">
     43<div class="inside-submitbox">
    6144<p><label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label></p>
    6245</div>
     
    6649<?php
    6750if ( ( 'edit' == $action) && current_user_can('manage_links') )
    68     echo "<a class='submitdelete' href='" . wp_nonce_url("link.php?action=delete&amp;link_id=$link_id", 'delete-bookmark_' . $link_id) . "' onclick=\"if ( confirm('" . js_escape( sprintf( __("You are about to delete this link '%s'\n'Cancel' to stop, 'OK' to delete."), $link->link_name )) . "') ) { return true;}return false;\">" . __('Delete&nbsp;link') . "</a>";
     51    echo "<a class='submitdelete' href='" . wp_nonce_url("link.php?action=delete&amp;link_id=$link->link_id", 'delete-bookmark_' . $link->link_id) . "' onclick=\"if ( confirm('" . js_escape( sprintf( __("You are about to delete this link '%s'\n'Cancel' to stop, 'OK' to delete."), $link->link_name )) . "') ) { return true;}return false;\">" . __('Delete&nbsp;link') . "</a>";
    6952?>
    7053</p>
    71 
    72 <div class="side-info">
    73 <h5><?php _e('Related') ?></h5>
    74 
    75 <ul>
    76 <li><a href="link-manager.php"><?php _e('Manage All Links') ?></a></li>
    77 <li><a href="edit-link-categories.php"><?php _e('Manage All Link Categories') ?></a></li>
    78 <li><a href="link-import.php"><?php _e('Import Links') ?></a></li>
    79 <?php do_action('link_relatedlinks_list'); ?>
    80 </ul>
    81 </div>
    8254<?php do_action('submitlink_box'); ?>
    8355</div>
    84 
    85 <div id="post-body">
    86 <div id="namediv" class="stuffbox">
    87 <h3><label for="link_name"><?php _e('Name') ?></label></h3>
    88 <div class="inside">
    89     <input type="text" name="link_name" size="30" tabindex="1" value="<?php echo $link->link_name; ?>" id="link_name" /><br />
    90     <?php _e('Example: Nifty blogging software'); ?>
    91 </div>
    92 </div>
    93 
    94 <div id="addressdiv" class="stuffbox">
    95 <h3><label for="link_url"><?php _e('Web Address') ?></label></h3>
    96 <div class="inside">
    97     <input type="text" name="link_url" size="30" tabindex="1" value="<?php echo $link->link_url; ?>" id="link_url" /><br />
    98     <?php _e('Example: <code>http://wordpress.org/</code> &#8212; don&#8217;t forget the <code>http://</code>'); ?>
    99 </div>
    100 </div>
    101 
    102 <div id="descriptiondiv" class="stuffbox">
    103 <h3><label for="link_description"><?php _e('Description') ?></label></h3>
    104 <div class="inside">
    105     <input type="text" name="link_description" size="30" tabindex="1" value="<?php echo ( isset( $link->link_description ) ? $link->link_description : ''); ?>" id="link_description" /><br />
    106     <?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?>
    107 </div>
    108 </div>
    109 
    110 <?php function link_categories_meta_box($link) { ?>
     56<?php
     57}
     58add_meta_box('linksubmitdiv', __('Save'), 'link_submit_meta_box', 'link', 'side', 'core');
     59
     60function link_categories_meta_box($link) { ?>
    11161<div id="category-adder" class="wp-hidden-children">
    11262    <h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
     
    14494}
    14595add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', 'link', 'normal', 'core');
    146 ?>
    147 
    148 <?php do_meta_boxes('link', 'normal', $link); ?>
    149 
    150 <h2><?php _e('Advanced Options'); ?></h2>
    151 
    152 <?php function link_target_meta_box($link) { ?>
     96
     97function link_target_meta_box($link) { ?>
    15398<fieldset><legend class="hidden"><?php _e('Target') ?></legend>
    15499<label for="link_target_blank" class="selectit">
     
    165110<?php
    166111}
    167 add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'advanced', 'core');
     112add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'normal', 'core');
    168113
    169114function link_xfn_meta_box($link) {
     
    278223<?php
    279224}
    280 add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'advanced', 'core');
     225add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'normal', 'core');
    281226
    282227function link_advanced_meta_box($link) {
     
    311256<?php
    312257}
    313 add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'advanced', 'core');
     258add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core');
     259
     260?>
     261
     262<?php echo $form ?>
     263<div id="wpbody-content">
     264
     265<?php echo $link_added; ?>
     266
     267<?php wp_nonce_field($nonce_action); ?>
     268<?php wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false ); ?>
     269<?php wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
     270
     271<div class="wrap">
     272<h2><?php echo $heading; ?></h2>
     273
     274<?php if ( !empty($link->link_id) ) { ?>
     275<div id="previewview">
     276<a class="button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e('Visit Link'); ?></a>
     277</div>
     278<?php } ?>
     279
     280<!--
     281<p id="big-add-button">
     282<span id="previewview">
     283<?php if ( !empty($link_id) ) { ?>
     284<a class="button" href="<?php echo $link->link_url; ?>" target="_blank"><?php _e('Visit Link'); ?></a>
     285<?php } ?>
     286</span>
     287</p>
     288-->
     289
     290<!-- TODO
     291<div class="inside">
     292<p><label for="link_private" class="selectit"><input id="link_private" name="link_visible" type="checkbox" value="N" <?php checked($link->link_visible, 'N'); ?> /> <?php _e('Keep this link private') ?></label></p>
     293</div>
     294
     295<div class="side-info">
     296<h5><?php _e('Related') ?></h5>
     297
     298<ul>
     299<li><a href="link-manager.php"><?php _e('Manage All Links') ?></a></li>
     300<li><a href="edit-link-categories.php"><?php _e('Manage All Link Categories') ?></a></li>
     301<li><a href="link-import.php"><?php _e('Import Links') ?></a></li>
     302<?php do_action('link_relatedlinks_list'); ?>
     303</ul>
     304</div>
     305-->
     306
     307<div id="poststuff">
     308
     309<div id="side-info-column" class="inner-sidebar">
     310<?php
     311
     312do_action('submitlink_box');
     313$side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
     314
     315?>
     316</div>
     317
     318<div id="post-body" class="<?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?>">
     319<div id="post-body-content" class="has-sidebar-content">
     320<div id="namediv" class="stuffbox">
     321<h3><label for="link_name"><?php _e('Name') ?></label></h3>
     322<div class="inside">
     323    <input type="text" name="link_name" size="30" tabindex="1" value="<?php echo $link->link_name; ?>" id="link_name" /><br />
     324    <?php _e('Example: Nifty blogging software'); ?>
     325</div>
     326</div>
     327
     328<div id="addressdiv" class="stuffbox">
     329<h3><label for="link_url"><?php _e('Web Address') ?></label></h3>
     330<div class="inside">
     331    <input type="text" name="link_url" size="30" tabindex="1" value="<?php echo $link->link_url; ?>" id="link_url" /><br />
     332    <?php _e('Example: <code>http://wordpress.org/</code> &#8212; don&#8217;t forget the <code>http://</code>'); ?>
     333</div>
     334</div>
     335
     336<div id="descriptiondiv" class="stuffbox">
     337<h3><label for="link_description"><?php _e('Description') ?></label></h3>
     338<div class="inside">
     339    <input type="text" name="link_description" size="30" tabindex="1" value="<?php echo $link->link_description; ?>" id="link_description" /><br />
     340    <?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?>
     341</div>
     342</div>
     343
     344<?php
     345
     346do_meta_boxes('link', 'normal', $link);
    314347
    315348do_meta_boxes('link', 'advanced', $link);
     
    326359</div>
    327360</div>
    328 
     361</div>
     362
     363</div>
     364
     365<br class="clear" />
    329366</div>
    330367
Note: See TracChangeset for help on using the changeset viewer.