Thread Board-rewrite: allgemeine Ideen (44 answers)
Opened by jan10001 at 2003-08-25 00:08

esskar
 2003-08-26 05:19
#39398 #39398
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
und schöner geht es vielleicht auch so

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#! /usr/bin/perl
use warnings;
use strict;

my %Actions =
(
   boardconf =>
   {
      subs =>
      [
         \&handler_boardconf,
      ],
   },
   otherconf =>
   {
      subs =>
      [
         \&handler_otherconf,
      ],
   },
);

sub handler_boardconf
{
   my (&#36r) = @_;
   my &#36action = lc(&#36r->param('action'));

   handler_handler(&#36r, &#36action, \%BoardConf::Actions, 'start');
}

sub handler_otherconf
{
   my (&#36r) = @_;
   my &#36action = lc(&#36r->param('other'));

   handler_handler(&#36r, &#36action, \%OtherConf::Actions, 'begin');
}

sub handler_handler
{
   my (&#36r, &#36action, &#36ref, &#36def) = @_;

   unless(exists &#36ref->{&#36action}->{subs})
   {
      &#36action = &#36def;
   }

   foreach my &#36sub (@{&#36ref->{&#36action}->{subs}})
   {
      unless (&#36sub->(&#36cgi))
      {
         # error in sub
         last; # errorhandling
      }
      else
      {
         # ok
      }
   }
}


sub handler
{
   my &#36r = Apache::Request->new(shift);
   &#36r->send_http_header('text/html');

   my &#36section = lc(&#36r->param('section'));
    
   handler_handler(&#36r, &#36section, \%Actions, 'boardconf');
}
\n\n

<!--EDIT|esskar|1061869240-->

View full thread Board-rewrite: allgemeine Ideen