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

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