Even more www. removed
[mailer.git] / templates / xml / admin_list_data_template.xml
1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!--
3 This template is for other "list templates" and serves aas an example and most
4 of it is not yet implemented (e.g. the table join part).
5
6 @author         Roland Haeder <webmaster@mxchange.org>
7 @version        0.2.1-FINAL
8 @copyright      (c) 2003 - 2009 by Roland Haeder
9 @copyright      (c) 2009 - 2011 by Mailer Developer Team
10 @license        GNU GPL 2.0 or any newer version
11 @link           http://mxchange.org
12
13 This program is free software; you can redistribute it and/or modify
14 it under the terms of the GNU General Public License as published by
15 the Free Software Foundation; either version 2 of the License, or
16 (at your option) any later version.
17
18 This program is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 GNU General Public License for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, write to the Free Software
25 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
26 MA  02110-1301  USA
27 //-->
28 <admin-list-data>
29         <!--
30         Call-back function, the extracted data from this XML will then be re-read
31         from that function. The most common function this XML uses is
32         adminListEntries() so mostly you can leave this alone unless you have JOINs.
33         Use adminListJoinEntries for JOINs:
34         //-->
35         <callback-function type="string" value="adminListEntries" />
36         <!--
37         //-->
38         <!--
39         Now we need information which template should be loaded and which functions
40         shall be called back. So lets start with the main list template. This mostly
41         requires no call-back function.
42         //-->
43         <list-template type="string" value="admin_list_foo_data" />
44         <!--
45         The template for all rows, mostly this name has a '_row' suffix and again,
46         no call-back function is usually required.
47         //-->
48         <list-row-template type="string" value="admin_list_foo_data_row" />
49         <!--
50         Message id to display if no entry could be found
51         //-->
52         <no-entry-found-message type="string" value="ADMIN_FOO_404" />
53         <!--
54         The table(s) we shall grab the data from, all as list.
55         //-->
56         <data-tables>
57                 <!--
58                 A single table entry, with alias and without the configurable
59                 _MYSQL_PREFIX. You can specify the table's name or alias later on.
60                 //-->
61                 <data-table type="string" alias="dt" value="data_table" />
62                 <!--
63                 A join condition to merge data from two or more tables, leave out
64                 if you want to do simple SELECTs.
65                 //-->
66                 <table-join-condition>
67                         <!--
68                         The joining type, can be any valid SQL statement. Here it is an
69                         INNER JOIN (from both tables the data must exist).
70                         //-->
71                         <table-join-type type="INNER JOIN" />
72                         <!--
73                         Name (and alias) of the table we want to join
74                         //-->
75                         <table-join-name name="foo_data" alias="fd" />
76                         <!--
77                         On which condition these tables should join
78                         //-->
79                         <join-on>
80                                 <!--
81                                 The left table, name can also be an alias, column is the column
82                                 of the left table.
83                                 //-->
84                                 <join-on-left-table type="string" name="dt" column="userid" />
85                                 <!--
86                                 Condition how these two tables should be joined.
87                                 //-->
88                                 <join-on-condition type="string" conditiion="EQUALS" />
89                                 <!--
90                                 And the corresponding right part.
91                                 //-->
92                                 <join-on-right-table type="string" name="fd" column="foo_userid" />
93                         </join-on>
94                 </table-join-condition>
95                 <!--
96                 Columns to perform the SELECT statement on, with alias and name plus which table.
97                 //-->
98                 <select-data-from-list>
99                         <!--
100                         A single entry with table name (can be left empty), value (must
101                         always be set), alias (again can be left empty) and SQL function
102                         (can also be left empty) which shall be applied on the column.
103                         //-->
104                         <select-data-from-list-entry type="string" table="dt" value="gender" alias="" function="" />
105                         <select-data-from-list-entry type="string" table="dt" value="surname" alias="" function="" />
106                         <select-data-from-list-entry type="string" table="dt" value="family" alias="" function="" />
107                         <select-data-from-list-entry type="string" table="dt" value="last_online" alias="" function="" />
108                 </select-data-from-list>
109                 <!--
110                 And the column list to perform the WHERE statement on.
111                 //-->
112                 <where-select-from-list>
113                         <!--
114                         A single entry to perform the WHERE statement on:
115                         - table     = table name (or alias)
116                         - value     = column name
117                         - condition = look-up condition
118                         - look-for  = What to look for
119                         //-->
120                         <where-select-from-list-entry type="string" table="dt" value="userid" condition="EQUALS" look-for="$userid" />
121                         <!--
122                         How the next described column shall be logical linked to the above.
123                         //-->
124                         <where-condition type="string" condition="AND" />
125                         <!--
126                         The second column to perform the WHERE statement on. NOT-EQUALS is an alias for '!='.
127                         //-->
128                         <where-select-from-list-entry type="string" table="dt" name="status" condition="NOT-EQUALS" look-for="CONFIRMED" />
129                 </where-select-from-list>
130                 <!--
131                 Columns to perform the ORDER BY statement (GROUP BY is not yet supported)
132                 //-->
133                 <order-by-list>
134                         <!--
135                         A isingle entry to perform the ORDER BY statement on, see above WHERE entry for details.
136                         //-->
137                         <order-by-list-entry type="string" table="dt" order="userid" value="ASC" />
138                         <!--
139                         ORDER BY does also support more than one column, so we allow it here, too
140                         //-->
141                         <order-by-list-entry type="string" table="dt" order="foo_column" value="DESC" />
142                 </order-by-list>
143         </data-tables>
144         <!--
145         List all column names from the 'select-data-from-list' node here, but now
146         with call-back informations. The list must only contain those entries where
147         a call-back function shall be called for.
148         //-->
149         <column-callback-list>
150                 <!--
151                 A single entry for call-back informations. In this example we want to
152                 "translate" the gender information into human-readable.
153                 //-->
154                 <column-callback-list-entry>
155                         <!--
156                         The actual data.
157                         //-->
158                         <column-callback-data type="string" value="gender" callback="translateGender" />
159                 </column-callback-list-entry>
160                 <!--
161                 Another column, now we need a second parameter here because
162                 generateDateTime() expects two parameters (first is always the data
163                 from column).
164                 //-->
165                 <column-callback-list-entry>
166                         <!--
167                         The actual data, again.
168                         //-->
169                         <column-callback-data type="string" value="last_online" callback="generateDateTime" />
170                         <!--
171                         More parameters, remember that the first parameter is always given
172                         and that it is the data from column.
173                         //-->
174                         <callback-extra-parameter-list>
175                                 <!--
176                                 A single parameter, 'type' can be one of 'float', 'int',
177                                 'bool', 'string'. 'array' is not yet supported.
178                                 //-->
179                                 <callback-extra-parameter-list-entry type="int" column="last_online" value="2" />
180                         </callback-extra-parameter-list>
181                 </column-callback-list-entry>
182         </column-callback-list>
183 </admin-list-data>