3 * Laconica, the distributed open-source microblogging tool
7 * LICENCE: This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU Affero General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU Affero General Public License for more details.
17 * You should have received a copy of the GNU Affero General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
22 * @author Zach Copley <zach@controlyourself.ca>
23 * @copyright 2009 Control Yourself, Inc.
24 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
25 * @link http://laconi.ca/
28 if (!defined('LACONICA')) {
33 * Plugin for sending and importing Twitter statuses
35 * This class allows users to link their Twitter accounts
39 * @author Zach Copley <zach@controlyourself.ca>
40 * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
41 * @link http://laconi.ca/
42 * @link http://twitter.com/
45 class TwitterBridgePlugin extends Plugin
48 * Initializer for the plugin.
51 function __construct()
53 parent::__construct();
57 * Add Twitter-related paths to the router table
59 * Hook for RouterInitialized event.
61 * @return boolean hook return
64 function onRouterInitialized(&$m)
66 $m->connect('twitter/authorization', array('action' => 'twitterauthorization'));
67 $m->connect('settings/twitter', array('action' => 'twittersettings'));
72 function onEndConnectSettingsNav(&$action)
74 $action_name = $action->trimmed('action');
76 $action->menuItem(common_local_url('twittersettings'),
78 _('Twitter integration options'),
79 $action_name === 'twittersettings');
84 function onAutoload($cls)
88 case 'TwittersettingsAction':
89 case 'TwitterauthorizationAction':
90 require_once(INSTALLDIR.'/plugins/TwitterBridge/' . strtolower(mb_substr($cls, 0, -6)) . '.php');
92 case 'TwitterOAuthClient':
93 require_once(INSTALLDIR.'/plugins/TwitterBridge/twitteroauthclient.php');