/** * 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 { $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(); }
/** * Context is not used. */ function display($context) { mpLog("notebook-view:User visited Lab Notebook page"); $labbook = openLabbook(); echo $this->pageHeader("Lab notebook", "notebook"); // Set time zone form echo makeEventForm("onSetTimezone"); echo "<table border='0' width='100%'><tr>\n"; echo "<td>Current time: " . formatTime(time()) . "</td>\n"; echo "<td>" . timeZonePicker('timezone', $_SESSION['timeZone']); echo "<input type='submit' name='cmd' value='Set time zone'></td>\n"; echo "</tr></table></form>\n"; echo "</div>\n<br>\n<div class='pagecontent'>\n"; // Notebook table of contents echo "<h3><a name='top'</a>Table of contents:</h3>\n"; echo "<div class='indent'>\n"; $this->printTOC($labbook); //onNotebookEdit removed for security reasons (probably nobody was using it) //echo makeEventForm("onNotebookEdit"); //echo "<input type='submit' name='cmd' value='Create new entry'>\n</form>\n"; echo "</div>\n"; // Actual notebook entries foreach ($labbook as $num => $entry) { $this->printEntry($num, $entry); } echo $this->pageFooter(); }
/** * Context is an array containing: * labbookEntry the labbook entry number */ function display($context) { $labbook = openLabbook(); $num = $context['labbookEntry']; 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(); }
/** * If the user requested to save changes, make sure we do that before returning. */ function onSaveEntry() { $req = $_REQUEST; // Did we get an edit request? if ($req['labbookEditCmd'] == "Save") { $labbook = openLabbook(); if (isset($req['entryNumber'])) { $entryNum = $req['entryNumber']; $labbook[$entryNum] = $req['labbookEntry']; mpLog("notebook-edit:User modified existing lab notebook entry"); } else { $entryNum = count($labbook); $labbook[$entryNum] = $req['labbookEntry']; mpLog("notebook-add:User added a new entry to the lab notebook"); } saveLabbook($labbook); } pageReturn(); }
/** * Make sure you say what $context is here. For example: * * Context is an array containing: * labbookEntry the labbook entry number for adding this new model */ function display($context) { echo $this->pageHeader("NAME OF YOUR PAGE GOES HERE"); // Here's a sample page that displays a notebook entry. // The notebook entry number was specified in $context['labbookEntry'] // This is a common way to display results of a background job. // Load and format the notebook entry: $labbook = openLabbook(); $num = $context['labbookEntry']; echo formatLabbookEntry($labbook[$num]); // This line makes a URL that, when clicked, will cause the onEditNotebook() // function to be called. It's declared below... echo "<p><a href='" . makeEventURL('onEditNotebook', $num) . "'>Edit notebook entry</a></p>\n"; // These lines create an HTML form that will call onReturn() to be called // when the user clicks the Continue > button. onReturn() is declared below. echo "<p>" . makeEventForm("onReturn"); echo "<input type='submit' name='cmd' value='Continue >'>\n</form></p>\n"; // Note the explicit </form> to end the form! echo $this->pageFooter(); }
/** * Context is an array containing: * labbookEntry the labbook entry number * modelID the ID of the new Reduced model */ function display($context) { $labbook = openLabbook(); $num = $context['labbookEntry']; 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"; $modelID = $context['modelID']; $model = $_SESSION['models'][$modelID]; if ($modelID && $model && $model['isReduced'] && $model['isUserSupplied']) { $url = makeEventURL('onDownload', $_SESSION['dataDir'] . '/' . MP_DIR_MODELS . '/' . $model['pdb']); ?> <script language='JavaScript'> function confirmPdbDownload() { if(window.confirm("Your PDB file has been changed. Would you like to download the new coordinates now?")) window.location.href = "<?php echo $url; ?> " } // This nifty function means we won't override other ONLOAD handlers function windowOnload(f) { var prev = window.onload; window.onload = function() { if(prev) prev(); f(); } } windowOnload(confirmPdbDownload) </script> <?php } echo $this->pageFooter(); }
/** * Context is not used. */ function display($context) { echo $this->pageHeader("Main page", "welcome"); // echo mpSerialize($_SESSION['models']); if (count($_SESSION['models']) > 0 && $_SESSION['lastUsedModelID']) { echo "<h5 class='welcome'>Suggested Tools (<a href='" . makeEventURL("onGoto", "sitemap.php") . "'>all tools</a>)</h5>\n"; echo "<div class='indent'>\n"; echo makeEventForm("onSetWorkingModel") . "\n"; $this->displayModels($context); echo "</form>\n"; if (isset($_SESSION['ensembles'][$_SESSION['lastUsedModelID']])) { $this->displayEnsembleTools($context); } else { $this->displayModelTools($context); } echo "</div></div>\n<br>\n<div class='pagecontent'>\n"; } // Entries / files should display if we have any entries. // We can have entries with no models -- e.g., uploading a het dictionary first thing. $labbook = openLabbook(); if (count($labbook) > 0) { $this->displayEntries($context, $labbook); echo "<br>\n"; //echo "</div>\n<br>\n<div class='pagecontent'>\n"; //$this->displayFiles($context); //$this->displayFilesJS($context); $this->displayAllFiles($context); echo "</div>\n<br>\n<div class='pagecontent'>\n"; } $this->displayUpload($context); echo "</div>\n<br>\n<div class='pagecontent'>\n"; ?> <table border='0' width='100%'><tr valign='top'><td width='45%'> <h3>Walkthroughs, tutorials, and usage FAQs:</h3> <p><b><?php echo "<a href='" . makeEventURL("onGoto", "helper_xray.php") . "'>Evaluate X-ray structure</a>"; ?> :</b> Typical steps for a published X-ray crystal structure or one still undergoing refinement.</p> <p><b><?php echo "<a href='" . makeEventURL("onGoto", "helper_nmr.php") . "'>Evaluate NMR structure</a>"; ?> :</b> Typical steps for a published NMR ensemble or one still undergoing refinement.</p> <p><b><?php echo "<a href='" . makeEventURL("onGoto", "helper_rebuild.php") . "'>Fix up structure</a>"; ?> :</b> Rebuild the model to remove outliers as part of the refinement cycle.</p> <p><b><?php echo "<a href='" . makeEventURL("onGoto", "helper_kinemage.php") . "'>Work with kinemages</a>"; ?> :</b> Create and view interactive 3-D graphics from your web browser.</p> <p><b><a target="_blank" href="help/validation_options/validation_options.html">Guide to validation options</a>:</b> Choose validations appropriate to a structure.</p> <?php // <h3>What's new in 4.0:</h3><ul> // <li>Updated Reduce-added hydrogen lengths to be more consistent with other crystallography software.</li> // <li>New <a href='http://kinemage.biochem.duke.edu/databases/top8000.php' target='_blank'>Top8000</a> Ramachandran validation information.</li> // <li>Allows use of both electron cloud and nuclear x-H bond-lengths. Read more about this change <a href='".makeEventURL("onGoto", "helper_hydrogens.php")."'>here</a>.</li> // <li>Full support for 2-character CHAINIDs added. 4-character SEGIDs also supported in place of CHAINIDs.</li> // </ul> echo "<h3>What's new in 4.2:</h3><ul>\n <li>Cis-peptide identification, markup and statistics now available.</li>\n <li>CaBLAM Cα-based validation of protein backbone and secondary structure now available.</li>\n <li>Rotamer validation now uses <a href='http://kinemage.biochem.duke.edu/databases/top8000.php' target='_blank'>Top8000</a> rotamer distributions. Favored vs Allowed distinction introduced for rotamers.</li>\n <li>New coloring scheme in multicriterion chart encodes outlier severity at a glance.</li>\n <li><a target='_blank' href='help/validation_options/validation_options.html'>Online tutorial</a> explaining markup and methods</li>\n <li>We now use a conformation-dependent library (CDL) from Dunbrack and Karplus for geometry analysis if requested.\n </ul>\n <h3>What's new in 4.1:</h3><ul>\n <li>Validation analysis now powered by CCTBX. Also adds geometry regularization for N/Q/H flip corrections. Read more about this change <a href='" . makeEventURL("onGoto", "helper_cctbx.php") . "'>here</a>.</li>\n <li>Alternate conformations now handled for validation analysis.</li>\n </ul>\n </td><td width='10%'><!-- horizontal spacer --></td><td width=='45%'>"; ?> <h3>Citations, science, and technical FAQs:</h3> <p><b><a href='help/about.html' target='_blank'>Cite MolProbity</a></b>: <small>Chen et al. (2010) <a href="http://kinemage.biochem.duke.edu/lab/papers.php" target="_blank">MolProbity: all-atom structure validation for macromolecular crystallography.</a> Acta Crystallographica D66:12-21. </p> <center>and/or</center> <p>Davis et al. (2007) <a href="http://kinemage.biochem.duke.edu/lab/papers.php" target="_blank">MolProbity: all-atom contacts and structure validation for proteins and nucleic acids.</a> Nucleic Acids Research 35:W375-W383. </small></p> <p><b><a href='help/about.html' target='_blank'>Cite KiNG</a></b>: <small>Chen et al. (2009) <a href="http://kinemage.biochem.duke.edu/lab/papers.php" target="_blank">KiNG (Kinemage, Next Generation): A versatile interactive molecular and scientific visualization program.</a> Protein Science 18:2403-2409. </small></p> <p><b><a href='help/about.html' target='_blank'>Cite CCTBX</a></b>: <small>Grosse-Kunstleve et al. (2002) <a href="http://scripts.iucr.org/cgi-bin/paper?ks0118" target="_blank">The Computational Crystallography Toolbox: crystallographic algorithms in a reusable software framework.</a> J. Appl. Cryst. 35:126-136. </small></p> <p><b><?php echo "<a href='" . makeEventURL("onGoto", "helper_hydrogens.php") . "'>About hydrogens</a>"; ?> :</b> Why have the hydrogen bondlengths changed?</p> <p><b><a href='help/java.html' target='_blank'>Installing Java</a></b>: how to make kinemage graphics work in your browser.</p> <p><b><?php echo "<a href='" . makeEventURL("onGoto", "get_molprobity.php") . "'>Download MolProbity</a>"; ?> </b>: how can I run a private MolProbity server, or run from the command line?</p> <p><small><i>NB: the back button doesn't work inside MolProbity</i></small></p><!-- by request of DCR --> </td></tr></table> <?php // These are too annoying to have at the top all the time $this->displayWarnings($context); echo $this->pageFooter(); }
/** * Returns the entry number of the new entry. */ function addLabbookEntry($title, $text, $model = "", $keywords = "", $thumbnail = null) { $labbook = openLabbook(); $entry = newLabbookEntry($model, $keywords); $entry['title'] = $title; $entry['entry'] = $text; if ($thumbnail) { $entry['thumbnail'] = $thumbnail; } // else it stays the default $entryNum = count($labbook); $labbook[$entryNum] = $entry; saveLabbook($labbook); return $entryNum; }
// Pages in subdirectories of lib/ or public_html/ will need more "/.." 's. if (!defined('MP_BASE_DIR')) { define('MP_BASE_DIR', realpath(dirname(__FILE__) . '/..')); } // 2. Include core functionality - defines constants, etc. require_once MP_BASE_DIR . '/lib/core.php'; require_once MP_BASE_DIR . '/lib/labbook.php'; // 3. Restore session data. If you don't want to access the session // data for some reason, you must call mpInitEnvirons() instead. mpStartSession(); // 4. For pages that want to see the session but not change it, such as // pages that are refreshing periodically to monitor a background job. mpSessReadOnly(); # MAIN - the beginning of execution for this page ############################################################################ $labbook = openLabbook(); $entry = $labbook[$_REQUEST['entry_num']]; // Start the page: produces <HTML>, <HEAD>, <BODY> tags echo mpPageHeader("{$entry['title']}"); ?> <form> <table border='0' width='100%'><tr> <td align='left'><small> When finished, you should <input type="button" value="close this window" language="JavaScript" onclick="self.close();">. </small></td><td align='right'><small><i> Hint: Use File | Save As... to save a copy of this page. </i></small></td> </tr></table> </form>