Documentation is available at interface.php
- <?
- /**
- * interface.php
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- * @author Stephan Raabe
- */
- function getSitemapTable($homekey,$key,$level,$val)
- {
- global $output;
- $page_sitemap = get_page_key($key);
- if ($level == 0)
- {
- ?>
- <option value="<?= $page_sitemap["page_path"]; ?>" <? if ($val == $page_sitemap["page_path"]) { ?>selected<? } ?>><?= strip_tags($page_sitemap["page_headline"]); ?></option>
- <?
- }
- else
- {
- $line = "";
- for ($i = 1; $i <= $level; $i++)
- {
- $line .= "-";
- }
- $line .= " ";
- ?>
- <option value="<?= $page_sitemap["page_path"]; ?>" <? if ($val == $page_sitemap["page_path"]) { ?>selected<? } ?>><?= $line.strip_tags($page_sitemap["page_headline"]); ?></option>
- <?
- }
- $level++;
- $subpages = get_subpages_key($key);
- while ($row = mysql_fetch_array($subpages))
- {
- getSitemapTable($homekey,$row["page_key"],$level,$val);
- }
- }
- /**
- * Writes a Table Interface
- */
- function writeTable($addhidden = "",$edit = "",$search="")
- {
- global $db_praefix;
- global $page;
- global $admin_lang;
- global $lang_list;
- global $table;
- global $query;
- global $fieldlist;
- global $locklist;
- global $requiredlist;
- global $widthlist;
- global $namelist;
- global $tablekey;
- global $information;
- $copy = "";
- $add = "";
- $info = "";
- $del = "";
- $test = "";
- $send = "";
- $export = "";
- $exportview = "";
- if ($table == "template")
- {
- $info = "templates/use";
- }
- if (($table == "page") && ($fieldlist == "page_title,page_path"))
- {
- $del = "no";
- $add = "no";
- $edit = "no";
- }
- if (($table == "statistic") || ($table == "group"))
- {
- $add = "no";
- $del = "no";
- }
- if ($table == "newsletter")
- {
- $copy = "yes";
- $test = "yes";
- $send = "yes";
- }
- if (($table == "page") && ($locklist == ""))
- {
- $add = "no";
- $edit = "no";
- $del = "no";
- }
- if (($table == "page") && ($locklist != "") && ($fieldlist != "page_title,page_path"))
- {
- $add = "no";
- $export = "yes";
- $exportview = "yes";
- }
- if (($table == "page") && ($requiredlist == "page_exportfolder"))
- {
- $del = "no";
- }
- $namelist_arr = explode(",",$namelist);
- $fieldlist_arr = explode(",",$fieldlist);
- $widthlist_arr = explode(",",$widthlist);
- $link = connectDB();
- $result = mysql_query($query);
- $anzahl = mysql_num_rows($result);
- closeDB($link);
- ?>
- <!-- openEngine Tooltip START -->
- <script type="text/javascript" src="system/admin/script/overlib414/overlib.js"><!-- overLIB (c) Erik Bosrup --></script>
- <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1005;"></div>
- <!-- openEngine Tooltip END -->
- <!-- Tab Script START -->
- <script language="javascript" src="system/admin/script/oe_tab.js"></script>
- <!-- Tab Script END -->
- <script language="javascript">
- function del<?= $table; ?>Item(key)
- {
- if (confirm("<?= $admin_lang["table"][17]; ?>"))
- {
- document.del<?= $table; ?>Form.delkey.value = key;
- document.del<?= $table; ?>Form.submit();
- }
- }
- function openGroupOrder(path)
- {
- groups = window.open("website.php?id=" + path + "&admin=group/order","order","width=400,height=600,scrollbars=yes");
- groups.focus();
- }
- function confirmSend(path,key,target)
- {
- if (confirm("<?= $admin_lang["newsletter"][21]; ?>"))
- {
- window.open("website.php?id=" + path + "&admin=newsletter/send&action=sendnewsletter&step=1&nl_key=" + key,"sendnewsletter","width=300,height=200");
- }
- }
- function startExport(path,key)
- {
- if (confirm("<?= $admin_lang["exporting"][2]; ?>"))
- {
- window.open("website.php?id=" + path + "&admin=exporting/export&folderdel=0&action=export_page&step=1&key=" + key,"exportpage","width=300,height=200");
- }
- }
- function startExportEmpty(path,key)
- {
- if (confirm("<?= $admin_lang["exporting"][2]; ?>"))
- {
- window.open("website.php?id=" + path + "&admin=exporting/export&folderdel=1&action=export_page&step=1&key=" + key,"exportpage","width=300,height=200");
- }
- }
- function copyNewsletter(nl_key)
- {
- if (confirm("<?= $admin_lang["newsletter"][31]; ?>"))
- {
- location.href="website.php?id=<?= $page["page_path"]; ?>&admin=newsletter&action=copynewsletter&nl_key=" + nl_key;
- }
- }
- function oeunlocknewsletter(path)
- {
- if (confirm("<?= $admin_lang["newsletter"][37]; ?>"))
- {
- location.href = "website.php?id=" + path + "&admin=newsletter&action=unlocknewsletter";
- }
- }
- </script>
- <ul id="tablist">
- <li><a href="#" onClick="return expandcontent('sc1', this)" theme="#D7E5FF"><?= $admin_lang["table"][1]; ?></a></li>
- <li><a href="#" onClick="return expandcontent('sc2', this)" theme="#D7E5FF">Information</a></li>
- <? if ($search != "") { ?>
- <li><a href="#" onClick="return expandcontent('sc3', this)" theme="#D7E5FF">Suche</a></li>
- <? } ?>
- </ul>
- <div id="tabcontentcontainer">
- <div id="sc1" class="tabcontent">
- <? if ((isset($_POST["action"])) && ($_POST["action"] == "searchitem")) { ?>
- <p class="adminText">Ihr Suchergebnis (<?= $anzahl; ?> Treffer):</p>
- <? } ?>
- <div class="oeedittable">
- <form method="post" name="del<?= $table; ?>Form">
- <input type="hidden" name="action" value="delTableItem">
- <input type="hidden" name="table" value="<?= $table; ?>">
- <input type="hidden" name="tablekey" value="<?= $tablekey; ?>">
- <input type="hidden" name="delkey">
- </form>
- <table border="0" cellpadding="0" cellspacing="0" width="100%">
- <thead>
- <tr>
- <? if ($edit != "no") { ?>
- <td width="1%">
- <? if ($add != "no") { ?>
- <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>
- <? } else { ?>
- <img src="system/admin/img/blank.gif" width="16" height="16">
- <? } ?>
- </td>
- <? } ?>
- <? if ($info != "") { ?><td width="1%"> </td><? } ?>
- <?
- $counter = 0;
- foreach($namelist_arr as $value)
- {
- $pos = strpos ($requiredlist, $fieldlist_arr[$counter]);
- if ($pos === false)
- {
- $required = "";
- }
- else
- {
- $required = "*";
- }
- ?>
- <td width="<?= $widthlist_arr[$counter]; ?>"><?= $value.$required; ?></td>
- <?
- $counter++;
- }
- ?>
- <? if ($exportview != "") { ?><td width="1%"> </td><? } ?>
- <? if ($export != "") { ?><td width="1%"> </td><td width="1%"> </td><? } ?>
- <? if ($copy != "") { ?><td width="1%"> </td><? } ?>
- <? if ($test != "") { ?><td width="1%"> </td><? } ?>
- <? if ($send != "") { ?><td width="1%"> </td><? } ?>
- <td width="1%"><img src="system/admin/img/blank.gif" width="16" height="16"></td>
- </tr>
- </thead>
- <tbody>
- <? if ((isset($_GET["action"])) && ($_GET["action"] == "show".$table."Item")) { ?>
- <? if ($requiredlist != "") { ?>
- <!-- Requiredlist START -->
- <script language="javascript" type="text/javascript">
- <? echo writeRequire("add".$table."Form", explode(",",$requiredlist)); ?>
- </script>
- <!-- Requiredlist END -->
- <? } ?>
- <!-- Add Item START -->
- <form method="post" name="add<?= $table; ?>Form">
- <input type="hidden" name="action" value="addTableItem">
- <input type="hidden" name="table" value="<?= $table; ?>">
- <input type="hidden" name="tablekey" value="<?= $tablekey; ?>">
- <input type="hidden" name="fieldlist" value="<?= $fieldlist; ?>">
- <input type="hidden" name="addhidden" value="<?= $addhidden; ?>">
- <tr valign="top">
- <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>
- <? if ($info != "") { ?><td width="1%"> </td><? } ?>
- <? foreach($fieldlist_arr as $value)
- {
- $pos = strpos ($locklist, $value);
- if ($pos === false)
- {
- if ($value == "task_description")
- {
- ?>
- <td><textarea name="<?= $value; ?>"></textarea></td>
- <?
- }
- elseif ($value == "task_page")
- {
- ?>
- <td>
- <select name="<?= $value; ?>">
- <option value="">Seite auswählen</option>
- <?
- $homepages = get_homepages();
- while ($item = mysql_fetch_array($homepages))
- {
- getSitemapTable("home".$item["page_key"],$item["page_key"],0,"");
- }
- ?>
- </select>
- </td>
- <?
- }
- else
- {
- ?>
- <td><input type="text" name="<?= $value; ?>"></td>
- <?
- }
- }
- else
- {
- ?>
- <td> </td>
- <?
- }
- }
- ?>
- <? if ($exportview != "") { ?><td width="1%"> </td><? } ?>
- <? if ($export != "") { ?><td width="1%"> </td><td width="1%"> </td><? } ?>
- <? if ($copy != "") { ?><td width="1%"> </td><? } ?>
- <? if ($test != "") { ?><td width="1%"> </td><? } ?>
- <? if ($send != "") { ?><td width="1%"> </td><? } ?>
- <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>
- </tr>
- </form>
- <!-- Add Item END -->
- <? } ?>
- <?
- while ($row = mysql_fetch_array($result))
- {
- if ((isset($_GET[$table."key"])) && ($_GET[$table."key"] == $row[$tablekey]))
- {
- if (($edit != "no") && ($edit != ""))
- {
- ?>
- <tr valign="top">
- <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>
- <? 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><? } ?>
- <td colspan="<?= sizeof($fieldlist_arr); ?>">
- <div class="oeeditinc">
- <a name="<?= $row[$tablekey]; ?>"></a>
- <? include($edit); ?>
- </div>
- </td>
- <? if ($copy != "") { ?><td width="1%"> </td><? } ?>
- <? if ($test != "") { ?><td width="1%"> </td><? } ?>
- <? if ($send != "") { ?><td width="1%"> </td><? } ?>
- <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>
- </tr>
- <?
- }
- else
- {
- ?>
- <? if ($requiredlist != "") { ?>
- <!-- Requiredlist START -->
- <script language="javascript" type="text/javascript">
- <? echo writeRequire("edit".$table."Form", explode(",",$requiredlist)); ?>
- </script>
- <!-- Requiredlist END -->
- <? } ?>
- <form method="post" name="edit<?= $table; ?>Form">
- <input type="hidden" name="action" value="editTableItem">
- <input type="hidden" name="table" value="<?= $table; ?>">
- <input type="hidden" name="tablekey" value="<?= $tablekey; ?>">
- <input type="hidden" name="fieldlist" value="<?= $fieldlist; ?>">
- <input type="hidden" name="editkey" value="<?= $row[$tablekey]; ?>">
- <tr valign="top">
- <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>
- <? 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><? } ?>
- <? foreach($fieldlist_arr as $value)
- {
- $pos = strpos ($locklist, $value);
- if ($pos === false)
- {
- if ($value == "task_description")
- {
- ?>
- <td><textarea name="<?= $value; ?>"><?= $row[$value]; ?></textarea></td>
- <?
- }
- elseif ($value == "task_page")
- {
- ?>
- <td>
- <select name="<?= $value; ?>">
- <option value="">Seite auswählen</option>
- <?
- $homepages = get_homepages();
- while ($item = mysql_fetch_array($homepages))
- {
- getSitemapTable("home".$item["page_key"],$item["page_key"],0,$row[$value]);
- }
- ?>
- </select>
- </td>
- <?
- }
- else
- {
- ?>
- <td><input type="text" name="<?= $value; ?>" value="<?= $row[$value]; ?>"></td>
- <?
- }
- }
- else
- {
- ?>
- <td><input type="hidden" name="<?= $value; ?>" value="<?= $row[$value]; ?>"><? if ($row[$value] != "") { ?><?= $row[$value]; ?><? } else { ?> <? } ?></td>
- <?
- }
- }
- ?>
- <? if ($exportview != "") { ?><td width="1%"> </td><? } ?>
- <? if ($export != "") { ?><td width="1%"> </td><td width="1%"> </td><? } ?>
- <? if ($copy != "") { ?><td width="1%"> </td><? } ?>
- <? if ($test != "") { ?><td width="1%"> </td><? } ?>
- <? if ($send != "") { ?><td width="1%"> </td><? } ?>
- <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>
- </tr>
- </form>
- <?
- }
- }
- else
- {
- ?>
- <tr>
- <? 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><? } ?>
- <? 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><? } ?>
- <? foreach($fieldlist_arr as $value) { ?>
- <td>
- <?
- if ($row[$value] != "")
- {
- if (($table == "account") && ($value == "account_lastname"))
- {
- if ($row["account_lock"])
- {
- $lock_start = "<span style='color:red;'>";
- $lock_end = "</span>";
- }
- else
- {
- $lock_start = "";
- $lock_end = "";
- }
- echo $lock_start.$row[$value]." [".getGroup($row["account_group"])."]".$lock_end;
- }
- elseif ($value == "task_page")
- {
- if ($row[$value] != "")
- {
- ?>
- <a href="#" onClick="window.opener.location.href = 'website.php?id=<?= $row[$value] ?>'"><?= strip_tags($row[$value]); ?></a>
- <?
- }
- else
- {
- echo " ";
- }
- }
- elseif ($value == "page_title")
- {
- ?>
- <a href="#" onClick="window.opener.location.href = 'website.php?id=<?= $row["page_path"] ?>'"><?= strip_tags($row[$value]); ?></a>
- <?
- }
- else
- {
- echo $row[$value];
- }
- }
- else
- {
- echo " ";
- }
- ?>
- </td>
- <? } ?>
- <? 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 { ?> <? } ?></td><? } ?>
- <? if ($export != "") { ?>
- <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 { ?> <? } ?></td>
- <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 { ?> <? } ?></td>
- <? } ?>
- <? 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><? } ?>
- <? 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><? } ?>
- <? 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><? } ?>
- <? if ($table == "template") { ?>
- <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>
- <? } else { ?>
- <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>
- <? } ?>
- </tr>
- <?
- }
- }
- ?>
- </tbody>
- </table>
- <? if ((isset($_POST["action"])) && ($_POST["action"] == "searchitem")) { ?>
- <div class="oesubmitbuttons2" style="padding-top:10px;">
- <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"]; ?>'">
- </div>
- <? } ?>
- </div>
- </div>
- <div id="sc2" class="tabcontent">
- <p class="adminText"><?= $admin_lang["table"][15]; ?> <b><?= $anzahl; ?> <?= $admin_lang["table"][16]; ?>.</b></p>
- <? if ($information != "") { ?><p class="adminText"><?= $information; ?></p><? } ?>
- <p class="adminText">
- <? if ($add != "no") { ?><img src="system/admin/img/oes_add.png"> <?= $admin_lang["table"][2]; ?><br><? } ?>
- <? if ($edit != "no") { ?><img src="system/admin/img/oes_editor.png"> <?= $admin_lang["table"][8]; ?><br><? } ?>
- <? if ($del != "no") { ?><img src="system/admin/img/oes_delete.png"> <?= $admin_lang["table"][14]; ?><br><? } ?>
- <? if (($add != "no") || ($edit != "no")) { ?><img src="system/admin/img/oes_ok.png"> <?= $admin_lang["table"][6]; ?><br><? } ?>
- <? if (($add != "no") || ($edit != "no")) { ?><img src="system/admin/img/oes_cancel.png"> <?= $admin_lang["table"][4]; ?><br><? } ?>
- <? if ($info == "yes") { ?><img src="system/admin/img/oes_help.gif"> <?= $admin_lang["table"][7]; ?><br><? } ?>
- <? if ($export == "yes") { ?><img src="system/admin/img/oes_startexport.png"> <?= $admin_lang["table"][10]; ?><br><? } ?>
- <? if ($export == "yes") { ?><img src="system/admin/img/oes_startexportempty.png"> <?= $admin_lang["table"][24]; ?><br><? } ?>
- <? if ($exportview == "yes") { ?><img src="system/admin/img/oes_preview.png"> <?= $admin_lang["table"][9]; ?><br><? } ?>
- <? if ($copy == "yes") { ?><img src="system/admin/img/oes_copy.png"> <?= $admin_lang["table"][11]; ?><br><? } ?>
- <? if ($test == "yes") { ?><img src="system/admin/img/oes_testnewsletter.png"> <?= $admin_lang["table"][12]; ?><br><? } ?>
- <? if ($send == "yes") { ?><img src="system/admin/img/oes_sendnewsletter.png"> <?= $admin_lang["table"][13]; ?><br><? } ?>
- </p>
- </div>
- <? if ($search != "") { ?>
- <div id="sc3" class="tabcontent">
- <div class="oeedittable">
- <div class="oeeditinc">
- <? include($search); ?>
- </div>
- </div>
- </div>
- <? } ?>
- </div>
- <?
- }
- /**
- * Adds a table item
- */
- function addTableItem()
- {
- global $db_praefix,$page;
- $table = $_POST["table"];
- $fieldlist = $_POST["fieldlist"];
- $fieldlist_arr = explode(",",$fieldlist);
- $addhidden = $_POST["addhidden"];
- $addhidden_arr = explode(",",$addhidden);
- $tablekey = $_POST["tablekey"];
- $link = connectDB();
- $hiddenlist = "";
- if ($addhidden != "")
- {
- foreach($addhidden_arr as $value)
- {
- $value_arr = explode("=",$value);
- $hiddenlist .= ",".$value_arr[0];
- }
- }
- $query = "INSERT INTO ".$db_praefix.$table." ($fieldlist$hiddenlist) VALUES (";
- foreach($fieldlist_arr as $value)
- {
- $query .= "'".$_POST[$value]."',";
- }
- if ($addhidden != "")
- {
- foreach($addhidden_arr as $value)
- {
- $value_arr = explode("=",$value);
- $query .= "'".$value_arr[1]."',";
- }
- }
- $query = substr($query,0,strlen($query)-1);
- $query .= ")";
- $result = mysql_query($query);
- closeDB($link);
- header("Location: website.php?id=".$page["page_path"]."&admin=".$_GET["admin"]);
- }
- /**
- * Deletes a table item
- */
- function delTableItem()
- {
- global $db_praefix,$page;
- $table = $_POST["table"];
- $tablekey = $_POST["tablekey"];
- $delkey = $_POST["delkey"];
- $link = connectDB();
- $query = "DELETE FROM ".$db_praefix.$table." where $tablekey = $delkey";
- $result = mysql_query($query);
- closeDB($link);
- header("Location: website.php?id=".$page["page_path"]."&admin=".$_GET["admin"]);
- }
- /**
- * Edits a table item
- */
- function editTableItem()
- {
- global $db_praefix,$page;
- $table = $_POST["table"];
- $tablekey = $_POST["tablekey"];
- $fieldlist = $_POST["fieldlist"];
- $fieldlist_arr = explode(",",$fieldlist);
- $editkey = $_POST["editkey"];
- $link = connectDB();
- $query = "UPDATE ".$db_praefix.$table." SET ";
- foreach($fieldlist_arr as $value)
- {
- $query .= $value."='".$_POST[$value]."',";
- }
- $query = substr($query,0,strlen($query)-1);
- $query .= " where $tablekey = $editkey";
- $result = mysql_query($query);
- closeDB($link);
- header("Location: website.php?id=".$page["page_path"]."&admin=".$_GET["admin"]);
- }
- ?>
Documentation generated on Tue, 16 Aug 2005 17:32:21 +0200 by phpDocumentor 1.3.0RC3