forked from rlabduke/MolProbity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upload_other_done.php
128 lines (120 loc) · 4.96 KB
/
upload_other_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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
<?php # (jEdit options) :folding=explicit:collapseFolds=1:
/*****************************************************************************
This page displays statistics about the just-uploaded PDB model.
*****************************************************************************/
// We use a uniquely named wrapper class to avoid re-defining display(), etc.
class upload_other_done_delegate extends BasicDelegate {
#{{{ display - creates the UI for this page
############################################################################
/**
* Context is an array containing:
* type the type of file uploaded. One of 'map', ...
* errorMsg an error diagnosis from failed PDB upload
* mapName the name of the just-added map file (map upload only)
*/
function display($context)
{
if(isset($context['errorMsg']))
{
echo $this->pageHeader("File upload failed");
echo "For some reason, your file could not be uploaded.\n<ul>\n";
echo "<li>$context[errorMsg]</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";
echo $this->pageFooter();
}
else // upload was OK
{
$type = $context['type'];
if($type == 'kin') $this->displayKin($context);
elseif($type == 'xray') $this->displayXray($context);
elseif($type == 'map') $this->displayMap($context);
elseif($type == 'hetdict') $this->displayHetDict($context);
}
}
#}}}########################################################################
#{{{ displayKin
############################################################################
function displayKin($context)
{
echo $this->pageHeader("Kinemage $context[kinName] added");
echo "Your kinemage has been uploaded. You may now view it in KiNG:\n";
echo "<ul><li>".linkKinemage($context['kinName'])."</li></ul>\n";
echo "<p>" . makeEventForm("onReturn");
echo "<input type='submit' name='cmd' value='Continue >'>\n</form></p>\n";
echo $this->pageFooter();
}
#}}}########################################################################
#{{{ displayXray
############################################################################
function displayXray($context)
{
echo $this->pageHeader("Xray $context[xrayName] added");
echo "<p>The following mtz files are now available:\n";
echo "<ul>\n";
foreach($_SESSION['mtzs'] as $mtz)
{
$xrayPath = "$_SESSION[dataDir]/".MP_DIR_XRAYDATA."/$mtz";
echo "<li><b>$mtz</b> (".formatFilesize(filesize($xrayPath)).")</li>\n";
}
echo "</ul>\n</p>\n";
echo "<p>" . makeEventForm("onReturn");
echo "<input type='submit' name='cmd' value='Continue >'>\n</form></p>\n";
echo $this->pageFooter();
}
#}}}########################################################################
#{{{ displayMap
############################################################################
function displayMap($context)
{
echo $this->pageHeader("Map $context[mapName] added");
echo "<p>The following electron density maps are now available:\n";
echo "<ul>\n";
foreach($_SESSION['edmaps'] as $map)
{
$mapPath = "$_SESSION[dataDir]/".MP_DIR_EDMAPS."/$map";
echo "<li><b>$map</b> (".formatFilesize(filesize($mapPath)).")</li>\n";
}
echo "</ul>\n</p>\n";
echo "<p>" . makeEventForm("onReturn");
echo "<input type='submit' name='cmd' value='Continue >'>\n</form></p>\n";
echo $this->pageFooter();
}
#}}}########################################################################
#{{{ displayHetDict
############################################################################
function displayHetDict($context)
{
echo $this->pageHeader("Custom het dictionary added");
echo "<p>Your custom heterogen dictionary will be used for all future work in this session.</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();
}
#}}}########################################################################
#{{{ a_function_definition - sumary_statement_goes_here
############################################################################
/**
* Documentation for this function.
*/
//function someFunctionName() {}
#}}}########################################################################
}//end of class definition
?>