summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMoshe Weitzman2011-04-08 03:31:29 (GMT)
committerMoshe Weitzman2011-04-08 03:31:29 (GMT)
commit9ab54a0ad0f13750f0b5d8056f41351987655e8d (patch)
treef4e72ff4dc9e2cec0f5eb799b829cea5e2f9c401
parenteeb821c46465bfb580133ed0c7e5a75155900ea9 (diff)
#559034 by sun | EnekoAlonso: Changed Remove dependency on Menu module.
-rw-r--r--devel.info1
-rw-r--r--devel.install23
-rw-r--r--devel.module19
3 files changed, 32 insertions, 11 deletions
diff --git a/devel.info b/devel.info
index 09302ee..f655609 100644
--- a/devel.info
+++ b/devel.info
@@ -1,7 +1,6 @@
name = Devel
description = Various blocks, pages, and functions for developers.
package = Development
-dependencies[] = menu
core = 7.x
configure = admin/config/development/devel
tags[] = developer
diff --git a/devel.install b/devel.install
index bf005b5..d454fc3 100644
--- a/devel.install
+++ b/devel.install
@@ -15,12 +15,16 @@ function devel_enable() {
->condition('name', 'devel')
->execute();
- $menu = array(
- 'menu_name' => 'devel',
- 'title' => $t('Development'),
- 'description' => $t('Development link'),
- );
- menu_save($menu);
+ // Create a custom menu, if Menu module is enabled.
+ // @see devel_modules_installed()
+ if (module_exists('menu')) {
+ $menu = array(
+ 'menu_name' => 'devel',
+ 'title' => $t('Development'),
+ 'description' => $t('Development link'),
+ );
+ menu_save($menu);
+ }
}
/**
@@ -40,8 +44,11 @@ function devel_uninstall() {
variable_del('devel_switch_user_show_form');
// Delete the development menu.
- $devel_menu = menu_load('devel');
- menu_delete($devel_menu);
+ if (module_exists('menu')) {
+ if ($devel_menu = menu_load('devel')) {
+ menu_delete($devel_menu);
+ }
+ }
}
/**
diff --git a/devel.module b/devel.module
index a83dba8..560306f 100644
--- a/devel.module
+++ b/devel.module
@@ -32,10 +32,25 @@ function devel_help($section) {
}
/**
- * Implementationation of hook_menu().
+ * Implements hook_modules_installed().
+ *
+ * @see devel_install()
+ */
+function devel_modules_installed($modules) {
+ if (in_array('menu', $modules)) {
+ $menu = array(
+ 'menu_name' => 'devel',
+ 'title' => t('Development'),
+ 'description' => t('Development link'),
+ );
+ menu_save($menu);
+ }
+}
+
+/**
+ * Implements hook_menu().
*/
function devel_menu() {
- $items = array();
// Note: we can't dynamically append destination to querystring. Do so at theme layer. Fix in D7?
$items['devel/cache/clear'] = array(
'title' => 'Empty cache',