Subversion Repositories DevTools

Rev

Rev 1295 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1293 dpurdie 1
###############################################################################
2
# Codestriker: Copyright (c) 2001, 2002 David Sitsky.  All rights reserved.
3
# sits@users.sourceforge.net
4
#
5
# This program is free software; you can redistribute it and modify it under
6
# the terms of the GPL.
7
 
8
# Action object for downloading the raw text of a topic.
9
 
10
package Codestriker::Action::DownloadTopic;
11
 
12
use strict;
13
 
14
use Codestriker::Http::Render;
15
use Codestriker::Model::Topic;
16
 
17
# If the input is valid, display the topic.
18
sub process($$$) {
19
    my ($type, $http_input, $http_response) = @_;
20
 
21
    # Retrieve the parameters for this action.
22
    my $query = $http_response->get_query();
23
    my $topicid = $http_input->get('topic');
24
    my $email = $http_input->get('email');
25
 
26
    my $topic = Codestriker::Model::Topic->new($topicid);
27
 
28
    # Fire the topic listener to indicate that the user has viewed the topic.
29
    Codestriker::TopicListeners::Manager::topic_viewed($email, $topic);
30
 
31
    # Dump the raw topic data as text/plain.
32
    print $query->header(-type=>'text/plain',
33
			 -content_type=>'text/plain',
34
			 -charset=>"UTF-8",
35
			 -attachment=>"topic${topicid}.txt",
36
			 -filename=>"topic${topicid}.txt",
37
			 -pragma=>"Cache",
38
			 -cache_control=>"Cache");
39
    print $topic->{document};
40
}
41
 
42
1;