| 1 | <? |
|---|
| 2 | if ($pristup AND ($access_login_menu_options[$menu_options]) OR ($row_groups_login[id] == 1)) { |
|---|
| 3 | $skins = array("kama", "office2003", "v2"); |
|---|
| 4 | $skin = $skins[0]; |
|---|
| 5 | |
|---|
| 6 | $key = "Upravit"; |
|---|
| 7 | $tran_upravit = text_by_lang($pg_link, $key, $lang); |
|---|
| 8 | |
|---|
| 9 | if ($zpravy_o_cinnosti == "Odeslat") { |
|---|
| 10 | $text = strtr($editorcontents, $trans_windows_1250_to_iso_8859_2); |
|---|
| 11 | |
|---|
| 12 | if ($odbor_zpravy_o_cinnosti_id == 0) { |
|---|
| 13 | $query = "INSERT INTO odbor_zpravy_o_cinnosti (typ, text_$lang) VALUES ('$odbor_typ', '$text')"; |
|---|
| 14 | //print $query.NL; |
|---|
| 15 | pg_query($pg_link, $query); |
|---|
| 16 | } else { |
|---|
| 17 | $query = "UPDATE odbor_zpravy_o_cinnosti SET text_$lang='$text' WHERE id='$odbor_zpravy_o_cinnosti_id'"; |
|---|
| 18 | pg_query($pg_link, $query); |
|---|
| 19 | } |
|---|
| 20 | } |
|---|
| 21 | |
|---|
| 22 | $query = "SELECT * FROM odbor_zpravy_o_cinnosti WHERE typ='$odbor_typ'"; |
|---|
| 23 | //print $query.NL; |
|---|
| 24 | $result = pg_query($pg_link, $query); |
|---|
| 25 | $rows = pg_num_rows($result); |
|---|
| 26 | if ($rows == 0) { |
|---|
| 27 | $odbor_zpravy_o_cinnosti_id = 0; |
|---|
| 28 | |
|---|
| 29 | $editorcontents = ""; |
|---|
| 30 | } else { |
|---|
| 31 | $row = pg_fetch_array($result); |
|---|
| 32 | |
|---|
| 33 | $odbor_zpravy_o_cinnosti_id = $row[id]; |
|---|
| 34 | |
|---|
| 35 | $editorcontents_lang = "text_".$lang; |
|---|
| 36 | $editorcontents = $row[$editorcontents_lang]; |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | print "<table width=100%>\n"; |
|---|
| 40 | print " <tr>\n"; |
|---|
| 41 | print " <td width=100%></td>\n"; |
|---|
| 42 | print " <td><button onClick='document.zpravy_o_cinnosti_modify.submit()' title='$tran_upravit' style='cursor:pointer;cursor:hand'><img src='obr/record_modify.gif' class='button'></button></td>\n"; |
|---|
| 43 | print " </tr>\n"; |
|---|
| 44 | print "</table>\n"; |
|---|
| 45 | |
|---|
| 46 | print "<form method='post' name='zpravy_o_cinnosti_modify'>\n"; |
|---|
| 47 | print "<input type='hidden' name='lang' value='$lang'>\n"; |
|---|
| 48 | print "<input type='hidden' name='menu_id' value='$menu_id'>\n"; |
|---|
| 49 | print "<input type='hidden' name='page' value='$page'>\n"; |
|---|
| 50 | print "<input type='hidden' name='odbor_zpravy_o_cinnosti_id' value='$odbor_zpravy_o_cinnosti_id'>\n"; |
|---|
| 51 | print "<input type='hidden' name='zpravy_o_cinnosti' value='modify'>\n"; |
|---|
| 52 | print "</form>\n"; |
|---|
| 53 | |
|---|
| 54 | if ($zpravy_o_cinnosti == "modify") { |
|---|
| 55 | print "<table border=0>\n"; |
|---|
| 56 | print " <form method='post'>\n"; |
|---|
| 57 | print " <input type='hidden' name='lang' value='$lang'>\n"; |
|---|
| 58 | print " <input type='hidden' name='menu_id' value='$menu_id'>\n"; |
|---|
| 59 | print " <input type='hidden' name='page' value='$page'>\n"; |
|---|
| 60 | print " <input type='hidden' name='odbor_zpravy_o_cinnosti_id' value='$odbor_zpravy_o_cinnosti_id'>\n"; |
|---|
| 61 | print " <input type='hidden' name='zpravy_o_cinnosti' value='Odeslat'>\n"; |
|---|
| 62 | print " <tr>\n"; |
|---|
| 63 | print " <td><textarea id='editorcontents' name='editorcontents'>$editorcontents</textarea></td>\n"; |
|---|
| 64 | print " </tr>\n"; |
|---|
| 65 | print " </form>\n"; |
|---|
| 66 | print "</table>\n"; |
|---|
| 67 | |
|---|
| 68 | session_start(); |
|---|
| 69 | $_SESSION['IsAuthorized'] = true; |
|---|
| 70 | |
|---|
| 71 | print "<script type='text/javascript'>\n"; |
|---|
| 72 | print " var editor;\n"; |
|---|
| 73 | print " function createEditor() {\n"; |
|---|
| 74 | print " editor = CKEDITOR.replace('editorcontents',\n"; |
|---|
| 75 | print " { \n"; |
|---|
| 76 | print " skin : '$skin',\n"; |
|---|
| 77 | print " height : 600,\n"; |
|---|
| 78 | print " language : '$lang',\n"; |
|---|
| 79 | print " filebrowserBrowseUrl : '/ckfinder/ckfinder.html?currentFolder=/$odbor_typ/',\n"; |
|---|
| 80 | print " filebrowserImageBrowseUrl : '/ckfinder/ckfinder.html?type=Images¤tFolder=/$odbor_typ/',\n"; |
|---|
| 81 | print " filebrowserFlashBrowseUrl : '/ckfinder/ckfinder.html?type=Flash¤tFolder=/$odbor_typ/',\n"; |
|---|
| 82 | print " filebrowserUploadUrl : '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files¤tFolder=/$odbor_typ/',\n"; |
|---|
| 83 | print " filebrowserImageUploadUrl : '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images¤tFolder=/$odbor_typ/',\n"; |
|---|
| 84 | print " filebrowserFlashUploadUrl : '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash¤tFolder=/$odbor_typ/'\n"; |
|---|
| 85 | print " });\n"; |
|---|
| 86 | print " }\n"; |
|---|
| 87 | print " createEditor();\n"; |
|---|
| 88 | print "</script>\n"; |
|---|
| 89 | } else { |
|---|
| 90 | print "<table>\n"; |
|---|
| 91 | print " <tr>\n"; |
|---|
| 92 | print " <td>$editorcontents</td>\n"; |
|---|
| 93 | print " </tr>\n"; |
|---|
| 94 | print "</table>\n"; |
|---|
| 95 | } |
|---|
| 96 | } else { |
|---|
| 97 | print "<table>\n"; |
|---|
| 98 | print " <tr>\n"; |
|---|
| 99 | print " <td>$editorcontents</td>\n"; |
|---|
| 100 | print " </tr>\n"; |
|---|
| 101 | print "</table>\n"; |
|---|
| 102 | } |
|---|
| 103 | ?> |
|---|