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 75ea7feb7ce62c5b4d8a82f91f5101b45353eaf2
parent d4cacbcd04526034975b5a968220243dfc449871
Author: JayVii <jayvii[AT]posteo[DOT]de>
Date:   Fri, 25 Oct 2024 17:02:27 +0200

fix: rename edit_note to show_note

Diffstat:
Mindex.php | 2+-
Dlib/edit.php | 51---------------------------------------------------
Alib/show.php | 51+++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/index.php b/index.php @@ -148,7 +148,7 @@ /* Show action */ if ($_POST["action"] == "show") { - edit_note( + show_note( $_POST["user"], $_POST["category"], $_POST["filename"] diff --git a/lib/edit.php b/lib/edit.php @@ -1,51 +0,0 @@ -<?php - -function edit_note( - string $user, - string $category, - string $filename -) { - - /* Read Note: if it does not exist yet, use empty string */ - $content = read_note($user, $category, $filename); - -?> - -<!-- Show Text Note Form --> -<form action="/" target="_self" method="post" enctype="multipart/form-data"> - <label for="note"><?php echo $GLOBALS["i18n_note"]; ?></label> - <textarea id="note" name="note"><?php echo $content; ?></textarea> - <label for="category"><?php echo $GLOBALS["i18n_category"]; ?></label> - <input - id="category" - name="category" - type="text" - value="<?php echo $category; ?>" - > - <label for="filename"><?php echo $GLOBALS["i18n_filename"]; ?></label> - <input - id="filename" - name="filename" - type="text" - value="<?php echo $filename; ?>" - > - <input - id="filename_t1" - name="filename_t1" - type="hidden" - value="<?php echo $user . "/" . $category . "/" . $filename; ?>" - > - <input - id="action" - name="action" - type="hidden" - value="edit" - > - <input type="submit" value="<?php echo $GLOBALS["i18n_save"]; ?>"> -</form> - -<?php - -} // function - -?> diff --git a/lib/show.php b/lib/show.php @@ -0,0 +1,51 @@ +<?php + +function show_note( + string $user, + string $category, + string $filename +) { + + /* Read Note: if it does not exist yet, use empty string */ + $content = read_note($user, $category, $filename); + +?> + +<!-- Show Text Note Form --> +<form action="/" target="_self" method="post" enctype="multipart/form-data"> + <label for="note"><?php echo $GLOBALS["i18n_note"]; ?></label> + <textarea id="note" name="note"><?php echo $content; ?></textarea> + <label for="category"><?php echo $GLOBALS["i18n_category"]; ?></label> + <input + id="category" + name="category" + type="text" + value="<?php echo $category; ?>" + > + <label for="filename"><?php echo $GLOBALS["i18n_filename"]; ?></label> + <input + id="filename" + name="filename" + type="text" + value="<?php echo $filename; ?>" + > + <input + id="filename_t1" + name="filename_t1" + type="hidden" + value="<?php echo $user . "/" . $category . "/" . $filename; ?>" + > + <input + id="action" + name="action" + type="hidden" + value="edit" + > + <input type="submit" value="<?php echo $GLOBALS["i18n_save"]; ?>"> +</form> + +<?php + +} // function + +?>