pub / rememori

Simple file-based bookmarking and notes application
git clone https://src.jayvii.de/pub/rememori.git
Home | Log | Files | Exports | Refs | README | RSS

commit 713bdb4f57e33b9baf32b7185c6aea495b1d3596
parent 96ad230a982f97a9f538188656d993f1c6882a2d
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Fri, 25 Oct 2024 12:46:50 +0200

wip: initial index page

Diffstat:
Mconfig/i18n.php | 6++++--
Aindex.php | 89+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 93 insertions(+), 2 deletions(-)

diff --git a/config/i18n.php b/config/i18n.php @@ -9,9 +9,11 @@ if ($lang == "en") { $GLOBALS["i18n_note"] = "Note"; $GLOBALS["i18n_category"] = "Category"; $GLOBALS["i18n_filename"] = "File name"; - $GLOBALS["i18n_save"] = "Save"; + $GLOBALS["i18n_save"] = "Save note"; $GLOBALS["i18n_ctime"] = "Last edited"; - $GLOBALS["i18n_edit"] = "Edit"; + $GLOBALS["i18n_edit"] = "Edit note"; + $GLOBALS["i18n_new"] = "New note"; + } ?> diff --git a/index.php b/index.php @@ -0,0 +1,89 @@ +<!-- SPDX-License-Identifier: AGPL-3.0-or-later + SPDX-FileCopyrightText: 2024 JayVii <jayvii[AT]posteo[DOT]de> +--> + +<?php + + /* DEVELOPMENT SETTINGS */ + $_POST["action"] = "list_all"; + $_POST["user"] = "test_user"; + + /* Load library functions */ + foreach (glob("./lib/*.php") as $lib) { + include($lib); + } + + /* Load configurations */ + foreach (glob("./config/*.php") as $conf) { + include($conf); + } + +?> + +<!DOCTYPE html> +<html> + + <head> + <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <title>Rememori</title> + <link rel="stylesheet" type="text/css" href="assets/css/simple.min.css"/> + <link rel="stylesheet" href="assets/css/custom.css" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + </head> + + <body> + + <header> + <!-- Buttons --> + <nav> + <!-- New Note: Edit-Action --> + <form action="/" target="_self" method="post"> + <input + id="user" + name="user" + type="hidden" + value="<?php echo $_POST["user"]; ?>" + > + <input + id="category" + name="category" + type="hidden" + value="" + > + <input + id="filename" + name="filename" + type="hidden" + value="" + > + <input + id="action" + name="action" + type="hidden" + value="edit" + > + <input + type="submit" + value="<?php echo $GLOBALS["i18n_new"]; ?>" + > + </form> + </nav> + <!-- Headline --> + <h1>Rememori</h1> + </header> + +<?php + + /* Listing action */ + if ($_POST["action"] == "list_all") { + + /* Fetch all categories of the user */ + foreach (glob("./data/" . $_POST["user"] . "/*") as $categorypath) { + list_notes($_POST["user"], basename($categorypath)); + } + } + +?> + + </body> +</html>