Scoop Box Exchange - Show Box: section_menu 1.00
|
Description:
This is a section menu displayed inside a select box form element. It checks read permissions and whether or not to display the Advertisments section. It should probably do the same for Diaries, but that's left for someone who wants to disable diaries.
Box Code:
my $archive_box = qq{
<br /><div align='center'><form name="form">
<select name="site" size=1 onChange="javascript:formHandler()" style="background-color: #ffffff; font-size: 9px;">
<option value="">Select section...</option>
<option value="/section/__all__">All Stories</option>
};
foreach my $section (keys %{$S->{SECTION_DATA}}) {
next if(($section eq $S->var('ad_story_section')) &&
!$S->var('use_ads'));
next unless ($S->have_section_perm( 'norm_read_stories', $section));
$archive_box .= qq{
<option value="/section/$section">$S->{SECTION_DATA}->{$section}->{title}}."</option>";
}
$archive_box .= qq{</select></form></div>};
my $js=qq{
<script language="JavaScript" type="text/javascript">
<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</script>
};
return $js.$archive_box;
|
|
Smokedot |
It's 4:19... do you know where your bong is? |
|
|
|
|