3 * Laconica - a distributed open-source microblogging tool
4 * Copyright (C) 2008, Controlez-Vous, Inc.
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Affero General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Affero General Public License for more details.
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 if (!defined('LACONICA')) { exit(1); }
22 require_once(INSTALLDIR.'/lib/facebookutil.php');
24 class FacebookAction extends Action
27 function handle($args)
29 parent::handle($args);
32 function show_header($selected = 'Home', $msg = null, $success = false)
37 # Add a timestamp to the CSS file so Facebook cache wont ignore our changes
38 $ts = filemtime(theme_file('facebookapp.css'));
39 $cssurl = theme_path('facebookapp.css') . "?ts=$ts";
41 common_element('link', array('rel' => 'stylesheet',
45 common_element('fb:dashboard');
47 common_element_start('fb:tabs');
48 common_element('fb:tab-item', array('title' => 'Home',
49 'href' => 'index.php',
50 'selected' => ($selected == 'Home')));
51 common_element('fb:tab-item', array('title' => 'Invite',
52 'href' => 'invite.php',
53 'selected' => ($selected == 'Invite')));
54 common_element('fb:tab-item', array('title' => 'Settings',
55 'href' => 'settings.php',
56 'selected' => ($selected == 'Settings')));
57 common_element_end('fb:tabs');
62 common_element('fb:success', array('message' => $msg));
64 // XXX do an error message here
68 common_element_start('div', 'main_body');
72 function show_footer()
74 common_element_end('div');
78 function showLoginForm($msg = null)
82 common_element_start('a', array('href' => 'http://identi.ca'));
83 common_element('img', array('src' => 'http://theme.identi.ca/identica/logo.png',
86 common_element_end('a');
89 common_element('fb:error', array('message' => $msg));
92 common_element("h2", null,
93 _('To add the Identi.ca application, you need to log into your Identi.ca account.'));
96 common_element_start('div', array('class' => 'instructions'));
97 common_element_start('p');
98 common_raw('Login with your username and password. Don\'t have a username yet?'
99 .' <a href="http://identi.ca/main/register">Register</a> a new account.');
100 common_element_end('p');
101 common_element_end('div');
103 common_element_start('div', array('id' => 'content'));
104 common_element_start('form', array('method' => 'post',
106 'action' => 'index.php'));
107 common_input('nickname', _('Nickname'));
108 common_password('password', _('Password'));
110 common_submit('submit', _('Login'));
111 common_element_end('form');
113 common_element_start('p');
114 common_element('a', array('href' => common_local_url('recoverpassword')),
115 _('Lost or forgotten password?'));
116 common_element_end('p');
117 common_element_end('div');