]> git.mxchange.org Git - mailer.git/commitdiff
Swapped out a large number of parameters to an XML construct. The previous commit...
authorRoland Häder <roland@mxchange.org>
Thu, 27 Jan 2011 03:40:54 +0000 (03:40 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 27 Jan 2011 03:40:54 +0000 (03:40 +0000)
.gitattributes
inc/modules/admin/what-list_surfbar_urls.php
templates/xml/admin/admin_del_do_surfbar_urls.xml [new file with mode: 0644]
templates/xml/admin/admin_del_show_surfbar_urls.xml [new file with mode: 0644]
templates/xml/admin/admin_edit_do_surfbar_urls.xml [new file with mode: 0644]
templates/xml/admin/admin_edit_show_surfbar_urls.xml
templates/xml/admin_data_template.xml

index b952308b96bf6b9201b74a1a3b2fa32d8df3a301..fb1bd746f2a85d30cff1797f2900f39155f9d23f 100644 (file)
@@ -1777,6 +1777,9 @@ templates/en/html/register_header.tpl -text svneol=unset#text/plain
 templates/en/html/welcome.tpl -text svneol=unset#text/plain
 templates/xml/.htaccess svneol=native#text/plain
 templates/xml/admin/.htaccess svneol=native#text/plain
+templates/xml/admin/admin_del_do_surfbar_urls.xml -text
+templates/xml/admin/admin_del_show_surfbar_urls.xml -text
+templates/xml/admin/admin_edit_do_surfbar_urls.xml -text
 templates/xml/admin/admin_edit_show_surfbar_urls.xml -text
 templates/xml/admin_data_template.xml -text
 templates/xml/template.xml -text
index d2163ad8f78949237623cc5dbef7a3c51d5646b7..0852fc1d5be3cafc2a1476a75679c53929790f5d 100644 (file)
@@ -64,59 +64,16 @@ if (isFormSent('edit')) {
        $show = false;
 } elseif (isFormSent('do_edit')) {
        // Change data of entries
-       adminEditEntriesConfirm(
-               postRequestParameter('url_id'),
-               'surfbar_urls',
-               array(),
-               array(),
-               array(),
-               true,
-               'url_id',
-               'url_userid',
-               'url_userid'
-       );
+       showEntriesByXmlCallback('admin_edit_do_surfbar_urls');
 } elseif (isFormSent('delete')) {
        // Show entries for deletion
-       adminDeleteEntriesConfirm(
-               postRequestParameter('url_id'),
-               'surfbar_urls',
-               array(
-                       'url_id',
-                       'url_userid',
-                       'url',
-                       'url_registered'
-               ),
-               array(
-                       'bigintval',
-                       'generateUserProfileLink',
-                       'generateFrametesterUrl',
-                       ''
-               ),
-               array(
-                       '',
-                       '',
-                       '',
-                       ''
-               ),
-               false,
-               'url_id',
-               'url_userid',
-               'url_userid'
-       );
+       showEntriesByXmlCallback('admin_del_show_surfbar_urls');
 
        // Do not show the list of URLs after this template
        $show = false;
 } elseif (isFormSent('do_delete')) {
        // Remove entries from database
-       adminDeleteEntriesConfirm(
-               postRequestParameter('url_id'),
-               'surfbar_urls',
-               array(),
-               array(),
-               array(),
-               true,
-               'url_id'
-       );
+       showEntriesByXmlCallback('admin_del_do_surfbar_urls');
 } elseif (isFormSent('lock')) {
        // Un-/lock selected URLs. This does not work for pending URLs
        adminLockEntriesConfirm(
diff --git a/templates/xml/admin/admin_del_do_surfbar_urls.xml b/templates/xml/admin/admin_del_do_surfbar_urls.xml
new file mode 100644 (file)
index 0000000..044d5d5
--- /dev/null
@@ -0,0 +1,83 @@
+<?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>
diff --git a/templates/xml/admin/admin_del_show_surfbar_urls.xml b/templates/xml/admin/admin_del_show_surfbar_urls.xml
new file mode 100644 (file)
index 0000000..d413c32
--- /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 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>
diff --git a/templates/xml/admin/admin_edit_do_surfbar_urls.xml b/templates/xml/admin/admin_edit_do_surfbar_urls.xml
new file mode 100644 (file)
index 0000000..368590c
--- /dev/null
@@ -0,0 +1,83 @@
+<?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="adminEditEntriesConfirm" />
+       <!--
+       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>
index b4230ab3e7b7395f764ed600040f5efc65497d29..e2d1f7e6de218477218682043d0569338d8ad805 100644 (file)
@@ -51,9 +51,9 @@ 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="url_id" />
-               <database-column-list-entry type="string" value="url_userid" />
-               <database-column-list-entry type="string" value="url" />
+               <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>
        <!--
        "Filter" call-back functions to call back for piping the fetched data
@@ -63,9 +63,9 @@ MA  02110-1301  USA
                <!--
                A call-back function list entry
                //-->
-               <callback-function-list-entry type="string" value="bigintval" />
-               <callback-function-list-entry type="string" value="addMemberSelectionBox" />
-               <callback-function-list-entry type="string" value="" /> <!-- No callback function! //-->
+               <callback-function-list-entry name="" type="string" value="bigintval" />
+               <callback-function-list-entry name="" type="string" value="addMemberSelectionBox" />
+               <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
@@ -82,11 +82,11 @@ MA  02110-1301  USA
                <!--
                A simple string example, int and float are similar.
                //-->
-               <extra-parameter-list-entry type="string" value="" />
+               <extra-parameter-list-entry name="" type="string" value="" />
                <!--
                A one-dimensional array with some entries
                //-->
-               <extra-parameter-list-entry type="array" value="member">
+               <extra-parameter-list-entry name="" type="array" value="member">
                        <!--
                        Our 'member' array
                        //-->
@@ -95,20 +95,20 @@ MA  02110-1301  USA
                                A bool entry in the 'bar' array, all other types are added in a
                                similar way.
                                //-->
-                               <extra-parameter-member-list-entry type="bool" value="false" />
-                               <extra-parameter-member-list-entry type="bool" value="true" />
-                               <extra-parameter-member-list-entry type="bool" value="true" />
+                               <extra-parameter-member-list-entry name="" type="bool" value="false" />
+                               <extra-parameter-member-list-entry name="" type="bool" value="true" />
+                               <extra-parameter-member-list-entry name="" type="bool" value="true" />
                                <!--
                                The brackets [] are required for addMemberSelectionBox(),
                                please read there for details.
                                //-->
-                               <extra-parameter-member-list-entry type="bool" value="url_userid[]" />
+                               <extra-parameter-member-list-entry name="" type="bool" value="url_userid[]" />
                        </extra-parameter-bar-list>
                </extra-parameter-list-entry>
                <!--
                A simple string example, int and float are similar.
                //-->
-               <extra-parameter-list-entry 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)
index a1639cb5807f3c766c9c99fa25f018f8c269d377..632b23c2889736c03c9dc64a2419482b52a8f752 100644 (file)
@@ -73,31 +73,37 @@ MA  02110-1301  USA
        <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.
+               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).
                //-->
                <!--
-               A simple string example, int and float are similar.
+               A simple string example with a numerical index, int and float are similar.
                //-->
-               <extra-parameter-list-entry type="string" value="foo" />
+               <extra-parameter-list-entry name="" type="string" value="foo" />
                <!--
-               A simple bool example, value can only be 'false' or 'true'
+               A simple bool example with a numerical index, value can only be 'false' or 'true'
                //-->
-               <extra-parameter-list-entry type="bool" value="false" />
+               <extra-parameter-list-entry name="" type="bool" value="false" />
                <!--
-               A one-dimensional array with some entries
+               A one-dimensional array with a numerical index and with some entries
                //-->
-               <extra-parameter-list-entry type="array" value="bar">
+               <extra-parameter-list-entry name="" type="array" value="bar">
                        <!--
                        Our 'bar' array
                        //-->
                        <extra-parameter-bar-list>
                                <!--
-                               A bool entry in the 'bar' array, all other types are added in a
-                               similar way.
+                               A bool entry with a numerical index in the 'bar' array, all
+                               other types are added in a similar way.
                                //-->
-                               <extra-parameter-bar-list-entry type="bool" value="true" />
+                               <extra-parameter-bar-list-entry name="" type="bool" value="true" />
+                               <!--
+                               A float entry with a alpha-numerical index in the 'bar' array.
+                               //-->
+                               <extra-parameter-bar-list-entry name="my_key" type="float" value="1.2345" />
                        </extra-parameter-bar-list>
                </extra-parameter-list-entry>
        </extra-parameter-list>