Show tab with FB, to expose FB connection
authorDuck (Jakob Munih) <duck@obala.net>
Thu, 12 Mar 2009 13:24:31 +0000 (14:24 +0100)
committerDuck (Jakob Munih) <duck@obala.net>
Thu, 12 Mar 2009 13:24:31 +0000 (14:24 +0100)
folks/edit/facebook.php [new file with mode: 0644]
folks/edit/tabs.php

diff --git a/folks/edit/facebook.php b/folks/edit/facebook.php
new file mode 100644 (file)
index 0000000..8c07177
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+/**
+ * $Id: edit.php 974 2008-10-07 19:46:00Z duck $
+ *
+ * Copyright Obala d.o.o. (www.obala.si)
+ *
+ * See the enclosed file COPYING for license information (GPL). If you
+ * did not receive this file, see http://www.fsf.org/copyleft/gpl.html.
+ *
+ * @author Duck <duck@obala.net>
+ * @package Folks
+ */
+
+define('FOLKS_BASE', dirname(__FILE__) . '/..');
+require_once FOLKS_BASE . '/lib/base.php';
+require_once 'tabs.php';
+
+$title = _("Facebook");
+
+// Check FB installation
+if (!$conf['facebook']['enabled']) {
+    $notification->push(sprintf(_("Could not find authorization for %s to interact with your Facebook account."), $GLOBALS['registry']->get('name', 'horde')));
+    header('Location: ' . Horde::applicationUrl('user.php'));
+    exit;
+}
+
+// Load horde central block
+$block = $registry->call('horde/blockContent', array('horde', 'fb_summary'));
+if ($block instanceof PEAR_Error) {
+    $notification->push($block);
+    header('Location: ' . Horde::applicationUrl('user.php'));
+    exit;
+}
+
+require FOLKS_TEMPLATES . '/common-header.inc';
+require FOLKS_TEMPLATES . '/menu.inc';
+
+echo $tabs->render('facebook');
+
+echo $block;
+
+require $registry->get('templates', 'horde') . '/common-footer.inc';
\ No newline at end of file
index 31717f8..659ac96 100644 (file)
@@ -29,7 +29,12 @@ $tabs->addTab(_("Password"), Horde::applicationUrl('edit/password.php'), 'passwo
 
 if ($conf['comments']['allow'] != 'never'
         && $registry->hasMethod('forums/doComments')) {
-    $tabs->addTab(_("Comments"), 'comments.php', 'comments');
+    $tabs->addTab(_("Comments"), Horde::applicationUrl('edit/comments.php'), 'comments');
 }
 
+if ($conf['facebook']['enabled']) {
+    $tabs->addTab(_("Facebook"), Horde::applicationUrl('edit/facebook.php'), 'facebook');
+}
+
+
 Horde::addScriptFile('tables.js', 'horde', true);
\ No newline at end of file