Go to the source code of this file.
Define the helper functions for the Publication/Species Information page.
Definition in file page_1_helper.php.
◆ tpps_organism()
tpps_organism |
( |
array & |
$form, |
|
|
array & |
$form_state |
|
) |
| |
This function creates fields describing the species in the publication.
- Parameters
-
array | $form | The form to be populated. |
array | $form_state | The form_state of the form to be populated. |
- Returns
- array The populated form.
Definition at line 132 of file page_1_helper.php.
135 '#type' =>
'fieldset',
136 '#title' =>
"Species !num",
138 '#type' =>
'textfield',
139 '#autocomplete_path' =>
'tpps/autocomplete/species',
140 '#attributes' => array(
141 'data-toggle' => array(
'tooltip'),
142 'data-placement' => array(
'right'),
143 'title' => array(
'If your species is not in the autocomplete list, don\'t worry about it! We will create a new organism entry in the database for you.'),
147 '#type' =>
'checkbox',
148 '#title' => t(
'This species is a tree.'),
149 '#default_value' => 1,
154 'label' =>
'Organism',
156 'substitute_fields' => array(
◆ tpps_publication()
tpps_publication |
( |
array & |
$form, |
|
|
array |
$values, |
|
|
array |
$form_state |
|
) |
| |
This function creates fields describing the publication.
This includes the secondary authors, status, year, title, abstract, and journal.
- Parameters
-
array | $form | The form to be populated. |
array | $values | The form_state values of the form to be populated. |
array | $form_state | The state of the form to be populated. |
- Returns
- array The populated form.
Definition at line 65 of file page_1_helper.php.
67 $form[
'publication'] = array(
68 '#type' =>
'fieldset',
69 '#title' => t(
'<div class="fieldset-title">Publication Information:</div>'),
71 '#collapsible' => TRUE,
76 $form[
'publication'][
'status'] = array(
78 '#title' => t(
'Publication Status: *'),
81 'In Preparation or Submitted' => t(
'In Preparation or Submitted'),
82 'In Press' => t(
'In Press'),
83 'Published' => t(
'Published'),
86 'callback' =>
'tpps_pub_status',
87 'wrapper' =>
'pubyear',
93 $form[
'publication'][
'title'] = array(
94 '#type' =>
'textfield',
95 '#title' => t(
'Title of Publication/Study: *'),
101 $form[
'publication'][
'abstract'] = array(
102 '#type' =>
'textarea',
103 '#title' => t(
'Abstract/Description: *'),
109 $form[
'publication'][
'journal'] = array(
110 '#type' =>
'textfield',
111 '#title' => t(
'Journal: *'),
112 '#autocomplete_path' =>
'tpps/autocomplete/journal',
114 if(isset($values[
'publication'][
'journal']) && $values[
'publication'][
'journal'] !=
"") {
115 $form[
'publication'][
'journal'][
'#value'] = $values[
'publication'][
'journal'];
tpps_year(array &$form, array $values, array $form_state)
tpps_secondary_authors(array &$form, array $values, array $form_state)
◆ tpps_secondary_authors()
tpps_secondary_authors |
( |
array & |
$form, |
|
|
array |
$values, |
|
|
array |
$form_state |
|
) |
| |
This function creates fields for the secondary authors of the publication.
- Parameters
-
array | $form | The form to be populated. |
array | $values | The form_state values of the form to be populated. |
array | $form_state | The state of the form to be populated. |
- Returns
- array The populated form.
Definition at line 238 of file page_1_helper.php.
240 '#type' =>
'textfield',
241 '#title' =>
"Secondary Author !num",
242 '#autocomplete_path' =>
'tpps/autocomplete/author',
246 'label' =>
'Secondary Author',
247 'callback' =>
'tpps_authors_callback',
248 'substitute_fields' => array(
256 $form[
'publication'][
'secondaryAuthors'][
'#title'] =
"<div class=\"fieldset-title\" style=\"font-size:.8em\">Secondary Author Information</div>";
◆ tpps_user_info()
tpps_user_info |
( |
array & |
$form, |
|
|
array |
$values |
|
) |
| |
This function creates fields describing the primary author.
- Parameters
-
array | $form | The form to be populated. |
array | $values | The form_state values of the form to be populated. |
- Returns
- array The populated form.
Definition at line 19 of file page_1_helper.php.
21 $form[
'primaryAuthor'] = array(
22 '#type' =>
'textfield',
23 '#title' => t(
'Primary Author: *'),
24 '#autocomplete_path' =>
'tpps/autocomplete/author',
25 '#attributes' => array(
26 'data-toggle' => array(
'tooltip'),
27 'data-placement' => array(
'right'),
28 'title' => array(
'First Author of the publication'),
31 if(isset($values[
'primaryAuthor']) && $values[
'primaryAuthor'] !=
"") {
32 $form[
'primaryAuthor'][
'#value'] = $values[
'primaryAuthor'];
35 $form[
'organization'] = array(
36 '#type' =>
'textfield',
37 '#title' => t(
'Organization: *'),
38 '#autocomplete_path' =>
'tpps/autocomplete/organization',
39 '#attributes' => array(
40 'data-toggle' => array(
'tooltip'),
41 'data-placement' => array(
'right'),
42 'title' => array(
'Organization of the Primary Author'),
◆ tpps_year()
tpps_year |
( |
array & |
$form, |
|
|
array |
$values, |
|
|
array |
$form_state |
|
) |
| |
This function creates the year field for the publication.
This field changes its options based on the selection made for publication status.
- Parameters
-
array | $form | The form to be populated. |
array | $values | The form_state values of the form to be populated. |
array | $form_state | The state of the form to be populated. |
- Returns
- array The populated form.
Definition at line 180 of file page_1_helper.php.
182 if (isset($form_state[
'values'][
'publication'][
'status']) and $form_state[
'values'][
'publication'][
'status'] !=
'0') {
183 $pub_status = $form_state[
'values'][
'publication'][
'status'];
185 elseif (isset($form_state[
'saved_values'][
TPPS_PAGE_1][
'publication'][
'status']) and $form_state[
'saved_values'][TPPS_PAGE_1][
'publication'][
'status'] !=
'0') {
186 $pub_status = $form_state[
'saved_values'][
TPPS_PAGE_1][
'publication'][
'status'];
189 if (isset($pub_status) and $pub_status !=
'Published') {
190 $yearArr = array(0 =>
'- Select -');
191 for ($i = 2017; $i <= date(
'Y') + 1; $i++) {
195 elseif (isset($pub_status)) {
196 $yearArr = array(0 =>
'- Select -');
197 for ($i = 1990; $i <= date(
'Y'); $i++) {
202 $yearArr = array(0 =>
'- Select -');
205 $form[
'publication'][
'year'] = array(
207 '#title' => t(
'Year of Publication: *'),
208 '#options' => $yearArr,
210 'invisible' => array(
211 ':input[name="publication[status]"]' => array(
'value' =>
'0'),
214 '#description' => t(
'If your publication has not been published yet, please choose the expected year of publication.'),
215 '#prefix' =>
'<div id="pubyear">',
216 '#suffix' =>
'</div>',