summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathew Winstone2013-03-15 17:56:29 (GMT)
committerMathew Winstone2013-03-15 17:56:29 (GMT)
commitfc159964b6e7a3a1a44f7edcabf13216e0ebf4e9 (patch)
tree178f99d358c8701a2eddcce7bf0f9fd09d148d28
parent5276df8513e07bf25e0c963f5aca7f8d10496820 (diff)
Added debug
-rw-r--r--garlic.module22
1 files changed, 22 insertions, 0 deletions
diff --git a/garlic.module b/garlic.module
index 01cfce3..d81b58a 100644
--- a/garlic.module
+++ b/garlic.module
@@ -5,6 +5,8 @@
* Adds the garlic.js library to Drupal and enable basic toggling on entities
*/
+define(GARLIC_DEBUG, variable_get('garlic_debug', FALSE));
+
/**
* Implements hook_libraries_info().
*/
@@ -61,4 +63,24 @@ function garlic_library() {
return $libraries;
}
+
+/**
+ * Implements hook_library_alter().
+ */
+function garlic_library_alter(&$libraries, $module) {
+ if (GARLIC_DEBUG) {
+ if ($module == 'garlic' && isset($libraries['garlic'])) {
+ $libraries['garlic']['js'] = array(libraries_get_path('garlic') . '/garlic.js');
+ }
+ }
+}
+
+/**
+ * Implements hook_uninstall().
+ */
+function garlic_uninstall() {
+ variable_del('garlic_debug');
+}
+
+
// @todo add hook_requirements \ No newline at end of file