Leser: 1
|< 1 2 >| | 14 Einträge, 2 Seiten |
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#!/usr/bin/perl
#
# Treeview-Script by F.Luettgens
###
use strict;
use CGI;
my $nodefile = 'nodes.js'; # Use absolute Path!
chomp((my $goto) = $ENV{"QUERY_STRING"});
#my $cgi = __FILE__ =~ m/.*$/;
my $cgi = "tree.cgi";
my $confquery = new CGI;
my @configs = $confquery->param;
my $newlink = new CGI;
my @entries = $newlink->param;
sub showconfig {
open(NODES,$nodefile);
my @scriptfile = <NODES>;
close(NODES);
print ("Treeview Konfiguration\n");
print ("<br><hr/><br><pre>\n");
print ("@scriptfile\n");
print ("</pre>\n\n");
}
sub new {
print ("<a href=\"./$cgi?newkat\">Neue Kategorie hinzufuegen</a> (Nicht fertig)<br>\n");
print ("<a href=\"./$cgi?newlink\">Neuen Link hinzufuegen</a><br><br>\n");
print ("<a href=\"javascript:history.go(-1)\">Back</a>");
}
sub newlink {
print("<form id=\"newlink\" name=\"newlink\" action=\"$cgi?savelink\" method=\"get\">\n");
print("Bezeichner: <input name=\"newlink_name\" value=\"z.B Software\" maxlength=\"36\"/><br/>\n");
print("Link: <input name=\"newlink_link\" value=\"z.B software.html\" maxlength=\"36\"/><br/>\n");
print("Position: <input name=\"newlink_posi\" value=\"1,5\" maxlength=\"3\"/> (z.B 1,5 fuer Kategorie 1, Position 5)<br/>\n");
print("Target-Frame: <input name=\"newlink_frame\" value=\"_right\" maxlength=\"36\"/><br/>\n");
print("<input type=\"submit\" value=\"Speichern\" name=\"save\"/><br/>\n");
print("</form><br><br>\n\n");
}
sub savelink {
my $newlink_name = $newlink->param('newlink_name');
my $newlink_link = $newlink->param('newlink_link');
my $newlink_posi = $newlink->param('newlink_posi');
(my $kategorie, my $sub_kategorie) = split(/\,/, $newlink_posi);
my $newlink_frame = $newlink->param('newlink_frame');
open(NEWNODE,">>.nodes.dat");
print NEWNODE ("aux$kategorie = gLnk\(\"Rh\"\, \"$newlink_frame\"\, \"$newlink_link\"\)\)");
close (NEWNODE);
rebuild();
}
sub config {
print("<form id=\"config\" name=\"config\" action=\"$cgi?saveconfig\" method=\"get\">\n");
print("<input type=\"radio\" value=\"1\" name=\"buildall\"/>\n");
print("<input type=\"radio\" value=\"0\" name=\"buildall\" checked/> Tree komplett bauen oder erst auf Abruf? (Standart: 0)<br/>\n");
print("<input type=\"radio\" value=\"1\" name=\"highlight\"/>\n");
print("<input type=\"radio\" value=\"0\" name=\"highlight\" checked/> Text hervorheben?<br/>\n");
print("<input name=\"highlight_color\" value=\"blue\" maxlength=\"8\"/> Highlight Schrift-Farbe (z.B white oder #FFFFFF)<br/>\n");
print("<input name=\"highlight_bg\" value=\"white\" maxlength=\"8\"/> Highlight Hintergrund-Farbe (z.B white oder #FFFFFF)<br/>\n");
print("<input name=\"iconpath\" value=\"icons/\" maxlength=\"36\"/> Pfad zum Icons Verzeichniss<br/>\n");
print("<input type=\"radio\" value=\"1\" name=\"preservestate\" checked/>\n");
print("<input type=\"radio\" value=\"0\" name=\"preservestate\"/> Speichern des Trees per Cookie?<br/>\n");
print("<input type=\"radio\" value=\"1\" name=\"startallopen\"/>\n");
print("<input type=\"radio\" value=\"0\" name=\"startallopen\" checked/> Alle Nodes ausgeklappt starten?<br/>\n");
print("<input type=\"radio\" value=\"1\" name=\"useframes\"/>\n");
print("<input type=\"radio\" value=\"0\" name=\"useframes\" checked/> Frames nutzen?<br/>\n");
print("<input type=\"radio\" value=\"1\" name=\"useicons\" checked/>\n");
print("<input type=\"radio\" value=\"0\" name=\"useicons\"/> Icons nutzen?<br/>\n");
print("<input type=\"radio\" value=\"1\" name=\"usetextlinks\" checked/>\n");
print("<input type=\"radio\" value=\"0\" name=\"usetextlinks\"/> Text links nutzen? <br/>\n");
print("<input type=\"radio\" value=\"1\" name=\"wraptext\"/>\n");
print("<input type=\"radio\" value=\"0\" name=\"wraptext\" checked/> Zeilenumbruch?<br/>\n");
print("<input name=\"comment\" value=\"Kommentar\" maxlength=\"32\"/> Kommentar<br/>\n");
print("<input type=\"submit\" value=\"Speichern\" name=\"save\"/><br/>\n");
print("</form><br><br>\n\n");
}
sub saveconfig {
my $use_buildall = $confquery->param('buildall');
my $use_highlight = $confquery->param('highlight');
my $highlightcolor = $confquery->param('highlight_color');
my $highlight_bg = $confquery->param('highlight_bg');
my $iconpath = $confquery->param('iconpath');
my $use_preserved = $confquery->param('preservedstate');
my $use_startallopen = $confquery->param('startallopen');
my $use_frames = $confquery->param('useframes');
my $use_icons = $confquery->param('useicons');
my $use_textlinks = $confquery->param('usetextlinks');
my $use_wraptext = $confquery->param('wraptext');
my $comment = $confquery->param('comment');
open(CONFIG_HEAD,">.config.dat");
if ($use_buildall eq '0') {
print CONFIG_HEAD ("BUILDALL = 0\n")
} elsif ($use_buildall eq '1') {
print CONFIG_HEAD ("BUILDALL = 1\n")
}
if ($use_highlight eq '0') {
print CONFIG_HEAD ("HIGHLIGHT = 0\n")
} elsif ($use_highlight eq '1') {
print CONFIG_HEAD ("HIGHLIGHT = 1\n")
}
if ($use_preserved eq '0') {
print CONFIG_HEAD ("PRESERVESTATE = 0\n")
} elsif ($use_preserved eq '1') {
print CONFIG_HEAD ("PRESERVESTATE = 1\n")
}
if ($use_startallopen eq '0') {
print CONFIG_HEAD ("STARTALLOPEN = 0\n")
} elsif ($use_startallopen eq '1') {
print CONFIG_HEAD ("STARTALLOPEN = 1\n")
}
if ($use_frames eq '0') {
print CONFIG_HEAD ("USEFRAMES = 0\n")
} elsif ($use_frames eq '1') {
print CONFIG_HEAD ("USEFRAMES = 1\n")
}
if ($use_icons eq '0') {
print CONFIG_HEAD ("USEICONS = 0\n")
} elsif ($use_icons eq '1') {
print CONFIG_HEAD ("USEICONS = 1\n")
}
if ($use_textlinks eq '0') {
print CONFIG_HEAD ("USETEXTLINKS = 0\n")
} elsif ($use_textlinks eq '1') {
print CONFIG_HEAD ("USETEXTLINKS = 1\n")
}
if ($use_wraptext eq '0') {
print CONFIG_HEAD ("WRAPTEXT = 0\n")
} elsif ($use_wraptext eq '1') {
print CONFIG_HEAD ("WRAPTEXT = 1\n")
}
print CONFIG_HEAD ("HIGHLIGHT_COLOR = $highlightcolor\n");
print CONFIG_HEAD ("HIGHLIGHT_BG = $highlight_bg\n");
print CONFIG_HEAD ("ICONPATH = $iconpath\n");
print CONFIG_HEAD ("\# $comment\n");
close(CONFIG_HEAD);
rebuild();
}
sub rebuild {
open(CONFIG_HEAD,".config.dat");
my @header = <CONFIG_HEAD>;
close(CONFIG_HEAD);
open(NEWNODES,".nodes.dat");
my @entries = <NEWNODES>;
close(NEWNODES);
open(FINAL_CONFIG,">$nodefile");
print FINAL_CONFIG @header;
print FINAL_CONFIG @entries;
close (FINAL_CONFIG);
}
print ("Content-Type: text/html\n\n");
print ("<HTML>\n");
print ("<HEAD>\n");
print ("<TITLE>Treeview Builder Script</TITLE>\n");
print ("<meta name=\"AUTHOR\" content=\"SWD\">\n");
print ("</HEAD>\n");
print ("<BODY>\n");
print ("<!-- Script by F.Luettgens for SWD-Ag 2007 -->\n");
print ("<BR><BR>\n");
if (($goto) eq 'show') {
showconfig();
print ("<a href=\"javascript:history.go(-1)\">Back</a>");
} elsif (($goto) eq 'newlink') {
newlink();
print ("<a href=\"javascript:history.go(-1)\">Back</a>");
} elsif (($goto) eq 'config') {
config();
print ("<a href=\"javascript:history.go(-1)\">Back</a>");
} elsif (($goto) eq 'saveconfig') {
saveconfig();
print ("<a href=\"javascript:history.go(-1)\">Back</a>");
} elsif (($goto) eq 'safelink') {
safelink();
print ("<a href=\"javascript:history.go(-1)\">Back</a>");
} elsif (($goto) eq 'new') {
new();
} else {
print ("<a href=\"./$cgi?show\">Config anzeigen</a>");
print ("<BR>\n");
print ("<a href=\"./$cgi?config\">Treeview anpassen</a>");
print ("<BR>\n");
print ("<a href=\"./$cgi?new\">Einen neuen Eintrag hinzufuegen</a>");
print ("<BR>\n");
}
print ("</BODY>\n");
print ("</HTML>\n");
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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
#!/usr/bin/perl # # Treeview-Script by F.Luettgens ### use strict; use CGI; use HTML::Template; my $nodefile = 'nodes.js';   ; # Use absolute Path! my $goto = $ENV{PATH_INFO}; my $cgi = "/cgi-bin/tree.cgi"; my $confquery = CGI->new; my @configs = $confquery->param; my %params = $confquery->Vars; $goto =~ s!^/!!; print $confquery->header; my %map = ( show => \&showconfig, newlink => \&newlink, config => \&config, saveconfig => \&saveconfig, safelink => \&safelink, new => \&new, ); if( exists $map{$goto} ){ $map{$goto}->(); } else{ my $tmpl = HTML::Template->new( filename => 'default.tmpl' ); $tmpl->param( SCRIPT => $cgi ); print $tmpl->output; } sub showconfig { open(NODES,$nodefile); my @scriptfile = <NODES>; close(NODES); my $tmpl = HTML::Template->new( filename => 'showconfig.tmpl' ); $tmpl->param( PRE => join(" ",@scriptfile) ); print $tmpl->output; } sub new { my $tmpl = HTML::Template->new( filename => 'new.tmpl' ); $tmpl->param( SCRIPT => $cgi ); print $tmpl->output; } sub newlink { my $tmpl = HTML::Template->new( filename => 'newlink.tmpl' ); $tmpl->param( SCRIPT => $cgi ); print $tmpl->output; } sub savelink { my $newlink_name = $params{'newlink_name'}; my $newlink_link = $params{'newlink_link'}; my $newlink_posi = $params{'newlink_posi'}; my ($kategorie, $sub_kategorie) = split(/\,/, $newlink_posi); my $newlink_frame = $params{'newlink_frame'}; open(NEWNODE,">>.nodes.dat") or die $!; print NEWNODE qq~aux$kategorie = gLnk("Rh", "$newlink_frame", "$newlink_link"))~; close (NEWNODE); rebuild(); } sub config { my $tmpl = HTML::Template->new( filename => 'config.tmpl' ); $tmpl->param( SCRIPT => $cgi ); print $tmpl->output; } sub saveconfig { my $use_buildall = $confquery->param('buildall'); my $use_highlight = $confquery->param('highlight'); my $highlightcolor = $confquery->param('highlight_color'); my $highlight_bg = $confquery->param('highlight_bg'); my $iconpath = $confquery->param('iconpath'); my $use_preserved = $confquery->param('preservedstate'); my $use_startallopen = $confquery->param('startallopen'); my $use_frames = $confquery->param('useframes'); my $use_icons = $confquery->param('useicons'); my $use_textlinks = $confquery->param('usetextlinks'); my $use_wraptext = $confquery->param('wraptext'); my $comment = $confquery->param('comment'); open(CONFIG_HEAD,">.config.dat"); if ($use_buildall eq '0') { print CONFIG_HEAD ("BUILDALL = 0\n") } elsif ($use_buildall eq '1') { print CONFIG_HEAD ("BUILDALL = 1\n") } if ($use_highlight eq '0') { print CONFIG_HEAD ("HIGHLIGHT = 0\n") } elsif ($use_highlight eq '1') { print CONFIG_HEAD ("HIGHLIGHT = 1\n") } if ($use_preserved eq '0') { print CONFIG_HEAD ("PRESERVESTATE = 0\n") } elsif ($use_preserved eq '1') { print CONFIG_HEAD ("PRESERVESTATE = 1\n") } if ($use_startallopen eq '0') { print CONFIG_HEAD ("STARTALLOPEN = 0\n") } elsif ($use_startallopen eq '1') { print CONFIG_HEAD ("STARTALLOPEN = 1\n") } if ($use_frames eq '0') { print CONFIG_HEAD ("USEFRAMES = 0\n") } elsif ($use_frames eq '1') { print CONFIG_HEAD ("USEFRAMES = 1\n") } if ($use_icons eq '0') { print CONFIG_HEAD ("USEICONS = 0\n") } elsif ($use_icons eq '1') { print CONFIG_HEAD ("USEICONS = 1\n") } if ($use_textlinks eq '0') { print CONFIG_HEAD ("USETEXTLINKS = 0\n") } elsif ($use_textlinks eq '1') { print CONFIG_HEAD ("USETEXTLINKS = 1\n") } if ($use_wraptext eq '0') { print CONFIG_HEAD ("WRAPTEXT = 0\n") } elsif ($use_wraptext eq '1') { print CONFIG_HEAD ("WRAPTEXT = 1\n") } print CONFIG_HEAD ("HIGHLIGHT_COLOR = $highlightcolor\n"); print CONFIG_HEAD ("HIGHLIGHT_BG = $highlight_bg\n"); print CONFIG_HEAD ("ICONPATH = $iconpath\n"); print CONFIG_HEAD ("\# $comment\n"); close(CONFIG_HEAD); rebuild(); } sub rebuild { open(CONFIG_HEAD,".config.dat"); my @header = <CONFIG_HEAD>; close(CONFIG_HEAD); open(NEWNODES,".nodes.dat"); my @entries = <NEWNODES>; close(NEWNODES); open(FINAL_CONFIG,">$nodefile"); print FINAL_CONFIG @header; print FINAL_CONFIG @entries; close (FINAL_CONFIG); }
'safelink => \&safelink,' =~ tr/f/v/
1
2
3
4
5
6
7
8
my %map = (
show => \&showconfig,
newlink => \&newlink,
config => \&config,
saveconfig => \&saveconfig,
'safelink => \&safelink,' =~ tr/f/v/
new => \&new,
);
|< 1 2 >| | 14 Einträge, 2 Seiten |