/** * This function is called automatically by saveLabbook(). * The output won't be ideal, because paths to linked items will be broken. */ function saveLabbookHTML($bookData) { $file = $_SESSION['dataDir'] . "/" . MP_DIR_SYSTEM . "/labbook.html"; // Write the notebook data if ($fp = @fopen($file, "wb")) { fwrite($fp, mpPageHeader("Lab notebook")); fwrite($fp, "<a name='top'>\n<ul>\n"); foreach ($bookData as $num => $entry) { $title = $entry['title']; if ($title == "") { $title = "(no title)"; } fwrite($fp, "<li><a href='#entry{$num}'</a>{$title} [" . formatDayTime($entry['modtime']) . "]</li>\n"); } fwrite($fp, "</ul>\n<br clear='all' />\n"); foreach ($bookData as $num => $entry) { fwrite($fp, "<hr>\n"); fwrite($fp, "<a name='entry{$num}'>\n"); fwrite($fp, formatLabbookEntry($entry)); fwrite($fp, "</a>\n"); fwrite($fp, "<p><a href='#top'>Top</a>\n"); } fwrite($fp, mpPageFooter()); @fclose($fp); return true; } else { return false; } }
require_once MP_BASE_DIR . '/lib/core.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 ############################################################################ if ($_POST['confirm']) { // Must log first or we lose our session ID for the log! mpLog("logout-session:User cleaned up all session files and left the site"); mpDestroySession(); } // Start the page: produces <HTML>, <HEAD>, <BODY> tags echo mpPageHeader("Thanks!"); ############################################################################ ?> <center> Thanks for using MolProbity! All your data files have been erased. <br> <br> <br> <br> <a href="index.php"><img src="img/mplogo_clear.png"><br>Start another MolProbity session</a> <br> <br> <br> <br> <a href="http://kinemage.biochem.duke.edu/"><img src="img/kinhome.gif"><br>Return to the Richardson lab (Kinemage) home page</a>
// 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 ############################################################################ // Security check on filename $file = realpath($_REQUEST['file']); if (!$file || !startsWith($file, realpath($_SESSION['dataDir']))) { mpLog("security:Attempt to access '{$file}' as '{$_REQUEST['file']}'"); die("Security failure: illegal file request '{$_REQUEST['file']}'"); } $name = basename($file); // Start the page: produces <HTML>, <HEAD>, <BODY> tags echo mpPageHeader("Viewing {$name}"); ?> <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> <hr> <?php $in = fopen($file, 'rb');
// 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(); #{{{ a_function_definition - sumary_statement_goes_here ############################################################################ /** * Documentation for this function. */ //function someFunctionName() {} #}}}######################################################################## # MAIN - the beginning of execution for this page ############################################################################ // Start the page: produces <HTML>, <HEAD>, <BODY> tags echo mpPageHeader("Viewing session info for " . session_id()); ?> <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> <hr> <?php echo "<pre>\$_SESSION = ";
} // 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> <hr> <?php echo formatLabbookEntry($entry);
$size = "width='600' height='400'"; } elseif ($kingSize == "small") { $size = "width='700' height='500'"; } elseif ($kingSize == "large") { $size = "width='1300' height='950'"; } elseif ($kingSize == "huge") { $size = "width='1500' height='1100'"; } else { $size = "width='950' height='650'"; } // Good for most people (1024 x 768) // Unfortunately, percentage sizes don't work reliably, as that would be a nicer way to go for "default". $url = $_REQUEST['url']; $file = basename($url); // Start the page: produces <HTML>, <HEAD>, <BODY> tags echo mpPageHeader("KiNG - {$file}"); ############################################################################ ?> <center> <applet id="king_applet" code="king/Kinglet.class" archive="king.jar" <?php echo $size; ?> > <param name="mode" value="flat"> <?php echo " <param name='kinSource' value='{$url}'>\n"; // For kinemage load/save: $kinfiles = implode(' ', listDir($_SESSION['dataDir'] . '/' . MP_DIR_KINS)); echo " <param name='kinfileList' value='{$kinfiles}'>\n"; echo " <param name='kinfileBase' value='{$_SESSION['dataURL']}/" . MP_DIR_KINS . "'>\n"; echo " <param name='kinfileSaveHandler' value='save_kinemage.php?{$_SESSION['sessTag']}'>\n";
function pageHeader($title, $active = "none", $refresh = "") { return mpPageHeader($title, $active, $refresh, $this->headContent()); }