X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-config_cats.php;h=cd1872bc28241353dd4b94291fa7f47bdb7419c7;hp=b8ebcf8b04bb5483580e8993139443db767ad2b4;hb=e01fcf1ca8ddeb72af76465df3ef72301a1cdae7;hpb=c4ceb98e54f072c262519fc2ea31ccf6f8559049 diff --git a/inc/modules/admin/what-config_cats.php b/inc/modules/admin/what-config_cats.php index b8ebcf8b04..cd1872bc28 100644 --- a/inc/modules/admin/what-config_cats.php +++ b/inc/modules/admin/what-config_cats.php @@ -11,7 +11,12 @@ * Kurzbeschreibung : Neue Kategorien hinzufuegen und bestehende * * editieren / loeschen * * -------------------------------------------------------------------- * - * * + * $Revision:: 856 $ * + * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. March 2009) $ * + * $Tag:: 0.2.1-FINAL $ * + * $Author:: stelzi $ * + * Needs to be in all Files and every File needs "svn propset * + * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2008 by Roland Haeder * * For more information visit: http://www.mxchange.org * @@ -105,7 +110,7 @@ if (REQUEST_ISSET_POST(('add'))) { } } elseif ((REQUEST_ISSET_POST('del')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) { // Delete categories - $SW = 2; $OUT = ""; + $OUT = ""; $SW = 2; foreach (REQUEST_POST('sel') as $id => $value) { // Load data of category $result = SQL_QUERY_ESC("SELECT cat FROM `{!_MYSQL_PREFIX!}_cats` WHERE id=%s LIMIT 1", @@ -130,7 +135,7 @@ if (REQUEST_ISSET_POST(('add'))) { LOAD_TEMPLATE("admin_del_cats"); } elseif ((REQUEST_ISSET_POST('edit')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) { // Edit categories - $SW = 2; $OUT = ""; + $OUT = ""; $SW = 2; foreach (REQUEST_POST('sel') as $id => $value) { // Load data from the category @@ -156,29 +161,25 @@ if (REQUEST_ISSET_POST(('add'))) { // Load main template LOAD_TEMPLATE("admin_edit_cats"); -} - else -{ +} else { + // Init variable here + $CATS = ""; + // Load all categories $result = SQL_QUERY("SELECT id, cat, visible, sort FROM `{!_MYSQL_PREFIX!}_cats` ORDER BY `sort`", __FILE__, __LINE__); - if (SQL_NUMROWS($result) > 0) - { + if (SQL_NUMROWS($result) > 0) { + // Init variables + $OUT = ""; $SW = 2; + // List already existing categories for editing - $SW = 2; $OUT = ""; $CATS = ""; - while (list($id, $cat, $visible, $sort) = SQL_FETCHROW($result)) - { + while ($content = SQL_FETCHARRAY($result)) { // Prepare data for the row template - $content = array( - 'sw' => $SW, - 'id' => $id, - 'cat' => $cat, - 'vis' => TRANSLATE_YESNO($visible), - 'sort' => $sort, - ); + $content['sw'] = $SW; + $content['vis'] = TRANSLATE_YESNO($content['visible']); // Put cat descriptions into variable for the selection box - if (strlen($cat) > 20) $cat = substr($cat, 0, 17)."..."; - $CATS .= " \n"; + if (strlen($content['cat']) > 20) $content['cat'] = substr($content['cat'], 0, 17)."..."; + $CATS .= " \n"; // Load row template and switch color $OUT .= LOAD_TEMPLATE("admin_config_cats_row", true, $content); @@ -187,12 +188,15 @@ if (REQUEST_ISSET_POST(('add'))) { // Free memory SQL_FREERESULT($result); + + // @TODO Rewrite this constant define('__CAT_ROWS', $OUT); // Load main template LOAD_TEMPLATE("admin_config_cats"); } + // @TODO Rewrite this constant define('CATS', $CATS); // Form to add a new category