]>
git.p6c8.net - selfforum.git/blob - selfforum-cgi/shared/Template/Delete.pm
1 package Template
::Delete
;
3 ################################################################################
5 # File: shared/Template/Delete.pm #
7 # Authors: Christian Kruse <ckruse@wwwtech.de> #
9 # Description: 'Administrator' view of forum index for deleting msgs #
11 ################################################################################
19 use Encode
::Plain
; $Encode::Plain
::utf8
= 1;
26 use Template
::_thread
;
29 ################################################################################
37 sub VERSION
{(q
$Revision$ =~ /([\d.]+)\s*$/)[0] or '0.0'}
39 ################################################################################
43 use base
qw(Exporter);
44 @EXPORT = qw(print_forum_as_HTML);
46 ### print_forum_as_HTML () #####################################################
48 # print Forum main file to STDOUT
50 # Params: $mainfile - main xml file name
51 # $tempfile - template file name
52 # $param - hash reference (see doc for details)
56 sub print_forum_as_HTML
($$$) {
57 my ($mainfile, $tempfile, $param) = @_;
58 my $assign = $param->{assign
};
60 my $template = new Template
$tempfile;
63 my $main = new Lock
($mainfile);
65 unless ($main->lock (LH_SHARED
)) {
66 unless ($main->masterlocked) {
67 print ${$template->scrap (
69 { $assign->{errorText
} => $template->insert ($assign->{'occupied'}) }
73 print ${$template->scrap (
75 { $assign->{errorText
} => $template->insert($assign->{'notAvailable'}) }
80 my $view = get_view_params
(
81 { adminDefault
=> $param->{adminDefault
} }
84 # set process priority, remove if you don't need...
86 eval {setpriority 0,0,1};
88 $threads = get_all_threads
($main->filename, $param->{showDeleted
}, $view->{sortedMsg
});
91 print ${$template->scrap (
92 $assign->{mainDocStart
},
93 { $assign->{loadingTime
} => plain
(long_hr_time
(time)) }
98 template
=> $param->{tree
},
105 unless ($view->{sortedThreads
}) {
106 @threads = sort {$b <=> $a} keys %$threads;
109 @threads = sort {$a <=> $b} keys %$threads;
113 $tpar->{thread
} = "$_";
117 $threads->{$_}, $template, $tpar, {
118 action
=> '<a href="fo_delete.pl?m={mid}&t='.$_.'&c=d"><b>Löschen</b></a>',
119 actionDeleted
=> '<a href="fo_delete.pl?m={mid}&t='.$_.'&c=w"><b>Wiederherstellen</b></a>',
120 base_link
=> 'fo_delete.pl'
123 },"\n",'<dd> </dd>',"\n";
126 print "</dl>\n",${$template->scrap($assign->{mainDocEnd
})};}
131 # keep 'require' happy
136 ### end of Template::Forum #####################################################
patrick-canterino.de