Rev 4 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2 | daniel-mar | 1 | <?php |
2 | |||
3 | daniel-mar | 3 | if (!defined('IBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
2 | daniel-mar | 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 | $hcode = ''; |
||
33 | |||
8 | daniel-mar | 34 | $handle = @fopen('modules/'.wb_dir_escape($modul).'/vorlagen/'.wb_dir_escape($vorlage), 'r'); |
2 | daniel-mar | 35 | if ($handle) |
36 | { |
||
37 | while (!@feof($handle)) |
||
38 | $hcode .= @fgets($handle, 4096); |
||
39 | } |
||
40 | @fclose($handle); |
||
41 | } |
||
42 | |||
43 | echo '<script language="JavaScript" type="text/javascript"> |
||
44 | <!-- |
||
45 | |||
46 | function subm_form(act) |
||
47 | { |
||
48 | if (act == 0) |
||
49 | { |
||
50 | document.forms["mainform"].target = \'\'; |
||
51 | document.forms["mainform"].elements["seite"].value = \'kraftsetzung\'; |
||
52 | } |
||
53 | if (act == 1) |
||
54 | { |
||
55 | document.forms["mainform"].target = \'_blank\'; |
||
56 | document.forms["mainform"].elements["seite"].value = \'checksite\'; |
||
57 | } |
||
58 | document.forms.mainform.submit(); |
||
59 | } |
||
60 | |||
61 | // --> |
||
62 | </script> |
||
63 | |||
64 | <form method="POST" name="mainform" action="'.$_SERVER['PHP_SELF'].'"> |
||
65 | <input type="hidden" name="seite" value="kraftsetzung"> |
||
66 | <input type="hidden" name="aktion" value="'.$aktion.'"> |
||
67 | <input type="hidden" name="modul" value="'.$modul.'">'; |
||
68 | |||
69 | if ($aktion == 'edit') |
||
70 | echo '<input type="hidden" name="id" value="'.$id.'">'; |
||
71 | |||
72 | echo '<table cellspacing="0" cellpadding="0" border="0"> |
||
73 | <tr> |
||
74 | <td colspan="2"><b>Allgemeine Informationen</b><br><br></td> |
||
75 | </tr> |
||
76 | <tr> |
||
77 | <td valign="top">Name:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
78 | <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> |
||
79 | </tr> |
||
80 | <tr> |
||
81 | <td valign="top">In Ordner:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
82 | <td valign="top">'; |
||
83 | |||
84 | gfx_zeichneordnerbox($modul, 'ORDER BY id', 0, 0, $auszuwaehlen); |
||
85 | |||
86 | echo '</td> |
||
87 | </tr> |
||
88 | <tr> |
||
89 | <td colspan="2"><br><b>HTML-Daten</b><br><br></td> |
||
90 | </tr> |
||
91 | <tr> |
||
92 | <td valign="top">HTML-Code:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
93 | <td valign="top" width="100%"> |
||
3 | daniel-mar | 94 | <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 Personal WebBase-Modul schreiben möchten.<br><br> |
2 | daniel-mar | 95 | <textarea style="width:100%; overflow:auto;" wrap="virtual" name="hcode" rows="15" cols="50">'.$hcode.'</textarea><br><br> |
96 | Eine Vorlage kann Ihnen die Arbeit erleichtern. Wählen Sie eine Vorlage, wenn Sie dies wünschen. |
||
97 | <ul>'; |
||
98 | |||
99 | function liste_vorlagen() |
||
100 | { |
||
101 | global $modul; |
||
102 | $ary = array(); |
||
103 | $i = 0; |
||
8 | daniel-mar | 104 | $v = 'modules/'.wb_dir_escape($modul).'/vorlagen/'; |
2 | daniel-mar | 105 | $verz=opendir($v); |
106 | |||
107 | while ($file = readdir($verz)) |
||
108 | { |
||
109 | if (($file != '.') && ($file != '..') && ($file != 'index.html') && (is_file($v.$file))) |
||
110 | { |
||
111 | $i++; |
||
112 | $ary[$i] = $file; |
||
113 | } |
||
114 | } |
||
115 | |||
116 | closedir($verz); |
||
117 | sort($ary); |
||
118 | |||
119 | return $ary; |
||
120 | } |
||
121 | |||
122 | $vorlagen = liste_vorlagen(); |
||
123 | |||
124 | foreach ($vorlagen AS $m1 => $m2) |
||
125 | { |
||
126 | if (!isset($id)) $id = 0; |
||
8 | daniel-mar | 127 | echo '<li><a href="'.$_SERVER['PHP_SELF'].'?seite='.urlencode($seite).'&modul='.urlencode($modul).'&aktion='.urlencode($aktion).'&id='.urlencode($id).'&vorlage='.urlencode($m2).'">'.$m2.'</a></li>'; |
2 | daniel-mar | 128 | } |
129 | |||
130 | unset($m1); |
||
131 | unset($m2); |
||
132 | |||
133 | if (!isset($danach)) $danach = 'A'; |
||
134 | |||
135 | echo '</ul>Bitte beachten Sie, dass beim Öffnen einer Vorlage die aktuellen Änderungen überschrieben werden.<br><br> |
||
136 | <a href="javascript:subm_form(1);">Seite testen</a></td></tr></table> |
||
137 | </td> |
||
138 | </tr> |
||
139 | |||
140 | <tr> |
||
141 | <td colspan="2"><br><b>Nach Speicherung</b><br><br></td> |
||
142 | </tr> |
||
143 | <tr> |
||
144 | <td valign="top">Aktion: </td> |
||
145 | <td><select name="danach"> |
||
146 | <option value="A"'; if ($danach == 'A') echo ' selected'; echo '>Zurück zum Hauptmenü</option> |
||
147 | <option value="B"'; if ($danach == 'B') echo ' selected'; echo '>Neuer Eintrag in Kategorie</option> |
||
148 | <option value="C"'; if ($danach == 'C') echo ' selected'; echo '>Neuer Eintrag im Ordner</option> |
||
149 | </select></td> |
||
150 | </tr> |
||
151 | </table><br> |
||
152 | <a href="javascript:subm_form(0);">'; |
||
153 | |||
154 | if ($aktion == 'new') echo 'Eintragung hinzufügen'; |
||
155 | if ($aktion == 'edit') echo 'Eintragung aktualisieren'; |
||
156 | |||
8 | daniel-mar | 157 | echo '</a> | <a href="'.$_SERVER['PHP_SELF'].'?seite=inhalt&modul='.urlencode($modul).'">Zurück</a> |
2 | daniel-mar | 158 | |
159 | </form>'; |
||
160 | |||
161 | echo $footer; |
||
162 | |||
163 | } |
||
164 | |||
3 | daniel-mar | 165 | ?> |