XML parser introduced, ext-surfbar rewritten, more EL code:
authorRoland Häder <roland@mxchange.org>
Sat, 9 Jul 2011 03:35:11 +0000 (03:35 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 9 Jul 2011 03:35:11 +0000 (03:35 +0000)
- XML parser functions (see xml-functions.php) introduced which shall make it
  much easier in adding list/edit/delete/foo forms to the script by a XML
  rather than tons of hard-to-debug code or large call parameters
- Extension ext-surfbar: Edit/delete/lock/unlock/undelete of URLs is now
  rewritten to make usage of above XML parser
- For same extension, new translateFooToBar() wrappers has been introduced in
  EL code.
- TODOs.txt updated

36 files changed:
.gitattributes
DOCS/TODOs.txt
inc/callback-functions.php [new file with mode: 0644]
inc/config-global.php
inc/extensions/ext-grade.php
inc/functions.php
inc/http-functions.php
inc/language/de.php
inc/language/surfbar_de.php
inc/libs/surfbar_functions.php
inc/modules/admin/action-grade.php [new file with mode: 0644]
inc/modules/admin/admin-inc.php
inc/modules/admin/what-list_surfbar_actions.php
inc/modules/admin/what-list_surfbar_urls.php
inc/modules/member/what-surfbar_list.php
inc/template-functions.php
inc/wrapper-functions.php
inc/xml-functions.php
templates/de/html/admin/admin_del_surfbar_urls.tpl
templates/de/html/admin/admin_del_surfbar_urls_row.tpl
templates/de/html/admin/admin_delete_surfbar_urls.tpl [new file with mode: 0644]
templates/de/html/admin/admin_delete_surfbar_urls_row.tpl [new file with mode: 0644]
templates/de/html/admin/admin_list_surfbar_actions_row.tpl
templates/de/html/member/member_surfbar_list_form.tpl
templates/de/html/surfbar/surfbar_frame_top.tpl
templates/xml/admin/admin_del_do_surfbar_urls.xml
templates/xml/admin/admin_del_show_surfbar_urls.xml
templates/xml/admin/admin_delete_do_surfbar_urls.xml [new file with mode: 0644]
templates/xml/admin/admin_delete_show_surfbar_urls.xml [new file with mode: 0644]
templates/xml/admin/admin_edit_do_surfbar_urls.xml
templates/xml/admin/admin_edit_show_surfbar_urls.xml
templates/xml/admin/admin_lock_do_surfbar_urls.xml [new file with mode: 0644]
templates/xml/admin/admin_lock_show_surfbar_urls.xml [new file with mode: 0644]
templates/xml/admin/admin_undelete_do_surfbar_urls.xml [new file with mode: 0644]
templates/xml/admin/admin_undelete_show_surfbar_urls.xml [new file with mode: 0644]
templates/xml/admin_data_template.xml

index f58a98d39653b482f96470863c243b9f78061b5a..35cdfce18e7f1746fc0e1d499d2e0524b6eed803 100644 (file)
@@ -89,6 +89,7 @@ inc/cache/.htaccess svneol=native#text/plain
 inc/cache/_compiled/.htaccess svneol=native#text/plain
 inc/cache/_compiled/emails/.htaccess svneol=native#text/plain
 inc/cache/_compiled/html/.htaccess svneol=native#text/plain
+inc/callback-functions.php svneol=native#text/plain
 inc/classes/.htaccess svneol=native#text/plain
 inc/classes/cachesystem.class.php svneol=native#text/plain
 inc/classes/rdf.class.php svneol=native#text/plain
@@ -400,6 +401,7 @@ inc/modules/admin/action-country.php svneol=native#text/plain
 inc/modules/admin/action-coupon.php svneol=native#text/plain
 inc/modules/admin/action-doubler.php svneol=native#text/plain
 inc/modules/admin/action-email.php svneol=native#text/plain
+inc/modules/admin/action-grade.php svneol=native#text/plain
 inc/modules/admin/action-holiday.php svneol=native#text/plain
 inc/modules/admin/action-login.php svneol=native#text/plain
 inc/modules/admin/action-logout.php svneol=native#text/plain
@@ -1129,6 +1131,8 @@ templates/de/html/admin/admin_delete_payouts_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_delete_reflevel.tpl svneol=native#text/plain
 templates/de/html/admin/admin_delete_reflevel_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_delete_sponsor.tpl svneol=native#text/plain
+templates/de/html/admin/admin_delete_surfbar_urls.tpl svneol=native#text/plain
+templates/de/html/admin/admin_delete_surfbar_urls_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_delete_transfer_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_delete_user.tpl svneol=native#text/plain
 templates/de/html/admin/admin_edit_admin_menu.tpl svneol=native#text/plain
index e3d4d8ea593f200945474d794da4fa0fb7b5ac8f..8032ea823a20a920d4f535daca6f664820140b3c 100644 (file)
 ./inc/extensions/ext-network.php:93:           // @TODO network_type_handle is an internal name and needs documentation
 ./inc/extensions/ext-newsletter.php:218:               // @TODO Move these into configuration
 ./inc/extensions/ext-order.php:358:            // @TODO This should be moved out to inc/daily/
-./inc/extensions/ext-rallye.php:329:           // @TODO Move this code into a hook
-./inc/extensions/ext-rallye.php:92:            // @TODO Fix config_rallye_prices to list_rallye_prices
+./inc/extensions/ext-rallye.php:331:           // @TODO Move this code into a hook
+./inc/extensions/ext-rallye.php:94:            // @TODO Fix config_rallye_prices to list_rallye_prices
 ./inc/extensions/ext-yoomedia.php:121:         // @TODO Can this be moved into a database table?
 ./inc/extensions/ext-yoomedia.php:54:// @TODO Only deprecated when 'ext-network' is ready! setExtensionDeprecated('Y');
 ./inc/extensions-functions.php:155:    // @TODO Do we still need this? setExtensionUpdateNotes('');
-./inc/extensions-functions.php:1939:// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'
+./inc/extensions-functions.php:1944:// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'
 ./inc/extensions-functions.php:425:// @TODO Change from ext_id to ext_name (not just even the variable! ;-) )
 ./inc/extensions-functions.php:562:            // @TODO Extension is loaded, what next?
 ./inc/filter/bonus_filter.php:56:              // @TODO This query isn't right, it will only update if the user was for a longer time away!
 ./inc/libs/register_functions.php:367: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
 ./inc/libs/sponsor_functions.php:159:                                  // @TODO Rewrite this to API function
 ./inc/libs/sponsor_functions.php:430:                  // @TODO Rewrite this to API function
-./inc/libs/surfbar_functions.php:1026: // @TODO Try to rewrite the following unset()
-./inc/libs/surfbar_functions.php:1541:         // @TODO This can be somehow rewritten
-./inc/libs/surfbar_functions.php:710:// @TODO Can't we use our new expression language instead of this ugly code?
-./inc/libs/surfbar_functions.php:951:  // @TODO Invalid salt should be refused
+./inc/libs/surfbar_functions.php:1072: // @TODO Try to rewrite the following unset()
+./inc/libs/surfbar_functions.php:1587:         // @TODO This can be somehow rewritten
+./inc/libs/surfbar_functions.php:708:// @TODO Can't we use our new expression language instead of this ugly code?
+./inc/libs/surfbar_functions.php:997:  // @TODO Invalid salt should be refused
 ./inc/libs/task_functions.php:240:             // @TODO These can be rewritten to filter
 ./inc/libs/task_functions.php:51:// @TODO Move all extension-dependent queries into filters
 ./inc/libs/theme_functions.php:93:     // @TODO Can't this be rewritten to an API function?
 ./templates/de/html/admin/admin_config_payouts_del.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/admin/admin_config_payouts_edit_row.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/admin/admin_config_payouts_edit.tpl:1:<!--@DEPRECATED //-->
+./templates/de/html/admin/admin_del_surfbar_urls_row.tpl:1:<!-- @DEPRECATED //-->
+./templates/de/html/admin/admin_del_surfbar_urls.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/admin/admin_list_cats_404.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/admin/admin_list_chk_reg_row.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/admin/admin_list_chk_reg.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/admin/admin_reset_pass_done.tpl:1:<!-- @DEPRECATED //-->
 ./templates/de/html/admin/admin_send_reset_link.tpl:1:<!-- @DEPRECATED //-->
+./templates/xml/admin/admin_del_do_surfbar_urls.xml:1:<!-- @DEPRECATED //-->
+./templates/xml/admin/admin_del_show_surfbar_urls.xml:1:<!-- @DEPRECATED //-->
 ### ### template-warnings.log follows: ### ###
 Warning: Not parsing JavaScript templates/de/html/js/js_order_send.tpl.
 Warning: Not parsing JavaScript templates/de/html/js/js_cookies_disabled.tpl.
diff --git a/inc/callback-functions.php b/inc/callback-functions.php
new file mode 100644 (file)
index 0000000..98f19e2
--- /dev/null
@@ -0,0 +1,586 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 07/08/2011 *
+ * ===================                          Last change: 07/08/2011 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : callback-functions.php                           *
+ * -------------------------------------------------------------------- *
+ * Short description : Call-back functions for XML templates            *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Call-Back-Funktionen fuer XML-Templates          *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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
+
+// Handles the XML node 'admin-entry-meta-data'
+function doXmlAdminEntryMetaData ($resource, $attributes) {
+       /*
+        * This node has no attributes by default so it remains just with this
+        * comment.
+        */
+}
+
+// Handles the XML node 'admin-callback-function'
+function doXmlAdminCallbackFunction ($resource, $attributes) {
+       // There are two attributes, by default
+       if (count($attributes) != 2) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 2 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       }
+
+       // Add the function name and no attributes by default
+       $GLOBALS['__XML_CALLBACKS']['callbacks'][] = __FUNCTION__;
+       $GLOBALS['__XML_CALLBACKS']['functions'][__FUNCTION__][] = $attributes['VALUE'];
+       $GLOBALS['__XML_ARGUMENTS'][__FUNCTION__] = array();
+}
+
+// Handles the XML node 'post-data-identify-index'
+function doXmlPostDataIdentifyIndex ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
+               // doXmlAdminCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+       }
+
+       // Add the POST data index for 'id'
+       $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['id_index'] = $attributes['VALUE'];
+}
+
+// Handles the XML node 'database-table'
+function doXmlDatabaseTable ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
+               // doXmlAdminCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+       }
+
+       // Add the database's name
+       $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['database_table'] = $attributes['VALUE'];
+}
+
+// Handles the XML node 'database-column-list'
+function doXmlDatabaseColumnList ($resource, $attributes) {
+       // There should be no attributes
+       if (count($attributes) > 0) {
+               // Please don't add any attributes to foo-list nodes
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
+       } // END - if
+
+       // Add an empty list
+       $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['column_list'] = array();
+}
+
+// Handles the XML node 'database-column-list-entry'
+function doXmlDatabaseColumnListEntry ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['column_list'])) {
+               // doXmlAdminCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function/database-column-list not included around this node. Please fix your XML.');
+       }
+
+       // Add the entry to the list
+       addXmlValueToCallbackAttributes('column_list', $attributes);
+}
+
+// Handles the XML node 'callback-function-list'
+function doXmlCallbackFunctionList ($resource, $attributes) {
+       // There should be no attributes
+       if (count($attributes) > 0) {
+               // Please don't add any attributes to foo-list nodes
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
+       } // END - if
+
+       // Add an empty list
+       $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['callback_list'] = array();
+}
+
+// Handles the XML node 'callback-function-list-entry'
+function doXmlCallbackFunctionListEntry ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['callback_list'])) {
+               // doXmlAdminCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function/callback-function-list not included around this node. Please fix your XML.');
+       }
+
+       // Add the entry to the list
+       addXmlValueToCallbackAttributes('callback_list', $attributes);
+}
+
+// Handles the XML node 'extra-parameter-list'
+function doXmlExtraParameterList ($resource, $attributes) {
+       // There should be no attributes
+       if (count($attributes) > 0) {
+               // Please don't add any attributes to foo-list nodes
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
+       } // END - if
+
+       // Add an empty list
+       $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['extra_list'] = array();
+}
+
+// Handles the XML node 'extra-parameter-list-entry'
+function doXmlExtraParameterListEntry ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['extra_list'])) {
+               // doXmlAdminCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function/extra-parameter-list not included around this node. Please fix your XML.');
+       }
+
+       // Add the entry to the list
+       addXmlValueToCallbackAttributes('extra_list', $attributes);
+}
+
+// Handles the XML node 'extra-parameter-member-list'
+function doXmlExtraParameterMemberList ($resource, $attributes) {
+       // There should be no attributes
+       if (count($attributes) > 0) {
+               // Please don't add any attributes to foo-list nodes
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['extra_list']['member_list'])) {
+               // This list should be created already
+               debug_report_bug(__FUNCTION__, __LINE__, 'member_list should be already created.');
+       }
+}
+
+// Handles the XML node 'extra-parameter-member-list-entry'
+function doXmlExtraParameterMemberListEntry ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['extra_list']['member_list'])) {
+               // doXmlAdminCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function/extra-parameter-list/member-list not included around this node. Please fix your XML.');
+       }
+
+       // Add the entry to the list
+       addXmlValueToCallbackAttributes('extra_list', $attributes, 'member_list');
+}
+
+// Handles the XML node 'status-change-column'
+function doXmlStatusChangeColumn ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
+               // doXmlAdminCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+       }
+
+       // Add the entry to the list
+       $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['status_list'][$attributes['VALUE']] = array();
+}
+
+// Handles the XML node 'status-change-list'
+function doXmlStatusChangeList ($resource, $attributes) {
+       // There should be no attributes
+       if (count($attributes) > 0) {
+               // Please don't add any attributes to foo-list nodes
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['status_list'])) {
+               // doXmlAdminCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function/status-list not included around this node. Please fix your XML.');
+       }
+}
+
+// Handles the XML node 'status-change-list-entry'
+function doXmlStatusChangeListEntry ($resource, $attributes) {
+       // There are for attributes, by default
+       if (count($attributes) != 4) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 4 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['OLD'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute OLD does not validate. TYPE=' . $attributes['TYPE'] . ',OLD=' . $attributes['OLD']);
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['status_list'])) {
+               // doXmlAdminCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function/extra-parameter-list/member-list not included around this node. Please fix your XML.');
+       }
+
+       // Add the entry to the list
+       addXmlValueToCallbackAttributes('status_list', $attributes, $attributes['NAME'], 'OLD');
+}
+
+// Handles the XML node 'enable-modify-entries'
+function doXmlEnableModifyEntries ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
+               // doXmlAdminCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+       }
+
+       // Add the entry to the array
+       $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['enable_modify_entries'] = convertStringToBoolean($attributes['VALUE']);
+}
+
+// Handles the XML node 'table-id-column'
+function doXmlTableIdColumn ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
+               // doXmlAdminCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+       }
+
+       // Add the entry to the array
+       $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['table_id_column'] = $attributes['VALUE'];
+}
+
+// Handles the XML node 'table-userid-column'
+function doXmlTableUseridColumn ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
+               // doXmlAdminCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+       }
+
+       // Add the entry to the array
+       $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['table_userid_column'] = $attributes['VALUE'];
+}
+
+// Handles the XML node 'raw-userid-column-key'
+function doXmlRawUseridColumnKey ($resource, $attributes) {
+       // There are three attributes, by default
+       if (count($attributes) != 3) {
+               // Not the right count
+               debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
+       } elseif (!isset($attributes['NAME'])) {
+               // 'NAME' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
+       } elseif (!isset($attributes['TYPE'])) {
+               // 'TYPE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
+       } elseif (!isInvalidXmlType($attributes['TYPE'])) {
+               // No valid type
+               debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
+       } elseif (!isset($attributes['VALUE'])) {
+               // 'VALUE' not found
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
+       } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
+               // Not valid/verifyable
+               debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
+       } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'])) {
+               // doXmlAdminCallbackFunction is missing
+               debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node admin-callback-function not included around this node. Please fix your XML.');
+       }
+
+       // Add the entry to the array
+       $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction']['raw_userid_column_key'] = $attributes['VALUE'];
+}
+
+// ----------------------------------------------------------------------------
+//                                XML type validation
+// ----------------------------------------------------------------------------
+
+// Checks for string without any added extra data
+function isXmlTypeString ($value) {
+       // Just let SQL_ESCAPE() do the job
+       return ($value == SQL_ESCAPE($value));
+}
+
+// Fake-check for array type
+function isXmlTypeArray ($value) {
+       // This value is always a string
+       return (is_string($value));
+}
+
+// Check for boolean type
+function isXmlTypeBool ($value) {
+       // Trim value
+       $value = trim($value);
+
+       // This value is always a string
+       return (($value == 'true') || ($value == 'false'));
+}
+
+// ----------------------------------------------------------------------------
+//                               Private XML functions
+// ----------------------------------------------------------------------------
+
+// Adds given attribut to element
+function addXmlValueToCallbackAttributes ($element, $attributes, $extraKey = '', $key = '') {
+       if ($attributes['TYPE'] == 'array') {
+               // Another nested array
+               /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=ARRAY, element=' . $element);
+               $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][$attributes['VALUE'] . '_list'] = array();
+       } elseif (!empty($extraKey)) {
+               // Is it bool?
+               if ($attributes['TYPE'] == 'bool') {
+                       // Then convert VALUE
+                       $attributes['VALUE'] = convertStringToBoolean($attributes['VALUE']);
+               } // END - if
+
+               // Sub-array (one level only)
+               /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE='.$attributes['TYPE'].',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE']);
+               if (trim($attributes['NAME']) == '') {
+                       // Numerical index
+                       /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE='.$attributes['TYPE'].',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!');
+                       $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][$extraKey][] = $attributes['VALUE'];
+               } elseif (!empty($key)) {
+                       // Use from $key
+                       /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE='.$attributes['TYPE'].',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - KEY! (key=' . $attributes[$key] . ')');
+                       $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][$extraKey][$attributes[$key]] = $attributes['VALUE'];
+               } else {
+                       // Use from NAME
+                       /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE='.$attributes['TYPE'].',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NAME! (name=' . $attributes['NAME'] . ')');
+                       $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][$extraKey][$attributes['NAME']] = $attributes['VALUE'];
+               }
+       } elseif (trim($attributes['NAME']) == '') {
+               // Numerical index
+               /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE']);
+               $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][] = $attributes['VALUE'];
+       } elseif (isset($GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][$attributes['NAME']])) {
+               // Already created
+               debug_report_bug(__FUNCTION__, __LINE__, 'NAME=' . $attributes['NAME'] . ' already addded to ' . $element . '.');
+       } else {
+               // Use from NAME
+               /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',NAME=' . $attributes['NAME'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE']);
+               $GLOBALS['__XML_ARGUMENTS']['doXmlAdminCallbackFunction'][$element][$attributes['NAME']] = $attributes['VALUE'];
+       }
+}
+
+// ----------------------------------------------------------------------------
+//                            Execute call-back functions
+// ----------------------------------------------------------------------------
+
+// Execute function for doXmlAdminCallbackFunction()
+function doXmlAdminCallbackFunctionExecute ($function, $args) {
+       // Prepare 'id_index'
+       $args['id_index'] = postRequestParameter($args['id_index']);
+
+       // Just call it
+       //* DEBUG: */ die('<pre>'.print_r($args, true).'</pre>');
+       call_user_func_array($function, $args);
+}
+
+// [EOF]
+?>
index a2becbbc33a5cec7ff2c5c5fd53ada6df3739f0d..1b40b2c9379df7f527654fa486ff4e7b29f9daca 100644 (file)
@@ -60,7 +60,7 @@ error_reporting(E_ALL | E_STRICT);
 $path = str_replace("\\", '/', substr(dirname(__FILE__), 0, -3));
 
 // Some very important function includes
-foreach (array('config', 'wrapper', 'template', 'module', 'inc', 'stats', 'http') as $inc) {
+foreach (array('config', 'wrapper', 'template', 'module', 'inc', 'stats', 'http', 'xml', 'callback') as $inc) {
        include($path . 'inc/' . $inc . '-functions.php');
 } // END - foreach
 
index 2ce287dd616a9f5c421cc69b44969369c8835e97..21fc8de95d8cb5d051bd18d47806ca0aadc9af71 100644 (file)
@@ -128,10 +128,14 @@ INDEX (`grade_id`)",
 
        case 'activate': // Do stuff when admin activates this extension
                // SQL commands to run
+               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `locked`='N', `visible`='Y' WHERE `what`='grade' LIMIT 1");
+               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `locked`='N', `visible`='Y' WHERE `what`='grade' LIMIT 1");
                break;
 
        case 'deactivate': // Do stuff when admin deactivates this extension
                // SQL commands to run
+               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `locked`='Y', `visible`='N' WHERE `what`='grade' LIMIT 1");
+               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `locked`='Y', `visible`='N' WHERE `what`='grade' LIMIT 1");
                break;
 
        case 'update': // Update an extension
index ba6ccc37101dcfc574e6145d1cc3728bbadb3811..e2fdb65381aba41d1264c934cfe0079386fd1a23 100644 (file)
@@ -2300,7 +2300,7 @@ function detectMultiBytePrefix ($str) {
 }
 
 // Searches the given array for a sub-string match and returns all found keys in an array
-function getArrayKeysFromSubStrArray ($heystack, array $needles, $offset = 0) {
+function getArrayKeysFromSubStrArray ($heystack, $needles, $offset = 0) {
        // Init array for all found keys
        $keys = array();
 
@@ -2391,6 +2391,21 @@ function translateTaskType ($taskType) {
        return $message;
 }
 
+// "Translates" 'true' to true and 'false' to false
+function convertStringToBoolean ($str) {
+       // Trim it lower-case for validation
+       $str = trim(strtolower($str));
+
+       // Is it valid?
+       if (!in_array($str, array('true', 'false'))) {
+               // Not valid!
+               debug_report_bug(__FUNCTION__, __LINE__, 'str=' . $str . ' is not true/false');
+       } // END - if
+
+       // Return it
+       return (($str == 'true') ? true : false);
+}
+
 //-----------------------------------------------------------------------------
 // Automatically re-created functions, all taken from user comments on www.php.net
 //-----------------------------------------------------------------------------
index 5e7aefa5718f0ed991119f0004c3d8820576f9aa..3b9a630eefbe48e362a17f109bf5d28c70dec282 100644 (file)
@@ -115,7 +115,7 @@ function sendGetRequest ($baseUrl, $data = array(), $removeHeader = false) {
 }
 
 // Send a POST request
-function sendPostRequest ($baseUrl, array $postData, $removeHeader = false) {
+function sendPostRequest ($baseUrl, $postData, $removeHeader = false) {
        // Extract host name from script
        $host = extractHostnameFromUrl($baseUrl);
 
@@ -369,7 +369,7 @@ function setupProxyTunnel ($host, $port, $resource) {
 }
 
 // Check array for chuncked encoding
-function unchunkHttpResponse (array $response) {
+function unchunkHttpResponse ($response) {
        // Default is not chunked
        $isChunked = false;
 
@@ -405,7 +405,7 @@ function unchunkHttpResponse (array $response) {
 }
 
 // Removes HTTP header lines from a response array (e.g. output from send<Get|Post>Request() )
-function removeHttpHeaderFromResponse (array $response) {
+function removeHttpHeaderFromResponse ($response) {
        // Save headers for later usage
        $GLOBALS['http_headers'] = array();
 
index 886d79ea0abf5944e6e2ec7823a548850d4c2a36..df6f8d80ea945afa0d0d1354f51afe8455dc7987 100644 (file)
@@ -1170,6 +1170,9 @@ addMessages(array(
        'ADMIN_CONFIG_GUEST_STATS_MODULES_NOTE' => "Zeigt Klicks in den 10 am h&auml;ufigsten angeklickten Gast- und Mitgliedsmodulen an.",
        'ADMIN_CONFIG_GUEST_STATS_INACTIVE' => "Gast-Statistik deaktivieren",
        'ADMIN_CONFIG_GUEST_STATS_INACTIVE_NOTE' => "Deaktiviert die Gast-Statistiken komplett.",
+
+       // XML related strings
+       'XML_TEMPLATE_404' => "XML-Template <span class=\"data\">%s</span nicht gefunden.",
 ));
 
 // Description of all months
index fd94f7589ad22191937857209f72ca47554acf39..27471898807f9c22bbf69e1f356070d6b581338e 100644 (file)
@@ -42,6 +42,7 @@ if (!defined('__SECURITY')) {
 
 // Configuration strings in admin area
 addMessages(array(
+       // Admin configuration
        'ADMIN_CONFIG_SURFBAR_TITLE' => "Konfiguration der Surfbar",
        'ADMIN_CONFIG_SURFBAR_STATIC_REWARD' => "Statische Verg&uuml;tung:",
        'ADMIN_CONFIG_SURFBAR_STATIC_COSTS' => "Statische Kosten:",
@@ -74,12 +75,12 @@ addMessages(array(
        'ADMIN_CONFIG_SURFBAR_GUEST_LOGIN_FORM_Y' => "Loginformular angzeigen.",
        'ADMIN_CONFIG_SURFBAR_GUEST_LOGIN_FORM_N' => "Zur Startseite weiterleiten.",
 
-// Admin non-config titles
+       // Admin non-config titles
        'ADMIN_SURFBAR_STATS_TITLE' => "Mitglieder-Statistik der Surfbar",
        'ADMIN_SURFBAR_URL_STATS_TITLE' => "URL-bezogene Statistik der Surfbar",
        'ADMIN_LIST_SURFBAR_ACTIONS_TITLE' => "Mitglieder-Aktionen der Surfbar auflisten",
 
-// General admin text
+       // General admin text
        'ADMIN_SURFBAR_NO_URLS_FOUND' => "Es konnten keine URLs in der Surfbar gefunden werden.",
        'ADMIN_SURFBAR_REWARD' => "Verg&uuml;tung",
        'ADMIN_SURFBAR_COSTS' => "Kosten",
@@ -118,7 +119,7 @@ addMessages(array(
        'ADMIN_LIST_SURFBAR_ACTIONS_NOTE' => "<strong>Hinweise:</strong> Sie sollten zur Sicherheit Ihres {?mt_word2?} den neuen Status nie auf <u>{--SURFBAR_URL_STATUS_ACTIVE--}</u> z.B. bei der Mitgliedaktion <u>{--MEMBER_SURFBAR_ACTION_UNPAUSE_SUBMIT--}</u> einstellen.",
        'ADMIN_SURFBAR_URL' => "Gebuchte URL",
 
-// Admin titles
+       // Admin titles
        'ADMIN_SURFBAR_UNLOCK_URLS_TITLE' => "Surfbar - URLs freihschalten/ablehnen",
        'ADMIN_SURFBAR_LIST_URLS_TITLE' => "Surfbar - URLs aufisten",
        'ADMIN_SURFBAR_DELETE_URLS_TITLE' => "Surfbar - URLs entfernen",
@@ -126,10 +127,10 @@ addMessages(array(
        'ADMIN_SURFBAR_LOCK_URLS_TITLE' => "Surfbar - URLs sperren/entsperren",
        'ADMIN_SURFBAR_UNDELETE_URLS_TITLE' => "Surfbar - gel&ouml;schte URLs wiederherstellen",
 
-// Member titles
+       // Member titles
        'MEMBER_SURFBAR_LIST_TITLE' => "Ihre URLs in der Surfbar verwalten",
 
-// General member text
+       // General member text
        'MEMBER_SURFBAR_URL_ADDED' => "URL hinzugef&uuml;gt und wartet auf Freischaltung.",
        'MEMBER_SURFBAR_URL_NOT_ADDED' => "URL konnte nicht hinzugef&uuml;gt werden, da ein Fehler vorliegt.",
        'MEMBER_SURFBAR_ADD_URL' => "URL in Surfbar buchen",
@@ -147,7 +148,7 @@ addMessages(array(
        'MEMBER_SURFBAR_ACTION_FAILED' => "Ausgew&auml;hlte Aktion konnte nicht vollst&auml;ndig ausgef&uuml;hrt werden.",
        'MEMBER_SURFBAR_UNLIMITED_VIEWS' => "Unbegrenzt",
 
-// Subject lines for admins
+       // Subject lines for admins
        'ADMIN_SURFBAR_NOTIFY_URL_UNLOCK_SUBJECT' => "[Surfbar:] URL hinzugef&uuml;gt durch Admin",
        'ADMIN_SURFBAR_NOTIFY_URL_REG_SUBJECT' => "[Surfbar:] Mitgliedsbuchung einer URL",
        'ADMIN_SURFBAR_NOTIFY_URL_MIGRATE_SUBJECT' => "[Surfbar:] Migrierung einer Mailbuchung",
@@ -171,13 +172,13 @@ addMessages(array(
        'ADMIN_SURFBAR_NOTIFY_URL_MIGRATED_PENDING_SUBJECT' => "[Surfbar:] Mitglied hat migrierte URL gebucht",
        'ADMIN_SURFBAR_NOTIFY_DEFAULT_SUBJECT' => "Problem in Surfbar-Betreff (%s)",
 
-// Auto-generated admin subject lines
+       // Auto-generated admin subject lines
        'ADMIN_DELETE_SURFBAR_URLS_SUBJECT' => "[Surfbar:] URL entfernt",
        'ADMIN_EDIT_SURFBAR_URLS_SUBJECT' => "[Surfbar:] URL ge&auml;ndert",
        'ADMIN_ACTIVE_SURFBAR_URLS_SUBJECT' => "[Surfbar:] Freigabe einer URL",
        'ADMIN_LOCKED_SURFBAR_URLS_SUBJECT' => "[Surfbar:] Sperrung einer URL",
 
-// Subject lines for members
+       // Subject lines for members
        'MEMBER_SURFBAR_NOTIFY_URL_UNLOCK_SUBJECT' => "[Surfbar:] Ihre URL wurde aufgenommen",
        'MEMBER_SURFBAR_NOTIFY_URL_REG_SUBJECT' => "[Surfbar:] Ihre URL wartet auf Freischaltung",
        'MEMBER_SURFBAR_NOTIFY_URL_MIGRATE_SUBJECT' => "[Surfbar:] Ihre URL aus der Mailbuchung wurde migriert",
@@ -202,13 +203,13 @@ addMessages(array(
        'MEMBER_SURFBAR_NOTIFY_DEFAULT_SUBJECT' => "[Fehler:] Bitte leiten Sie diese Mail an uns weiter!",
        'MEMBER_SURFBAR_NOTIFY_LOW_POINTS_SUBJECT' => "[Surfbar:] Ihr {?POINTS?}-Stand ist sehr niedrig!",
 
-// Auto-generated member subject lines
+       // Auto-generated member subject lines
        'MEMBER_DELETE_SURFBAR_URLS_SUBJECT' => "[Surfbar:] Ihre URL wurde entfernt",
        'MEMBER_EDIT_SURFBAR_URLS_SUBJECT' => "[Surfbar:] &Auml;nderung Ihrer URL durch Admin",
        'MEMBER_LOCKED_SURFBAR_URLS_SUBJECT' => "[Surfbar:] Sperrung Ihrer URL, bitte AGBs beachten.",
        'MEMBER_ACTIVE_SURFBAR_URLS_SUBJECT' => "[Surfbar:] Freigabe Ihrer URL",
 
-// URL status
+       // URL status
        'SURFBAR_URL_STATUS_ACTIVE' => "Freigegeben",
        'SURFBAR_URL_STATUS_LOCKED' => "Gesperrt",
        'SURFBAR_URL_STATUS_PENDING' => "Wartend",
@@ -219,7 +220,8 @@ addMessages(array(
        'SURFBAR_URL_STATUS_MIGRATED' => "Migriert",
        'SURFBAR_URL_STATUS_NONE' => "Nicht ge&auml;ndert",
 
-// Member actions - submit buttons
+       // Member actions - submit buttons
+       'MEMBER_SURFBAR_ACTION_UNKNOWN_SUBMIT' => "Unbekannt (%s)",
        'MEMBER_SURFBAR_ACTION_RETREAT_SUBMIT' => "Zur&uuml;cknehmen",
        'MEMBER_SURFBAR_ACTION_FRAMETEST_SUBMIT' => "Framkiller-Test",
        'MEMBER_SURFBAR_ACTION_EDIT_SUBMIT' => "&Auml;ndern",
@@ -229,11 +231,12 @@ addMessages(array(
        'MEMBER_SURFBAR_ACTION_PAUSE_SUBMIT' => "Anhalten",
        'MEMBER_SURFBAR_ACTION_UNPAUSE_SUBMIT' => "Fortfahren",
 
-// Member actions - "now" submit buttons
+       // Member actions - "now" submit buttons
        'MEMBER_SURFBAR_ACTION_DELETE_NOW_SUBMIT' => "Jetzt l&ouml;schen",
        'MEMBER_SURFBAR_ACTION_EDIT_NOW_SUBMIT' => "Jetzt &auml;ndern",
 
-// Member actions - button titles
+       // Member actions - button titles
+       'MEMBER_SURFBAR_ACTION_UNKNOWN_TITLE' => "Es wurde eine unbekannte Mitgliedsaktion &#39;%s&#39; erkannt. Bitte melden Sie dies an den Support.",
        'MEMBER_SURFBAR_ACTION_RETREAT_TITLE' => "Nehmen Sie hiermit Ihre Buchung wieder zur&uuml;ck, falls Sie diese doch nicht bewerben wollten.",
        'MEMBER_SURFBAR_ACTION_FRAMETEST_TITLE' => "Testen Sie die Seite auf Framekiller hin, diese sind in unserer Surfbar grunds&auml;tzlich nicht gestattet.",
        'MEMBER_SURFBAR_ACTION_EDIT_TITLE' => "&Auml;ndern Sie hier Ihre URL, wenn diese nicht stimmen sollte. Allerdings wird Ihre URL dann auf Freischaltung wartend gesetzt, damit wir sie vor Aufnahme nochmals kontrollieren k&ouml;nnen.",
@@ -243,12 +246,12 @@ addMessages(array(
        'MEMBER_SURFBAR_ACTION_PAUSE_TITLE' => "Halten Sie die URL in der Surfbar kurz an, wenn sie gerade nicht erreichbar ist. Dies geschieht nicht automatisch.",
        'MEMBER_SURFBAR_ACTION_UNPAUSE_TITLE' => "Lassen Sie die URL in der Surfbar weiterlaufen, wenn Sie dies m&ouml;chten. Wir m&uuml;ssen die URL jedoch erneut freigeben.",
 
-// Internal errors
+       // Internal errors
        'MEMBER_SURFBAR_EXECUTE_ACTION_404' => "Auszuf&uuml;hrende Funktion <span class=\"data\">%s</span> nicht gefunden.",
        'ADMIN_SURFBAR_NOTIFY_SUBJECT_404' => "Admin-Betreffzeile <span class=\"data\">%s</span> nicht gefunden.",
        'MEMBER_SURFBAR_NOTIFY_SUBJECT_404' => "Mitglieder-Betreffzeile <span class=\"data\">%s</span> nicht gefunden.",
 
-// Guest texts
+       // Guest texts
        'GUEST_SURFBAR_LOGIN_HEADER' => "Login zur Surfbar:",
 ));
 
index bb4c68d4a12834f2d58be78d741711387e47ea54..1a1ff0e53e933154297f31bf66fc5598fda6c668 100644 (file)
@@ -199,9 +199,7 @@ function SURFBAR_MEMBER_ACTIONS ($urlId, $status) {
                $OUT .= loadTemplate('member_surfbar_list_form', true, array(
                        'width'    => $width,
                        'id'       => bigintval($urlId),
-                       'action'   => strtolower($action),
-                       'title'    => '{--MEMBER_SURFBAR_ACTION_' . strtoupper($action) . '_TITLE--}',
-                       'submit'   => '{--MEMBER_SURFBAR_ACTION_' . strtoupper($action) . '_SUBMIT--}',
+                       'action'   => strtolower($action)
                ));
        } // END - foreach
 
@@ -734,8 +732,56 @@ function translateSurfbarLimit ($limit) {
 
 // Translate the URL status
 function translateSurfbarUrlStatus ($status) {
-       // Return result
-       return sprintf("{--SURFBAR_URL_STATUS_%s--}", strtoupper($status));
+       // NULL must be handled carfefully
+       if (is_null($status)) {
+               // Is NULL, so return other language string
+               return '{--SURFBAR_URL_STATUS_NONE--}';
+       } else {
+               // Return regular result
+               return sprintf("{--SURFBAR_URL_STATUS_%s--}", strtoupper($status));
+       }
+}
+
+// Translates the given action into a link title for members
+function translateMemberSurfbarActionToTitle ($action) {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__][$action])) {
+               // Construct default return string (unknown
+               $GLOBALS[__FUNCTION__][$action] = '{%message,MEMBER_SURFBAR_ACTION_UNKNOWN_TITLE=' . $action . '%}';
+
+               // ... and the id's name
+               $messageId = 'MEMBER_SURFBAR_ACTION_' . strtoupper($action) . '_TITLE';
+
+               // Is the id there?
+               if (isMessageIdValid($messageId)) {
+                       // Then use it
+                       $GLOBALS[__FUNCTION__][$action] = '{--' . $messageId . '--}';
+               } // END - if
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__][$action];
+}
+
+// Translates the given action into a submit button for members
+function translateMemberSurfbarActionToSubmit ($action) {
+       // Do we have cache?
+       if (!isset($GLOBALS[__FUNCTION__][$action])) {
+               // Construct default return string (unknown
+               $GLOBALS[__FUNCTION__][$action] = '{%message,MEMBER_SURFBAR_ACTION_UNKNOWN_SUBMIT=' . $action . '%}';
+
+               // ... and the id's name
+               $messageId = 'MEMBER_SURFBAR_ACTION_' . strtoupper($action) . '_SUBMIT';
+
+               // Is the id there?
+               if (isMessageIdValid($messageId)) {
+                       // Then use it
+                       $GLOBALS[__FUNCTION__][$action] = '{--' . $messageId . '--}';
+               } // END - if
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__][$action];
 }
 
 // Determine reward
diff --git a/inc/modules/admin/action-grade.php b/inc/modules/admin/action-grade.php
new file mode 100644 (file)
index 0000000..8a0e540
--- /dev/null
@@ -0,0 +1,56 @@
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL                                Start: 03/06/2004 *
+ * ===================                          Last change: 06/30/2004 *
+ *                                                                      *
+ * -------------------------------------------------------------------- *
+ * File              : action-grade.php                                 *
+ * -------------------------------------------------------------------- *
+ * Short description : Grade for members                                *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung  : Einstufungen fuer Mitglieder                     *
+ * -------------------------------------------------------------------- *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author::                                                          $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://www.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__);
+
+// Load the include file
+$inc = sprintf("inc/modules/admin/what-%s.php", getWhat());
+if (isIncludeReadable($inc)) { 
+       // Ok, we finally load the admin action module
+       loadInclude($inc);
+} else {
+       addFatalMessage(__FILE__, __LINE__, '{--ADMIN_WHAT_404--}');
+}
+
+// [EOF]
+?>
index 083e290725ca339d6baa354c0213c4e083a1f819..867c30f34f967bc299ce52cebdc05560e5f7155f 100644 (file)
@@ -751,7 +751,7 @@ function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') {
 }
 
 // Send mails for del/edit/lock build modes
-function sendAdminBuildMails ($mode, $table, $content, $id, $subjectPart = '', $userid = 'userid') {
+function sendAdminBuildMails ($mode, $table, $content, $id, $subjectPart = '', $userIdColumn = 'userid') {
        // Default subject is the subject part
        $subject = $subjectPart;
 
@@ -762,7 +762,7 @@ function sendAdminBuildMails ($mode, $table, $content, $id, $subjectPart = '', $
        } // END - if
 
        // Is the raw userid set?
-       if (postRequestParameter($useridColumn, $id) > 0) {
+       if (postRequestParameter($userIdColumn, $id) > 0) {
                // Load email template
                if (!empty($subjectPart)) {
                        $mail = loadEmailTemplate('member_' . $mode . '_' . strtolower($subjectPart) . '_' . $table, $content);
@@ -771,7 +771,7 @@ function sendAdminBuildMails ($mode, $table, $content, $id, $subjectPart = '', $
                }
 
                // Send email out
-               sendEmail(postRequestParameter($useridColumn, $id), strtoupper('{--MEMBER_' . $subject . '_' . $table . '_SUBJECT--}'), $mail);
+               sendEmail(postRequestParameter($userIdColumn, $id), strtoupper('{--MEMBER_' . $subject . '_' . $table . '_SUBJECT--}'), $mail);
        } // END - if
 
        // Generate subject
@@ -779,9 +779,9 @@ function sendAdminBuildMails ($mode, $table, $content, $id, $subjectPart = '', $
 
        // Send admin notification out
        if (!empty($subjectPart)) {
-               sendAdminNotification($subject, 'admin_' . $mode . '_' . strtolower($subjectPart) . '_' . $table, $content, postRequestParameter($useridColumn, $id));
+               sendAdminNotification($subject, 'admin_' . $mode . '_' . strtolower($subjectPart) . '_' . $table, $content, postRequestParameter($userIdColumn, $id));
        } else {
-               sendAdminNotification($subject, 'admin_' . $mode . '_' . $table, $content, postRequestParameter($useridColumn, $id));
+               sendAdminNotification($subject, 'admin_' . $mode . '_' . $table, $content, postRequestParameter($userIdColumn, $id));
        }
 }
 
@@ -823,7 +823,11 @@ function adminListBuilder ($listType, $IDs, $table, $columns, $filterFunctions,
 
                                // Handle the call in external function
                                //* DEBUG: */ debugOutput('key=' . $key . ',fucntion=' . $filterFunctions[$idx] . ',value=' . $value);
-                               $content[$key] = handleExtraValues($filterFunctions[$idx], $value, $extraValues[$idx]);
+                               $content[$key] = handleExtraValues(
+                                       $filterFunctions[$idx],
+                                       $value,
+                                       $extraValues[$idx]
+                               );
                        } // END - foreach
 
                        // Then list it
@@ -1075,7 +1079,10 @@ function adminEditEntriesConfirm ($IDs, $table, $columns = array(), $filterFunct
                        // List for editing
                        adminListBuilder('edit', $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
                }
-       } // END - if
+       } else {
+               // Maybe some invalid parameters
+               debug_report_bug(__FUNCTION__, __LINE__, 'IDs[]=' . gettype($IDs) . ',table=' . $table . ',columns[]=' . gettype($columns) . ',filterFunctions[]=' . gettype($filterFunctions) . ',extraValues[]=' . gettype($extraValues) . ',idColumn=' . $idColumn . ',userIdColumn=' . $userIdColumn . ' - INVALID!');
+       }
 }
 
 // Un-/lock rows by given id numbers
index 195a01acb5eb7cb2770854cecb464a2bdf96e8fb..ff95f1c49410c664abee80bcf0313f5fedb2b390 100644 (file)
@@ -61,16 +61,7 @@ if (!SQL_HASZERONUMS($result)) {
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // "Translate" some data
-               $content['actions_action'] = sprintf("{--MEMBER_SURFBAR_ACTION_%s_SUBMIT--}", strtoupper($content['actions_action']));
-
-               // New status set?
-               if (!is_null($content['actions_new_status'])) {
-                       // Translate it
-                       $content['actions_new_status'] = translateSurfbarUrlStatus($content['actions_new_status']);
-               } else {
-                       // "Do nothing" status
-                       $content['actions_new_status'] = '{--SURFBAR_URL_STATUS_NONE--}';
-               }
+               $content['actions_action'] = '{--MEMBER_SURFBAR_ACTION_' . strtoupper($content['actions_action']) . '_SUBMIT--}', ;
 
                // Load row template
                $OUT .= loadTemplate('admin_list_surfbar_actions_row', true, $content);
index ba8a6daa2fdf8ae59646e55cbd4b4671ae99f7c5..fe6a839e8b29e4e7f648be0678c148e671663e7d 100644 (file)
@@ -67,116 +67,31 @@ if (isFormSent('edit')) {
        showEntriesByXmlCallback('admin_edit_do_surfbar_urls');
 } elseif (isFormSent('delete')) {
        // Show entries for deletion
-       showEntriesByXmlCallback('admin_del_show_surfbar_urls');
+       showEntriesByXmlCallback('admin_delete_show_surfbar_urls');
 
        // Do not show the list of URLs after this template
        $show = false;
 } elseif (isFormSent('do_delete')) {
        // Remove entries from database
-       showEntriesByXmlCallback('admin_del_do_surfbar_urls');
+       showEntriesByXmlCallback('admin_delete_do_surfbar_urls');
 } elseif (isFormSent('lock')) {
        // Un-/lock selected URLs. This does not work for pending URLs
-       adminLockEntriesConfirm(
-               postRequestParameter('url_id'),
-               'surfbar_urls',
-               array(
-                       'url_id',
-                       'url_userid',
-                       'url',
-                       'url_registered',
-                       'url_status'
-               ),
-               array(
-                       'bigintval',
-                       'generateUserProfileLink',
-                       'generateFrametesterUrl',
-                       '',
-                       'translateSurfbarUrlStatus'
-               ),
-               array(
-                       '',
-                       '',
-                       '',
-                       '',
-                       ''
-               ),
-               false,
-               'url_id',
-               'url_userid',
-               'url_userid'
-       );
+       showEntriesByXmlCallback('admin_lock_show_surfbar_urls');
 
        // 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
-       adminLockEntriesConfirm(
-               postRequestParameter('url_id'),
-               'surfbar_urls',
-               array(),
-               array(),
-               array(),
-               array(
-                       'url_status' => array(
-                               'ACTIVE' => 'LOCKED',
-                               'LOCKED' => 'ACTIVE'
-                       )
-               ),
-               true,
-               'url_id',
-               'url_userid',
-               'url_userid'
-       );
+       showEntriesByXmlCallback('admin_lock_do_surfbar_urls');
 } elseif (isFormSent('undelete')) {
        // Undelete selected URLs. This does only work for deleted URLs... ;-)
-       adminUndeleteEntriesConfirm(
-               postRequestParameter('url_id'),
-               'surfbar_urls',
-               array(
-                       'url_id',
-                       'url_userid',
-                       'url',
-                       'url_registered',
-                       'url_status'
-               ),
-               array(
-                       'bigintval',
-                       'generateUserProfileLink',
-                       'generateFrametesterUrl',
-                       '',
-                       'translateSurfbarUrlStatus'
-               ),
-               array(
-                       '',
-                       '',
-                       '',
-                       '',
-                       ''
-               ),
-               false,
-               'url_id',
-               'url_userid',
-               'url_userid'
-       );
+       showEntriesByXmlCallback('admin_undelete_show_surfbar_urls');
+
+       // 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... ;-)
-       adminUndeleteEntriesConfirm(
-               postRequestParameter('url_id'),
-               'surfbar_urls',
-               array(),
-               array(),
-               array(),
-               array(
-                       'url_status' => array(
-                               'DELETED' => 'ACTIVE'
-                       )
-               ),
-               true,
-               'url_id',
-               'url_userid',
-               'url_userid'
-       );
+       showEntriesByXmlCallback('admin_undelete_del_surfbar_urls');
 }
 
 // Show entries?
@@ -187,7 +102,11 @@ if ($show === false) {
 
 // List all URLs
 $result = SQL_QUERY("SELECT
-       `url_id`, `url_userid`, `url`, `url_views_total`, `url_status`,
+       `url_id`,
+       `url_userid`,
+       `url`,
+       `url_views_total`,
+       `url_status`,
        UNIX_TIMESTAMP(`url_registered`) AS `url_registered`,
        UNIX_TIMESTAMP(`url_last_locked`) AS `url_last_locked`,
        `url_lock_reason`
@@ -201,9 +120,9 @@ if (!SQL_HASZERONUMS($result)) {
        // List all URLs
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
-               // "Translate"/add content
-               $content['url_registered']  = generateDateTime($content['url_registered'], 2);
-               $content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2);
+               // "Translate" content
+               $content['url_registered']  = generateDateTime($content['url_registered'], '2');
+               $content['url_last_locked'] = generateDateTime($content['url_last_locked'], '2');
 
                // Load row template
                $OUT .= loadTemplate('admin_list_surfbar_urls_row', true, $content);
index 6d17f2560fa7c79d28a62c61e23d2ff53eaa6170..cd377c70361e59df08f80463d7624263f59a9a5c 100644 (file)
@@ -75,13 +75,13 @@ if ((isFormSent()) && (isPostRequestParameterSet('action')) && (isPostRequestPar
                        // Include link to stats
                        $content['views_total'] = '[<a href="{%url=modules.php?module=login&amp;what=surfbar_list%}">{%pipe,translateComma=' . $content['views_total'] . '%}</a>]';
                } // END - if
-               $content['url_registered']  = generateDateTime($content['url_registered'], 2);
-               $content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2);
+               $content['url_registered']  = generateDateTime($content['url_registered'], '2');
+               $content['url_last_locked'] = generateDateTime($content['url_last_locked'], '2');
                $content['actions']         = SURFBAR_MEMBER_ACTIONS($content['id'], $content['url_status']);
 
                // Load row template
                $OUT .= loadTemplate('member_surfbar_list_row', true, $content);
-       } // END - if
+       } // END - foreach
 
        // Load main template
        loadTemplate('member_surfbar_list', false, $OUT);
index 4cf55879756758e8146aad711a04519ce817c1e4..eeba4db76cad0d6327f1c39de93eae5f23938e0b 100644 (file)
@@ -1611,7 +1611,7 @@ function sendModeMails ($mod, $modes) {
 }
 
 // Generates a 'selection box' from given array
-function generateSelectionBoxFromArray (array $options, $name, $optionValue, $optionContent = '', $extraName = '') {
+function generateSelectionBoxFromArray ($options, $name, $optionValue, $optionContent = '', $extraName = '') {
        // Start the output
        $OUT = '<select name="' . $name . '" size="1" class="form_select">
 <option value="X" disabled="disabled">{--PLEASE_SELECT--}</option>';
index 00844537956bacb634ef375ee5479089473325bd..79de7cc685243746d32e20e3c09d934255e066b7 100644 (file)
@@ -2510,7 +2510,7 @@ function convertCommaToDotInPostData ($postEntry) {
 }
 
 // Converts German commas to Computer's version in all entries
-function convertCommaToDotInPostDataArray (array $postEntries) {
+function convertCommaToDotInPostDataArray ($postEntries) {
        // Replace german decimal comma with computer decimal dot
        foreach ($postEntries as $entry) {
                // Is the entry there?
index 94a9b6a0ed43f82e04506fdd51056054575456d8..04550bc6da6afa1f1901b1efb6bbd93ff1cdc5b4 100644 (file)
@@ -40,5 +40,161 @@ if (!defined('__SECURITY')) {
        die();
 } // END - if
 
+// Calls back a function based on given XML template data
+function showEntriesByXmlCallback ($template) {
+       // Generate FQFN for with special path
+       $FQFN = sprintf("%stemplates/xml/%s%s.xml",
+               getPath(),
+               detectExtraTemplatePath($template),
+               $template
+       );
+
+       // Is the file readable?
+       if (!isFileReadable($FQFN)) {
+               // No, use without extra path
+               $FQFN = sprintf("%stemplates/xml/%s.xml",
+                       getPath(),
+                       $template
+               );
+       } // END - if
+
+       // Is it again readable?
+       if (isFileReadable($FQFN)) {
+               // Read it
+               $templateContent = readFromFile($FQFN);
+
+               // Handle it over to the parser
+               parseXmlData($templateContent);
+
+               // Call the call-back function
+               doCallXmlCallbackFunction();
+       } else {
+               // Template not found
+               displayMessage('{%message,XML_TEMPLATE_404=' . $template . '%}');
+       }
+}
+
+// Parses the XML content
+function parseXmlData ($content) {
+       // Do we have recode?
+       if (function_exists('recode')) {
+               // Convert 'HTML' to UTF-8
+               $content = recode('html..utf8', $content);
+       } else {
+               // No fallback ATM
+               debug_report_bug('PHP extension recode is missing. Please install it.');
+       }
+
+       // Create a new XML parser
+       $xmlParser = xml_parser_create();
+
+       // Force case-folding to on
+       xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, true);
+
+       // Set UTF-8
+       xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, 'UTF-8');
+
+       // Set handler call-backs
+       xml_set_element_handler($xmlParser, 'startXmlElement', 'endXmlElement');
+       xml_set_character_data_handler($xmlParser, 'xmlCharacterHandler');
+
+       // Now parse the XML tree
+       if (!xml_parse($xmlParser, $content)) {
+               // Error found in XML!
+               //* DEBUG: */ die('<pre>'.htmlentities($content).'</pre>');
+               debug_report_bug(__FUNCTION__, __LINE__, 'Error found in XML. errorMessage=' . xml_error_string(xml_get_error_code($xmlParser)) . ', line=' . xml_get_current_line_number($xmlParser));
+       } // END - if
+
+       // Free the parser
+       xml_parser_free($xmlParser);
+}
+
+// Calls the found call-back function
+function doCallXmlCallbackFunction () {
+       // Loop through all added entries
+       foreach ($GLOBALS['__XML_CALLBACKS']['callbacks'] as $callback) {
+               // Do we have the entry?
+               if ((isset($GLOBALS['__XML_CALLBACKS']['functions'][$callback])) && (isset($GLOBALS['__XML_ARGUMENTS'][$callback]))) {
+                       // Run all function callbacks
+                       foreach ($GLOBALS['__XML_CALLBACKS']['functions'][$callback] as $function) {
+                               // Now construct the call-back function's name with 'Execute' at the end
+                               $callbackName = $callback . 'Execute';
+
+                               // Is it there?
+                               if (!function_exists($callbackName)) {
+                                       debug_report_bug(__FUNCTION__, __LINE__, 'callback=' . $callback . ',function=' . $function . 'arguments()=' . count($GLOBALS['__XML_ARGUMENTS'][$callback]) . ' - execute call-back not found.');
+                               } // END - if
+
+                               // Call it
+                               call_user_func_array($callbackName, array($function, $GLOBALS['__XML_ARGUMENTS'][$callback]));
+                       } // END - foreach
+               } else {
+                       // Not found
+                       debug_report_bug(__FUNCTION__, __LINE__, 'Entry in callbacks does exist, but not in functions, callback= ' . $callback);
+               }
+       } // END - foreach
+}
+
+// ----------------------------------------------------------------------------
+//                     Call-back functions for XML parser
+// ----------------------------------------------------------------------------
+
+// Starts an element
+function startXmlElement ($resource, $element, $attributes) {
+       // Call-back function for given element
+       $elementCallback = 'doXml' . capitalizeUnderscoreString($element);
+
+       // Is the call-back function there?
+       if (!function_exists($elementCallback)) {
+               // Not there
+               debug_report_bug(__FUNCTION__, __LINE__, 'Missing call-back function ' . $elementCallback . ', please add it.');
+       } // END - if
+
+       // Call the call-back function
+       call_user_func_array($elementCallback, array($resource, $attributes));
+}
+
+// Ends an element
+function endXmlElement ($resource, $element) {
+       // Out-of-function for now
+}
+
+// Handle characters
+function xmlCharacterHandler ($resource, $characters) {
+       // Trim spaces away
+       $characters = trim($characters);
+
+       // Do we have some to handle?
+       if (strlen($characters) == 0) {
+               // Nothing to handle
+               return;
+       } // END - if
+       die('characters[]='.strlen($characters));
+}
+
+// Checks if given type is valid, makes all lower-case
+function isInvalidXmlType ($type) {
+       // All lower-case
+       $type = strtolower(trim($type));
+
+       // Is it found?
+       return (in_array($type, array('string', 'array', 'bool')));
+}
+
+// Checks if given value is valid/verifyable
+function isXmlValueValid ($type, $value) {
+       // Depends on type, so build a call-back
+       $callbackFunction = 'isXmlType' . trim(capitalizeUnderscoreString($type));
+
+       // Is the call-back function there?
+       if (!function_exists($callbackFunction)) {
+               // Not there
+               debug_report_bug(__FUNCTION__, __LINE__, 'Missing call-back function ' . $callbackFunction . ', please add it.');
+       } // END - if
+
+       // Call and return it
+       return call_user_func_array($callbackFunction, array($value));
+}
+
 // [EOF]
 ?>
index 6a054adce14b324d7bde25f788b9a9901cd2ec56..11f5d85d80b1ca4d16cf4c19e14af24e5ec2a60f 100644 (file)
@@ -1,23 +1 @@
-<div align="center">
-<form accept-charset="UTF-8" action="{%url=modules.php?module=admin&amp;what=list_surfbar_urls%}" method="post">
-<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
-<tr>
-       <td align="center" colspan="3" class="table_header">
-               <strong>{--ADMIN_SURFBAR_DELETE_URLS_TITLE--}</strong>
-       </td>
-</tr>
-<tr>
-       <td class="header_column bottom right" align="center"><strong>{--_USERID--}</strong></td>
-       <td class="header_column bottom right" align="center"><strong>{--ADMIN_TEST_URL--}</strong></td>
-       <td class="header_column bottom" align="center"><strong>{--ADMIN_SURFBAR_REGISTERED--}</strong></td>
-</tr>
-$content
-<tr>
-       <td class="table_footer" colspan="3">
-               <input type="reset" class="form_reset" value="{--UNDO_SELECTIONS--}" />
-               <input type="submit" name="do_delete" class="form_delete" value="{--ADMIN_SURFBAR_DELETE_URL_NOW--}" />
-       </td>
-</tr>
-</table>
-</form>
-</div>
+<!-- @DEPRECATED //-->
index 55c0060e6813a0a7b4e2b174fa4557233ca08a8f..11f5d85d80b1ca4d16cf4c19e14af24e5ec2a60f 100644 (file)
@@ -1,13 +1 @@
-<tr>
-       <td align="center" class="bottom right {%template,ColorSwitch%}">
-               <input type="hidden" name="url_id[$content[url_id]]" value="1" />
-               <input type="hidden" name="url_userid[content[url_id]]" value="$content[url_userid_raw]" />
-               $content[url_userid]
-       </td>
-       <td align="center" class="bottom right {%template,ColorSwitch%}">
-               <a href="$content[url]" target="_blank" title="{--ADMIN_TEST_URL--}">{--ADMIN_TEST_URL--}</a>
-       </td>
-       <td align="center" class="bottom {%template,ColorSwitch%}">
-               $content[url_registered]
-       </td>
-</tr>
+<!-- @DEPRECATED //-->
diff --git a/templates/de/html/admin/admin_delete_surfbar_urls.tpl b/templates/de/html/admin/admin_delete_surfbar_urls.tpl
new file mode 100644 (file)
index 0000000..6a054ad
--- /dev/null
@@ -0,0 +1,23 @@
+<div align="center">
+<form accept-charset="UTF-8" action="{%url=modules.php?module=admin&amp;what=list_surfbar_urls%}" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
+<tr>
+       <td align="center" colspan="3" class="table_header">
+               <strong>{--ADMIN_SURFBAR_DELETE_URLS_TITLE--}</strong>
+       </td>
+</tr>
+<tr>
+       <td class="header_column bottom right" align="center"><strong>{--_USERID--}</strong></td>
+       <td class="header_column bottom right" align="center"><strong>{--ADMIN_TEST_URL--}</strong></td>
+       <td class="header_column bottom" align="center"><strong>{--ADMIN_SURFBAR_REGISTERED--}</strong></td>
+</tr>
+$content
+<tr>
+       <td class="table_footer" colspan="3">
+               <input type="reset" class="form_reset" value="{--UNDO_SELECTIONS--}" />
+               <input type="submit" name="do_delete" class="form_delete" value="{--ADMIN_SURFBAR_DELETE_URL_NOW--}" />
+       </td>
+</tr>
+</table>
+</form>
+</div>
diff --git a/templates/de/html/admin/admin_delete_surfbar_urls_row.tpl b/templates/de/html/admin/admin_delete_surfbar_urls_row.tpl
new file mode 100644 (file)
index 0000000..55c0060
--- /dev/null
@@ -0,0 +1,13 @@
+<tr>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               <input type="hidden" name="url_id[$content[url_id]]" value="1" />
+               <input type="hidden" name="url_userid[content[url_id]]" value="$content[url_userid_raw]" />
+               $content[url_userid]
+       </td>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               <a href="$content[url]" target="_blank" title="{--ADMIN_TEST_URL--}">{--ADMIN_TEST_URL--}</a>
+       </td>
+       <td align="center" class="bottom {%template,ColorSwitch%}">
+               $content[url_registered]
+       </td>
+</tr>
index f2dead389ec3333f54d25a1f026836592e769d76..cf9d4659c12f584987a53ea81df2bff22f3cf86f 100644 (file)
@@ -9,6 +9,6 @@
                $content[actions_action]
        </td>
        <td align="center" class="bottom {%template,ColorSwitch%}">
-               $content[actions_new_status]
+               {%pipe,translateSurfbarUrlStatus=$content[actions_new_status]%}
        </td>
 </tr>
index 98574d1ab7d2ba6d51b59023d3867cb5ede9be65..ce51f43919a80148c6ebbe8a50abcb64a8d1c471 100644 (file)
@@ -2,6 +2,6 @@
        <form accept-charset="UTF-8" action="{%url=modules.php?module=login&amp;what=surfbar_list%}" method="post">
                <input type="hidden" name="url_id" value="$content[url_id]" />
                <input type="hidden" name="action" value="$content[action]" />
-               <input type="submit" class="form_submit" name="ok" title="$content[title]" value="$content[submit]" />
+               <input type="submit" class="form_submit" name="ok" title="{%pipe,translateMemberSurfbarActionToTitle=$content[action]%}" value="{%pipe,translateMemberSurfbarActionToSubmit=$content[action]%}" />
        </form>
 </td>
index f73f4fa6e92abe65d50d24cccc9921f579a41239..96f2278405a010387d56efd768ba6b7f8469d7d2 100644 (file)
@@ -3,25 +3,25 @@
 <tr>
        <td id="surfbar_td">
                <div>
-               &raquo;<span id="surfbar_points">$content[xxx]</span> {?POINTS?} in
-               <span id="surfbar_counter" class="surfbar_counter">$content[xxx]</span>
-               <span id="surfbar_counter_word">Sekunden</span>&laquo;
-               &raquo;<span id="surfbar_reload">X</span> von
-               <span id="surfbar_max">X</span> im Reload&laquo;
+                       &raquo;<span id="surfbar_points">$content[xxx]</span> {?POINTS?} in
+                       <span id="surfbar_counter" class="surfbar_counter">$content[xxx]</span>
+                       <span id="surfbar_counter_word">Sekunden</span>&laquo;
+                       &raquo;<span id="surfbar_reload">X</span> von
+                       <span id="surfbar_max">X</span> im Reload&laquo;
                </div>
 
                <div>
-               &raquo;<a href="{%pipe,SURFBAR_GET_URL=$content[url_id]%}" target="_blank">Aktuelle Seite in neuem
-               Fenster &ouml;ffnen</a>&laquo;
-               <span id="surfbar_navi">[<a href="#" onclick="return startStopCounter();"
-                id="start">{--MEMBER_SURFBAR_ACTION_PAUSE_SUBMIT--}</a>|<a target="_parent"
-                href="{%url=login.php%}">Loginbereich</a>|<a target="_parent"
-                href="{%url=modules.php?module=login&amp;what=logout%}">Ausloggen</a>|<a
-                href="javascript:window.close()">Schliessen</a>]</span>
+                       &raquo;<a href="{%pipe,SURFBAR_GET_URL=$content[url_id]%}" target="_blank">Aktuelle Seite in neuem
+                       Fenster &ouml;ffnen</a>&laquo;
+                       <span id="surfbar_navi">[<a href="#" onclick="return startStopCounter();"
+                        id="start">{--MEMBER_SURFBAR_ACTION_PAUSE_SUBMIT--}</a>|<a target="_parent"
+                        href="{%url=login.php%}">Loginbereich</a>|<a target="_parent"
+                        href="{%url=modules.php?module=login&amp;what=logout%}">Ausloggen</a>|<a
+                        href="javascript:window.close()">Schliessen</a>]</span>
                </div>
 
                <div>
-               &raquo;{?MAIN_TITLE?} ist f&uuml;r den Inhalt nicht verantwortlich!&laquo;
+                       &raquo;{?MAIN_TITLE?} ist f&uuml;r den Inhalt nicht verantwortlich!&laquo;
                </div>
        </td>
 </tr>
index 044d5d5c389b9888c24acfbea2058f5fd71ebda8..11f5d85d80b1ca4d16cf4c19e14af24e5ec2a60f 100644 (file)
@@ -1,83 +1 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-This template provides meta data for doing edits on URLs of the surfbar in the admin
-area.
-
-@author                Roland Haeder <webmaster@mxchange.org>
-@version       0.2.1-FINAL
-@copyright     (c) 2003 - 2009 by Roland Haeder
-@copyright     (c) 2009 - 2011 by Mailer Developer Team
-@license       GNU GPL 2.0 or any newer version
-@link          http://www.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-entry-meta-data>
-       <!--
-       Call-back function which should all following parameter handled over
-       to. This will always be type of string but we like homogene XMLs.
-       //-->
-       <admin-callback-function type="string" value="adminDeleteEntriesConfirm" />
-       <!--
-       Array index from HTTP POST data array for identifying every data row
-       //-->
-       <post-data-identify-index type="string" value="url_id" />
-       <!--
-       Name of the database table where the entries should be read/write from/to.
-       //-->
-       <database-table type="string" value="surfbar_urls" />
-       <!--
-       The following three lists must have the same count of list entries, else an
-       error may occur.
-       //-->
-       <!--
-       And all column names to read/write, leave this list tag empty for all (*).
-       //-->
-       <database-column-list>
-       </database-column-list>
-       <!--
-       "Filter" call-back functions to call back for piping the fetched data
-       through (can be left empty, no call-back function will be called)
-       //-->
-       <callback-function-list>
-       </callback-function-list>
-       <!--
-       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
-       is provided, we have more than two parameters to handle over to the
-       call-back function. See function handleExtraValues() for details.
-       //-->
-       <extra-parameter-list>
-       </extra-parameter-list>
-       <!--
-       Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
-       //-->
-       <enable-modify-entries type="bool" value="true" />
-       <!--
-       The table column which should be taken for the ids (see first parameter).
-       This' type can again only be 'string' (remember why?).
-       //-->
-       <table-id-column type="string" value="url_id" />
-       <!--
-       The table column which should be taken for user ids
-       This' type can again only be 'string' (remember why?).
-       //-->
-       <table-userid-column type="string" value="url_userid" />
-       <!--
-       Raw userid column ($key) to skip which is always an invalid (?) entry
-       This' type can again only be 'string' (remember why?).
-       //-->
-       <raw-userid-column-key type="string" value="url_userid" />
-</admin-entry-meta-data>
+<!-- @DEPRECATED //-->
index d413c32efa9f72a969137fcf6856a21b94b0017b..11f5d85d80b1ca4d16cf4c19e14af24e5ec2a60f 100644 (file)
@@ -1,111 +1 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<!--
-This template provides meta data for deleting URLs of the surfbar in the admin
-area.
-
-@author                Roland Haeder <webmaster@mxchange.org>
-@version       0.2.1-FINAL
-@copyright     (c) 2003 - 2009 by Roland Haeder
-@copyright     (c) 2009 - 2011 by Mailer Developer Team
-@license       GNU GPL 2.0 or any newer version
-@link          http://www.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-entry-meta-data>
-       <!--
-       Call-back function which should all following parameter handled over
-       to. This will always be type of string but we like homogene XMLs.
-       //-->
-       <admin-callback-function type="string" value="adminDeleteEntriesConfirm" />
-       <!--
-       Array index from HTTP POST data array for identifying every data row
-       //-->
-       <post-data-identify-index type="string" value="url_id" />
-       <!--
-       Name of the database table where the entries should be read/write from/to.
-       //-->
-       <database-table type="string" value="surfbar_urls" />
-       <!--
-       The following three lists must have the same count of list entries, else an
-       error may occur.
-       //-->
-       <!--
-       And all column names to read/write, leave this list tag empty for all (*).
-       //-->
-       <database-column-list>
-               <!--
-               A column name list entry. The type is always string, or do you have
-               numerical column names?
-               //-->
-               <database-column-list-entry name="" type="string" value="url_id" />
-               <database-column-list-entry name="" type="string" value="url_userid" />
-               <database-column-list-entry name="" type="string" value="url" />
-               <database-column-list-entry name="" type="string" value="url_registered" />
-       </database-column-list>
-       <!--
-       "Filter" call-back functions to call back for piping the fetched data
-       through (can be left empty, no call-back function will be called)
-       //-->
-       <callback-function-list>
-               <!--
-               A call-back function list entry
-               //-->
-               <callback-function-list-entry name="" type="string" value="bigintval" />
-               <callback-function-list-entry name="" type="string" value="generateUserProfileLink" />
-               <callback-function-list-entry name="" type="string" value="generateFrametesterUrl" />
-               <callback-function-list-entry name="" type="string" value="" /> <!-- No callback function! //-->
-       </callback-function-list>
-       <!--
-       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
-       is provided, we have more than two parameters to handle over to the
-       call-back function. See function handleExtraValues() for details.
-       //-->
-       <extra-parameter-list>
-               <!--
-               A list entry for a single extra parameter. 'type' can now be: string,
-               int, float, bool, array. If the type 'array' is provided, the parser searches
-               for a tag called "extra-parameter-<value>-list(-entry)", by <value>
-               is the value from the 'value' attribute. Please check out the examples below.
-               //-->
-               <!--
-               A simple string example, int and float are similar.
-               //-->
-               <extra-parameter-list-entry name="" type="string" value="" />
-               <extra-parameter-list-entry name="" type="string" value="" />
-               <extra-parameter-list-entry name="" type="string" value="" />
-               <extra-parameter-list-entry name="" type="string" value="" />
-       </extra-parameter-list>
-       <!--
-       Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
-       //-->
-       <enable-modify-entries type="bool" value="false" />
-       <!--
-       The table column which should be taken for the ids (see first parameter).
-       This' type can again only be 'string' (remember why?).
-       //-->
-       <table-id-column type="string" value="url_id" />
-       <!--
-       The table column which should be taken for user ids
-       This' type can again only be 'string' (remember why?).
-       //-->
-       <table-userid-column type="string" value="url_userid" />
-       <!--
-       Raw userid column ($key) to skip which is always an invalid (?) entry
-       This' type can again only be 'string' (remember why?).
-       //-->
-       <raw-userid-column-key type="string" value="url_userid" />
-</admin-entry-meta-data>
+<!-- @DEPRECATED //-->
diff --git a/templates/xml/admin/admin_delete_do_surfbar_urls.xml b/templates/xml/admin/admin_delete_do_surfbar_urls.xml
new file mode 100644 (file)
index 0000000..6a53141
--- /dev/null
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for doing deletions on URLs of the surfbar in
+the admin area.
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2011 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          http://www.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-entry-meta-data>
+       <!--
+       Call-back function which should all following parameter handled over
+       to. This will always be type of string but we like homogene XMLs.
+       //-->
+       <admin-callback-function type="string" value="adminDeleteEntriesConfirm" />
+       <!--
+       Array index from HTTP POST data array for identifying every data row
+       //-->
+       <post-data-identify-index name="" type="string" value="url_id" />
+       <!--
+       Name of the database table where the entries should be read/write from/to.
+       //-->
+       <database-table name="" type="string" value="surfbar_urls" />
+       <!--
+       The following three lists must have the same count of list entries, else an
+       error may occur.
+       //-->
+       <!--
+       And all column names to read/write, leave this list tag empty for all (*).
+       //-->
+       <database-column-list>
+       </database-column-list>
+       <!--
+       "Filter" call-back functions to call back for piping the fetched data
+       through (can be left empty, no call-back function will be called)
+       //-->
+       <callback-function-list>
+       </callback-function-list>
+       <!--
+       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
+       is provided, we have more than two parameters to handle over to the
+       call-back function. See function handleExtraValues() for details.
+       //-->
+       <extra-parameter-list>
+       </extra-parameter-list>
+       <!--
+       Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+       //-->
+       <enable-modify-entries name="" type="bool" value="true" />
+       <!--
+       The table column which should be taken for the ids (see first parameter).
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-id-column name="" type="string" value="url_id" />
+       <!--
+       The table column which should be taken for user ids
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-userid-column name="" type="string" value="url_userid" />
+       <!--
+       Raw userid column ($key) to skip which is always an invalid (?) entry
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <raw-userid-column-key name="" type="string" value="url_userid" />
+</admin-entry-meta-data>
diff --git a/templates/xml/admin/admin_delete_show_surfbar_urls.xml b/templates/xml/admin/admin_delete_show_surfbar_urls.xml
new file mode 100644 (file)
index 0000000..6e32480
--- /dev/null
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for deleting URLs of the surfbar in the admin
+area.
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2011 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          http://www.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-entry-meta-data>
+       <!--
+       Call-back function which should all following parameter handled over
+       to. This will always be type of string but we like homogene XMLs.
+       //-->
+       <admin-callback-function type="string" value="adminDeleteEntriesConfirm" />
+       <!--
+       Array index from HTTP POST data array for identifying every data row
+       //-->
+       <post-data-identify-index name="" type="string" value="url_id" />
+       <!--
+       Name of the database table where the entries should be read/write from/to.
+       //-->
+       <database-table name="" type="string" value="surfbar_urls" />
+       <!--
+       The following three lists must have the same count of list entries, else an
+       error may occur.
+       //-->
+       <!--
+       And all column names to read/write, leave this list tag empty for all (*).
+       //-->
+       <database-column-list>
+               <!--
+               A column name list entry. The type is always string, or do you have
+               numerical column names?
+               //-->
+               <database-column-list-entry name="" type="string" value="url_id" />
+               <database-column-list-entry name="" type="string" value="url_userid" />
+               <database-column-list-entry name="" type="string" value="url" />
+               <database-column-list-entry name="" type="string" value="url_registered" />
+       </database-column-list>
+       <!--
+       "Filter" call-back functions to call back for piping the fetched data
+       through (can be left empty, no call-back function will be called)
+       //-->
+       <callback-function-list>
+               <!--
+               A call-back function list entry
+               //-->
+               <callback-function-list-entry name="" type="string" value="bigintval" />
+               <callback-function-list-entry name="" type="string" value="generateUserProfileLink" />
+               <callback-function-list-entry name="" type="string" value="generateFrametesterUrl" />
+               <callback-function-list-entry name="" type="string" value="" /> <!-- No callback function! //-->
+       </callback-function-list>
+       <!--
+       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
+       is provided, we have more than two parameters to handle over to the
+       call-back function. See function handleExtraValues() for details.
+       //-->
+       <extra-parameter-list>
+               <!--
+               A list entry for a single extra parameter. 'type' can now be: string,
+               int, float, bool, array. If the type 'array' is provided, the parser searches
+               for a tag called "extra-parameter-<value>-list(-entry)", by <value>
+               is the value from the 'value' attribute. Please check out the examples below.
+               //-->
+               <!--
+               A simple string example, int and float are similar.
+               //-->
+               <extra-parameter-list-entry name="" type="string" value="" />
+               <extra-parameter-list-entry name="" type="string" value="" />
+               <extra-parameter-list-entry name="" type="string" value="" />
+               <extra-parameter-list-entry name="" type="string" value="" />
+       </extra-parameter-list>
+       <!--
+       Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+       //-->
+       <enable-modify-entries name="" type="bool" value="false" />
+       <!--
+       The table column which should be taken for the ids (see first parameter).
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-id-column name="" type="string" value="url_id" />
+       <!--
+       The table column which should be taken for user ids
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-userid-column name="" type="string" value="url_userid" />
+       <!--
+       Raw userid column ($key) to skip which is always an invalid (?) entry
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <raw-userid-column-key name="" type="string" value="url_userid" />
+</admin-entry-meta-data>
index 368590c0b7bfc753226b397d4a90039706eb11f6..92ecc82f3851d9f5854e489d8e950e3b9b8bf650 100644 (file)
@@ -34,11 +34,11 @@ MA  02110-1301  USA
        <!--
        Array index from HTTP POST data array for identifying every data row
        //-->
-       <post-data-identify-index type="string" value="url_id" />
+       <post-data-identify-index name="" type="string" value="url_id" />
        <!--
        Name of the database table where the entries should be read/write from/to.
        //-->
-       <database-table type="string" value="surfbar_urls" />
+       <database-table name="" type="string" value="surfbar_urls" />
        <!--
        The following three lists must have the same count of list entries, else an
        error may occur.
@@ -64,20 +64,20 @@ MA  02110-1301  USA
        <!--
        Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
        //-->
-       <enable-modify-entries type="bool" value="true" />
+       <enable-modify-entries name="" type="bool" value="true" />
        <!--
        The table column which should be taken for the ids (see first parameter).
        This' type can again only be 'string' (remember why?).
        //-->
-       <table-id-column type="string" value="url_id" />
+       <table-id-column name="" type="string" value="url_id" />
        <!--
        The table column which should be taken for user ids
        This' type can again only be 'string' (remember why?).
        //-->
-       <table-userid-column type="string" value="url_userid" />
+       <table-userid-column name="" type="string" value="url_userid" />
        <!--
        Raw userid column ($key) to skip which is always an invalid (?) entry
        This' type can again only be 'string' (remember why?).
        //-->
-       <raw-userid-column-key type="string" value="url_userid" />
+       <raw-userid-column-key name="" type="string" value="url_userid" />
 </admin-entry-meta-data>
index e2d1f7e6de218477218682043d0569338d8ad805..7ab4786f2461a0bb46855327f7195fc22912ab20 100644 (file)
@@ -34,11 +34,11 @@ MA  02110-1301  USA
        <!--
        Array index from HTTP POST data array for identifying every data row
        //-->
-       <post-data-identify-index type="string" value="url_id" />
+       <post-data-identify-index name="" type="string" value="url_id" />
        <!--
        Name of the database table where the entries should be read/write from/to.
        //-->
-       <database-table type="string" value="surfbar_urls" />
+       <database-table name="" type="string" value="surfbar_urls" />
        <!--
        The following three lists must have the same count of list entries, else an
        error may occur.
@@ -52,7 +52,7 @@ MA  02110-1301  USA
                numerical column names?
                //-->
                <database-column-list-entry name="" type="string" value="url_id" />
-               <database-column-list-entry name="" type="string" value="url_userid" />
+               <database-column-list-entry name="member_list" type="string" value="url_userid" />
                <database-column-list-entry name="" type="string" value="url" />
        </database-column-list>
        <!--
@@ -64,7 +64,7 @@ MA  02110-1301  USA
                A call-back function list entry
                //-->
                <callback-function-list-entry name="" type="string" value="bigintval" />
-               <callback-function-list-entry name="" type="string" value="addMemberSelectionBox" />
+               <callback-function-list-entry name="member_list" type="string" value="addMemberSelectionBox" />
                <callback-function-list-entry name="" type="string" value="" /> <!-- No callback function! //-->
        </callback-function-list>
        <!--
@@ -80,7 +80,7 @@ MA  02110-1301  USA
                is the value from the 'value' attribute. Please check out the examples below.
                //-->
                <!--
-               A simple string example, int and float are similar.
+               Dummy entry
                //-->
                <extra-parameter-list-entry name="" type="string" value="" />
                <!--
@@ -102,31 +102,31 @@ MA  02110-1301  USA
                                The brackets [] are required for addMemberSelectionBox(),
                                please read there for details.
                                //-->
-                               <extra-parameter-member-list-entry name="" type="bool" value="url_userid[]" />
-                       </extra-parameter-bar-list>
+                               <extra-parameter-member-list-entry name="" type="string" value="url_userid[]" />
+                       </extra-parameter-member-list>
                </extra-parameter-list-entry>
                <!--
-               A simple string example, int and float are similar.
+               Dummy entry
                //-->
                <extra-parameter-list-entry name="" type="string" value="" />
        </extra-parameter-list>
        <!--
        Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
        //-->
-       <enable-modify-entries type="bool" value="false" />
+       <enable-modify-entries name="" type="bool" value="false" />
        <!--
        The table column which should be taken for the ids (see first parameter).
        This' type can again only be 'string' (remember why?).
        //-->
-       <table-id-column type="string" value="url_id" />
+       <table-id-column name="" type="string" value="url_id" />
        <!--
        The table column which should be taken for user ids
        This' type can again only be 'string' (remember why?).
        //-->
-       <table-userid-column type="string" value="url_userid" />
+       <table-userid-column name="" type="string" value="url_userid" />
        <!--
        Raw userid column ($key) to skip which is always an invalid (?) entry
        This' type can again only be 'string' (remember why?).
        //-->
-       <raw-userid-column-key type="string" value="url_userid" />
+       <raw-userid-column-key name="" type="string" value="url_userid" />
 </admin-entry-meta-data>
diff --git a/templates/xml/admin/admin_lock_do_surfbar_urls.xml b/templates/xml/admin/admin_lock_do_surfbar_urls.xml
new file mode 100644 (file)
index 0000000..f1dd012
--- /dev/null
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for doing un-/locking on URLs of the surfbar
+in the admin area.
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2011 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          http://www.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-entry-meta-data>
+       <!--
+       Call-back function which should all following parameter handled over
+       to. This will always be type of string but we like homogene XMLs.
+       //-->
+       <admin-callback-function type="string" value="adminLockEntriesConfirm" />
+       <!--
+       Array index from HTTP POST data array for identifying every data row
+       //-->
+       <post-data-identify-index name="" type="string" value="url_id" />
+       <!--
+       Name of the database table where the entries should be read/write from/to.
+       //-->
+       <database-table name="" type="string" value="surfbar_urls" />
+       <!--
+       The following three lists must have the same count of list entries, else an
+       error may occur.
+       //-->
+       <!--
+       And all column names to read/write, leave this list tag empty for all (*).
+       //-->
+       <database-column-list>
+       </database-column-list>
+       <!--
+       "Filter" call-back functions to call back for piping the fetched data
+       through (can be left empty, no call-back function will be called)
+       //-->
+       <callback-function-list>
+       </callback-function-list>
+       <!--
+       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
+       is provided, we have more than two parameters to handle over to the
+       call-back function. See function handleExtraValues() for details.
+       //-->
+       <extra-parameter-list>
+       </extra-parameter-list>
+       <!--
+       Informations for changing status
+       //-->
+       <status-change-column name="" type="string" value="url_status" />
+       <!--
+       Status change array.
+       //-->
+       <status-change-list>
+               <status-change-list-entry name="url_status" type="string" old="ACTIVE" value="LOCKED" />
+               <status-change-list-entry name="url_status" type="string" old="LOCKED" value="ACTIVE" />
+       </status-change-list>
+       <!--
+       Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+       //-->
+       <enable-modify-entries name="" type="bool" value="true" />
+       <!--
+       The table column which should be taken for the ids (see first parameter).
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-id-column name="" type="string" value="url_id" />
+       <!--
+       The table column which should be taken for user ids
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-userid-column name="" type="string" value="url_userid" />
+       <!--
+       Raw userid column ($key) to skip which is always an invalid (?) entry
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <raw-userid-column-key name="" type="string" value="url_userid" />
+</admin-entry-meta-data>
diff --git a/templates/xml/admin/admin_lock_show_surfbar_urls.xml b/templates/xml/admin/admin_lock_show_surfbar_urls.xml
new file mode 100644 (file)
index 0000000..490c69d
--- /dev/null
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for un-/locking URLs of the surfbar in the
+admin area.
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2011 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          http://www.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-entry-meta-data>
+       <!--
+       Call-back function which should all following parameter handled over
+       to. This will always be type of string but we like homogene XMLs.
+       //-->
+       <admin-callback-function type="string" value="adminLockEntriesConfirm" />
+       <!--
+       Array index from HTTP POST data array for identifying every data row
+       //-->
+       <post-data-identify-index name="" type="string" value="url_id" />
+       <!--
+       Name of the database table where the entries should be read/write from/to.
+       //-->
+       <database-table name="" type="string" value="surfbar_urls" />
+       <!--
+       The following three lists must have the same count of list entries, else an
+       error may occur.
+       //-->
+       <!--
+       And all column names to read/write, leave this list tag empty for all (*).
+       //-->
+       <database-column-list>
+               <!--
+               A column name list entry. The type is always string, or do you have
+               numerical column names?
+               //-->
+               <database-column-list-entry name="" type="string" value="url_id" />
+               <database-column-list-entry name="" type="string" value="url_userid" />
+               <database-column-list-entry name="" type="string" value="url" />
+               <database-column-list-entry name="" type="string" value="url_registered" />
+               <database-column-list-entry name="" type="string" value="url_status" />
+       </database-column-list>
+       <!--
+       "Filter" call-back functions to call back for piping the fetched data
+       through (can be left empty, no call-back function will be called)
+       //-->
+       <callback-function-list>
+               <!--
+               A call-back function list entry
+               //-->
+               <callback-function-list-entry name="" type="string" value="bigintval" />
+               <callback-function-list-entry name="" type="string" value="generateUserProfileLink" />
+               <callback-function-list-entry name="" type="string" value="generateFrametesterUrl" />
+               <callback-function-list-entry name="" type="string" value="" /> <!-- No callback function! //-->
+               <callback-function-list-entry name="" type="string" value="translateSurfbarUrlStatus" />
+       </callback-function-list>
+       <!--
+       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
+       is provided, we have more than two parameters to handle over to the
+       call-back function. See function handleExtraValues() for details.
+       //-->
+       <extra-parameter-list>
+               <!--
+               A list entry for a single extra parameter. 'type' can now be: string,
+               int, float, bool, array. If the type 'array' is provided, the parser searches
+               for a tag called "extra-parameter-<value>-list(-entry)", by <value>
+               is the value from the 'value' attribute. Please check out the examples below.
+               //-->
+               <!--
+               A simple string example, int and float are similar.
+               //-->
+               <extra-parameter-list-entry name="" type="string" value="" />
+               <extra-parameter-list-entry name="" type="string" value="" />
+               <extra-parameter-list-entry name="" type="string" value="" />
+               <extra-parameter-list-entry name="" type="string" value="" />
+               <extra-parameter-list-entry name="" type="string" value="" />
+       </extra-parameter-list>
+       <!--
+       Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+       //-->
+       <enable-modify-entries name="" type="bool" value="false" />
+       <!--
+       The table column which should be taken for the ids (see first parameter).
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-id-column name="" type="string" value="url_id" />
+       <!--
+       The table column which should be taken for user ids
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-userid-column name="" type="string" value="url_userid" />
+       <!--
+       Raw userid column ($key) to skip which is always an invalid (?) entry
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <raw-userid-column-key name="" type="string" value="url_userid" />
+</admin-entry-meta-data>
diff --git a/templates/xml/admin/admin_undelete_do_surfbar_urls.xml b/templates/xml/admin/admin_undelete_do_surfbar_urls.xml
new file mode 100644 (file)
index 0000000..0fdb6b6
--- /dev/null
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for doing undelete on URLs of the surfbar in
+the admin area.
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2011 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          http://www.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-entry-meta-data>
+       <!--
+       Call-back function which should all following parameter handled over
+       to. This will always be type of string but we like homogene XMLs.
+       //-->
+       <admin-callback-function type="string" value="adminUndeleteEntriesConfirm" />
+       <!--
+       Array index from HTTP POST data array for identifying every data row
+       //-->
+       <post-data-identify-index name="" type="string" value="url_id" />
+       <!--
+       Name of the database table where the entries should be read/write from/to.
+       //-->
+       <database-table name="" type="string" value="surfbar_urls" />
+       <!--
+       The following three lists must have the same count of list entries, else an
+       error may occur.
+       //-->
+       <!--
+       And all column names to read/write, leave this list tag empty for all (*).
+       //-->
+       <database-column-list>
+       </database-column-list>
+       <!--
+       "Filter" call-back functions to call back for piping the fetched data
+       through (can be left empty, no call-back function will be called)
+       //-->
+       <callback-function-list>
+       </callback-function-list>
+       <!--
+       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
+       is provided, we have more than two parameters to handle over to the
+       call-back function. See function handleExtraValues() for details.
+       //-->
+       <extra-parameter-list>
+       </extra-parameter-list>
+       <!--
+       Informations for changing status
+       //-->
+       <status-change-column name="" type="string" value="url_status" />
+       <!--
+       Status change array.
+       //-->
+       <status-change-list>
+               <status-change-list-entry name="url_status" type="string" old="DELETED" value="ACTIVE" />
+       </status-change-list>
+       <!--
+       Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+       //-->
+       <enable-modify-entries name="" type="bool" value="true" />
+       <!--
+       The table column which should be taken for the ids (see first parameter).
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-id-column name="" type="string" value="url_id" />
+       <!--
+       The table column which should be taken for user ids
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-userid-column name="" type="string" value="url_userid" />
+       <!--
+       Raw userid column ($key) to skip which is always an invalid (?) entry
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <raw-userid-column-key name="" type="string" value="url_userid" />
+</admin-entry-meta-data>
diff --git a/templates/xml/admin/admin_undelete_show_surfbar_urls.xml b/templates/xml/admin/admin_undelete_show_surfbar_urls.xml
new file mode 100644 (file)
index 0000000..d0f0f3a
--- /dev/null
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for undeleting URLs of the surfbar in the
+admin area.
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2011 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          http://www.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-entry-meta-data>
+       <!--
+       Call-back function which should all following parameter handled over
+       to. This will always be type of string but we like homogene XMLs.
+       //-->
+       <admin-callback-function type="string" value="adminUndeleteEntriesConfirm" />
+       <!--
+       Array index from HTTP POST data array for identifying every data row
+       //-->
+       <post-data-identify-index name="" type="string" value="url_id" />
+       <!--
+       Name of the database table where the entries should be read/write from/to.
+       //-->
+       <database-table name="" type="string" value="surfbar_urls" />
+       <!--
+       The following three lists must have the same count of list entries, else an
+       error may occur.
+       //-->
+       <!--
+       And all column names to read/write, leave this list tag empty for all (*).
+       //-->
+       <database-column-list>
+               <!--
+               A column name list entry. The type is always string, or do you have
+               numerical column names?
+               //-->
+               <database-column-list-entry name="" type="string" value="url_id" />
+               <database-column-list-entry name="" type="string" value="url_userid" />
+               <database-column-list-entry name="" type="string" value="url" />
+               <database-column-list-entry name="" type="string" value="url_registered" />
+               <database-column-list-entry name="" type="string" value="url_status" />
+       </database-column-list>
+       <!--
+       "Filter" call-back functions to call back for piping the fetched data
+       through (can be left empty, no call-back function will be called)
+       //-->
+       <callback-function-list>
+               <!--
+               A call-back function list entry
+               //-->
+               <callback-function-list-entry name="" type="string" value="bigintval" />
+               <callback-function-list-entry name="" type="string" value="generateUserProfileLink" />
+               <callback-function-list-entry name="" type="string" value="generateFrametesterUrl" />
+               <callback-function-list-entry name="" type="string" value="" /> <!-- No callback function! //-->
+               <callback-function-list-entry name="" type="string" value="translateSurfbarUrlStatus" />
+       </callback-function-list>
+       <!--
+       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
+       is provided, we have more than two parameters to handle over to the
+       call-back function. See function handleExtraValues() for details.
+       //-->
+       <extra-parameter-list>
+               <!--
+               A list entry for a single extra parameter. 'type' can now be: string,
+               int, float, bool, array. If the type 'array' is provided, the parser searches
+               for a tag called "extra-parameter-<value>-list(-entry)", by <value>
+               is the value from the 'value' attribute. Please check out the examples below.
+               //-->
+               <!--
+               A simple string example, int and float are similar.
+               //-->
+               <extra-parameter-list-entry name="" type="string" value="" />
+               <extra-parameter-list-entry name="" type="string" value="" />
+               <extra-parameter-list-entry name="" type="string" value="" />
+               <extra-parameter-list-entry name="" type="string" value="" />
+               <extra-parameter-list-entry name="" type="string" value="" />
+       </extra-parameter-list>
+       <!--
+       Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+       //-->
+       <enable-modify-entries name="" type="bool" value="false" />
+       <!--
+       The table column which should be taken for the ids (see first parameter).
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-id-column name="" type="string" value="url_id" />
+       <!--
+       The table column which should be taken for user ids
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-userid-column name="" type="string" value="url_userid" />
+       <!--
+       Raw userid column ($key) to skip which is always an invalid (?) entry
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <raw-userid-column-key name="" type="string" value="url_userid" />
+</admin-entry-meta-data>
index 632b23c2889736c03c9dc64a2419482b52a8f752..c517d7ac234e1ab798ea08b122697dd7808e5ae0 100644 (file)
@@ -31,16 +31,17 @@ MA  02110-1301  USA
        <!--
        Call-back function which should all following parameter handled over
        to. This will always be type of string but we like homogene XMLs.
+       Keep 'name' empty for numerical array indexes (array keys).
        //-->
        <admin-callback-function type="string" value="adminFooEntriesBar" />
        <!--
        Array index from HTTP POST data array for identifying every data row
        //-->
-       <post-data-identify-index type="string" value="id" />
+       <post-data-identify-index name="" type="string" value="id" />
        <!--
        Name of the database table where the entries should be read/write from/to.
        //-->
-       <database-table type="string" value="table_name" />
+       <database-table name="" type="string" value="table_name" />
        <!--
        The following three lists must have the same count of list entries, else an
        error may occur.
@@ -53,7 +54,7 @@ MA  02110-1301  USA
                A column name list entry. The type is always string, or do you have
                numerical column names?
                //-->
-               <database-column-list-entry type="string" value="foo" />
+               <database-column-list-entry name="" type="string" value="foo" />
        </database-column-list>
        <!--
        "Filter" call-back functions to call back for piping the fetched data
@@ -63,7 +64,7 @@ MA  02110-1301  USA
                <!--
                A call-back function list entry
                //-->
-               <callback-function-list-entry type="string" value="someFooCallback" />
+               <callback-function-list-entry name="" type="string" value="someFooCallback" />
        </callback-function-list>
        <!--
        Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
@@ -76,8 +77,9 @@ MA  02110-1301  USA
                int, float, bool, array. If the type 'array' is provided, the parser
                searches for a tag called "extra-parameter-<value>-list(-entry)", by
                <value> is the value from the 'value' attribute. Please check out the
-               examples below.
-               Keep 'name' empty for numerical array indexes (array keys).
+               examples below. In addition to that you need to maintain <value>_list
+               in all corresponding elements, see admin_edit_show_surfbar_urls.xml for
+               an example.
                //-->
                <!--
                A simple string example with a numerical index, int and float are similar.
@@ -110,20 +112,20 @@ MA  02110-1301  USA
        <!--
        Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
        //-->
-       <enable-modify-entries type="bool" value="false" />
+       <enable-modify-entries name="" type="bool" value="false" />
        <!--
        The table column which should be taken for the ids (see first parameter).
        This' type can again only be 'string' (remember why?).
        //-->
-       <table-id-column type="string" value="id" />
+       <table-id-column name="" type="string" value="id" />
        <!--
        The table column which should be taken for user ids
        This' type can again only be 'string' (remember why?).
        //-->
-       <table-userid-column type="string" value="userid" />
+       <table-userid-column name="" type="string" value="userid" />
        <!--
        Raw userid column ($key) to skip which is always an invalid (?) entry
        This' type can again only be 'string' (remember why?).
        //-->
-       <raw-userid-column-key type="string" value="userid" />
+       <raw-userid-column-key name="" type="string" value="userid" />
 </admin-entry-meta-data>