Fixes to XFN creator

git-svn-id: http://svn.automattic.com/wordpress/trunk@2051 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2005-01-06 09:46:52 +00:00
parent 6e71a37427
commit b835332cd0
2 changed files with 157 additions and 138 deletions

View File

@ -22,6 +22,22 @@ function category_dropdown($fieldname, $selected = 0) {
echo "\n</select>\n"; echo "\n</select>\n";
} }
function xfn_check($class, $value = '', $type = 'check') {
global $link_rel;
$rels = preg_split('/\s+/', $link_rel);
if ('' != $value && in_array($value, $rels) ) {
echo ' checked="checked"';
}
if ('' == $value) {
if ('family' == $class && !strstr($link_rel, 'child') && !strstr($link_rel, 'parent') && !strstr($link_rel, 'sibling') && !strstr($link_rel, 'spouse') && !strstr($link_rel, 'kin')) echo ' checked="checked"';
if ('friendship' == $class && !strstr($link_rel, 'friend') && !strstr($link_rel, 'acquaintance') && !strstr($link_rel, 'contact') ) echo ' checked="checked"';
if ('geographical' == $class && !strstr($link_rel, 'co-resident') && !strstr($link_rel, 'neighbor') ) echo ' checked="checked"';
if ('identity' == $class && in_array('me', $rels) ) echo ' checked="checked"';
}
}
$wpvarstoreset = array('action', 'cat_id', 'linkurl', 'name', 'image', $wpvarstoreset = array('action', 'cat_id', 'linkurl', 'name', 'image',
'description', 'visible', 'target', 'category', 'link_id', 'description', 'visible', 'target', 'category', 'link_id',
'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel',
@ -82,106 +98,109 @@ require('admin-header.php');
<legend><?php _e('Link Relationship (XFN)') ?></legend> <legend><?php _e('Link Relationship (XFN)') ?></legend>
<table class="editform" width="100%" cellspacing="2" cellpadding="5"> <table class="editform" width="100%" cellspacing="2" cellpadding="5">
<tr> <tr>
<th width="33%" scope="row"><?php _e('rel:') ?></th> <th width="33%" scope="row"><?php _e('rel:') ?></th>
<td width="67%"><input type="text" name="rel" id="rel" size="50" value="" /></td> <td width="67%"><input type="text" name="rel" id="rel" size="50" value="<?php echo $link_rel; ?>" /></td>
</tr> </tr>
<tr> <tr>
<th scope="row"><?php _e('<a href="http://gmpg.org/xfn/">XFN</a> Creator:') ?></th> <th scope="row"><?php _e('<a href="http://gmpg.org/xfn/">XFN</a> Creator:') ?></th>
<td><table cellpadding="3" cellspacing="5"> <td>
<tr> <table cellpadding="3" cellspacing="5">
<th scope="row"> <?php _e('friendship') ?> </th> <tr>
<td> <th scope="row"> <?php _e('identity') ?> </th>
<label for="label1"> <td>
<input class="valinp" type="radio" name="friendship" value="acquaintance" id="label1" /> <label for="me">
<?php _e('acquaintance') ?></label> <input type="checkbox" name="identity" value="me" id="me" <?php xfn_check('identity', 'me'); ?> />
<label for="label2"> <?php _e('another web address of mine') ?></label>
<input class="valinp" type="radio" name="friendship" value="contact" id="label2" /> </td>
<?php _e('contact') ?></label> </tr>
<label for="label3"> <tr>
<input class="valinp" type="radio" name="friendship" value="friend" id="label3" /> <th scope="row"> <?php _e('friendship') ?> </th>
<?php _e('friend') ?></label> <td>
<label for="label4"> <label for="acquaintance">
<input class="valinp" type="radio" name="friendship" value="" id="label4" /> <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> /> <?php _e('acquaintance') ?></label>
<?php _e('none') ?></label> <label for="contact">
</td> <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php _e('contact') ?></label>
</tr> <label id="friend">
<tr> <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php _e('friend') ?></label>
<th scope="row"> <?php _e('physical') ?> </th> <label for="friendship">
<td><label for="label10"> <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php _e('none') ?></label>
<input class="valinp" type="checkbox" name="physical" value="met" id="label10" /> </td>
<?php _e('met') ?></label> </tr>
</td> <tr>
</tr> <th scope="row"> <?php _e('physical') ?> </th>
<tr> <td>
<th scope="row"> <?php _e('professional') ?> </th> <label for="met">
<td><label for="label20"> <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
<input class="valinp" type="checkbox" name="professional" value="co-worker" id="label20" /> <?php _e('met') ?></label>
<?php _e('co-worker') ?></label> </td>
<label for="label21"> </tr>
<input class="valinp" type="checkbox" name="professional" value="colleague" id="label21" /> <tr>
<?php _e('colleague') ?></label> <th scope="row"> <?php _e('professional') ?> </th>
</td> <td>
</tr> <label for="co-worker">
<tr> <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
<th scope="row"> <?php _e('geographical') ?> </th> <?php _e('co-worker') ?></label>
<td><label for="label30"> <label for="colleague">
<input class="valinp" type="radio" name="geographical" value="co-resident" id="label30" /> <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
<?php _e('co-resident') ?></label> <?php _e('colleague') ?></label>
<label for="label31"> </td>
<input class="valinp" type="radio" name="geographical" value="neighbor" id="label31" /> </tr>
<?php _e('neighbor') ?></label> <tr>
<label for="label32"> <th scope="row"> <?php _e('geographical') ?> </th>
<input class="valinp" type="radio" name="geographical" value="" id="label32" /> <td>
<?php _e('none') ?></label> <label for="co-resident">
</td> <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
</tr> <?php _e('co-resident') ?></label>
<tr> <label for="neighbor">
<th scope="row"> <?php _e('family') ?> </th> <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
<td> <?php _e('neighbor') ?></label>
<label for="label40"> <label for="geographical">
<input class="valinp" type="radio" name="family" value="child" id="label40" /> <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
<?php _e('child') ?></label> <?php _e('none') ?></label>
<label for="label41"> </td>
<input class="valinp" type="radio" name="family" value="kin" id="label41" /> </tr>
<?php _e('kin') ?></label> <tr>
<label for="label42"> <th scope="row"> family </th>
<input class="valinp" type="radio" name="family" value="parent" id="label42" /> <td>
<?php _e('parent') ?></label> <label for="child">
<label for="label43"> <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />
<input class="valinp" type="radio" name="family" value="sibling" id="label43" /> <?php _e('child') ?></label>
<?php _e('sibling') ?></label> <label for="kin">
<label for="label44"> <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?> />
<input class="valinp" type="radio" name="family" value="spouse" id="label44" /> <?php _e('kin') ?></label>
<?php _e('spouse') ?></label> <label for="parent">
<label for="label45"> <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
<input class="valinp" type="radio" name="family" value="" id="label45" /> <?php _e('parent') ?></label>
<?php _e('none') ?></label> <label for="sibling">
</td> <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
</tr> <?php _e('sibling') ?></label>
<tr> <label for="spouse">
<th scope="row"> <?php _e('romantic') ?> </th> <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
<td><label for="label50"> <?php _e('spouse') ?></label>
<input class="valinp" type="checkbox" name="romantic" value="muse" id="label50" /> <label for="family">
<?php _e('muse') ?></label> <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
<label for="label51"> <?php _e('none') ?></label>
<input class="valinp" type="checkbox" name="romantic" value="crush" id="label51" /> </td>
<?php _e('crush') ?></label> </tr>
<label for="label52"> <tr>
<input class="valinp" type="checkbox" name="romantic" value="date" id="label42" /> <th scope="row"> <?php _e('romantic') ?> </th>
<?php _e('date') ?></label> <td>
<label for="label53"> <label for="muse">
<input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="label53" /> <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
<?php _e('sweetheart') ?></label> <?php _e('muse') ?></label>
</td> <label for="crush">
</tr> <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
<tr> <?php _e('crush') ?></label>
<th scope="row"> <?php _e('identity') ?> </th> <label for="date">
<td><label for="label60"> <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
<input class="valinp" type="checkbox" name="identity" value="me" id="label60" /> <?php _e('date') ?></label>
<?php _e('me') ?></label> <label for="romantic">
</td> <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
</tr> <?php _e('sweetheart') ?></label>
</table></td> </td>
</tr>
</table>
</td>
</tr> </tr>
</table> </table>
</fieldset> </fieldset>

View File

@ -346,86 +346,86 @@ switch ($action) {
<tr> <tr>
<th scope="row"> <?php _e('friendship') ?> </th> <th scope="row"> <?php _e('friendship') ?> </th>
<td> <td>
<label for="label"> <label for="acquaintance">
<input class="valinp" type="radio" name="friendship" value="acquaintance" id="label" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> /> <?php _e('acquaintance') ?></label> <input class="valinp" type="radio" name="friendship" value="acquaintance" id="acquaintance" <?php xfn_check('friendship', 'acquaintance', 'radio'); ?> /> <?php _e('acquaintance') ?></label>
<label for="label2"> <label for="contact">
<input class="valinp" type="radio" name="friendship" value="contact" id="label2" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php _e('contact') ?></label> <input class="valinp" type="radio" name="friendship" value="contact" id="contact" <?php xfn_check('friendship', 'contact', 'radio'); ?> /> <?php _e('contact') ?></label>
<label for="label3"> <label id="friend">
<input class="valinp" type="radio" name="friendship" value="friend" id="label3" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php _e('friend') ?></label> <input class="valinp" type="radio" name="friendship" value="friend" id="friend" <?php xfn_check('friendship', 'friend', 'radio'); ?> /> <?php _e('friend') ?></label>
<label for="label4"> <label for="friendship">
<input name="friendship" type="radio" class="valinp" id="label4" value="" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php _e('none') ?></label> <input name="friendship" type="radio" class="valinp" value="" id="friendship" <?php xfn_check('friendship', '', 'radio'); ?> /> <?php _e('none') ?></label>
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row"> <?php _e('physical') ?> </th> <th scope="row"> <?php _e('physical') ?> </th>
<td> <td>
<label for="label10"> <label for="met">
<input class="valinp" type="checkbox" name="physical" value="met" id="label10" <?php xfn_check('physical', 'met'); ?> /> <input class="valinp" type="checkbox" name="physical" value="met" id="met" <?php xfn_check('physical', 'met'); ?> />
<?php _e('met') ?></label> <?php _e('met') ?></label>
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row"> <?php _e('professional') ?> </th> <th scope="row"> <?php _e('professional') ?> </th>
<td> <td>
<label for="label20"> <label for="co-worker">
<input class="valinp" type="checkbox" name="professional" value="co-worker" id="label20" <?php xfn_check('professional', 'co-worker'); ?> /> <input class="valinp" type="checkbox" name="professional" value="co-worker" id="co-worker" <?php xfn_check('professional', 'co-worker'); ?> />
<?php _e('co-worker') ?></label> <?php _e('co-worker') ?></label>
<label for="label21"> <label for="colleague">
<input class="valinp" type="checkbox" name="professional" value="colleague" id="label21" <?php xfn_check('professional', 'colleague'); ?> /> <input class="valinp" type="checkbox" name="professional" value="colleague" id="colleague" <?php xfn_check('professional', 'colleague'); ?> />
<?php _e('colleague') ?></label> <?php _e('colleague') ?></label>
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row"> <?php _e('geographical') ?> </th> <th scope="row"> <?php _e('geographical') ?> </th>
<td> <td>
<label for="label30"> <label for="co-resident">
<input class="valinp" type="radio" name="geographical" value="co-resident" id="label30" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> /> <input class="valinp" type="radio" name="geographical" value="co-resident" id="co-resident" <?php xfn_check('geographical', 'co-resident', 'radio'); ?> />
<?php _e('co-resident') ?></label> <?php _e('co-resident') ?></label>
<label for="label31"> <label for="neighbor">
<input class="valinp" type="radio" name="geographical" value="neighbor" id="label31" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> /> <input class="valinp" type="radio" name="geographical" value="neighbor" id="neighbor" <?php xfn_check('geographical', 'neighbor', 'radio'); ?> />
<?php _e('neighbor') ?></label> <?php _e('neighbor') ?></label>
<label for="label32"> <label for="geographical">
<input class="valinp" type="radio" name="geographical" value="" id="label32" <?php xfn_check('geographical', '', 'radio'); ?> /> <input class="valinp" type="radio" name="geographical" value="" id="geographical" <?php xfn_check('geographical', '', 'radio'); ?> />
<?php _e('none') ?></label> <?php _e('none') ?></label>
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row"> family </th> <th scope="row"> family </th>
<td> <td>
<label for="label40"> <label for="child">
<input class="valinp" type="radio" name="family" value="child" id="label40" <?php xfn_check('family', 'child', 'radio'); ?> /> <input class="valinp" type="radio" name="family" value="child" id="child" <?php xfn_check('family', 'child', 'radio'); ?> />
<?php _e('child') ?></label> <?php _e('child') ?></label>
<label for="label41"> <label for="kin">
<input class="valinp" type="radio" name="family" value="kin" id="label41" <?php xfn_check('family', 'kin', 'radio'); ?> /> <input class="valinp" type="radio" name="family" value="kin" id="kin" <?php xfn_check('family', 'kin', 'radio'); ?> />
<?php _e('kin') ?></label> <?php _e('kin') ?></label>
<label for="label42"> <label for="parent">
<input class="valinp" type="radio" name="family" value="parent" id="label42" <?php xfn_check('family', 'parent', 'radio'); ?> /> <input class="valinp" type="radio" name="family" value="parent" id="parent" <?php xfn_check('family', 'parent', 'radio'); ?> />
<?php _e('parent') ?></label> <?php _e('parent') ?></label>
<label for="label43"> <label for="sibling">
<input class="valinp" type="radio" name="family" value="sibling" id="label43" <?php xfn_check('family', 'sibling', 'radio'); ?> /> <input class="valinp" type="radio" name="family" value="sibling" id="sibling" <?php xfn_check('family', 'sibling', 'radio'); ?> />
<?php _e('sibling') ?></label> <?php _e('sibling') ?></label>
<label for="label44"> <label for="spouse">
<input class="valinp" type="radio" name="family" value="spouse" id="label44" <?php xfn_check('family', 'spouse', 'radio'); ?> /> <input class="valinp" type="radio" name="family" value="spouse" id="spouse" <?php xfn_check('family', 'spouse', 'radio'); ?> />
<?php _e('spouse') ?></label> <?php _e('spouse') ?></label>
<label for="label45"> <label for="family">
<input class="valinp" type="radio" name="family" value="" id="label45" <?php xfn_check('family', '', 'radio'); ?> /> <input class="valinp" type="radio" name="family" value="" id="family" <?php xfn_check('family', '', 'radio'); ?> />
<?php _e('none') ?></label> <?php _e('none') ?></label>
</td> </td>
</tr> </tr>
<tr> <tr>
<th scope="row"> <?php _e('romantic') ?> </th> <th scope="row"> <?php _e('romantic') ?> </th>
<td> <td>
<label for="label50"> <label for="muse">
<input class="valinp" type="checkbox" name="romantic" value="muse" id="label50" <?php xfn_check('romantic', 'muse'); ?> /> <input class="valinp" type="checkbox" name="romantic" value="muse" id="muse" <?php xfn_check('romantic', 'muse'); ?> />
<?php _e('muse') ?></label> <?php _e('muse') ?></label>
<label for="label51"> <label for="crush">
<input class="valinp" type="checkbox" name="romantic" value="crush" id="label51" <?php xfn_check('romantic', 'crush'); ?> /> <input class="valinp" type="checkbox" name="romantic" value="crush" id="crush" <?php xfn_check('romantic', 'crush'); ?> />
<?php _e('crush') ?></label> <?php _e('crush') ?></label>
<label for="label52"> <label for="date">
<input class="valinp" type="checkbox" name="romantic" value="date" id="label52" <?php xfn_check('romantic', 'date'); ?> /> <input class="valinp" type="checkbox" name="romantic" value="date" id="date" <?php xfn_check('romantic', 'date'); ?> />
<?php _e('date') ?></label> <?php _e('date') ?></label>
<label for="label53"> <label for="romantic">
<input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="label53" <?php xfn_check('romantic', 'sweetheart'); ?> /> <input class="valinp" type="checkbox" name="romantic" value="sweetheart" id="romantic" <?php xfn_check('romantic', 'sweetheart'); ?> />
<?php _e('sweetheart') ?></label> <?php _e('sweetheart') ?></label>
</td> </td>
</tr> </tr>