Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r3257 r4144  
    11<?php
    22if ( ! empty($link_id) ) {
    3     $editing = true;
    4     $heading = __('Edit a link:');
     3    $heading = __('Edit Link');
    54    $submit_text = __('Save Changes &raquo;');
    6     $form = '<form action="" method="post" name="editlink" id="editlink">';
     5    $form = '<form name="editlink" id="editlink" method="post" action="link.php">';
     6    $nonce_action = 'update-bookmark_' . $link_id;
    77} else {
    8     $editing = false;
    9     $heading = __('<strong>Add</strong> a link:');
     8    $heading = __('Add Link');
    109    $submit_text = __('Add Link &raquo;');
    11     $form = '<form name="addlink" method="post" action="link-manager.php">';
     10    $form = '<form name="addlink" id="addlink" method="post" action="link.php">';
     11    $nonce_action = 'add-bookmark';
    1212}
    1313
     
    2929    }
    3030}
    31 
    3231?>
    3332
    3433<div class="wrap">
    35   <?php echo $form ?>
    36   <h2><?php echo $heading ?></h2>
    37 <fieldset class="options">
    38     <legend><?php _e('Basics') ?></legend>
    39         <table class="editform" width="100%" cellspacing="2" cellpadding="5">
    40          <tr>
    41            <th width="33%" scope="row"><?php _e('URI:') ?></th>
    42            <td width="67%"><input type="text" name="link_url" value="<?php echo $link->link_url; ?>" style="width: 95%;" /></td>
    43          </tr>
    44          <tr>
    45            <th scope="row"><?php _e('Link Name:') ?></th>
    46            <td><input type="text" name="link_name" value="<?php echo $link->link_name; ?>" style="width: 95%" /></td>
    47          </tr>
    48          <tr>
    49             <th scope="row"><?php _e('Short description:') ?></th>
    50             <td><input type="text" name="link_description" value="<?php echo $link->link_description; ?>" style="width: 95%" /></td>
    51             </tr>
    52         <tr>
    53            <th scope="row"><?php _e('Category:') ?></th>
    54            <td><?php link_category_dropdown('link_category', $link->link_category); ?></td>
    55          </tr>
     34<h2><?php echo $heading ?></h2>
     35<?php echo $form ?>
     36<?php wp_nonce_field($nonce_action); ?>
     37
     38<div id="poststuff">
     39<div id="moremeta">
     40<div id="grabit" class="dbx-group">
     41
     42<fieldset id="categorydiv" class="dbx-box">
     43<h3 class="dbx-handle"><?php _e('Categories') ?></h3>
     44<div class="dbx-content">
     45<p id="jaxcat"></p>
     46<ul id="categorychecklist"><?php dropdown_link_categories(get_option('default_link_category')); ?></ul>
     47</div>
     48</fieldset>
     49
     50<fieldset class="dbx-box">
     51<h3 class="dbx-handle"><?php _e('Target') ?></h3>
     52<div class="dbx-content">
     53<label for="link_target_blank" class="selectit">
     54<input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo(($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
     55<code>_blank</code></label>
     56<label for="link_target_top" class="selectit">
     57<input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo(($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
     58<code>_top</code></label>
     59<label for="link_target_none" class="selectit">
     60<input id="link_target_none" type="radio" name="link_target" value="" <?php echo(($link->link_target == '') ? 'checked="checked"' : ''); ?> />
     61<?php _e('none') ?></label>
     62</div>
     63</fieldset>
     64
     65<fieldset class="dbx-box">
     66<h3 class="dbx-handle"><?php _e('Visible') ?></h3>
     67<div class="dbx-content">
     68<label for="link_visible_yes" class="selectit">
     69<input id="link_visible_yes" type="radio" name="link_visible" <?php if ($link->link_visible == 'Y') echo "checked='checked'"; ?> value="Y" />
     70<?php _e('Yes') ?></label>
     71<label for="link_visible_no" class="selectit">
     72<input id="link_visible_no" type="radio" name="link_visible" <?php if ($link->link_visible == 'N') echo "checked='checked'"; ?> value="N" />
     73<?php _e('No') ?></label>
     74</div>
     75</fieldset>
     76
     77</div>
     78</div>
     79
     80<table class="editform" width="100%" cellspacing="2" cellpadding="5">
     81<tr>
     82<th scope="row" valign="top"><label for="link_name"><?php _e('Name:') ?></label></th>
     83<td><input type="text" name="link_name" value="<?php echo $link->link_name; ?>" style="width: 95%" /></td>
     84</tr>
     85<tr>
     86<th width="20%" scope="row" valign="top"><label for="link_url"><?php _e('Address:') ?></label></th>
     87<td width="80%"><input type="text" name="link_url" value="<?php echo $link->link_url; if ( empty( $link->link_url ) ) echo 'http://'; ?>" style="width: 95%" /></td>
     88</tr>
     89<tr>
     90<th scope="row" valign="top"><label for="link_description"><?php _e('Description:') ?></label></th>
     91<td><input type="text" name="link_description" value="<?php echo $link->link_description; ?>" style="width: 95%" /></td>
     92</tr>
    5693</table>
    57 </fieldset>
    58        <p class="submit">
    59        <input type="submit" name="submit" value="<?php echo $submit_text ?>" />
    60        </p>
    61     <fieldset class="options">
    62         <legend><?php _e('Link Relationship (XFN)') ?></legend>
    63         <table class="editform" width="100%" cellspacing="2" cellpadding="5">
    64             <tr>
    65                 <th width="33%" scope="row"><?php _e('rel:') ?></th>
    66                 <td width="67%"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo $link->link_rel; ?>" /></td>
    67             </tr>
    68             <tr>
    69                 <th scope="row"><?php _e('<a href="http://gmpg.org/xfn/">XFN</a> Creator:') ?></th>
    70                 <td>
    71                     <table cellpadding="3" cellspacing="5">
    72               <tr>
    73               <th scope="row"> <?php _e('identity') ?> </th>
    74               <td>
    75                 <label for="me">
    76                 <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
    77           <?php _e('another web address of mine') ?></label>
    78               </td>
    79             </tr>
    80             <tr>
    81               <th scope="row"> <?php _e('friendship') ?> </th>
    82               <td>
    83                 <label for="contact">
    84                 <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php _e('contact') ?></label>
    85                 <label for="acquaintance">
    86                 <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> />  <?php _e('acquaintance') ?></label>
    87                 <label id="friend">
    88                 <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php _e('friend') ?></label>
    89                 <label for="friendship">
    90                 <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php _e('none') ?></label>
    91               </td>
    92             </tr>
    93             <tr>
    94               <th scope="row"> <?php _e('physical') ?> </th>
    95               <td>
    96                 <label for="met">
    97                 <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
    98           <?php _e('met') ?></label>
    99               </td>
    100             </tr>
    101             <tr>
    102               <th scope="row"> <?php _e('professional') ?> </th>
    103               <td>
    104                 <label for="co-worker">
    105                 <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
    106           <?php _e('co-worker') ?></label>
    107                 <label for="colleague">
    108                 <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
    109           <?php _e('colleague') ?></label>
    110               </td>
    111             </tr>
    112             <tr>
    113               <th scope="row"> <?php _e('geographical') ?> </th>
    114               <td>
    115                 <label for="co-resident">
    116                 <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
    117           <?php _e('co-resident') ?></label>
    118                 <label for="neighbor">
    119                 <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
    120           <?php _e('neighbor') ?></label>
    121                 <label for="geographical">
    122                 <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
    123           <?php _e('none') ?></label>
    124               </td>
    125             </tr>
    126             <tr>
    127               <th scope="row"> <?php _e('family') ?> </th>
    128               <td>
    129                 <label for="child">
    130                 <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?>  />
    131           <?php _e('child') ?></label>
    132                 <label for="kin">
    133                 <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?>  />
    134           <?php _e('kin') ?></label>
    135                 <label for="parent">
    136                 <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
    137           <?php _e('parent') ?></label>
    138                 <label for="sibling">
    139                 <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
    140           <?php _e('sibling') ?></label>
    141                 <label for="spouse">
    142                 <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
    143           <?php _e('spouse') ?></label>
    144                 <label for="family">
    145                 <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
    146           <?php _e('none') ?></label>
    147               </td>
    148             </tr>
    149             <tr>
    150               <th scope="row"> <?php _e('romantic') ?> </th>
    151               <td>
    152                 <label for="muse">
    153                 <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
    154          <?php _e('muse') ?></label>
    155                 <label for="crush">
    156                 <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
    157          <?php _e('crush') ?></label>
    158                 <label for="date">
    159                 <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
    160          <?php _e('date') ?></label>
    161                 <label for="romantic">
    162                 <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
    163          <?php _e('sweetheart') ?></label>
    164               </td>
    165             </tr>
    166         </table>
    167           </td>
    168             </tr>
     94
     95<p class="submit">
     96<input type="submit" name="submit" value="<?php echo $submit_text ?>" />
     97</p>
     98
     99<div id="advancedstuff" class="dbx-group" >
     100
     101<fieldset id="xfn" class="dbx-box">
     102<h3 class="dbx-handle"><?php _e('Link Relationship (XFN)') ?></h3>
     103<div class="dbx-content">
     104<table class="editform" width="100%" cellspacing="2" cellpadding="5">
     105    <tr>
     106        <th width="20%" scope="row"><?php _e('rel:') ?></th>
     107        <td width="80%"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo $link->link_rel; ?>" /></td>
     108    </tr>
     109    <tr>
     110        <th scope="row"><?php _e('<a href="http://gmpg.org/xfn/">XFN</a> Creator:') ?></th>
     111        <td>
     112            <table cellpadding="3" cellspacing="5">
     113                <tr>
     114                    <th scope="row"> <?php _e('identity') ?> </th>
     115                    <td>
     116                        <label for="me">
     117                        <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
     118                        <?php _e('another web address of mine') ?></label>
     119                    </td>
     120                </tr>
     121                <tr>
     122                    <th scope="row"> <?php _e('friendship') ?> </th>
     123                    <td>
     124                        <label for="contact">
     125                        <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php _e('contact') ?></label>
     126                        <label for="acquaintance">
     127                        <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> />  <?php _e('acquaintance') ?></label>
     128                        <label for="friend">
     129                        <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php _e('friend') ?></label>
     130                        <label for="friendship">
     131                        <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php _e('none') ?></label>
     132                    </td>
     133                </tr>
     134                <tr>
     135                    <th scope="row"> <?php _e('physical') ?> </th>
     136                    <td>
     137                        <label for="met">
     138                        <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
     139                        <?php _e('met') ?></label>
     140                    </td>
     141                </tr>
     142                <tr>
     143                    <th scope="row"> <?php _e('professional') ?> </th>
     144                    <td>
     145                        <label for="co-worker">
     146                        <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
     147                        <?php _e('co-worker') ?></label>
     148                        <label for="colleague">
     149                        <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
     150                        <?php _e('colleague') ?></label>
     151                    </td>
     152                </tr>
     153                <tr>
     154                    <th scope="row"> <?php _e('geographical') ?> </th>
     155                    <td>
     156                        <label for="co-resident">
     157                        <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
     158                        <?php _e('co-resident') ?></label>
     159                        <label for="neighbor">
     160                        <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
     161                        <?php _e('neighbor') ?></label>
     162                        <label for="geographical">
     163                        <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
     164                        <?php _e('none') ?></label>
     165                    </td>
     166                </tr>
     167                <tr>
     168                    <th scope="row"> <?php _e('family') ?> </th>
     169                    <td>
     170                        <label for="child">
     171                        <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?>  />
     172                        <?php _e('child') ?></label>
     173                        <label for="kin">
     174                        <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?>  />
     175                        <?php _e('kin') ?></label>
     176                        <label for="parent">
     177                        <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
     178                        <?php _e('parent') ?></label>
     179                        <label for="sibling">
     180                        <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
     181                        <?php _e('sibling') ?></label>
     182                        <label for="spouse">
     183                        <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
     184                        <?php _e('spouse') ?></label>
     185                        <label for="family">
     186                        <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
     187                        <?php _e('none') ?></label>
     188                    </td>
     189                </tr>
     190                <tr>
     191                    <th scope="row"> <?php _e('romantic') ?> </th>
     192                    <td>
     193                        <label for="muse">
     194                        <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
     195                        <?php _e('muse') ?></label>
     196                        <label for="crush">
     197                        <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
     198                        <?php _e('crush') ?></label>
     199                        <label for="date">
     200                        <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
     201                        <?php _e('date') ?></label>
     202                        <label for="romantic">
     203                        <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
     204                        <?php _e('sweetheart') ?></label>
     205                    </td>
     206                </tr>
     207            </table>
     208        </td>
     209    </tr>
    169210</table>
    170 </fieldset>
    171        <p class="submit">
    172        <input type="submit" name="submit" value="<?php echo $submit_text ?>" />
    173        </p>
    174 <fieldset class="options">
    175         <legend><?php _e('Advanced') ?></legend>
    176         <table class="editform" width="100%" cellspacing="2" cellpadding="5">
    177          <tr>
    178            <th width="33%" scope="row"><?php _e('Image URI:') ?></th>
    179            <td width="67%"><input type="text" name="link_image" size="50" value="<?php echo $link->link_image; ?>" style="width: 95%" /></td>
    180          </tr>
    181 <tr>
    182            <th scope="row"><?php _e('RSS URI:') ?> </th>
    183            <td><input name="link_rss" type="text" id="rss_uri" value="<?php echo $link->link_rss; ?>" size="50" style="width: 95%" /></td>
    184          </tr>
    185          <tr>
    186            <th scope="row"><?php _e('Notes:') ?></th>
    187            <td><textarea name="link_notes" cols="50" rows="10" style="width: 95%"><?php echo $link->link_notes; ?></textarea></td>
    188          </tr>
    189          <tr>
    190            <th scope="row"><?php _e('Rating:') ?></th>
    191            <td><select name="link_rating" size="1">
    192 <?php
    193     for ($r = 0; $r < 10; $r++) {
    194       echo('            <option value="'.$r.'" ');
    195       if ($link->link_rating == $r)
    196         echo 'selected="selected"';
    197       echo('>'.$r.'</option>');
    198     }
    199 ?>
    200            </select>
    201          &nbsp;<?php _e('(Leave at 0 for no rating.)') ?> </td>
    202          </tr>
    203          <tr>
    204            <th scope="row"><?php _e('Target') ?></th>
    205            <td><label>
    206           <input type="radio" name="link_target" value="_blank"   <?php echo(($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
    207           <code>_blank</code></label><br />
    208 <label>
    209 <input type="radio" name="link_target" value="_top" <?php echo(($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
    210 <code>_top</code></label><br />
    211 <label>
    212 <input type="radio" name="link_target" value=""     <?php echo(($link->link_target == '') ? 'checked="checked"' : ''); ?> />
    213 <?php _e('none') ?></label><br />
    214 <?php _e('(Note that the <code>target</code> attribute is illegal in XHTML 1.1 and 1.0 Strict.)') ?></td>
    215          </tr>
    216          <tr>
    217            <th scope="row"><?php _e('Visible:') ?></th>
    218            <td><label>
    219              <input type="radio" name="link_visible" <?php if ($link->link_visible == 'Y') echo "checked='checked'"; ?> value="Y" />
    220 <?php _e('Yes') ?></label><br /><label>
    221 <input type="radio" name="link_visible" <?php if ($link->link_visible == 'N') echo "checked='checked'"; ?> value="N" />
    222 <?php _e('No') ?></label></td>
    223          </tr>
     211</div>
     212</fieldset>
     213
     214<fieldset id="advanced" class="dbx-box">
     215<h3 class="dbx-handle"><?php _e('Advanced') ?></h3>
     216<div class="dbx-content">
     217<table class="editform" width="100%" cellspacing="2" cellpadding="5">
     218    <tr>
     219        <th width="20%" scope="row"><?php _e('Image Address:') ?></th>
     220        <td width="80%"><input type="text" name="link_image" size="50" value="<?php echo $link->link_image; ?>" style="width: 95%" /></td>
     221    </tr>
     222    <tr>
     223        <th scope="row"><?php _e('RSS Address:') ?> </th>
     224        <td><input name="link_rss" type="text" id="rss_uri" value="<?php echo $link->link_rss; ?>" size="50" style="width: 95%" /></td>
     225    </tr>
     226    <tr>
     227        <th scope="row"><?php _e('Notes:') ?></th>
     228        <td><textarea name="link_notes" cols="50" rows="10" style="width: 95%"><?php echo $link->link_notes; ?></textarea></td>
     229    </tr>
     230    <tr>
     231        <th scope="row"><?php _e('Rating:') ?></th>
     232        <td><select name="link_rating" size="1">
     233        <?php
     234            for ($r = 0; $r < 10; $r++) {
     235                echo('            <option value="'.$r.'" ');
     236                if ($link->link_rating == $r)
     237                    echo 'selected="selected"';
     238                echo('>'.$r.'</option>');
     239            }
     240        ?></select>&nbsp;<?php _e('(Leave at 0 for no rating.)') ?>
     241        </td>
     242    </tr>
    224243</table>
    225244</fieldset>
    226 <p class="submit"><input type="submit" name="submit" value="<?php echo $submit_text ?>" /></p>
    227 <?php if ( $editing ) : ?>
    228           <input type="hidden" name="action" value="editlink" />
    229           <input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
    230           <input type="hidden" name="order_by" value="<?php echo wp_specialchars($order_by, 1); ?>" />
    231           <input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
     245</div>
     246
     247<?php if ( $link_id ) : ?>
     248<input type="hidden" name="action" value="save" />
     249<input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
     250<input type="hidden" name="order_by" value="<?php echo wp_specialchars($order_by, 1); ?>" />
     251<input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
    232252<?php else: ?>
    233         <input type="hidden" name="action" value="Add" />
     253<input type="hidden" name="action" value="add" />
    234254<?php endif; ?>
    235 </form>
    236 </div>
     255</div>
     256</form>
     257</div>
Note: See TracChangeset for help on using the changeset viewer.