Tripal Plant PopGen Submit
page_1.php File Reference

Go to the source code of this file.

Functions

 tpps_page_1_create_form (array &$form, array &$form_state)
 

Detailed Description

Creates the Publication/Species Information page and includes helper files.

Definition in file page_1.php.

Function Documentation

◆ tpps_page_1_create_form()

tpps_page_1_create_form ( array &  $form,
array &  $form_state 
)

Creates the Publication/Species Information form page.

This function mainly calls the helper functions user_info, publication, and organism.

Parameters
array$formThe form being created.
array$form_stateThe state of the form being created.
Returns
array The completed Publication/Species Information form.

Definition at line 25 of file page_1.php.

25  {
26 
27  if (isset($form_state['saved_values'][TPPS_PAGE_1])) {
28  $values = $form_state['saved_values'][TPPS_PAGE_1];
29  }
30  else {
31  $values = array();
32  }
33 
34  tpps_user_info($form, $values);
35 
36  tpps_publication($form, $values, $form_state);
37 
38  $file_upload_location = 'public://' . variable_get('tpps_study_photo_files_dir', 'tpps_study_photos');
39  $form['study_photo'] = array(
40  '#type' => 'fieldset',
41  '#title' => '<div class="fieldset-title">Study Cover Photo: (Optional)</div>',
42  '#tree' => FALSE,
43  '#collapsible' => TRUE,
44  );
45 
46  $form['study_photo']['photo'] = array(
47  '#type' => 'managed_file',
48  '#title' => t('Please upload a cover photo for your study. This photo will be displayed at the top of the landing page of the study.'),
49  '#upload_location' => "$file_upload_location",
50  '#upload_validators' => array(
51  'file_validate_extensions' => array('img jpg jpeg png'),
52  ),
53  '#default_value' => $form_state['saved_values'][TPPS_PAGE_1]['photo'] ?? NULL,
54  );
55 
56  tpps_organism($form, $form_state);
57 
58  $form['Save'] = array(
59  '#type' => 'submit',
60  '#value' => t('Save'),
61  '#prefix' => '<div class="input-description">* : Required Field</div>',
62  );
63 
64  $form['Next'] = array(
65  '#type' => 'submit',
66  '#value' => t('Next'),
67  );
68 
69  return $form;
70 }
const TPPS_PAGE_1
Definition: tpps.module:12
tpps_publication(array &$form, array $values, array $form_state)
tpps_organism(array &$form, array &$form_state)
tpps_user_info(array &$form, array $values)