#!/usr/bin/perl
#########################################
# index
# - do all index stuff, also deal with keyword admin
#########################################
use localbucky;
$dbh = DBI->connect ($dsn);
our ($USER, $lastlog) = checkin();
my $k;
my $tag;
# check name of the calling script: index, tag, keyword
$input->{script} ||= $input->{script_from_uri} if defined($input->{script_from_uri});
# load the tag or keyword into the input params, if they don't exit already
if ( $input->{script} eq $BUCKY_LEXICON_TAG )
{
$input->{tag} ||= $input->{object_from_uri} if defined($input->{object_from_uri});
}
elsif ( $input->{script} eq $BUCKY_LEXICON_KEYWORD )
{
$input->{keyword} ||= $input->{object_from_uri} if defined($input->{object_from_uri});
}
# Get keyword
if (exists($input->{keyword}) && $input->{keyword} ne "new" && $input->{keyword} ne "unsorted")
{
$k = get_keyword($input->{keyword});
}
# Create New Keyword? FORM
if (exists($input->{keyword}) && $input->{keyword} eq "new")
{
my $t;
header("add new category");
if (exists($input->{thread}))
{
$t = get_thread($input->{thread});
}
menu();
print "
";
my %faek =
(
keyword => $input->{keyword},
thread => $input->{thread}
);
keyword_form($input->{keyword}, \%faek, $t);
footer();
}
# Edit settings for keyword
elsif ($input->{c} eq "edit" && (check_op($k) || $USER->{ulevel} == 3))
{
header(
{
title => "settings for category '$input->{keyword}'",
sticky => $input->{keyword}
} );
# 20070903 - marc - new menu args calling style
my $menu_args;
$menu_args->{keywords} = $k if $k;
menu( $menu_args );
# menu($k);
print "
";
keyword_form($k->{keyword}, $k);
print qq!
| \n);
print qq( ); print $s; print qq( ); } if ($s) { print qq($start - $pre ); print $s; print qq( ); print qq( | \n);
#############################
# PRINT MAIN PANE
print qq(\n);
# index_photostream($keyword,$tag);
# print qq(| \n);
alerts();
if ($USER == -1)
{
bPod_box();
}
else
{
welcome_box(); # if (check_key($USER->{boxes}, "welcome"));
search_box();
# radio_box() ; # if (check_key($USER->{boxes}, "radio"));
# bPod_box() if (check_key($USER->{boxes}, "bPod"));
hoot_box() if (check_key($USER->{boxes}, "hootbox"));
# svn_box();# if $USER->{'ulevel'} == 3;
# upload_form($keyword) if (check_key($USER->{boxes}, "postform"));
}
print qq( | );
###############################
print qq();
print qq( |