--- C:\Documents and Settings\Mike Carper\Desktop\moduleinfo\moduleinfo.module Fri Sep 5 12:08:44 2008 +++ E:\xampplite\htdocs\Pre-Panels\sites\all\modules\moduleinfo\moduleinfo.module Thu Mar 5 19:38:09 2009 @@ -6,6 +6,7 @@ which is displayed on the pages admin/build/modules and admin/build/modules/list ****/ function moduleinfo_form_alter($form, $form_state, $form_id){ + if ("admin/build/modules" == $_GET['q']){ $files = module_rebuild_cache(); if ($form_id=="system_modules"){ foreach($form["description"] as $module=>$description){ @@ -23,6 +24,7 @@ $form["description"][$module]['#value'] .= theme('fieldset', $fieldset);; } } + } } /**** an implementation of hook_help @@ -55,6 +57,7 @@ /*** collects all the information we can find about a module from various hooks ***/ function moduleinfo_get_info($module){ + if ("admin/build/modules" == $_GET['q']){ $output = ''; $help = moduleinfo_get_help($module); if ($help){ @@ -81,6 +84,7 @@ $output.= ''; } return $output; + } } /*** check for help ***/ @@ -96,6 +100,7 @@ /*** check for pages, both config and other ***/ /** todo -- display w/ submenu structure **/ function moduleinfo_get_pages($module,$cached=TRUE){ + if ("admin/build/modules" == $_GET['q']){ $pages = array(); if (module_hook($module,"menu")){ $menus = module_invoke($module, "menu", $cached); @@ -113,10 +118,12 @@ } } return $pages; + } } /*** check for block ***/ function moduleinfo_get_blocks($module){ + if ("admin/build/modules" == $_GET['q']){ /*** check for blocks ***/ $blocks = array(); if (module_hook($module, "block")){ @@ -128,10 +135,12 @@ } } return $blocks; + } } /*** check for custom content-types ***/ function moduleinfo_get_content_types($module){ + if ("admin/build/modules" == $_GET['q']){ $content_types = array(); if (module_hook($module, "node_info")){ $nodes = module_invoke($module,"node_info"); @@ -142,10 +151,12 @@ } } return $content_types; + } } /*** grab a module name from the database ***/ function moduleinfo_get_menu_name($path){ + if ("admin/build/modules" == $_GET['q']){ $result = db_query("SELECT link_title FROM {menu_links} WHERE link_path = '%s'",array($path)); $res = db_fetch_object($result)->link_title; if (!$res){ @@ -153,10 +164,12 @@ $res = ucwords($res[0]); } return $res; + } } /*** generate a breadcrumb-style string from a menu path ***/ function moduleinfo_get_breadcrumb($path){ + if ("admin/build/modules" == $_GET['q']){ $parts = explode("/",$path); $current = ""; $breadcrumb = ""; @@ -167,4 +180,5 @@ $breadcrumb .= moduleinfo_get_menu_name($current); } return $breadcrumb; + } }