? enabled_modules--762678-1.patch
? enabled_modules--762678-4.patch
? enabled_modules.views.inc
? enabled_modules.views_default.inc
Index: enabled_modules.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/enabled_modules/Attic/enabled_modules.install,v
retrieving revision 1.1.2.1.2.1
diff -u -p -r1.1.2.1.2.1 enabled_modules.install
--- enabled_modules.install	12 Oct 2008 23:24:03 -0000	1.1.2.1.2.1
+++ enabled_modules.install	6 Apr 2010 19:58:33 -0000
@@ -2,27 +2,206 @@
 // $Id: enabled_modules.install,v 1.1.2.1.2.1 2008/10/12 23:24:03 agaric Exp $
 
 /**
+ * @function
+ * Implementation of hook_schema().
+ */
+function enabled_modules_schema() {
+  return array(
+    'enabled_modules_system' => array(
+      'description' => 'Stores the contents of the "info" field of the {system} table as separate fields',
+      'fields' => array(
+        'filename' => array(
+          'description' => 'The location of the .module file',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+          'not null' => TRUE,
+        ),
+        'name' => array(
+          'description' => 'The name of the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'description' => array(
+          'description' => 'A description of the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'package' => array(
+          'description' => 'The package for the modules page',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'version' => array(
+          'description' => 'The version of the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'core' => array(
+          'description' => 'The core version of the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'project' => array(
+          'description' => 'The project that the module is part of',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'datestamp' => array(
+          'description' => 'The release datestamp',
+          'type' => 'int',
+          'default' => NULL,
+        ),
+        'dependencies' => array(
+          'description' => 'Dependencies of the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'dependents' => array(
+          'description' => 'Dependents of the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'php' => array(
+          'description' => 'The required PHP version for the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+      ),
+      'primary_key' => array('filename'),
+    ),
+  );
+}
+
+/**
  * Implementation of hook_install().
  */
 function enabled_modules_install() {
+  drupal_install_schema('enabled_modules');
   drupal_set_message(t('"Enabled modules" module installed.  See lists of <a href="@list">presently enabled</a> and <a href="@disabled">formerly enabled</a> modules in your Logs section of Administration.  Set which roles can view enabled modules <a href="@permissions">in Access permissions</a>.', array('@list' => url('admin/logs/status'), '@disabled' => url('admin/build/modules'), '@permissions' => url('admin/user/access', array('fragment' => 'module-enabled_modules')))));
 }
 
 /**
  * Implementation of hook_uninstall().
-function update_status_uninstall() {
-  $variables = array(
-    'update_status_settings',
-    'update_status_notify_emails',
-    'update_status_check_frequency',
-    'update_status_notification_threshold',
-    'update_status_last',
-    'update_status_fetch_url',
-  );
-  foreach ($variables as $variable) {
-    variable_del($variable);
-  }
-  cache_clear_all();
+ */
+function enabled_modules_uninstall() {
+  drupal_uninstall_schema('enabled_modules');
 }
+
+/**
+ * @function
+ * Implementation of hook_update_N()
+ * Adds table for system.info data
  */
+function enabled_modules_update_6101() {
+  $ret = array();
+  
+  $schema = array(
+    'enabled_modules_system' => array(
+      'description' => 'Stores the contents of the "info" field of the {system} table as separate fields',
+      'fields' => array(
+        'filename' => array(
+          'description' => 'The location of the .module file',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+          'not null' => TRUE,
+        ),
+        'name' => array(
+          'description' => 'The name of the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'description' => array(
+          'description' => 'A description of the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'package' => array(
+          'description' => 'The package for the modules page',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'version' => array(
+          'description' => 'The version of the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'core' => array(
+          'description' => 'The core version of the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'project' => array(
+          'description' => 'The project that the module is part of',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'datestamp' => array(
+          'description' => 'The release datestamp',
+          'type' => 'int',
+          'default' => NULL,
+        ),
+        'dependencies' => array(
+          'description' => 'Dependencies of the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'dependents' => array(
+          'description' => 'Dependents of the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+        'php' => array(
+          'description' => 'The required PHP version for the module',
+          'type' => 'varchar',
+          'size' => 'normal',
+          'default' => '',
+          'length' => '256',
+        ),
+      ),
+      'primary_key' => array('filename'),
+    ),
+  );
+
+  db_create_table($ret, 'enabled_modules_system', $schema['enabled_modules_system']);
+
+  return $ret;
+}
 
Index: enabled_modules.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/enabled_modules/enabled_modules.module,v
retrieving revision 1.1.2.13.2.5
diff -u -p -r1.1.2.13.2.5 enabled_modules.module
--- enabled_modules.module	6 Apr 2010 17:25:26 -0000	1.1.2.13.2.5
+++ enabled_modules.module	6 Apr 2010 19:58:33 -0000
@@ -360,9 +360,33 @@ function enabled_modules_array_link($arr
   }
   return $output;
  }
-
+
+/**
+ * @function
+ * Implements hook_views_api
+ */
 function enabled_modules_views_api() {
   return array(
     'api' => 2,
   );
-}
+}
+/**
+ * @function
+ * Implements hook_system_info_alter
+ */
+function enabled_modules_system_info_alter($info, $file) {
+  // This if() loop prevents a huge number of error messages from occurring before table has been created.
+  if (db_table_exists('enabled_modules_system')) {
+    // This hook is called each time a line of the {system} table is rebuilt.
+    // Delete that row
+    db_query("DELETE FROM {enabled_modules_system} WHERE filename='%s'", $file->filename);
+    // Rebuild
+    db_query("INSERT INTO {enabled_modules_system}
+      (filename, name, description, package, version, core, project, datestamp, dependencies, dependents, php)
+      VALUES
+      ('%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, '%s', '%s', '%s')",
+      $file->filename, $info['name'], $info['description'], $info['package'], $info['version'], $info['core'], $info['project'], $info['datestamp'], serialize($info['dependencies']), serialize($info['dependents']), $info['php']
+    ); 
+  }
+}
+
