mailer project continued:
[mailer.git] / inc / modules / admin / what-list_point_accounts.php
index 8549996049e4b8dabf012c9e0abe0b819e8b384e..b6f542d442643f63c0289d3be02499bd22571653 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -43,5 +43,59 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 // Add description as navigation point
 addYouAreHereLink('admin', __FILE__);
 
+// By default show the list...
+$show = true;
+
+// Check for 'url_id' element
+if ((!isFormSent('add')) && (countRequestPost() > 0) && (!ifPostContainsSelections('id'))) {
+       // Not found so output message
+       displayMessage('{--ADMIN_POINT_ACCOUNTS_NO_SELECTIONS--}');
+
+       // Abort here
+       return;
+} // END - if
+
+// Edit or delete button hit?
+if (isFormSent('add')) {
+       // Add new forced ad
+       if (doAdminAddPointsAccountByType(postRequestArray(), 'CUSTOM')) {
+               // Did work
+               displayMessage('{--ADMIN_POINT_ACCOUNT_ADDED--}');
+       } else {
+               // Doesn't work
+               displayMessage('{--ADMIN_POINT_ACCOUNT_NOT_ADDED--}');
+       }
+} elseif (isFormSent('edit')) {
+       // Show only custom entries for editing
+       showEntriesByXmlCallback('admin_edit_show_point_accounts');
+
+       // Do not show the list of URLs after this template
+       $show = false;
+} elseif (isFormSent('do_edit')) {
+       // Change data of only custom entries
+       showEntriesByXmlCallback('admin_edit_do_point_accounts');
+} elseif ((isFormSent('delete')) && (ifPointsAccountTypeMatchesPost('CUSTOM'))) {
+       // Show only custom entries for deleting
+       showEntriesByXmlCallback('admin_delete_show_point_accounts');
+
+       // Do not show the list of URLs after this template
+       $show = false;
+} elseif ((isFormSent('do_delete')) && (ifPointsAccountTypeMatchesPost('CUSTOM'))) {
+       // Remove only custom entries
+       showEntriesByXmlCallback('admin_delete_do_point_accounts');
+}
+
+// Show entries?
+if ($show === false) {
+       // No, a form has already been show
+       return false;
+} // END - if
+
+// List all campaigns
+showEntriesByXmlCallback('admin_list_point_accounts');
+
+// Display form for adding a forced-ad
+loadTemplate('admin_add_point_accounts');
+
 // [EOF]
 ?>