Exemple #1
0
    /**
    * Context is not used.
    */
    function display($context)
    {
        // FUNKY: this breaks the general rule of display() not modifying session data.
        // Set session lifetime to a longer value.
        // Will be overwritten each session restart (i.e. when we leave this page).
        mpSessSetTTL(session_id(), MP_SESSION_LIFETIME_EXT);
        echo $this->pageHeader("Save session", "savesession");
        ?>
<p>To make MolProbity more convenient, you can bookmark this page and return to it later.
We will do our best to preserve all your files, but the unexpected does sometimes happen --
so we recommend that you
<a href='<?php 
        echo makeEventURL('onGoto', 'file_browser.php');
        ?>
'>download</a>
anything really important.
</p>

<p>If you're not going to use these files anymore, please
<a href='<?php 
        echo makeEventURL('onGoto', 'logout.php');
        ?>
'>log out</a>
instead.
We appreciate your help in freeing up disk space for other users.
</p>

<center><p>Your data will be kept until:
<br><b><?php 
        echo formatDayTime(time() + mpSessTimeToLive(session_id()));
        ?>
</b>
</p></center>
<?php 
        echo $this->pageFooter();
    }
Exemple #2
0
/**
* $entry - one of the entries from the labbook, i.e. $labbook[N]
*   This should be a single array with keys 'title', 'ctime', etc.
*   For a new entry, this should be newLabbookEntry().
* $width, $height - the size of the text entry area, in characters.
*
* Returns a formatted chunk of HTML that you can insert in your pages,
* inside a <FORM> element. No submit button is provided.
*
* When submitted, the form will define an array called 'labbookEntry'
* with keys 'title', 'ctime', etc. Look for it in $_REQUEST.
*/
function formEditLabbook($entry, $width = 90, $height = 30)
{
    // HTML entities are interpretted once by the browser inside the form,
    // so title and entry have to be "double protected" to save correctly.
    $s = "";
    $s .= "<input type='text' size='{$width}' name='labbookEntry[title]' value='" . htmlspecialchars($entry['title']) . "'>\n";
    $s .= "<input type='hidden' name='labbookEntry[ctime]' value='{$entry['ctime']}'>\n";
    $s .= "<input type='hidden' name='labbookEntry[modtime]' value='{$entry['modtime']}'>\n";
    $s .= "<input type='hidden' name='labbookEntry[model]' value='{$entry['model']}'>\n";
    $s .= "<input type='hidden' name='labbookEntry[keywords]' value='{$entry['keywords']}'>\n";
    $s .= "<input type='hidden' name='labbookEntry[thumbnail]' value='{$entry['thumbnail']}'>\n";
    $s .= "<br><table border=0 cellpadding=0 cellspacing=3>\n";
    $s .= "<tr align=left valign=top><td>Entry begun:</td><td>" . formatDayTime($entry['ctime']) . "</td></tr>\n";
    $s .= "<tr align=left valign=top><td>Last modified:</td><td>" . formatDayTime($entry['modtime']) . "</td></tr>\n";
    $s .= "</table>";
    if ($entry['model'] != "") {
        $s .= "<br>Model: " . implode(", ", explode("|", $entry['model'])) . "\n";
    }
    if ($entry['keywords'] != "") {
        $s .= "<br>Keywords: " . implode(", ", explode("|", $entry['keywords'])) . "\n";
    }
    $s .= "<br><textarea name='labbookEntry[entry]' cols='{$width}' rows='{$height}'>" . htmlspecialchars($entry['entry']) . "</textarea>\n";
    return $s;
}