Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | daniel-mar | 1 | <?php |
2 | |||
3 | if (!defined('IBLEGAL')) die('Kann nicht ohne IronBASE ausgeführt werden.'); |
||
4 | |||
5 | if (($aktion == 'new') || ($aktion == 'edit')) |
||
6 | { |
||
7 | echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'name\').focus();"', $header); |
||
8 | |||
9 | if ($aktion == 'new') echo '<h1>Neue HTML-Seite</h1>'; |
||
10 | if ($aktion == 'edit') echo '<h1>HTML-Seite bearbeiten</h1>'; |
||
11 | |||
12 | if ($aktion == 'edit') |
||
13 | { |
||
14 | $res = db_query("SELECT * FROM `".$mysql_zugangsdaten['praefix']."html` WHERE `id` = '".db_escape($id)."' AND `user` = '".$benutzer['id']."'"); |
||
15 | if (db_num($res) == 0) |
||
16 | die($header.'Auf diesen Datensatz kann nicht zugegriffen werden. Entweder ist er nicht mehr verfügbar, oder die Zugriffsberechtigungen sind falsch.'.$footer); |
||
17 | $row = db_fetch($res); |
||
18 | |||
19 | $auszuwaehlen = (isset($row['folder'])) ? $row['folder'] : ''; |
||
20 | $name = (isset($row['name'])) ? $row['name'] : ''; |
||
21 | $hcode = (isset($row['hcode'])) ? $row['hcode'] : ''; |
||
22 | } |
||
23 | else |
||
24 | { |
||
25 | $auszuwaehlen = (isset($folder)) ? $folder : 0; |
||
26 | $name = ''; |
||
27 | $hcode = ''; |
||
28 | } |
||
29 | |||
30 | if (isset($vorlage) && ($vorlage != '')) |
||
31 | { |
||
32 | // Achtung! Ein Hacker könnte durch ../ die MySQL-Zugangsdaten statt einer Vorlage auslesen! |
||
33 | if (strpos($vorlage, '..')) |
||
34 | die($header.'<b>Fehler</b><br><br>Es ist eine Schutzverletzung aufgetreten!'.$footer); |
||
35 | |||
36 | $hcode = ''; |
||
37 | |||
38 | $handle = @fopen('modules/'.$modul.'/vorlagen/'.$vorlage, 'r'); |
||
39 | if ($handle) |
||
40 | { |
||
41 | while (!@feof($handle)) |
||
42 | $hcode .= @fgets($handle, 4096); |
||
43 | } |
||
44 | @fclose($handle); |
||
45 | } |
||
46 | |||
47 | echo '<script language="JavaScript" type="text/javascript"> |
||
48 | <!-- |
||
49 | |||
50 | function subm_form(act) |
||
51 | { |
||
52 | if (act == 0) |
||
53 | { |
||
54 | document.forms["mainform"].target = \'\'; |
||
55 | document.forms["mainform"].elements["seite"].value = \'kraftsetzung\'; |
||
56 | } |
||
57 | if (act == 1) |
||
58 | { |
||
59 | document.forms["mainform"].target = \'_blank\'; |
||
60 | document.forms["mainform"].elements["seite"].value = \'checksite\'; |
||
61 | } |
||
62 | document.forms.mainform.submit(); |
||
63 | } |
||
64 | |||
65 | // --> |
||
66 | </script> |
||
67 | |||
68 | <form method="POST" name="mainform" action="'.$_SERVER['PHP_SELF'].'"> |
||
69 | <input type="hidden" name="seite" value="kraftsetzung"> |
||
70 | <input type="hidden" name="aktion" value="'.$aktion.'"> |
||
71 | <input type="hidden" name="modul" value="'.$modul.'">'; |
||
72 | |||
73 | if ($aktion == 'edit') |
||
74 | echo '<input type="hidden" name="id" value="'.$id.'">'; |
||
75 | |||
76 | echo '<table cellspacing="0" cellpadding="0" border="0"> |
||
77 | <tr> |
||
78 | <td colspan="2"><b>Allgemeine Informationen</b><br><br></td> |
||
79 | </tr> |
||
80 | <tr> |
||
81 | <td valign="top">Name:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
82 | <td valign="top"><input type="text" class="normal" onmouseover="this.className=\'highlight\';" onmouseout="this.className=\'normal\';" name="name" id="name" value="'.$name.'" size="50"></td> |
||
83 | </tr> |
||
84 | <tr> |
||
85 | <td valign="top">In Ordner:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
86 | <td valign="top">'; |
||
87 | |||
88 | gfx_zeichneordnerbox($modul, 'ORDER BY id', 0, 0, $auszuwaehlen); |
||
89 | |||
90 | echo '</td> |
||
91 | </tr> |
||
92 | <tr> |
||
93 | <td colspan="2"><br><b>HTML-Daten</b><br><br></td> |
||
94 | </tr> |
||
95 | <tr> |
||
96 | <td valign="top">HTML-Code:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
97 | <td valign="top" width="100%"> |
||
98 | <table width="100%"><tr><td rowspan="8" style="vertical-align:top;width:100%">Verwenden Sie eine vordefinierte HTML-Seite wenn Sie z.B. ein automatisches Login-Formular erstellen, jedoch kein IronBASE-Modul schreiben möchten.<br><br> |
||
99 | <textarea style="width:100%; overflow:auto;" wrap="virtual" name="hcode" rows="15" cols="50">'.$hcode.'</textarea><br><br> |
||
100 | Eine Vorlage kann Ihnen die Arbeit erleichtern. Wählen Sie eine Vorlage, wenn Sie dies wünschen. |
||
101 | <ul>'; |
||
102 | |||
103 | function liste_vorlagen() |
||
104 | { |
||
105 | global $modul; |
||
106 | $ary = array(); |
||
107 | $i = 0; |
||
108 | $v = 'modules/'.$modul.'/vorlagen/'; |
||
109 | $verz=opendir($v); |
||
110 | |||
111 | while ($file = readdir($verz)) |
||
112 | { |
||
113 | if (($file != '.') && ($file != '..') && ($file != 'index.html') && (is_file($v.$file))) |
||
114 | { |
||
115 | $i++; |
||
116 | $ary[$i] = $file; |
||
117 | } |
||
118 | } |
||
119 | |||
120 | closedir($verz); |
||
121 | sort($ary); |
||
122 | |||
123 | return $ary; |
||
124 | } |
||
125 | |||
126 | $vorlagen = liste_vorlagen(); |
||
127 | |||
128 | foreach ($vorlagen AS $m1 => $m2) |
||
129 | { |
||
130 | if (!isset($id)) $id = 0; |
||
131 | echo '<li><a href="'.$_SERVER['PHP_SELF'].'?seite='.$seite.'&modul='.$modul.'&aktion='.$aktion.'&id='.$id.'&vorlage='.$m2.'">'.$m2.'</a></li>'; |
||
132 | } |
||
133 | |||
134 | unset($m1); |
||
135 | unset($m2); |
||
136 | |||
137 | if (!isset($danach)) $danach = 'A'; |
||
138 | |||
139 | echo '</ul>Bitte beachten Sie, dass beim Öffnen einer Vorlage die aktuellen Änderungen überschrieben werden.<br><br> |
||
140 | <a href="javascript:subm_form(1);">Seite testen</a></td></tr></table> |
||
141 | </td> |
||
142 | </tr> |
||
143 | |||
144 | <tr> |
||
145 | <td colspan="2"><br><b>Nach Speicherung</b><br><br></td> |
||
146 | </tr> |
||
147 | <tr> |
||
148 | <td valign="top">Aktion: </td> |
||
149 | <td><select name="danach"> |
||
150 | <option value="A"'; if ($danach == 'A') echo ' selected'; echo '>Zurück zum Hauptmenü</option> |
||
151 | <option value="B"'; if ($danach == 'B') echo ' selected'; echo '>Neuer Eintrag in Kategorie</option> |
||
152 | <option value="C"'; if ($danach == 'C') echo ' selected'; echo '>Neuer Eintrag im Ordner</option> |
||
153 | </select></td> |
||
154 | </tr> |
||
155 | </table><br> |
||
156 | <a href="javascript:subm_form(0);">'; |
||
157 | |||
158 | if ($aktion == 'new') echo 'Eintragung hinzufügen'; |
||
159 | if ($aktion == 'edit') echo 'Eintragung aktualisieren'; |
||
160 | |||
161 | echo '</a> | <a href="'.$_SERVER['PHP_SELF'].'?seite=inhalt&modul='.$modul.'">Zurück</a> |
||
162 | |||
163 | </form>'; |
||
164 | |||
165 | echo $footer; |
||
166 | |||
167 | } |
||
168 | |||
169 | ?> |