]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Interface design: copy description and tags (when creating a bookmark from another...
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 14 Mar 2008 16:21:58 +0000 (16:21 +0000)
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Fri, 14 Mar 2008 16:21:58 +0000 (16:21 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@86 b3834d28-1941-0410-a4f8-b48e95affb8f

bookmarks.php
templates/bookmarks.tpl.php

index 4c0a2a9c1ec76e1fb886e007e324fe2689f1c9d2..ff1d65b8b9d30355d9f88a7fce6b231447ce9f70 100644 (file)
@@ -131,9 +131,9 @@ if ($loggedon && isset($_POST['submitted'])) {
 if (isset($_GET['action']) && ($_GET['action'] == "add")) {
     // If the bookmark exists already, edit the original
     if ($bookmarkservice->bookmarkExists(stripslashes($_GET['address']), $currentUserID)) {
-        $bookmark =& $bookmarkservice->getBookmarkByAddress(stripslashes($_GET['address']));
-        $popup = (isset($_GET['popup'])) ? '?popup=1' : '';
-        header('Location: '. createURL('edit', $bookmark['bId'] . $popup));
+       $bookmark =& $bookmarkservice->getBookmarks(0, NULL, $currentUserID, NULL, NULL, NULL, NULL, NULL, NULL, md5(stripslashes($_GET['address'])));       
+       $popup = (isset($_GET['popup'])) ? '?popup=1' : '';
+        header('Location: '. createURL('edit', $bookmark['bookmarks'][0]['bId'] . $popup));
         exit();
     }
     $templatename = 'editbookmark.tpl';
index 84a67fe565f3bded98c1457a203dd0f4a02a37ef..d48aa1b960951345e362ad306d2aa5f06aa4c20f 100644 (file)
@@ -96,11 +96,13 @@ window.onload = playerLoad;
         }
 
         $cats = '';
+       $tagsForCopy = '';
         $tags = $row['tags'];
         foreach(array_keys($tags) as $key) {
 
             $tag =& $tags[$key];
             $cats .= '<a href="'. sprintf($cat_url, filter($row['username'], 'url'), filter($tag, 'url')) .'" rel="tag">'. filter($tag) .'</a>, ';
+           $tagsForCopy.= $tag.',';
         }
         $cats = substr($cats, 0, -2);
         if ($cats != '') {
@@ -136,11 +138,11 @@ window.onload = playerLoad;
         }
 
         // Copy link
-        if ($userservice->isLoggedOn() && ($logged_on_userid != $row['uId'])) {
+        if ($userservice->isLoggedOn() && ($logged_on_userid != $row['uId']) && !$bookmarkservice->bookmarkExists($row['bAddress'], $logged_on_userid)) {
             // Get the username of the current user
             $currentUser = $userservice->getCurrentUser();
             $currentUsername = $currentUser[$userservice->getFieldName('username')];
-            $copy .= ' - <a href="'. createURL('bookmarks', $currentUsername .'?action=add&amp;address='. urlencode($row['bAddress']) .'&amp;title='. urlencode($row['bTitle'])) .'">'. T_('Copy') .'</a>';   
+            $copy .= ' - <a href="'. createURL('bookmarks', $currentUsername .'?action=add&amp;address='. urlencode($row['bAddress']) .'&amp;title='. urlencode($row['bTitle'])). '&amp;description='.urlencode($row['bDescription']). '&amp;tags='.$tagsForCopy  .'">'. T_('Copy') .'</a>';   
         }
 
         // Nofollow option