+// Handle network type form
+function doAdminNetworkProcessHandlenetworktypeForm () {
+ // Do we have selections?
+ if (countPostSelection() > 0) {
+ // Load network data
+ $networkData = getNetworkDataById(getRequestElement('network'));
+
+ // Something has been selected, so start displaying one by one
+ $SW = 2; $OUT = '';
+ foreach (postRequestElement('sel') as $id => $sel) {
+ // Is this selected?
+ if ($sel == 1) {
+ // Load this network's data
+ $networkTypeData = getNetworkTypeDataById($id);
+
+ // Do we have found the network?
+ if (count($networkTypeData) > 0) {
+ // Add color
+ $networkTypeData['sw'] = $SW;
+
+ if (isPostRequestElementSet('edit')) {
+ // Add row template for deleting
+ $OUT .= loadTemplate('admin_edit_network_types_row', true, $networkTypeData);
+ } elseif (isPostRequestElementSet('del')) {
+ // Add row template for deleting
+ $OUT .= loadTemplate('admin_del_network_types_row', true, $networkTypeData);
+ } else {
+ // Problem!
+ debug_report_bug('Cannot detect edit/del.');
+ }
+
+ // Switch colors
+ $SW = 3 - $SW;
+ } // END - if
+ } // END - if
+ } // END - foreach
+
+ // If we have no rows, we don't need to display the edit form
+ if (!empty($OUT)) {
+ // Prepare content for template
+ $content = array(
+ 'rows' => $OUT,
+ 'network_data' => getNetworkDataById(getRequestElement('network'))
+ );
+
+ // Output main template
+ if (isPostRequestElementSet('edit')) {
+ loadTemplate('admin_edit_network_types', false, $content);
+ } elseif (isPostRequestElementSet('del')) {
+ loadTemplate('admin_del_network_types', false, $content);
+ } else {
+ // Problem!
+ debug_report_bug('Cannot detect edit/del.');
+ }
+
+ // Don't display the list/add new form
+ $GLOBALS['network_display'] = false;
+ } else {
+ // Nothing selected/found
+ loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NETWORK_TYPE_NOTHING_FOUND'));
+ }
+ } // END - if
+}
+