forked from rlabduke/MolProbity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload_pdb_done.php
95 lines (87 loc) · 3.5 KB
/
upload_pdb_done.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php # (jEdit options) :folding=explicit:collapseFolds=1:
/*****************************************************************************
This page displays statistics about the just-uploaded PDB model.
*****************************************************************************/
require_once(MP_BASE_DIR.'/lib/labbook.php');
// We use a uniquely named wrapper class to avoid re-defining display(), etc.
class upload_pdb_done_delegate extends BasicDelegate {
#{{{ display - creates the UI for this page
############################################################################
/**
* Context is an array containing:
* newModel the ID of the model just added, or null on failure
* labbookEntry the labbook entry number for adding this new model
* errorMsg an error diagnosis from failed PDB upload
*/
function display($context)
{
$labbook = openLabbook();
if(!$context['newModel'])
{
if(isset($context['errorMsg']))
{
echo $this->pageHeader("Model upload failed");
echo "For some reason, your file could not be uploaded.\n<ul>\n";
echo "<li>$context[errorMsg]</li>\n";
echo "</ul>\n";
}
else
{
echo $this->pageHeader("Model retrieval failed");
echo "For some reason, your file could not be pulled from the network.\n<ul>\n";
echo "<li>Check the PDB/NDB identifier code and try again.</li>\n";
echo "<li>Check the PDB/NDB web site - their server may be down.</li>\n";
echo "</ul>\n";
}
echo "<p>" . makeEventForm("onTryAgain");
echo "<table border='0' width='100%'><tr>\n";
echo "<td align='left'><input type='submit' name='cmd' value='< Try again'></td>\n";
echo "<td align='right'><input type='submit' name='cmd' value='Cancel'></td>\n";
echo "</tr></table>\n</form></p>\n";
}
else // upload was OK
{
$num = $context['labbookEntry'];
// Start the page: produces <HTML>, <HEAD>, <BODY> tags
echo $this->pageHeader($labbook[$num]['title']);
//echo formatLabbookEntry($labbook[$num]);
echo $labbook[$num]['entry']; // avoid date stamp, title clutter
//echo "<p><a href='".makeEventURL('onEditNotebook', $num)."'>Edit notebook entry</a></p>\n";
echo "<p>" . makeEventForm("onReturn");
echo "<input type='submit' name='cmd' value='Continue >'>\n</form></p>\n";
}
echo $this->pageFooter();
}
#}}}########################################################################
#{{{ onTryAgain
############################################################################
/**
* Documentation for this function.
*/
function onTryAgain()
{
if($_REQUEST['cmd'] == '< Try again')
pageGoto("upload_setup.php");
else
pageReturn();
}
#}}}########################################################################
#{{{ onEditNotebook
############################################################################
/**
* Documentation for this function.
*/
function onEditNotebook($arg)
{
pageCall("notebook_edit.php", array('entryNumber' => $arg));
}
#}}}########################################################################
#{{{ a_function_definition - sumary_statement_goes_here
############################################################################
/**
* Documentation for this function.
*/
//function someFunctionName() {}
#}}}########################################################################
}//end of class definition
?>