Consolidate link forms into edit-link-form

git-svn-id: https://develop.svn.wordpress.org/trunk@2890 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2005-09-19 00:47:58 +00:00
parent d218eb9fb6
commit 3efbc15533
4 changed files with 272 additions and 466 deletions

View File

@@ -520,6 +520,20 @@ function get_link_to_edit($link_id) {
return $link;
}
function get_default_link_to_edit() {
if ( isset($_GET['linkurl']) )
$link->link_url = wp_specialchars($_GET['linkurl'], 1);
else
$link->link_url = '';
if ( isset($_GET['name']) )
$link->link_name = wp_specialchars($_GET['name'], 1);
else
$link->link_name = '';
return $link;
}
function add_link() {
return edit_link();
}
@@ -799,6 +813,23 @@ function wp_dropdown_cats($currentcat = 0, $currentparent = 0, $parent = 0, $lev
}
}
function link_category_dropdown($fieldname, $selected = 0) {
global $wpdb;
$results = $wpdb->get_results("SELECT cat_id, cat_name, auto_toggle FROM $wpdb->linkcategories ORDER BY cat_id");
echo "\n<select name='$fieldname' size='1'>\n";
foreach ($results as $row) {
echo "\n\t<option value='$row->cat_id'";
if ($row->cat_id == $selected)
echo " selected='selected'";
echo ">$row->cat_id : " . wp_specialchars($row->cat_name);
if ($row->auto_toggle == 'Y')
echo ' (auto toggle)';
echo "</option>";
}
echo "\n</select>\n";
}
function wp_create_thumbnail($file, $max_side, $effect = '') {
// 1 = GIF, 2 = JPEG, 3 = PNG