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 1 Jan 2007 19:10:22 -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 ); 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 1 Jan 2007 19:10:22 -0000 @@ -25,7 +25,7 @@ */ function module_builder_help($section) { switch ($section) { - case 'admin/modules#description': + case 'admin/help#module_builder': return t('Builds scaffolding for custom modules.'); } } @@ -50,13 +50,24 @@ if ($may_cache) { $items[] = array( 'path' => 'module_builder', - 'title' => t('module builder'), + 'title' => t('Module Builder'), + 'description' => t('Builds scaffolding for custom modules.'), 'callback' => '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' => '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,10 +82,7 @@ * * @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', @@ -125,21 +133,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 +181,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( @@ -311,7 +318,7 @@ ); } - return drupal_get_form('module_builder_page', $form); + return drupal_render_form('module_builder_page', $form); } /** @@ -320,9 +327,10 @@ function theme_module_builder_hook_list($form) { $output = "
\n"; + $output .= drupal_render($form); return $output; } @@ -380,7 +388,7 @@ // Include link in breadcrumb to go back to main module builder form $breadcrumb = drupal_get_breadcrumb(); - $breadcrumb[] = l(t('module builder'), 'module_builder'); + $breadcrumb[] = l(t('Module Builder'), 'module_builder'); drupal_set_breadcrumb($breadcrumb); // Grab header from settings @@ -672,12 +680,12 @@ * Initiates documentation upate routine. */ function module_builder_update_documentation() { + // Retrieve remote hook file listing from cvs.drupal.org $hook_listing = drupal_http_request('http://cvs.drupal.org/viewcvs/drupal/contributions/docs/developer/hooks/?only_with_tag='. MODULE_BUILDER_VERSION); - if ($hook_listing->error) { + if (isset($hook_listing->error)) { return FALSE; } - $url_pattern = '!\  $file_url) { - $file_contents = drupal_http_request($file_url); - file_save_data($file_contents->data, "$directory/$file_name", FILE_EXISTS_REPLACE); +// $file_contents = drupal_http_request($file_url); +// file_save_data($file_contents->data, "$directory/$file_name", FILE_EXISTS_REPLACE); } - // Finally, set the last updated variable variable_set('module_builder_last_update', format_date(time())); } Index: README.txt =================================================================== RCS file: /cvs/drupal/contributions/modules/module_builder/README.txt,v retrieving revision 1.5 diff -u -r1.5 README.txt --- README.txt 4 Apr 2006 16:40:02 -0000 1.5 +++ README.txt 1 Jan 2007 19:10:21 -0000 @@ -27,10 +27,10 @@ 2. Enable it from administer >> modules. 3. Go to administer >> settings >> module_builder and specify the path to save the hook documentation files -4. The first time you visit the settings page or the module builder form, - the module will retrieve hook documentation from cvs.drupal.org and - store it locally. When you want to update this documentation later on, - return to the settings page and click the "Update" button. +4. The first time you visit the module builder form, the module will + retrieve hook documentation from cvs.drupal.org and store it locally. + When you want to update this documentation later on, return to the + settings page and click the "Update" button. 5. (Optional) Create custom function declaration template file(s) if you don't like the default output. 6. (Optional) Create your own hook groupings if you don't like the Index: module_builder.info =================================================================== RCS file: module_builder.info diff -N module_builder.info --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ module_builder.info 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,6 @@ +; $Id$ +name = Module Builder +description = Builds scaffolding for custom modules. +; dependencies = +package = Development +version = "$Name$"