32 $image_path = drupal_get_path(
'module',
'tpps') .
'/images/';
33 $prefix_text =
"<div><figure style=\"text-align:center;\"><img style=\"max-height:100%;max-width:100%;\" src=\"{$image_path}TPPS-1.png\"></figure>";
34 $prefix_text .=
"<div id=\"landing-buttons\">";
35 $prefix_text .=
"<a href=\"https://tpps.readthedocs.io/en/latest/\" target=\"blank\" class=\"landing-button\"><button type=\"button\" class=\"btn btn-primary\">TPPS Documentation</button></a>";
36 $prefix_text .=
"<a href=\"$base_url/tpps/details\" target=\"blank\" class=\"landing-button\"><button type=\"button\" class=\"btn btn-primary\">TPPS Studies</button></a>";
37 if (module_exists(
'cartogratree')) {
38 $prefix_text .=
"<a href=\"$base_url/ct\" target=\"blank\" class=\"landing-button\"><button type=\"button\" class=\"btn btn-primary\">CartograPlant</button></a>";
40 $prefix_text .=
"</div></div>";
43 if(!isset($user->mail)) {
44 $prefix_text .=
"<div style='text-align: center'>To begin submitting your data, please ensure that you're logged in to access upload features on this page.</div>";
45 $prefix_text .=
"<div style='text-align: center'>If you do not have an account <a style='color: #e2b448;' href='/user/register'>register one here</a> or <a style='color: #e2b448' href='/user/login'>click here to login</a></div>";
48 $form[
'description'] = array(
49 '#markup' => $prefix_text,
53 if (isset($user->mail)) {
55 $options_arr = array();
56 $options_arr[
'new'] =
'Create new TPPS Submission';
59 'status' =>
'Incomplete',
63 foreach ($states as $state) {
64 if (empty($state[
'tpps_type']) or $state[
'tpps_type'] !=
'tppsc') {
65 if ($state != NULL and isset($state[
'saved_values'][
TPPS_PAGE_1][
'publication'][
'title'])) {
66 $title = ($state[
'saved_values'][
TPPS_PAGE_1][
'publication'][
'title'] != NULL) ? $state[
'saved_values'][TPPS_PAGE_1][
'publication'][
'title'] :
"No Title";
67 $tgdr_id = $state[
'accession'];
68 $options_arr[
"$tgdr_id"] =
"$title";
71 if (isset($state) and !isset($state[
'saved_values'][TPPS_PAGE_1])) {
78 if (count($options_arr) > 1) {
80 $form[
'accession'] = array(
82 '#title' => t(
'Would you like to load an old TPPS submission, or create a new one?'),
83 '#options' => $options_arr,
84 '#default_value' => isset($form_state[
'saved_values'][
'frontpage'][
'accession']) ? $form_state[
'saved_values'][
'frontpage'][
'accession'] :
'new',
90 $form[
'custom_accession_check'] = array(
91 '#type' =>
'checkbox',
92 '#title' => t(
'I would like to use a custom accession number'),
93 '#description' => t(
'Specify a custom accession number. This feature is available only to users with administrative access, and is generally not required or recommended.'),
96 $form[
'custom_accession'] = array(
97 '#type' =>
'textfield',
98 '#title' => t(
'Custom Accession number'),
101 ':input[name="custom_accession_check"]' => array(
'checked' => TRUE),
104 '#description' => t(
'Use this field to specify a custom accession number. Must be of the format TGDR###'),
108 if (isset($user->mail)) {
109 $form[
'Next'] = array(
111 '#value' => t(
'Submit Data'),
tpps_front_create_form(array &$form, array $form_state)
tpps_delete_submission($accession, $redirect=TRUE)
tpps_load_submission_multiple(array $conditions=array(), $state=TRUE)