package LSweb::Application::LSone; use strict; use warnings; use base qw(LSweb::Base); use Apache::Reload; use CGI; use LSweb::Database::Page_Intro; use LSweb::Database::Page_Content; use LSweb::Database::LSone; sub setup { my $self = shift; $self->start_mode('lsone'); $self->run_modes([qw/lsone/]);} sub _submenu { return LSRfm::Database::SubMenus->search(menu => "lsone", { order_by=>'position ASC'});} sub lsone { my $self = shift; my $html_template = $self->param('main_template'); my @lsone = LSweb::Database::LSone->retrieve_all; my @pageintro = LSweb::Database::Page_Intro->search(page => "lsone"); my @pagecontent = LSweb::Database::Page_Content->search(page => "lsone", { order_by=>'contentorder ASC'}); my $output; $html_template->process('template', {wrapper => $self->wrapper(), submenu => \&_submenu, submenuon => "lsone", pageintro => \@pageintro, pagecontent => \@pagecontent, boxtype => "half", box => "right", lsone => \@lsone, }, \$output) || die $html_template->error; return $output; } sub article { my $self = shift; my $html_template = $self->param('main_template'); my $cgi = CGI->new; my $id = $cgi->param('article'); my @lsone = LSweb::Database::LSone->search(id => $id); my @pageintro = LSweb::Database::Page_Intro->search(page => "lsone"); my @pagecontent = LSweb::Database::Page_Content->search(page => "lsone", { order_by=>'contentorder ASC'}); my $output; $html_template->process('template', {wrapper => $self->wrapper(), submenu => \&_submenu, submenuon => "lsone", pageintro => \@pageintro, pagecontent => \@pagecontent, boxtype => "half", lsone => \@lsone, }, \$output) || die $html_template->error; return $output; } 1;