From 54cd0a2046c417fd072bb4cf79aeda163cf760af Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Thu, 21 May 2009 05:43:11 +0000 Subject: - Reworked login / logout workflow - Added Facebook Connect tab to login nav - Show Facebook mini-avatar when logged in - Added Facebook Connect tab to connect settings nav - Option to disconnect from Facebook --- plugins/FBConnect/FBCSettingsNav.php | 113 +++++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 plugins/FBConnect/FBCSettingsNav.php (limited to 'plugins/FBConnect/FBCSettingsNav.php') diff --git a/plugins/FBConnect/FBCSettingsNav.php b/plugins/FBConnect/FBCSettingsNav.php new file mode 100644 index 000000000..8b8411853 --- /dev/null +++ b/plugins/FBConnect/FBCSettingsNav.php @@ -0,0 +1,113 @@ +. + * + * @category Menu + * @package Laconica + * @author Evan Prodromou + * @author Zach Copley + * @copyright 2009 Control Yourself, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + */ + +if (!defined('LACONICA')) { + exit(1); +} + +require_once INSTALLDIR . '/lib/widget.php'; + +/** + * A widget for showing the connect group local nav menu + * + * @category Output + * @package Laconica + * @author Evan Prodromou + * @author Zach Copley + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://laconi.ca/ + * + * @see Widget + */ + +class FBCSettingsNav extends Widget +{ + var $action = null; + + /** + * Construction + * + * @param Action $action current action, used for output + */ + + function __construct($action=null) + { + parent::__construct($action); + $this->action = $action; + } + + /** + * Show the menu + * + * @return void + */ + + function show() + { + + $this->action->elementStart('dl', array('id' => 'site_nav_local_views')); + $this->action->element('dt', null, _('Local views')); + $this->action->elementStart('dd'); + + # action => array('prompt', 'title') + $menu = + array('imsettings' => + array(_('IM'), + _('Updates by instant messenger (IM)')), + 'smssettings' => + array(_('SMS'), + _('Updates by SMS')), + 'twittersettings' => + array(_('Twitter'), + _('Twitter integration options')), + 'FBConnectSettings' => + array(_('Facebook'), + _('Facebook Connect settings'))); + + $action_name = $this->action->trimmed('action'); + $this->action->elementStart('ul', array('class' => 'nav')); + + foreach ($menu as $menuaction => $menudesc) { + if ($menuaction == 'imsettings' && + !common_config('xmpp', 'enabled')) { + continue; + } + $this->action->menuItem(common_local_url($menuaction), + $menudesc[0], + $menudesc[1], + $action_name === $menuaction); + } + + $this->action->elementEnd('ul'); + + $this->action->elementEnd('dd'); + $this->action->elementEnd('dl'); + } +} -- cgit v1.2.3-54-g00ecf