]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_yoomedia_tm.php
Huge rewrite of default parameters, ext-network continued:
[mailer.git] / inc / modules / admin / what-list_yoomedia_tm.php
index ec846b2e313c9eec3ff4eac6e5f4c6e657240062..e5486dc9c8caa4a856bd9c74fecc1519df5edd00 100644 (file)
@@ -17,7 +17,7 @@
  * Needs to be in all Files and every File needs "svn propset           *
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software. You can redistribute it and/or modify *
  ************************************************************************/
 
 // Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
-       require($INC);
-} elseif (!EXT_IS_ACTIVE("yoomedia")) {
-       addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "yoomedia");
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+       die();
+} // END - if
+
+// Add description as navigation point
+addMenuDescription('admin', __FILE__);
+
+if (!isExtensionActive('yoomedia')) {
+       loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('yoomedia'));
        return;
-} elseif (!EXT_IS_ACTIVE("bonus")) {
-       addFatalMessage(__FILE__, __LINE__, getMessage('EXTENSION_PROBLEM_EXT_INACTIVE'), "bonus");
+} elseif (!isExtensionActive('bonus')) {
+       loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('bonus'));
        return;
 }
 
-// Add description as navigation point
-ADD_DESCR("admin", __FILE__);
-
 // Do actions here
-if (IS_FORM_SENT()) {
+if (isFormSent()) {
        // Prepare mail for delivery
-       YOOMEDIA_PREPARE_MAIL_DELIVERY(REQUEST_POST_ARRAY());
+       YOOMEDIA_PREPARE_MAIL_DELIVERY(postRequestArray());
        return;
-} elseif (REQUEST_ISSET_POST(('sent'))) {
+} elseif (isPostRequestElementSet('sent')) {
        // Sent mail
-       YOOMEDIA_SEND_BONUS_MAIL(REQUEST_POST_ARRAY(), "normal");
-} elseif (REQUEST_ISSET_POST('remove')) {
+       YOOMEDIA_SEND_BONUS_MAIL(postRequestArray(), 'normal');
+} elseif (isPostRequestElementSet('remove')) {
        // Add mail to exclude list
-       YOOMEDIA_EXCLUDE_MAIL(REQUEST_POST_ARRAY(), "normal");
-} elseif (REQUEST_ISSET_POST(('unlist'))) {
+       YOOMEDIA_EXCLUDE_MAIL(postRequestArray(), 'normal');
+} elseif (isPostRequestElementSet('unlist')) {
        // Remove mail from exclude list
-       YOOMEDIA_UNLIST_MAIL(REQUEST_POST_ARRAY(), "normal");
+       YOOMEDIA_UNLIST_MAIL(postRequestArray(), 'normal');
 }
 
 // Enougth queries left?
-if (getConfig('yoomedia_requests_remain') == 0) {
+if (getConfig('yoomedia_requests_remain') == '0') {
        // Output message
-       LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_YOOMEDIA_REQUESTS_DEPLETED'));
+       loadTemplate('admin_settings_saved', false, getMessage('ADMIN_YOOMEDIA_REQUESTS_DEPLETED'));
 
        // Abort here!
        return false;
@@ -79,37 +80,34 @@ if (getConfig('yoomedia_requests_remain') == 0) {
 $result = YOOMEDIA_GET_PARSED_RESULT_TEXTMAILS();
 
 // Sanity-check on result array
-if ((!is_array($result)) || (count($result) == 0) || (!isset($result[0]['id']))) {
+if ((!is_array($result)) || (count($result) == '0') || (!isset($result[0]['id']))) {
        // Invalid result
-       LOAD_TEMPLATE("admin_settings_saved", false, getMessage('ADMIN_YOOMEDIA_INVALID_RESULT'));
+       loadTemplate('admin_settings_saved', false, getMessage('ADMIN_YOOMEDIA_INVALID_RESULT'));
        return false;
 } elseif (count($result[0]) < 7) {
        // Error received so prepare error code
-       $code = explode(" ", $result[0]['id']);
-       $code = $code[0];
-       $code = explode("<br />", $code);
-       $code = $code[0];
+       $code = YOOMEDIA_GET_ERRORCODE_FROM_RESULT($result);
 
        // Output message
-       LOAD_TEMPLATE("admin_yoomedia_error", false, sprintf("{--ADMIN_YOOMEDIA_ERROR_%s--}", strtoupper(YOOMEDIA_TRANSLATE_ERROR($code))));
+       loadTemplate('admin_yoomedia_error', false, sprintf("{--ADMIN_YOOMEDIA_ERROR_%s--}", strtoupper(translateYooMediaError($code))));
        return false;
 }
 
 // Prepare all entries
-$OUT = ""; $SW = 2;
+$OUT = ''; $SW = 2;
 foreach ($result as $entry) {
        // Translate some data
-       $entry['pay']    = TRANSLATE_COMMA($entry['pay'], true, 5);
-       $entry['remain'] = TRANSLATE_COMMA($entry['remain']);
+       $entry['pay']    = translateComma($entry['pay'], true, 5);
+       $entry['remain'] = translateComma($entry['remain']);
        $entry['sw']     = $SW;
 
        // Check reload lock
-       $reload = YOOMEDIA_CHECK_RELOAD($entry['id'], $entry['reload'], "textmail");
+       $reload = YOOMEDIA_CHECK_RELOAD($entry['id'], $entry['reload'], 'textmail');
 
        // Is this mail already sent?
        if ($reload !== false) {
                // Init countdown
-               $countdown = 0;
+               $countdown = '0';
 
                // Not manually locked?
                if ($reload > 0) {
@@ -123,17 +121,17 @@ foreach ($result as $entry) {
                        } // END - if
 
                        // Add reload lock
-                       $entry['already'] = sprintf(ADMIN_YOOMEDIA_TEXTMAIL_SEND_AGAIN, CREATE_FANCY_TIME($countdown));
+                       $entry['already'] = sprintf(getMessage('ADMIN_YOOMEDIA_TEXTMAIL_SEND_AGAIN'), createFancyTime($countdown));
                } else {
                        // Never resentable unless manual removal
-                       $entry['already'] = ADMIN_YOOMEDIA_TEXTMAIL_MANUALLY_LOCKED;
+                       $entry['already'] = getMessage('ADMIN_YOOMEDIA_TEXTMAIL_MANUALLY_LOCKED');
                }
 
                // Load row template for displaying
-               $OUT .= LOAD_TEMPLATE("admin_list_yoomedia_tm_already", true, $entry);
+               $OUT .= loadTemplate('admin_list_yoomedia_tm_already', true, $entry);
        } else {
                // Load row template with buttons
-               $OUT .= LOAD_TEMPLATE("admin_list_yoomedia_tm_row", true, $entry);
+               $OUT .= loadTemplate('admin_list_yoomedia_tm_row', true, $entry);
        }
 
        // Switch color
@@ -141,7 +139,7 @@ foreach ($result as $entry) {
 } // END - if
 
 // Load main template
-LOAD_TEMPLATE("admin_list_yoomedia_tm", false, $OUT);
+loadTemplate('admin_list_yoomedia_tm', false, $OUT);
 
-//
+// [EOF]
 ?>