Thanks tandat,
But I can get it to work, do I have the changes in the right place?
sub {
my ($category,$output);
my $db= $DB->table('Category') || return $GT::SQL::error;
$db->select_options('ORDER BY Full_Name') || return $GT::SQL::error;
my $sth = $db->select( ['ID','Full_Name', 'CatDepth', 'Number_of_Links'] ) || return $GT::SQL::error;
$output .= qq|<select name="nnn-DeptSelect" onchange="top.location=this.options[this.selectedIndex].value" size="1">\n|;
$output .= qq|<option selected>Website Categories</option>\n|;
my $preurl = "$CFG->{build_root_url}/";
if($IN->param('d'){
$preurl="$CFG->{db_cgi_url}/page.cgi?d=1;g=";
}
while (my ($id,$full_name, $depth, $cnt) = $sth->fetchrow_array) {
my $safe_full = $full_name;
my @cut = split /\//, $full_name;
my $back = '';
for (my $i=0; $i < $#cut; $i++) {
$back .= q| |;
}
$back .= $cut[$#cut];
$output .= qq|<option value="$preurl| . $db->as_url($safe_full) . qq|/$CFG->{build_index}">$back ($cnt)</option>|. "\n";
}
$output .= "</select>\n";
return \$output;
}
But I can get it to work, do I have the changes in the right place?
sub {
my ($category,$output);
my $db= $DB->table('Category') || return $GT::SQL::error;
$db->select_options('ORDER BY Full_Name') || return $GT::SQL::error;
my $sth = $db->select( ['ID','Full_Name', 'CatDepth', 'Number_of_Links'] ) || return $GT::SQL::error;
$output .= qq|<select name="nnn-DeptSelect" onchange="top.location=this.options[this.selectedIndex].value" size="1">\n|;
$output .= qq|<option selected>Website Categories</option>\n|;
my $preurl = "$CFG->{build_root_url}/";
if($IN->param('d'){
$preurl="$CFG->{db_cgi_url}/page.cgi?d=1;g=";
}
while (my ($id,$full_name, $depth, $cnt) = $sth->fetchrow_array) {
my $safe_full = $full_name;
my @cut = split /\//, $full_name;
my $back = '';
for (my $i=0; $i < $#cut; $i++) {
$back .= q| |;
}
$back .= $cut[$#cut];
$output .= qq|<option value="$preurl| . $db->as_url($safe_full) . qq|/$CFG->{build_index}">$back ($cnt)</option>|. "\n";
}
$output .= "</select>\n";
return \$output;
}