# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: millennium.d6.inc
--- millennium.d6.inc Base (1.1.2.1)
+++ millennium.d6.inc Locally Modified (Based On 1.1.2.1)
@@ -8,7 +8,6 @@
  *   Make our life easily on backporting.
  */
 
-function millennium_d6_functions() {
   if (!function_exists('drupal_alter')) {
     function drupal_alter($type, &$data) {
       // PHP's func_get_args() always returns copies of params, not references, so
@@ -196,5 +195,3 @@
       return $property ? $language->$property : $language;
     }
   }
-}
-
Index: millennium.module
--- millennium.module Base (1.13.2.34.2.5)
+++ millennium.module Locally Modified (Based On 1.13.2.34.2.5)
@@ -13,22 +13,24 @@
 define('MILLENNIUM_SESSION_COOKIE_LIFETIME', 300);
 define('MILLENNIUM_ITEM_AVAILABLE_STRINGS', 'AVAILABLE,IN LIBRARY');
 
-/**
- * Implementation of hook_init().
- */
-function millennium_init() {
-  global $_millennium_field_labels;
-  global $_key_to_name;
-
   // Include some files
-  require_once 'millennium.admin.inc';
   require_once 'millennium.theme.inc';
   require_once 'millennium.pages.inc';
+// Include admin functions only on the admin pages.
+if (arg(0) == 'admin' && (arg(1) == 'settings' || arg(1) == 'logs' || arg(1) == 'content') && arg(2) == 'millennium') {
+  include_once(drupal_get_path('module', 'millennium') .'/millennium.admin.inc');
+}
   
   // Include backport of D6 functions
   require_once 'millennium.d6.inc';
-  millennium_d6_functions();
 
+/**
+ * Setup code and globals. Runs on every page load.
+ */
+function millennium_setup() {
+  global $_millennium_field_labels;
+  global $_key_to_name;
+
   // Load CSS file
   drupal_add_css( drupal_get_path('module', 'millennium') .'/millennium.css');
 
@@ -579,6 +581,11 @@
 function millennium_menu($may_cache) {
   $items = array();
 
+  if (!$may_cache) {
+    // Setup global variables
+    millennium_setup();
+  }
+  
\ No newline at end of file
   if ($may_cache) {
     $items[] = array(
       'path' => MILLENNIUM_SETTINGS_PATH,
