]> 91.132.146.200 Git - insipid.git/commitdiff
starting the bookmark edit function. not complete yet.
authorBanana <banana@optimus.de>
Sun, 12 Feb 2017 11:13:40 +0000 (12:13 +0100)
committerBanana <banana@optimus.de>
Sun, 12 Feb 2017 11:13:40 +0000 (12:13 +0100)
ChangeLog
TODO
VERSION
source/version-names.txt [new file with mode: 0644]
webroot/view/edit.inc.php [deleted file]
webroot/view/edit.php [deleted file]
webroot/view/editlink.inc.php [new file with mode: 0644]
webroot/view/editlink.php [new file with mode: 0644]
webroot/view/home.inc.php
webroot/view/linkinfo.php

index ead926ae2b2e2c8ecc31d01b6ccf71f8c2ab7e83..48230d611b621678903f17e0c5895dfdda1867d0 100755 (executable)
--- 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 ec5a58ad7cc9ca44e36d2994f9804431ce00dedf..6a97293053a3a5ed9c6bc5aa90266c2056026aaa 100755 (executable)
--- 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 5bd2b311c71be1895bdfbdc681c7a695a62f5b0d..d4c7fe7f75c3052015d6b579a13ae2633012a77b 100644 (file)
--- 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 (file)
index 0000000..71bcb72
--- /dev/null
@@ -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.inc.php b/webroot/view/edit.inc.php
deleted file mode 100644 (file)
index c4fe973..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-<?php
-/**
- * Insipid
- * Personal web-bookmark-system
- *
- * Copyright 2016-2017 Johannes Keßler
- *
- * Development starting from 2011: Johannes Keßler
- * https://www.bananas-playground.net/projekt/insipid/
- *
- * creator:
- * Luke Reeves <luke@neuro-tech.net>
- *
- * 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.
- *
- */
-$submitFeedback = false;
-$formData = false;
-
-# very simple security check.
-# can 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'])) {
-    $_id = trim($_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");
-        }
-}
-
diff --git a/webroot/view/edit.php b/webroot/view/edit.php
deleted file mode 100644 (file)
index d449879..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-<?php
-/**
- * Insipid
- * Personal web-bookmark-system
- *
- * Copyright 2016-2017 Johannes Keßler
- *
- * Development starting from 2011: Johannes Keßler
- * https://www.bananas-playground.net/projekt/insipid/
- *
- * creator:
- * Luke Reeves <luke@neuro-tech.net>
- *
- * 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/editlink.inc.php b/webroot/view/editlink.inc.php
new file mode 100644 (file)
index 0000000..3d1b422
--- /dev/null
@@ -0,0 +1,69 @@
+<?php
+/**
+ * Insipid
+ * Personal web-bookmark-system
+ *
+ * Copyright 2016-2017 Johannes Keßler
+ *
+ * Development starting from 2011: Johannes Keßler
+ * https://www.bananas-playground.net/projekt/insipid/
+ *
+ * creator:
+ * Luke Reeves <luke@neuro-tech.net>
+ *
+ * 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.
+ *
+ */
+$submitFeedback = false;
+$formData = false;
+
+# very simple security check.
+# can/should be extended in the future.
+Summoner::simpleAuth();
+
+
+$_id = false;
+if(isset($_GET['id']) && !empty($_GET['id'])) {
+    $_id = trim($_GET['id']);
+    $_id = Summoner::validate($_id,'nospace') ? $_id : false;
+}
+
+$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 (file)
index 0000000..0d0c34c
--- /dev/null
@@ -0,0 +1,154 @@
+<?php
+/**
+ * Insipid
+ * Personal web-bookmark-system
+ *
+ * Copyright 2016-2017 Johannes Keßler
+ *
+ * Development starting from 2011: Johannes Keßler
+ * https://www.bananas-playground.net/projekt/insipid/
+ *
+ * creator:
+ * Luke Reeves <luke@neuro-tech.net>
+ *
+ * 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.
+ *
+ */
+?>
+
+<?php if(empty($link)) { ?>
+<div class="callout alert">
+       <h5>Error</h5>
+       <p>Something went wrong...</p>
+</div>
+<?php } ?>
+
+<?php if(!empty($submitFeedback)) { ?>
+<div class="row">
+       <div class="large-12 columns">
+<?php if($submitFeedback['status'] == "error") { ?>
+               <div class="callout alert">
+                       <h5>Error</h5>
+                       <p><?php echo $submitFeedback['message']; ?></p>
+               </div>
+<?php } else { ?>
+               <div class="callout success">
+                       <h5>Success</h5>
+                       <p><?php echo $submitFeedback['message']; ?></p>
+               </div>
+<?php } ?>
+       </div>
+</div>
+<?php } ?>
+
+<div class="row">
+       <div class="large-12 columns">
+               <h1 class="text-center"><?php echo $link['title']; ?></h1>
+       </div>
+</div>
+<div class="row expanded">
+       <div class="large-12 columns">
+               <p class="text-right"><a href="index.php" title="... back to home" class="tiny button"><i class="fi-home"></i></a></p>
+       </div>
+</div>
+
+<form method="post">
+       <div class="row">
+       <div class="small-12 medium-2 columns">
+               <p>Date added:</p>
+       </div>
+       <div class="small-12 medium-10 columns">
+               <p><?php echo $link['created']; ?></p>
+       </div>
+    </div>
+    <div class="row">
+       <div class="small-12 medium-2 columns">
+               <p>Title:</p>
+       </div>
+       <div class="small-12 medium-10 columns">
+               <input type="text" name="data[title]" value="<?php echo Summoner::ifset($formData, 'title'); ?>" />
+       </div>
+    </div>
+    <div class="row">
+       <div class="small-12 medium-2 columns">
+               <p>Description:</p>
+       </div>
+       <div class="small-12 medium-10 columns">
+               <input type="text" name="data[description]" value="<?php echo Summoner::ifset($formData, 'description'); ?>" />
+       </div>
+    </div>
+    <div class="row">
+       <div class="small-12 medium-2 columns">
+               <p>URL:</p>
+       </div>
+       <div class="small-12 medium-10 columns">
+               <p><?php echo $link['link']; ?></p>
+       </div>
+    </div>
+    <div class="row">
+       <div class="small-12 medium-2 columns">
+               <p>
+                       Image:<br />
+                       <small>If provided</small>
+               </p>
+       </div>
+       <div class="small-12 medium-10 columns">
+               <p>
+                       <img class="linkthumbnail" src="<?php echo $link['image']; ?>" alt="Image if provided">
+               </p>
+               <input type="text" name="data[image]" value="<?php echo Summoner::ifset($formData, 'image'); ?>" />
+       </div>
+    </div>
+
+    <div class="row">
+       <div class="small-12 medium-2 columns">
+               <p>Tags:</p>
+       </div>
+       <div class="small-12 medium-10 columns">
+           <input type="text" name="data[tag]" list="taglist"
+                               class="flexdatalist" data-min-length='1' multiple='multiple'
+                               value="<?php echo Summoner::ifset($formData, 'tag'); ?>" />
+                       <datalist id="taglist">
+                       <?php foreach($existingTags as $t) { ?>
+                               <option value="<?php echo $t['name']; ?>">
+                       <?php } ?>
+            </datalist>
+            <br />
+       </div>
+    </div>
+    <div class="row">
+       <div class="small-12 medium-2 columns">
+               <p>Category:</p>
+       </div>
+       <div class="small-12 medium-10 columns">
+           <input type="text" name="data[category]" list="categorylist"
+                               class="flexdatalist" data-min-length='1' multiple='multiple'
+                               value="<?php echo Summoner::ifset($formData, 'category'); ?>" />
+                       <datalist id="categorylist">
+                       <?php foreach($existingCategories as $c) { ?>
+                               <option value="<?php echo $c['name']; ?>">
+                       <?php } ?>
+            </datalist>
+            <br />
+       </div>
+    </div>
+    <div class="row">
+       <div class="large-8 columns">
+               <input type="checkbox" name="data[private]" value="1" <?php if(Summoner::ifset($formData, 'private')) echo "checked"; ?> /><label>Private</label>
+       </div>
+       <div class="large-4 columns text-right" >
+               <input type="submit" class="button" name="editlink" value="Update">
+       </div>
+    </div>
+</form>
index 3e0c41a7e9d443934f1d91617ab8d9a78d6cdda8..c3f971ca0db706a59a47210f8fce874f5a147470 100644 (file)
@@ -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);
index e9b10f267286378bb6de0c064487c00115181035..1af5f9b55d3f9098b1c21d00b25cb315d2b55e2a 100644 (file)
                <p><?php echo $link['description']; ?></p>
        </div>
 </div>
+<div class="row">
+       <div class="small-12 medium-2 columns">
+               <p>URL:</p>
+       </div>
+       <div class="small-12 medium-10 columns">
+               <p><a href="<?php echo $link['link']; ?>" target="_blank"><?php echo $link['link']; ?></a></p>
+       </div>
+</div>
 <div class="row">
        <div class="small-12 medium-2 columns">
                <p>
 </div>
 <div class="row">
        <div class="small-12 medium-12 columns text-right">
-        <a href="index.php?p=edit&m=link&id=<?php echo $link['hash']; ?>" class="button tiny alert"><i class="fi-page-edit"></i> edit</a>
+        <a href="index.php?p=editlink&id=<?php echo $link['hash']; ?>" class="button tiny alert"><i class="fi-page-edit"></i> edit</a>
        </div>
 </div>