. */ if (!defined('LACONICA')) { exit(1); } require_once(INSTALLDIR.'/lib/facebookaction.php'); class FacebooksettingsAction extends FacebookAction { function handle($args) { parent::handle($args); if ($this->arg('save')) { $this->save_settings(); } else { $this->show_form(); } } function save_settings() { $noticesync = $this->arg('noticesync'); $replysync = $this->arg('replysync'); $facebook = get_facebook(); $fbuid = $facebook->require_login(); $flink = Foreign_link::getByForeignID($fbuid, 2); // 2 == Facebook $original = clone($flink); $flink->set_flags($noticesync, $replysync, false); $result = $flink->update($original); if ($result) { echo ''; } $this->show_form(); } function show_form() { $facebook = get_facebook(); $fbuid = $facebook->require_login(); $flink = Foreign_link::getByForeignID($fbuid, 2); // 2 == Facebook $this->show_header('Settings'); $fbml = '' .'

Add an Identi.ca box to my profile

' .'' .'
'; $fbml .= '

Allow Identi.ca to update my Facebook status

'; $fbml .= '
' .'

Sync preferences

' .'

'; if ($flink->noticesync & FOREIGN_NOTICE_SEND) { $fbml .= ''; } else { $fbml .= ''; } $fbml .= '' .'

' .'

'; if ($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) { $fbml .= ''; } else { $fbml .= ''; } $fbml .= '' .'

' .'

' .'' .'

' .'
'; echo $fbml; $this->show_footer(); } }