]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/overview-inc.php
Rewritten all THEME_FOO variables to GLOBALS
[mailer.git] / inc / modules / admin / overview-inc.php
index aff833a064309d884f563de35c7e6b916e59b51c..0ffec8391190adf76fed5d029ffb72774d6a6754 100644 (file)
@@ -52,8 +52,8 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) {
        $jobsDone = true;
 
        // Open the extension directory
-       $handle = opendir(constant('PATH')."inc/extensions/") or mxchange_die("Cannot read extension directory!");
-       while ($file = readdir($handle)) {
+       $extensionList = GET_DIR_AS_ARRAY("inc/extensions/", "ext-", false, false);
+       foreach ($extensionList as $file) {
                // Is this file an extension?
                if ((substr($file, 0, 4) == "ext-") && (substr($file, -4) == ".php")) {
                        //* DEBUG: */ echo $file."<br />\n";
@@ -96,10 +96,7 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) {
                                } // END - if
                        }
                } // END - if
-       } // END - while
-
-       // Close directory handle
-       closedir($handle);
+       } // END - foreach
 
        // At last - but not least - check for own and new unassigned tasks...
        $result_tasks = SQL_QUERY_ESC("SELECT id, assigned_admin, userid, task_type, subject, text, task_created
@@ -387,7 +384,6 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
 
                // There are uncompleted jobs!
                // @TODO Rewrite this to one template and use $OUT = ...
-               LOAD_TEMPLATE("admin_overview_header");
                $OUT = ""; $SW = 2;
                while ($content = SQL_FETCHARRAY($result_tasks)) {
                        // Init infos
@@ -428,12 +424,10 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                        // Do we have extension task?
                        if (($content['task_type'] == "EXTENSION") && (GET_EXT_VERSION($content['infos']) == "")) {
                                // Load extension row template
-                               // @TODO Rewrite this to $OUT .= ..., true, ...
-                               LOAD_TEMPLATE("admin_overview_list_ext_rows", false, $content);
+                               $OUT .= LOAD_TEMPLATE("admin_overview_list_ext_rows", true, $content);
                        } else {
                                // Load default row template
-                               // @TODO Rewrite this to $OUT .= ..., true, ...
-                               LOAD_TEMPLATE("admin_overview_list_rows", false, $content);
+                               $OUT .= LOAD_TEMPLATE("admin_overview_list_rows", true, $content);
                        }
 
                        // Switch color
@@ -444,7 +438,7 @@ function OUTPUT_SELECTED_TASKS ($POST, $result_tasks) {
                SQL_FREERESULT($result_tasks);
 
                // Load footer template
-               LOAD_TEMPLATE("admin_overview_footer");
+               LOAD_TEMPLATE("admin_overview_table", false, $OUT);
        }
 }
 //