Fixed logfile writing in installation phase, .revision is now ignored
[mailer.git] / inc / libs / task_functions.php
index 22090f5bb12a5677b4159f82177cd9238a0a0fac..f33501540b4f66e4d0d5aeef0ce3c2b833f2212a 100644 (file)
  * -------------------------------------------------------------------- *
  * Kurzbeschreibung  : Spezielle task-Funktionen                        *
  * -------------------------------------------------------------------- *
- *                                                                      *
+ * $Revision:: 856                                                    $ *
+ * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. Mär 2009)              $ *
+ * $Tag:: 0.2.1-FINAL                                                 $ *
+ * $Author:: stelzi                                                   $ *
+ * 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                           *
  * For more information visit: http://www.mxchange.org                  *
@@ -50,7 +55,6 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) {
        // Init variables/arrays
        $EXTRAS = "";
        $OUT = "";
-       INIT_SQLS();
        $WHATs = array();
        $DESCRs = array();
        $TITLEs = array();
@@ -58,6 +62,9 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) {
        // Chheck for new extensions and updates
        $JOBS_DONE = OUTPUT_STANDARD_OVERVIEW($result_main);
 
+       // Init SQLs
+       INIT_SQLS();
+
        if (!$JOBS_DONE) {
                // New extensions or updates found
                $value = GET_TOTAL_DATA(GET_CURRENT_ADMIN_ID(), "task_system", "id", "assigned_admin", true, " AND `status`='NEW' AND task_type='EXTENSION_UPDATE'");
@@ -215,13 +222,13 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) {
                                define('__MAIL_BONUS_AP_VALUE', "0");
                        }
                } elseif (EXT_IS_ACTIVE("bonus")) {
-                       define('__MAIL_BONUS_AP_VALUE', ADMIN_EXT_BONUS_OUTDATED_1."0.1.8".ADMIN_EXT_BONUS_OUTDATED_2);
+                       define('__MAIL_BONUS_AP_VALUE', sprintf(getMessage('ADMIN_EXT_BONUS_OUTDATED', "0.1.8")));
                } else {
-                       define('__MAIL_BONUS_AP_VALUE', "<div class=\"admin_note\">{--ADMIN_EXT_BONUS_404--}</div>");
+                       define('__MAIL_BONUS_AP_VALUE', "<span class=\"admin_note\">{--ADMIN_EXT_BONUS_404--}</span>");
                }
        } else {
-               define('__MAIL_BONUS_AP_VALUE', "<div class=\"admin_note\">{--ADMIN_EXT_AUTOPURGE_404--}</div>");
-               define('__MAIL_DELETED_VALUE', "<div class=\"admin_note\">{--ADMIN_EXT_AUTOPURGE_404--}</div>");
+               define('__MAIL_BONUS_AP_VALUE', "<span class=\"admin_note\">{--ADMIN_EXT_AUTOPURGE_404--}</span>");
+               define('__MAIL_DELETED_VALUE', "<span class=\"admin_note\">{--ADMIN_EXT_AUTOPURGE_404--}</span>");
        }
 
        //
@@ -237,7 +244,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) {
                        define('__MAIL_BONUS_SEND_VALUE', "0");
                }
        } elseif (EXT_IS_ACTIVE("bonus")) {
-               define('__MAIL_BONUS_SEND_VALUE', ADMIN_EXT_BONUS_OUTDATED_1."0.1.8".ADMIN_EXT_BONUS_OUTDATED_2);
+               define('__MAIL_BONUS_SEND_VALUE', sprintf(getMessage('ADMIN_EXT_BONUS_OUTDATED', "0.1.8")));
        } else {
                define('__MAIL_BONUS_SEND_VALUE', getMessage('ADMIN_EXT_BONUS_404'));
        }
@@ -251,6 +258,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) {
                } // END - if
 
                // Check for more extensions
+               // @TODO These can be rewritten to filter
                if (EXT_IS_ACTIVE("beg"))                  $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_uid')."";
                if (EXT_IS_ACTIVE("bonus"))                $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_uid')."";
                if (EXT_IS_ACTIVE("doubler"))              $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_uid')."";
@@ -537,7 +545,7 @@ ORDER BY beg_points DESC, userid");
 //
 function TASK_CREATE_EXTRA_ROWS ($WHATs, $DESCRs, $TITLEs) {
        // Init variables
-       $OUT = ""; $SW = 2; $MAX = COUNT_SQLS() - 1;
+       $OUT = ""; $SW = 2;
 
        // Sadly this cannot be rewritten to a filter... :(
        foreach (GET_SQLS() as $key => $sql) {
@@ -550,13 +558,16 @@ function TASK_CREATE_EXTRA_ROWS ($WHATs, $DESCRs, $TITLEs) {
                // Free result
                SQL_FREERESULT($result);
 
+               // Prepare array for output
                $content = array(
                        'row_descr' => $DESCRs[$key],
                        'row_sw'    => $SW,
                        'bottom'    => "",
                );
 
-               if ($key < $MAX) $content['bottom'] = "bottom2";
+               // Rewrite CSS class if not last entry is reached
+               if ($key < (COUNT_SQLS() - 1)) $content['bottom'] = "bottom2";
+
                if (($value > 0) && (!empty($WHATs[$key]))) {
                        if (empty($TITLEs[$key])) $TITLEs[$key] = getMessage('ADMIN_TASK_UNKNOWN_LIST_TITLE');
                        $content['row_link'] = "<a href=\"{!URL!}/modules.php?module=admin&amp;what=".$WHATs[$key]."\" title=\"".$TITLEs[$key]."\">".$value."</a>";
@@ -564,15 +575,16 @@ function TASK_CREATE_EXTRA_ROWS ($WHATs, $DESCRs, $TITLEs) {
                        $content['row_link'] = 0;
                }
 
-               // Switch color
-               $SW = 3 - $SW;
-
                // And insert the final string into extras template
                $OUT .= LOAD_TEMPLATE("admin_overview_task_rows", true, $content);
+
+               // Switch color
+               $SW = 3 - $SW;
        } // END - if
 
-       // Return output
+       // Return output in the template
        return LOAD_TEMPLATE("admin_overview_task_extras", true, $OUT);
 }
+
 //
 ?>