Source for file interface.php

Documentation is available at interface.php

  1. <?
  2. /**
  3. * interface.php
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. * @author Stephan Raabe
  14. */
  15.  
  16.  
  17. function getSitemapTable($homekey,$key,$level,$val)
  18. {
  19. global $output;
  20. $page_sitemap = get_page_key($key);
  21. if ($level == 0)
  22. {
  23. ?>
  24. <option value="<?= $page_sitemap["page_path"]; ?>" <? if ($val == $page_sitemap["page_path"]) { ?>selected<? } ?>><?= strip_tags($page_sitemap["page_headline"]); ?></option>
  25. <?
  26. }
  27. else
  28. {
  29. $line = "";
  30. for ($i = 1; $i <= $level; $i++)
  31. {
  32. $line .= "-";
  33. }
  34. $line .= " ";
  35. ?>
  36. <option value="<?= $page_sitemap["page_path"]; ?>" <? if ($val == $page_sitemap["page_path"]) { ?>selected<? } ?>><?= $line.strip_tags($page_sitemap["page_headline"]); ?></option>
  37. <?
  38. }
  39. $level++;
  40. $subpages = get_subpages_key($key);
  41. while ($row = mysql_fetch_array($subpages))
  42. {
  43. getSitemapTable($homekey,$row["page_key"],$level,$val);
  44. }
  45. }
  46.  
  47. /**
  48. * Writes a Table Interface
  49. */
  50. function writeTable($addhidden = "",$edit = "",$search="")
  51. {
  52. global $db_praefix;
  53. global $page;
  54. global $admin_lang;
  55. global $lang_list;
  56. global $table;
  57. global $query;
  58. global $fieldlist;
  59. global $locklist;
  60. global $requiredlist;
  61. global $widthlist;
  62. global $namelist;
  63. global $tablekey;
  64. global $information;
  65. $copy = "";
  66. $add = "";
  67. $info = "";
  68. $del = "";
  69. $test = "";
  70. $send = "";
  71. $export = "";
  72. $exportview = "";
  73. if ($table == "template")
  74. {
  75. $info = "templates/use";
  76. }
  77. if (($table == "page") && ($fieldlist == "page_title,page_path"))
  78. {
  79. $del = "no";
  80. $add = "no";
  81. $edit = "no";
  82. }
  83. if (($table == "statistic") || ($table == "group"))
  84. {
  85. $add = "no";
  86. $del = "no";
  87. }
  88. if ($table == "newsletter")
  89. {
  90. $copy = "yes";
  91. $test = "yes";
  92. $send = "yes";
  93. }
  94. if (($table == "page") && ($locklist == ""))
  95. {
  96. $add = "no";
  97. $edit = "no";
  98. $del = "no";
  99. }
  100. if (($table == "page") && ($locklist != "") && ($fieldlist != "page_title,page_path"))
  101. {
  102. $add = "no";
  103. $export = "yes";
  104. $exportview = "yes";
  105. }
  106. if (($table == "page") && ($requiredlist == "page_exportfolder"))
  107. {
  108. $del = "no";
  109. }
  110. $namelist_arr = explode(",",$namelist);
  111. $fieldlist_arr = explode(",",$fieldlist);
  112. $widthlist_arr = explode(",",$widthlist);
  113. $link = connectDB();
  114. $result = mysql_query($query);
  115. $anzahl = mysql_num_rows($result);
  116. closeDB($link);
  117.  
  118. ?>
  119. <!-- openEngine Tooltip START -->
  120. <script type="text/javascript" src="system/admin/script/overlib414/overlib.js"><!-- overLIB (c) Erik Bosrup --></script>
  121. <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1005;"></div>
  122. <!-- openEngine Tooltip END -->
  123.  
  124. <!-- Tab Script START -->
  125. <script language="javascript" src="system/admin/script/oe_tab.js"></script>
  126. <!-- Tab Script END -->
  127.  
  128. <script language="javascript">
  129. function del<?= $table; ?>Item(key)
  130. {
  131. if (confirm("<?= $admin_lang["table"][17]; ?>"))
  132. {
  133. document.del<?= $table; ?>Form.delkey.value = key;
  134. document.del<?= $table; ?>Form.submit();
  135. }
  136. }
  137.  
  138. function openGroupOrder(path)
  139. {
  140. groups = window.open("website.php?id=" + path + "&admin=group/order","order","width=400,height=600,scrollbars=yes");
  141. groups.focus();
  142. }
  143.  
  144. function confirmSend(path,key,target)
  145. {
  146. if (confirm("<?= $admin_lang["newsletter"][21]; ?>"))
  147. {
  148. window.open("website.php?id=" + path + "&admin=newsletter/send&action=sendnewsletter&step=1&nl_key=" + key,"sendnewsletter","width=300,height=200");
  149. }
  150. }
  151.  
  152. function startExport(path,key)
  153. {
  154. if (confirm("<?= $admin_lang["exporting"][2]; ?>"))
  155. {
  156. window.open("website.php?id=" + path + "&admin=exporting/export&folderdel=0&action=export_page&step=1&key=" + key,"exportpage","width=300,height=200");
  157. }
  158. }
  159.  
  160. function startExportEmpty(path,key)
  161. {
  162. if (confirm("<?= $admin_lang["exporting"][2]; ?>"))
  163. {
  164. window.open("website.php?id=" + path + "&admin=exporting/export&folderdel=1&action=export_page&step=1&key=" + key,"exportpage","width=300,height=200");
  165. }
  166. }
  167.  
  168. function copyNewsletter(nl_key)
  169. {
  170. if (confirm("<?= $admin_lang["newsletter"][31]; ?>"))
  171. {
  172. location.href="website.php?id=<?= $page["page_path"]; ?>&admin=newsletter&action=copynewsletter&nl_key=" + nl_key;
  173. }
  174. }
  175.  
  176. function oeunlocknewsletter(path)
  177. {
  178. if (confirm("<?= $admin_lang["newsletter"][37]; ?>"))
  179. {
  180. location.href = "website.php?id=" + path + "&admin=newsletter&action=unlocknewsletter";
  181. }
  182. }
  183. </script>
  184. <ul id="tablist">
  185. <li><a href="#" onClick="return expandcontent('sc1', this)" theme="#D7E5FF"><?= $admin_lang["table"][1]; ?></a></li>
  186. <li><a href="#" onClick="return expandcontent('sc2', this)" theme="#D7E5FF">Information</a></li>
  187. <? if ($search != "") { ?>
  188. <li><a href="#" onClick="return expandcontent('sc3', this)" theme="#D7E5FF">Suche</a></li>
  189. <? } ?>
  190. </ul>
  191.  
  192. <div id="tabcontentcontainer">
  193.  
  194. <div id="sc1" class="tabcontent">
  195. <? if ((isset($_POST["action"])) && ($_POST["action"] == "searchitem")) { ?>
  196. <p class="adminText">Ihr Suchergebnis (<?= $anzahl; ?> Treffer):</p>
  197. <? } ?>
  198. <div class="oeedittable">
  199. <form method="post" name="del<?= $table; ?>Form">
  200. <input type="hidden" name="action" value="delTableItem">
  201. <input type="hidden" name="table" value="<?= $table; ?>">
  202. <input type="hidden" name="tablekey" value="<?= $tablekey; ?>">
  203. <input type="hidden" name="delkey">
  204. </form>
  205. <table border="0" cellpadding="0" cellspacing="0" width="100%">
  206.  
  207. <thead>
  208. <tr>
  209. <? if ($edit != "no") { ?>
  210. <td width="1%">
  211. <? if ($add != "no") { ?>
  212. <a href="website.php?id=<?= $page["page_path"]; ?>&admin=<?= $_GET["admin"]; ?>&action=show<?= $table; ?>Item" onmouseover="return overlib('<?= $admin_lang["table"][2]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_add.png"></a>
  213. <? } else { ?>
  214. <img src="system/admin/img/blank.gif" width="16" height="16">
  215. <? } ?>
  216. </td>
  217. <? } ?>
  218. <? if ($info != "") { ?><td width="1%">&nbsp;</td><? } ?>
  219. <?
  220. $counter = 0;
  221. foreach($namelist_arr as $value)
  222. {
  223. $pos = strpos ($requiredlist, $fieldlist_arr[$counter]);
  224. if ($pos === false)
  225. {
  226. $required = "";
  227. }
  228. else
  229. {
  230. $required = "*";
  231. }
  232. ?>
  233. <td width="<?= $widthlist_arr[$counter]; ?>"><?= $value.$required; ?></td>
  234. <?
  235. $counter++;
  236. }
  237. ?>
  238. <? if ($exportview != "") { ?><td width="1%">&nbsp;</td><? } ?>
  239. <? if ($export != "") { ?><td width="1%">&nbsp;</td><td width="1%">&nbsp;</td><? } ?>
  240. <? if ($copy != "") { ?><td width="1%">&nbsp;</td><? } ?>
  241. <? if ($test != "") { ?><td width="1%">&nbsp;</td><? } ?>
  242. <? if ($send != "") { ?><td width="1%">&nbsp;</td><? } ?>
  243. <td width="1%"><img src="system/admin/img/blank.gif" width="16" height="16"></td>
  244. </tr>
  245. </thead>
  246.  
  247. <tbody>
  248. <? if ((isset($_GET["action"])) && ($_GET["action"] == "show".$table."Item")) { ?>
  249.  
  250. <? if ($requiredlist != "") { ?>
  251. <!-- Requiredlist START -->
  252. <script language="javascript" type="text/javascript">
  253. <? echo writeRequire("add".$table."Form", explode(",",$requiredlist)); ?>
  254. </script>
  255. <!-- Requiredlist END -->
  256. <? } ?>
  257.  
  258. <!-- Add Item START -->
  259. <form method="post" name="add<?= $table; ?>Form">
  260. <input type="hidden" name="action" value="addTableItem">
  261. <input type="hidden" name="table" value="<?= $table; ?>">
  262. <input type="hidden" name="tablekey" value="<?= $tablekey; ?>">
  263. <input type="hidden" name="fieldlist" value="<?= $fieldlist; ?>">
  264. <input type="hidden" name="addhidden" value="<?= $addhidden; ?>">
  265. <tr valign="top">
  266. <td><a href="Javascript:checkInput();" onmouseover="return overlib('<?= $admin_lang["table"][3]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_ok.png"></a></td>
  267. <? if ($info != "") { ?><td width="1%">&nbsp;</td><? } ?>
  268. <? foreach($fieldlist_arr as $value)
  269. {
  270. $pos = strpos ($locklist, $value);
  271. if ($pos === false)
  272. {
  273. if ($value == "task_description")
  274. {
  275. ?>
  276. <td><textarea name="<?= $value; ?>"></textarea></td>
  277. <?
  278. }
  279. elseif ($value == "task_page")
  280. {
  281. ?>
  282. <td>
  283. <select name="<?= $value; ?>">
  284. <option value="">Seite ausw&auml;hlen</option>
  285. <?
  286. $homepages = get_homepages();
  287. while ($item = mysql_fetch_array($homepages))
  288. {
  289. getSitemapTable("home".$item["page_key"],$item["page_key"],0,"");
  290. }
  291. ?>
  292. </select>
  293. </td>
  294. <?
  295. }
  296. else
  297. {
  298. ?>
  299. <td><input type="text" name="<?= $value; ?>"></td>
  300. <?
  301. }
  302. }
  303. else
  304. {
  305. ?>
  306. <td>&nbsp;</td>
  307. <?
  308. }
  309. }
  310. ?>
  311. <? if ($exportview != "") { ?><td width="1%">&nbsp;</td><? } ?>
  312. <? if ($export != "") { ?><td width="1%">&nbsp;</td><td width="1%">&nbsp;</td><? } ?>
  313. <? if ($copy != "") { ?><td width="1%">&nbsp;</td><? } ?>
  314. <? if ($test != "") { ?><td width="1%">&nbsp;</td><? } ?>
  315. <? if ($send != "") { ?><td width="1%">&nbsp;</td><? } ?>
  316. <td><a href="website.php?id=<?= $page["page_path"]; ?>&admin=<?= $_GET["admin"]; ?>" onmouseover="return overlib('<?= $admin_lang["table"][4]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_cancel.png"></a></td>
  317. </tr>
  318. </form>
  319. <!-- Add Item END -->
  320. <? } ?>
  321.  
  322. <?
  323. while ($row = mysql_fetch_array($result))
  324. {
  325. if ((isset($_GET[$table."key"])) && ($_GET[$table."key"] == $row[$tablekey]))
  326. {
  327. if (($edit != "no") && ($edit != ""))
  328. {
  329. ?>
  330. <tr valign="top">
  331. <td><a href="Javascript:checkInput()" onmouseover="return overlib('<?= $admin_lang["table"][5]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_ok.png"></a></td>
  332. <? if ($info != "") { ?><td width="1%" valign="bottom"><a href="website.php?id=<?= $page["page_path"]; ?>&admin=<?= $info; ?>&key=<?= $row[$tablekey]; ?>" onmouseover="return overlib('Weitere Informationen', CAPTION, '<?= $title; ?>', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_help.gif"></a></td><? } ?>
  333. <td colspan="<?= sizeof($fieldlist_arr); ?>">
  334. <div class="oeeditinc">
  335. <a name="<?= $row[$tablekey]; ?>"></a>
  336. <? include($edit); ?>
  337. </div>
  338. </td>
  339. <? if ($copy != "") { ?><td width="1%">&nbsp;</td><? } ?>
  340. <? if ($test != "") { ?><td width="1%">&nbsp;</td><? } ?>
  341. <? if ($send != "") { ?><td width="1%">&nbsp;</td><? } ?>
  342. <td><a href="website.php?id=<?= $page["page_path"]; ?>&admin=<?= $_GET["admin"]; ?>" onmouseover="return overlib('<?= $admin_lang["table"][4]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_cancel.png"></a></td>
  343. </tr>
  344. <?
  345. }
  346. else
  347. {
  348. ?>
  349.  
  350. <? if ($requiredlist != "") { ?>
  351. <!-- Requiredlist START -->
  352. <script language="javascript" type="text/javascript">
  353. <? echo writeRequire("edit".$table."Form", explode(",",$requiredlist)); ?>
  354. </script>
  355. <!-- Requiredlist END -->
  356. <? } ?>
  357.  
  358. <form method="post" name="edit<?= $table; ?>Form">
  359. <input type="hidden" name="action" value="editTableItem">
  360. <input type="hidden" name="table" value="<?= $table; ?>">
  361. <input type="hidden" name="tablekey" value="<?= $tablekey; ?>">
  362. <input type="hidden" name="fieldlist" value="<?= $fieldlist; ?>">
  363. <input type="hidden" name="editkey" value="<?= $row[$tablekey]; ?>">
  364. <tr valign="top">
  365. <td><a name="<?= $row[$tablekey]; ?>"></a><a href="Javascript:checkInput();" onmouseover="return overlib('<?= $admin_lang["table"][6]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_ok.png"></a></td>
  366. <? if ($info != "") { ?><td width="1%"><a href="website.php?id=<?= $page["page_path"]; ?>&admin=<?= $info; ?>&key=<?= $row[$tablekey]; ?>" onmouseover="return overlib('<?= $admin_lang["table"][7]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_help.gif"></a></td><? } ?>
  367. <? foreach($fieldlist_arr as $value)
  368. {
  369. $pos = strpos ($locklist, $value);
  370. if ($pos === false)
  371. {
  372. if ($value == "task_description")
  373. {
  374. ?>
  375. <td><textarea name="<?= $value; ?>"><?= $row[$value]; ?></textarea></td>
  376. <?
  377. }
  378. elseif ($value == "task_page")
  379. {
  380. ?>
  381. <td>
  382. <select name="<?= $value; ?>">
  383. <option value="">Seite ausw&auml;hlen</option>
  384. <?
  385. $homepages = get_homepages();
  386. while ($item = mysql_fetch_array($homepages))
  387. {
  388. getSitemapTable("home".$item["page_key"],$item["page_key"],0,$row[$value]);
  389. }
  390. ?>
  391. </select>
  392. </td>
  393. <?
  394. }
  395. else
  396. {
  397. ?>
  398. <td><input type="text" name="<?= $value; ?>" value="<?= $row[$value]; ?>"></td>
  399. <?
  400. }
  401. }
  402. else
  403. {
  404. ?>
  405. <td><input type="hidden" name="<?= $value; ?>" value="<?= $row[$value]; ?>"><? if ($row[$value] != "") { ?><?= $row[$value]; ?><? } else { ?>&nbsp;<? } ?></td>
  406. <?
  407. }
  408. }
  409. ?>
  410. <? if ($exportview != "") { ?><td width="1%">&nbsp;</td><? } ?>
  411. <? if ($export != "") { ?><td width="1%">&nbsp;</td><td width="1%">&nbsp;</td><? } ?>
  412. <? if ($copy != "") { ?><td width="1%">&nbsp;</td><? } ?>
  413. <? if ($test != "") { ?><td width="1%">&nbsp;</td><? } ?>
  414. <? if ($send != "") { ?><td width="1%">&nbsp;</td><? } ?>
  415. <td><a href="website.php?id=<?= $page["page_path"]; ?>&admin=<?= $_GET["admin"]; ?>" onmouseover="return overlib('<?= $admin_lang["table"][4]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_cancel.png"></a></td>
  416. </tr>
  417. </form>
  418. <?
  419. }
  420. }
  421. else
  422. {
  423. ?>
  424. <tr>
  425. <? if ($edit != "no") { ?><td><a href="website.php?id=<?= $page["page_path"]; ?>&admin=<?= $_GET["admin"]; ?>&<?= $table; ?>key=<?= $row[$tablekey]; ?>#<?= $row[$tablekey]; ?>" onmouseover="return overlib('<?= $admin_lang["table"][8]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_editor.png"></a></td><? } ?>
  426. <? if ($info != "") { ?><td width="1%"><a href="website.php?id=<?= $page["page_path"]; ?>&admin=<?= $info; ?>&key=<?= $row[$tablekey]; ?>" onmouseover="return overlib('<?= $admin_lang["table"][7]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_help.gif"></a></td><? } ?>
  427. <? foreach($fieldlist_arr as $value) { ?>
  428. <td>
  429. <?
  430. if ($row[$value] != "")
  431. {
  432. if (($table == "account") && ($value == "account_lastname"))
  433. {
  434. if ($row["account_lock"])
  435. {
  436. $lock_start = "<span style='color:red;'>";
  437. $lock_end = "</span>";
  438. }
  439. else
  440. {
  441. $lock_start = "";
  442. $lock_end = "";
  443. }
  444. echo $lock_start.$row[$value]." [".getGroup($row["account_group"])."]".$lock_end;
  445. }
  446. elseif ($value == "task_page")
  447. {
  448. if ($row[$value] != "")
  449. {
  450. ?>
  451. <a href="#" onClick="window.opener.location.href = 'website.php?id=<?= $row[$value] ?>'"><?= strip_tags($row[$value]); ?></a>
  452. <?
  453. }
  454. else
  455. {
  456. echo "&nbsp;";
  457. }
  458. }
  459. elseif ($value == "page_title")
  460. {
  461. ?>
  462. <a href="#" onClick="window.opener.location.href = 'website.php?id=<?= $row["page_path"] ?>'"><?= strip_tags($row[$value]); ?></a>
  463. <?
  464. }
  465. else
  466. {
  467. echo $row[$value];
  468. }
  469. }
  470. else
  471. {
  472. echo "&nbsp;";
  473. }
  474. ?>
  475. </td>
  476. <? } ?>
  477. <? if ($exportview != "") { ?><td><? if ($row["page_exportfolder"] != "") { ?><a href=".<?= $row["page_exportfolder"]; ?>/<?= getFile($row["page_path"]); ?>" target="_blank" onmouseover="return overlib('<?= $admin_lang["table"][9]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_preview.png"></a><? } else { ?>&nbsp;<? } ?></td><? } ?>
  478. <? if ($export != "") { ?>
  479. <td><? if ($row["page_exportfolder"] != "") { ?><a href="javascript:startExportEmpty('<?= $page["page_path"]; ?>',<?= $row[$tablekey]; ?>);" onmouseover="return overlib('<?= $admin_lang["table"][24]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_startexportempty.png"></a><? } else { ?>&nbsp;<? } ?></td>
  480. <td><? if ($row["page_exportfolder"] != "") { ?><a href="javascript:startExport('<?= $page["page_path"]; ?>',<?= $row[$tablekey]; ?>);" onmouseover="return overlib('<?= $admin_lang["table"][10]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_startexport.png"></a><? } else { ?>&nbsp;<? } ?></td>
  481. <? } ?>
  482. <? if ($copy != "") { ?><td width="1%"><a href="javascript:copyNewsletter(<?= $row[$tablekey]; ?>);" onmouseover="return overlib('<?= $admin_lang["table"][11]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_copy.png"></a></td><? } ?>
  483. <? if ($test != "") { ?><td width="1%"><a href="javascript:location.href='website.php?id=<?= $page["page_path"]; ?>&admin=newsletter&action=testnewsletter&nl_key=<?= $row[$tablekey]; ?>';" onmouseover="return overlib('<?= $admin_lang["table"][12]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_testnewsletter.png"></a></td><? } ?>
  484. <? if ($send != "") { ?><td width="1%"><? if ($row["nl_status"] == 0) { ?><a href="javascript:confirmSend('<?= $page["page_path"]; ?>','<?= $row[$tablekey]; ?>');" onmouseover="return overlib('<?= $admin_lang["table"][13]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_sendnewsletter.png"></a><? } else { ?><img src="system/admin/img/oes_sendnewsletter_off.png"><? } ?></td><? } ?>
  485. <? if ($table == "template") { ?>
  486. <td><? if (mysql_num_rows(get_template_page($row[$tablekey])) == 0) { ?><a href="Javascript:del<?= $table; ?>Item(<?= $row[$tablekey]; ?>);" onmouseover="return overlib('<?= $admin_lang["table"][14]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_delete.png"></a><? } else { ?><img src="system/admin/img/oes_delete_off.png"><? } ?></td>
  487. <? } else { ?>
  488. <td><? if ($del != "no") { ?><a href="Javascript:del<?= $table; ?>Item(<?= $row[$tablekey]; ?>);" onmouseover="return overlib('<?= $admin_lang["table"][14]; ?>', CAPTION, '', WIDTH, 100, FGCOLOR, '#ffffff', BGCOLOR, '#FF9933');" onmouseout="return nd();"><img src="system/admin/img/oes_delete.png"></a><? } else { ?><img src="system/admin/img/oes_delete_off.png"><? } ?></td>
  489. <? } ?>
  490. </tr>
  491. <?
  492. }
  493. }
  494. ?>
  495. </tbody>
  496.  
  497. </table>
  498. <? if ((isset($_POST["action"])) && ($_POST["action"] == "searchitem")) { ?>
  499. <div class="oesubmitbuttons2" style="padding-top:10px;">
  500. <input style="background-image:url(system/admin/img/oes_cancelback.png);background-repeat:no-repeat;width:100px;" type="button" value="Cancel" class="adminsubmitbtn" onclick="location.href='website.php?id=/index.htm&admin=<?= $_GET["admin"]; ?>'">
  501. </div>
  502. <? } ?>
  503. </div>
  504. </div>
  505.  
  506. <div id="sc2" class="tabcontent">
  507. <p class="adminText"><?= $admin_lang["table"][15]; ?> <b><?= $anzahl; ?> <?= $admin_lang["table"][16]; ?>.</b></p>
  508. <? if ($information != "") { ?><p class="adminText"><?= $information; ?></p><? } ?>
  509. <p class="adminText">
  510. <? if ($add != "no") { ?><img src="system/admin/img/oes_add.png"> <?= $admin_lang["table"][2]; ?><br><? } ?>
  511. <? if ($edit != "no") { ?><img src="system/admin/img/oes_editor.png"> <?= $admin_lang["table"][8]; ?><br><? } ?>
  512. <? if ($del != "no") { ?><img src="system/admin/img/oes_delete.png"> <?= $admin_lang["table"][14]; ?><br><? } ?>
  513. <? if (($add != "no") || ($edit != "no")) { ?><img src="system/admin/img/oes_ok.png"> <?= $admin_lang["table"][6]; ?><br><? } ?>
  514. <? if (($add != "no") || ($edit != "no")) { ?><img src="system/admin/img/oes_cancel.png"> <?= $admin_lang["table"][4]; ?><br><? } ?>
  515. <? if ($info == "yes") { ?><img src="system/admin/img/oes_help.gif"> <?= $admin_lang["table"][7]; ?><br><? } ?>
  516. <? if ($export == "yes") { ?><img src="system/admin/img/oes_startexport.png"> <?= $admin_lang["table"][10]; ?><br><? } ?>
  517. <? if ($export == "yes") { ?><img src="system/admin/img/oes_startexportempty.png"> <?= $admin_lang["table"][24]; ?><br><? } ?>
  518. <? if ($exportview == "yes") { ?><img src="system/admin/img/oes_preview.png"> <?= $admin_lang["table"][9]; ?><br><? } ?>
  519. <? if ($copy == "yes") { ?><img src="system/admin/img/oes_copy.png"> <?= $admin_lang["table"][11]; ?><br><? } ?>
  520. <? if ($test == "yes") { ?><img src="system/admin/img/oes_testnewsletter.png"> <?= $admin_lang["table"][12]; ?><br><? } ?>
  521. <? if ($send == "yes") { ?><img src="system/admin/img/oes_sendnewsletter.png"> <?= $admin_lang["table"][13]; ?><br><? } ?>
  522. </p>
  523. </div>
  524.  
  525. <? if ($search != "") { ?>
  526. <div id="sc3" class="tabcontent">
  527. <div class="oeedittable">
  528. <div class="oeeditinc">
  529. <? include($search); ?>
  530. </div>
  531. </div>
  532. </div>
  533. <? } ?>
  534. </div>
  535. <?
  536. }
  537.  
  538. /**
  539. * Adds a table item
  540. */
  541. function addTableItem()
  542. {
  543. global $db_praefix,$page;
  544. $table = $_POST["table"];
  545. $fieldlist = $_POST["fieldlist"];
  546. $fieldlist_arr = explode(",",$fieldlist);
  547. $addhidden = $_POST["addhidden"];
  548. $addhidden_arr = explode(",",$addhidden);
  549. $tablekey = $_POST["tablekey"];
  550. $link = connectDB();
  551. $hiddenlist = "";
  552. if ($addhidden != "")
  553. {
  554. foreach($addhidden_arr as $value)
  555. {
  556. $value_arr = explode("=",$value);
  557. $hiddenlist .= ",".$value_arr[0];
  558. }
  559. }
  560. $query = "INSERT INTO ".$db_praefix.$table." ($fieldlist$hiddenlist) VALUES (";
  561. foreach($fieldlist_arr as $value)
  562. {
  563. $query .= "'".$_POST[$value]."',";
  564. }
  565. if ($addhidden != "")
  566. {
  567. foreach($addhidden_arr as $value)
  568. {
  569. $value_arr = explode("=",$value);
  570. $query .= "'".$value_arr[1]."',";
  571. }
  572. }
  573. $query = substr($query,0,strlen($query)-1);
  574. $query .= ")";
  575. $result = mysql_query($query);
  576. closeDB($link);
  577. header("Location: website.php?id=".$page["page_path"]."&admin=".$_GET["admin"]);
  578. }
  579.  
  580. /**
  581. * Deletes a table item
  582. */
  583. function delTableItem()
  584. {
  585. global $db_praefix,$page;
  586. $table = $_POST["table"];
  587. $tablekey = $_POST["tablekey"];
  588. $delkey = $_POST["delkey"];
  589. $link = connectDB();
  590. $query = "DELETE FROM ".$db_praefix.$table." where $tablekey = $delkey";
  591. $result = mysql_query($query);
  592. closeDB($link);
  593. header("Location: website.php?id=".$page["page_path"]."&admin=".$_GET["admin"]);
  594. }
  595.  
  596. /**
  597. * Edits a table item
  598. */
  599. function editTableItem()
  600. {
  601. global $db_praefix,$page;
  602. $table = $_POST["table"];
  603. $tablekey = $_POST["tablekey"];
  604. $fieldlist = $_POST["fieldlist"];
  605. $fieldlist_arr = explode(",",$fieldlist);
  606. $editkey = $_POST["editkey"];
  607. $link = connectDB();
  608. $query = "UPDATE ".$db_praefix.$table." SET ";
  609. foreach($fieldlist_arr as $value)
  610. {
  611. $query .= $value."='".$_POST[$value]."',";
  612. }
  613. $query = substr($query,0,strlen($query)-1);
  614. $query .= " where $tablekey = $editkey";
  615. $result = mysql_query($query);
  616. closeDB($link);
  617. header("Location: website.php?id=".$page["page_path"]."&admin=".$_GET["admin"]);
  618. }
  619. ?>

Documentation generated on Tue, 16 Aug 2005 17:32:21 +0200 by phpDocumentor 1.3.0RC3