Gossamer Forum
Home : Products : Gossamer Links : Discussions :

mutlpile categories add modify form

Quote Reply
mutlpile categories add modify form
hi,
the use the following global my add/modify.it works perfectly. Also when people select to place their links in multiple categories, it will do this.however when they go to modify that link, only one category shows as selected them to modify form. how can I change this so that it shows all the categories that the link is associated with in the multiple select form
sub {
my $catid = shift;
my $show_count = $_[0];
my $in_id = $IN->param('CatLinks.CategoryID') || $IN->param('ID');
my $table = $DB->table('Category') || return $GT::SQL::error;
my $back;

$table->select_options('ORDER BY Full_Name') || return $GT::SQL::error;
my $cond = GT::SQL::Condition->new('menuShow','=','Yes');
my $sth = $table->select( ['ID','Full_Name','Number_of_Links'], $cond) || return $GT::SQL::error;

while (my ($id,$full_name,$numberoflinks) = $sth->fetchrow_array) {
my $full_name2;
my @cut = split /\//, $full_name;
for (my $i=0; $i < $#cut; $i++) {
$full_name2 .= "&nbsp;&nbsp;&nbsp;";
}
$full_name2 .= $cut[$#cut];
if ($show_count) {
$full_name2 .= " ($numberoflinks)";
}
$back .= "<option value=\"$id\"";
if ($in_id == $id) { $back .= "selected=\"selected\""; }
$back .= ">$full_name2</option>";
}
my $send_back = qq|<select MULTIPLE SIZE="5" name="CatLinks.CategoryID"><option value="">------</option>$back</select>|;
return $send_back;
}
cheers,
Subject Author Views Date
Thread mutlpile categories add modify form ajiimd 2258 Nov 16, 2004, 5:07 PM
Thread Re: [ajiimd] mutlpile categories add modify form
Jonze 2203 Nov 17, 2004, 11:06 AM
Thread Re: [Jonze] mutlpile categories add modify form
ajiimd 2179 Nov 17, 2004, 6:47 PM
Thread Re: [ajiimd] mutlpile categories add modify form
Jonze 2194 Nov 18, 2004, 11:15 AM
Post Re: [Jonze] mutlpile categories add modify form
ajiimd 2185 Nov 18, 2004, 2:47 PM
Post Re: [Jonze] mutlpile categories add modify form
ajiimd 2125 Dec 19, 2004, 7:40 PM