function module_builder_admin_settings in Module Builder 5
Same name and namespace in other branches
- 6.2 includes/module_builder.admin.inc \module_builder_admin_settings()
- 7.2 includes/module_builder.admin.inc \module_builder_admin_settings()
- 7 includes/module_builder.admin.inc \module_builder_admin_settings()
Implementation of hook_settings().
Related topics
1 string reference to 'module_builder_admin_settings'
- module_builder_menu in ./
module_builder.module - Implementation of hook_menu().
File
- ./
module_builder.module, line 135 - Builds scaffolding for custom modules.
Code
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') . '/',
)),
'#default_value' => variable_get('module_builder_hooks_directory', 'hooks'),
);
$last_update = variable_get('module_builder_last_update', 0);
$form['module_builder_update'] = array(
'#type' => 'fieldset',
'#title' => t('Update hook documentation'),
'#description' => $last_update ? t('Your last hook documentation update was %date.', array(
'%date' => $last_update,
)) : t('The hook documentation has not yet been updated.'),
);
$form['module_builder_update']['update'] = array(
'#type' => 'button',
'#value' => t('Update'),
);
$form['#after_build'] = array(
'module_builder_update_button',
);
$form['module_builder_write_directory'] = array(
'#type' => 'textfield',
'#title' => t('Path to write module files'),
'#description' => t('Subdirectory in the directory "%dir" where module files will be written.', array(
'%dir' => variable_get('file_directory_path', 'files') . '/',
)),
'#default_value' => variable_get('module_builder_write_directory', 'modules'),
);
$form['module_builder_header'] = array(
'#type' => 'textarea',
'#title' => t('Module header'),
'#description' => t('This is the code that will be displayed at the top of your module file.'),
'#rows' => 15,
'#default_value' => variable_get('module_builder_header', MODULE_BUILDER_HEADER_DEFAULT),
);
$form['module_builder_footer'] = array(
'#type' => 'textarea',
'#title' => t('Module footer'),
'#description' => t('This is the code that will be displayed at the bottom of your module file.'),
'#rows' => 15,
'#default_value' => variable_get('module_builder_footer', ''),
);
$form['module_builder_detail'] = array(
'#type' => 'radios',
'#title' => t('Code detail level'),
'#description' => t('This setting will either display or suppress additional explanatory comments in the resulting module code to help new developers.'),
'#options' => array(
1 => t("<strong>Beginner</strong>: I'm just starting out with Drupal development; please display lots of helpful comments in my module code!"),
0 => t("<strong>Advanced</strong>: I already know what I'm doing; don't put in a bunch of crap in my module file that I don't need!"),
),
'#default_value' => variable_get('module_builder_detail', 0),
);
/*
$form['module_builder_download'] = array(
'#type' => 'radios',
'#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'),
0 => t('Disabled'),
),
'#default_value' => variable_get('module_builder_download', 1),
);
*/
return system_settings_form($form);
}