A friend just showed me system_settings_form in action in a configuration file for a form.
The code in question looks like this (simplified).
function my_module_generateAdminForm($form){
$form = array();
$form['super_secret_password'] = array(
'#type' => 'textfield',
'#title' => t('Headline'),
'#default_value' => variable_get('super_secret_password','password'),
);
system_settings_form($form);
}
system_settings_form adds in submit buttons and handles the form submission, saving the variables. It also adds a "Reset to default" button - that resets all the variable to the default.
I basically guessed what it does because there's not a whole lot of documentation out there and my friend doesn't know exactly what it does either. My question is how does it know the variables to save/reset? Aren't I just passing an array?
Also is there any other magic in system_settings_form that I should know about?