get("Note does not exist", false), "ERROR"); } if (!$note->hasWriteAccess(getRequestUser())) { sendJsonResp($Strings->get("You don't have permission to edit this note.", false), "ERROR"); } if (empty($VARS['favorite'])) { $note->setFavorite(!$note->getFavorite()); } else { $note->setFavorite($VARS['favorite'] == true); } $note->saveNote(); sendJsonResp($Strings->get("Note saved", false), "OK", ["note" => $note->toArray()]);