die();
} // END - if
+// Handle a (maybe) sent form here
+function doNetworkHandleForm () {
+ // Was the form sent?
+ if ((isFormSent()) || (isPostRequestElementSet('edit')) || (isPostRequestElementSet('del')) || (isPostRequestElementSet('change')) || (isPostRequestElementSet('remove'))) {
+ // Do we have a 'do'?
+ if (isGetRequestElementSet('do')) {
+ // Process the request
+ doAdminNetworkProcessForm();
+ } else {
+ // No 'do' found
+ loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NETWORK_DO_404'));
+ }
+ } // END - if
+}
+
// Processes an admin form
function doAdminNetworkProcessForm () {
// Form really sent?
// Is the function valid?
if (!function_exists($functionName)) {
// Invalid function name
- debug_report_bug('Invalid do ' . getRequestElement('do') . ', function ' . $functionName .' does not exist.');
+ debug_report_bug('Invalid do ' . getRequestElement('do') . ', function ' . $functionName .' does not exist.', false);
} // END - if
// Call-back the method handling our request
return SQL_AFFECTEDROWS();
}
+// Generates a list of networks for given script and returns it
+function generateAdminNetworkList () {
+ // Init output
+ $content = '';
+
+ // Query for all networks
+ $result = SQL_QUERY("SELECT
+ `network_id`, `network_title`
+FROM
+ `{?_MYSQL_PREFIX?}_network_data`
+ORDER BY
+ `network_title` ASC", __FILE__, __LINE__);
+
+ // Do we have entries?
+ if (SQL_NUMROWS($result) > 0) {
+ // List all entries
+ $rows = array();
+ while ($row = SQL_FETCHARRAY($result)) {
+ // Is this valid, then add it
+ if ((is_array($row)) && (isset($row['network_id']))) $rows[] = $row;
+ } // END - while
+
+ // Generate the selection box
+ $content = generateSelectionBoxFromArray($rows, 'network', 'network_id', 'network_title');
+ } else {
+ // Nothing selected
+ $content = loadTemplate('admin_settings_saved', false, getMessage('ADMIN_ENTRIES_404'));
+ }
+
+ // Free the result
+ SQL_FREERESULT($result);
+
+ // Return the list
+ return $content;
+}
+
//------------------------------------------------------------------------------
// Call-back functions
//------------------------------------------------------------------------------