summaryrefslogtreecommitdiff
path: root/plugins/FacebookBridge/FacebookBridgePlugin.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/FacebookBridge/FacebookBridgePlugin.php')
-rw-r--r--plugins/FacebookBridge/FacebookBridgePlugin.php36
1 files changed, 26 insertions, 10 deletions
diff --git a/plugins/FacebookBridge/FacebookBridgePlugin.php b/plugins/FacebookBridge/FacebookBridgePlugin.php
index c30ea1544..93427d5bd 100644
--- a/plugins/FacebookBridge/FacebookBridgePlugin.php
+++ b/plugins/FacebookBridge/FacebookBridgePlugin.php
@@ -236,7 +236,8 @@ class FacebookBridgePlugin extends Plugin
}
/*
- * Add a tab for user-level Facebook settings
+ * Add a tab for user-level Facebook settings if the user
+ * has a link to Facebook
*
* @param Action &action the current action
*
@@ -247,17 +248,32 @@ class FacebookBridgePlugin extends Plugin
if ($this->hasApplication()) {
$action_name = $action->trimmed('action');
- $action->menuItem(
- common_local_url('facebooksettings'),
- // TRANS: Menu item tab.
- _m('MENU','Facebook'),
- // TRANS: Tooltip for menu item "Facebook".
- _m('Facebook settings'),
- $action_name === 'facebooksettings'
- );
+ // CurrentUserDesignAction stores the current user in $cur
+ $user = $action->getCurrentUser();
+
+ $flink = null;
+
+ if (!empty($user)) {
+ $flink = Foreign_link::getByUserID(
+ $user->id,
+ FACEBOOK_SERVICE
+ );
+ }
+
+ if (!empty($flink)) {
+
+ $action->menuItem(
+ common_local_url('facebooksettings'),
+ // TRANS: Menu item tab.
+ _m('MENU','Facebook'),
+ // TRANS: Tooltip for menu item "Facebook".
+ _m('Facebook settings'),
+ $action_name === 'facebooksettings'
+ );
+
+ }
}
- return true;
}
/*