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>Neues Dokument</h1>'; |
||
10 | if ($aktion == 'edit') echo '<h1>Dokument bearbeiten</h1>'; |
||
11 | |||
12 | if ($aktion == 'edit') |
||
13 | { |
||
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) |
||
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 | $name = (isset($row['name'])) ? $row['name'] : ''; |
||
20 | $text = (isset($row['text'])) ? $row['text'] : ''; |
||
21 | $auszuwaehlen = (isset($row['folder'])) ? $row['folder'] : ''; |
||
22 | } |
||
23 | else |
||
24 | { |
||
25 | $name = ''; |
||
26 | $text = ''; |
||
27 | $auszuwaehlen = (isset($folder)) ? $folder : 0; |
||
28 | } |
||
29 | |||
30 | echo '<form method="POST" name="mainform" action="'.$_SERVER['PHP_SELF'].'"> |
||
31 | <input type="hidden" name="seite" value="kraftsetzung"> |
||
32 | <input type="hidden" name="aktion" value="'.$aktion.'"> |
||
33 | <input type="hidden" name="modul" value="'.$modul.'">'; |
||
34 | |||
35 | if ($aktion == 'edit') |
||
36 | echo '<input type="hidden" name="id" value="'.$id.'">'; |
||
37 | |||
38 | echo '<table cellspacing="0" cellpadding="0" border="0" width="100%"> |
||
39 | <tr> |
||
40 | <td colspan="2"><b>Dokumentinformationen</b><br><br></td> |
||
41 | </tr> |
||
42 | <tr> |
||
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> |
||
45 | </tr> |
||
46 | <tr> |
||
47 | <td valign="top">In Ordner:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
48 | <td valign="top">'; |
||
49 | |||
50 | gfx_zeichneordnerbox($modul, 'ORDER BY `name`', 0, 0, $auszuwaehlen); |
||
51 | |||
52 | if (!isset($danach)) $danach = 'A'; |
||
53 | |||
54 | echo '</td> |
||
55 | </tr> |
||
56 | <tr> |
||
57 | <td colspan="2"><br><b>Dokumentinhalt</b><br><br></td> |
||
58 | </tr> |
||
59 | <tr> |
||
60 | <td valign="top">Text:<img src="design/spacer.gif" height="1" width="35" alt=""></td> |
||
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> |
||
63 | </td> |
||
64 | </tr> |
||
65 | <tr> |
||
66 | <td colspan="2"><br><b>Nach Speicherung</b><br><br></td> |
||
67 | </tr> |
||
68 | <tr> |
||
69 | <td valign="top">Aktion: </td> |
||
70 | <td><select name="danach"> |
||
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> |
||
73 | <option value="C"'; if ($danach == 'C') echo ' selected'; echo '>Neuer Eintrag im Ordner</option> |
||
74 | </select></td> |
||
75 | </tr> |
||
76 | </table><br> |
||
77 | <a href="javascript:document.mainform.submit();">'; |
||
78 | |||
79 | if ($aktion == 'new') echo 'Eintragung hinzufügen'; |
||
80 | if ($aktion == 'edit') echo 'Eintragung aktualisieren'; |
||
81 | |||
8 | daniel-mar | 82 | echo '</a> | <a href="'.$_SERVER['PHP_SELF'].'?seite=inhalt&modul='.urlencode($modul).'">Zurück</a> |
2 | daniel-mar | 83 | |
84 | </form>'; |
||
85 | |||
86 | echo $footer; |
||
87 | |||
88 | } |
||
89 | |||
3 | daniel-mar | 90 | ?> |