2 * Implements hook_install_tasks().
4 function {{ machine_name }}_install_tasks(&$install_state) {
5 // Here, we define a variable to allow tasks to indicate that a particular,
6 // processor-intensive batch process needs to be triggered later on in the
8 $myprofile_needs_batch_processing = variable_get('myprofile_needs_batch_processing', FALSE);
10 // This is an example of a task that defines a form which the user who is
11 // installing the site will be asked to fill out. To implement this task,
12 // your profile would define a function named myprofile_data_import_form()
13 // as a normal form API callback function, with associated validation and
14 // submit handlers. In the submit handler, in addition to saving whatever
15 // other data you have collected from the user, you might also call
16 // variable_set('myprofile_needs_batch_processing', TRUE) if the user has
17 // entered data which requires that batch processing will need to occur
19 'myprofile_data_import_form' => array(
20 'display_name' => st('Data import options'),
23 // Similarly, to implement this task, your profile would define a function
24 // named myprofile_settings_form() with associated validation and submit
25 // handlers. This form might be used to collect and save additional
26 // information from the user that your profile needs. There are no extra
27 // steps required for your profile to act as an "installation wizard"; you
28 // can simply define as many tasks of type 'form' as you wish to execute,
29 // and the forms will be presented to the user, one after another.
30 'myprofile_settings_form' => array(
31 'display_name' => st('Additional options'),
34 // This is an example of a task that performs batch operations. To
35 // implement this task, your profile would define a function named
36 // myprofile_batch_processing() which returns a batch API array definition
37 // that the installer will use to execute your batch operations. Due to the
38 // 'myprofile_needs_batch_processing' variable used here, this task will be
39 // hidden and skipped unless your profile set it to TRUE in one of the
41 'myprofile_batch_processing' => array(
42 'display_name' => st('Import additional data'),
43 'display' => $myprofile_needs_batch_processing,
45 'run' => $myprofile_needs_batch_processing ? INSTALL_TASK_RUN_IF_NOT_COMPLETED : INSTALL_TASK_SKIP,
47 // This is an example of a task that will not be displayed in the list that
48 // the user sees. To implement this task, your profile would define a
49 // function named myprofile_final_site_setup(), in which additional,
50 // automated site setup operations would be performed. Since this is the
51 // last task defined by your profile, you should also use this function to
52 // call variable_del('myprofile_needs_batch_processing') and clean up the
53 // variable that was used above. If you want the user to pass to the final
54 // Drupal installation tasks uninterrupted, return no output from this
55 // function. Otherwise, return themed output that the user will see (for
56 // example, a confirmation page explaining that your profile's tasks are
57 // complete, with a link to reload the current page and therefore pass on
58 // to the final Drupal installation tasks when the user is ready to do so).
59 'myprofile_final_site_setup' => array(