dd0d2fab8d50f998267d0056c54e7670695c7b17
[yaffs-website] / vendor / drush / drush / tests / resources / example.profile
1 <?php
2
3 function example_profile_details() {
4   return array(
5     'name' => 'Example',
6     'description' => 'Example profile with a couple of basic added configuration options.',
7   );
8 }
9
10 function example_profile_modules() {
11   return array();
12 }
13
14 function example_form_alter(&$form, $form_state, $form_id) {
15   if ($form_id == 'install_configure') {
16     $form['my_options'] = array(
17       '#type' => 'fieldset',
18       '#title' => t('Example options'),
19     );
20     $form['my_options']['myopt1'] = array(
21       '#type' => 'textfield',
22       '#title' => 'Example option 1'
23     );
24     $form['my_options']['myopt2'] = array(
25       '#type' => 'select',
26       '#title' => t('Example option 2'),
27       '#options' => array(
28         0 => t('Something'),
29         1 => t('Something else'),
30         2 => t('Something completely different'),
31       ),
32     );
33
34     // Make sure we don't clobber the original auto-detected submit func
35     $form['#submit'] = array('install_configure_form_submit', 'example_install_configure_form_submit');
36   }
37 }
38
39 function example_install_configure_form_submit($form, &$form_state) {
40   variable_set('myopt1', $form_state['values']['myopt1']);
41   variable_set('myopt2', $form_state['values']['myopt2']);
42 }