Rev 4 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4 | Rev 8 | ||
---|---|---|---|
1 | <?php |
1 | <?php |
2 | 2 | ||
3 | if (!defined('IBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
3 | if (!defined('IBLEGAL')) die('Kann nicht ohne Personal WebBase ausgeführt werden.'); |
4 | 4 | ||
5 | if (($aktion == 'new') || ($aktion == 'edit')) |
5 | if (($aktion == 'new') || ($aktion == 'edit')) |
6 | { |
6 | { |
7 | echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'name\').focus();"', $header); |
7 | echo str_replace('<body', '<body onload="self.focus();document.getElementById(\'name\').focus();"', $header); |
8 | 8 | ||
9 | if ($aktion == 'new') echo '<h1>Neues Dokument</h1>'; |
9 | if ($aktion == 'new') echo '<h1>Neues Dokument</h1>'; |
10 | if ($aktion == 'edit') echo '<h1>Dokument bearbeiten</h1>'; |
10 | if ($aktion == 'edit') echo '<h1>Dokument bearbeiten</h1>'; |
11 | 11 | ||
12 | if ($aktion == 'edit') |
12 | if ($aktion == 'edit') |
13 | { |
13 | { |
14 | $res = db_query("SELECT `name`, `folder`, `text` FROM `".$mysql_zugangsdaten['praefix']."dokumente` WHERE `id` = '".db_escape($id)."' AND `user` = '".$benutzer['id']."'"); |
14 | $res = db_query("SELECT `name`, `folder`, `text` FROM `".$mysql_zugangsdaten['praefix']."dokumente` WHERE `id` = '".db_escape($id)."' AND `user` = '".$benutzer['id']."'"); |
15 | if (db_num($res) == 0) |
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); |
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); |
17 | $row = db_fetch($res); |
18 | 18 | ||
19 | $name = (isset($row['name'])) ? $row['name'] : ''; |
19 | $name = (isset($row['name'])) ? $row['name'] : ''; |
20 | $text = (isset($row['text'])) ? $row['text'] : ''; |
20 | $text = (isset($row['text'])) ? $row['text'] : ''; |
21 | $auszuwaehlen = (isset($row['folder'])) ? $row['folder'] : ''; |
21 | $auszuwaehlen = (isset($row['folder'])) ? $row['folder'] : ''; |
22 | } |
22 | } |
23 | else |
23 | else |
24 | { |
24 | { |
25 | $name = ''; |
25 | $name = ''; |
26 | $text = ''; |
26 | $text = ''; |
27 | $auszuwaehlen = (isset($folder)) ? $folder : 0; |
27 | $auszuwaehlen = (isset($folder)) ? $folder : 0; |
28 | } |
28 | } |
29 | 29 | ||
30 | echo '<form method="POST" name="mainform" action="'.$_SERVER['PHP_SELF'].'"> |
30 | echo '<form method="POST" name="mainform" action="'.$_SERVER['PHP_SELF'].'"> |
31 | <input type="hidden" name="seite" value="kraftsetzung"> |
31 | <input type="hidden" name="seite" value="kraftsetzung"> |
32 | <input type="hidden" name="aktion" value="'.$aktion.'"> |
32 | <input type="hidden" name="aktion" value="'.$aktion.'"> |
33 | <input type="hidden" name="modul" value="'.$modul.'">'; |
33 | <input type="hidden" name="modul" value="'.$modul.'">'; |
34 | 34 | ||
35 | if ($aktion == 'edit') |
35 | if ($aktion == 'edit') |
36 | echo '<input type="hidden" name="id" value="'.$id.'">'; |
36 | echo '<input type="hidden" name="id" value="'.$id.'">'; |
37 | 37 | ||
38 | echo '<table cellspacing="0" cellpadding="0" border="0" width="100%"> |
38 | echo '<table cellspacing="0" cellpadding="0" border="0" width="100%"> |
39 | <tr> |
39 | <tr> |
40 | <td colspan="2"><b>Dokumentinformationen</b><br><br></td> |
40 | <td colspan="2"><b>Dokumentinformationen</b><br><br></td> |
41 | </tr> |
41 | </tr> |
42 | <tr> |
42 | <tr> |
43 | <td valign="top">Name:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
43 | <td valign="top">Name:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
44 | <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> |
44 | <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> |
45 | </tr> |
45 | </tr> |
46 | <tr> |
46 | <tr> |
47 | <td valign="top">In Ordner:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
47 | <td valign="top">In Ordner:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
48 | <td valign="top">'; |
48 | <td valign="top">'; |
49 | 49 | ||
50 | gfx_zeichneordnerbox($modul, 'ORDER BY `name`', 0, 0, $auszuwaehlen); |
50 | gfx_zeichneordnerbox($modul, 'ORDER BY `name`', 0, 0, $auszuwaehlen); |
51 | 51 | ||
52 | if (!isset($danach)) $danach = 'A'; |
52 | if (!isset($danach)) $danach = 'A'; |
53 | 53 | ||
54 | echo '</td> |
54 | echo '</td> |
55 | </tr> |
55 | </tr> |
56 | <tr> |
56 | <tr> |
57 | <td colspan="2"><br><b>Dokumentinhalt</b><br><br></td> |
57 | <td colspan="2"><br><b>Dokumentinhalt</b><br><br></td> |
58 | </tr> |
58 | </tr> |
59 | <tr> |
59 | <tr> |
60 | <td valign="top">Text:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
60 | <td valign="top">Text:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
61 | <td valign="top"> |
61 | <td valign="top"> |
62 | <table width="100%"><tr><td rowspan="8" style="vertical-align:top;width:100%"><textarea style="width:100%; overflow:auto;" wrap="virtual" name="text" rows="15" cols="50">'.$text.'</textarea></td></tr></table> |
62 | <table width="100%"><tr><td rowspan="8" style="vertical-align:top;width:100%"><textarea style="width:100%; overflow:auto;" wrap="virtual" name="text" rows="15" cols="50">'.$text.'</textarea></td></tr></table> |
63 | </td> |
63 | </td> |
64 | </tr> |
64 | </tr> |
65 | <tr> |
65 | <tr> |
66 | <td colspan="2"><br><b>Nach Speicherung</b><br><br></td> |
66 | <td colspan="2"><br><b>Nach Speicherung</b><br><br></td> |
67 | </tr> |
67 | </tr> |
68 | <tr> |
68 | <tr> |
69 | <td valign="top">Aktion: </td> |
69 | <td valign="top">Aktion: </td> |
70 | <td><select name="danach"> |
70 | <td><select name="danach"> |
71 | <option value="A"'; if ($danach == 'A') echo ' selected'; echo '>Zurück zum Hauptmenü</option> |
71 | <option value="A"'; if ($danach == 'A') echo ' selected'; echo '>Zurück zum Hauptmenü</option> |
72 | <option value="B"'; if ($danach == 'B') echo ' selected'; echo '>Neuer Eintrag in Kategorie</option> |
72 | <option value="B"'; if ($danach == 'B') echo ' selected'; echo '>Neuer Eintrag in Kategorie</option> |
73 | <option value="C"'; if ($danach == 'C') echo ' selected'; echo '>Neuer Eintrag im Ordner</option> |
73 | <option value="C"'; if ($danach == 'C') echo ' selected'; echo '>Neuer Eintrag im Ordner</option> |
74 | </select></td> |
74 | </select></td> |
75 | </tr> |
75 | </tr> |
76 | </table><br> |
76 | </table><br> |
77 | <a href="javascript:document.mainform.submit();">'; |
77 | <a href="javascript:document.mainform.submit();">'; |
78 | 78 | ||
79 | if ($aktion == 'new') echo 'Eintragung hinzufügen'; |
79 | if ($aktion == 'new') echo 'Eintragung hinzufügen'; |
80 | if ($aktion == 'edit') echo 'Eintragung aktualisieren'; |
80 | if ($aktion == 'edit') echo 'Eintragung aktualisieren'; |
81 | 81 | ||
82 | echo '</a> | <a href="'.$_SERVER['PHP_SELF'].'?seite=inhalt&modul='.$modul.'">Zurück</a> |
82 | echo '</a> | <a href="'.$_SERVER['PHP_SELF'].'?seite=inhalt&modul='.urlencode($modul).'">Zurück</a> |
83 | 83 | ||
84 | </form>'; |
84 | </form>'; |
85 | 85 | ||
86 | echo $footer; |
86 | echo $footer; |
87 | 87 | ||
88 | } |
88 | } |
89 | 89 | ||
90 | ?> |
90 | ?> |
91 | 91 |