$this->showHeader('Settings', $msg, $success);
- common_element_start('fb:if-section-not-added', array('section' => 'profile'));
- common_element('h2', null, _('Add an Identi.ca box to my profile'));
+ common_element('form', array('id' => 'redirect_form',
+ 'style' => 'display: none;'));
+
common_element_start('p');
- common_element('fb:add-section-button', array('section' => 'profile'));
- common_element_end('p');
-
- common_element_end('fb:if-section-not-added');
- common_element_start('p');
- common_element_start('fb:prompt-permission', array('perms' => 'status_update'));
+ common_element_start('fb:prompt-permission', array('perms' => 'status_update',
+ 'next_fbjs' => 'redirectSettings()'));
common_element('h2', null, _('Allow Identi.ca to update my Facebook status'));
common_element_end('fb:prompt-permission');
common_element_end('p');
+
+
if ($facebook->api_client->users_hasAppPermission('status_update')) {
common_element_start('form', array('method' => 'post',
common_checkbox('replysync', _('Send local "@" replies to Facebook.'),
($flink) ? ($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : true);
- // function common_input($id, $label, $value=null,$instructions=null)
-
$prefix = $facebook->api_client->data_getUserPreference(1);
--- /dev/null
+/*
+ * Laconica - a distributed open-source microblogging tool
+ * Copyright (C) 2008, Controlez-Vous, Inc.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+// Psycho Facebook redirect hack, used because 'document.location'
+// simply does not work in FBJS
+function redirectSettings() {
+ form = document.getElementById('redirect_form');
+ form.setAction('settings.php');
+ form.submit();
+}
common_element('link', array('rel' => 'stylesheet',
'type' => 'text/css',
- 'href' => get_facebook_css()));
+ 'href' => getFacebookCSS()));
+
+ common_element('script', array('type' => 'text/javascript',
+ 'src' => getFacebookJS()),
+ ' ');
common_element_start('a', array('class' => 'url home bookmark',
'href' => common_local_url('public')));
start_fbml();
+ common_element_start('fb:if-section-not-added', array('section' => 'profile'));
+ common_element_start('span', array('id' => 'add_to_profile'));
+ common_element('fb:add-section-button', array('section' => 'profile'));
+ common_element_end('span');
+ common_element_end('fb:if-section-not-added');
+
$this->showLogo();
common_element_start('dl', array("id" => 'site_nav_local_views'));
common_element('link', array('rel' => 'stylesheet',
'type' => 'text/css',
- 'href' => get_facebook_css()));
-
+ 'href' => getFacebookCSS()));
$this->showLogo();
$facebook->api_client->profile_setFBML(null, $fbuid, $fbml, null, null, $fbml_main);
}
-function get_facebook_css()
+function getFacebookCSS()
{
# Add a timestamp to the CSS file so Facebook cache wont ignore our changes
$ts = filemtime(theme_file('facebookapp.css'));
return $cssurl;
}
+function getFacebookJS() {
+
+ # Add a timestamp to the FBJS file so Facebook cache wont ignore our changes
+ $ts = filemtime(INSTALLDIR.'/js/facebookapp.js');
+ $jsurl = common_path('js/facebookapp.js') . "?ts=$ts";
+ return $jsurl;
+}
+
class FacebookNoticeList extends NoticeList
{