Index: includes/module_builder.js =================================================================== RCS file: /cvs/drupal/contributions/modules/module_builder/includes/module_builder.js,v retrieving revision 1.2 diff -u -r1.2 module_builder.js --- includes/module_builder.js 4 Apr 2006 03:24:35 -0000 1.2 +++ includes/module_builder.js 10 Jan 2007 05:15:22 -0000 @@ -27,4 +27,4 @@ checkbox.checkCount += grouping.checked ? 1 : -1; checkbox.checked = checkbox.checkCount > 0; } -} \ No newline at end of file +} Index: includes/module_builder.css =================================================================== RCS file: /cvs/drupal/contributions/modules/module_builder/includes/module_builder.css,v retrieving revision 1.1 diff -u -r1.1 module_builder.css --- includes/module_builder.css 2 Apr 2006 22:51:15 -0000 1.1 +++ includes/module_builder.css 10 Jan 2007 05:15:22 -0000 @@ -15,4 +15,4 @@ width: 50%; margin: 0; padding: 0; -} \ No newline at end of file +} Index: templates/node_hooks.template =================================================================== RCS file: /cvs/drupal/contributions/modules/module_builder/templates/node_hooks.template,v retrieving revision 1.2 diff -u -r1.2 node_hooks.template --- templates/node_hooks.template 3 Apr 2006 05:04:42 -0000 1.2 +++ templates/node_hooks.template 10 Jan 2007 05:15:23 -0000 @@ -33,6 +33,7 @@ $items[] = array( 'path' => 'node/add/%module', 'title' => t('%name'), + 'description' => t('%description'), 'access' => user_access('create %name'), // OPTIONAL: Fill in other properties ); @@ -132,4 +133,4 @@ // $order_info = theme('node_example_order_info', $node); // $node->body .= $order_info; // $node->teaser .= $order_info; -== END == \ No newline at end of file +== END == Index: module_builder.module =================================================================== RCS file: /cvs/drupal/contributions/modules/module_builder/module_builder.module,v retrieving revision 1.27 diff -u -r1.27 module_builder.module --- module_builder.module 5 Apr 2006 04:13:13 -0000 1.27 +++ module_builder.module 10 Jan 2007 05:15:22 -0000 @@ -19,18 +19,6 @@ */ /** - * Implementation of hook_help(). - * - * @ingroup module_builder_core - */ -function module_builder_help($section) { - switch ($section) { - case 'admin/modules#description': - return t('Builds scaffolding for custom modules.'); - } -} - -/** * Implementation of hook_perm(). * * @ingroup module_builder_core @@ -50,13 +38,25 @@ if ($may_cache) { $items[] = array( 'path' => 'module_builder', - 'title' => t('module builder'), - 'callback' => 'module_builder_page', + 'title' => t('Module Builder'), + 'description' => t('Builds scaffolding for custom modules.'), + 'callback' => 'drupal_get_form', + 'callback arguments' => array('module_builder_page'), + 'access' => user_access('access module builder'), + 'type' => MENU_NORMAL_ITEM, + ); + $items[] = array( + 'path' => 'admin/settings/module_builder', + 'title' => t('Module Builder'), + 'description' => t('Configure Module Builder.'), + 'callback' => 'drupal_get_form', + 'callback arguments' => array('module_builder_admin_settings'), 'access' => user_access('access module builder'), + 'type' => MENU_NORMAL_ITEM, ); $items[] = array( 'path' => 'module_builder_process', - 'title' => t('module builder'), + 'title' => t('Module Builder'), 'callback' => 'module_builder_process', 'access' => user_access('access module builder'), 'type' => MENU_CALLBACK, @@ -71,15 +71,12 @@ * * @ingroup module_builder_core */ -function module_builder_settings() { - $op = $_POST['op']; - - _module_builder_check_settings(); +function module_builder_admin_settings() { $form['module_builder_hooks_directory'] = array( '#type' => 'textfield', '#title' => t('Path to hook documentation directory'), - '#description' => t('Subdirectory in the directory "%dir" where local copies of hook documentation should be stored.', array('%dir' => ''. variable_get('file_directory_path', 'files') .'/')), + '#description' => t('Subdirectory in the directory "%dir" where local copies of hook documentation should be stored.', array('%dir' => variable_get('file_directory_path', 'files') .'/')), '#default_value' => variable_get('module_builder_hooks_directory', 'hooks'), ); $form['module_builder_header'] = array( @@ -116,7 +113,7 @@ $form['module_builder_download'] = array( '#type' => 'radios', - '#title' => t('Download module file checkbox defaults to:'), + '#title' => t('Download module file checkbox defaults to'), '#description' => t('When checked, this will automatically generate your module file for you and prompt your browser to download it.'), '#options' => array( 1 => t('Enabled'), @@ -125,21 +122,21 @@ '#default_value' => variable_get('module_builder_download', 1), ); - if ($op == t('Update')) { + if ($_POST['op'] == t('Update')) { module_builder_update_documentation(); } $form['module_builder_update'] = array( '#type' => 'fieldset', '#title' => t('Update hook documentation'), - '#description' => t('Your last hook documentation update was %date.', array('%date' => ''. variable_get('module_builder_last_update', 0) .'')), + '#description' => t('Your last hook documentation update was %date.', array('%date' => variable_get('module_builder_last_update', 0))), ); $form['module_builder_update']['update'] = array( '#type' => 'button', '#value' => t('Update'), ); - return $form; + return system_settings_form($form); } /** @@ -173,8 +170,7 @@ _module_builder_check_settings(); // Include CSS for formatting - $path = drupal_get_path('module', 'module_builder'); - theme_add_style($path . '/includes/module_builder.css'); + drupal_add_css(drupal_get_path('module', 'module_builder') .'/includes/module_builder.css'); // Module properties $form['module_root_name'] = array( @@ -186,7 +182,7 @@ $form['module_short_description'] = array( '#type' => 'textfield', '#title' => t('Module short description'), - '#description' => t('Will appear in the module listing at administer >> modules.', array('%listing' => url('admin/modules'))), + '#description' => t('Will appear in the module listing at administer >> modules.', array('!listing' => url('admin/build/modules'))), '#required' => TRUE, ); $form['module_readable_name'] = array( @@ -197,16 +193,16 @@ $form['module_help_text'] = array( '#type' => 'textarea', '#title' => t('Help text'), - '#description' => t('Help text (HTML) to appear in administer >> help >> module_name page', array('%help' => url('admin/help'))), + '#description' => t('Help text (HTML) to appear in administer >> help >> module_name page', array('!help' => url('admin/help'))), ); // Check for custom hook_groups file, else use default - $path = drupal_get_path('module', 'module_builder') . '/templates'; + $path = drupal_get_path('module', 'module_builder'); if (file_exists("$path/hook_groups-custom.template")) { - $template_file = file_get_contents("$path/hook_groups-custom.template"); + $template_file = file_get_contents("$path/templates/hook_groups-custom.template"); } else { - $template_file = file_get_contents("$path/hook_groups.template"); + $template_file = file_get_contents("$path/templates/hook_groups.template"); } $form['hook_groups'] = array( @@ -215,7 +211,6 @@ '#description' => t('Selecting one or more of these features will automatically select appropriate hooks for you.'), ); - $path = drupal_get_path('module', 'module_builder'); drupal_add_js($path .'/includes/module_builder.js'); // Get list of hook groups @@ -249,7 +244,7 @@ $hook_groups = module_builder_get_hook_data(); if (!is_array($hook_groups) || !count($hook_groups)) { - form_set_error('hooks', t('No hooks were found. Please check the documentation path specified in the admininster >> settings >> modulebuilder page.', array('%settings' => url('admin/settings/module_builder')))); + form_set_error('hooks', t('No hooks were found. Please check the documentation path specified in the admininster >> settings >> modulebuilder page.', array('!settings' => url('admin/settings/module_builder')))); } else { @@ -311,7 +306,7 @@ ); } - return drupal_get_form('module_builder_page', $form); + return $form; } /** @@ -320,7 +315,7 @@ function theme_module_builder_hook_list($form) { $output = "