Go to the source code of this file.
◆ tpps_admin_panel_logs()
tpps_admin_panel_logs |
( |
array |
$form, |
|
|
array & |
$form_state, |
|
|
|
$job_log_file = NULL |
|
) |
| |
Creates the administrative panel form.
If the administrator is looking at one specific TPPS submission, they are provided with options to reject the submission and leave a reason for the rejection, or to approve the submission and start loading the data into the database. If the submission includes CartograPlant layers with environmental parameters, the administrator will need to select the kind of parameter the user has selected - an attr_id, or a cvterm. This will be important when the submission is recording the environmental data of the plants.
- Parameters
-
array | $form | The form being created. |
array | $form_state | The state of the form being created. |
- Returns
- array The administrative panel logs form.
Definition at line 21 of file logs.php.
29 drupal_add_js(drupal_get_path(
'module',
'tpps') .
TPPS_JS_PATH);
30 drupal_add_css(drupal_get_path(
'module',
'tpps') .
TPPS_CSS_PATH);
32 $job_log_file_parts = explode(
'_', $job_log_file);
33 $accession = $job_log_file_parts[0];
34 $job_id = $job_log_file_parts[1];
35 $job_log_file = $job_log_file .
'.txt';
38 $markup .=
"<a href='/tpps-admin-panel/$accession'>Return to TPPS Admin Panel - $accession</a><br />";
39 $markup .=
"<a target='_blank' href='/admin/tripal/tripal_jobs/view/$job_id'>View Tripal Job ID: $job_id</a><br />";
40 $markup .=
"This page refreshes every 10 seconds.<br />";
41 $markup .=
"<iframe id='iframe_log' height='400px;' width='100%' src='/sites/default/files/tpps_job_logs/" . $job_log_file .
"'></iframe>";
42 $markup .=
'<script type="text/javascript">';
43 $markup .=
"jQuery(document).ready(function() {";
44 $markup .=
" setInterval(function() {";
45 $markup .=
" var url='/sites/default/files/tpps_job_logs/$job_log_file';";
46 $markup .=
" var nocache=Math.floor(Date.now() / 1000);";
47 $markup .=
" jQuery('#iframe_log').attr('src', url + '?nocache=' + nocache);";
48 $markup .=
" }, 10000);";
49 $markup .=
" jQuery('#iframe_log').on('load', function() {";
51 $markup .=
" jQuery('#iframe_log').contents().scrollTop(jQuery('#iframe_log').contents().height());";
54 $markup .=
'</script>';
56 $form[
'markup'] = array(