You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
943 B
PHTML
34 lines
943 B
PHTML
6 years ago
|
<?php
|
||
|
|
||
|
/*
|
||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||
|
*/
|
||
|
|
||
|
$note = new Note("", "", $_SESSION['uid'], null);
|
||
|
|
||
|
if (!empty($VARS['note'])) {
|
||
|
try {
|
||
|
$note = Note::loadNote($VARS['note']);
|
||
|
} catch (Exception $ex) {
|
||
|
// It's a new note I guess
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// TODO: Check for note sharing
|
||
|
if ($note->getOwnerID() != $_SESSION['uid']) {
|
||
|
header("Location: app.php?msg=no_permission");
|
||
|
die();
|
||
|
}
|
||
|
|
||
|
$note->saveNote();
|
||
|
|
||
|
?>
|
||
|
|
||
|
<form action="action.php" method="POST" id="noteform">
|
||
|
<textarea name="content" id="note_content"><?php echo $note->getText(); ?></textarea>
|
||
|
<input type="hidden" name="noteid" value="<?php echo $note->getID(); ?>" />
|
||
|
<input type="hidden" name="color" value="FFFFFF" />
|
||
|
<input type="hidden" name="action" value="savenote" />
|
||
|
</form>
|