This hook adds a button and setting forms, which allow you to configure the setting.
https://api.drupal.org/api/drupal/modules!system!system.module/function/system_settings_form/7
https://drupal.org/node/206761
function test_admin_settings() {
$form = array();
// Test output visibility settings.
$form['display'] = array(
'#type' => 'fieldset',
'#title' => t('Display options'),
);
$form['display']['test_display_section_summaries'] = array(
'#type' => 'checkbox',
'#title' => t('Show summaries on administration sections.'),
'#default_value' => variable_get('test_display_section_summaries', 1),
'#description' => t('If unchecked, the summaries will still be visible on the <a href="@test-overview">reports</a> page.',
array('@xray-overview' => url('admin/reports/xray'))
),
);
$form['display'][test_display_callback_function'] = array(
'#type' => 'checkbox',
'#title' => t('Show the page callback function on all pages.'),
'#default_value' => variable_get('test_display_callback_function', 1),
);
$form['display']['test_display_form_id'] = array(
'#type' => 'checkbox',
'#title' => t('Show form ID in forms.'),
'#default_value' => variable_get('test_display_form_id', 1),
);
return system_settings_form($form);
}

No comments:
Post a Comment