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 update_profile_box($facebook, $fbuid, $user)
35 $notice = $user->getCurrentNotice();
37 # Need to include inline CSS for styling the Profile box
44 list-style-type: none;
46 border-top: 1px solid #dec5b5;
49 text-decoration: underline;
55 padding: 5px 5px 5px 0;
57 font-family: Georgia, "Times New Roman", Times, serif;
60 border-bottom: 1px solid #dec5b5;
61 background-color:#FCFFF5;
64 .notice_single:hover {
65 background-color: #f7ebcc;
74 $html = Facebookaction::render_notice($notice);
77 $fbml = "<fb:wide>$style $html</fb:wide>";
78 $fbml .= "<fb:narrow>$style $html</fb:narrow>";
80 $fbml_main = "<fb:narrow>$style $html</fb:narrow>";
82 $facebook->api_client->profile_setFBML(null, $fbuid, $fbml, null, null, $fbml_main);
87 function show_header($selected = 'Home', $msg = null, $success = false)
92 # Add a timestamp to the CSS file so Facebook cache wont ignore our changes
93 $ts = filemtime(theme_file('facebookapp.css'));
94 $cssurl = theme_path('facebookapp.css') . "?ts=$ts";
96 common_element('link', array('rel' => 'stylesheet',
100 common_element('fb:dashboard');
102 common_element_start('fb:tabs');
103 common_element('fb:tab-item', array('title' => 'Home',
104 'href' => 'index.php',
105 'selected' => ($selected == 'Home')));
106 common_element('fb:tab-item', array('title' => 'Invite Friends',
107 'href' => 'invite.php',
108 'selected' => ($selected == 'Invite')));
109 common_element('fb:tab-item', array('title' => 'Settings',
110 'href' => 'settings.php',
111 'selected' => ($selected == 'Settings')));
112 common_element_end('fb:tabs');
117 common_element('fb:success', array('message' => $msg));
119 // XXX do an error message here
123 common_element_start('div', 'main_body');
127 function show_footer()
129 common_element_end('div');
133 function showLoginForm($msg = null)
137 common_element_start('a', array('href' => 'http://identi.ca'));
138 common_element('img', array('src' => 'http://theme.identi.ca/identica/logo.png',
139 'alt' => 'Identi.ca',
141 common_element_end('a');
144 common_element('fb:error', array('message' => $msg));
147 common_element("h2", null,
148 _('To add the Identi.ca application, you need to log into your Identi.ca account.'));
151 common_element_start('div', array('class' => 'instructions'));
152 common_element_start('p');
153 common_raw('Login with your username and password. Don\'t have a username yet?'
154 .' <a href="http://identi.ca/main/register">Register</a> a new account.');
155 common_element_end('p');
156 common_element_end('div');
158 common_element_start('div', array('id' => 'content'));
159 common_element_start('form', array('method' => 'post',
161 'action' => 'index.php'));
162 common_input('nickname', _('Nickname'));
163 common_password('password', _('Password'));
165 common_submit('submit', _('Login'));
166 common_element_end('form');
168 common_element_start('p');
169 common_element('a', array('href' => common_local_url('recoverpassword')),
170 _('Lost or forgotten password?'));
171 common_element_end('p');
172 common_element_end('div');