mp-wp_genesis 1 <?php
mp-wp_genesis 2 /**
mp-wp_genesis 3 * Edit links form for inclusion in administration panels.
mp-wp_genesis 4 *
mp-wp_genesis 5 * @package WordPress
mp-wp_genesis 6 * @subpackage Administration
mp-wp_genesis 7 */
mp-wp_genesis 8
mp-wp_genesis 9 if ( ! empty($link_id) ) {
mp-wp_genesis 10 $heading = sprintf( __( '<a href="%s">Links</a> / Edit Link' ), 'link-manager.php' );
mp-wp_genesis 11 $submit_text = __('Update Link');
mp-wp_genesis 12 $form = '<form name="editlink" id="editlink" method="post" action="link.php">';
mp-wp_genesis 13 $nonce_action = 'update-bookmark_' . $link_id;
mp-wp_genesis 14 } else {
mp-wp_genesis 15 $heading = sprintf( __( '<a href="%s">Links</a> / Add New Link' ), 'link-manager.php' );
mp-wp_genesis 16 $submit_text = __('Add Link');
mp-wp_genesis 17 $form = '<form name="addlink" id="addlink" method="post" action="link.php">';
mp-wp_genesis 18 $nonce_action = 'add-bookmark';
mp-wp_genesis 19 }
mp-wp_genesis 20
mp-wp_genesis 21 /**
mp-wp_genesis 22 * Display checked checkboxes attribute for xfn microformat options.
mp-wp_genesis 23 *
mp-wp_genesis 24 * @since 1.0.1
mp-wp_genesis 25 *
mp-wp_genesis 26 * @param string $class
mp-wp_genesis 27 * @param string $value
mp-wp_genesis 28 * @param mixed $deprecated Not used.
mp-wp_genesis 29 */
mp-wp_genesis 30 function xfn_check($class, $value = '', $deprecated = '') {
mp-wp_genesis 31 global $link;
mp-wp_genesis 32
mp-wp_genesis 33 $link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
mp-wp_genesis 34 $rels = preg_split('/\s+/', $link_rel);
mp-wp_genesis 35
mp-wp_genesis 36 if ('' != $value && in_array($value, $rels) ) {
mp-wp_genesis 37 echo ' checked="checked"';
mp-wp_genesis 38 }
mp-wp_genesis 39
mp-wp_genesis 40 if ('' == $value) {
mp-wp_genesis 41 if ('family' == $class && strpos($link_rel, 'child') === false && strpos($link_rel, 'parent') === false && strpos($link_rel, 'sibling') === false && strpos($link_rel, 'spouse') === false && strpos($link_rel, 'kin') === false) echo ' checked="checked"';
mp-wp_genesis 42 if ('friendship' == $class && strpos($link_rel, 'friend') === false && strpos($link_rel, 'acquaintance') === false && strpos($link_rel, 'contact') === false) echo ' checked="checked"';
mp-wp_genesis 43 if ('geographical' == $class && strpos($link_rel, 'co-resident') === false && strpos($link_rel, 'neighbor') === false) echo ' checked="checked"';
mp-wp_genesis 44 if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
mp-wp_genesis 45 }
mp-wp_genesis 46 }
mp-wp_genesis 47
mp-wp_genesis 48 /**
mp-wp_genesis 49 * Display link create form fields.
mp-wp_genesis 50 *
mp-wp_genesis 51 * @since 2.7.0
mp-wp_genesis 52 *
mp-wp_genesis 53 * @param object $link
mp-wp_genesis 54 */
mp-wp_genesis 55 function link_submit_meta_box($link) {
mp-wp_genesis 56 ?>
mp-wp_genesis 57 <div class="submitbox" id="submitlink">
mp-wp_genesis 58
mp-wp_genesis 59 <div id="minor-publishing">
mp-wp_genesis 60
mp-wp_genesis 61 <?php // Hidden submit button early on so that the browser chooses the right button when form is submitted with Return key ?>
mp-wp_genesis 62 <div style="display:none;">
mp-wp_genesis 63 <input type="submit" name="save" value="<?php echo attribute_escape( __('Save') ); ?>" />
mp-wp_genesis 64 </div>
mp-wp_genesis 65
mp-wp_genesis 66 <div id="minor-publishing-actions">
mp-wp_genesis 67 <div id="preview-action">
mp-wp_genesis 68 <?php if ( !empty($link->link_id) ) { ?>
mp-wp_genesis 69 <a class="preview button" href="<?php echo $link->link_url; ?>" target="_blank" tabindex="4"><?php _e('Visit Link'); ?></a>
mp-wp_genesis 70 <?php } ?>
mp-wp_genesis 71 </div>
mp-wp_genesis 72 <div class="clear"></div>
mp-wp_genesis 73 </div>
mp-wp_genesis 74
mp-wp_genesis 75 <div id="misc-publishing-actions">
mp-wp_genesis 76 <div class="misc-pub-section misc-pub-section-last">
mp-wp_genesis 77 <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>
mp-wp_genesis 78 </div>
mp-wp_genesis 79 </div>
mp-wp_genesis 80
mp-wp_genesis 81 </div>
mp-wp_genesis 82
mp-wp_genesis 83 <div id="major-publishing-actions">
mp-wp_genesis 84 <?php do_action('post_submitbox_start'); ?>
mp-wp_genesis 85 <div id="delete-action">
mp-wp_genesis 86 <?php
mp-wp_genesis 87 if ( !empty($_GET['action']) && 'edit' == $_GET['action'] && current_user_can('manage_links') ) { ?>
mp-wp_genesis 88 <a class="submitdelete deletion" href="<?php echo wp_nonce_url("link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id); ?>" onclick="if ( confirm('<?php echo 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;"><?php _e('Delete'); ?></a>
mp-wp_genesis 89 <?php } ?>
mp-wp_genesis 90 </div>
mp-wp_genesis 91
mp-wp_genesis 92 <div id="publishing-action">
mp-wp_genesis 93 <?php if ( !empty($link->link_id) ) { ?>
mp-wp_genesis 94 <input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php _e('Update Link') ?>" />
mp-wp_genesis 95 <?php } else { ?>
mp-wp_genesis 96 <input name="save" type="submit" class="button-primary" id="publish" tabindex="4" accesskey="p" value="<?php _e('Add Link') ?>" />
mp-wp_genesis 97 <?php } ?>
mp-wp_genesis 98 </div>
mp-wp_genesis 99 <div class="clear"></div>
mp-wp_genesis 100 </div>
mp-wp_genesis 101 <?php do_action('submitlink_box'); ?>
mp-wp_genesis 102 <div class="clear"></div>
mp-wp_genesis 103 </div>
mp-wp_genesis 104 <?php
mp-wp_genesis 105 }
mp-wp_genesis 106 add_meta_box('linksubmitdiv', __('Save'), 'link_submit_meta_box', 'link', 'side', 'core');
mp-wp_genesis 107
mp-wp_genesis 108 /**
mp-wp_genesis 109 * Display link categories form fields.
mp-wp_genesis 110 *
mp-wp_genesis 111 * @since 2.6.0
mp-wp_genesis 112 *
mp-wp_genesis 113 * @param object $link
mp-wp_genesis 114 */
mp-wp_genesis 115 function link_categories_meta_box($link) { ?>
mp-wp_genesis 116 <div id="category-adder" class="wp-hidden-children">
mp-wp_genesis 117 <h4><a id="category-add-toggle" href="#category-add"><?php _e( '+ Add New Category' ); ?></a></h4>
mp-wp_genesis 118 <p id="link-category-add" class="wp-hidden-child">
mp-wp_genesis 119 <label class="hidden" for="newcat"><?php _e( '+ Add New Category' ); ?></label>
mp-wp_genesis 120 <input type="text" name="newcat" id="newcat" class="form-required form-input-tip" value="<?php _e( 'New category name' ); ?>" aria-required="true" />
mp-wp_genesis 121 <input type="button" id="category-add-sumbit" class="add:categorychecklist:linkcategorydiv button" value="<?php _e( 'Add' ); ?>" />
mp-wp_genesis 122 <?php wp_nonce_field( 'add-link-category', '_ajax_nonce', false ); ?>
mp-wp_genesis 123 <span id="category-ajax-response"></span>
mp-wp_genesis 124 </p>
mp-wp_genesis 125 </div>
mp-wp_genesis 126
mp-wp_genesis 127 <ul id="category-tabs">
mp-wp_genesis 128 <li class="ui-tabs-selected"><a href="#categories-all"><?php _e( 'All Categories' ); ?></a></li>
mp-wp_genesis 129 <li class="hide-if-no-js"><a href="#categories-pop"><?php _e( 'Most Used' ); ?></a></li>
mp-wp_genesis 130 </ul>
mp-wp_genesis 131
mp-wp_genesis 132 <div id="categories-all" class="ui-tabs-panel">
mp-wp_genesis 133 <ul id="categorychecklist" class="list:category categorychecklist form-no-clear">
mp-wp_genesis 134 <?php
mp-wp_genesis 135 if ( isset($link->link_id) )
mp-wp_genesis 136 wp_link_category_checklist($link->link_id);
mp-wp_genesis 137 else
mp-wp_genesis 138 wp_link_category_checklist();
mp-wp_genesis 139 ?>
mp-wp_genesis 140 </ul>
mp-wp_genesis 141 </div>
mp-wp_genesis 142
mp-wp_genesis 143 <div id="categories-pop" class="ui-tabs-panel" style="display: none;">
mp-wp_genesis 144 <ul id="categorychecklist-pop" class="categorychecklist form-no-clear">
mp-wp_genesis 145 <?php wp_popular_terms_checklist('link_category'); ?>
mp-wp_genesis 146 </ul>
mp-wp_genesis 147 </div>
mp-wp_genesis 148 <?php
mp-wp_genesis 149 }
mp-wp_genesis 150 add_meta_box('linkcategorydiv', __('Categories'), 'link_categories_meta_box', 'link', 'normal', 'core');
mp-wp_genesis 151
mp-wp_genesis 152 /**
mp-wp_genesis 153 * Display form fields for changing link target.
mp-wp_genesis 154 *
mp-wp_genesis 155 * @since 2.6.0
mp-wp_genesis 156 *
mp-wp_genesis 157 * @param object $link
mp-wp_genesis 158 */
mp-wp_genesis 159 function link_target_meta_box($link) { ?>
mp-wp_genesis 160 <fieldset><legend class="hidden"><?php _e('Target') ?></legend>
mp-wp_genesis 161 <label for="link_target_blank" class="selectit">
mp-wp_genesis 162 <input id="link_target_blank" type="radio" name="link_target" value="_blank" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_blank') ? 'checked="checked"' : ''); ?> />
mp-wp_genesis 163 <code>_blank</code></label><br />
mp-wp_genesis 164 <label for="link_target_top" class="selectit">
mp-wp_genesis 165 <input id="link_target_top" type="radio" name="link_target" value="_top" <?php echo ( isset( $link->link_target ) && ($link->link_target == '_top') ? 'checked="checked"' : ''); ?> />
mp-wp_genesis 166 <code>_top</code></label><br />
mp-wp_genesis 167 <label for="link_target_none" class="selectit">
mp-wp_genesis 168 <input id="link_target_none" type="radio" name="link_target" value="" <?php echo ( isset( $link->link_target ) && ($link->link_target == '') ? 'checked="checked"' : ''); ?> />
mp-wp_genesis 169 <?php _e('none') ?></label>
mp-wp_genesis 170 </fieldset>
mp-wp_genesis 171 <p><?php _e('Choose the frame your link targets. Essentially this means if you choose <code>_blank</code> your link will open in a new window.'); ?></p>
mp-wp_genesis 172 <?php
mp-wp_genesis 173 }
mp-wp_genesis 174 add_meta_box('linktargetdiv', __('Target'), 'link_target_meta_box', 'link', 'normal', 'core');
mp-wp_genesis 175
mp-wp_genesis 176 /**
mp-wp_genesis 177 * Display xfn form fields.
mp-wp_genesis 178 *
mp-wp_genesis 179 * @since 2.6.0
mp-wp_genesis 180 *
mp-wp_genesis 181 * @param object $link
mp-wp_genesis 182 */
mp-wp_genesis 183 function link_xfn_meta_box($link) {
mp-wp_genesis 184 ?>
mp-wp_genesis 185 <table class="editform" style="width: 100%;" cellspacing="2" cellpadding="5">
mp-wp_genesis 186 <tr>
mp-wp_genesis 187 <th style="width: 20%;" scope="row"><label for="link_rel"><?php _e('rel:') ?></label></th>
mp-wp_genesis 188 <td style="width: 80%;"><input type="text" name="link_rel" id="link_rel" size="50" value="<?php echo ( isset( $link->link_rel ) ? $link->link_rel : ''); ?>" /></td>
mp-wp_genesis 189 </tr>
mp-wp_genesis 190 <tr>
mp-wp_genesis 191 <td colspan="2">
mp-wp_genesis 192 <table cellpadding="3" cellspacing="5" class="form-table">
mp-wp_genesis 193 <tr>
mp-wp_genesis 194 <th scope="row"> <?php _e('identity') ?> </th>
mp-wp_genesis 195 <td><fieldset><legend class="hidden"> <?php _e('identity') ?> </legend>
mp-wp_genesis 196 <label for="me">
mp-wp_genesis 197 <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
mp-wp_genesis 198 <?php _e('another web address of mine') ?></label>
mp-wp_genesis 199 </fieldset></td>
mp-wp_genesis 200 </tr>
mp-wp_genesis 201 <tr>
mp-wp_genesis 202 <th scope="row"> <?php _e('friendship') ?> </th>
mp-wp_genesis 203 <td><fieldset><legend class="hidden"> <?php _e('friendship') ?> </legend>
mp-wp_genesis 204 <label for="contact">
mp-wp_genesis 205 <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php _e('contact') ?></label>
mp-wp_genesis 206 <label for="acquaintance">
mp-wp_genesis 207 <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> /> <?php _e('acquaintance') ?></label>
mp-wp_genesis 208 <label for="friend">
mp-wp_genesis 209 <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php _e('friend') ?></label>
mp-wp_genesis 210 <label for="friendship">
mp-wp_genesis 211 <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php _e('none') ?></label>
mp-wp_genesis 212 </fieldset></td>
mp-wp_genesis 213 </tr>
mp-wp_genesis 214 <tr>
mp-wp_genesis 215 <th scope="row"> <?php _e('physical') ?> </th>
mp-wp_genesis 216 <td><fieldset><legend class="hidden"> <?php _e('physical') ?> </legend>
mp-wp_genesis 217 <label for="met">
mp-wp_genesis 218 <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
mp-wp_genesis 219 <?php _e('met') ?></label>
mp-wp_genesis 220 </fieldset></td>
mp-wp_genesis 221 </tr>
mp-wp_genesis 222 <tr>
mp-wp_genesis 223 <th scope="row"> <?php _e('professional') ?> </th>
mp-wp_genesis 224 <td><fieldset><legend class="hidden"> <?php _e('professional') ?> </legend>
mp-wp_genesis 225 <label for="co-worker">
mp-wp_genesis 226 <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
mp-wp_genesis 227 <?php _e('co-worker') ?></label>
mp-wp_genesis 228 <label for="colleague">
mp-wp_genesis 229 <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
mp-wp_genesis 230 <?php _e('colleague') ?></label>
mp-wp_genesis 231 </fieldset></td>
mp-wp_genesis 232 </tr>
mp-wp_genesis 233 <tr>
mp-wp_genesis 234 <th scope="row"> <?php _e('geographical') ?> </th>
mp-wp_genesis 235 <td><fieldset><legend class="hidden"> <?php _e('geographical') ?> </legend>
mp-wp_genesis 236 <label for="co-resident">
mp-wp_genesis 237 <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
mp-wp_genesis 238 <?php _e('co-resident') ?></label>
mp-wp_genesis 239 <label for="neighbor">
mp-wp_genesis 240 <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
mp-wp_genesis 241 <?php _e('neighbor') ?></label>
mp-wp_genesis 242 <label for="geographical">
mp-wp_genesis 243 <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
mp-wp_genesis 244 <?php _e('none') ?></label>
mp-wp_genesis 245 </fieldset></td>
mp-wp_genesis 246 </tr>
mp-wp_genesis 247 <tr>
mp-wp_genesis 248 <th scope="row"> <?php _e('family') ?> </th>
mp-wp_genesis 249 <td><fieldset><legend class="hidden"> <?php _e('family') ?> </legend>
mp-wp_genesis 250 <label for="child">
mp-wp_genesis 251 <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />
mp-wp_genesis 252 <?php _e('child') ?></label>
mp-wp_genesis 253 <label for="kin">
mp-wp_genesis 254 <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?> />
mp-wp_genesis 255 <?php _e('kin') ?></label>
mp-wp_genesis 256 <label for="parent">
mp-wp_genesis 257 <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
mp-wp_genesis 258 <?php _e('parent') ?></label>
mp-wp_genesis 259 <label for="sibling">
mp-wp_genesis 260 <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
mp-wp_genesis 261 <?php _e('sibling') ?></label>
mp-wp_genesis 262 <label for="spouse">
mp-wp_genesis 263 <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
mp-wp_genesis 264 <?php _e('spouse') ?></label>
mp-wp_genesis 265 <label for="family">
mp-wp_genesis 266 <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
mp-wp_genesis 267 <?php _e('none') ?></label>
mp-wp_genesis 268 </fieldset></td>
mp-wp_genesis 269 </tr>
mp-wp_genesis 270 <tr>
mp-wp_genesis 271 <th scope="row"> <?php _e('romantic') ?> </th>
mp-wp_genesis 272 <td><fieldset><legend class="hidden"> <?php _e('romantic') ?> </legend>
mp-wp_genesis 273 <label for="muse">
mp-wp_genesis 274 <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
mp-wp_genesis 275 <?php _e('muse') ?></label>
mp-wp_genesis 276 <label for="crush">
mp-wp_genesis 277 <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
mp-wp_genesis 278 <?php _e('crush') ?></label>
mp-wp_genesis 279 <label for="date">
mp-wp_genesis 280 <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
mp-wp_genesis 281 <?php _e('date') ?></label>
mp-wp_genesis 282 <label for="romantic">
mp-wp_genesis 283 <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
mp-wp_genesis 284 <?php _e('sweetheart') ?></label>
mp-wp_genesis 285 </fieldset></td>
mp-wp_genesis 286 </tr>
mp-wp_genesis 287 </table>
mp-wp_genesis 288 </td>
mp-wp_genesis 289 </tr>
mp-wp_genesis 290 </table>
mp-wp_genesis 291 <p><?php _e('If the link is to a person, you can specify your relationship with them using the above form. If you would like to learn more about the idea check out <a href="http://gmpg.org/xfn/">XFN</a>.'); ?></p>
mp-wp_genesis 292 <?php
mp-wp_genesis 293 }
mp-wp_genesis 294 add_meta_box('linkxfndiv', __('Link Relationship (XFN)'), 'link_xfn_meta_box', 'link', 'normal', 'core');
mp-wp_genesis 295
mp-wp_genesis 296 /**
mp-wp_genesis 297 * Display advanced link options form fields.
mp-wp_genesis 298 *
mp-wp_genesis 299 * @since 2.6.0
mp-wp_genesis 300 *
mp-wp_genesis 301 * @param object $link
mp-wp_genesis 302 */
mp-wp_genesis 303 function link_advanced_meta_box($link) {
mp-wp_genesis 304 ?>
mp-wp_genesis 305 <table class="form-table" style="width: 100%;" cellspacing="2" cellpadding="5">
mp-wp_genesis 306 <tr class="form-field">
mp-wp_genesis 307 <th valign="top" scope="row"><label for="link_image"><?php _e('Image Address') ?></label></th>
mp-wp_genesis 308 <td><input type="text" name="link_image" id="link_image" size="50" value="<?php echo ( isset( $link->link_image ) ? $link->link_image : ''); ?>" style="width: 95%" /></td>
mp-wp_genesis 309 </tr>
mp-wp_genesis 310 <tr class="form-field">
mp-wp_genesis 311 <th valign="top" scope="row"><label for="rss_uri"><?php _e('RSS Address') ?></label></th>
mp-wp_genesis 312 <td><input name="link_rss" type="text" id="rss_uri" value="<?php echo ( isset( $link->link_rss ) ? $link->link_rss : ''); ?>" size="50" style="width: 95%" /></td>
mp-wp_genesis 313 </tr>
mp-wp_genesis 314 <tr class="form-field">
mp-wp_genesis 315 <th valign="top" scope="row"><label for="link_notes"><?php _e('Notes') ?></label></th>
mp-wp_genesis 316 <td><textarea name="link_notes" id="link_notes" cols="50" rows="10" style="width: 95%"><?php echo ( isset( $link->link_notes ) ? $link->link_notes : ''); ?></textarea></td>
mp-wp_genesis 317 </tr>
mp-wp_genesis 318 <tr class="form-field">
mp-wp_genesis 319 <th valign="top" scope="row"><label for="link_rating"><?php _e('Rating') ?></label></th>
mp-wp_genesis 320 <td><select name="link_rating" id="link_rating" size="1">
mp-wp_genesis 321 <?php
mp-wp_genesis 322 for ($r = 0; $r < 10; $r++) {
mp-wp_genesis 323 echo(' <option value="'.$r.'" ');
mp-wp_genesis 324 if ( isset($link->link_rating) && $link->link_rating == $r)
mp-wp_genesis 325 echo 'selected="selected"';
mp-wp_genesis 326 echo('>'.$r.'</option>');
mp-wp_genesis 327 }
mp-wp_genesis 328 ?></select> <?php _e('(Leave at 0 for no rating.)') ?>
mp-wp_genesis 329 </td>
mp-wp_genesis 330 </tr>
mp-wp_genesis 331 </table>
mp-wp_genesis 332 <?php
mp-wp_genesis 333 }
mp-wp_genesis 334 add_meta_box('linkadvanceddiv', __('Advanced'), 'link_advanced_meta_box', 'link', 'normal', 'core');
mp-wp_genesis 335
mp-wp_genesis 336 do_action('do_meta_boxes', 'link', 'normal', $link);
mp-wp_genesis 337 do_action('do_meta_boxes', 'link', 'advanced', $link);
mp-wp_genesis 338 do_action('do_meta_boxes', 'link', 'side', $link);
mp-wp_genesis 339
mp-wp_genesis 340 require_once ('admin-header.php');
mp-wp_genesis 341
mp-wp_genesis 342 ?>
mp-wp_genesis 343
mp-wp_genesis 344
mp-wp_genesis 345 <div class="wrap">
mp-wp_genesis 346 <?php screen_icon(); ?>
mp-wp_genesis 347 <h2><?php echo wp_specialchars( $title ); ?></h2>
mp-wp_genesis 348
mp-wp_genesis 349 <?php if ( isset( $_GET['added'] ) ) : ?>
mp-wp_genesis 350 <div id="message" class="updated fade"><p><?php _e('Link added.'); ?></p></div>
mp-wp_genesis 351 <?php endif; ?>
mp-wp_genesis 352
mp-wp_genesis 353 <?php
mp-wp_genesis 354 if ( !empty($form) )
mp-wp_genesis 355 echo $form;
mp-wp_genesis 356 if ( !empty($link_added) )
mp-wp_genesis 357 echo $link_added;
mp-wp_genesis 358
mp-wp_genesis 359 wp_nonce_field( $nonce_action );
mp-wp_genesis 360 wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
mp-wp_genesis 361 wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false ); ?>
mp-wp_genesis 362
mp-wp_genesis 363 <div id="poststuff" class="metabox-holder">
mp-wp_genesis 364
mp-wp_genesis 365 <div id="side-info-column" class="inner-sidebar">
mp-wp_genesis 366 <?php
mp-wp_genesis 367
mp-wp_genesis 368 do_action('submitlink_box');
mp-wp_genesis 369 $side_meta_boxes = do_meta_boxes( 'link', 'side', $link );
mp-wp_genesis 370
mp-wp_genesis 371 ?>
mp-wp_genesis 372 </div>
mp-wp_genesis 373
mp-wp_genesis 374 <div id="post-body" class="<?php echo $side_meta_boxes ? 'has-sidebar' : ''; ?>">
mp-wp_genesis 375 <div id="post-body-content" class="has-sidebar-content">
mp-wp_genesis 376 <div id="namediv" class="stuffbox">
mp-wp_genesis 377 <h3><label for="link_name"><?php _e('Name') ?></label></h3>
mp-wp_genesis 378 <div class="inside">
mp-wp_genesis 379 <input type="text" name="link_name" size="30" tabindex="1" value="<?php echo $link->link_name; ?>" id="link_name" />
mp-wp_genesis 380 <p><?php _e('Example: Nifty blogging software'); ?></p>
mp-wp_genesis 381 </div>
mp-wp_genesis 382 </div>
mp-wp_genesis 383
mp-wp_genesis 384 <div id="addressdiv" class="stuffbox">
mp-wp_genesis 385 <h3><label for="link_url"><?php _e('Web Address') ?></label></h3>
mp-wp_genesis 386 <div class="inside">
mp-wp_genesis 387 <input type="text" name="link_url" size="30" tabindex="1" value="<?php echo $link->link_url; ?>" id="link_url" />
mp-wp_genesis 388 <p><?php _e('Example: <code>http://wordpress.org/</code> — don’t forget the <code>http://</code>'); ?></p>
mp-wp_genesis 389 </div>
mp-wp_genesis 390 </div>
mp-wp_genesis 391
mp-wp_genesis 392 <div id="descriptiondiv" class="stuffbox">
mp-wp_genesis 393 <h3><label for="link_description"><?php _e('Description') ?></label></h3>
mp-wp_genesis 394 <div class="inside">
mp-wp_genesis 395 <input type="text" name="link_description" size="30" tabindex="1" value="<?php echo isset($link->link_description) ? $link->link_description : ''; ?>" id="link_description" />
mp-wp_genesis 396 <p><?php _e('This will be shown when someone hovers over the link in the blogroll, or optionally below the link.'); ?></p>
mp-wp_genesis 397 </div>
mp-wp_genesis 398 </div>
mp-wp_genesis 399
mp-wp_genesis 400 <?php
mp-wp_genesis 401
mp-wp_genesis 402 do_meta_boxes('link', 'normal', $link);
mp-wp_genesis 403
mp-wp_genesis 404 do_meta_boxes('link', 'advanced', $link);
mp-wp_genesis 405
mp-wp_genesis 406 if ( $link_id ) : ?>
mp-wp_genesis 407 <input type="hidden" name="action" value="save" />
mp-wp_genesis 408 <input type="hidden" name="link_id" value="<?php echo (int) $link_id; ?>" />
mp-wp_genesis 409 <input type="hidden" name="order_by" value="<?php echo attribute_escape($order_by); ?>" />
mp-wp_genesis 410 <input type="hidden" name="cat_id" value="<?php echo (int) $cat_id ?>" />
mp-wp_genesis 411 <?php else: ?>
mp-wp_genesis 412 <input type="hidden" name="action" value="add" />
mp-wp_genesis 413 <?php endif; ?>
mp-wp_genesis 414
mp-wp_genesis 415 </div>
mp-wp_genesis 416 </div>
mp-wp_genesis 417 </div>
mp-wp_genesis 418
mp-wp_genesis 419 </form>
mp-wp_genesis 420 </div>