Some functions rewritten to hungarian notation, handling of array rewritten
[mailer.git] / inc / modules / admin / what-overview.php
index e18bbad546cdfac61b2d76fc69511d2b8eeb0767..83e1660d255c88f8a0b98f6f407330ade4fa5a39 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])) || (!IS_ADMIN())) {
+if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
 }
 
 // Add description as navigation point
-ADD_DESCR("admin", basename(__FILE__));
+// In Opera browsers the menu is being displayed double: ADD_DESCR("admin", __FILE__);
 
 // Otherwise load include file 'overview-inc' (old standard overview page)
 require_once(PATH."inc/modules/admin/overview-inc.php");
 
 $JOBS_DONE = true;
+$taskExt = false; // Default is that "task" is not installed
+
 // When the admin is logging in check several things first (new jobs to complete and so on)
-if ($GLOBALS['action'] == "login")
-{
-       if (EXT_IS_ACTIVE("task"))
-       {
+if ($GLOBALS['action'] == "login") {
+       if ((EXT_IS_ACTIVE("task")) && (function_exists('OUTPUT_ADVANCED_OVERVIEW'))) {
                // When task extension is registered output advanced overview page
                $JOBS_DONE = OUTPUT_ADVANCED_OVERVIEW($result_tasks); // This function is provided by the extension 'task'
-       }
-        else
-       {
+               $taskExt = true;
+       } else {
                // Output standart overview (provided by overview-inc.php)
                $JOBS_DONE = OUTPUT_STANDARD_OVERVIEW($result_tasks);
        }
-}
-// Do we have new jobs or not?
-if ($JOBS_DONE)
-{
+} // END - if
+
+// Are there jobs to be done?
+if ($JOBS_DONE) {
        // Generate overview of all main menus
-       global $menuDesription, $FATAL;
+       global $menuDesription;
        if ((is_array($menuDesription)) && (sizeof($menuDesription) > 0)) {
                $OUT = "";
-               foreach ($menuDesription as $key=>$value)
+               foreach ($menuDesription as $key => $value)
                {
                        // Prepare content
                        $content = array(
@@ -80,7 +79,13 @@ if ($JOBS_DONE)
                // Load base template
                LOAD_TEMPLATE("admin_menu_hints", false, $OUT);
        }
-} elseif (!EXT_IS_ACTIVE("task")) {
+} elseif (!$taskExt) {
+       if (EXT_IS_ACTIVE("task")) {
+               // Output warning message
+               LOAD_TEMPLATE("admin_settings_saved", false, sprintf(EXTENSION_WARNING_EXT_INACTIVE, "task"));
+               OUTPUT_HTML("<br />");
+       }
+
        // List selected tasks on overview when task management is not active
        OUTPUT_SELECTED_TASKS($_POST, $result_tasks);
 }