]> gitweb.fluxo.info Git - semanticscuttle.git/commitdiff
Interface fix: add tags from contacts into ajax tag list when adding/editing a bookmark.
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Tue, 17 Feb 2009 13:53:20 +0000 (13:53 +0000)
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>
Tue, 17 Feb 2009 13:53:20 +0000 (13:53 +0000)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@290 b3834d28-1941-0410-a4f8-b48e95affb8f

services/bookmark2tagservice.php
templates/editbookmark.tpl.php

index 86cb88ad064ed90321cf8c18265a01d9b9aad17d..99c97aff758823054e35f3d6bb9657ddc0b205f9 100644 (file)
@@ -338,6 +338,20 @@ class Bookmark2TagService {
                // ask for their tags
                return $this->getPopularTags($admins, $limit, $logged_on_user, $days);
        }
+       
+       function &getContactTags($user, $limit = 30, $logged_on_user = NULL, $days = NULL) {
+               // look for contact ids
+               $userservice = & ServiceFactory :: getServiceInstance('UserService');
+               $contacts = $userservice->getWatchlist($user);
+               
+               // add the user (to show him/her also his/her tags)
+               if(!is_null($logged_on_user)) {
+                       $contacts[] = $logged_on_user;
+               }
+               
+               // ask for their tags
+               return $this->getPopularTags($contacts, $limit, $logged_on_user, $days);
+       }       
 
        // $users can be {NULL, an id, an array of id}
        function &getPopularTags($user = NULL, $limit = 30, $logged_on_user = NULL, $days = NULL) {
index 92357d115abf41bb84bb33216232663717f4cc1e..5a24cf4c5d3917597a8f0c14c43d12656de699b5 100644 (file)
@@ -68,7 +68,7 @@ $this->includeTemplate("dojo.inc");
 <tr>
     <th align="left"><?php echo T_('Tags'); ?></th>
     <td class="scuttletheme">
-    <span dojoType="dojo.data.ItemFileReadStore" jsId="memberTagStore" url="<?php echo ROOT?>ajax/<?php echo ($GLOBALS['adminsAreAdvisedTagsFromOtherAdmins'] && $currentUser->isAdmin())?'getadmintags':'gettags'?>.php"></span>
+    <span dojoType="dojo.data.ItemFileReadStore" jsId="memberTagStore" url="<?php echo ROOT?>ajax/<?php echo ($GLOBALS['adminsAreAdvisedTagsFromOtherAdmins'] && $currentUser->isAdmin())?'getadmintags':'getcontacttags'?>.php"></span>
     <input type="text" dojoType="js.MultiComboBox" id="tags" name="tags" size="75" value="<?php echo filter(implode(', ', $row['tags']), 'xml'); ?>" store="memberTagStore" delimiter="," searchAttr="tag" hasDownArrow="false" queryExpr="*${0}*" autoComplete="false" highlightMatch="all"/></td>
     <td>&larr; <?php echo T_('Comma-separated'); ?></td>
 </tr>