Interface fix: add tags from contacts into ajax tag list when adding/editing a bookmark.
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@290 b3834d28-1941-0410-a4f8-b48e95affb8f
This commit is contained in:
parent
3f9a5210f1
commit
cbe4d2f734
2 changed files with 15 additions and 1 deletions
|
@ -339,6 +339,20 @@ class Bookmark2TagService {
|
||||||
return $this->getPopularTags($admins, $limit, $logged_on_user, $days);
|
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}
|
// $users can be {NULL, an id, an array of id}
|
||||||
function &getPopularTags($user = NULL, $limit = 30, $logged_on_user = NULL, $days = NULL) {
|
function &getPopularTags($user = NULL, $limit = 30, $logged_on_user = NULL, $days = NULL) {
|
||||||
// Only count the tags that are visible to the current user.
|
// Only count the tags that are visible to the current user.
|
||||||
|
|
|
@ -68,7 +68,7 @@ $this->includeTemplate("dojo.inc");
|
||||||
<tr>
|
<tr>
|
||||||
<th align="left"><?php echo T_('Tags'); ?></th>
|
<th align="left"><?php echo T_('Tags'); ?></th>
|
||||||
<td class="scuttletheme">
|
<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>
|
<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>← <?php echo T_('Comma-separated'); ?></td>
|
<td>← <?php echo T_('Comma-separated'); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
Loading…
Reference in a new issue