From dcbc059ba1cc081f351921e8b4b91e1081de1177 Mon Sep 17 00:00:00 2001
From: Bob Vincent <bobvin@pillars.net>
Date: Sat, 9 Jul 2011 13:34:54 -0400
Subject: [PATCH] Issue #942684: Fix breakage due to #497118: Remove the registry (for functions).

---
 charts.info                                        |    5 -----
 charts.install                                     |    2 +-
 charts.hooks.inc => charts.module                  |   20 ++++++++++++++++++--
 ...harts_system.hooks.inc => charts_system.module} |    0
 google_charts/google_charts.info                   |    2 --
 ...oogle_charts.hooks.inc => google_charts.module} |    0
 6 files changed, 19 insertions(+), 10 deletions(-)
 rename charts.hooks.inc => charts.module (69%)
 rename charts_system/{charts_system.hooks.inc => charts_system.module} (100%)
 rename google_charts/{google_charts.hooks.inc => google_charts.module} (100%)

diff --git a/charts.info b/charts.info
index 0e75b5620e38ab2547d83445512c70ff15b6b992..28f1e06c397340cd3750a3cba405eada54e0b942 100644
--- a/charts.info
+++ b/charts.info
@@ -1,10 +1,5 @@
 core            = "7.x"
 description     = "Transform DATA into INFORMATION using beautiful CHARTS."
-files[]         = charts.module
-files[]         = charts.admin.inc
-files[]         = charts.inc
-files[]         = charts.hooks.inc
-files[]         = charts.install
 name            = "Charts"
 package         = "Charts"
 php             = 5.2
\ No newline at end of file
diff --git a/charts.install b/charts.install
index 26851bc9e9ed982d744d41c08594a13fa9b15558..80b25660462831336206238c7514bebfdc9d0c56 100644
--- a/charts.install
+++ b/charts.install
@@ -37,7 +37,7 @@ function charts_requirements($phase) {
     $requirements['charts']['title']        = t('Charts');
     $requirements['charts']['value']        = t('Charts module not yet configured');
     $requirements['charts']['severity']     = REQUIREMENT_ERROR;
-    $requirements['charts']['description']  = t('Charts core module needs to get some default options in order to operate. You must go to <a href="!link">settings page</a> and configure it.', array('!link' => url('admin/settings/charts')));
+    $requirements['charts']['description']  = t('Charts core module needs to get some default options in order to operate. You must go to <a href="!link">settings page</a> and configure it.', array('!link' => url('admin/config/content/charts')));
   }
 
   if (isset($requirements)) {
diff --git a/charts.hooks.inc b/charts.module
similarity index 69%
rename from charts.hooks.inc
rename to charts.module
index d23969fdaab80e260e318233dba625b47fc46020..a27e4037455a1c4933e954dd5d08ac6c37b65be8 100644
--- a/charts.hooks.inc
+++ b/charts.module
@@ -4,10 +4,25 @@
  * @file
  * Transform DATA into INFORMATION using beautiful CHARTS.
  *
- * @note only cachable hooks are here.
+ * @note For instructions about the API, see chart_api.txt file.
  */
 
 /**
+ * The main Chart API function, that calls any chart provider
+ * to print the given data.
+ *
+ * @param &$data
+ *   Array. The chart data, described on chart_api.txt
+ * @return
+ *   String. The HTML with the propper chart (might include Flash or
+ *   JavaScript external files)
+ */
+function charts_chart(&$data) {
+  module_load_include('inc', 'charts');
+  return _charts_chart($data);
+}
+
+/**
  * Implementation of hook_chart_types().
  */
 function charts_chart_types() {
@@ -24,9 +39,10 @@ function charts_chart_types() {
  * Implementation of hook_menu().
  */
 function charts_menu() {
-  $items['admin/settings/charts'] = array(
+  $items['admin/config/content/charts'] = array(
     'access arguments'  => array('set default settings for charts'),
     'description'     => 'Set the default behaviour and look of all your charts',
+    'file'            => 'charts.admin.inc',
     'page callback'   => 'drupal_get_form',
     'page arguments'  => array('_charts_settings_page'),
     'title'           => 'Charts'
diff --git a/charts_system/charts_system.hooks.inc b/charts_system/charts_system.module
similarity index 100%
rename from charts_system/charts_system.hooks.inc
rename to charts_system/charts_system.module
diff --git a/google_charts/google_charts.info b/google_charts/google_charts.info
index 1a0efe56e70f494b9c15498dc1bf305a07c8d020..9bb40aa06f3feca2b4351f91ec41bab7b02fe097 100644
--- a/google_charts/google_charts.info
+++ b/google_charts/google_charts.info
@@ -1,7 +1,5 @@
 core            = "7.x"
 dependencies[]  = charts
 description     = "Use Google Charts on your site."
-files[]         = google_charts.inc
-files[]         = google_charts.hooks.inc
 name            = "Google"
 package         = "Charts"
diff --git a/google_charts/google_charts.hooks.inc b/google_charts/google_charts.module
similarity index 100%
rename from google_charts/google_charts.hooks.inc
rename to google_charts/google_charts.module
-- 
1.7.4.1

