- // List for confirmation
- foreach ($IDs as $id => $selected) {
- // Secure ID number
- $id = bigintval($id);
-
- // Will always be 1 ;-)
- if ($selected == 1) {
- // Get result from a given column array and table name
- $result = SQL_RESULT_FROM_ARRAY($table, $columns, $idRow, $id);
-
- // Is there one entry?
- if (SQL_NUMROWS($result) == 1) {
- // Load all data
- $content = SQL_FETCHARRAY($result);
-
- // Filter all data
- foreach ($content as $key=>$value) {
- // Is a filter function set?
- $idx = array_search($key, $columns, true);
- if (!empty($filterFunctions[$idx])) {
- // Then call it!
- $content[$key] = call_user_func($filterFunctions[$idx], $value);
- }
- }
+ $mail = LOAD_EMAIL_TEMPLATE("member_".$mode."_".$table, $content);
+ }
+
+ // Send email out
+ SEND_EMAIL(REQUEST_POST('uid_raw', $id), $subjectLine, $mail);
+ } // END - if
+
+ // Generate subject
+ $subjectLine = constant('ADMIN_'.strtoupper($subject).'_'.strtoupper($table).'_SUBJECT');
+
+ // Send admin notification out
+ if (!empty($subjectPart)) {
+ SEND_ADMIN_NOTIFICATION($subjectLine, "admin_".$mode."_".strtolower($subjectPart)."_".$table, $content, REQUEST_POST('uid_raw', $id));
+ } else {
+ SEND_ADMIN_NOTIFICATION($subjectLine, "admin_".$mode."_".$table, $content, REQUEST_POST('uid_raw', $id));
+ }
+}
+
+// Build a special template list
+function ADMIN_BUILD_LIST ($listType, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn) {
+ $OUT = ""; $SW = 2;
+
+ // "Walk" through all entries
+ foreach ($IDs as $id => $selected) {
+ // Secure ID number
+ $id = bigintval($id);
+
+ // Get result from a given column array and table name
+ $result = SQL_RESULT_FROM_ARRAY($table, $columns, $idColumn, $id, __FUNCTION__, __LINE__);
+
+ // Is there one entry?
+ if (SQL_NUMROWS($result) == 1) {
+ // Load all data
+ $content = SQL_FETCHARRAY($result);
+
+ // Filter all data
+ foreach ($content as $key => $value) {
+ // Search index
+ $idx = array_search($key, $columns, true);
+
+ // Do we have a userid?
+ if ($key == "userid") {
+ // Add it again as raw id
+ $content['uid'] = bigintval($value);
+ } // END - if
+
+ // Handle the call in external function
+ $content[$key] = HANDLE_EXTRA_VALUES($filterFunctions[$idx], $value, $extraValues[$idx]);
+ } // END - foreach
+
+ // Add color switching
+ $content['sw'] = $SW;
+
+ // Then list it
+ $OUT .= LOAD_TEMPLATE(sprintf("admin_%s_%s_row",
+ $listType,
+ $table
+ ), true, $content
+ );
+
+ // Switch color
+ $SW = 3 - $SW;
+ } // END - if
+
+ // Free the result
+ SQL_FREERESULT($result);
+ } // END - foreach
+
+ // Load master template
+ LOAD_TEMPLATE(sprintf("admin_%s_%s",
+ $listType,
+ $table
+ ), false, $OUT
+ );
+}