Scoop -- the swiss army chainsaw of content management
Front Page · Everything · News · Code · Help! · Wishlist · Project · Scoop Sites · Dev Notes · Latest CVS changes · Development Activities
Scoop Box Exchange - Show Box: section_menu 1.00

Author: hillct [Info]

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;
Display: Sort:
Menu
· create account
· faq
· search
· report bugs
· Scoop Administrators Guide
· Scoop Box Exchange

Scoop Site Scroller: Get one yourself!
Scoop::Ads
Almost there...

Login
Make a new account
Username:
Password:

Hosted by ScoopHost.com Powered by Scoop
All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest © 1999 The Management

create account | faq | search