]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_forced_campaigns.php
Code style changed, ext-user continued:
[mailer.git] / inc / modules / admin / what-list_forced_campaigns.php
index 48992aec85dc5b9d46f81311d42c31862293b956..50949df58064c9ee8751777f67ea860d956cbaf5 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 *
@@ -44,10 +44,10 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addYouAreHereLink('admin', __FILE__);
 
 // By default show the list...
-$show = true;
+$show = TRUE;
 
 // Check for 'url_id' element
-if ((countRequestPost() > 0) && ((!isPostRequestElementSet('forced_campaigns_id')) || (!is_array(postRequestElement('forced_campaigns_id'))) || (count(postRequestElement('forced_campaigns_id')) == 0))) {
+if ((!isFormSent('add')) && (countRequestPost() > 0) && (!ifPostContainsSelections('forced_campaign_id'))) {
        // Not found so output message
        displayMessage('{--ADMIN_FORCED_CAMPAIGNS_NO_SELECTIONS--}');
 
@@ -64,7 +64,7 @@ if (isFormSent('add')) {
        showEntriesByXmlCallback('admin_edit_show_forced_campaigns');
 
        // Do not show the list of URLs after this template
-       $show = false;
+       $show = FALSE;
 } elseif (isFormSent('do_edit')) {
        // Change data of entries
        showEntriesByXmlCallback('admin_edit_do_forced_campaigns');
@@ -73,23 +73,46 @@ if (isFormSent('add')) {
        showEntriesByXmlCallback('admin_delete_show_forced_campaigns');
 
        // Do not show the list of URLs after this template
-       $show = false;
+       $show = FALSE;
 } elseif (isFormSent('do_delete')) {
        // Remove entries from database
        showEntriesByXmlCallback('admin_delete_do_forced_campaigns');
+} elseif (isFormSent('lock')) {
+       // Un-/lock selected campaigns. This does not work for pending campaigns
+       showEntriesByXmlCallback('admin_lock_show_forced_campaigns');
+
+       // Do not show the list of URLs after this template
+       $show = FALSE;
+} elseif (isFormSent('do_lock')) {
+       // Un-/lock selected campaigns. This does not work for pending campaigns
+       showEntriesByXmlCallback('admin_lock_do_forced_campaigns');
+} elseif (isFormSent('activate')) {
+       // List activation of selected campaigns. This does not work for locked campaigns
+       if (doForcedAdminActivateCampaigns()) {
+               // Has all worked
+               displayMessage('{--ADMIN_FORCED_CAMPAIGNS_ACTIVATED_DONE--}');
+       } else {
+               // Something went wrong
+               displayMessage('{--ADMIN_FORCED_CAMPAIGNS_ACTIVATED_FAILED--}');
+       }
 }
 
 // Show entries?
-if ($show === false) {
+if ($show === FALSE) {
        // No, a form has already been show
-       return false;
+       return FALSE;
 } // END - if
 
-// List all URLs
+// List all campaigns
 showEntriesByXmlCallback('admin_list_forced_campaigns');
 
+// Init array
+$content = array(
+       'reload' => createTimeSelections(0, 'forced_campaign_reload_lock', 'Dhms')
+);
+
 // Display form for adding a forced-ad
-loadTemplate('admin_add_forced_campaign');
+loadTemplate('admin_add_forced_campaign', FALSE, $content);
 
 // [EOF]
 ?>