Mailer project continued:
authorRoland Häder <roland@mxchange.org>
Thu, 4 Oct 2012 20:36:59 +0000 (20:36 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 4 Oct 2012 20:36:59 +0000 (20:36 +0000)
- Extension ext-grade continued:
  + Language file added
  + XML template for listing grade_data entries added
  + First script to list entries in grade_data added
- Generic admin "list" template added (you may use this for own XML-based scripts)
- Other minor improvements
- TODOs.txt updated

.gitattributes
DOCS/TODOs.txt
inc/db/lib-mysql3.php
inc/db/lib.php
inc/extensions/ext-grade.php
inc/language/grade_de.php [new file with mode: 0644]
inc/modules/admin/what-list_ [new file with mode: 0644]
inc/modules/admin/what-list_grade_data.php [new file with mode: 0644]
templates/xml/admin/admin_list_grade_data.xml [new file with mode: 0644]

index 81b0cd72bfed6240ef3b81dc9a6bc31335959915..bb41fca68606595fed994daf3f6e601081469142 100644 (file)
@@ -312,6 +312,7 @@ inc/language/earning_de.php svneol=native#text/plain
 inc/language/en.php svneol=native#text/plain
 inc/language/forced_de.php svneol=native#text/plain
 inc/language/funcoins_de.php svneol=native#text/plain
+inc/language/grade_de.php svneol=native#text/plain
 inc/language/holiday_de.php svneol=native#text/plain
 inc/language/html_mail_de.php svneol=native#text/plain
 inc/language/imprint_de.php svneol=native#text/plain
@@ -561,6 +562,7 @@ inc/modules/admin/what-guest_add.php svneol=native#text/plain
 inc/modules/admin/what-guestedit.php svneol=native#text/plain
 inc/modules/admin/what-holiday_list.php svneol=native#text/plain
 inc/modules/admin/what-holiday_remove.php svneol=native#text/plain
+inc/modules/admin/what-list_ svneol=native#text/plain
 inc/modules/admin/what-list_admins_acls.php svneol=native#text/plain
 inc/modules/admin/what-list_autopurge.php svneol=native#text/plain
 inc/modules/admin/what-list_bank_package.php svneol=native#text/plain
@@ -574,6 +576,7 @@ inc/modules/admin/what-list_email_max_rec.php svneol=native#text/plain
 inc/modules/admin/what-list_forced_ads.php svneol=native#text/plain
 inc/modules/admin/what-list_forced_campaigns.php svneol=native#text/plain
 inc/modules/admin/what-list_forced_costs.php svneol=native#text/plain
+inc/modules/admin/what-list_grade_data.php svneol=native#text/plain
 inc/modules/admin/what-list_holiday.php svneol=native#text/plain
 inc/modules/admin/what-list_links.php svneol=native#text/plain
 inc/modules/admin/what-list_network_api_translation.php svneol=native#text/plain
index 1fae91354a58c670d5262c80e13cc15fd98f8d68..ed9e13227cb26efffc61b4c5808d27909c33f312 100644 (file)
@@ -69,7 +69,7 @@
 ./inc/language/order_de.php:70:        // @TODO Find better text
 ./inc/language/rallye_de.php:13: * @TODO Naming convention not applied for language strings             *
 ./inc/language/refback_de.php:51:      // @TODO Rewrite these constants to one
-./inc/libs/admins_functions.php:521:           // @TODO This can be, somehow, rewritten
+./inc/libs/admins_functions.php:525:           // @TODO This can be, somehow, rewritten
 ./inc/libs/bonus_functions.php:194:            // @TODO Move this HTML to a template
 ./inc/libs/doubler_functions.php:44:// @TODO Lame description
 ./inc/libs/doubler_functions.php:93:                   // @TODO Can't this be moved into EL?
 ./inc/modules/admin/what-admins_mails.php:58:                          // @TODO Can this be rewritten to an API function?
 ./inc/modules/admin/what-bonus.php:46:// @TODO Unused at the moment
 ./inc/modules/admin/what-config_mods.php:55:                   // @TODO This can be moved into mysql-function.php, see checkModulePermissions() function
-./inc/modules/admin/what-config_points.php:110:                        // @TODO Rewrite this to a filter
-./inc/modules/admin/what-config_points.php:133:                                // @TODO Rewrite these two lines for new user_points columns (e.g. locked_order_points) with a filter
+./inc/modules/admin/what-config_points.php:130:                                // @TODO Rewrite these two lines for new user_points columns (e.g. locked_order_points) with a filter
 ./inc/modules/admin/what-config_rallye_prices.php:222:                 // @TODO Rewrite these two constants
 ./inc/modules/admin/what-config_register.php:75:       // @TODO Move this HTML code into a template
 ./inc/modules/admin/what-del_email.php:61:             // @TODO Unused: cat_id, payment_id
 ./inc/modules/admin/what-guest_add.php:67:             // @TODO Cant this be rewritten?
 ./inc/modules/admin/what-guest_add.php:80:             // @TODO This can be somehow rewritten to a function
 ./inc/modules/admin/what-holiday_list.php:46:// @TODO Unused at the moment
-./inc/modules/admin/what-list_admins_acls.php:101:     // @TODO Rewrite this to a filter
-./inc/modules/admin/what-list_admins_acls.php:129:     // @TODO Rewrite this to filter 'run_sqls'
+./inc/modules/admin/what-list_admins_acls.php:126:     // @TODO Rewrite this to filter 'run_sqls'
 ./inc/modules/admin/what-list_autopurge.php:47:// @TODO Rewrite those lines to filter
 ./inc/modules/admin/what-list_bonus.php:137:           // @TODO Can't this be moved into our expression language?
 ./inc/modules/admin/what-list_cats.php:54:             // @TODO No longer needed? define('__CATEGORIES_BASE'   , '<a href="{%url=modules.php?module=admin&amp;userid=');
 ./inc/modules/member/what-unconfirmed.php:169: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
 ./inc/modules/member/what-unconfirmed.php:234:                         // @TODO This 'userid' cannot be saved because of encapsulated EL code
 ./inc/modules/order.php:78:            // @TODO Unused: 2,4
-./inc/mysql-manager.php:1442:          // @TODO Rewrite these lines to a filter
-./inc/mysql-manager.php:1466:  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1722:                  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1437:          // @TODO Rewrite these lines to a filter
+./inc/mysql-manager.php:1461:  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1717:                  // @TODO Rewrite this to a filter
 ./inc/mysql-manager.php:398:   // @TODO Try to rewrite this to one or more functions
 ./inc/mysql-manager.php:44:// @TODO Can we cache this?
 ./inc/purge/purge-inact.php:55:        // @TODO Rewrite these if() blocks to a filter
 ./inc/template-functions.php:285:      // @TODO Remove these sanity checks if all is fine
 ./inc/template-functions.php:599:// @TODO $simple/$constants are deprecated
 ./inc/template-functions.php:697:                      // @TODO $userid is deprecated and should be removed from loadEmailTemplate() and replaced with $content[userid] in all templates
-./inc/wrapper-functions.php:2980:      // @TODO Find a way to not use direct module comparison
+./inc/wrapper-functions.php:3004:      // @TODO Find a way to not use direct module comparison
 ./inc/wrapper-functions.php:494:// @TODO Do some more sanity check here
 ./inc/xml-functions.php:208:   // @TODO Handle characters
 ./mailid.php:102:              // @TODO Rewrite this to a filter
index 2f1c1b4fe1bfa93295d677caf688c1d40e7553ab..1da0f27c5a2befb19ff39dbd25d57bdc75fd0f66 100644 (file)
@@ -118,7 +118,7 @@ function SQL_QUERY ($sqlString, $F, $L, $enableCodes = true) {
                } // END - if
 
                // Append debug line
-               appendLineToFile(getCachePath() . 'mysql.log', basename($F) . '|LINE=' . $L . '|NUM=' . (is_resource($result) ? SQL_NUMROWS($result) : 'false') . '|AFFECTED=' . SQL_AFFECTEDROWS() . '|QUERYTIME:' . $queryTime . '): ' . str_replace(array(chr(13), chr(10)), array('', ' '), $GLOBALS['last_sql']));
+               appendLineToFile(getCachePath() . 'mysql.log', basename($F) . '|LINE=' . $L . '|NUM=' . (is_resource($result) ? SQL_NUMROWS($result) : 'false') . '|AFFECTED=' . SQL_AFFECTEDROWS() . '|QUERYTIME:' . ($queryTime * 1000) . 'ms): ' . str_replace(array(chr(13), chr(10)), array('', ' '), $GLOBALS['last_sql']));
        } // END - if
 
        // Increment stats entry
@@ -177,12 +177,12 @@ function SQL_FETCHROW ($resource) {
 }
 
 // SQL fetch array
-function SQL_FETCHARRAY ($res) {
+function SQL_FETCHARRAY ($resource) {
        // Is a result resource set?
-       if ((!is_resource($res)) || (!SQL_IS_LINK_UP())) return false;
+       if ((!is_resource($resource)) || (!SQL_IS_LINK_UP())) return false;
 
        // Load row from database
-       $row = mysql_fetch_assoc($res);
+       $row = mysql_fetch_assoc($resource);
 
        // Return only arrays here
        if (is_array($row)) {
@@ -306,7 +306,7 @@ function SQL_INSERTID () {
 // Escape a string for the database
 function SQL_ESCAPE ($str, $secureString = true, $strip = true) {
        // Do we have cache?
-       if (!isset($GLOBALS['sql_escapes'][''.$str.''])) {
+       if (!isset($GLOBALS['sql_escapes']['' . $str . ''])) {
                // Prepare the string here
                $str = SQL_PREPARE_SQL_STRING($str);
 
@@ -331,11 +331,11 @@ function SQL_ESCAPE ($str, $secureString = true, $strip = true) {
                }
 
                // Cache result
-               $GLOBALS['sql_escapes'][''.$str.''] = $ret;
+               $GLOBALS['sql_escapes']['' . $str . ''] = $ret;
        } // END - if
 
        // Return it
-       return $GLOBALS['sql_escapes'][''.$str.''];
+       return $GLOBALS['sql_escapes']['' . $str . ''];
 }
 
 // SELECT query string from table, columns and so on... ;-)
index 9d28823ac52107f9919291adf25e43f050f5d3fb..c4616d9b53ba7a30410ef0d73f19f2cd733d980c 100644 (file)
@@ -43,9 +43,10 @@ if (!defined('__SECURITY')) {
 // Create include file name
 $inc = sprintf("inc/db/lib-%s.php", getConfig('_DB_TYPE'));
 
+// Is the database library available?
 if (!isIncludeReadable($inc)) {
        // Bye, bye...
-       reportBug(__FILE__, __LINE__, 'Cannot load database abstraction layer <u>' . getConfig('_DB_TYPE') . '</u> -&gt; R.I.P.');
+       reportBug(__FILE__, __LINE__, 'Cannot load database library <u>' . getConfig('_DB_TYPE') . '</u> -&gt; R.I.P.');
 } // END - if
 
 // Include abstraction layer
index cedea5eb664bc1b7de8d28bf71f96f097db3ab05..0ec4081d60695cd907fd4eea216045eab8cd21fa 100644 (file)
@@ -54,55 +54,55 @@ switch (getExtensionMode()) {
                // General and grade level data
                addDropTableSql('grade_data');
                addCreateTableSql('grade_data', "
-`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`grade_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `grade_name` VARCHAR(255) NOT NULL DEFAULT '',
 `grade_description` TINYTEXT NOT NULL,
 `grade_parent_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
-PRIMARY KEY (`id`),
 UNIQUE (`grade_name`),
-INDEX (`grade_parent_id`)",
-                       'Grade general data');
+INDEX (`grade_parent_id`),
+PRIMARY KEY (`grade_id`)",
+                       'Grade data');
 
                // Data for if a grade level has been reached
                addDropTableSql('grade_cash_data');
                addCreateTableSql('grade_cash_data', "
-`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`cash_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `grade_cash_name` VARCHAR(255) NOT NULL DEFAULT '',
 `grade_cash_type` ENUM('DISCOUNT','BONUS') NOT NULL DEFAULT 'DISCOUNT',
 `reached_points` FLOAT(20,5) UNSIGNED NULL DEFAULT NULL,
 `reached_mails` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
 `time_valid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-PRIMARY KEY (`id`),
-UNIQUE (`grade_cash_name`)",
-                       'Grade data if the grade have been "cashed"');
+UNIQUE (`grade_cash_name`),
+PRIMARY KEY (`cash_id`)",
+                       'Data for "cashed" grades');
 
                // Connection grade<->cash data
                addDropTableSql('grade_cash_connect');
                addCreateTableSql('grade_cash_connect', "
-`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`connect_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `grade_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `grade_cash_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-PRIMARY KEY (`id`),
 UNIQUE INDEX `grade_cash` (`grade_id`,`grade_cash_id`),
-INDEX (`grade_cash_id`)",
+INDEX (`grade_cash_id`),
+PRIMARY KEY (`connect_id`)",
                        'Grade<->cash data connection');
 
                // Connection grade<->user data
                addDropTableSql('grade_user_connect');
                addCreateTableSql('grade_user_connect', "
-`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`connect_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `grade_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `grade_expired` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
-PRIMARY KEY (`id`),
 UNIQUE (`userid`,`grade_id`),
-INDEX (`grade_id`)",
+INDEX (`grade_id`),
+PRIMARY KEY (`connect_id`)",
                        'Grade<->user connection');
 
                // Admin menu entries
-               addAdminMenuSql('grade', NULL, 'Einstufungen', 'Stufen Sie Ihre Mitglieder ein, die sie ab einer einstellbaren Anzahl an {?POINTS?} oder best&auml;tigten Mails usw. erhalten und durch die Einstufung Erm&auml;&szlig;igungen oder Sonderboni erhalten k&ouml;nnen.', 6);
-               addAdminMenuSql('grade', 'list_grades', 'Auflisten...', 'Listet alle Einstufungen auf, auch sind diese hier editierbar, neue hinzuf&uuml;gbar und l&ouml;schbar.', 1);
-               addAdminMenuSql('grade', 'list_cash_grade', 'Erm&auml;&szlig;igungen/Sonderboni', 'Listet alle Erm&auml;&szlig;igungen/Sonderbi auf, auch sind diese hier editierbar, neue hinzuf&uuml;gbar und l&ouml;schbar.', 2);
+               addAdminMenuSql('grade', NULL, 'Einstufungen', 'Stufen Sie Ihre Mitglieder ein, die sie ab einer einstellbaren Anzahl an {OPEN_CONFIG}POINTS{CLOSE_CONFIG} oder best&auml;tigten Mails usw. erhalten und durch die Einstufung Erm&auml;&szlig;igungen oder Sonderboni erhalten k&ouml;nnen.', 6);
+               addAdminMenuSql('grade', 'list_grade_data', 'Auflisten...', 'Listet alle Einstufungen auf, auch sind diese hier editierbar, neue hinzuf&uuml;gbar und l&ouml;schbar.', 1);
+               addAdminMenuSql('grade', 'list_cash_grade', 'Erm&auml;&szlig;igungen/Sonderboni', 'Listet alle Erm&auml;&szlig;igungen/Sonderboni auf, auch sind diese hier editierbar, neue hinzuf&uuml;gbar und l&ouml;schbar.', 2);
                addAdminMenuSql('grade', 'list_current_grades', 'Mitglieder-Einstufungen', 'Liste alle durch die Mitglieder aktuell erreichten Einstungen auf. Diese sind nicht editierbar (wir wollen ja nicht schummeln und bestimmten Mitgliedern bessere Einstufungen geben, oder? ;-) ).', 3);
                addAdminMenuSql('grade', 'config_grade', 'Einstellungen ...', 'Diverse Einstellungen zu den Einstufungen.', 4);
 
diff --git a/inc/language/grade_de.php b/inc/language/grade_de.php
new file mode 100644 (file)
index 0000000..c92cb65
--- /dev/null
@@ -0,0 +1,51 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 10/04/2012 *
+ * ===================                          Last change: 10/04/2012 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : grade_de.php                                     *
+ * -------------------------------------------------------------------- *
+ * Short description : German langugage support                         *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Deutsche Sprachunterstuetzung                    *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
+ *                                                                      *
+ * 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.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+       die();
+} // END - if
+
+// Language definitions
+addMessages(array(
+       // Admin - error messages
+       'ADMIN_GRADE_DATA_NO_SELECTIONS' => "Es wurde keine Auswahl getroffen, bitte w&auml;hlen Sie mindestens eine Abstufung aus.",
+       'ADMIN_GRADE_DATA_404' => "Es wurden keine Abstufungen gefunden.",
+));
+
+// [EOF]
+?>
diff --git a/inc/modules/admin/what-list_ b/inc/modules/admin/what-list_
new file mode 100644 (file)
index 0000000..e190b12
--- /dev/null
@@ -0,0 +1,107 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 10/04/2012 *
+ * ===================                          Last change: 10/04/2012 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_!!!s.php                               *
+ * -------------------------------------------------------------------- *
+ * Short description : List all URLs in !!! and sync from mail pool     *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Alle URLs in !!! auflisten und syncen            *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
+ *                                                                      *
+ * 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.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+       die();
+} // END - if
+
+// Add description as navigation point
+addYouAreHereLink('admin', __FILE__);
+
+// By default show the list...
+$show = true;
+
+// Check for '???_id' element
+if ((countRequestPost() > 0) && (!ifPostContainsSelections('???_id'))) {
+       // Not found so output message
+       displayMessage('{--ADMIN_|||_NO_SELECTIONS--}');
+
+       // Abort here
+       return;
+} // END - if
+
+// Edit or delete button hit?
+if (isFormSent('edit')) {
+       // Show entries for editing
+       showEntriesByXmlCallback('admin_edit_show_!!!s');
+
+       // Do not show the list of URLs after this template
+       $show = false;
+} elseif (isFormSent('do_edit')) {
+       // Change data of entries
+       showEntriesByXmlCallback('admin_edit_do_!!!s');
+} elseif (isFormSent('delete')) {
+       // Show entries for deletion
+       showEntriesByXmlCallback('admin_delete_show_!!!s');
+
+       // Do not show the list of URLs after this template
+       $show = false;
+} elseif (isFormSent('do_delete')) {
+       // Remove entries from database
+       showEntriesByXmlCallback('admin_delete_do_!!!s');
+} elseif (isFormSent('lock')) {
+       // Un-/lock selected URLs. This does not work for pending URLs
+       showEntriesByXmlCallback('admin_lock_show_!!!s');
+
+       // Do not show the list of URLs after this template
+       $show = false;
+} elseif (isFormSent('do_lock')) {
+       // Un-/lock selected URLs. This does not work for pending URLs
+       showEntriesByXmlCallback('admin_lock_do_!!!s');
+} elseif (isFormSent('undelete')) {
+       // Undelete selected URLs. This does only work for deleted URLs... ;-)
+       showEntriesByXmlCallback('admin_undelete_show_!!!s');
+
+       // Do not show the list of URLs after this template
+       $show = false;
+} elseif (isFormSent('do_undelete')) {
+       // Undelete selected URLs. This does only work for deleted URLs... ;-)
+       showEntriesByXmlCallback('admin_undelete_do_!!!s');
+}
+
+// Show entries?
+if ($show === false) {
+       // No, a form has already been show
+       return false;
+} // END - if
+
+// List all URLs
+showEntriesByXmlCallback('admin_list_!!!s');
+
+// [EOF]
+?>
diff --git a/inc/modules/admin/what-list_grade_data.php b/inc/modules/admin/what-list_grade_data.php
new file mode 100644 (file)
index 0000000..173bcbe
--- /dev/null
@@ -0,0 +1,92 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 10/04/2012 *
+ * ===================                          Last change: 10/04/2012 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : what-list_grade_data.php                         *
+ * -------------------------------------------------------------------- *
+ * Short description : List all grades                                  *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Listet alle Abstufungen auf                      *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
+ *                                                                      *
+ * 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.                         *
+ *                                                                      *
+ * You should have received a copy of the GNU General Public License    *
+ * along with this program; if not, write to the Free Software          *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
+ * MA  02110-1301  USA                                                  *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+       die();
+} // END - if
+
+// Add description as navigation point
+addYouAreHereLink('admin', __FILE__);
+
+// By default show the list...
+$show = true;
+
+// Check for '???_id' element
+if ((countRequestPost() > 0) && (!ifPostContainsSelections('grade_id'))) {
+       // Not found so output message
+       displayMessage('{--ADMIN_GRADE_DATA_NO_SELECTIONS--}');
+
+       // Abort here
+       return;
+} // END - if
+
+// Edit or delete button hit?
+if (isFormSent('edit')) {
+       // Show entries for editing
+       showEntriesByXmlCallback('admin_edit_show_grade_data');
+
+       // Do not show the list of URLs after this template
+       $show = false;
+} elseif (isFormSent('do_edit')) {
+       // Change data of entries
+       showEntriesByXmlCallback('admin_edit_do_grade_data');
+} elseif (isFormSent('delete')) {
+       // Show entries for deletion
+       showEntriesByXmlCallback('admin_delete_show_grade_data');
+
+       // Do not show the list of URLs after this template
+       $show = false;
+} elseif (isFormSent('do_delete')) {
+       // Remove entries from database
+       showEntriesByXmlCallback('admin_delete_do_grade_data');
+}
+
+// Show entries?
+if ($show === false) {
+       // No, a form has already been show
+       return false;
+} // END - if
+
+// List all URLs
+showEntriesByXmlCallback('admin_list_grade_data');
+
+// Add form for adding new entry
+loadTemplate('admin_add_grade_data');
+
+// [EOF]
+?>
diff --git a/templates/xml/admin/admin_list_grade_data.xml b/templates/xml/admin/admin_list_grade_data.xml
new file mode 100644 (file)
index 0000000..fa5afb1
--- /dev/null
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for listing grades.
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2012 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          http://mxchange.org
+
+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.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+MA  02110-1301  USA
+//-->
+<admin-list-data>
+       <!--
+       Call-back function, the extracted data from this XML will then be re-read
+       from that function. The most common function this XML uses is
+       adminListEntries() so mostly you can leave this alone unless you have JOINs.
+       //-->
+       <callback-function type="string" value="adminListEntries" />
+       <!--
+       Now we need information which template should be loaded and which functions
+       shall be called back. So lets start with the main list template. This mostly
+       requires no call-back function.
+       //-->
+       <list-template type="string" value="admin_list_grade_data" />
+       <!--
+       The template for all rows, mostly this name has a '_row' suffix and again,
+       no call-back function is usually required.
+       //-->
+       <list-row-template type="string" value="admin_list_grade_data_row" />
+       <!--
+       Message id to display if no entry could be found
+       //-->
+       <no-entry-found-message type="string" value="ADMIN_GRADE_DATA_404" />
+       <!--
+       The table(s) we shall grab the data from, all as list.
+       //-->
+       <data-tables>
+               <!--
+               A single table entry, with alias and without the configurable
+               _MYSQL_PREFIX. You can specify the table's name or alias later on.
+               //-->
+               <data-table type="string" alias="" value="grade_data" />
+               <!--
+               Columns to perform the SELECT statement on, with alias and name plus which table.
+               //-->
+               <select-data-from-list>
+                       <!--
+                       A single entry with table name (can be left empty), value (must
+                       always be set), alias (again can be left empty) and SQL function
+                       (can also be left empty) which shall be applied on the column.
+                       //-->
+                       <select-data-from-list-entry type="string" table="" value="grade_id" alias="" function="" />
+                       <select-data-from-list-entry type="string" table="" value="grade_name" alias="" function="" />
+                       <select-data-from-list-entry type="string" table="" value="grade_description" alias="" function="" />
+                       <select-data-from-list-entry type="string" table="" value="grade_parent_id" alias="" function="" />
+               </select-data-from-list>
+               <!--
+               And the column list to perform the WHERE statement on.
+               //-->
+               <where-select-from-list>
+               </where-select-from-list>
+               <!--
+               Columns to perform the ORDER BY statement (GROUP BY is not yet supported)
+               //-->
+               <order-by-list>
+                       <!--
+                       A single entry to perform the ORDER BY statement on, see above WHERE entry for details.
+                       //-->
+                       <order-by-list-entry type="string" table="" order="grade_id" value="ASC" />
+               </order-by-list>
+       </data-tables>
+       <!--
+       List all column names from the 'select-data-from-list' node here, but now
+       with call-back informations. The list must only contain those entries where
+       a call-back function shall be called for.
+       //-->
+       <column-callback-list>
+               <!--
+               Another column, now we need a second parameter here because
+               generateDateTime() expects two parameters (first is always the data
+               from column).
+               //-->
+               <column-callback-list-entry>
+                       <!--
+                       The actual data, again.
+                       //-->
+                       <column-callback-data type="string" value="grade_parent_id" callback="generateAdminGradeSelectionBox" />
+                       <!--
+                       More parameters, remember that the first parameter is always given
+                       and that it is the data from column.
+                       //-->
+                       <callback-extra-parameter-list>
+                               <!--
+                               A single parameter, 'type' can be one of 'float', 'int',
+                               'bool', 'string'. 'array' is not yet supported.
+                               //-->
+                               <callback-extra-parameter-list-entry type="int" column="grade_parent_id" value="2" />
+                       </callback-extra-parameter-list>
+               </column-callback-list-entry>
+       </column-callback-list>
+</admin-list-data>