templates/de/html/admin/admin_del_email_bonus.tpl -text
templates/de/html/admin/admin_del_email_normal.tpl -text
templates/de/html/admin/admin_del_email_notify.tpl -text
+templates/de/html/admin/admin_del_networks.tpl -text
+templates/de/html/admin/admin_del_networks_row.tpl -text
templates/de/html/admin/admin_del_payments.tpl -text
templates/de/html/admin/admin_del_payments_row.tpl -text
templates/de/html/admin/admin_del_sponsor.tpl -text
'ADMIN_NETWORK_DO_404' => "Es wurde der Parameter 'do' nicht übermittelt.",
'ADMIN_NETWORK_FORM_NOT_SENT' => "Es wurde kein bekanntes Formular versendet.",
'ADMIN_NETWORK_NOTHING_FOUND' => "Es wurden keine Daten zum Editieren oder Löschen gefunden.",
+ 'ADMIN_NETWORK_NOTHING_CHANGED' => "Es wurden keine Änderungen an den allgemeinen Daten ausgeführt.",
// - Form titles
'ADMIN_NETWORK_ADD_TITLE' => "Neues Werbenetzwerk hinzufügen - Allgemeine Daten",
'ADMIN_NETWORK_EDIT_TITLE' => "Werbenetzwerk editieren - Allgemeine Daten",
+ 'ADMIN_NETWORK_DELETE_TITLE' => "Werbenetzwerk löschen - Allgemeine Daten",
// - Link titles
'ADMIN_NETWORK_LIST_TYPES_LINK_TITLE' => "Weiter zu den Werbearten",
'ADMIN_NETWORK_LIST_PARAMS_LINK_TITLE' => "Weiter zu den Abfrageparametern",
'ADMIN_NETWORK_EDIT' => "Editieren",
'ADMIN_NETWORK_CHANGE' => "Daten ändern",
'ADMIN_NETWORK_DELETE' => "Löschen",
+ 'ADMIN_NETWORK_REMOVE' => "Daten entfernen",
+ // - Success nots
+ 'ADMIN_NETWORK_UPDATED' => "Es wurden <span class=\"data\">%s</span> Einträge in den allgemeinen Daten aktualisiert.",
// - Sponsor networks
'ADMIN_NETWORK_NONE_SUPPORTED' => "Es sind noch keine Werbenetzwerke eingerichtet.",
'ADMIN_NETWORK_SHORT_NAME' => "Kurzname",
return $networkData;
}
+// Updates given network (id) with data from array
+function doNetworkUpdateDataByArray ($id, $networkData) {
+ // Ids lower one are not accepted
+ if ($id < 1) {
+ // Not good, should be fixed
+ debug_report_bug('Network id ' . $id . ' is smaller than 1.');
+ } // END - if
+
+ // Just call our inner method
+ return adminSaveSettings($networkData, '_network_data', sprintf("`network_id`=%s", bigintval($id)), array(), false, false);
+}
+
//------------------------------------------------------------------------------
// Call-back functions
//------------------------------------------------------------------------------
// Add color
$networkData['sw'] = $SW;
- // Make selection box for network_request_type
- $networkData['network_request_type'] = generateOptionList(
- '/ARRAY/',
- array('GET','POST'),
- array(getMessage('ADMIN_NETWORK_REQUEST_TYPE_GET'), getMessage('ADMIN_NETWORK_REQUEST_TYPE_POST')),
- $networkData['network_request_type']
- );
+ if (isPostRequestElementSet('edit')) {
+ // Make selection box for network_request_type
+ $networkData['network_request_type'] = generateOptionList(
+ '/ARRAY/',
+ array('GET','POST'),
+ array(getMessage('ADMIN_NETWORK_REQUEST_TYPE_GET'), getMessage('ADMIN_NETWORK_REQUEST_TYPE_POST')),
+ $networkData['network_request_type']
+ );
+
+ // Add row template and switch color
+ $OUT .= loadTemplate('admin_edit_networks_row', true, $networkData);
+ } elseif (isPostRequestElementSet('del')) {
+ // Translate the request type
+ $networkData['network_request_type'] = getMessage('ADMIN_NETWORK_REQUEST_TYPE_' . $networkData['network_request_type']);
- // Add row template and switch color
- $OUT .= loadTemplate('admin_edit_networks_row', true, $networkData);
+ // Add row template and switch color
+ $OUT .= loadTemplate('admin_del_networks_row', true, $networkData);
+ } else {
+ // Problem!
+ debug_report_bug('Cannot detect edit/del.');
+ }
$SW = 3 - $SW;
} // END - if
} // END - if
// If we have no rows, we don't need to display the edit form
if (!empty($OUT)) {
// Output main template
- loadTemplate('admin_edit_networks', false, $OUT);
+ if (isPostRequestElementSet('edit')) {
+ loadTemplate('admin_edit_networks', false, $OUT);
+ } elseif (isPostRequestElementSet('del')) {
+ loadTemplate('admin_del_networks', false, $OUT);
+ } else {
+ // Problem!
+ debug_report_bug('Cannot detect edit/del.');
+ }
// Don't display the list/add new form
$GLOBALS['network_display'] = false;
} // END - if
}
+// Changes given networks
+function doAdminNetworkProcessChangenetworkForm () {
+ // Do we have selections?
+ if (countPostSelection() > 0) {
+ // By default nothing is updated
+ $updated = 0;
+
+ // Something has been selected, so start updating them
+ foreach (postRequestElement('sel') as $id => $sel) {
+ // Update this entry?
+ if ($sel == 1) {
+ // Init data array
+ $networkData = array();
+
+ // Transfer whole array, except 'sel'
+ foreach (postRequestArray() as $key=>$entry) {
+ // Skip 'sel' and submit button
+ if (in_array($key, array('sel', 'change'))) continue;
+
+ // Do we have this enty?
+ if (!isset($entry[$id])) {
+ // Not found, needs fixing
+ debug_report_bug('No entry in key=' . $key . ', id=' . $id . ' found.');
+ } // END - if
+
+ // Add this entry
+ $networkData[$key] = $entry[$id];
+ } // END - foreach
+
+ // Update the network data
+ $updated += doNetworkUpdateDataByArray($id, $networkData);
+ } // END - if
+ } // END - foreach
+
+ // Do we have updates?
+ if ($updated > 0) {
+ // Updates done
+ loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_NETWORK_UPDATED'), $updated));
+ } else {
+ // Nothing changed
+ loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NETWORK_NOTHING_CHANGED'));
+ }
+ } // END - if
+}
+
// [EOF]
?>
}
// Wrapper for $_POST and adminSaveSettings
-function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = false) {
+function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = false, $displayMessage = true) {
// Get the array
$postData = postRequestArray();
// Call the lower function
- adminSaveSettings($postData, $tableName, $whereStatement, $translateComma, $alwaysAdd);
+ adminSaveSettings($postData, $tableName, $whereStatement, $translateComma, $alwaysAdd, $displayMessage);
}
// Save settings to the database
-function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = false) {
+function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = false, $displayMessage = true) {
// Prepare all arrays, variables
$DATA = array();
$skip = false;
// Simply run generated SQL string
SQL_QUERY($sql, __FUNCTION__, __LINE__);
+ // Remember affected rows
+ $affected = SQL_AFFECTEDROWS();
+
// Rebuild cache
rebuildCacheFile('config', 'config');
- // Settings saved
- loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
+ // Settings saved, so display message?
+ if ($displayMessage === true) loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
+
+ // Return affected rows
+ return $affected;
}
// Generate a selection box
--- /dev/null
+<div align="center">
+<form accept-charset="utf-8" action="{?URL?}/modules.php?module=admin&what=list_networks&do=removenetwork" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
+ <tr>
+ <td align="center" class="admin_title bottom" height="25" colspan="4">
+ <strong>{--ADMIN_NETWORK_DELETE_TITLE--}</strong>
+ </td>
+ </tr>
+ $content
+ <tr>
+ <td colspan="4" class="admin_footer">
+ <input type="reset" class="admin_reset" value="{--CLEAR_FORM--}" />
+ <input type="submit" name="remove" class="admin_delete" value="{--ADMIN_NETWORK_REMOVE--}" />
+ </td>
+ </tr>
+</table>
+</form>
+
+<div class="admin_note">
+ {--ADMIN_NETWORK_LIST_NOTE--}
+</div>
+</div>
--- /dev/null
+<tr><td colspan="4" class="switch_sw$content[sw] seperator" height="5"> </td></tr>
+<tr>
+ <td class="switch_sw$content[sw]" style="padding-left:5px">{--ADMIN_NETWORK_TITLE--}:</td>
+ <td class="switch_sw$content[sw]">
+ <input type="hidden" name="sel[$content[network_id]]" value="1" />
+ $content[network_title]
+ </td>
+ <td class="switch_sw$content[sw]" style="padding-left:5px">{--ADMIN_NETWORK_SHORT_NAME--}:</td>
+ <td class="switch_sw$content[sw]">
+ $content[network_short_name]
+ </td>
+</tr>
+<tr><td colspan="4" class="switch_sw$content[sw] seperator" height="5"> </td></tr>
+<tr>
+ <td class="switch_sw$content[sw]" style="padding-left:5px">{--ADMIN_NETWORK_REFLINK--}:</td>
+ <td class="switch_sw$content[sw]">
+ $content[network_reflink]
+ </td>
+ <td class="switch_sw$content[sw]" style="padding-left:5px">{--ADMIN_NETWORK_DATA_SEPERATOR--}:</td>
+ <td class="switch_sw$content[sw]">
+ $content[network_data_seperator]
+ </td>
+</tr>
+<tr><td colspan="4" class="switch_sw$content[sw] seperator" height="5"> </td></tr>
+<tr>
+ <td class="switch_sw$content[sw]" style="padding-left:5px">{--ADMIN_NETWORK_REQUEST_TYPE--}:</td>
+ <td class="switch_sw$content[sw]">
+ $content[network_request_type]
+ </td>
+ <td class="switch_sw$content[sw]" style="padding-left:5px">{--ADMIN_NETWORK_ROW_SEPERATOR--}:</td>
+ <td class="switch_sw$content[sw]">
+ $content[network_row_seperator]
+ </td>
+</tr>
+<tr><td colspan="4" class="switch_sw$content[sw] seperator" height="5"> </td></tr>
+<tr>
+ <td class="switch_sw$content[sw]" style="padding-left:5px">{--ADMIN_NETWORK_CHARSET--}:</td>
+ <td class="switch_sw$content[sw]">
+ $content[network_charset]
+ </td>
+ <td class="switch_sw$content[sw] seperator" colspan="2"> </td>
+</tr>
+<tr><td colspan="4" class="bottom switch_sw$content[sw] seperator" height="6"> </td></tr>
</tr>
</table>
</form>
+
+<div class="admin_note">
+ {--ADMIN_NETWORK_LIST_NOTE--}
+</div>
</div>
<tr>
<td class="switch_sw$content[sw]" style="padding-left:5px">{--ADMIN_NETWORK_TITLE--}:</td>
<td class="switch_sw$content[sw]">
+ <input type="hidden" name="sel[$content[network_id]]" value="1" />
<input type="text" name="network_title[$content[network_id]]" class="admin_normal" size="20" maxlength="255" value="$content[network_title]" />
</td>
<td class="switch_sw$content[sw]" style="padding-left:5px">{--ADMIN_NETWORK_SHORT_NAME--}:</td>
<tr>
<td class="switch_sw$content[sw]" style="padding-left:5px">{--ADMIN_NETWORK_REQUEST_TYPE--}:</td>
<td class="switch_sw$content[sw]">
- <select name="network_request_type" class="admin_select" size="1">
+ <select name="network_request_type[$content[network_id]]" class="admin_select" size="1">
$content[network_request_type]
</select>
</td>