#!/usr/pkg/bin/perl
#$Id: editor.cgi,v 1.11.4.1 2001/02/20 12:14:54 tom Exp $
################################################################

use lib qw(../lib);

use CGI::QueryString;
use CGI::Tools;

use TDS;
use TDS::Admin::Editor;
use TDS::Admin::Authorize;

################################################################

TDS::Admin::Authorize->PrintHTTPHeader();

if (param('limit') eq 'this_year'){
    my $year = $TDS::Status->start_time->year;
    param('additional_path', $year);
}

my $ed = new TDS::Admin::Editor(type=>param('type'),
				kind=>param('kind'),
				ext=>param('ext'),
				additional_path=>param('additional_path'));


my $command = param('command');

if ($command =~ /save/i){
    $ed->Write(param('body'));
} else {
    $ed->ShowForm;
}

