From 1a53a577d90c88cea1160a84847df4f641b35334 Mon Sep 17 00:00:00 2001 From: Banana Date: Sun, 12 Feb 2017 12:13:40 +0100 Subject: [PATCH] starting the bookmark edit function. not complete yet. --- ChangeLog | 10 +- TODO | 4 +- VERSION | 2 +- source/version-names.txt | 35 ++++ webroot/view/edit.php | 28 ---- .../view/{edit.inc.php => editlink.inc.php} | 41 +++-- webroot/view/editlink.php | 154 ++++++++++++++++++ webroot/view/home.inc.php | 2 - webroot/view/linkinfo.php | 10 +- 9 files changed, 237 insertions(+), 49 deletions(-) create mode 100644 source/version-names.txt delete mode 100644 webroot/view/edit.php rename webroot/view/{edit.inc.php => editlink.inc.php} (61%) create mode 100644 webroot/view/editlink.php diff --git a/ChangeLog b/ChangeLog index ead926a..48230d6 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,15 +1,20 @@ -version 2.1alpha - Bright Crucible - (tba) +version 2.1 alpha - Guardian of Fire - (tba) + * cleanups + * edit area for a bookmark version 2.0alpha - Bright Crucible - (2017-01-05) + * This is a not prodction ready version of the complete rewrite. * It is now written in PHP based on the idea from Luke Reeves version 1.5 (30 Nov. 2012) + * support phantomjs as a screenshot tool for a bookmark * code updates and cleanup version 1.1 (20 Feb. 2012) + * older and newer link at the top no working * bug with path to the jquery.js file * some statistics @@ -17,7 +22,8 @@ version 1.1 (20 Feb. 2012) * tool to check the bookmarks version 1.0 (15. Feb 2012) -+ jumpin.banana + + * jumpin.banana * tag suggest was not working correctly. * tag rename feature implemented * tag rename case sensitive problem diff --git a/TODO b/TODO index ec5a58a..6a97293 100755 --- a/TODO +++ b/TODO @@ -6,4 +6,6 @@ TODO / Feature list + bookmark js snippet + snapshots + stats -+ private links \ No newline at end of file ++ private links ++ more "secure" user authentication +++ multiple user accounts and stuff \ No newline at end of file diff --git a/VERSION b/VERSION index 5bd2b31..d4c7fe7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0alpha - Bright Crucible - (2017-01-05) \ No newline at end of file +2.1 alpha - Guardian of Fire - (tba) \ No newline at end of file diff --git a/source/version-names.txt b/source/version-names.txt new file mode 100644 index 0000000..71bcb72 --- /dev/null +++ b/source/version-names.txt @@ -0,0 +1,35 @@ +Hub 1: Bright Crucible +Hub 1: Guardian of Fire +Hub 1: Guardian of Ice +Hub 1: Guardian of Steel +Hub 1: Seven Portals (map) +Hub 1: Winnowing Hall + +Hub 2: Caves of Circe +Hub 2: Darkmere +Hub 2: Hypostyle +Hub 2: Sacred Grove +Hub 2: Shadow Wood (map) +Hub 2: Wastelands + +Hub 3: Deathwind Chapel +Hub 3: Dragon Chapel +Hub 3: Griffin Chapel +Hub 3: Heresiarch's Seminary (map) +Hub 3: Orchard of Lamentations +Hub 3: Silent Refectory +Hub 3: Wolf Chapel + +Hub 4: Castle of Grief (map) +Hub 4: Desolate Garden +Hub 4: Dungeons +Hub 4: Effluvium +Hub 4: Forsaken Outpost +Hub 4: Gibbet + +Hub 5: Dark Crucible +Hub 5: Menelkir's Tomb +Hub 5: Necropolis (map) +Hub 5: Traductus' Tomb +Hub 5: Vivarium +Hub 5: Zedek's Tomb \ No newline at end of file diff --git a/webroot/view/edit.php b/webroot/view/edit.php deleted file mode 100644 index d449879..0000000 --- a/webroot/view/edit.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0. - * - */ -?> diff --git a/webroot/view/edit.inc.php b/webroot/view/editlink.inc.php similarity index 61% rename from webroot/view/edit.inc.php rename to webroot/view/editlink.inc.php index c4fe973..3d1b422 100644 --- a/webroot/view/edit.inc.php +++ b/webroot/view/editlink.inc.php @@ -29,14 +29,9 @@ $submitFeedback = false; $formData = false; # very simple security check. -# can be extended in the future. +# can/should be extended in the future. Summoner::simpleAuth(); -$_requestMode = false; -if(isset($_GET['m']) && !empty($_GET['m'])) { - $_requestMode = trim($_GET['m']); - $_requestMode = Summoner::validate($_requestMode,'nospace') ? $_requestMode : "all"; -} $_id = false; if(isset($_GET['id']) && !empty($_GET['id'])) { @@ -44,13 +39,31 @@ if(isset($_GET['id']) && !empty($_GET['id'])) { $_id = Summoner::validate($_id,'nospace') ? $_id : false; } -switch ($_requestMode) { - case 'link': - default: - $linkObj = new Link($DB); - $link = $linkObj->load($_id); - if(empty($link)) { - header("HTTP/1.0 404 Not Found"); - } +$linkObj = new Link($DB); +$link = $linkObj->load($_id); +if(empty($link)) { + header("HTTP/1.0 404 Not Found"); +} + +$formData = $link; +# prepate the tag edit string +$formData['tag'] = ''; +if(!empty($link['tags'])) { + foreach($link['tags'] as $entry) { + $formData['tag'] .= $entry['tag'].','; + } + $formData['tag'] = trim($formData['tag']," ,"); } +# prepate the category string +$formData['category'] = ''; +if(!empty($link['categories'])) { + foreach($link['categories'] as $entry) { + $formData['category'] .= $entry['category'].','; + } + $formData['category'] = trim($formData['category']," ,"); +} + +$existingCategories = $Management->categories(); +$existingTags = $Management->tags(); + diff --git a/webroot/view/editlink.php b/webroot/view/editlink.php new file mode 100644 index 0000000..0d0c34c --- /dev/null +++ b/webroot/view/editlink.php @@ -0,0 +1,154 @@ + + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0. + * + */ +?> + + +
+
Error
+

Something went wrong...

+
+ + + +
+
+ +
+
Error
+

+
+ +
+
Success
+

+
+ +
+
+ + +
+
+

+
+
+
+
+

+
+
+ +
+
+
+

Date added:

+
+
+

+
+
+
+
+

Title:

+
+
+ +
+
+
+
+

Description:

+
+
+ +
+
+
+
+

URL:

+
+
+

+
+
+
+
+

+ Image:
+ If provided +

+
+
+

+ Image if provided +

+ +
+
+ +
+
+

Tags:

+
+
+ + + + +
+
+
+
+
+

Category:

+
+
+ + + + +
+
+
+
+
+ /> +
+
+ +
+
+
diff --git a/webroot/view/home.inc.php b/webroot/view/home.inc.php index 3e0c41a..c3f971c 100644 --- a/webroot/view/home.inc.php +++ b/webroot/view/home.inc.php @@ -157,8 +157,6 @@ if(isset($_POST['data']) && !empty($_POST['data']) && isset($_POST['addnewone']) if(!empty($linkID)) { - - if(!empty($catArr)) { foreach($catArr as $c) { $catObj = new Category($DB); diff --git a/webroot/view/linkinfo.php b/webroot/view/linkinfo.php index e9b10f2..1af5f9b 100644 --- a/webroot/view/linkinfo.php +++ b/webroot/view/linkinfo.php @@ -58,6 +58,14 @@

+
+
+

URL:

+
+
+

+
+

@@ -113,7 +121,7 @@

-- 2.39.5