#! /usr/bin/perl -Tw ### # Copyright (C) 2002, 2003 Rodd Clarkson # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. ### use strict; no strict "refs"; use lib "..",".","parts"; use CGI ":standard"; use DBI; use Defs; use PartsDB; use PartsPerms; use AdminPerm; use MainPage; use PartsCommon; use PartsContent; use PartsDate; use PartsWrapper; use PartsBody; use PartsImage; use ContentList; my $contentRef = \%ContentList::CONTENT_LIST; my $featuresRef = \%DefsContent::CONTENT_FEATURES; ### Load necessary modules ### my %usedModules = (); foreach ( keys %{$featuresRef} ) { if ($featuresRef->{$_}{'count'}) { if (!$usedModules{$featuresRef->{$_}{'module'}}) { eval 'use '.$featuresRef->{$_}{'module'}; $usedModules{$featuresRef->{$_}{'module'}} = 1; } } } use PartsModule; ### Connect the Database my $db = PartsDB::CONNECT_TO_DATABASE(); my $output = new CGI; my $contentID_IN = ""; $contentID_IN = $output->param('tid') or $contentID_IN = $ContentList::DEFAULT_CONTENT_ID; my $treeLevel = 0; my $treeDots = PartsCommon::GET_TREE_DOTS($treeLevel); my %document = ( treeLevel => $treeLevel, title => "$Defs::SITE_NAME_SHORT", content => [0, "Welcome"], pageInfo => ['welcome'], showFull => PartsCommon::CHECK_TEXT_ONLY($output) ); my $documentRef = \%document; our @allModules = (); my $allModRef = \@allModules; PartsBody::GET_MODULE_DATA($db, $allModRef); if ($contentID_IN) { my $contentTitle = ""; if (defined $contentRef->{$contentID_IN}{'title'}) { $contentTitle = $contentRef->{$contentID_IN}{'title'}; } $documentRef->{'content'} = [$contentID_IN, $contentTitle]; $documentRef->{'pageInfo'} = ['content']; $documentRef->{'pageareas'} = { main => "main", submain => "submain", subextra => "subextra", parents => $contentID_IN, subcount => $contentRef->{$contentID_IN}{'shortList'}[0] }; PartsBody::GENERATE_PAGE($documentRef, $contentRef, $featuresRef, $allModRef, $output, $db); } else { if ($documentRef->{'showFull'}) { $documentRef->{'body'}{'main'} .= qq[Welcome]; } } MainPage::PRINT_MAIN_WRAPPER($db, $output, $documentRef); ### Disconnect the Database; PartsDB::DISCONNECT_FROM_DATABASE($db);