aboutsummaryrefslogtreecommitdiff
path: root/services/tag2tagservice.php
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-02-20 09:33:59 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-02-20 09:33:59 +0000
commit0c81abaa3e6319fb729f6924c8d8ffb7393a5072 (patch)
treeeffd427ddc891d198976f2770cfc82bf0f744d8b /services/tag2tagservice.php
parent6bd34af2885e1e2e93218371923c0d0fdc1e2c53 (diff)
downloadsemanticscuttle-0c81abaa3e6319fb729f6924c8d8ffb7393a5072.tar.gz
semanticscuttle-0c81abaa3e6319fb729f6924c8d8ffb7393a5072.tar.bz2
Interface fix: menu2 just displays linked tags from admins
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@292 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'services/tag2tagservice.php')
-rw-r--r--services/tag2tagservice.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/services/tag2tagservice.php b/services/tag2tagservice.php
index 1547daf..6069880 100644
--- a/services/tag2tagservice.php
+++ b/services/tag2tagservice.php
@@ -43,6 +43,16 @@ class Tag2TagService {
return true;
}
+ // Return linked tags just for admin users
+ function getAdminLinkedTags($tag, $relationType, $inverseRelation = false, $stopList = array()) {
+ // look for admin ids
+ $userservice = & ServiceFactory :: getServiceInstance('UserService');
+ $adminIds = $userservice->getAdminIds();
+
+ //ask for their linked tags
+ return $this->getLinkedTags($tag, $relationType, $adminIds, $inverseRelation, $stopList);
+ }
+
// Return the target linked tags. If inverseRelation is true, return the source linked tags.
function getLinkedTags($tag, $relationType, $uId = null, $inverseRelation = false, $stopList = array()) {
// Set up the SQL query.
@@ -63,7 +73,13 @@ class Tag2TagService {
if($relationType) {
$query.= " AND relationType = '". $relationType ."'";
}
- if($uId != null) {
+ if(is_array($uId)) {
+ $query.= " AND ( 1=0 "; //tricks always false
+ foreach($uId as $u) {
+ $query.= " OR uId = '".$u."'";
+ }
+ $query.= " ) ";
+ } elseif($uId != null) {
$query.= " AND uId = '".$uId."'";
}
//die($query);