example.profile

  1. 8.0.x tests/resources/example.profile
  2. 6.x tests/resources/example.profile
  3. 7.x tests/resources/example.profile
  4. 5.x tests/resources/example.profile
  5. master tests/resources/example.profile

Functions

File

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