function background_process_settings_form in Background Process 7.2
Same name and namespace in other branches
- 8 background_process.admin.inc \background_process_settings_form()
- 6 background_process.admin.inc \background_process_settings_form()
- 7 background_process.admin.inc \background_process_settings_form()
FAPI definition for settings page.
1 string reference to 'background_process_settings_form'
- background_process_menu in ./
background_process.module - Implements hook_menu().
File
- ./
background_process.admin.inc, line 9
Code
function background_process_settings_form() {
$form = array();
$form['background_process_cleanup_age'] = array(
'#type' => 'textfield',
'#title' => t('Cleanup age'),
'#description' => t('Unlock processes that have been more than X seconds to start.'),
'#default_value' => variable_get('background_process_cleanup_age', BACKGROUND_PROCESS_CLEANUP_AGE),
);
$form['background_process_running_cleanup_age'] = array(
'#type' => 'textfield',
'#title' => t('Cleanup age for running jobs'),
'#description' => t('Unlock processes that have been running for more than X seconds.'),
'#default_value' => variable_get('background_process_running_cleanup_age', BACKGROUND_PROCESS_RUNNING_CLEANUP_AGE),
);
$form['background_process_queue_cleanup_age'] = array(
'#type' => 'textfield',
'#title' => t('Cleanup age for queued jobs'),
'#description' => t('Unlock queued processes that have been more than X seconds to start.'),
'#default_value' => variable_get('background_process_queue_cleanup_age', BACKGROUND_PROCESS_QUEUE_CLEANUP_AGE),
);
$form['background_process_result_cleanup_age'] = array(
'#type' => 'textfield',
'#title' => t('Cleanup age for results'),
'#description' => t('Removed background process results older than X seconds..'),
'#default_value' => variable_get('background_process_result_cleanup_age', BACKGROUND_PROCESS_RESULT_CLEANUP_AGE),
);
$options = background_process_get_service_hosts();
foreach ($options as $key => &$value) {
$new = empty($value['description']) ? $key : $value['description'];
$new .= ' (' . background_process_get_service_host_title($value) . ')';
$value = $new;
}
$form['background_process_default_service_host'] = array(
'#type' => 'select',
'#title' => t('Default service host'),
'#description' => t('The default service host to use'),
'#options' => $options,
'#default_value' => variable_get('background_process_default_service_host', 'default'),
);
$options = background_process_get_service_groups();
foreach ($options as $key => &$value) {
$value = (empty($value['description']) ? $key : $value['description']) . ' (' . join(',', $value['hosts']) . ')';
}
$form['background_process_default_service_group'] = array(
'#type' => 'select',
'#title' => t('Default service group'),
'#description' => t('The default service group to use.'),
'#options' => $options,
'#default_value' => variable_get('background_process_default_service_group', 'default'),
);
$form = system_settings_form($form);
// Add determine button and make sure all the buttons are shown last.
$form['buttons']['#weight'] = 1000;
$form['buttons']['determine'] = array(
'#value' => t("Determine default service host"),
'#description' => t('Tries to determine the default service host.'),
'#type' => 'submit',
'#submit' => array(
'background_process_settings_form_determine_submit',
),
);
return $form;
}