forked from rlabduke/MolProbity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
editpdb_setup1.php
99 lines (89 loc) · 3.51 KB
/
editpdb_setup1.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
<?php # (jEdit options) :folding=explicit:collapseFolds=1:
/*****************************************************************************
This page allows the user to choose a model to edit (e.g. remove chains)
*****************************************************************************/
// Includes go here. For example:
// require_once(MP_BASE_DIR.'/lib/labbook.php');
// public_html/index.php has already included core.php, sessions.php, etc.
// so you don't need to include them explicitly here.
// We use a uniquely named wrapper class to avoid re-defining display(), etc.
class editpdb_setup1_delegate extends BasicDelegate {
#{{{ display - creates the UI for this page
############################################################################
function display($context)
{
echo $this->pageHeader("Edit PDB file");
if(count($_SESSION['models']) > 0)
{
// Choose a default model to select
$lastUsedID = $context['modelID'];
if(!$lastUsedID) $lastUsedID = $_SESSION['lastUsedModelID'];
echo makeEventForm("onChooseOptions");
echo "<h3>Select a model to work with:</h3>";
echo "<p><table width='100%' border='0' cellspacing='0' cellpadding='2'>\n";
$c = MP_TABLE_ALT1;
foreach($_SESSION['models'] as $id => $model)
{
// Alternate row colors:
$c == MP_TABLE_ALT1 ? $c = MP_TABLE_ALT2 : $c = MP_TABLE_ALT1;
echo " <tr bgcolor='$c'>\n";
$checked = ($lastUsedID == $id ? "checked" : "");
echo " <td><input type='radio' name='modelID' value='$id' $checked></td>\n";
echo " <td><b>$model[pdb]</b></td>\n";
echo " <td><small>$model[history]</small></td>\n";
echo " </tr>\n";
}
echo "</table></p>\n";
echo "<p><table width='100%' border='0'><tr>\n";
echo "<td><input type='submit' name='cmd' value='Choose editing options >'></td>\n";
echo "<td align='right'><input type='submit' name='cmd' value='Cancel'></td>\n";
echo "</tr></table></p></form>\n";
// Note the explicit </form> to end the form!
?>
<hr>
<div class='help_info'>
<h4>Editing PDB files</h4>
<i>TODO: Help text about editing goes here</i>
</div>
<?php
}
else
{
echo "No models are available. Please <a href='".makeEventURL("onCall", "upload_setup.php")."'>upload or fetch a PDB file</a> in order to continue.\n";
echo makeEventForm("onChooseOptions");
echo "<p><input type='submit' name='cmd' value='Cancel'></p></form>\n";
}
echo $this->pageFooter();
}
#}}}########################################################################
#{{{ onChooseOptions
############################################################################
/**
* Launches Prekin when the user submits the form.
*/
function onChooseOptions()
{
$req = $_REQUEST;
if($req['cmd'] == 'Cancel')
{
pageReturn();
return;
}
// Otherwise, moving forward:
if(isset($req['modelID']))
{
$ctx = array();
$ctx['modelID'] = $req['modelID'];
pageGoto("editpdb_setup2.php", $ctx);
}
}
#}}}########################################################################
#{{{ a_function_definition - sumary_statement_goes_here
############################################################################
/**
* Documentation for this function.
*/
//function someFunctionName() {}
#}}}########################################################################
}//end of class definition
?>