%#-- Begin HTML --# <& '/widgets/wrappers/sharky/header.mc', title => "$disp Profile", context => "Admin | Profile | $disp | $crumb" &>
<& '/widgets/wrappers/sharky/footer.mc', param => \%ARGS &> %#-- End HTML --# %#-- Once Section --# <%once>; my $class = 'Bric::Biz::Category'; my $section = 'admin'; my $type = 'category'; my $disp = get_disp_name($type); %once> %#-- Args Section --# <%args> $id => undef %args> %#-- Init Section --# <%init>; $id ||= $ARGS{category_id} unless defined $id; # Instantiate an object. my $cat = $ARGS{obj} ? $ARGS{obj} : defined $id ? $class->lookup({ id => $id}) : $class->new; $id = $cat->get_id unless defined $id; # Make sure to set the site ID if we have it. $cat->set_site_id($ARGS{site_id}) if $ARGS{site_id}; # This will fail if for some bad reason site_id has not been set on $cat my $root_id = $cat->site_root_category_id; # Check authorization. chk_authz($cat, $id ? READ : CREATE); my $no_edit = !chk_authz($cat, ($id ? EDIT : CREATE), 1); my $no_del = ! defined $id || $no_edit || $id == $root_id; # Roll in any changes to the category object if we're just adding keywords. if (exists($ARGS{'addmore_type'}) && $ARGS{'addmore_type'} eq 'keyword') { foreach my $meth ($cat->my_meths(1)) { $meth->{set_meth}->($cat, @{$meth->{set_args}}, $ARGS{$meth->{name}}) if defined $meth->{set_meth} and exists $ARGS{$meth->{name}}; } } # Get the name for the breadcrumb trail. my $crumb = $cat->get_name; $crumb = $crumb ? ""$crumb"" : 'New'; my $cat_excl = sub { return 1 if grep($_[0] == $_->get_id, $cat->children); return 1 if defined $id and ($_[0] == $id); return 0; }; %init> <%doc> ############################################################################### =head1 NAME /admin/profile/category/dhandler - Interface for managing categories. =head1 VERSION $LastChangedRevision$ =head1 DATE $LastChangedDate: 2004-05-24 18:17:44 -0700 (Mon, 24 May 2004) $ =head1 DESCRIPTION This element handles the display for editing categories. =cut %doc>