From deffcc1442ab452c3cadba1d2158d24209831656 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 18 Jan 2011 16:55:51 -0500 Subject: [PATCH 01/89] non-working version of private groups --- .../PrivateGroup/Group_privacy_settings.php | 184 ++++++++++++++++++ plugins/PrivateGroup/Group_private_inbox.php | 184 ++++++++++++++++++ plugins/PrivateGroup/PrivateGroupPlugin.php | 177 +++++++++++++++++ plugins/PrivateGroup/groupinbox.php | 164 ++++++++++++++++ 4 files changed, 709 insertions(+) create mode 100644 plugins/PrivateGroup/Group_privacy_settings.php create mode 100644 plugins/PrivateGroup/Group_private_inbox.php create mode 100644 plugins/PrivateGroup/PrivateGroupPlugin.php create mode 100644 plugins/PrivateGroup/groupinbox.php diff --git a/plugins/PrivateGroup/Group_privacy_settings.php b/plugins/PrivateGroup/Group_privacy_settings.php new file mode 100644 index 0000000000..38d68c91ed --- /dev/null +++ b/plugins/PrivateGroup/Group_privacy_settings.php @@ -0,0 +1,184 @@ + + * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 + * @link http://status.net/ + * + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2009, StatusNet, 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 . + */ + +if (!defined('STATUSNET')) { + exit(1); +} + +require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; + +/** + * Data class for counting greetings + * + * We use the DB_DataObject framework for data classes in StatusNet. Each + * table maps to a particular data class, making it easier to manipulate + * data. + * + * Data classes should extend Memcached_DataObject, the (slightly misnamed) + * extension of DB_DataObject that provides caching, internationalization, + * and other bits of good functionality to StatusNet-specific data classes. + * + * @category Action + * @package StatusNet + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 + * @link http://status.net/ + * + * @see DB_DataObject + */ + +class User_greeting_count extends Memcached_DataObject +{ + public $__table = 'user_greeting_count'; // table name + public $user_id; // int(4) primary_key not_null + public $greeting_count; // int(4) + + /** + * Get an instance by key + * + * This is a utility method to get a single instance with a given key value. + * + * @param string $k Key to use to lookup (usually 'user_id' for this class) + * @param mixed $v Value to lookup + * + * @return User_greeting_count object found, or null for no hits + * + */ + function staticGet($k, $v=null) + { + return Memcached_DataObject::staticGet('User_greeting_count', $k, $v); + } + + /** + * return table definition for DB_DataObject + * + * DB_DataObject needs to know something about the table to manipulate + * instances. This method provides all the DB_DataObject needs to know. + * + * @return array array of column definitions + */ + function table() + { + return array('user_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, + 'greeting_count' => DB_DATAOBJECT_INT); + } + + /** + * return key definitions for DB_DataObject + * + * DB_DataObject needs to know about keys that the table has, since it + * won't appear in StatusNet's own keys list. In most cases, this will + * simply reference your keyTypes() function. + * + * @return array list of key field names + */ + function keys() + { + return array_keys($this->keyTypes()); + } + + /** + * return key definitions for Memcached_DataObject + * + * Our caching system uses the same key definitions, but uses a different + * method to get them. This key information is used to store and clear + * cached data, so be sure to list any key that will be used for static + * lookups. + * + * @return array associative array of key definitions, field name to type: + * 'K' for primary key: for compound keys, add an entry for each component; + * 'U' for unique keys: compound keys are not well supported here. + */ + function keyTypes() + { + return array('user_id' => 'K'); + } + + /** + * Magic formula for non-autoincrementing integer primary keys + * + * If a table has a single integer column as its primary key, DB_DataObject + * assumes that the column is auto-incrementing and makes a sequence table + * to do this incrementation. Since we don't need this for our class, we + * overload this method and return the magic formula that DB_DataObject needs. + * + * @return array magic three-false array that stops auto-incrementing. + */ + function sequenceKey() + { + return array(false, false, false); + } + + /** + * Increment a user's greeting count and return instance + * + * This method handles the ins and outs of creating a new greeting_count for a + * user or fetching the existing greeting count and incrementing its value. + * + * @param integer $user_id ID of the user to get a count for + * + * @return User_greeting_count instance for this user, with count already incremented. + */ + static function inc($user_id) + { + $gc = User_greeting_count::staticGet('user_id', $user_id); + + if (empty($gc)) { + + $gc = new User_greeting_count(); + + $gc->user_id = $user_id; + $gc->greeting_count = 1; + + $result = $gc->insert(); + + if (!$result) { + // TRANS: Exception thrown when the user greeting count could not be saved in the database. + // TRANS: %d is a user ID (number). + throw Exception(sprintf(_m("Could not save new greeting count for %d."), + $user_id)); + } + } else { + $orig = clone($gc); + + $gc->greeting_count++; + + $result = $gc->update($orig); + + if (!$result) { + // TRANS: Exception thrown when the user greeting count could not be saved in the database. + // TRANS: %d is a user ID (number). + throw Exception(sprintf(_m("Could not increment greeting count for %d."), + $user_id)); + } + } + + return $gc; + } +} diff --git a/plugins/PrivateGroup/Group_private_inbox.php b/plugins/PrivateGroup/Group_private_inbox.php new file mode 100644 index 0000000000..38d68c91ed --- /dev/null +++ b/plugins/PrivateGroup/Group_private_inbox.php @@ -0,0 +1,184 @@ + + * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 + * @link http://status.net/ + * + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2009, StatusNet, 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 . + */ + +if (!defined('STATUSNET')) { + exit(1); +} + +require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; + +/** + * Data class for counting greetings + * + * We use the DB_DataObject framework for data classes in StatusNet. Each + * table maps to a particular data class, making it easier to manipulate + * data. + * + * Data classes should extend Memcached_DataObject, the (slightly misnamed) + * extension of DB_DataObject that provides caching, internationalization, + * and other bits of good functionality to StatusNet-specific data classes. + * + * @category Action + * @package StatusNet + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 + * @link http://status.net/ + * + * @see DB_DataObject + */ + +class User_greeting_count extends Memcached_DataObject +{ + public $__table = 'user_greeting_count'; // table name + public $user_id; // int(4) primary_key not_null + public $greeting_count; // int(4) + + /** + * Get an instance by key + * + * This is a utility method to get a single instance with a given key value. + * + * @param string $k Key to use to lookup (usually 'user_id' for this class) + * @param mixed $v Value to lookup + * + * @return User_greeting_count object found, or null for no hits + * + */ + function staticGet($k, $v=null) + { + return Memcached_DataObject::staticGet('User_greeting_count', $k, $v); + } + + /** + * return table definition for DB_DataObject + * + * DB_DataObject needs to know something about the table to manipulate + * instances. This method provides all the DB_DataObject needs to know. + * + * @return array array of column definitions + */ + function table() + { + return array('user_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, + 'greeting_count' => DB_DATAOBJECT_INT); + } + + /** + * return key definitions for DB_DataObject + * + * DB_DataObject needs to know about keys that the table has, since it + * won't appear in StatusNet's own keys list. In most cases, this will + * simply reference your keyTypes() function. + * + * @return array list of key field names + */ + function keys() + { + return array_keys($this->keyTypes()); + } + + /** + * return key definitions for Memcached_DataObject + * + * Our caching system uses the same key definitions, but uses a different + * method to get them. This key information is used to store and clear + * cached data, so be sure to list any key that will be used for static + * lookups. + * + * @return array associative array of key definitions, field name to type: + * 'K' for primary key: for compound keys, add an entry for each component; + * 'U' for unique keys: compound keys are not well supported here. + */ + function keyTypes() + { + return array('user_id' => 'K'); + } + + /** + * Magic formula for non-autoincrementing integer primary keys + * + * If a table has a single integer column as its primary key, DB_DataObject + * assumes that the column is auto-incrementing and makes a sequence table + * to do this incrementation. Since we don't need this for our class, we + * overload this method and return the magic formula that DB_DataObject needs. + * + * @return array magic three-false array that stops auto-incrementing. + */ + function sequenceKey() + { + return array(false, false, false); + } + + /** + * Increment a user's greeting count and return instance + * + * This method handles the ins and outs of creating a new greeting_count for a + * user or fetching the existing greeting count and incrementing its value. + * + * @param integer $user_id ID of the user to get a count for + * + * @return User_greeting_count instance for this user, with count already incremented. + */ + static function inc($user_id) + { + $gc = User_greeting_count::staticGet('user_id', $user_id); + + if (empty($gc)) { + + $gc = new User_greeting_count(); + + $gc->user_id = $user_id; + $gc->greeting_count = 1; + + $result = $gc->insert(); + + if (!$result) { + // TRANS: Exception thrown when the user greeting count could not be saved in the database. + // TRANS: %d is a user ID (number). + throw Exception(sprintf(_m("Could not save new greeting count for %d."), + $user_id)); + } + } else { + $orig = clone($gc); + + $gc->greeting_count++; + + $result = $gc->update($orig); + + if (!$result) { + // TRANS: Exception thrown when the user greeting count could not be saved in the database. + // TRANS: %d is a user ID (number). + throw Exception(sprintf(_m("Could not increment greeting count for %d."), + $user_id)); + } + } + + return $gc; + } +} diff --git a/plugins/PrivateGroup/PrivateGroupPlugin.php b/plugins/PrivateGroup/PrivateGroupPlugin.php new file mode 100644 index 0000000000..9aded1d960 --- /dev/null +++ b/plugins/PrivateGroup/PrivateGroupPlugin.php @@ -0,0 +1,177 @@ +. + * + * @category Privacy + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET')) { + // This check helps protect against security problems; + // your code file can't be executed directly from the web. + exit(1); +} + +/** + * Private groups + * + * This plugin allows users to send private messages to a group. + * + * @category Privacy + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ +class PrivateGroupPlugin extends Plugin +{ + /** + * Database schema setup + * + * @see Schema + * @see ColumnDef + * + * @return boolean hook value + */ + + function onCheckSchema() + { + $schema = Schema::get(); + + // For storing user-submitted flags on profiles + + $schema->ensureTable('group_privacy_settings', + array(new ColumnDef('group_id', + 'integer', + null, + false, + 'PRI'), + new ColumnDef('allow_privacy', + 'integer'), + new ColumnDef('allow_sender', + 'integer'), + new ColumnDef('created', + 'datetime'), + new ColumnDef('modified', + 'timestamp')); + + $schema->ensureTable('group_private_inbox', + array(new ColumnDef('group_id', + 'integer', + null, + false, + 'PRI'), + new ColumnDef('allow_privacy', + 'integer'), + new ColumnDef('allow_sender', + 'integer'), + new ColumnDef('created', + 'datetime'), + new ColumnDef('modified', + 'timestamp')); + + return true; + } + + /** + * Load related modules when needed + * + * @param string $cls Name of the class to be loaded + * + * @return boolean hook value + */ + + function onAutoload($cls) + { + $dir = dirname(__FILE__); + + switch ($cls) + { + case 'GroupinboxAction': + include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; + return false; + case 'Group_privacy_settings': + case 'Group_private_inbox': + include_once $dir . '/'.$cls.'.php'; + return false; + default: + return true; + } + } + + /** + * Map URLs to actions + * + * @param Net_URL_Mapper $m path-to-action mapper + * + * @return boolean hook value + */ + + function onRouterInitialized($m) + { + $m->connect('group/:nickname/inbox', + array('action' => 'groupinbox'), + array('nickname' => Nickname::DISPLAY_FMT)); + + return true; + } + + /** + * Add group inbox to the menu + * + * @param Action $action The current action handler. Use this to + * do any output. + * + * @return boolean hook value; true means continue processing, false means stop. + * + * @see Action + */ + + function onEndGroupGroupNav($groupnav) + { + $action = $groupnav->action; + $group = $groupnav->group; + + $action->menuItem(common_local_url('groupinbox', + array('nickname' => $group->nickname)), + _m('Inbox'), + _m('Private messages for this group'), + $action->trimmed('action') == 'groupinbox', + 'nav_group_inbox'); + return true; + } + + function onPluginVersion(&$versions) + { + $versions[] = array('name' => 'PrivateGroup', + 'version' => STATUSNET_VERSION, + 'author' => 'Evan Prodromou', + 'homepage' => 'http://status.net/wiki/Plugin:PrivateGroup', + 'rawdescription' => + _m('Allow posting DMs to a group.')); + return true; + } +} diff --git a/plugins/PrivateGroup/groupinbox.php b/plugins/PrivateGroup/groupinbox.php new file mode 100644 index 0000000000..a793ac6de2 --- /dev/null +++ b/plugins/PrivateGroup/groupinbox.php @@ -0,0 +1,164 @@ + + * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 + * @link http://status.net/ + * + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2009, StatusNet, 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 . + */ + +if (!defined('STATUSNET')) { + exit(1); +} + +/** + * Give a warm greeting to our friendly user + * + * This sample action shows some basic ways of doing output in an action + * class. + * + * Action classes have several output methods that they override from + * the parent class. + * + * @category Sample + * @package StatusNet + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 + * @link http://status.net/ + */ +class HelloAction extends Action +{ + var $user = null; + var $gc = null; + + /** + * Take arguments for running + * + * This method is called first, and it lets the action class get + * all its arguments and validate them. It's also the time + * to fetch any relevant data from the database. + * + * Action classes should run parent::prepare($args) as the first + * line of this method to make sure the default argument-processing + * happens. + * + * @param array $args $_REQUEST args + * + * @return boolean success flag + */ + function prepare($args) + { + parent::prepare($args); + + $this->user = common_current_user(); + + if (!empty($this->user)) { + $this->gc = User_greeting_count::inc($this->user->id); + } + + return true; + } + + /** + * Handle request + * + * This is the main method for handling a request. Note that + * most preparation should be done in the prepare() method; + * by the time handle() is called the action should be + * more or less ready to go. + * + * @param array $args $_REQUEST args; handled in prepare() + * + * @return void + */ + function handle($args) + { + parent::handle($args); + + $this->showPage(); + } + + /** + * Title of this page + * + * Override this method to show a custom title. + * + * @return string Title of the page + */ + function title() + { + if (empty($this->user)) { + return _m('Hello'); + } else { + return sprintf(_m('Hello, %s!'), $this->user->nickname); + } + } + + /** + * Show content in the content area + * + * The default StatusNet page has a lot of decorations: menus, + * logos, tabs, all that jazz. This method is used to show + * content in the content area of the page; it's the main + * thing you want to overload. + * + * This method also demonstrates use of a plural localized string. + * + * @return void + */ + function showContent() + { + if (empty($this->user)) { + $this->element('p', array('class' => 'greeting'), + _m('Hello, stranger!')); + } else { + $this->element('p', array('class' => 'greeting'), + sprintf(_m('Hello, %s'), $this->user->nickname)); + $this->element('p', array('class' => 'greeting_count'), + sprintf(_m('I have greeted you %d time.', + 'I have greeted you %d times.', + $this->gc->greeting_count), + $this->gc->greeting_count)); + } + } + + /** + * Return true if read only. + * + * Some actions only read from the database; others read and write. + * The simple database load-balancer built into StatusNet will + * direct read-only actions to database mirrors (if they are configured), + * and read-write actions to the master database. + * + * This defaults to false to avoid data integrity issues, but you + * should make sure to overload it for performance gains. + * + * @param array $args other arguments, if RO/RW status depends on them. + * + * @return boolean is read only action? + */ + function isReadOnly($args) + { + return false; + } +} From 4618641da23aab0822bec008ff7406ffc13e1cad Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 19 Jan 2011 18:31:07 -0500 Subject: [PATCH 02/89] data structures --- .../PrivateGroup/Group_privacy_settings.php | 119 ++++++------------ plugins/PrivateGroup/Group_private_inbox.php | 2 +- plugins/PrivateGroup/PrivateGroupPlugin.php | 1 + 3 files changed, 43 insertions(+), 79 deletions(-) diff --git a/plugins/PrivateGroup/Group_privacy_settings.php b/plugins/PrivateGroup/Group_privacy_settings.php index 38d68c91ed..7861571222 100644 --- a/plugins/PrivateGroup/Group_privacy_settings.php +++ b/plugins/PrivateGroup/Group_privacy_settings.php @@ -1,6 +1,6 @@ DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, - 'greeting_count' => DB_DATAOBJECT_INT); + return array('group_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, + 'allow_privacy' => DB_DATAOBJECT_INT, + 'allow_sender' => DB_DATAOBJECT_INT, + 'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL, + 'modified' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL); + } /** @@ -98,6 +115,7 @@ class User_greeting_count extends Memcached_DataObject * * @return array list of key field names */ + function keys() { return array_keys($this->keyTypes()); @@ -106,79 +124,24 @@ class User_greeting_count extends Memcached_DataObject /** * return key definitions for Memcached_DataObject * - * Our caching system uses the same key definitions, but uses a different - * method to get them. This key information is used to store and clear - * cached data, so be sure to list any key that will be used for static - * lookups. - * * @return array associative array of key definitions, field name to type: * 'K' for primary key: for compound keys, add an entry for each component; * 'U' for unique keys: compound keys are not well supported here. */ + function keyTypes() { - return array('user_id' => 'K'); + return array('group_id' => 'K'); } /** * Magic formula for non-autoincrementing integer primary keys * - * If a table has a single integer column as its primary key, DB_DataObject - * assumes that the column is auto-incrementing and makes a sequence table - * to do this incrementation. Since we don't need this for our class, we - * overload this method and return the magic formula that DB_DataObject needs. - * * @return array magic three-false array that stops auto-incrementing. */ + function sequenceKey() { return array(false, false, false); } - - /** - * Increment a user's greeting count and return instance - * - * This method handles the ins and outs of creating a new greeting_count for a - * user or fetching the existing greeting count and incrementing its value. - * - * @param integer $user_id ID of the user to get a count for - * - * @return User_greeting_count instance for this user, with count already incremented. - */ - static function inc($user_id) - { - $gc = User_greeting_count::staticGet('user_id', $user_id); - - if (empty($gc)) { - - $gc = new User_greeting_count(); - - $gc->user_id = $user_id; - $gc->greeting_count = 1; - - $result = $gc->insert(); - - if (!$result) { - // TRANS: Exception thrown when the user greeting count could not be saved in the database. - // TRANS: %d is a user ID (number). - throw Exception(sprintf(_m("Could not save new greeting count for %d."), - $user_id)); - } - } else { - $orig = clone($gc); - - $gc->greeting_count++; - - $result = $gc->update($orig); - - if (!$result) { - // TRANS: Exception thrown when the user greeting count could not be saved in the database. - // TRANS: %d is a user ID (number). - throw Exception(sprintf(_m("Could not increment greeting count for %d."), - $user_id)); - } - } - - return $gc; - } } diff --git a/plugins/PrivateGroup/Group_private_inbox.php b/plugins/PrivateGroup/Group_private_inbox.php index 38d68c91ed..11142314bc 100644 --- a/plugins/PrivateGroup/Group_private_inbox.php +++ b/plugins/PrivateGroup/Group_private_inbox.php @@ -1,6 +1,6 @@ Date: Thu, 20 Jan 2011 10:43:27 -0800 Subject: [PATCH 03/89] Move getConnectedApps() from Profile to User, where it belongs Conflicts: classes/User.php --- actions/oauthconnectionssettings.php | 2 +- classes/Profile.php | 25 ------------ classes/User.php | 59 ++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 26 deletions(-) diff --git a/actions/oauthconnectionssettings.php b/actions/oauthconnectionssettings.php index 9a7cda924a..cdb73203f0 100644 --- a/actions/oauthconnectionssettings.php +++ b/actions/oauthconnectionssettings.php @@ -97,7 +97,7 @@ class OauthconnectionssettingsAction extends ConnectSettingsAction $offset = ($this->page - 1) * APPS_PER_PAGE; $limit = APPS_PER_PAGE + 1; - $connection = $profile->getConnectedApps($offset, $limit); + $connection = $user->getConnectedApps($offset, $limit); $cnt = 0; diff --git a/classes/Profile.php b/classes/Profile.php index 00e076a624..e29e6db7b7 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -409,31 +409,6 @@ class Profile extends Memcached_DataObject return $profile; } - function getConnectedApps($offset = 0, $limit = null) - { - $qry = - 'SELECT u.* ' . - 'FROM oauth_application_user u, oauth_application a ' . - 'WHERE u.profile_id = %d ' . - 'AND a.id = u.application_id ' . - 'AND u.access_type > 0 ' . - 'ORDER BY u.created DESC '; - - if ($offset > 0) { - if (common_config('db','type') == 'pgsql') { - $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; - } else { - $qry .= ' LIMIT ' . $offset . ', ' . $limit; - } - } - - $apps = new Oauth_application_user(); - - $cnt = $apps->query(sprintf($qry, $this->id)); - - return $apps; - } - function subscriptionCount() { $c = common_memcache(); diff --git a/classes/User.php b/classes/User.php index c824ddb0c2..1b1b971ec7 100644 --- a/classes/User.php +++ b/classes/User.php @@ -116,6 +116,16 @@ class User extends Memcached_DataObject return $result; } + /** + * Check whether the given nickname is potentially usable, or if it's + * excluded by any blacklists on this system. + * + * WARNING: INPUT IS NOT VALIDATED OR NORMALIZED. NON-NORMALIZED INPUT + * OR INVALID INPUT MAY LEAD TO FALSE RESULTS. + * + * @param string $nickname + * @return boolean true if clear, false if blacklisted + */ static function allowed_nickname($nickname) { // XXX: should already be validated for size, content, etc. @@ -949,4 +959,53 @@ class User extends Memcached_DataObject throw $e; } } + + /** + * Find and shorten links in the given text using this user's URL shortening + * settings. + * + * By default, links will be left untouched if the text is shorter than the + * configured maximum notice length. Pass true for the $always parameter + * to force all links to be shortened regardless. + * + * Side effects: may save file and file_redirection records for referenced URLs. + * + * @param string $text + * @param boolean $always + * @return string + */ + public function shortenLinks($text, $always=false) + { + return common_shorten_links($text, $always, $this); + } + + /* + * Get a list of OAuth client application that have access to this + * user's account. + */ + function getConnectedApps($offset = 0, $limit = null) + { + $qry = + 'SELECT u.* ' . + 'FROM oauth_application_user u, oauth_application a ' . + 'WHERE u.profile_id = %d ' . + 'AND a.id = u.application_id ' . + 'AND u.access_type > 0 ' . + 'ORDER BY u.created DESC '; + + if ($offset > 0) { + if (common_config('db','type') == 'pgsql') { + $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset; + } else { + $qry .= ' LIMIT ' . $offset . ', ' . $limit; + } + } + + $apps = new Oauth_application_user(); + + $cnt = $apps->query(sprintf($qry, $this->id)); + + return $apps; + } + } From 3a24b95edb87a20302f5d9911763867a0fcb8277 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 19 Jan 2011 15:52:18 -0800 Subject: [PATCH 04/89] Fix a couple spelling mistakes in comments and remove redundant statement terminator --- classes/User.php | 2 +- lib/apiauth.php | 2 +- lib/apioauthstore.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/User.php b/classes/User.php index 1b1b971ec7..b339d61702 100644 --- a/classes/User.php +++ b/classes/User.php @@ -980,7 +980,7 @@ class User extends Memcached_DataObject } /* - * Get a list of OAuth client application that have access to this + * Get a list of OAuth client applications that have access to this * user's account. */ function getConnectedApps($offset = 0, $limit = null) diff --git a/lib/apiauth.php b/lib/apiauth.php index 1dacf1409b..0cc184c04c 100644 --- a/lib/apiauth.php +++ b/lib/apiauth.php @@ -337,7 +337,7 @@ class ApiAuthAction extends ApiAction } /** - * Log an API authentication failer. Collect the proxy and IP + * Log an API authentication failure. Collect the proxy and IP * and log them * * @param string $logMsg additional log message diff --git a/lib/apioauthstore.php b/lib/apioauthstore.php index 2a65fffc4b..6aabde047c 100644 --- a/lib/apioauthstore.php +++ b/lib/apioauthstore.php @@ -229,7 +229,7 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore // insert a new Oauth_application_user record w/access token $appUser = new Oauth_application_user(); - $appUser->profile_id = $tokenAssoc->profile_id;; + $appUser->profile_id = $tokenAssoc->profile_id; $appUser->application_id = $app->id; $appUser->access_type = $app->access_type; $appUser->token = $at->tok; From 28d40e5eed82626be7543a0998cf4956b95034cc Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 19 Jan 2011 16:13:42 -0800 Subject: [PATCH 05/89] Fix syntax error in error msg --- actions/apioauthaccesstoken.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/actions/apioauthaccesstoken.php b/actions/apioauthaccesstoken.php index 064d05120f..a3ce9edbf6 100644 --- a/actions/apioauthaccesstoken.php +++ b/actions/apioauthaccesstoken.php @@ -98,7 +98,7 @@ class ApiOauthAccessTokenAction extends ApiOauthAction common_log(LOG_WARNING, $msg); // TRANS: Client error given from the OAuth API when the request token or verifier is invalid. - $this->clientError(_("Invalid request token or verifier.", 400, 'text')); + $this->clientError(_("Invalid request token or verifier."), 400, 'text'); } else { common_log( LOG_INFO, From 05361bb6868dac96566ea477530c9ac148c37ae6 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 19 Jan 2011 22:55:00 -0800 Subject: [PATCH 06/89] OAuth: Fix rare problem in which request tokens were sometimes being returned as access tokens. --- actions/apioauthaccesstoken.php | 1 + lib/apioauthstore.php | 194 +++++++++++++++++++++++--------- 2 files changed, 141 insertions(+), 54 deletions(-) diff --git a/actions/apioauthaccesstoken.php b/actions/apioauthaccesstoken.php index a3ce9edbf6..6c3819c3bd 100644 --- a/actions/apioauthaccesstoken.php +++ b/actions/apioauthaccesstoken.php @@ -84,6 +84,7 @@ class ApiOauthAccessTokenAction extends ApiOauthAction common_debug(var_export($req, true)); $code = $e->getCode(); $this->clientError($e->getMessage(), empty($code) ? 401 : $code, 'text'); + return; } if (empty($atok)) { diff --git a/lib/apioauthstore.php b/lib/apioauthstore.php index 6aabde047c..f1f88b13a1 100644 --- a/lib/apioauthstore.php +++ b/lib/apioauthstore.php @@ -152,8 +152,11 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore ); } - // check to see if we have previously issued an access token for this application - // and profile + // Check to see if we have previously issued an access token for + // this application and profile; if so we can just return the + // existing access token. That seems to be the best practice. It + // makes it so users only have to authorize the app once per + // machine. $appUser = new Oauth_application_user(); @@ -172,19 +175,40 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore ) ); - $at = new Token(); + $at = null; - // fetch the full access token - $at->consumer_key = $consumer->key; - $at->tok = $appUser->token; + // Special case: we used to store request tokens in the + // Oauth_application_user record, and the access_type would + // always be 0 (no access) as a failsafe until an access + // token was issued and replaced the request token. There could + // be a few old Oauth_application_user records storing request + // tokens still around, and we don't want to accidentally + // return a useless request token instead of a new access + // token. So if we find one, we generate a new access token + // and update the existing Oauth_application_user record before + // returning the new access token. This should be rare. - $result = $at->find(true); + if ($appUser->access_type == 0) { - if (!$result) { - throw new Exception( - // TRANS: Exception thrown when no access token can be issued. - _('Could not issue access token.') - ); + $at = $this->generateNewAccessToken($consumer, $rt, $verifier); + $this->updateAppUser($appUser, $app, $at); + + } else { + + $at = new Token(); + + // fetch the full access token + $at->consumer_key = $consumer->key; + $at->tok = $appUser->token; + + $result = $at->find(true); + + if (!$result) { + throw new Exception( + // TRANS: Exception thrown when no access token can be issued. + _('Could not issue access token.') + ); + } } // Yay, we can re-issue the access token @@ -200,48 +224,8 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore ) ); - // make a brand new access token - $at = new Token(); - - $at->consumer_key = $consumer->key; - $at->tok = common_good_rand(16); - $at->secret = common_good_rand(16); - $at->type = 1; // access - $at->verifier = $verifier; - $at->verified_callback = $rt->verified_callback; // 1.0a - $at->created = common_sql_now(); - - if (!$at->insert()) { - $e = $at->_lastError; - common_debug('access token "' . $at->tok . '" not inserted: "' . $e->message . '"', __FILE__); - return null; - } else { - common_debug('access token "' . $at->tok . '" inserted', __FILE__); - // burn the old one - $orig_rt = clone($rt); - $rt->state = 2; // used - if (!$rt->update($orig_rt)) { - return null; - } - common_debug('request token "' . $rt->tok . '" updated', __FILE__); - } - - // insert a new Oauth_application_user record w/access token - $appUser = new Oauth_application_user(); - - $appUser->profile_id = $tokenAssoc->profile_id; - $appUser->application_id = $app->id; - $appUser->access_type = $app->access_type; - $appUser->token = $at->tok; - $appUser->created = common_sql_now(); - - $result = $appUser->insert(); - - if (!$result) { - common_log_db_error($appUser, 'INSERT', __FILE__); - // TRANS: Server error displayed when a database error occurs. - $this->serverError(_('Database error inserting OAuth application user.')); - } + $at = $this->generateNewAccessToken($consumer, $rt, $verifier); + $this->newAppUser($tokenAssoc, $app, $at); // Okay, good return new OAuthToken($at->tok, $at->secret); @@ -261,6 +245,108 @@ class ApiStatusNetOAuthDataStore extends StatusNetOAuthDataStore } } + /* + * Generate a new access token and save it to the database + * + * @param Consumer $consumer the OAuth consumer + * @param Token $rt the authorized request token + * @param string $verifier the OAuth 1.0a verifier + * + * @access private + * + * @return Token $at the new access token + */ + private function generateNewAccessToken($consumer, $rt, $verifier) + { + $at = new Token(); + + $at->consumer_key = $consumer->key; + $at->tok = common_good_rand(16); + $at->secret = common_good_rand(16); + $at->type = 1; // access + $at->verifier = $verifier; + $at->verified_callback = $rt->verified_callback; // 1.0a + $at->created = common_sql_now(); + + if (!$at->insert()) { + $e = $at->_lastError; + common_debug('access token "' . $at->tok . '" not inserted: "' . $e->message . '"', __FILE__); + return null; + } else { + common_debug('access token "' . $at->tok . '" inserted', __FILE__); + // burn the old one + $orig_rt = clone($rt); + $rt->state = 2; // used + if (!$rt->update($orig_rt)) { + return null; + } + common_debug('request token "' . $rt->tok . '" updated', __FILE__); + } + + return $at; + } + + /* + * Add a new app user (Oauth_application_user) record + * + * @param Oauth_token_association $tokenAssoc token-to-app association + * @param Oauth_application $app the OAuth client app + * @param Token $at the access token + * + * @access private + * + * @return void + */ + private function newAppUser($tokenAssoc, $app, $at) + { + $appUser = new Oauth_application_user(); + + $appUser->profile_id = $tokenAssoc->profile_id; + $appUser->application_id = $app->id; + $appUser->access_type = $app->access_type; + $appUser->token = $at->tok; + $appUser->created = common_sql_now(); + + $result = $appUser->insert(); + + if (!$result) { + common_log_db_error($appUser, 'INSERT', __FILE__); + + // TRANS: Server error displayed when a database error occurs. + throw new Exception( + _('Database error inserting OAuth application user.') + ); + } + } + + /* + * Update an existing app user (Oauth_application_user) record + * + * @param Oauth_application_user $appUser existing app user rec + * @param Oauth_application $app the OAuth client app + * @param Token $at the access token + * + * @access private + * + * @return void + */ + private function updateAppUser($appUser, $app, $at) + { + $original = clone($appUser); + $appUser->access_type = $app->access_type; + $appUser->token = $at->tok; + + $result = $appUser->update($original); + + if (!$result) { + common_log_db_error($appUser, 'UPDATE', __FILE__); + // TRANS: Server error displayed when a database error occurs. + throw new Exception( + _('Database error updating OAuth application user.') + ); + } + } + /** * Revoke specified access token * From edeaf8a2f810a58678428cd5a0393addd152656c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 20 Jan 2011 16:08:22 -0500 Subject: [PATCH 07/89] new group message layout --- ...up_private_inbox.php => Group_message.php} | 12 ++-- plugins/PrivateGroup/PrivateGroupPlugin.php | 57 +++++++++++++++---- 2 files changed, 53 insertions(+), 16 deletions(-) rename plugins/PrivateGroup/{Group_private_inbox.php => Group_message.php} (93%) diff --git a/plugins/PrivateGroup/Group_private_inbox.php b/plugins/PrivateGroup/Group_message.php similarity index 93% rename from plugins/PrivateGroup/Group_private_inbox.php rename to plugins/PrivateGroup/Group_message.php index 11142314bc..404f663a1f 100644 --- a/plugins/PrivateGroup/Group_private_inbox.php +++ b/plugins/PrivateGroup/Group_message.php @@ -53,7 +53,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; * @see DB_DataObject */ -class User_greeting_count extends Memcached_DataObject +class Group_message extends Memcached_DataObject { public $__table = 'user_greeting_count'; // table name public $user_id; // int(4) primary_key not_null @@ -67,12 +67,12 @@ class User_greeting_count extends Memcached_DataObject * @param string $k Key to use to lookup (usually 'user_id' for this class) * @param mixed $v Value to lookup * - * @return User_greeting_count object found, or null for no hits + * @return Group_message object found, or null for no hits * */ function staticGet($k, $v=null) { - return Memcached_DataObject::staticGet('User_greeting_count', $k, $v); + return Memcached_DataObject::staticGet('Group_message', $k, $v); } /** @@ -143,15 +143,15 @@ class User_greeting_count extends Memcached_DataObject * * @param integer $user_id ID of the user to get a count for * - * @return User_greeting_count instance for this user, with count already incremented. + * @return Group_message instance for this user, with count already incremented. */ static function inc($user_id) { - $gc = User_greeting_count::staticGet('user_id', $user_id); + $gc = Group_message::staticGet('user_id', $user_id); if (empty($gc)) { - $gc = new User_greeting_count(); + $gc = new Group_message(); $gc->user_id = $user_id; $gc->greeting_count = 1; diff --git a/plugins/PrivateGroup/PrivateGroupPlugin.php b/plugins/PrivateGroup/PrivateGroupPlugin.php index f0f904cca1..0ae1247bee 100644 --- a/plugins/PrivateGroup/PrivateGroupPlugin.php +++ b/plugins/PrivateGroup/PrivateGroupPlugin.php @@ -77,22 +77,59 @@ class PrivateGroupPlugin extends Plugin new ColumnDef('created', 'datetime'), new ColumnDef('modified', - 'timestamp')); - - $schema->ensureTable('group_private_inbox', - array(new ColumnDef('group_id', + 'timestamp'))); + + $schema->ensureTable('group_message', + array(new ColumnDef('id', + 'char', + 36, + false, + 'PRI'), + new ColumnDef('uri', + 'varchar', + 255, + false, + 'UNI'), + new ColumnDef('from_profile', 'integer', null, false, - 'PRI'), - new ColumnDef('allow_privacy', - 'integer'), - new ColumnDef('allow_sender', - 'integer'), + 'MUL'), + new ColumnDef('to_group', + 'integer', + null, + false, + 'MUL'), + new ColumnDef('content', + 'text'), + new ColumnDef('rendered', + 'text'), + new ColumnDef('url', + 'varchar', + 255, + false, + 'UNI'), new ColumnDef('created', 'datetime'), new ColumnDef('modified', - 'timestamp')); + 'timestamp'))); + + + $schema->ensureTable('group_message_copy', + array(new ColumnDef('group_message_id', + 'char', + 36, + false, + 'PRI'), + new ColumnDef('message_uri', + 'varchar', + 255, + false, + 'PRI'), + new ColumnDef('created', + 'datetime'), + new ColumnDef('modified', + 'timestamp'))); return true; } From 73011e6344efa0bd73c0a11cef10c93b2764eb26 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 26 Jan 2011 10:49:14 -0800 Subject: [PATCH 08/89] Add IdentiCurse to notice sources --- db/notice_source.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/db/notice_source.sql b/db/notice_source.sql index 82074077b4..06b1348898 100644 --- a/db/notice_source.sql +++ b/db/notice_source.sql @@ -24,6 +24,7 @@ VALUES ('HelloTxt','HelloTxt','http://hellotxt.com/', now()), ('identicatools','Laconica Tools','http://bitbucketlabs.net/laconica-tools/', now()), ('identichat','identichat','http://identichat.prosody.im/', now()), + ('IdentiCurse','IdentiCurse','http://identicurse.net/', now()), ('IdentiFox','IdentiFox','http://www.bitbucket.org/uncryptic/identifox/', now()), ('identitwitch','IdentiTwitch','http://richfish.org/identitwitch/', now()), ('Jiminy','Jiminy','http://code.google.com/p/jiminy/', now()), From 5fee38b02565ef9b342c2d6c1ad07a0aed413258 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 26 Jan 2011 18:21:43 -0700 Subject: [PATCH 09/89] events for modifying group edit form --- EVENTS.txt | 6 ++ actions/editgroup.php | 201 ++++++++++++++++++++++-------------------- lib/groupeditform.php | 89 ++++++++++--------- 3 files changed, 155 insertions(+), 141 deletions(-) diff --git a/EVENTS.txt b/EVENTS.txt index 6719ba737a..59baf51ce6 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -1057,3 +1057,9 @@ StartCloseNoticeListItemElement: Before the closing of a notice list eleme EndCloseNoticeListItemElement: After the closing of a notice list element - $nli: The notice list item being shown + +StartGroupEditFormData: Beginning the group edit form entries +- $form: The form widget being shown + +EndGroupEditFormData: Ending the group edit form entries +- $form: The form widget being shown diff --git a/actions/editgroup.php b/actions/editgroup.php index ab4dbb2836..0e04170051 100644 --- a/actions/editgroup.php +++ b/actions/editgroup.php @@ -177,116 +177,121 @@ class EditgroupAction extends GroupDesignAction return; } - $nickname = Nickname::normalize($this->trimmed('nickname')); - $fullname = $this->trimmed('fullname'); - $homepage = $this->trimmed('homepage'); - $description = $this->trimmed('description'); - $location = $this->trimmed('location'); - $aliasstring = $this->trimmed('aliases'); + if (Event::handle('StartGroupSaveForm', array($this))) { - if ($this->nicknameExists($nickname)) { - // TRANS: Group edit form validation error. - $this->showForm(_('Nickname already in use. Try another one.')); - return; - } else if (!User_group::allowedNickname($nickname)) { - // TRANS: Group edit form validation error. - $this->showForm(_('Not a valid nickname.')); - return; - } else if (!is_null($homepage) && (strlen($homepage) > 0) && - !Validate::uri($homepage, - array('allowed_schemes' => - array('http', 'https')))) { - // TRANS: Group edit form validation error. - $this->showForm(_('Homepage is not a valid URL.')); - return; - } else if (!is_null($fullname) && mb_strlen($fullname) > 255) { - // TRANS: Group edit form validation error. - $this->showForm(_('Full name is too long (maximum 255 characters).')); - return; - } else if (User_group::descriptionTooLong($description)) { - $this->showForm(sprintf( + $nickname = Nickname::normalize($this->trimmed('nickname')); + $fullname = $this->trimmed('fullname'); + $homepage = $this->trimmed('homepage'); + $description = $this->trimmed('description'); + $location = $this->trimmed('location'); + $aliasstring = $this->trimmed('aliases'); + + if ($this->nicknameExists($nickname)) { // TRANS: Group edit form validation error. - _m('Description is too long (maximum %d character).', - 'Description is too long (maximum %d characters).', - User_group::maxDescription()), + $this->showForm(_('Nickname already in use. Try another one.')); + return; + } else if (!User_group::allowedNickname($nickname)) { + // TRANS: Group edit form validation error. + $this->showForm(_('Not a valid nickname.')); + return; + } else if (!is_null($homepage) && (strlen($homepage) > 0) && + !Validate::uri($homepage, + array('allowed_schemes' => + array('http', 'https')))) { + // TRANS: Group edit form validation error. + $this->showForm(_('Homepage is not a valid URL.')); + return; + } else if (!is_null($fullname) && mb_strlen($fullname) > 255) { + // TRANS: Group edit form validation error. + $this->showForm(_('Full name is too long (maximum 255 characters).')); + return; + } else if (User_group::descriptionTooLong($description)) { + $this->showForm(sprintf( + // TRANS: Group edit form validation error. + _m('Description is too long (maximum %d character).', + 'Description is too long (maximum %d characters).', + User_group::maxDescription()), User_group::maxDescription())); - return; - } else if (!is_null($location) && mb_strlen($location) > 255) { - // TRANS: Group edit form validation error. - $this->showForm(_('Location is too long (maximum 255 characters).')); - return; - } - - if (!empty($aliasstring)) { - $aliases = array_map('common_canonical_nickname', array_unique(preg_split('/[\s,]+/', $aliasstring))); - } else { - $aliases = array(); - } - - if (count($aliases) > common_config('group', 'maxaliases')) { - // TRANS: Group edit form validation error. - // TRANS: %d is the maximum number of allowed aliases. - $this->showForm(sprintf(_m('Too many aliases! Maximum %d allowed.', - 'Too many aliases! Maximum %d allowed.', - common_config('group', 'maxaliases')), - common_config('group', 'maxaliases'))); - return; - } - - foreach ($aliases as $alias) { - if (!Nickname::isValid($alias)) { + return; + } else if (!is_null($location) && mb_strlen($location) > 255) { // TRANS: Group edit form validation error. - $this->showForm(sprintf(_('Invalid alias: "%s"'), $alias)); + $this->showForm(_('Location is too long (maximum 255 characters).')); return; } - if ($this->nicknameExists($alias)) { + + if (!empty($aliasstring)) { + $aliases = array_map('common_canonical_nickname', array_unique(preg_split('/[\s,]+/', $aliasstring))); + } else { + $aliases = array(); + } + + if (count($aliases) > common_config('group', 'maxaliases')) { // TRANS: Group edit form validation error. - $this->showForm(sprintf(_('Alias "%s" already in use. Try another one.'), - $alias)); + // TRANS: %d is the maximum number of allowed aliases. + $this->showForm(sprintf(_m('Too many aliases! Maximum %d allowed.', + 'Too many aliases! Maximum %d allowed.', + common_config('group', 'maxaliases')), + common_config('group', 'maxaliases'))); return; } - // XXX assumes alphanum nicknames - if (strcmp($alias, $nickname) == 0) { - // TRANS: Group edit form validation error. - $this->showForm(_('Alias can\'t be the same as nickname.')); - return; + + foreach ($aliases as $alias) { + if (!Nickname::isValid($alias)) { + // TRANS: Group edit form validation error. + $this->showForm(sprintf(_('Invalid alias: "%s"'), $alias)); + return; + } + if ($this->nicknameExists($alias)) { + // TRANS: Group edit form validation error. + $this->showForm(sprintf(_('Alias "%s" already in use. Try another one.'), + $alias)); + return; + } + // XXX assumes alphanum nicknames + if (strcmp($alias, $nickname) == 0) { + // TRANS: Group edit form validation error. + $this->showForm(_('Alias can\'t be the same as nickname.')); + return; + } } + + $this->group->query('BEGIN'); + + $orig = clone($this->group); + + $this->group->nickname = $nickname; + $this->group->fullname = $fullname; + $this->group->homepage = $homepage; + $this->group->description = $description; + $this->group->location = $location; + $this->group->mainpage = common_local_url('showgroup', array('nickname' => $nickname)); + + $result = $this->group->update($orig); + + if (!$result) { + common_log_db_error($this->group, 'UPDATE', __FILE__); + // TRANS: Server error displayed when editing a group fails. + $this->serverError(_('Could not update group.')); + } + + $result = $this->group->setAliases($aliases); + + if (!$result) { + // TRANS: Server error displayed when group aliases could not be added. + $this->serverError(_('Could not create aliases.')); + } + + if ($nickname != $orig->nickname) { + common_log(LOG_INFO, "Saving local group info."); + $local = Local_group::staticGet('group_id', $this->group->id); + $local->setNickname($nickname); + } + + $this->group->query('COMMIT'); + + Event::handle('EndGroupSaveForm', array($this)); } - $this->group->query('BEGIN'); - - $orig = clone($this->group); - - $this->group->nickname = $nickname; - $this->group->fullname = $fullname; - $this->group->homepage = $homepage; - $this->group->description = $description; - $this->group->location = $location; - $this->group->mainpage = common_local_url('showgroup', array('nickname' => $nickname)); - - $result = $this->group->update($orig); - - if (!$result) { - common_log_db_error($this->group, 'UPDATE', __FILE__); - // TRANS: Server error displayed when editing a group fails. - $this->serverError(_('Could not update group.')); - } - - $result = $this->group->setAliases($aliases); - - if (!$result) { - // TRANS: Server error displayed when group aliases could not be added. - $this->serverError(_('Could not create aliases.')); - } - - if ($nickname != $orig->nickname) { - common_log(LOG_INFO, "Saving local group info."); - $local = Local_group::staticGet('group_id', $this->group->id); - $local->setNickname($nickname); - } - - $this->group->query('COMMIT'); - if ($this->group->nickname != $orig->nickname) { common_redirect(common_local_url('editgroup', array('nickname' => $nickname)), diff --git a/lib/groupeditform.php b/lib/groupeditform.php index cc25f06886..8e4519267b 100644 --- a/lib/groupeditform.php +++ b/lib/groupeditform.php @@ -147,51 +147,54 @@ class GroupEditForm extends Form } $this->out->elementStart('ul', 'form_data'); - $this->out->elementStart('li'); - $this->out->hidden('groupid', $id); - $this->out->input('nickname', _('Nickname'), - ($this->out->arg('nickname')) ? $this->out->arg('nickname') : $nickname, - _('1-64 lowercase letters or numbers, no punctuation or spaces')); - $this->out->elementEnd('li'); - $this->out->elementStart('li'); - $this->out->input('fullname', _('Full name'), - ($this->out->arg('fullname')) ? $this->out->arg('fullname') : $fullname); - $this->out->elementEnd('li'); - $this->out->elementStart('li'); - $this->out->input('homepage', _('Homepage'), - ($this->out->arg('homepage')) ? $this->out->arg('homepage') : $homepage, - _('URL of the homepage or blog of the group or topic.')); - $this->out->elementEnd('li'); - $this->out->elementStart('li'); - $desclimit = User_group::maxDescription(); - if ($desclimit == 0) { - $descinstr = _('Describe the group or topic'); - } else { - $descinstr = sprintf(_m('Describe the group or topic in %d character or less', - 'Describe the group or topic in %d characters or less', - $desclimit), - $desclimit); - } - $this->out->textarea('description', _('Description'), - ($this->out->arg('description')) ? $this->out->arg('description') : $description, - $descinstr); - $this->out->elementEnd('li'); - $this->out->elementStart('li'); - $this->out->input('location', _('Location'), - ($this->out->arg('location')) ? $this->out->arg('location') : $location, - _('Location for the group, if any, like "City, State (or Region), Country".')); - $this->out->elementEnd('li'); - if (common_config('group', 'maxaliases') > 0) { - $aliases = (empty($this->group)) ? array() : $this->group->getAliases(); + if (Event::handle('StartGroupEditFormData', array($this))) { $this->out->elementStart('li'); - $this->out->input('aliases', _('Aliases'), - ($this->out->arg('aliases')) ? $this->out->arg('aliases') : - (!empty($aliases)) ? implode(' ', $aliases) : '', - sprintf(_m('Extra nicknames for the group, separated with commas or spaces. Maximum %d alias allowed.', - 'Extra nicknames for the group, separated with commas or spaces. Maximum %d aliases allowed.', - common_config('group', 'maxaliases')), - common_config('group', 'maxaliases')));; + $this->out->hidden('groupid', $id); + $this->out->input('nickname', _('Nickname'), + ($this->out->arg('nickname')) ? $this->out->arg('nickname') : $nickname, + _('1-64 lowercase letters or numbers, no punctuation or spaces')); $this->out->elementEnd('li'); + $this->out->elementStart('li'); + $this->out->input('fullname', _('Full name'), + ($this->out->arg('fullname')) ? $this->out->arg('fullname') : $fullname); + $this->out->elementEnd('li'); + $this->out->elementStart('li'); + $this->out->input('homepage', _('Homepage'), + ($this->out->arg('homepage')) ? $this->out->arg('homepage') : $homepage, + _('URL of the homepage or blog of the group or topic.')); + $this->out->elementEnd('li'); + $this->out->elementStart('li'); + $desclimit = User_group::maxDescription(); + if ($desclimit == 0) { + $descinstr = _('Describe the group or topic'); + } else { + $descinstr = sprintf(_m('Describe the group or topic in %d character or less', + 'Describe the group or topic in %d characters or less', + $desclimit), + $desclimit); + } + $this->out->textarea('description', _('Description'), + ($this->out->arg('description')) ? $this->out->arg('description') : $description, + $descinstr); + $this->out->elementEnd('li'); + $this->out->elementStart('li'); + $this->out->input('location', _('Location'), + ($this->out->arg('location')) ? $this->out->arg('location') : $location, + _('Location for the group, if any, like "City, State (or Region), Country".')); + $this->out->elementEnd('li'); + if (common_config('group', 'maxaliases') > 0) { + $aliases = (empty($this->group)) ? array() : $this->group->getAliases(); + $this->out->elementStart('li'); + $this->out->input('aliases', _('Aliases'), + ($this->out->arg('aliases')) ? $this->out->arg('aliases') : + (!empty($aliases)) ? implode(' ', $aliases) : '', + sprintf(_m('Extra nicknames for the group, separated with commas or spaces. Maximum %d alias allowed.', + 'Extra nicknames for the group, separated with commas or spaces. Maximum %d aliases allowed.', + common_config('group', 'maxaliases')), + common_config('group', 'maxaliases')));; + $this->out->elementEnd('li'); + } + Event::handle('EndGroupEditFormData', array($this)); } $this->out->elementEnd('ul'); } From 2682915b99a63a395e04cabf2c6cb71d3716acdd Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 26 Jan 2011 18:35:01 -0700 Subject: [PATCH 10/89] events for creating a group --- EVENTS.txt | 6 +++ classes/User_group.php | 110 ++++++++++++++++++++++------------------- 2 files changed, 64 insertions(+), 52 deletions(-) diff --git a/EVENTS.txt b/EVENTS.txt index 59baf51ce6..d26c576e19 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -1063,3 +1063,9 @@ StartGroupEditFormData: Beginning the group edit form entries EndGroupEditFormData: Ending the group edit form entries - $form: The form widget being shown + +StartGroupSave: After initializing but before saving a group +- &$group: group about to be saved + +EndGroupSave: After saving a group, aliases, and first member +- $group: group that was saved diff --git a/classes/User_group.php b/classes/User_group.php index d402ed4773..5a9991fe9e 100644 --- a/classes/User_group.php +++ b/classes/User_group.php @@ -512,64 +512,70 @@ class User_group extends Memcached_DataObject $group->mainpage = $mainpage; $group->created = common_sql_now(); - $result = $group->insert(); + if (Event::handle('StartGroupSave', array(&$group))) { - if (!$result) { - common_log_db_error($group, 'INSERT', __FILE__); - // TRANS: Server exception thrown when creating a group failed. - throw new ServerException(_('Could not create group.')); - } - - if (!isset($uri) || empty($uri)) { - $orig = clone($group); - $group->uri = common_local_url('groupbyid', array('id' => $group->id)); - $result = $group->update($orig); - if (!$result) { - common_log_db_error($group, 'UPDATE', __FILE__); - // TRANS: Server exception thrown when updating a group URI failed. - throw new ServerException(_('Could not set group URI.')); - } - } - - $result = $group->setAliases($aliases); - - if (!$result) { - // TRANS: Server exception thrown when creating group aliases failed. - throw new ServerException(_('Could not create aliases.')); - } - - $member = new Group_member(); - - $member->group_id = $group->id; - $member->profile_id = $userid; - $member->is_admin = 1; - $member->created = $group->created; - - $result = $member->insert(); - - if (!$result) { - common_log_db_error($member, 'INSERT', __FILE__); - // TRANS: Server exception thrown when setting group membership failed. - throw new ServerException(_('Could not set group membership.')); - } - - if ($local) { - $local_group = new Local_group(); - - $local_group->group_id = $group->id; - $local_group->nickname = $nickname; - $local_group->created = common_sql_now(); - - $result = $local_group->insert(); + $result = $group->insert(); if (!$result) { - common_log_db_error($local_group, 'INSERT', __FILE__); - // TRANS: Server exception thrown when saving local group information failed. - throw new ServerException(_('Could not save local group info.')); + common_log_db_error($group, 'INSERT', __FILE__); + // TRANS: Server exception thrown when creating a group failed. + throw new ServerException(_('Could not create group.')); } + + if (!isset($uri) || empty($uri)) { + $orig = clone($group); + $group->uri = common_local_url('groupbyid', array('id' => $group->id)); + $result = $group->update($orig); + if (!$result) { + common_log_db_error($group, 'UPDATE', __FILE__); + // TRANS: Server exception thrown when updating a group URI failed. + throw new ServerException(_('Could not set group URI.')); + } + } + + $result = $group->setAliases($aliases); + + if (!$result) { + // TRANS: Server exception thrown when creating group aliases failed. + throw new ServerException(_('Could not create aliases.')); + } + + $member = new Group_member(); + + $member->group_id = $group->id; + $member->profile_id = $userid; + $member->is_admin = 1; + $member->created = $group->created; + + $result = $member->insert(); + + if (!$result) { + common_log_db_error($member, 'INSERT', __FILE__); + // TRANS: Server exception thrown when setting group membership failed. + throw new ServerException(_('Could not set group membership.')); + } + + if ($local) { + $local_group = new Local_group(); + + $local_group->group_id = $group->id; + $local_group->nickname = $nickname; + $local_group->created = common_sql_now(); + + $result = $local_group->insert(); + + if (!$result) { + common_log_db_error($local_group, 'INSERT', __FILE__); + // TRANS: Server exception thrown when saving local group information failed. + throw new ServerException(_('Could not save local group info.')); + } + } + + $group->query('COMMIT'); + + Event::handle('EndGroupSave', array($group)); } - $group->query('COMMIT'); return $group; } From 1a96a5e695e76f4a7e91ffe10e5ca0b5ccbfccaf Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 26 Jan 2011 18:48:13 -0700 Subject: [PATCH 11/89] create privacy settings on new group --- plugins/PrivateGroup/PrivateGroupPlugin.php | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/plugins/PrivateGroup/PrivateGroupPlugin.php b/plugins/PrivateGroup/PrivateGroupPlugin.php index 0ae1247bee..9851313ff4 100644 --- a/plugins/PrivateGroup/PrivateGroupPlugin.php +++ b/plugins/PrivateGroup/PrivateGroupPlugin.php @@ -202,6 +202,31 @@ class PrivateGroupPlugin extends Plugin return true; } + /** + * Create default group privacy settings at group create time + * + * @param $group Group that was just created + * + * @result boolean hook value + */ + + function onEndGroupSave($group) + { + $gps = new Group_privacy_settings(); + + $gps->group_id = $group->id; + $gps->allow_privacy = Group_privacy_settings::SOMETIMES; + $gps->allow_sender = Group_privacy_settings::MEMBER; + $gps->created = common_sql_now(); + $gps->modified = $gps->created; + + // This will throw an exception on error + + $gps->insert(); + + return true; + } + function onPluginVersion(&$versions) { $versions[] = array('name' => 'PrivateGroup', From 433ec211199aedc98e7d6949a17d6b5c2d0932f3 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 27 Jan 2011 12:07:29 -0800 Subject: [PATCH 12/89] Add $config['sessions']['gc_limit'] to limit how much work we do in each session GC; defaulting to killing 1000 sessions at a time. --- classes/Session.php | 7 +++++++ lib/default.php | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/classes/Session.php b/classes/Session.php index e1c83ad4dc..166b89815a 100644 --- a/classes/Session.php +++ b/classes/Session.php @@ -156,6 +156,13 @@ class Session extends Memcached_DataObject $session->selectAdd(); $session->selectAdd('id'); + $limit = common_config('sessions', 'gc_limit'); + if ($limit > 0) { + // On large sites, too many sessions to expire + // at once will just result in failure. + $session->limit($limit); + } + $session->find(); while ($session->fetch()) { diff --git a/lib/default.php b/lib/default.php index 85d27f5220..4b28e3238b 100644 --- a/lib/default.php +++ b/lib/default.php @@ -261,8 +261,9 @@ $default = 'search' => array('type' => 'fulltext'), 'sessions' => - array('handle' => false, // whether to handle sessions ourselves - 'debug' => false), // debugging output for sessions + array('handle' => false, // whether to handle sessions ourselves + 'debug' => false, // debugging output for sessions + 'gc_limit' => 1000), // max sessions to expire at a time 'design' => array('backgroundcolor' => null, // null -> 'use theme default' 'contentcolor' => null, From a7abb2323e7d57125b9fbc903a1cecc06c27944e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 27 Jan 2011 12:27:31 -0800 Subject: [PATCH 13/89] Session GC fix: save session.modified field as UTC so our comparisons work. Had to tweak statusnet.ini to remove the DB_DATAOBJECT_MYSQLTIMESTAMP bitfield constant on session.modified; while it sounds like a useful and legit setting, it actually just means that DB_DataObject silently fails to pass through any attempts to explicitly set the value. As a result, MySQL does its default behavior which is to insert the current *LOCAL* time, which is useless. This was leading to early GC west of GMT, or late GC east of it. Early GC could at worst destroy all live sessions (whoever's session *triggered* GC is fine, as the session then gets saved right back.) --- classes/Session.php | 2 ++ classes/statusnet.ini | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/classes/Session.php b/classes/Session.php index 166b89815a..b9daf364db 100644 --- a/classes/Session.php +++ b/classes/Session.php @@ -87,6 +87,7 @@ class Session extends Memcached_DataObject $session->id = $id; $session->session_data = $session_data; $session->created = common_sql_now(); + $session->modified = common_sql_now(); $result = $session->insert(); @@ -108,6 +109,7 @@ class Session extends Memcached_DataObject $orig = clone($session); $session->session_data = $session_data; + $session->modified = common_sql_now(); $result = $session->update($orig); diff --git a/classes/statusnet.ini b/classes/statusnet.ini index ef631e28d3..29fde93b5d 100644 --- a/classes/statusnet.ini +++ b/classes/statusnet.ini @@ -513,7 +513,20 @@ profile_id = K id = 130 session_data = 34 created = 142 -modified = 384 +modified = 142 +; Warning: using DB_DATAOBJECT_MYSQLTIMESTAMP (256) causes DB_DataObject +; to SILENTLY REMOVE ATTEMPTS TO SET THIS FIELD DIRECTLY, which is pretty +; bad because the default behavior for auto-updated TIMESTAMP fields is +; to use local time. Local time can't be compared to UTC in any useful +; way, so doing that breaks session GC. +; +; Instead we'll use the plain datetime settings so it'll actually save the +; UTC value we provide when updating. +; +; Long-term fix: punch MySQL in the face until it understands that local +; time is a tool of the cyber-devil. +; +;modified = 384 [session__keys] id = K From 2a29738dc1240b534c1eb1e60472e42168ee5d05 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 31 Jan 2011 11:50:24 -0800 Subject: [PATCH 14/89] Revert "Session GC fix: save session.modified field as UTC so our comparisons work." - no longer needed with ticket #3020 fix to time zone settings This reverts commit a7abb2323e7d57125b9fbc903a1cecc06c27944e. --- classes/Session.php | 2 -- classes/statusnet.ini | 15 +-------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/classes/Session.php b/classes/Session.php index b9daf364db..166b89815a 100644 --- a/classes/Session.php +++ b/classes/Session.php @@ -87,7 +87,6 @@ class Session extends Memcached_DataObject $session->id = $id; $session->session_data = $session_data; $session->created = common_sql_now(); - $session->modified = common_sql_now(); $result = $session->insert(); @@ -109,7 +108,6 @@ class Session extends Memcached_DataObject $orig = clone($session); $session->session_data = $session_data; - $session->modified = common_sql_now(); $result = $session->update($orig); diff --git a/classes/statusnet.ini b/classes/statusnet.ini index 29fde93b5d..ef631e28d3 100644 --- a/classes/statusnet.ini +++ b/classes/statusnet.ini @@ -513,20 +513,7 @@ profile_id = K id = 130 session_data = 34 created = 142 -modified = 142 -; Warning: using DB_DATAOBJECT_MYSQLTIMESTAMP (256) causes DB_DataObject -; to SILENTLY REMOVE ATTEMPTS TO SET THIS FIELD DIRECTLY, which is pretty -; bad because the default behavior for auto-updated TIMESTAMP fields is -; to use local time. Local time can't be compared to UTC in any useful -; way, so doing that breaks session GC. -; -; Instead we'll use the plain datetime settings so it'll actually save the -; UTC value we provide when updating. -; -; Long-term fix: punch MySQL in the face until it understands that local -; time is a tool of the cyber-devil. -; -;modified = 384 +modified = 384 [session__keys] id = K From b896a37da0b2ce78802c3e0007084fe739b2ba0d Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 31 Jan 2011 12:22:50 -0800 Subject: [PATCH 15/89] Use cachedQuery on File::getAttachments, plus other cleanups: * dropped unnecessary join on notice table * made the function actually static, since it makes no sense as an instance variable. The only caller (in AttachmentList) is updated. --- classes/File.php | 18 ++++++++++++------ lib/attachmentlist.php | 3 +-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/classes/File.php b/classes/File.php index 29a8f0f1c5..e9a0131c4e 100644 --- a/classes/File.php +++ b/classes/File.php @@ -55,14 +55,20 @@ class File extends Memcached_DataObject return 'http://www.facebook.com/login.php' === $url; } - function getAttachments($post_id) { - $query = "select file.* from file join file_to_post on (file_id = file.id) join notice on (post_id = notice.id) where post_id = " . $this->escape($post_id); - $this->query($query); + /** + * Get the attachments for a particlar notice. + * + * @param int $post_id + * @return array of File objects + */ + static function getAttachments($post_id) { + $file = new File(); + $query = "select file.* from file join file_to_post on (file_id = file.id) where post_id = " . $file->escape($post_id); + $file = Memcached_DataObject::cachedQuery('File', $query); $att = array(); - while ($this->fetch()) { - $att[] = clone($this); + while ($file->fetch()) { + $att[] = clone($file); } - $this->free(); return $att; } diff --git a/lib/attachmentlist.php b/lib/attachmentlist.php index 7e536925bf..c3d3f4d116 100644 --- a/lib/attachmentlist.php +++ b/lib/attachmentlist.php @@ -76,8 +76,7 @@ class AttachmentList extends Widget */ function show() { - $atts = new File; - $att = $atts->getAttachments($this->notice->id); + $att = File::getAttachments($this->notice->id); if (empty($att)) return 0; $this->showListStart(); From de7726dd0037ea3cee91bf64162fc8b19853ec7a Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 31 Jan 2011 13:12:56 -0800 Subject: [PATCH 16/89] Performance counters: records number of total and unique cache get/set/incr/deletes and queries, and logs to syslog. $config['site']['logperf'] = true; // to record & dump total hits of each type and the runtime to syslog $config['site']['logperf_detail'] = true; // very verbose -- dump the individual cache keys and queries as they get used (may contain private info in some queries) Seeing 180 cache gets on a timeline page seems not unusual currently; since these run in serial, even relatively small roundtrip times can add up heavily. We should consider ways to reduce the number of round trips, such as more frequently storing compound objects or the output of processing in memcached. Doing parallel multi-key lookups could also help by collapsing round-trip times, but might not be easy to fit into SN's object model. (For things like streams this should actually work pretty well -- grab the list, then when it's returned go grab all the individual items in parallel and return the list) --- classes/Memcached_DataObject.php | 1 + index.php | 3 +++ lib/cache.php | 4 ++++ lib/default.php | 2 ++ lib/util.php | 37 ++++++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+) diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index a3c2de8e64..867b40cf3c 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -340,6 +340,7 @@ class Memcached_DataObject extends Safe_DataObject $start = microtime(true); $result = null; if (Event::handle('StartDBQuery', array($this, $string, &$result))) { + common_perf_counter('query', $string); $result = parent::_query($string); Event::handle('EndDBQuery', array($this, $string, &$result)); } diff --git a/index.php b/index.php index 37c157b01f..7f2afffb5a 100644 --- a/index.php +++ b/index.php @@ -38,6 +38,7 @@ */ $_startTime = microtime(true); +$_perfCounters = array(); define('INSTALLDIR', dirname(__FILE__)); define('STATUSNET', true); @@ -45,6 +46,8 @@ define('LACONICA', true); // compatibility require_once INSTALLDIR . '/lib/common.php'; +register_shutdown_function('common_log_perf_counters'); + $user = null; $action = null; diff --git a/lib/cache.php b/lib/cache.php index dc667654ab..bf0603c62d 100644 --- a/lib/cache.php +++ b/lib/cache.php @@ -164,6 +164,7 @@ class Cache { $value = false; + common_perf_counter('Cache::get', $key); if (Event::handle('StartCacheGet', array(&$key, &$value))) { if (array_key_exists($key, $this->_items)) { $value = unserialize($this->_items[$key]); @@ -188,6 +189,7 @@ class Cache { $success = false; + common_perf_counter('Cache::set', $key); if (Event::handle('StartCacheSet', array(&$key, &$value, &$flag, &$expiry, &$success))) { @@ -214,6 +216,7 @@ class Cache function increment($key, $step=1) { $value = false; + common_perf_counter('Cache::increment', $key); if (Event::handle('StartCacheIncrement', array(&$key, &$step, &$value))) { // Fallback is not guaranteed to be atomic, // and may original expiry value. @@ -239,6 +242,7 @@ class Cache { $success = false; + common_perf_counter('Cache::delete', $key); if (Event::handle('StartCacheDelete', array(&$key, &$success))) { if (array_key_exists($key, $this->_items)) { unset($this->_items[$key]); diff --git a/lib/default.php b/lib/default.php index 405213fbea..2ddc47bd17 100644 --- a/lib/default.php +++ b/lib/default.php @@ -39,6 +39,8 @@ $default = 'logo' => null, 'ssllogo' => null, 'logdebug' => false, + 'logperf' => false, // Enable to dump performance counters to syslog + 'logperf_detail' => false, // Enable to dump every counter hit 'fancy' => false, 'locale_path' => INSTALLDIR.'/locale', 'language' => 'en', diff --git a/lib/util.php b/lib/util.php index da36121ffd..85f49e4c59 100644 --- a/lib/util.php +++ b/lib/util.php @@ -2184,3 +2184,40 @@ function common_nicknamize($str) $str = preg_replace('/\W/', '', $str); return strtolower($str); } + +function common_perf_counter($key, $val=null) +{ + global $_perfCounters; + if (isset($_perfCounters)) { + if (common_config('site', 'logperf')) { + if (array_key_exists($key, $_perfCounters)) { + $_perfCounters[$key][] = $val; + } else { + $_perfCounters[$key] = array($val); + } + if (common_config('site', 'logperf_detail')) { + common_log(LOG_DEBUG, "PERF COUNTER HIT: $key $val"); + } + } + } +} + +function common_log_perf_counters() +{ + if (common_config('site', 'logperf')) { + global $_startTime, $_perfCounters; + + if (isset($_startTime)) { + $endTime = microtime(true); + $diff = round(($endTime - $_startTime) * 1000); + common_log(LOG_DEBUG, "PERF runtime: ${diff}ms"); + } + $counters = $_perfCounters; + ksort($counters); + foreach ($counters as $key => $values) { + $count = count($values); + $unique = count(array_unique($values)); + common_log(LOG_DEBUG, "PERF COUNTER: $key $count ($unique unique)"); + } + } +} From b46ce3b67d189d729a4a7679dfb6d6434190d392 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 31 Jan 2011 14:00:22 -0800 Subject: [PATCH 17/89] Fix "$s"s that slipped into double-quoted translatable strings' '%1$s' pattern. Switch to single-quote to fix. --- actions/atompubfavoritefeed.php | 2 +- actions/atompubmembershipfeed.php | 2 +- actions/atompubsubscriptionfeed.php | 2 +- lib/activityimporter.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/actions/atompubfavoritefeed.php b/actions/atompubfavoritefeed.php index d35bd9f53e..c31fcbd72a 100644 --- a/actions/atompubfavoritefeed.php +++ b/actions/atompubfavoritefeed.php @@ -144,7 +144,7 @@ class AtompubfavoritefeedAction extends ApiAuthAction // TRANS: Subtitle for Atom favorites feed. // TRANS: %1$s is a user nickname, %2$s is the StatusNet sitename. - $feed->setSubtitle(sprintf(_("Notices %1$s has favorited on %2$s"), + $feed->setSubtitle(sprintf(_('Notices %1$s has favorited on %2$s'), $this->_profile->getBestName(), common_config('site', 'name'))); diff --git a/actions/atompubmembershipfeed.php b/actions/atompubmembershipfeed.php index 57cf465a0c..b52583314d 100644 --- a/actions/atompubmembershipfeed.php +++ b/actions/atompubmembershipfeed.php @@ -146,7 +146,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction // TRANS: Subtitle for group membership feed. // TRANS: %1$s is a username, %2$s is the StatusNet sitename. - $feed->setSubtitle(sprintf(_("Groups %1$s is a member of on %2$s"), + $feed->setSubtitle(sprintf(_('Groups %1$s is a member of on %2$s'), $this->_profile->getBestName(), common_config('site', 'name'))); diff --git a/actions/atompubsubscriptionfeed.php b/actions/atompubsubscriptionfeed.php index 1b22efeac3..26740da835 100644 --- a/actions/atompubsubscriptionfeed.php +++ b/actions/atompubsubscriptionfeed.php @@ -150,7 +150,7 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction // TRANS: Subtitle for Atom subscription feed. // TRANS: %1$s is a user nickname, %s$s is the StatusNet sitename. - $feed->setSubtitle(sprintf(_("People %1$s has subscribed to on %2$s"), + $feed->setSubtitle(sprintf(_("People %1\$s has subscribed to on %2\$s"), $this->_profile->getBestName(), common_config('site', 'name'))); diff --git a/lib/activityimporter.php b/lib/activityimporter.php index 0bd7620da3..aa9b95e084 100644 --- a/lib/activityimporter.php +++ b/lib/activityimporter.php @@ -198,8 +198,8 @@ class ActivityImporter extends QueueHandler } else { // TRANS: Client exception thrown when trying to import a notice by another user. // TRANS: %1$s is the source URI of the notice, %2$s is the URI of the author. - throw new ClientException(sprintf(_("Already know about notice %1$s and ". - " it has a different author %2$s."), + throw new ClientException(sprintf(_('Already know about notice %1$s and '. + ' it has a different author %2$s.'), $sourceUri, $uri)); } } else { From 7f1b8720887a6e97df15bc761635418c75870711 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 31 Jan 2011 23:42:43 +0000 Subject: [PATCH 18/89] FacebookPlugin: Fix up FBML canvas app so it keeps working after Facebook removed Profile Boxes and some API calls it relied upon. See: http://developers.facebook.com/roadmap/deprecations --- plugins/Facebook/facebookaction.php | 36 +++++++++-------------------- plugins/Facebook/facebookhome.php | 34 ++++----------------------- plugins/Facebook/facebookutil.php | 33 +------------------------- 3 files changed, 16 insertions(+), 87 deletions(-) diff --git a/plugins/Facebook/facebookaction.php b/plugins/Facebook/facebookaction.php index 4c15fc0397..1a45033a38 100644 --- a/plugins/Facebook/facebookaction.php +++ b/plugins/Facebook/facebookaction.php @@ -81,9 +81,20 @@ class FacebookAction extends Action function showStylesheets() { + // Loading CSS via files in Facebook FBML Canvas apps is still busted as of 1/31/11 + // See: http://bugs.developers.facebook.net/show_bug.cgi?id=10052 $this->cssLink('css/display.css', 'base'); $this->cssLink('css/display.css', null, 'screen, projection, tv'); $this->cssLink('plugins/Facebook/facebookapp.css'); + + // Also, Facebook refuses to let me do this... gar! +/* + $baseCss = file_get_contents(INSTALLDIR . '/theme/base/css/display.css'); + $this->style($baseCss); + + $facebookCss = file_get_contents(INSTALLDIR . '/plugins/Facebook/facebookapp.css'); + $this->style($facebookCss); +*/ } function showScripts() @@ -292,31 +303,6 @@ class FacebookAction extends Action $this->elementEnd('div'); } - function updateProfileBox($notice) - { - - // Need to include inline CSS for styling the Profile box - - $app_props = $this->facebook->api_client->Admin_getAppProperties(array('icon_url')); - $icon_url = $app_props['icon_url']; - - $style = ''; - - $this->xw->openMemory(); - - $item = new FacebookProfileBoxNotice($notice, $this); - $item->show(); - - $fbml = "$style " . $this->xw->outputMemory(false) . ""; - $fbml .= "$style " . $this->xw->outputMemory(false) . ""; - - $fbml_main = "$style " . $this->xw->outputMemory(false) . ""; - - $this->facebook->api_client->profile_setFBML(null, $this->fbuid, $fbml, null, null, $fbml_main); - - $this->xw->openURI('php://output'); - } - /** * Generate pagination links * diff --git a/plugins/Facebook/facebookhome.php b/plugins/Facebook/facebookhome.php index 8b8b974458..9b18a695bf 100644 --- a/plugins/Facebook/facebookhome.php +++ b/plugins/Facebook/facebookhome.php @@ -44,33 +44,15 @@ class FacebookhomeAction extends FacebookAction { parent::handle($args); - // If the user has opted not to initially allow the app to have - // Facebook status update permission, store that preference. Only - // promt the user the first time she uses the app - if ($this->arg('skip') || $args['fb_sig_request_method'] == 'GET') { - $this->facebook->api_client->data_setUserPreference( - FACEBOOK_PROMPTED_UPDATE_PREF, 'true'); - } - - if ($this->flink) { + if (!empty($this->flink)) { $this->user = $this->flink->getUser(); // If this is the first time the user has started the app // prompt for Facebook status update permission if (!$this->facebook->api_client->users_hasAppPermission('publish_stream')) { - - if ($this->facebook->api_client->data_getUserPreference( - FACEBOOK_PROMPTED_UPDATE_PREF) != 'true') { - $this->getUpdatePermission(); - return; - } - } - - // Make sure the user's profile box has the lastest notice - $notice = $this->user->getCurrentNotice(); - if ($notice) { - $this->updateProfileBox($notice); - } + $this->getUpdatePermission(); + return; + } if ($this->arg('status_submit') == 'Send') { $this->saveNewNotice(); @@ -114,8 +96,6 @@ class FacebookhomeAction extends FacebookAction // XXX: Do some error handling here - $this->setDefaults(); - $this->getUpdatePermission(); return; } else { @@ -127,12 +107,6 @@ class FacebookhomeAction extends FacebookAction $this->showFooter(); } - function setDefaults() - { - $this->facebook->api_client->data_setUserPreference( - FACEBOOK_PROMPTED_UPDATE_PREF, 'false'); - } - function showNoticeForm() { $post_action = "$this->app_uri/index.php"; diff --git a/plugins/Facebook/facebookutil.php b/plugins/Facebook/facebookutil.php index fb70c51bc5..3996459a63 100644 --- a/plugins/Facebook/facebookutil.php +++ b/plugins/Facebook/facebookutil.php @@ -50,6 +50,7 @@ function getFacebook() function isFacebookBound($notice, $flink) { if (empty($flink)) { + common_debug("QQQQQ empty flink"); return false; } @@ -157,11 +158,6 @@ function facebookBroadcastNotice($notice) common_log(LOG_WARNING, $msg); } - // Finally, attempt to update the user's profile box - if ($canPublish == 1 || $canUpdate == 1) { - updateProfileBox($facebook, $flink, $notice, $user); - } - } catch (FacebookRestClientException $e) { return handleFacebookError($e, $notice, $flink); } @@ -293,33 +289,6 @@ function publishStream($notice, $user, $fbuid) ); } -function updateProfileBox($facebook, $flink, $notice, $user) { - - $facebook = getFacebook(); - $fbaction = new FacebookAction( - $output = 'php://output', - $indent = null, - $facebook, - $flink - ); - - $fbuid = $flink->foreign_id; - - common_debug( - 'FacebookPlugin - Attempting to update profile box with ' - . "content from notice $notice->id for $user->nickname ($user->id), " - . "Facebook UID: $fbuid" - ); - - $fbaction->updateProfileBox($notice); - - common_debug( - 'FacebookPlugin - finished updating profile box for ' - . "$user->nickname ($user->id) Facebook UID: $fbuid" - ); - -} - function format_attachments($attachments) { $fbattachment = array(); From ad12384d8c021c31f91060ccbc4f91eda9d33f02 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 31 Jan 2011 23:42:43 +0000 Subject: [PATCH 19/89] FacebookPlugin: Fix up FBML canvas app so it keeps working after Facebook removed Profile Boxes and some API calls it relied upon. See: http://developers.facebook.com/roadmap/deprecations --- plugins/Facebook/facebookaction.php | 36 +++++++++-------------------- plugins/Facebook/facebookhome.php | 34 ++++----------------------- plugins/Facebook/facebookutil.php | 33 +------------------------- 3 files changed, 16 insertions(+), 87 deletions(-) diff --git a/plugins/Facebook/facebookaction.php b/plugins/Facebook/facebookaction.php index e4edcea0d9..003bf8cd7e 100644 --- a/plugins/Facebook/facebookaction.php +++ b/plugins/Facebook/facebookaction.php @@ -81,9 +81,20 @@ class FacebookAction extends Action function showStylesheets() { + // Loading CSS via files in Facebook FBML Canvas apps is still busted as of 1/31/11 + // See: http://bugs.developers.facebook.net/show_bug.cgi?id=10052 $this->cssLink('css/display.css', 'base'); $this->cssLink('css/display.css', null, 'screen, projection, tv'); $this->cssLink('plugins/Facebook/facebookapp.css'); + + // Also, Facebook refuses to let me do this... gar! +/* + $baseCss = file_get_contents(INSTALLDIR . '/theme/base/css/display.css'); + $this->style($baseCss); + + $facebookCss = file_get_contents(INSTALLDIR . '/plugins/Facebook/facebookapp.css'); + $this->style($facebookCss); +*/ } function showScripts() @@ -292,31 +303,6 @@ class FacebookAction extends Action $this->elementEnd('div'); } - function updateProfileBox($notice) - { - - // Need to include inline CSS for styling the Profile box - - $app_props = $this->facebook->api_client->Admin_getAppProperties(array('icon_url')); - $icon_url = $app_props['icon_url']; - - $style = ''; - - $this->xw->openMemory(); - - $item = new FacebookProfileBoxNotice($notice, $this); - $item->show(); - - $fbml = "$style " . $this->xw->outputMemory(false) . ""; - $fbml .= "$style " . $this->xw->outputMemory(false) . ""; - - $fbml_main = "$style " . $this->xw->outputMemory(false) . ""; - - $this->facebook->api_client->profile_setFBML(null, $this->fbuid, $fbml, null, null, $fbml_main); - - $this->xw->openURI('php://output'); - } - /** * Generate pagination links * diff --git a/plugins/Facebook/facebookhome.php b/plugins/Facebook/facebookhome.php index 8b8b974458..9b18a695bf 100644 --- a/plugins/Facebook/facebookhome.php +++ b/plugins/Facebook/facebookhome.php @@ -44,33 +44,15 @@ class FacebookhomeAction extends FacebookAction { parent::handle($args); - // If the user has opted not to initially allow the app to have - // Facebook status update permission, store that preference. Only - // promt the user the first time she uses the app - if ($this->arg('skip') || $args['fb_sig_request_method'] == 'GET') { - $this->facebook->api_client->data_setUserPreference( - FACEBOOK_PROMPTED_UPDATE_PREF, 'true'); - } - - if ($this->flink) { + if (!empty($this->flink)) { $this->user = $this->flink->getUser(); // If this is the first time the user has started the app // prompt for Facebook status update permission if (!$this->facebook->api_client->users_hasAppPermission('publish_stream')) { - - if ($this->facebook->api_client->data_getUserPreference( - FACEBOOK_PROMPTED_UPDATE_PREF) != 'true') { - $this->getUpdatePermission(); - return; - } - } - - // Make sure the user's profile box has the lastest notice - $notice = $this->user->getCurrentNotice(); - if ($notice) { - $this->updateProfileBox($notice); - } + $this->getUpdatePermission(); + return; + } if ($this->arg('status_submit') == 'Send') { $this->saveNewNotice(); @@ -114,8 +96,6 @@ class FacebookhomeAction extends FacebookAction // XXX: Do some error handling here - $this->setDefaults(); - $this->getUpdatePermission(); return; } else { @@ -127,12 +107,6 @@ class FacebookhomeAction extends FacebookAction $this->showFooter(); } - function setDefaults() - { - $this->facebook->api_client->data_setUserPreference( - FACEBOOK_PROMPTED_UPDATE_PREF, 'false'); - } - function showNoticeForm() { $post_action = "$this->app_uri/index.php"; diff --git a/plugins/Facebook/facebookutil.php b/plugins/Facebook/facebookutil.php index fb70c51bc5..3996459a63 100644 --- a/plugins/Facebook/facebookutil.php +++ b/plugins/Facebook/facebookutil.php @@ -50,6 +50,7 @@ function getFacebook() function isFacebookBound($notice, $flink) { if (empty($flink)) { + common_debug("QQQQQ empty flink"); return false; } @@ -157,11 +158,6 @@ function facebookBroadcastNotice($notice) common_log(LOG_WARNING, $msg); } - // Finally, attempt to update the user's profile box - if ($canPublish == 1 || $canUpdate == 1) { - updateProfileBox($facebook, $flink, $notice, $user); - } - } catch (FacebookRestClientException $e) { return handleFacebookError($e, $notice, $flink); } @@ -293,33 +289,6 @@ function publishStream($notice, $user, $fbuid) ); } -function updateProfileBox($facebook, $flink, $notice, $user) { - - $facebook = getFacebook(); - $fbaction = new FacebookAction( - $output = 'php://output', - $indent = null, - $facebook, - $flink - ); - - $fbuid = $flink->foreign_id; - - common_debug( - 'FacebookPlugin - Attempting to update profile box with ' - . "content from notice $notice->id for $user->nickname ($user->id), " - . "Facebook UID: $fbuid" - ); - - $fbaction->updateProfileBox($notice); - - common_debug( - 'FacebookPlugin - finished updating profile box for ' - . "$user->nickname ($user->id) Facebook UID: $fbuid" - ); - -} - function format_attachments($attachments) { $fbattachment = array(); From c35d8e3a3e98cdbdba4e1f052806ced6acfb9602 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 31 Jan 2011 23:50:22 +0000 Subject: [PATCH 20/89] Remove old Facebook Plugin (use FacebookBridge now) --- plugins/Facebook/FBC_XDReceiver.php | 66 - plugins/Facebook/FBConnect.css | 36 - plugins/Facebook/FBConnectAuth.php | 486 --- plugins/Facebook/FBConnectLogin.php | 74 - plugins/Facebook/FBConnectSettings.php | 203 - plugins/Facebook/FacebookPlugin.php | 599 --- plugins/Facebook/README | 163 - plugins/Facebook/facebook/facebook.php | 609 --- .../Facebook/facebook/facebook_desktop.php | 104 - plugins/Facebook/facebook/facebook_mobile.php | 260 -- .../facebook/facebookapi_php5_restlib.php | 3702 ----------------- .../facebook/jsonwrapper/JSON/JSON.php | 806 ---- .../facebook/jsonwrapper/JSON/LICENSE | 21 - .../facebook/jsonwrapper/jsonwrapper.php | 6 - .../jsonwrapper/jsonwrapper_inner.php | 23 - plugins/Facebook/facebookaction.php | 531 --- plugins/Facebook/facebookadminpanel.php | 212 - plugins/Facebook/facebookapp.css | 115 - plugins/Facebook/facebookapp.js | 33 - plugins/Facebook/facebookhome.php | 246 -- plugins/Facebook/facebookinvite.php | 145 - plugins/Facebook/facebooklogin.php | 97 - plugins/Facebook/facebooknoticeform.php | 198 - plugins/Facebook/facebookqueuehandler.php | 51 - plugins/Facebook/facebookremove.php | 73 - plugins/Facebook/facebooksettings.php | 136 - plugins/Facebook/facebookutil.php | 409 -- plugins/Facebook/fbfavicon.ico | Bin 1150 -> 0 bytes plugins/Facebook/locale/Facebook.pot | 535 --- .../locale/be-tarask/LC_MESSAGES/Facebook.po | 562 --- .../locale/br/LC_MESSAGES/Facebook.po | 544 --- .../locale/ca/LC_MESSAGES/Facebook.po | 575 --- .../locale/de/LC_MESSAGES/Facebook.po | 578 --- .../locale/es/LC_MESSAGES/Facebook.po | 563 --- .../locale/fr/LC_MESSAGES/Facebook.po | 581 --- .../locale/gl/LC_MESSAGES/Facebook.po | 545 --- .../locale/ia/LC_MESSAGES/Facebook.po | 572 --- .../locale/mk/LC_MESSAGES/Facebook.po | 568 --- .../locale/nb/LC_MESSAGES/Facebook.po | 540 --- .../locale/nl/LC_MESSAGES/Facebook.po | 578 --- .../locale/pt_BR/LC_MESSAGES/Facebook.po | 544 --- .../locale/tl/LC_MESSAGES/Facebook.po | 583 --- .../locale/uk/LC_MESSAGES/Facebook.po | 573 --- .../locale/vi/LC_MESSAGES/Facebook.po | 540 --- .../locale/zh_CN/LC_MESSAGES/Facebook.po | 556 --- 45 files changed, 18941 deletions(-) delete mode 100644 plugins/Facebook/FBC_XDReceiver.php delete mode 100644 plugins/Facebook/FBConnect.css delete mode 100644 plugins/Facebook/FBConnectAuth.php delete mode 100644 plugins/Facebook/FBConnectLogin.php delete mode 100644 plugins/Facebook/FBConnectSettings.php delete mode 100644 plugins/Facebook/FacebookPlugin.php delete mode 100644 plugins/Facebook/README delete mode 100644 plugins/Facebook/facebook/facebook.php delete mode 100644 plugins/Facebook/facebook/facebook_desktop.php delete mode 100644 plugins/Facebook/facebook/facebook_mobile.php delete mode 100755 plugins/Facebook/facebook/facebookapi_php5_restlib.php delete mode 100644 plugins/Facebook/facebook/jsonwrapper/JSON/JSON.php delete mode 100644 plugins/Facebook/facebook/jsonwrapper/JSON/LICENSE delete mode 100644 plugins/Facebook/facebook/jsonwrapper/jsonwrapper.php delete mode 100644 plugins/Facebook/facebook/jsonwrapper/jsonwrapper_inner.php delete mode 100644 plugins/Facebook/facebookaction.php delete mode 100644 plugins/Facebook/facebookadminpanel.php delete mode 100644 plugins/Facebook/facebookapp.css delete mode 100644 plugins/Facebook/facebookapp.js delete mode 100644 plugins/Facebook/facebookhome.php delete mode 100644 plugins/Facebook/facebookinvite.php delete mode 100644 plugins/Facebook/facebooklogin.php delete mode 100644 plugins/Facebook/facebooknoticeform.php delete mode 100644 plugins/Facebook/facebookqueuehandler.php delete mode 100644 plugins/Facebook/facebookremove.php delete mode 100644 plugins/Facebook/facebooksettings.php delete mode 100644 plugins/Facebook/facebookutil.php delete mode 100644 plugins/Facebook/fbfavicon.ico delete mode 100644 plugins/Facebook/locale/Facebook.pot delete mode 100644 plugins/Facebook/locale/be-tarask/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/br/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/ca/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/de/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/es/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/fr/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/gl/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/ia/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/mk/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/nb/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/nl/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/pt_BR/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/tl/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/uk/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/vi/LC_MESSAGES/Facebook.po delete mode 100644 plugins/Facebook/locale/zh_CN/LC_MESSAGES/Facebook.po diff --git a/plugins/Facebook/FBC_XDReceiver.php b/plugins/Facebook/FBC_XDReceiver.php deleted file mode 100644 index bf4b59bba1..0000000000 --- a/plugins/Facebook/FBC_XDReceiver.php +++ /dev/null @@ -1,66 +0,0 @@ -showPage(); - } - - function showPage() - { - // cache the xd_receiver - header('Cache-Control: max-age=225065900'); - header('Expires:'); - header('Pragma:'); - - $this->startXML('html'); - - $language = $this->getLanguage(); - - $this->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml', - 'xml:lang' => $language, - 'lang' => $language)); - $this->elementStart('head'); - $this->element('title', null, 'cross domain receiver page'); - $this->script('http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.debug.js'); - $this->elementEnd('head'); - $this->elementStart('body'); - $this->elementEnd('body'); - - $this->elementEnd('html'); - } -} diff --git a/plugins/Facebook/FBConnect.css b/plugins/Facebook/FBConnect.css deleted file mode 100644 index 49217bf13f..0000000000 --- a/plugins/Facebook/FBConnect.css +++ /dev/null @@ -1,36 +0,0 @@ -/** Styles for Facebook logo and Facebook user profile avatar. - * - * @package StatusNet - * @author Sarven Capadisli - * @copyright 2009 StatusNet, Inc. - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://status.net/ - */ - -#site_nav_global_primary #nav_fb { -position:relative; -margin-left:18px; -} - -#nav_fb #fbc_profile-pic { -position:absolute; -top:-3px; -left:-18px; -display:inline; -border:1px solid #3B5998; -padding:1px; -} - -#nav_fb #fb_favicon { -position:absolute; -top:-13px; -left:-25px; -display:inline; -} - -#settings_facebook_connect_options legend { -display:none; -} -#form_settings_facebook_connect fieldset fieldset legend { -display:block; -} diff --git a/plugins/Facebook/FBConnectAuth.php b/plugins/Facebook/FBConnectAuth.php deleted file mode 100644 index 937db56e56..0000000000 --- a/plugins/Facebook/FBConnectAuth.php +++ /dev/null @@ -1,486 +0,0 @@ -. - * - * @category Plugin - * @package StatusNet - * @author Zach Copley - * @copyright 2009 StatusNet, Inc. - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://status.net/ - */ - -if (!defined('STATUSNET')) { - exit(1); -} - -require_once INSTALLDIR . '/plugins/Facebook/FacebookPlugin.php'; - -class FBConnectauthAction extends Action -{ - var $fbuid = null; - var $fb_fields = null; - - function prepare($args) { - parent::prepare($args); - - $this->fbuid = getFacebook()->get_loggedin_user(); - - if ($this->fbuid > 0) { - $this->fb_fields = $this->getFacebookFields($this->fbuid, - array('first_name', 'last_name', 'name')); - } else { - list($proxy, $ip) = common_client_ip(); - - common_log(LOG_WARNING, 'Facebook Connect Plugin - ' . - "Failed auth attempt, proxy = $proxy, ip = $ip."); - - $this->clientError(_m('You must be logged into Facebook to ' . - 'use Facebook Connect.')); - } - - return true; - } - - function handle($args) - { - parent::handle($args); - - if (common_is_real_login()) { - // User is already logged in. Does she already have a linked Facebook acct? - $flink = Foreign_link::getByForeignID($this->fbuid, FACEBOOK_CONNECT_SERVICE); - - if (!empty($flink)) { - // User already has a linked Facebook account and shouldn't be here - common_debug('Facebook Connect Plugin - ' . - 'There is already a local user (' . $flink->user_id . - ') linked with this Facebook (' . $this->fbuid . ').'); - - // We don't want these cookies - getFacebook()->clear_cookie_state(); - - $this->clientError(_m('There is already a local user linked with this Facebook account.')); - } else { - - // User came from the Facebook connect settings tab, and - // probably just wants to link/relink their Facebook account - $this->connectUser(); - } - - } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { - - $token = $this->trimmed('token'); - if (!$token || $token != common_session_token()) { - $this->showForm(_m('There was a problem with your session token. Try again, please.')); - return; - } - if ($this->arg('create')) { - if (!$this->boolean('license')) { - $this->showForm(_m('You can\'t register if you don\'t agree to the license.'), - $this->trimmed('newname')); - return; - } - $this->createNewUser(); - } else if ($this->arg('connect')) { - $this->connectNewUser(); - } else { - common_debug('Facebook Connect Plugin - ' . - print_r($this->args, true)); - $this->showForm(_m('An unknown error has occured.'), - $this->trimmed('newname')); - } - } else { - $this->tryLogin(); - } - } - - function showPageNotice() - { - if ($this->error) { - $this->element('div', array('class' => 'error'), $this->error); - } else { - $this->element('div', 'instructions', - // TRANS: %s is the site name. - sprintf(_m('This is the first time you\'ve logged into %s so we must connect your Facebook to a local account. You can either create a new account, or connect with your existing account, if you have one.'), common_config('site', 'name'))); - } - } - - function title() - { - // TRANS: Page title. - return _m('Facebook Account Setup'); - } - - function showForm($error=null, $username=null) - { - $this->error = $error; - $this->username = $username; - - $this->showPage(); - } - - function showPage() - { - parent::showPage(); - } - - /** - * @fixme much of this duplicates core code, which is very fragile. - * Should probably be replaced with an extensible mini version of - * the core registration form. - */ - function showContent() - { - if (!empty($this->message_text)) { - $this->element('p', null, $this->message); - return; - } - - $this->elementStart('form', array('method' => 'post', - 'id' => 'form_settings_facebook_connect', - 'class' => 'form_settings', - 'action' => common_local_url('FBConnectAuth'))); - $this->elementStart('fieldset', array('id' => 'settings_facebook_connect_options')); - // TRANS: Legend. - $this->element('legend', null, _m('Connection options')); - $this->elementStart('ul', 'form_data'); - $this->elementStart('li'); - $this->element('input', array('type' => 'checkbox', - 'id' => 'license', - 'class' => 'checkbox', - 'name' => 'license', - 'value' => 'true')); - $this->elementStart('label', array('class' => 'checkbox', 'for' => 'license')); - // TRANS: %s is the name of the license used by the user for their status updates. - $message = _m('My text and files are available under %s ' . - 'except this private data: password, ' . - 'email address, IM address, and phone number.'); - $link = '' . - htmlspecialchars(common_config('license', 'title')) . - ''; - $this->raw(sprintf(htmlspecialchars($message), $link)); - $this->elementEnd('label'); - $this->elementEnd('li'); - $this->elementEnd('ul'); - - $this->elementStart('fieldset'); - $this->hidden('token', common_session_token()); - $this->element('legend', null, - // TRANS: Legend. - _m('Create new account')); - $this->element('p', null, - _m('Create a new user with this nickname.')); - $this->elementStart('ul', 'form_data'); - $this->elementStart('li'); - // TRANS: Field label. - $this->input('newname', _m('New nickname'), - ($this->username) ? $this->username : '', - _m('1-64 lowercase letters or numbers, no punctuation or spaces')); - $this->elementEnd('li'); - $this->elementEnd('ul'); - // TRANS: Submit button. - $this->submit('create', _m('BUTTON','Create')); - $this->elementEnd('fieldset'); - - $this->elementStart('fieldset'); - // TRANS: Legend. - $this->element('legend', null, - _m('Connect existing account')); - $this->element('p', null, - _m('If you already have an account, login with your username and password to connect it to your Facebook.')); - $this->elementStart('ul', 'form_data'); - $this->elementStart('li'); - // TRANS: Field label. - $this->input('nickname', _m('Existing nickname')); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->password('password', _m('Password')); - $this->elementEnd('li'); - $this->elementEnd('ul'); - // TRANS: Submit button. - $this->submit('connect', _m('BUTTON','Connect')); - $this->elementEnd('fieldset'); - - $this->elementEnd('fieldset'); - $this->elementEnd('form'); - } - - function message($msg) - { - $this->message_text = $msg; - $this->showPage(); - } - - function createNewUser() - { - if (!Event::handle('StartRegistrationTry', array($this))) { - return; - } - - if (common_config('site', 'closed')) { - // TRANS: Client error trying to register with registrations not allowed. - $this->clientError(_m('Registration not allowed.')); - return; - } - - $invite = null; - - if (common_config('site', 'inviteonly')) { - $code = $_SESSION['invitecode']; - if (empty($code)) { - // TRANS: Client error trying to register with registrations 'invite only'. - $this->clientError(_m('Registration not allowed.')); - return; - } - - $invite = Invitation::staticGet($code); - - if (empty($invite)) { - // TRANS: Client error trying to register with an invalid invitation code. - $this->clientError(_m('Not a valid invitation code.')); - return; - } - } - - try { - $nickname = Nickname::normalize($this->trimmed('newname')); - } catch (NicknameException $e) { - $this->showForm($e->getMessage()); - } - - if (!User::allowed_nickname($nickname)) { - $this->showForm(_m('Nickname not allowed.')); - return; - } - - if (User::staticGet('nickname', $nickname)) { - $this->showForm(_m('Nickname already in use. Try another one.')); - return; - } - - $fullname = trim($this->fb_fields['firstname'] . - ' ' . $this->fb_fields['lastname']); - - $args = array('nickname' => $nickname, 'fullname' => $fullname); - - if (!empty($invite)) { - $args['code'] = $invite->code; - } - - $user = User::register($args); - - $result = $this->flinkUser($user->id, $this->fbuid); - - if (!$result) { - $this->serverError(_m('Error connecting user to Facebook.')); - return; - } - - common_set_user($user); - common_real_login(true); - - common_debug('Facebook Connect Plugin - ' . - "Registered new user $user->id from Facebook user $this->fbuid"); - - Event::handle('EndRegistrationTry', array($this)); - - common_redirect(common_local_url('showstream', array('nickname' => $user->nickname)), - 303); - } - - function connectNewUser() - { - $nickname = $this->trimmed('nickname'); - $password = $this->trimmed('password'); - - if (!common_check_user($nickname, $password)) { - $this->showForm(_m('Invalid username or password.')); - return; - } - - $user = User::staticGet('nickname', $nickname); - - if (!empty($user)) { - common_debug('Facebook Connect Plugin - ' . - "Legit user to connect to Facebook: $nickname"); - } - - $result = $this->flinkUser($user->id, $this->fbuid); - - if (!$result) { - $this->serverError(_m('Error connecting user to Facebook.')); - return; - } - - common_debug('Facebook Connnect Plugin - ' . - "Connected Facebook user $this->fbuid to local user $user->id"); - - common_set_user($user); - common_real_login(true); - - $this->goHome($user->nickname); - } - - function connectUser() - { - $user = common_current_user(); - - $result = $this->flinkUser($user->id, $this->fbuid); - - if (empty($result)) { - $this->serverError(_m('Error connecting user to Facebook.')); - return; - } - - common_debug('Facebook Connect Plugin - ' . - "Connected Facebook user $this->fbuid to local user $user->id"); - - // Return to Facebook connection settings tab - common_redirect(common_local_url('FBConnectSettings'), 303); - } - - function tryLogin() - { - common_debug('Facebook Connect Plugin - ' . - "Trying login for Facebook user $this->fbuid."); - - $flink = Foreign_link::getByForeignID($this->fbuid, FACEBOOK_CONNECT_SERVICE); - - if (!empty($flink)) { - $user = $flink->getUser(); - - if (!empty($user)) { - - common_debug('Facebook Connect Plugin - ' . - "Logged in Facebook user $flink->foreign_id as user $user->id ($user->nickname)"); - - common_set_user($user); - common_real_login(true); - $this->goHome($user->nickname); - } - - } else { - - common_debug('Facebook Connect Plugin - ' . - "No flink found for fbuid: $this->fbuid - new user"); - - $this->showForm(null, $this->bestNewNickname()); - } - } - - function goHome($nickname) - { - $url = common_get_returnto(); - if ($url) { - // We don't have to return to it again - common_set_returnto(null); - } else { - $url = common_local_url('all', - array('nickname' => - $nickname)); - } - - common_redirect($url, 303); - } - - function flinkUser($user_id, $fbuid) - { - $flink = new Foreign_link(); - $flink->user_id = $user_id; - $flink->foreign_id = $fbuid; - $flink->service = FACEBOOK_CONNECT_SERVICE; - $flink->created = common_sql_now(); - - $flink_id = $flink->insert(); - - return $flink_id; - } - - function bestNewNickname() - { - if (!empty($this->fb_fields['name'])) { - $nickname = $this->nicknamize($this->fb_fields['name']); - if ($this->isNewNickname($nickname)) { - return $nickname; - } - } - - // Try the full name - - $fullname = trim($this->fb_fields['firstname'] . - ' ' . $this->fb_fields['lastname']); - - if (!empty($fullname)) { - $fullname = $this->nicknamize($fullname); - if ($this->isNewNickname($fullname)) { - return $fullname; - } - } - - return null; - } - - /** - * Given a string, try to make it work as a nickname - */ - function nicknamize($str) - { - $str = preg_replace('/\W/', '', $str); - return strtolower($str); - } - - function isNewNickname($str) - { - if (!Nickname::isValid($str)) { - return false; - } - if (!User::allowed_nickname($str)) { - return false; - } - if (User::staticGet('nickname', $str)) { - return false; - } - return true; - } - - // XXX: Consider moving this to lib/facebookutil.php - function getFacebookFields($fb_uid, $fields) { - try { - - $facebook = getFacebook(); - - $infos = $facebook->api_client->users_getInfo($fb_uid, $fields); - - if (empty($infos)) { - return null; - } - return reset($infos); - - } catch (Exception $e) { - common_log(LOG_WARNING, 'Facebook Connect Plugin - ' . - "Facebook client failure when requesting " . - join(",", $fields) . " on uid " . $fb_uid . - " : ". $e->getMessage()); - return null; - } - } -} diff --git a/plugins/Facebook/FBConnectLogin.php b/plugins/Facebook/FBConnectLogin.php deleted file mode 100644 index 8345532dbd..0000000000 --- a/plugins/Facebook/FBConnectLogin.php +++ /dev/null @@ -1,74 +0,0 @@ -. - */ - -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR . '/plugins/Facebook/FacebookPlugin.php'; - -class FBConnectLoginAction extends Action -{ - function handle($args) - { - parent::handle($args); - - if (common_is_real_login()) { - $this->clientError(_m('Already logged in.')); - } - - $this->showPage(); - } - - function getInstructions() - { - // TRANS: Instructions. - return _m('Login with your Facebook Account'); - } - - function showPageNotice() - { - $instr = $this->getInstructions(); - $output = common_markup_to_html($instr); - $this->elementStart('div', 'instructions'); - $this->raw($output); - $this->elementEnd('div'); - } - - function title() - { - // TRANS: Page title. - return _m('Facebook Login'); - } - - function showContent() { - - $this->elementStart('fieldset'); - $this->element('fb:login-button', array('onlogin' => 'goto_login()', - 'length' => 'long')); - - $this->elementEnd('fieldset'); - } - - function showLocalNav() - { - $nav = new LoginGroupNav($this); - $nav->show(); - } -} diff --git a/plugins/Facebook/FBConnectSettings.php b/plugins/Facebook/FBConnectSettings.php deleted file mode 100644 index 701994d0d0..0000000000 --- a/plugins/Facebook/FBConnectSettings.php +++ /dev/null @@ -1,203 +0,0 @@ -. - * - * @category Settings - * @package StatusNet - * @author Zach Copley - * @copyright 2009 StatusNet, Inc. - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://status.net/ - */ - -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR.'/lib/connectsettingsaction.php'; - -/** - * Facebook Connect settings action - * - * @category Settings - * @package StatusNet - * @author Zach Copley - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://status.net/ - */ -class FBConnectSettingsAction extends ConnectSettingsAction -{ - /** - * Title of the page - * - * @return string Title of the page - */ - function title() - { - // TRANS: Page title. - return _m('Facebook Connect Settings'); - } - - /** - * Instructions for use - * - * @return instructions for use - */ - function getInstructions() - { - // TRANS: Instructions. - return _m('Manage how your account connects to Facebook'); - } - - /** - * Content area of the page - * - * Shows a form for uploading an avatar. - * - * @return void - */ - function showContent() - { - $user = common_current_user(); - $flink = Foreign_link::getByUserID($user->id, FACEBOOK_CONNECT_SERVICE); - - $this->elementStart('form', array('method' => 'post', - 'id' => 'form_settings_facebook', - 'class' => 'form_settings', - 'action' => - common_local_url('FBConnectSettings'))); - - if (!$flink) { - - $this->element('p', 'instructions', - _m('There is no Facebook user connected to this account.')); - - $this->element('fb:login-button', array('onlogin' => 'goto_login()', - 'length' => 'long')); - - } else { - - $this->element('p', 'form_note', - _m('Connected Facebook user')); - - $this->elementStart('p', array('class' => 'facebook-user-display')); - $this->elementStart('fb:profile-pic', - array('uid' => $flink->foreign_id, - 'size' => 'small', - 'linked' => 'true', - 'facebook-logo' => 'true')); - $this->elementEnd('fb:profile-pic'); - - $this->elementStart('fb:name', array('uid' => $flink->foreign_id, - 'useyou' => 'false')); - $this->elementEnd('fb:name'); - $this->elementEnd('p'); - - $this->hidden('token', common_session_token()); - - $this->elementStart('fieldset'); - - // TRANS: Legend. - $this->element('legend', null, _m('Disconnect my account from Facebook')); - - if (!$user->password) { - - $this->elementStart('p', array('class' => 'form_guide')); - // @todo FIXME: Bad i18n. Patchwork message in three parts. - // TRANS: Followed by a link containing text "set a password". - $this->text(_m('Disconnecting your Faceboook ' . - 'would make it impossible to log in! Please ')); - $this->element('a', - array('href' => common_local_url('passwordsettings')), - // TRANS: Preceded by "Please " and followed by " first." - _m('set a password')); - // TRANS: Preceded by "Please set a password". - $this->text(_m(' first.')); - $this->elementEnd('p'); - } else { - - $note = 'Keep your %s account but disconnect from Facebook. ' . - 'You\'ll use your %s password to log in.'; - - $site = common_config('site', 'name'); - - $this->element('p', 'instructions', - sprintf($note, $site, $site)); - - // TRANS: Submit button. - $this->submit('disconnect', _m('BUTTON','Disconnect')); - } - - $this->elementEnd('fieldset'); - } - - $this->elementEnd('form'); - } - - /** - * Handle post - * - * Disconnects the current Facebook user from the current user's account - * - * @return void - */ - function handlePost() - { - // CSRF protection - $token = $this->trimmed('token'); - if (!$token || $token != common_session_token()) { - $this->showForm(_m('There was a problem with your session token. '. - 'Try again, please.')); - return; - } - - if ($this->arg('disconnect')) { - - $user = common_current_user(); - - $flink = Foreign_link::getByUserID($user->id, FACEBOOK_CONNECT_SERVICE); - $result = $flink->delete(); - - if ($result === false) { - common_log_db_error($user, 'DELETE', __FILE__); - $this->serverError(_m('Couldn\'t delete link to Facebook.')); - return; - } - - try { - - // Clear FB Connect cookies out - $facebook = getFacebook(); - $facebook->clear_cookie_state(); - - } catch (Exception $e) { - common_log(LOG_WARNING, 'Facebook Connect Plugin - ' . - 'Couldn\'t clear Facebook cookies: ' . - $e->getMessage()); - } - - $this->showForm(_m('You have disconnected from Facebook.'), true); - - } else { - $this->showForm(_m('Not sure what you\'re trying to do.')); - return; - } - } -} diff --git a/plugins/Facebook/FacebookPlugin.php b/plugins/Facebook/FacebookPlugin.php deleted file mode 100644 index e877d300b6..0000000000 --- a/plugins/Facebook/FacebookPlugin.php +++ /dev/null @@ -1,599 +0,0 @@ -. - * - * @category Plugin - * @package StatusNet - * @author Zach Copley - * @copyright 2009-2010 StatusNet, Inc. - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://status.net/ - */ - -if (!defined('STATUSNET')) { - exit(1); -} - -define("FACEBOOK_CONNECT_SERVICE", 3); - -require_once INSTALLDIR . '/plugins/Facebook/facebookutil.php'; - -/** - * Facebook plugin to add a StatusNet Facebook canvas application - * and allow registration and authentication via Facebook Connect - * - * @category Plugin - * @package StatusNet - * @author Zach Copley - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://status.net/ - */ -class FacebookPlugin extends Plugin -{ - const VERSION = STATUSNET_VERSION; - - /** - * Initializer for the plugin. - */ - - function initialize() - { - // Allow the key and secret to be passed in - // Control panel will override - if (isset($this->apikey)) { - $key = common_config('facebook', 'apikey'); - if (empty($key)) { - Config::save('facebook', 'apikey', $this->apikey); - } - } - - if (isset($this->secret)) { - $secret = common_config('facebook', 'secret'); - if (empty($secret)) { - Config::save( - 'facebook', - 'secret', - $this->secret - ); - } - } - } - - /** - * Check to see if there is an API key and secret defined - * for Facebook integration. - * - * @return boolean result - */ - static function hasKeys() - { - $apiKey = common_config('facebook', 'apikey'); - $apiSecret = common_config('facebook', 'secret'); - - if (!empty($apiKey) && !empty($apiSecret)) { - return true; - } - - return false; - } - - /** - * Add Facebook app actions to the router table - * - * Hook for RouterInitialized event. - * - * @param Net_URL_Mapper &$m path-to-action mapper - * - * @return boolean hook return - */ - function onStartInitializeRouter($m) - { - $m->connect('admin/facebook', array('action' => 'facebookadminpanel')); - - if (self::hasKeys()) { - // Facebook App stuff - - $m->connect('facebook/app', array('action' => 'facebookhome')); - $m->connect('facebook/app/index.php', array('action' => 'facebookhome')); - $m->connect('facebook/app/settings.php', - array('action' => 'facebooksettings')); - $m->connect('facebook/app/invite.php', array('action' => 'facebookinvite')); - $m->connect('facebook/app/remove', array('action' => 'facebookremove')); - - // Facebook Connect stuff - - $m->connect('main/facebookconnect', array('action' => 'FBConnectAuth')); - $m->connect('main/facebooklogin', array('action' => 'FBConnectLogin')); - $m->connect('settings/facebook', array('action' => 'FBConnectSettings')); - $m->connect('xd_receiver.html', array('action' => 'FBC_XDReceiver')); - } - - return true; - } - - /** - * Automatically load the actions and libraries used by the Facebook app - * - * @param Class $cls the class - * - * @return boolean hook return - * - */ - function onAutoload($cls) - { - switch ($cls) { - case 'FacebookAction': - case 'FacebookhomeAction': - case 'FacebookinviteAction': - case 'FacebookremoveAction': - case 'FacebooksettingsAction': - case 'FacebookadminpanelAction': - include_once INSTALLDIR . '/plugins/Facebook/' . - strtolower(mb_substr($cls, 0, -6)) . '.php'; - return false; - case 'FBConnectAuthAction': - case 'FBConnectLoginAction': - case 'FBConnectSettingsAction': - case 'FBC_XDReceiverAction': - include_once INSTALLDIR . '/plugins/Facebook/' . - mb_substr($cls, 0, -6) . '.php'; - return false; - case 'FBCLoginGroupNav': - include_once INSTALLDIR . '/plugins/Facebook/FBCLoginGroupNav.php'; - return false; - case 'FBCSettingsNav': - include_once INSTALLDIR . '/plugins/Facebook/FBCSettingsNav.php'; - return false; - case 'FacebookQueueHandler': - include_once INSTALLDIR . '/plugins/Facebook/facebookqueuehandler.php'; - return false; - default: - return true; - } - } - - /** - * Add a Facebook tab to the admin panels - * - * @param Widget $nav Admin panel nav - * - * @return boolean hook value - */ - function onEndAdminPanelNav($nav) - { - if (AdminPanelAction::canAdmin('facebook')) { - - $action_name = $nav->action->trimmed('action'); - - $nav->out->menuItem( - common_local_url('facebookadminpanel'), - // TRANS: Menu item. - _m('MENU','Facebook'), - // TRANS: Tooltip for menu item "Facebook". - _m('Facebook integration configuration'), - $action_name == 'facebookadminpanel', - 'nav_facebook_admin_panel' - ); - } - - return true; - } - - /** - * Override normal HTML output to force the content type to - * text/html and add in xmlns:fb - * - * @param Action $action the current action - * - * @return void - */ - function onStartShowHTML($action) - { - if ($this->reqFbScripts($action)) { - // XXX: Horrible hack to make Safari, FF2, and Chrome work with - // Facebook Connect. These browser cannot use Facebook's - // DOM parsing routines unless the mime type of the page is - // text/html even though Facebook Connect uses XHTML. This is - // A bug in Facebook Connect, and this is a temporary solution - // until they fix their JavaScript libs. - - header('Content-Type: text/html'); - - $action->extraHeaders(); - - $action->startXML('html'); - - $language = $action->getLanguage(); - - $action->elementStart('html', - array('xmlns' => 'http://www.w3.org/1999/xhtml', - 'xmlns:fb' => 'http://www.facebook.com/2008/fbml', - 'xml:lang' => $language, - 'lang' => $language)); - - return false; - } else { - return true; - } - } - - /** - * Add in the Facebook Connect JavaScript stuff - * - * Note: this script needs to appear in the - * - * @param Action $action the current action - * - * @return void - * - */ - function onEndShowScripts($action) - { - if ($this->reqFbScripts($action)) { - - $apikey = common_config('facebook', 'apikey'); - $plugin_path = 'plugins/Facebook'; - - $login_url = common_local_url('FBConnectAuth'); - $logout_url = common_local_url('logout'); - - // XXX: Facebook says we don't need this FB_RequireFeatures(), - // but we actually do, for IE and Safari. Gar. - - $js .= ' $(document).ready(function () {'; - $js .= ' FB_RequireFeatures('; - $js .= ' ["XFBML"], function() {'; - $js .= ' FB.init("%1$s", "../xd_receiver.html");'; - $js .= ' }'; - $js .= ' );'; - $js .= ' });'; - - $js .= ' function goto_login() {'; - $js .= ' window.location = "%2$s";'; - $js .= ' }'; - - // The below function alters the logout link so that it logs the user out - // of Facebook Connect as well as the site. However, for some pages - // (FB Connect Settings) we need to output the FB Connect scripts (to - // show an existing FB connection even if the user isn't authenticated - // with Facebook connect) but NOT alter the logout link. And the only - // way to reliably do that is with the FB Connect .js libs. Crazy. - - $js .= ' FB.ensureInit(function() {'; - $js .= ' FB.Connect.ifUserConnected('; - $js .= ' function() { '; - $js .= ' $(\'#nav_logout a\').attr(\'href\', \'#\');'; - $js .= ' $(\'#nav_logout a\').click(function() {'; - $js .= ' FB.Connect.logoutAndRedirect(\'%3$s\');'; - $js .= ' return false;'; - $js .= ' })'; - $js .= ' },'; - $js .= ' function() {'; - $js .= ' return false;'; - $js .= ' }'; - $js .= ' );'; - $js .= ' });'; - - $js = sprintf($js, $apikey, $login_url, $logout_url); - - // Compress the bugger down a bit - $js = str_replace(' ', '', $js); - - $action->inlineScript($js); - } - } - - /** - * Add in an additional Facebook Connect script that's supposed to - * appear as close as possible to - * - * @param Action $action the current action - * - * @return void - * - */ - function onEndShowFooter($action) - { - if ($this->reqFbScripts($action)) { - $action->script('http://static.ak.connect.facebook.com' . - '/js/api_lib/v0.4/FeatureLoader.js.php'); - } - } - - /** - * Output Facebook Connect specific CSS link - * - * @param Action $action the current action - * - * @return void - * - */ - function onEndShowStatusNetStyles($action) - { - if ($this->reqFbScripts($action)) { - $action->cssLink('plugins/Facebook/FBConnect.css'); - } - } - - /** - * Does the Action we're plugged into require the FB Scripts? We only - * want to output FB namespace, scripts, CSS, etc. on the pages that - * really need them. - * - * @param Action $action the current action - * - * @return boolean true - */ - function reqFbScripts($action) - { - if (!self::hasKeys()) { - return false; - } - - // If you're logged in w/FB Connect, you always need the FB stuff - $fbuid = $this->loggedIn(); - - if (!empty($fbuid)) { - return true; - } - - // List of actions that require FB stuff - $needy = array('FBConnectLoginAction', - 'FBConnectauthAction', - 'FBConnectSettingsAction'); - - if (in_array(get_class($action), $needy)) { - return true; - } - - return false; - } - - /** - * Is the user currently logged in with FB Connect? - * - * @return mixed $fbuid the Facebook ID of the logged in user, or null - */ - function loggedIn() - { - $user = common_current_user(); - - if (!empty($user)) { - - $flink = Foreign_link::getByUserId($user->id, - FACEBOOK_CONNECT_SERVICE); - $fbuid = 0; - - if (!empty($flink)) { - try { - $facebook = getFacebook(); - $fbuid = $facebook->get_loggedin_user(); - } catch (Exception $e) { - common_log(LOG_WARNING, 'Facebook Connect Plugin - ' . - 'Problem getting Facebook user: ' . - $e->getMessage()); - } - - if ($fbuid > 0) { - return $fbuid; - } - } - } - - return null; - } - - /** - * Add in a Facebook Connect avatar to the primary nav menu - * - * @param Action $action the current action - * - * @return void - * - */ - function onStartPrimaryNav($action) - { - if (self::hasKeys()) { - $user = common_current_user(); - if (!empty($user)) { - $fbuid = $this->loggedIn(); - - if (!empty($fbuid)) { - /* Default FB silhouette pic for FB users who haven't - uploaded a profile pic yet. */ - - $silhouetteUrl = - 'http://static.ak.fbcdn.net/pics/q_silhouette.gif'; - - $url = $this->getProfilePicURL($fbuid); - - $action->elementStart('li', array('id' => 'nav_fb')); - - $action->element('img', array('id' => 'fbc_profile-pic', - 'src' => (!empty($url)) ? $url : $silhouetteUrl, - 'alt' => _m('Facebook Connect User'), - 'width' => '16'), ''); - - $iconurl = common_path('plugins/Facebook/fbfavicon.ico'); - $action->element('img', array('id' => 'fb_favicon', - 'src' => $iconurl)); - - $action->elementEnd('li'); - } - } - } - - return true; - } - - /* - * Add a login tab for Facebook Connect - * - * @param Action $action the current action - * - * @return void - */ - function onEndLoginGroupNav($action) - { - if (self::hasKeys()) { - $action_name = $action->trimmed('action'); - - $action->menuItem(common_local_url('FBConnectLogin'), - // @todo CHECKME: Should be 'Facebook Login'? - // TRANS: Menu item. - _m('MENU','Facebook'), - // TRANS: Tooltip for menu item "Facebook". - _m('Login or register using Facebook'), - 'FBConnectLogin' === $action_name); - } - - return true; - } - - /* - * Add a tab for managing Facebook Connect settings - * - * @param Action $action the current action - * - * @return void - */ - function onEndConnectSettingsNav($action) - { - if (self::hasKeys()) { - $action_name = $action->trimmed('action'); - - $action->menuItem(common_local_url('FBConnectSettings'), - // @todo CHECKME: Should be 'Facebook Connect'? - // TRANS: Menu item tab. - _m('MENU','Facebook'), - // TRANS: Tooltip for menu item "Facebook". - _m('Facebook Connect Settings'), - $action_name === 'FBConnectSettings'); - } - - return true; - } - - /** - * Have the logout process do some Facebook Connect cookie cleanup - * - * @param Action $action the current action - * - * @return void - */ - function onStartLogout($action) - { - if (self::hasKeys()) { - - $action->logout(); - $fbuid = $this->loggedIn(); - - if (!empty($fbuid)) { - try { - $facebook = getFacebook(); - $facebook->expire_session(); - } catch (Exception $e) { - common_log(LOG_WARNING, 'Facebook Connect Plugin - ' . - 'Could\'t logout of Facebook: ' . - $e->getMessage()); - } - } - } - return true; - } - - /** - * Get the URL of the user's Facebook avatar - * - * @param int $fbuid the Facebook user ID - * - * @return string $url the url for the user's Facebook avatar - */ - function getProfilePicURL($fbuid) - { - $facebook = getFacebook(); - $url = null; - - try { - $fqry = 'SELECT pic_square FROM user WHERE uid = %s'; - - $result = $facebook->api_client->fql_query(sprintf($fqry, $fbuid)); - - if (!empty($result)) { - $url = $result[0]['pic_square']; - } - - } catch (Exception $e) { - common_log(LOG_WARNING, 'Facebook Connect Plugin - ' . - "Facebook client failure requesting profile pic!"); - } - - return $url; - } - - /** - * Add a Facebook queue item for each notice - * - * @param Notice $notice the notice - * @param array &$transports the list of transports (queues) - * - * @return boolean hook return - */ - function onStartEnqueueNotice($notice, &$transports) - { - if (self::hasKeys() && $notice->isLocal()) { - array_push($transports, 'facebook'); - } - return true; - } - - /** - * Register Facebook notice queue handler - * - * @param QueueManager $manager - * - * @return boolean hook return - */ - function onEndInitializeQueueManager($manager) - { - if (self::hasKeys()) { - $manager->connect('facebook', 'FacebookQueueHandler'); - } - return true; - } - - function onPluginVersion(&$versions) - { - $versions[] = array( - 'name' => 'Facebook', - 'version' => self::VERSION, - 'author' => 'Zach Copley', - 'homepage' => 'http://status.net/wiki/Plugin:Facebook', - // TRANS: Plugin description. - 'rawdescription' => _m( - 'The Facebook plugin allows integrating ' . - 'StatusNet instances with ' . - 'Facebook ' . - 'and Facebook Connect.' - ) - ); - return true; - } -} diff --git a/plugins/Facebook/README b/plugins/Facebook/README deleted file mode 100644 index 454dd44e79..0000000000 --- a/plugins/Facebook/README +++ /dev/null @@ -1,163 +0,0 @@ -*** WARNING *** -This plugin is deprecated as of StatusNet 0.9.7, and will soon be removed -completely from the StatusNet codebase. Please install or upgrade to the -new "Facebook Bridge" (plugins/FacebookBridge) plugin ASAP. -*************** - -Facebook Plugin -=============== - -This plugin allows you to use Facebook Connect with StatusNet, provides -a Facebook canvas application for your users, and allows them to update -their Facebook statuses from StatusNet. - -Facebook Connect ----------------- - -Facebook connect allows users to register and login using nothing but their -Facebook credentials. With Facebook Connect, your users can: - -- Authenticate (register/login/logout -- works similar to OpenID) -- Associate an existing StatusNet account with a Facebook account -- Disconnect a Facebook account from a StatusNet account - -Built-in Facebook Application ------------------------------ - -The plugin also installs a StatusNet Facebook canvas application that -allows your users to automatically update their Facebook status with -their latest notices, invite their friends to use the app (and thus your -site), view their notice timelines and post notices -- all from within -Facebook. The application is built into the StatusNet Facebook plugin -and runs on your host. - -Quick setup instructions* -------------------------- - -Install the Facebook Developer application on Facebook: - - http://www.facebook.com/developers/ - -Use it to create a new application and generate an API key and secret. -You will need the key and secret so cut-n-paste them into your text -editor or write them down. - -In Facebook's application editor, specify the following URLs for your app: - -- Canvas Callback URL : http://example.net/mublog/facebook/app/ -- Post-Remove Callback URL : http://example.net/mublog/facebook/app/remove -- Post-Authorize Redirect URL : http://apps.facebook.com/yourapp/ -- Canvas Page URL : http://apps.facebook.com/yourapp/ -- Connect URL : http://example.net/mublog/ - - *** ATTENTION *** - These URLs have changed slightly since StatusNet version 0.8.1, - so if you have been using the Facebook app previously, you will - need to update your configuration! - -Replace "example.net" with your host's URL, "mublog" with the path to your -StatusNet installation, and 'yourapp' with the name of the Facebook -application you created. (If you don't have "Fancy URLs" on, you'll need to -change http://example.net/mublog/ to http://example.net/mublog/index.php/). - -Additionally, Choose "Web" for Application type in the Advanced tab. In the -"Canvas setting" section, choose the "FBML" for Render Method, "Smart Size" -for IFrame size, and "Full width (760px)" for Canvas Width. Everything else -can be left with default values. - -* NOTE: For more under-the-hood detailed instructions about setting up a - Facebook application and getting an API key, check out the - following pages on the Facebook wiki: - - http://wiki.developers.facebook.com/index.php/Connect/Setting_Up_Your_Site - http://wiki.developers.facebook.com/index.php/Creating_your_first_application - -Finally you must activate the plugin by adding it in your config.php -(this is where you'll need the API key and secret generated earlier): - - addPlugin( - 'Facebook', - array( - 'apikey' => 'YOUR_APIKEY', - 'secret' => 'YOUR_SECRET' - ) - ); - -Administration Panel --------------------- - -As of StatusNet 0.9.0 you can alternatively specify the key and secret -via a Facebook administration panel from within StatusNet, in which case -you can just add: - - addPlugin('Facebook'); - -to activate the plugin. - -NOTE: To enable the administration panel you'll need to add it to the -list of active administration panels, e.g.: - - $config['admin']['panels'][] = 'facebook'; - -and of course you'll need a user with the administrative role to access -it and input the API key and secret (see: scripts/userrole.php). - -Testing It Out --------------- - -If the Facebook plugin is enabled and working, there will be a new Facebook -Connect Settings tab under each user's Connect menu. Users can connect and -disconnect* to their Facebook accounts from it. - -To try out the plugin, fire up your browser and connect to: - - http://example.net/mublog/main/facebooklogin - -or, if you do not have fancy URLs turned on: - - http://example.net/mublog/index.php/main/facebooklogin - -You should see a page with a blue button that says: "Connect with Facebook" -and you should be able to login or register. - -From within Facebook, you should also be able to get to the Facebook -application, and run it by hitting the link you specified above when -configuring it: - - http://apps.facebook.com/yourapp/ - -That link should be present you with a login screen. After logging in to -the app, you are given the option to update their Facebook status via -StatusNet. - -* Note: Before a user can disconnect from Facebook, she must set a normal - StatusNet password. Otherwise, she might not be able to login in to her - account in the future. This is usually only required for users who have - used Facebook Connect to register their StatusNet account, and therefore - haven't already set a local password. - -Offline Queue Handling ----------------------- - -For larger sites needing better performance it's possible to enable -queuing and have users' notices posted to Facebook via a separate -"offline" process -- FacebookQueueHandler (facebookqueuhandler.php in -the Facebook plugin directory). It will run automatically if you have -enabled StatusNet's offline queueing subsystem. See the "Queues and -daemons" section in the StatusNet README for more about queuing. - - -TODO ----- - -- Make Facebook Connect work for authentication for multi-site setups - (e.g.: *.status.net) -- Posting to Facebook user streams using only Facebook Connect -- Invite Facebook friends to use your StatusNet installation via Facebook - Connect -- Auto-subscribe Facebook friends already using StatusNet -- Share StatusNet favorite notices to your Facebook stream -- Allow users to update their Facebook statuses once they have authenticated - with Facebook Connect (no need for them to use the Facebook app if they - don't want to). -- Import a user's Facebook updates into StatusNet diff --git a/plugins/Facebook/facebook/facebook.php b/plugins/Facebook/facebook/facebook.php deleted file mode 100644 index 76696c1d55..0000000000 --- a/plugins/Facebook/facebook/facebook.php +++ /dev/null @@ -1,609 +0,0 @@ -api_key = $api_key; - $this->secret = $secret; - $this->generate_session_secret = $generate_session_secret; - $this->api_client = new FacebookRestClient($api_key, $secret, null); - $this->validate_fb_params(); - - // Set the default user id for methods that allow the caller to - // pass an explicit uid instead of using a session key. - $defaultUser = null; - if ($this->user) { - $defaultUser = $this->user; - } else if ($this->profile_user) { - $defaultUser = $this->profile_user; - } else if ($this->canvas_user) { - $defaultUser = $this->canvas_user; - } - - $this->api_client->set_user($defaultUser); - - - if (isset($this->fb_params['friends'])) { - $this->api_client->friends_list = - array_filter(explode(',', $this->fb_params['friends'])); - } - if (isset($this->fb_params['added'])) { - $this->api_client->added = $this->fb_params['added']; - } - if (isset($this->fb_params['canvas_user'])) { - $this->api_client->canvas_user = $this->fb_params['canvas_user']; - } - } - - /* - * Validates that the parameters passed in were sent from Facebook. It does so - * by validating that the signature matches one that could only be generated - * by using your application's secret key. - * - * Facebook-provided parameters will come from $_POST, $_GET, or $_COOKIE, - * in that order. $_POST and $_GET are always more up-to-date than cookies, - * so we prefer those if they are available. - * - * For nitty-gritty details of when each of these is used, check out - * http://wiki.developers.facebook.com/index.php/Verifying_The_Signature - */ - public function validate_fb_params() { - $this->fb_params = $this->get_valid_fb_params($_POST, 48 * 3600, 'fb_sig'); - - // note that with preload FQL, it's possible to receive POST params in - // addition to GET, so use a different prefix to differentiate them - if (!$this->fb_params) { - $fb_params = $this->get_valid_fb_params($_GET, 48 * 3600, 'fb_sig'); - $fb_post_params = $this->get_valid_fb_params($_POST, - 48 * 3600, // 48 hours - 'fb_post_sig'); - $this->fb_params = array_merge($fb_params, $fb_post_params); - } - - // Okay, something came in via POST or GET - if ($this->fb_params) { - $user = isset($this->fb_params['user']) ? - $this->fb_params['user'] : null; - $this->profile_user = isset($this->fb_params['profile_user']) ? - $this->fb_params['profile_user'] : null; - $this->canvas_user = isset($this->fb_params['canvas_user']) ? - $this->fb_params['canvas_user'] : null; - $this->base_domain = isset($this->fb_params['base_domain']) ? - $this->fb_params['base_domain'] : null; - $this->ext_perms = isset($this->fb_params['ext_perms']) ? - explode(',', $this->fb_params['ext_perms']) - : array(); - - if (isset($this->fb_params['session_key'])) { - $session_key = $this->fb_params['session_key']; - } else if (isset($this->fb_params['profile_session_key'])) { - $session_key = $this->fb_params['profile_session_key']; - } else { - $session_key = null; - } - $expires = isset($this->fb_params['expires']) ? - $this->fb_params['expires'] : null; - $this->set_user($user, - $session_key, - $expires); - } else if ($cookies = - $this->get_valid_fb_params($_COOKIE, null, $this->api_key)) { - // if no Facebook parameters were found in the GET or POST variables, - // then fall back to cookies, which may have cached user information - // Cookies are also used to receive session data via the Javascript API - $base_domain_cookie = 'base_domain_' . $this->api_key; - if (isset($_COOKIE[$base_domain_cookie])) { - $this->base_domain = $_COOKIE[$base_domain_cookie]; - } - - // use $api_key . '_' as a prefix for the cookies in case there are - // multiple facebook clients on the same domain. - $expires = isset($cookies['expires']) ? $cookies['expires'] : null; - $this->set_user($cookies['user'], - $cookies['session_key'], - $expires); - } - - return !empty($this->fb_params); - } - - // Store a temporary session secret for the current session - // for use with the JS client library - public function promote_session() { - try { - $session_secret = $this->api_client->auth_promoteSession(); - if (!$this->in_fb_canvas()) { - $this->set_cookies($this->user, $this->api_client->session_key, $this->session_expires, $session_secret); - } - return $session_secret; - } catch (FacebookRestClientException $e) { - // API_EC_PARAM means we don't have a logged in user, otherwise who - // knows what it means, so just throw it. - if ($e->getCode() != FacebookAPIErrorCodes::API_EC_PARAM) { - throw $e; - } - } - } - - public function do_get_session($auth_token) { - try { - return $this->api_client->auth_getSession($auth_token, $this->generate_session_secret); - } catch (FacebookRestClientException $e) { - // API_EC_PARAM means we don't have a logged in user, otherwise who - // knows what it means, so just throw it. - if ($e->getCode() != FacebookAPIErrorCodes::API_EC_PARAM) { - throw $e; - } - } - } - - // Invalidate the session currently being used, and clear any state associated - // with it. Note that the user will still remain logged into Facebook. - public function expire_session() { - try { - if ($this->api_client->auth_expireSession()) { - $this->clear_cookie_state(); - return true; - } else { - return false; - } - } catch (Exception $e) { - $this->clear_cookie_state(); - } - } - - /** Logs the user out of all temporary application sessions as well as their - * Facebook session. Note this will only work if the user has a valid current - * session with the application. - * - * @param string $next URL to redirect to upon logging out - * - */ - public function logout($next) { - $logout_url = $this->get_logout_url($next); - - // Clear any stored state - $this->clear_cookie_state(); - - $this->redirect($logout_url); - } - - /** - * Clears any persistent state stored about the user, including - * cookies and information related to the current session in the - * client. - * - */ - public function clear_cookie_state() { - if (!$this->in_fb_canvas() && isset($_COOKIE[$this->api_key . '_user'])) { - $cookies = array('user', 'session_key', 'expires', 'ss'); - foreach ($cookies as $name) { - setcookie($this->api_key . '_' . $name, - false, - time() - 3600, - '', - $this->base_domain); - unset($_COOKIE[$this->api_key . '_' . $name]); - } - setcookie($this->api_key, false, time() - 3600, '', $this->base_domain); - unset($_COOKIE[$this->api_key]); - } - - // now, clear the rest of the stored state - $this->user = 0; - $this->api_client->session_key = 0; - } - - public function redirect($url) { - if ($this->in_fb_canvas()) { - echo ''; - } else if (preg_match('/^https?:\/\/([^\/]*\.)?facebook\.com(:\d+)?/i', $url)) { - // make sure facebook.com url's load in the full frame so that we don't - // get a frame within a frame. - echo ""; - } else { - header('Location: ' . $url); - } - exit; - } - - public function in_frame() { - return isset($this->fb_params['in_canvas']) - || isset($this->fb_params['in_iframe']); - } - public function in_fb_canvas() { - return isset($this->fb_params['in_canvas']); - } - - public function get_loggedin_user() { - return $this->user; - } - - public function get_canvas_user() { - return $this->canvas_user; - } - - public function get_profile_user() { - return $this->profile_user; - } - - public static function current_url() { - return 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; - } - - // require_add and require_install have been removed. - // see http://developer.facebook.com/news.php?blog=1&story=116 for more details - public function require_login($required_permissions = '') { - $user = $this->get_loggedin_user(); - $has_permissions = true; - - if ($required_permissions) { - $this->require_frame(); - $permissions = array_map('trim', explode(',', $required_permissions)); - foreach ($permissions as $permission) { - if (!in_array($permission, $this->ext_perms)) { - $has_permissions = false; - break; - } - } - } - - if ($user && $has_permissions) { - return $user; - } - - $this->redirect( - $this->get_login_url(self::current_url(), $this->in_frame(), - $required_permissions)); - } - - public function require_frame() { - if (!$this->in_frame()) { - $this->redirect($this->get_login_url(self::current_url(), true)); - } - } - - public static function get_facebook_url($subdomain='www') { - return 'http://' . $subdomain . '.facebook.com'; - } - - public function get_install_url($next=null) { - // this was renamed, keeping for compatibility's sake - return $this->get_add_url($next); - } - - public function get_add_url($next=null) { - $page = self::get_facebook_url().'/add.php'; - $params = array('api_key' => $this->api_key); - - if ($next) { - $params['next'] = $next; - } - - return $page . '?' . http_build_query($params); - } - - public function get_login_url($next, $canvas, $req_perms = '') { - $page = self::get_facebook_url().'/login.php'; - $params = array('api_key' => $this->api_key, - 'v' => '1.0', - 'req_perms' => $req_perms); - - if ($next) { - $params['next'] = $next; - } - if ($canvas) { - $params['canvas'] = '1'; - } - - return $page . '?' . http_build_query($params); - } - - public function get_logout_url($next) { - $page = self::get_facebook_url().'/logout.php'; - $params = array('app_key' => $this->api_key, - 'session_key' => $this->api_client->session_key); - - if ($next) { - $params['connect_next'] = 1; - $params['next'] = $next; - } - - return $page . '?' . http_build_query($params); - } - - public function set_user($user, $session_key, $expires=null, $session_secret=null) { - if (!$this->in_fb_canvas() && (!isset($_COOKIE[$this->api_key . '_user']) - || $_COOKIE[$this->api_key . '_user'] != $user)) { - $this->set_cookies($user, $session_key, $expires, $session_secret); - } - $this->user = $user; - $this->api_client->session_key = $session_key; - $this->session_expires = $expires; - } - - public function set_cookies($user, $session_key, $expires=null, $session_secret=null) { - $cookies = array(); - $cookies['user'] = $user; - $cookies['session_key'] = $session_key; - if ($expires != null) { - $cookies['expires'] = $expires; - } - if ($session_secret != null) { - $cookies['ss'] = $session_secret; - } - - foreach ($cookies as $name => $val) { - setcookie($this->api_key . '_' . $name, $val, (int)$expires, '', $this->base_domain); - $_COOKIE[$this->api_key . '_' . $name] = $val; - } - $sig = self::generate_sig($cookies, $this->secret); - setcookie($this->api_key, $sig, (int)$expires, '', $this->base_domain); - $_COOKIE[$this->api_key] = $sig; - - if ($this->base_domain != null) { - $base_domain_cookie = 'base_domain_' . $this->api_key; - setcookie($base_domain_cookie, $this->base_domain, (int)$expires, '', $this->base_domain); - $_COOKIE[$base_domain_cookie] = $this->base_domain; - } - } - - /** - * Tries to undo the badness of magic quotes as best we can - * @param string $val Should come directly from $_GET, $_POST, etc. - * @return string val without added slashes - */ - public static function no_magic_quotes($val) { - if (get_magic_quotes_gpc()) { - return stripslashes($val); - } else { - return $val; - } - } - - /* - * Get the signed parameters that were sent from Facebook. Validates the set - * of parameters against the included signature. - * - * Since Facebook sends data to your callback URL via unsecured means, the - * signature is the only way to make sure that the data actually came from - * Facebook. So if an app receives a request at the callback URL, it should - * always verify the signature that comes with against your own secret key. - * Otherwise, it's possible for someone to spoof a request by - * pretending to be someone else, i.e.: - * www.your-callback-url.com/?fb_user=10101 - * - * This is done automatically by verify_fb_params. - * - * @param assoc $params a full array of external parameters. - * presumed $_GET, $_POST, or $_COOKIE - * @param int $timeout number of seconds that the args are good for. - * Specifically good for forcing cookies to expire. - * @param string $namespace prefix string for the set of parameters we want - * to verify. i.e., fb_sig or fb_post_sig - * - * @return assoc the subset of parameters containing the given prefix, - * and also matching the signature associated with them. - * OR an empty array if the params do not validate - */ - public function get_valid_fb_params($params, $timeout=null, $namespace='fb_sig') { - $prefix = $namespace . '_'; - $prefix_len = strlen($prefix); - $fb_params = array(); - if (empty($params)) { - return array(); - } - - foreach ($params as $name => $val) { - // pull out only those parameters that match the prefix - // note that the signature itself ($params[$namespace]) is not in the list - if (strpos($name, $prefix) === 0) { - $fb_params[substr($name, $prefix_len)] = self::no_magic_quotes($val); - } - } - - // validate that the request hasn't expired. this is most likely - // for params that come from $_COOKIE - if ($timeout && (!isset($fb_params['time']) || time() - $fb_params['time'] > $timeout)) { - return array(); - } - - // validate that the params match the signature - $signature = isset($params[$namespace]) ? $params[$namespace] : null; - if (!$signature || (!$this->verify_signature($fb_params, $signature))) { - return array(); - } - return $fb_params; - } - - /** - * Validates the account that a user was trying to set up an - * independent account through Facebook Connect. - * - * @param user The user attempting to set up an independent account. - * @param hash The hash passed to the reclamation URL used. - * @return bool True if the user is the one that selected the - * reclamation link. - */ - public function verify_account_reclamation($user, $hash) { - return $hash == md5($user . $this->secret); - } - - /** - * Validates that a given set of parameters match their signature. - * Parameters all match a given input prefix, such as "fb_sig". - * - * @param $fb_params an array of all Facebook-sent parameters, - * not including the signature itself - * @param $expected_sig the expected result to check against - */ - public function verify_signature($fb_params, $expected_sig) { - return self::generate_sig($fb_params, $this->secret) == $expected_sig; - } - - /** - * Validate the given signed public session data structure with - * public key of the app that - * the session proof belongs to. - * - * @param $signed_data the session info that is passed by another app - * @param string $public_key Optional public key of the app. If this - * is not passed, function will make an API call to get it. - * return true if the session proof passed verification. - */ - public function verify_signed_public_session_data($signed_data, - $public_key = null) { - - // If public key is not already provided, we need to get it through API - if (!$public_key) { - $public_key = $this->api_client->auth_getAppPublicKey( - $signed_data['api_key']); - } - - // Create data to verify - $data_to_serialize = $signed_data; - unset($data_to_serialize['sig']); - $serialized_data = implode('_', $data_to_serialize); - - // Decode signature - $signature = base64_decode($signed_data['sig']); - $result = openssl_verify($serialized_data, $signature, $public_key, - OPENSSL_ALGO_SHA1); - return $result == 1; - } - - /* - * Generate a signature using the application secret key. - * - * The only two entities that know your secret key are you and Facebook, - * according to the Terms of Service. Since nobody else can generate - * the signature, you can rely on it to verify that the information - * came from Facebook. - * - * @param $params_array an array of all Facebook-sent parameters, - * NOT INCLUDING the signature itself - * @param $secret your app's secret key - * - * @return a hash to be checked against the signature provided by Facebook - */ - public static function generate_sig($params_array, $secret) { - $str = ''; - - ksort($params_array); - // Note: make sure that the signature parameter is not already included in - // $params_array. - foreach ($params_array as $k=>$v) { - $str .= "$k=$v"; - } - $str .= $secret; - - return md5($str); - } - - public function encode_validationError($summary, $message) { - return json_encode( - array('errorCode' => FACEBOOK_API_VALIDATION_ERROR, - 'errorTitle' => $summary, - 'errorMessage' => $message)); - } - - public function encode_multiFeedStory($feed, $next) { - return json_encode( - array('method' => 'multiFeedStory', - 'content' => - array('next' => $next, - 'feed' => $feed))); - } - - public function encode_feedStory($feed, $next) { - return json_encode( - array('method' => 'feedStory', - 'content' => - array('next' => $next, - 'feed' => $feed))); - } - - public function create_templatizedFeedStory($title_template, $title_data=array(), - $body_template='', $body_data = array(), $body_general=null, - $image_1=null, $image_1_link=null, - $image_2=null, $image_2_link=null, - $image_3=null, $image_3_link=null, - $image_4=null, $image_4_link=null) { - return array('title_template'=> $title_template, - 'title_data' => $title_data, - 'body_template'=> $body_template, - 'body_data' => $body_data, - 'body_general' => $body_general, - 'image_1' => $image_1, - 'image_1_link' => $image_1_link, - 'image_2' => $image_2, - 'image_2_link' => $image_2_link, - 'image_3' => $image_3, - 'image_3_link' => $image_3_link, - 'image_4' => $image_4, - 'image_4_link' => $image_4_link); - } - - -} - diff --git a/plugins/Facebook/facebook/facebook_desktop.php b/plugins/Facebook/facebook/facebook_desktop.php deleted file mode 100644 index ed4762215b..0000000000 --- a/plugins/Facebook/facebook/facebook_desktop.php +++ /dev/null @@ -1,104 +0,0 @@ -app_secret = $secret; - $this->verify_sig = false; - parent::__construct($api_key, $secret); - } - - public function do_get_session($auth_token) { - $this->api_client->secret = $this->app_secret; - $this->api_client->session_key = null; - $session_info = parent::do_get_session($auth_token); - if (!empty($session_info['secret'])) { - // store the session secret - $this->set_session_secret($session_info['secret']); - } - return $session_info; - } - - public function set_session_secret($session_secret) { - $this->secret = $session_secret; - $this->api_client->use_session_secret($session_secret); - } - - public function require_login() { - if ($this->get_loggedin_user()) { - try { - // try a session-based API call to ensure that we have the correct - // session secret - $user = $this->api_client->users_getLoggedInUser(); - - // now that we have a valid session secret, verify the signature - $this->verify_sig = true; - if ($this->validate_fb_params(false)) { - return $user; - } else { - // validation failed - return null; - } - } catch (FacebookRestClientException $ex) { - if (isset($_GET['auth_token'])) { - // if we have an auth_token, use it to establish a session - $session_info = $this->do_get_session($_GET['auth_token']); - if ($session_info) { - return $session_info['uid']; - } - } - } - } - // if we get here, we need to redirect the user to log in - $this->redirect($this->get_login_url(self::current_url(), $this->in_fb_canvas())); - } - - public function verify_signature($fb_params, $expected_sig) { - // we don't want to verify the signature until we have a valid - // session secret - if ($this->verify_sig) { - return parent::verify_signature($fb_params, $expected_sig); - } else { - return true; - } - } -} diff --git a/plugins/Facebook/facebook/facebook_mobile.php b/plugins/Facebook/facebook/facebook_mobile.php deleted file mode 100644 index 5ee7f4ed5b..0000000000 --- a/plugins/Facebook/facebook/facebook_mobile.php +++ /dev/null @@ -1,260 +0,0 @@ - $val) { - if (!$val) { - unset($params[$key]); - } - } - return $page . '?' . http_build_query($params); - } - - public function get_www_url($action, $params) { - $page = parent::get_facebook_url('www'). '/' .$action; - foreach($params as $key => $val) { - if (!$val) { - unset($params[$key]); - } - } - return $page . '?' . http_build_query($params); - } - - public function get_add_url($next=null) { - - return $this->get_m_url('add.php', array('api_key' => $this->api_key, - 'next' => $next)); - } - - public function get_tos_url($next=null, $cancel = null, $canvas=null) { - return $this->get_m_url('tos.php', array('api_key' => $this->api_key, - 'v' => '1.0', - 'next' => $next, - 'canvas' => $canvas, - 'cancel' => $cancel)); - } - - public function get_logout_url($next=null) { - $params = array('api_key' => $this->api_key, - 'session_key' => $this->api_client->session_key, - ); - - if ($next) { - $params['connect_next'] = 1; - $params['next'] = $next; - } - - return $this->get_m_url('logout.php', $params); - } - public function get_register_url($next=null, $cancel_url=null) { - return $this->get_m_url('r.php', - array('fbconnect' => 1, - 'api_key' => $this->api_key, - 'next' => $next ? $next : parent::current_url(), - 'cancel_url' => $cancel_url ? $cancel_url : parent::current_url())); - } - /** - * These set of fbconnect style url redirect back to the application current - * page when the action is done. Developer can also use the non fbconnect - * style url and provide their own redirect link by giving the right parameter - * to $next and/or $cancel_url - */ - public function get_fbconnect_register_url() { - return $this->get_register_url(parent::current_url(), parent::current_url()); - } - public function get_fbconnect_tos_url() { - return $this->get_tos_url(parent::current_url(), parent::current_url(), $this->in_frame()); - } - - public function get_fbconnect_logout_url() { - return $this->get_logout_url(parent::current_url()); - } - - public function logout_user() { - $this->user = null; - } - - public function get_prompt_permissions_url($ext_perm, - $next=null, - $cancel_url=null) { - - return $this->get_www_url('connect/prompt_permissions.php', - array('api_key' => $this->api_key, - 'ext_perm' => $ext_perm, - 'next' => $next ? $next : parent::current_url(), - 'cancel' => $cancel_url ? $cancel_url : parent::current_url(), - 'display' => 'wap')); - - } - - /** - * support both prompt_permissions.php and authorize.php for now. - * authorized.php is to be deprecate though. - */ - public function get_extended_permission_url($ext_perm, - $next=null, - $cancel_url=null) { - $next = $next ? $next : parent::current_url(); - $cancel_url = $cancel_url ? $cancel_url : parent::current_url(); - - return $this->get_m_url('authorize.php', - array('api_key' => $this->api_key, - 'ext_perm' => $ext_perm, - 'next' => $next, - 'cancel_url' => $cancel_url)); - - } - - public function render_prompt_feed_url($action_links=NULL, - $target_id=NULL, - $message='', - $user_message_prompt='', - $caption=NULL, - $callback ='', - $cancel='', - $attachment=NULL, - $preview=true) { - - $params = array('api_key' => $this->api_key, - 'session_key' => $this->api_client->session_key, - ); - if (!empty($attachment)) { - $params['attachment'] = urlencode(json_encode($attachment)); - } else { - $attachment = new stdClass(); - $app_display_info = $this->api_client->admin_getAppProperties(array('application_name', - 'callback_url', - 'description', - 'logo_url')); - $app_display_info = $app_display_info; - $attachment->name = $app_display_info['application_name']; - $attachment->caption = !empty($caption) ? $caption : 'Just see what\'s new!'; - $attachment->description = $app_display_info['description']; - $attachment->href = $app_display_info['callback_url']; - if (!empty($app_display_info['logo_url'])) { - $logo = new stdClass(); - $logo->type = 'image'; - $logo->src = $app_display_info['logo_url']; - $logo->href = $app_display_info['callback_url']; - $attachment->media = array($logo); - } - $params['attachment'] = urlencode(json_encode($attachment)); - } - $params['preview'] = $preview; - $params['message'] = $message; - $params['user_message_prompt'] = $user_message_prompt; - if (!empty($callback)) { - $params['callback'] = $callback; - } else { - $params['callback'] = $this->current_url(); - } - if (!empty($cancel)) { - $params['cancel'] = $cancel; - } else { - $params['cancel'] = $this->current_url(); - } - - if (!empty($target_id)) { - $params['target_id'] = $target_id; - } - if (!empty($action_links)) { - $params['action_links'] = urlencode(json_encode($action_links)); - } - - $params['display'] = 'wap'; - header('Location: '. $this->get_www_url('connect/prompt_feed.php', $params)); - } - -//use template_id - public function render_feed_form_url($template_id=NULL, - $template_data=NULL, - $user_message=NULL, - $body_general=NULL, - $user_message_prompt=NULL, - $target_id=NULL, - $callback=NULL, - $cancel=NULL, - $preview=true) { - - $params = array('api_key' => $this->api_key); - $params['preview'] = $preview; - if (isset($template_id) && $template_id) { - $params['template_id'] = $template_id; - } - $params['message'] = $user_message ? $user_message['value'] : ''; - if (isset($body_general) && $body_general) { - $params['body_general'] = $body_general; - } - if (isset($user_message_prompt) && $user_message_prompt) { - $params['user_message_prompt'] = $user_message_prompt; - } - if (isset($callback) && $callback) { - $params['callback'] = $callback; - } else { - $params['callback'] = $this->current_url(); - } - if (isset($cancel) && $cancel) { - $params['cancel'] = $cancel; - } else { - $params['cancel'] = $this->current_url(); - } - if (isset($template_data) && $template_data) { - $params['template_data'] = $template_data; - } - if (isset($target_id) && $target_id) { - $params['to_ids'] = $target_id; - } - $params['display'] = 'wap'; - header('Location: '. $this->get_www_url('connect/prompt_feed.php', $params)); - } -} diff --git a/plugins/Facebook/facebook/facebookapi_php5_restlib.php b/plugins/Facebook/facebook/facebookapi_php5_restlib.php deleted file mode 100755 index e249a326b2..0000000000 --- a/plugins/Facebook/facebook/facebookapi_php5_restlib.php +++ /dev/null @@ -1,3702 +0,0 @@ -secret = $secret; - $this->session_key = $session_key; - $this->api_key = $api_key; - $this->batch_mode = FacebookRestClient::BATCH_MODE_DEFAULT; - $this->last_call_id = 0; - $this->call_as_apikey = ''; - $this->use_curl_if_available = true; - $this->server_addr = - Facebook::get_facebook_url('api') . '/restserver.php'; - $this->photo_server_addr = - Facebook::get_facebook_url('api-photo') . '/restserver.php'; - - if (!empty($GLOBALS['facebook_config']['debug'])) { - $this->cur_id = 0; - ?> - -user = $uid; - } - - - /** - * Switch to use the session secret instead of the app secret, - * for desktop and unsecured environment - */ - public function use_session_secret($session_secret) { - $this->secret = $session_secret; - $this->using_session_secret = true; - } - - /** - * Normally, if the cURL library/PHP extension is available, it is used for - * HTTP transactions. This allows that behavior to be overridden, falling - * back to a vanilla-PHP implementation even if cURL is installed. - * - * @param $use_curl_if_available bool whether or not to use cURL if available - */ - public function set_use_curl_if_available($use_curl_if_available) { - $this->use_curl_if_available = $use_curl_if_available; - } - - /** - * Start a batch operation. - */ - public function begin_batch() { - if ($this->pending_batch()) { - $code = FacebookAPIErrorCodes::API_EC_BATCH_ALREADY_STARTED; - $description = FacebookAPIErrorCodes::$api_error_descriptions[$code]; - throw new FacebookRestClientException($description, $code); - } - - $this->batch_queue = array(); - $this->pending_batch = true; - } - - /* - * End current batch operation - */ - public function end_batch() { - if (!$this->pending_batch()) { - $code = FacebookAPIErrorCodes::API_EC_BATCH_NOT_STARTED; - $description = FacebookAPIErrorCodes::$api_error_descriptions[$code]; - throw new FacebookRestClientException($description, $code); - } - - $this->pending_batch = false; - - $this->execute_server_side_batch(); - $this->batch_queue = null; - } - - /** - * are we currently queueing up calls for a batch? - */ - public function pending_batch() { - return $this->pending_batch; - } - - private function execute_server_side_batch() { - $item_count = count($this->batch_queue); - $method_feed = array(); - foreach ($this->batch_queue as $batch_item) { - $method = $batch_item['m']; - $params = $batch_item['p']; - list($get, $post) = $this->finalize_params($method, $params); - $method_feed[] = $this->create_url_string(array_merge($post, $get)); - } - - $serial_only = - ($this->batch_mode == FacebookRestClient::BATCH_MODE_SERIAL_ONLY); - - $params = array('method_feed' => json_encode($method_feed), - 'serial_only' => $serial_only, - 'format' => $this->format); - $result = $this->call_method('facebook.batch.run', $params); - - if (is_array($result) && isset($result['error_code'])) { - throw new FacebookRestClientException($result['error_msg'], - $result['error_code']); - } - - for ($i = 0; $i < $item_count; $i++) { - $batch_item = $this->batch_queue[$i]; - $batch_item['p']['format'] = $this->format; - $batch_item_result = $this->convert_result($result[$i], - $batch_item['m'], - $batch_item['p']); - - if (is_array($batch_item_result) && - isset($batch_item_result['error_code'])) { - throw new FacebookRestClientException($batch_item_result['error_msg'], - $batch_item_result['error_code']); - } - $batch_item['r'] = $batch_item_result; - } - } - - public function begin_permissions_mode($permissions_apikey) { - $this->call_as_apikey = $permissions_apikey; - } - - public function end_permissions_mode() { - $this->call_as_apikey = ''; - } - - - /* - * If a page is loaded via HTTPS, then all images and static - * resources need to be printed with HTTPS urls to avoid - * mixed content warnings. If your page loads with an HTTPS - * url, then call set_use_ssl_resources to retrieve the correct - * urls. - */ - public function set_use_ssl_resources($is_ssl = true) { - $this->use_ssl_resources = $is_ssl; - } - - /** - * Returns public information for an application (as shown in the application - * directory) by either application ID, API key, or canvas page name. - * - * @param int $application_id (Optional) app id - * @param string $application_api_key (Optional) api key - * @param string $application_canvas_name (Optional) canvas name - * - * Exactly one argument must be specified, otherwise it is an error. - * - * @return array An array of public information about the application. - */ - public function application_getPublicInfo($application_id=null, - $application_api_key=null, - $application_canvas_name=null) { - return $this->call_method('facebook.application.getPublicInfo', - array('application_id' => $application_id, - 'application_api_key' => $application_api_key, - 'application_canvas_name' => $application_canvas_name)); - } - - /** - * Creates an authentication token to be used as part of the desktop login - * flow. For more information, please see - * http://wiki.developers.facebook.com/index.php/Auth.createToken. - * - * @return string An authentication token. - */ - public function auth_createToken() { - return $this->call_method('facebook.auth.createToken'); - } - - /** - * Returns the session information available after current user logs in. - * - * @param string $auth_token the token returned by auth_createToken or - * passed back to your callback_url. - * @param bool $generate_session_secret whether the session returned should - * include a session secret - * @param string $host_url the connect site URL for which the session is - * being generated. This parameter is optional, unless - * you want Facebook to determine which of several base domains - * to choose from. If this third argument isn't provided but - * there are several base domains, the first base domain is - * chosen. - * - * @return array An assoc array containing session_key, uid - */ - public function auth_getSession($auth_token, - $generate_session_secret = false, - $host_url = null) { - if (!$this->pending_batch()) { - $result = $this->call_method( - 'facebook.auth.getSession', - array('auth_token' => $auth_token, - 'generate_session_secret' => $generate_session_secret, - 'host_url' => $host_url)); - $this->session_key = $result['session_key']; - - if (!empty($result['secret']) && !$generate_session_secret) { - // desktop apps have a special secret - $this->secret = $result['secret']; - } - - return $result; - } - } - - /** - * Generates a session-specific secret. This is for integration with - * client-side API calls, such as the JS library. - * - * @return array A session secret for the current promoted session - * - * @error API_EC_PARAM_SESSION_KEY - * API_EC_PARAM_UNKNOWN - */ - public function auth_promoteSession() { - return $this->call_method('facebook.auth.promoteSession'); - } - - /** - * Expires the session that is currently being used. If this call is - * successful, no further calls to the API (which require a session) can be - * made until a valid session is created. - * - * @return bool true if session expiration was successful, false otherwise - */ - public function auth_expireSession() { - return $this->call_method('facebook.auth.expireSession'); - } - - /** - * Revokes the given extended permission that the user granted at some - * prior time (for instance, offline_access or email). If no user is - * provided, it will be revoked for the user of the current session. - * - * @param string $perm The permission to revoke - * @param int $uid The user for whom to revoke the permission. - */ - public function auth_revokeExtendedPermission($perm, $uid=null) { - return $this->call_method('facebook.auth.revokeExtendedPermission', - array('perm' => $perm, 'uid' => $uid)); - } - - /** - * Revokes the user's agreement to the Facebook Terms of Service for your - * application. If you call this method for one of your users, you will no - * longer be able to make API requests on their behalf until they again - * authorize your application. Use with care. Note that if this method is - * called without a user parameter, then it will revoke access for the - * current session's user. - * - * @param int $uid (Optional) User to revoke - * - * @return bool true if revocation succeeds, false otherwise - */ - public function auth_revokeAuthorization($uid=null) { - return $this->call_method('facebook.auth.revokeAuthorization', - array('uid' => $uid)); - } - - /** - * Get public key that is needed to verify digital signature - * an app may pass to other apps. The public key is only used by - * other apps for verification purposes. - * @param string API key of an app - * @return string The public key for the app. - */ - public function auth_getAppPublicKey($target_app_key) { - return $this->call_method('facebook.auth.getAppPublicKey', - array('target_app_key' => $target_app_key)); - } - - /** - * Get a structure that can be passed to another app - * as proof of session. The other app can verify it using public - * key of this app. - * - * @return signed public session data structure. - */ - public function auth_getSignedPublicSessionData() { - return $this->call_method('facebook.auth.getSignedPublicSessionData', - array()); - } - - /** - * Returns the number of unconnected friends that exist in this application. - * This number is determined based on the accounts registered through - * connect.registerUsers() (see below). - */ - public function connect_getUnconnectedFriendsCount() { - return $this->call_method('facebook.connect.getUnconnectedFriendsCount', - array()); - } - - /** - * This method is used to create an association between an external user - * account and a Facebook user account, as per Facebook Connect. - * - * This method takes an array of account data, including a required email_hash - * and optional account data. For each connected account, if the user exists, - * the information is added to the set of the user's connected accounts. - * If the user has already authorized the site, the connected account is added - * in the confirmed state. If the user has not yet authorized the site, the - * connected account is added in the pending state. - * - * This is designed to help Facebook Connect recognize when two Facebook - * friends are both members of a external site, but perhaps are not aware of - * it. The Connect dialog (see fb:connect-form) is used when friends can be - * identified through these email hashes. See the following url for details: - * - * http://wiki.developers.facebook.com/index.php/Connect.registerUsers - * - * @param mixed $accounts A (JSON-encoded) array of arrays, where each array - * has three properties: - * 'email_hash' (req) - public email hash of account - * 'account_id' (opt) - remote account id; - * 'account_url' (opt) - url to remote account; - * - * @return array The list of email hashes for the successfully registered - * accounts. - */ - public function connect_registerUsers($accounts) { - return $this->call_method('facebook.connect.registerUsers', - array('accounts' => $accounts)); - } - - /** - * Unregisters a set of accounts registered using connect.registerUsers. - * - * @param array $email_hashes The (JSON-encoded) list of email hashes to be - * unregistered. - * - * @return array The list of email hashes which have been successfully - * unregistered. - */ - public function connect_unregisterUsers($email_hashes) { - return $this->call_method('facebook.connect.unregisterUsers', - array('email_hashes' => $email_hashes)); - } - - /** - * Returns events according to the filters specified. - * - * @param int $uid (Optional) User associated with events. A null - * parameter will default to the session user. - * @param array/string $eids (Optional) Filter by these event - * ids. A null parameter will get all events for - * the user. (A csv list will work but is deprecated) - * @param int $start_time (Optional) Filter with this unix time as lower - * bound. A null or zero parameter indicates no - * lower bound. - * @param int $end_time (Optional) Filter with this UTC as upper bound. - * A null or zero parameter indicates no upper - * bound. - * @param string $rsvp_status (Optional) Only show events where the given uid - * has this rsvp status. This only works if you - * have specified a value for $uid. Values are as - * in events.getMembers. Null indicates to ignore - * rsvp status when filtering. - * - * @return array The events matching the query. - */ - public function &events_get($uid=null, - $eids=null, - $start_time=null, - $end_time=null, - $rsvp_status=null) { - return $this->call_method('facebook.events.get', - array('uid' => $uid, - 'eids' => $eids, - 'start_time' => $start_time, - 'end_time' => $end_time, - 'rsvp_status' => $rsvp_status)); - } - - /** - * Returns membership list data associated with an event. - * - * @param int $eid event id - * - * @return array An assoc array of four membership lists, with keys - * 'attending', 'unsure', 'declined', and 'not_replied' - */ - public function &events_getMembers($eid) { - return $this->call_method('facebook.events.getMembers', - array('eid' => $eid)); - } - - /** - * RSVPs the current user to this event. - * - * @param int $eid event id - * @param string $rsvp_status 'attending', 'unsure', or 'declined' - * - * @return bool true if successful - */ - public function &events_rsvp($eid, $rsvp_status) { - return $this->call_method('facebook.events.rsvp', - array( - 'eid' => $eid, - 'rsvp_status' => $rsvp_status)); - } - - /** - * Cancels an event. Only works for events where application is the admin. - * - * @param int $eid event id - * @param string $cancel_message (Optional) message to send to members of - * the event about why it is cancelled - * - * @return bool true if successful - */ - public function &events_cancel($eid, $cancel_message='') { - return $this->call_method('facebook.events.cancel', - array('eid' => $eid, - 'cancel_message' => $cancel_message)); - } - - /** - * Creates an event on behalf of the user is there is a session, otherwise on - * behalf of app. Successful creation guarantees app will be admin. - * - * @param assoc array $event_info json encoded event information - * @param string $file (Optional) filename of picture to set - * - * @return int event id - */ - public function events_create($event_info, $file = null) { - if ($file) { - return $this->call_upload_method('facebook.events.create', - array('event_info' => $event_info), - $file, - $this->photo_server_addr); - } else { - return $this->call_method('facebook.events.create', - array('event_info' => $event_info)); - } - } - - /** - * Invites users to an event. If a session user exists, the session user - * must have permissions to invite friends to the event and $uids must contain - * a list of friend ids. Otherwise, the event must have been - * created by the app and $uids must contain users of the app. - * This method requires the 'create_event' extended permission to - * invite people on behalf of a user. - * - * @param $eid the event id - * @param $uids an array of users to invite - * @param $personal_message a string containing the user's message - * (text only) - * - */ - public function events_invite($eid, $uids, $personal_message) { - return $this->call_method('facebook.events.invite', - array('eid' => $eid, - 'uids' => $uids, - 'personal_message' => $personal_message)); - } - - /** - * Edits an existing event. Only works for events where application is admin. - * - * @param int $eid event id - * @param assoc array $event_info json encoded event information - * @param string $file (Optional) filename of new picture to set - * - * @return bool true if successful - */ - public function events_edit($eid, $event_info, $file = null) { - if ($file) { - return $this->call_upload_method('facebook.events.edit', - array('eid' => $eid, 'event_info' => $event_info), - $file, - $this->photo_server_addr); - } else { - return $this->call_method('facebook.events.edit', - array('eid' => $eid, - 'event_info' => $event_info)); - } - } - - /** - * Fetches and re-caches the image stored at the given URL, for use in images - * published to non-canvas pages via the API (for example, to user profiles - * via profile.setFBML, or to News Feed via feed.publishUserAction). - * - * @param string $url The absolute URL from which to refresh the image. - * - * @return bool true on success - */ - public function &fbml_refreshImgSrc($url) { - return $this->call_method('facebook.fbml.refreshImgSrc', - array('url' => $url)); - } - - /** - * Fetches and re-caches the content stored at the given URL, for use in an - * fb:ref FBML tag. - * - * @param string $url The absolute URL from which to fetch content. This URL - * should be used in a fb:ref FBML tag. - * - * @return bool true on success - */ - public function &fbml_refreshRefUrl($url) { - return $this->call_method('facebook.fbml.refreshRefUrl', - array('url' => $url)); - } - - /** - * Associates a given "handle" with FBML markup so that the handle can be - * used within the fb:ref FBML tag. A handle is unique within an application - * and allows an application to publish identical FBML to many user profiles - * and do subsequent updates without having to republish FBML on behalf of - * each user. - * - * @param string $handle The handle to associate with the given FBML. - * @param string $fbml The FBML to associate with the given handle. - * - * @return bool true on success - */ - public function &fbml_setRefHandle($handle, $fbml) { - return $this->call_method('facebook.fbml.setRefHandle', - array('handle' => $handle, 'fbml' => $fbml)); - } - - /** - * Register custom tags for the application. Custom tags can be used - * to extend the set of tags available to applications in FBML - * markup. - * - * Before you call this function, - * make sure you read the full documentation at - * - * http://wiki.developers.facebook.com/index.php/Fbml.RegisterCustomTags - * - * IMPORTANT: This function overwrites the values of - * existing tags if the names match. Use this function with care because - * it may break the FBML of any application that is using the - * existing version of the tags. - * - * @param mixed $tags an array of tag objects (the full description is on the - * wiki page) - * - * @return int the number of tags that were registered - */ - public function &fbml_registerCustomTags($tags) { - $tags = json_encode($tags); - return $this->call_method('facebook.fbml.registerCustomTags', - array('tags' => $tags)); - } - - /** - * Get the custom tags for an application. If $app_id - * is not specified, the calling app's tags are returned. - * If $app_id is different from the id of the calling app, - * only the app's public tags are returned. - * The return value is an array of the same type as - * the $tags parameter of fbml_registerCustomTags(). - * - * @param int $app_id the application's id (optional) - * - * @return mixed an array containing the custom tag objects - */ - public function &fbml_getCustomTags($app_id = null) { - return $this->call_method('facebook.fbml.getCustomTags', - array('app_id' => $app_id)); - } - - - /** - * Delete custom tags the application has registered. If - * $tag_names is null, all the application's custom tags will be - * deleted. - * - * IMPORTANT: If your application has registered public tags - * that other applications may be using, don't delete those tags! - * Doing so can break the FBML ofapplications that are using them. - * - * @param array $tag_names the names of the tags to delete (optinal) - * @return bool true on success - */ - public function &fbml_deleteCustomTags($tag_names = null) { - return $this->call_method('facebook.fbml.deleteCustomTags', - array('tag_names' => json_encode($tag_names))); - } - - /** - * Gets the best translations for native strings submitted by an application - * for translation. If $locale is not specified, only native strings and their - * descriptions are returned. If $all is true, then unapproved translations - * are returned as well, otherwise only approved translations are returned. - * - * A mapping of locale codes -> language names is available at - * http://wiki.developers.facebook.com/index.php/Facebook_Locales - * - * @param string $locale the locale to get translations for, or 'all' for all - * locales, or 'en_US' for native strings - * @param bool $all whether to return all or only approved translations - * - * @return array (locale, array(native_strings, array('best translation - * available given enough votes or manual approval', approval - * status))) - * @error API_EC_PARAM - * @error API_EC_PARAM_BAD_LOCALE - */ - public function &intl_getTranslations($locale = 'en_US', $all = false) { - return $this->call_method('facebook.intl.getTranslations', - array('locale' => $locale, - 'all' => $all)); - } - - /** - * Lets you insert text strings in their native language into the Facebook - * Translations database so they can be translated. - * - * @param array $native_strings An array of maps, where each map has a 'text' - * field and a 'description' field. - * - * @return int Number of strings uploaded. - */ - public function &intl_uploadNativeStrings($native_strings) { - return $this->call_method('facebook.intl.uploadNativeStrings', - array('native_strings' => json_encode($native_strings))); - } - - /** - * This method is deprecated for calls made on behalf of users. This method - * works only for publishing stories on a Facebook Page that has installed - * your application. To publish stories to a user's profile, use - * feed.publishUserAction instead. - * - * For more details on this call, please visit the wiki page: - * - * http://wiki.developers.facebook.com/index.php/Feed.publishTemplatizedAction - */ - public function &feed_publishTemplatizedAction($title_template, - $title_data, - $body_template, - $body_data, - $body_general, - $image_1=null, - $image_1_link=null, - $image_2=null, - $image_2_link=null, - $image_3=null, - $image_3_link=null, - $image_4=null, - $image_4_link=null, - $target_ids='', - $page_actor_id=null) { - return $this->call_method('facebook.feed.publishTemplatizedAction', - array('title_template' => $title_template, - 'title_data' => $title_data, - 'body_template' => $body_template, - 'body_data' => $body_data, - 'body_general' => $body_general, - 'image_1' => $image_1, - 'image_1_link' => $image_1_link, - 'image_2' => $image_2, - 'image_2_link' => $image_2_link, - 'image_3' => $image_3, - 'image_3_link' => $image_3_link, - 'image_4' => $image_4, - 'image_4_link' => $image_4_link, - 'target_ids' => $target_ids, - 'page_actor_id' => $page_actor_id)); - } - - /** - * Registers a template bundle. Template bundles are somewhat involved, so - * it's recommended you check out the wiki for more details: - * - * http://wiki.developers.facebook.com/index.php/Feed.registerTemplateBundle - * - * @return string A template bundle id - */ - public function &feed_registerTemplateBundle($one_line_story_templates, - $short_story_templates = array(), - $full_story_template = null, - $action_links = array()) { - - $one_line_story_templates = json_encode($one_line_story_templates); - - if (!empty($short_story_templates)) { - $short_story_templates = json_encode($short_story_templates); - } - - if (isset($full_story_template)) { - $full_story_template = json_encode($full_story_template); - } - - if (isset($action_links)) { - $action_links = json_encode($action_links); - } - - return $this->call_method('facebook.feed.registerTemplateBundle', - array('one_line_story_templates' => $one_line_story_templates, - 'short_story_templates' => $short_story_templates, - 'full_story_template' => $full_story_template, - 'action_links' => $action_links)); - } - - /** - * Retrieves the full list of active template bundles registered by the - * requesting application. - * - * @return array An array of template bundles - */ - public function &feed_getRegisteredTemplateBundles() { - return $this->call_method('facebook.feed.getRegisteredTemplateBundles', - array()); - } - - /** - * Retrieves information about a specified template bundle previously - * registered by the requesting application. - * - * @param string $template_bundle_id The template bundle id - * - * @return array Template bundle - */ - public function &feed_getRegisteredTemplateBundleByID($template_bundle_id) { - return $this->call_method('facebook.feed.getRegisteredTemplateBundleByID', - array('template_bundle_id' => $template_bundle_id)); - } - - /** - * Deactivates a previously registered template bundle. - * - * @param string $template_bundle_id The template bundle id - * - * @return bool true on success - */ - public function &feed_deactivateTemplateBundleByID($template_bundle_id) { - return $this->call_method('facebook.feed.deactivateTemplateBundleByID', - array('template_bundle_id' => $template_bundle_id)); - } - - const STORY_SIZE_ONE_LINE = 1; - const STORY_SIZE_SHORT = 2; - const STORY_SIZE_FULL = 4; - - /** - * Publishes a story on behalf of the user owning the session, using the - * specified template bundle. This method requires an active session key in - * order to be called. - * - * The parameters to this method ($templata_data in particular) are somewhat - * involved. It's recommended you visit the wiki for details: - * - * http://wiki.developers.facebook.com/index.php/Feed.publishUserAction - * - * @param int $template_bundle_id A template bundle id previously registered - * @param array $template_data See wiki article for syntax - * @param array $target_ids (Optional) An array of friend uids of the - * user who shared in this action. - * @param string $body_general (Optional) Additional markup that extends - * the body of a short story. - * @param int $story_size (Optional) A story size (see above) - * @param string $user_message (Optional) A user message for a short - * story. - * - * @return bool true on success - */ - public function &feed_publishUserAction( - $template_bundle_id, $template_data, $target_ids='', $body_general='', - $story_size=FacebookRestClient::STORY_SIZE_ONE_LINE, - $user_message='') { - - if (is_array($template_data)) { - $template_data = json_encode($template_data); - } // allow client to either pass in JSON or an assoc that we JSON for them - - if (is_array($target_ids)) { - $target_ids = json_encode($target_ids); - $target_ids = trim($target_ids, "[]"); // we don't want square brackets - } - - return $this->call_method('facebook.feed.publishUserAction', - array('template_bundle_id' => $template_bundle_id, - 'template_data' => $template_data, - 'target_ids' => $target_ids, - 'body_general' => $body_general, - 'story_size' => $story_size, - 'user_message' => $user_message)); - } - - - /** - * Publish a post to the user's stream. - * - * @param $message the user's message - * @param $attachment the post's attachment (optional) - * @param $action links the post's action links (optional) - * @param $target_id the user on whose wall the post will be posted - * (optional) - * @param $uid the actor (defaults to session user) - * @return string the post id - */ - public function stream_publish( - $message, $attachment = null, $action_links = null, $target_id = null, - $uid = null) { - - return $this->call_method( - 'facebook.stream.publish', - array('message' => $message, - 'attachment' => $attachment, - 'action_links' => $action_links, - 'target_id' => $target_id, - 'uid' => $this->get_uid($uid))); - } - - /** - * Remove a post from the user's stream. - * Currently, you may only remove stories you application created. - * - * @param $post_id the post id - * @param $uid the actor (defaults to session user) - * @return bool - */ - public function stream_remove($post_id, $uid = null) { - return $this->call_method( - 'facebook.stream.remove', - array('post_id' => $post_id, - 'uid' => $this->get_uid($uid))); - } - - /** - * Add a comment to a stream post - * - * @param $post_id the post id - * @param $comment the comment text - * @param $uid the actor (defaults to session user) - * @return string the id of the created comment - */ - public function stream_addComment($post_id, $comment, $uid = null) { - return $this->call_method( - 'facebook.stream.addComment', - array('post_id' => $post_id, - 'comment' => $comment, - 'uid' => $this->get_uid($uid))); - } - - - /** - * Remove a comment from a stream post - * - * @param $comment_id the comment id - * @param $uid the actor (defaults to session user) - * @return bool - */ - public function stream_removeComment($comment_id, $uid = null) { - return $this->call_method( - 'facebook.stream.removeComment', - array('comment_id' => $comment_id, - 'uid' => $this->get_uid($uid))); - } - - /** - * Add a like to a stream post - * - * @param $post_id the post id - * @param $uid the actor (defaults to session user) - * @return bool - */ - public function stream_addLike($post_id, $uid = null) { - return $this->call_method( - 'facebook.stream.addLike', - array('post_id' => $post_id, - 'uid' => $this->get_uid($uid))); - } - - /** - * Remove a like from a stream post - * - * @param $post_id the post id - * @param $uid the actor (defaults to session user) - * @return bool - */ - public function stream_removeLike($post_id, $uid = null) { - return $this->call_method( - 'facebook.stream.removeLike', - array('post_id' => $post_id, - 'uid' => $this->get_uid($uid))); - } - - /** - * For the current user, retrieves stories generated by the user's friends - * while using this application. This can be used to easily create a - * "News Feed" like experience. - * - * @return array An array of feed story objects. - */ - public function &feed_getAppFriendStories() { - return $this->call_method('facebook.feed.getAppFriendStories'); - } - - /** - * Makes an FQL query. This is a generalized way of accessing all the data - * in the API, as an alternative to most of the other method calls. More - * info at http://wiki.developers.facebook.com/index.php/FQL - * - * @param string $query the query to evaluate - * - * @return array generalized array representing the results - */ - public function &fql_query($query) { - return $this->call_method('facebook.fql.query', - array('query' => $query)); - } - - /** - * Makes a set of FQL queries in parallel. This method takes a dictionary - * of FQL queries where the keys are names for the queries. Results from - * one query can be used within another query to fetch additional data. More - * info about FQL queries at http://wiki.developers.facebook.com/index.php/FQL - * - * @param string $queries JSON-encoded dictionary of queries to evaluate - * - * @return array generalized array representing the results - */ - public function &fql_multiquery($queries) { - return $this->call_method('facebook.fql.multiquery', - array('queries' => $queries)); - } - - /** - * Returns whether or not pairs of users are friends. - * Note that the Facebook friend relationship is symmetric. - * - * @param array/string $uids1 list of ids (id_1, id_2,...) - * of some length X (csv is deprecated) - * @param array/string $uids2 list of ids (id_A, id_B,...) - * of SAME length X (csv is deprecated) - * - * @return array An array with uid1, uid2, and bool if friends, e.g.: - * array(0 => array('uid1' => id_1, 'uid2' => id_A, 'are_friends' => 1), - * 1 => array('uid1' => id_2, 'uid2' => id_B, 'are_friends' => 0) - * ...) - * @error - * API_EC_PARAM_USER_ID_LIST - */ - public function &friends_areFriends($uids1, $uids2) { - return $this->call_method('facebook.friends.areFriends', - array('uids1' => $uids1, - 'uids2' => $uids2)); - } - - /** - * Returns the friends of the current session user. - * - * @param int $flid (Optional) Only return friends on this friend list. - * @param int $uid (Optional) Return friends for this user. - * - * @return array An array of friends - */ - public function &friends_get($flid=null, $uid = null) { - if (isset($this->friends_list)) { - return $this->friends_list; - } - $params = array(); - if (!$uid && isset($this->canvas_user)) { - $uid = $this->canvas_user; - } - if ($uid) { - $params['uid'] = $uid; - } - if ($flid) { - $params['flid'] = $flid; - } - return $this->call_method('facebook.friends.get', $params); - - } - - /** - * Returns the mutual friends between the target uid and a source uid or - * the current session user. - * - * @param int $target_uid Target uid for which mutual friends will be found. - * @param int $source_uid (optional) Source uid for which mutual friends will - * be found. If no source_uid is specified, - * source_id will default to the session - * user. - * @return array An array of friend uids - */ - public function &friends_getMutualFriends($target_uid, $source_uid = null) { - return $this->call_method('facebook.friends.getMutualFriends', - array("target_uid" => $target_uid, - "source_uid" => $source_uid)); - } - - /** - * Returns the set of friend lists for the current session user. - * - * @return array An array of friend list objects - */ - public function &friends_getLists() { - return $this->call_method('facebook.friends.getLists'); - } - - /** - * Returns the friends of the session user, who are also users - * of the calling application. - * - * @return array An array of friends also using the app - */ - public function &friends_getAppUsers() { - return $this->call_method('facebook.friends.getAppUsers'); - } - - /** - * Returns groups according to the filters specified. - * - * @param int $uid (Optional) User associated with groups. A null - * parameter will default to the session user. - * @param array/string $gids (Optional) Array of group ids to query. A null - * parameter will get all groups for the user. - * (csv is deprecated) - * - * @return array An array of group objects - */ - public function &groups_get($uid, $gids) { - return $this->call_method('facebook.groups.get', - array('uid' => $uid, - 'gids' => $gids)); - } - - /** - * Returns the membership list of a group. - * - * @param int $gid Group id - * - * @return array An array with four membership lists, with keys 'members', - * 'admins', 'officers', and 'not_replied' - */ - public function &groups_getMembers($gid) { - return $this->call_method('facebook.groups.getMembers', - array('gid' => $gid)); - } - - /** - * Returns cookies according to the filters specified. - * - * @param int $uid User for which the cookies are needed. - * @param string $name (Optional) A null parameter will get all cookies - * for the user. - * - * @return array Cookies! Nom nom nom nom nom. - */ - public function data_getCookies($uid, $name) { - return $this->call_method('facebook.data.getCookies', - array('uid' => $uid, - 'name' => $name)); - } - - /** - * Sets cookies according to the params specified. - * - * @param int $uid User for which the cookies are needed. - * @param string $name Name of the cookie - * @param string $value (Optional) if expires specified and is in the past - * @param int $expires (Optional) Expiry time - * @param string $path (Optional) Url path to associate with (default is /) - * - * @return bool true on success - */ - public function data_setCookie($uid, $name, $value, $expires, $path) { - return $this->call_method('facebook.data.setCookie', - array('uid' => $uid, - 'name' => $name, - 'value' => $value, - 'expires' => $expires, - 'path' => $path)); - } - - /** - * Retrieves links posted by the given user. - * - * @param int $uid The user whose links you wish to retrieve - * @param int $limit The maximimum number of links to retrieve - * @param array $link_ids (Optional) Array of specific link - * IDs to retrieve by this user - * - * @return array An array of links. - */ - public function &links_get($uid, $limit, $link_ids = null) { - return $this->call_method('links.get', - array('uid' => $uid, - 'limit' => $limit, - 'link_ids' => $link_ids)); - } - - /** - * Posts a link on Facebook. - * - * @param string $url URL/link you wish to post - * @param string $comment (Optional) A comment about this link - * @param int $uid (Optional) User ID that is posting this link; - * defaults to current session user - * - * @return bool - */ - public function &links_post($url, $comment='', $uid = null) { - return $this->call_method('links.post', - array('uid' => $uid, - 'url' => $url, - 'comment' => $comment)); - } - - /** - * Permissions API - */ - - /** - * Checks API-access granted by self to the specified application. - * - * @param string $permissions_apikey Other application key - * - * @return array API methods/namespaces which are allowed access - */ - public function permissions_checkGrantedApiAccess($permissions_apikey) { - return $this->call_method('facebook.permissions.checkGrantedApiAccess', - array('permissions_apikey' => $permissions_apikey)); - } - - /** - * Checks API-access granted to self by the specified application. - * - * @param string $permissions_apikey Other application key - * - * @return array API methods/namespaces which are allowed access - */ - public function permissions_checkAvailableApiAccess($permissions_apikey) { - return $this->call_method('facebook.permissions.checkAvailableApiAccess', - array('permissions_apikey' => $permissions_apikey)); - } - - /** - * Grant API-access to the specified methods/namespaces to the specified - * application. - * - * @param string $permissions_apikey Other application key - * @param array(string) $method_arr (Optional) API methods/namespaces - * allowed - * - * @return array API methods/namespaces which are allowed access - */ - public function permissions_grantApiAccess($permissions_apikey, $method_arr) { - return $this->call_method('facebook.permissions.grantApiAccess', - array('permissions_apikey' => $permissions_apikey, - 'method_arr' => $method_arr)); - } - - /** - * Revoke API-access granted to the specified application. - * - * @param string $permissions_apikey Other application key - * - * @return bool true on success - */ - public function permissions_revokeApiAccess($permissions_apikey) { - return $this->call_method('facebook.permissions.revokeApiAccess', - array('permissions_apikey' => $permissions_apikey)); - } - - /** - * Payments Order API - */ - - /** - * Set Payments properties for an app. - * - * @param properties a map from property names to values - * @return true on success - */ - public function payments_setProperties($properties) { - return $this->call_method ('facebook.payments.setProperties', - array('properties' => json_encode($properties))); - } - - public function payments_getOrderDetails($order_id) { - return json_decode($this->call_method( - 'facebook.payments.getOrderDetails', - array('order_id' => $order_id)), true); - } - - public function payments_updateOrder($order_id, $status, - $params) { - return $this->call_method('facebook.payments.updateOrder', - array('order_id' => $order_id, - 'status' => $status, - 'params' => json_encode($params))); - } - - public function payments_getOrders($status, $start_time, - $end_time, $test_mode=false) { - return json_decode($this->call_method('facebook.payments.getOrders', - array('status' => $status, - 'start_time' => $start_time, - 'end_time' => $end_time, - 'test_mode' => $test_mode)), true); - } - - /** - * Gifts API - */ - - /** - * Get Gifts associated with an app - * - * @return array of gifts - */ - public function gifts_get() { - return json_decode( - $this->call_method('facebook.gifts.get', - array()), - true - ); - } - - /* - * Update gifts stored by an app - * - * @param array containing gift_id => gift_data to be updated - * @return array containing gift_id => true/false indicating success - * in updating that gift - */ - public function gifts_update($update_array) { - return json_decode( - $this->call_method('facebook.gifts.update', - array('update_str' => json_encode($update_array)) - ), - true - ); - } - - - /** - * Creates a note with the specified title and content. - * - * @param string $title Title of the note. - * @param string $content Content of the note. - * @param int $uid (Optional) The user for whom you are creating a - * note; defaults to current session user - * - * @return int The ID of the note that was just created. - */ - public function ¬es_create($title, $content, $uid = null) { - return $this->call_method('notes.create', - array('uid' => $uid, - 'title' => $title, - 'content' => $content)); - } - - /** - * Deletes the specified note. - * - * @param int $note_id ID of the note you wish to delete - * @param int $uid (Optional) Owner of the note you wish to delete; - * defaults to current session user - * - * @return bool - */ - public function ¬es_delete($note_id, $uid = null) { - return $this->call_method('notes.delete', - array('uid' => $uid, - 'note_id' => $note_id)); - } - - /** - * Edits a note, replacing its title and contents with the title - * and contents specified. - * - * @param int $note_id ID of the note you wish to edit - * @param string $title Replacement title for the note - * @param string $content Replacement content for the note - * @param int $uid (Optional) Owner of the note you wish to edit; - * defaults to current session user - * - * @return bool - */ - public function ¬es_edit($note_id, $title, $content, $uid = null) { - return $this->call_method('notes.edit', - array('uid' => $uid, - 'note_id' => $note_id, - 'title' => $title, - 'content' => $content)); - } - - /** - * Retrieves all notes by a user. If note_ids are specified, - * retrieves only those specific notes by that user. - * - * @param int $uid User whose notes you wish to retrieve - * @param array $note_ids (Optional) List of specific note - * IDs by this user to retrieve - * - * @return array A list of all of the given user's notes, or an empty list - * if the viewer lacks permissions or if there are no visible - * notes. - */ - public function ¬es_get($uid, $note_ids = null) { - return $this->call_method('notes.get', - array('uid' => $uid, - 'note_ids' => $note_ids)); - } - - - /** - * Returns the outstanding notifications for the session user. - * - * @return array An assoc array of notification count objects for - * 'messages', 'pokes' and 'shares', a uid list of - * 'friend_requests', a gid list of 'group_invites', - * and an eid list of 'event_invites' - */ - public function ¬ifications_get() { - return $this->call_method('facebook.notifications.get'); - } - - /** - * Sends a notification to the specified users. - * - * @return A comma separated list of successful recipients - * @error - * API_EC_PARAM_USER_ID_LIST - */ - public function ¬ifications_send($to_ids, $notification, $type) { - return $this->call_method('facebook.notifications.send', - array('to_ids' => $to_ids, - 'notification' => $notification, - 'type' => $type)); - } - - /** - * Sends an email to the specified user of the application. - * - * @param array/string $recipients array of ids of the recipients (csv is deprecated) - * @param string $subject subject of the email - * @param string $text (plain text) body of the email - * @param string $fbml fbml markup for an html version of the email - * - * @return string A comma separated list of successful recipients - * @error - * API_EC_PARAM_USER_ID_LIST - */ - public function ¬ifications_sendEmail($recipients, - $subject, - $text, - $fbml) { - return $this->call_method('facebook.notifications.sendEmail', - array('recipients' => $recipients, - 'subject' => $subject, - 'text' => $text, - 'fbml' => $fbml)); - } - - /** - * Returns the requested info fields for the requested set of pages. - * - * @param array/string $page_ids an array of page ids (csv is deprecated) - * @param array/string $fields an array of strings describing the - * info fields desired (csv is deprecated) - * @param int $uid (Optional) limit results to pages of which this - * user is a fan. - * @param string type limits results to a particular type of page. - * - * @return array An array of pages - */ - public function &pages_getInfo($page_ids, $fields, $uid, $type) { - return $this->call_method('facebook.pages.getInfo', - array('page_ids' => $page_ids, - 'fields' => $fields, - 'uid' => $uid, - 'type' => $type)); - } - - /** - * Returns true if the given user is an admin for the passed page. - * - * @param int $page_id target page id - * @param int $uid (Optional) user id (defaults to the logged-in user) - * - * @return bool true on success - */ - public function &pages_isAdmin($page_id, $uid = null) { - return $this->call_method('facebook.pages.isAdmin', - array('page_id' => $page_id, - 'uid' => $uid)); - } - - /** - * Returns whether or not the given page has added the application. - * - * @param int $page_id target page id - * - * @return bool true on success - */ - public function &pages_isAppAdded($page_id) { - return $this->call_method('facebook.pages.isAppAdded', - array('page_id' => $page_id)); - } - - /** - * Returns true if logged in user is a fan for the passed page. - * - * @param int $page_id target page id - * @param int $uid user to compare. If empty, the logged in user. - * - * @return bool true on success - */ - public function &pages_isFan($page_id, $uid = null) { - return $this->call_method('facebook.pages.isFan', - array('page_id' => $page_id, - 'uid' => $uid)); - } - - /** - * Adds a tag with the given information to a photo. See the wiki for details: - * - * http://wiki.developers.facebook.com/index.php/Photos.addTag - * - * @param int $pid The ID of the photo to be tagged - * @param int $tag_uid The ID of the user being tagged. You must specify - * either the $tag_uid or the $tag_text parameter - * (unless $tags is specified). - * @param string $tag_text Some text identifying the person being tagged. - * You must specify either the $tag_uid or $tag_text - * parameter (unless $tags is specified). - * @param float $x The horizontal position of the tag, as a - * percentage from 0 to 100, from the left of the - * photo. - * @param float $y The vertical position of the tag, as a percentage - * from 0 to 100, from the top of the photo. - * @param array $tags (Optional) An array of maps, where each map - * can contain the tag_uid, tag_text, x, and y - * parameters defined above. If specified, the - * individual arguments are ignored. - * @param int $owner_uid (Optional) The user ID of the user whose photo - * you are tagging. If this parameter is not - * specified, then it defaults to the session user. - * - * @return bool true on success - */ - public function &photos_addTag($pid, - $tag_uid, - $tag_text, - $x, - $y, - $tags, - $owner_uid=0) { - return $this->call_method('facebook.photos.addTag', - array('pid' => $pid, - 'tag_uid' => $tag_uid, - 'tag_text' => $tag_text, - 'x' => $x, - 'y' => $y, - 'tags' => (is_array($tags)) ? json_encode($tags) : null, - 'owner_uid' => $this->get_uid($owner_uid))); - } - - /** - * Creates and returns a new album owned by the specified user or the current - * session user. - * - * @param string $name The name of the album. - * @param string $description (Optional) A description of the album. - * @param string $location (Optional) A description of the location. - * @param string $visible (Optional) A privacy setting for the album. - * One of 'friends', 'friends-of-friends', - * 'networks', or 'everyone'. Default 'everyone'. - * @param int $uid (Optional) User id for creating the album; if - * not specified, the session user is used. - * - * @return array An album object - */ - public function &photos_createAlbum($name, - $description='', - $location='', - $visible='', - $uid=0) { - return $this->call_method('facebook.photos.createAlbum', - array('name' => $name, - 'description' => $description, - 'location' => $location, - 'visible' => $visible, - 'uid' => $this->get_uid($uid))); - } - - /** - * Returns photos according to the filters specified. - * - * @param int $subj_id (Optional) Filter by uid of user tagged in the photos. - * @param int $aid (Optional) Filter by an album, as returned by - * photos_getAlbums. - * @param array/string $pids (Optional) Restrict to an array of pids - * (csv is deprecated) - * - * Note that at least one of these parameters needs to be specified, or an - * error is returned. - * - * @return array An array of photo objects. - */ - public function &photos_get($subj_id, $aid, $pids) { - return $this->call_method('facebook.photos.get', - array('subj_id' => $subj_id, 'aid' => $aid, 'pids' => $pids)); - } - - /** - * Returns the albums created by the given user. - * - * @param int $uid (Optional) The uid of the user whose albums you want. - * A null will return the albums of the session user. - * @param string $aids (Optional) An array of aids to restrict - * the query. (csv is deprecated) - * - * Note that at least one of the (uid, aids) parameters must be specified. - * - * @returns an array of album objects. - */ - public function &photos_getAlbums($uid, $aids) { - return $this->call_method('facebook.photos.getAlbums', - array('uid' => $uid, - 'aids' => $aids)); - } - - /** - * Returns the tags on all photos specified. - * - * @param string $pids A list of pids to query - * - * @return array An array of photo tag objects, which include pid, - * subject uid, and two floating-point numbers (xcoord, ycoord) - * for tag pixel location. - */ - public function &photos_getTags($pids) { - return $this->call_method('facebook.photos.getTags', - array('pids' => $pids)); - } - - /** - * Uploads a photo. - * - * @param string $file The location of the photo on the local filesystem. - * @param int $aid (Optional) The album into which to upload the - * photo. - * @param string $caption (Optional) A caption for the photo. - * @param int uid (Optional) The user ID of the user whose photo you - * are uploading - * - * @return array An array of user objects - */ - public function photos_upload($file, $aid=null, $caption=null, $uid=null) { - return $this->call_upload_method('facebook.photos.upload', - array('aid' => $aid, - 'caption' => $caption, - 'uid' => $uid), - $file); - } - - - /** - * Uploads a video. - * - * @param string $file The location of the video on the local filesystem. - * @param string $title (Optional) A title for the video. Titles over 65 characters in length will be truncated. - * @param string $description (Optional) A description for the video. - * - * @return array An array with the video's ID, title, description, and a link to view it on Facebook. - */ - public function video_upload($file, $title=null, $description=null) { - return $this->call_upload_method('facebook.video.upload', - array('title' => $title, - 'description' => $description), - $file, - Facebook::get_facebook_url('api-video') . '/restserver.php'); - } - - /** - * Returns an array with the video limitations imposed on the current session's - * associated user. Maximum length is measured in seconds; maximum size is - * measured in bytes. - * - * @return array Array with "length" and "size" keys - */ - public function &video_getUploadLimits() { - return $this->call_method('facebook.video.getUploadLimits'); - } - - /** - * Returns the requested info fields for the requested set of users. - * - * @param array/string $uids An array of user ids (csv is deprecated) - * @param array/string $fields An array of info field names desired (csv is deprecated) - * - * @return array An array of user objects - */ - public function &users_getInfo($uids, $fields) { - return $this->call_method('facebook.users.getInfo', - array('uids' => $uids, - 'fields' => $fields)); - } - - /** - * Returns the requested info fields for the requested set of users. A - * session key must not be specified. Only data about users that have - * authorized your application will be returned. - * - * Check the wiki for fields that can be queried through this API call. - * Data returned from here should not be used for rendering to application - * users, use users.getInfo instead, so that proper privacy rules will be - * applied. - * - * @param array/string $uids An array of user ids (csv is deprecated) - * @param array/string $fields An array of info field names desired (csv is deprecated) - * - * @return array An array of user objects - */ - public function &users_getStandardInfo($uids, $fields) { - return $this->call_method('facebook.users.getStandardInfo', - array('uids' => $uids, - 'fields' => $fields)); - } - - /** - * Returns the user corresponding to the current session object. - * - * @return integer User id - */ - public function &users_getLoggedInUser() { - return $this->call_method('facebook.users.getLoggedInUser'); - } - - /** - * Returns 1 if the user has the specified permission, 0 otherwise. - * http://wiki.developers.facebook.com/index.php/Users.hasAppPermission - * - * @return integer 1 or 0 - */ - public function &users_hasAppPermission($ext_perm, $uid=null) { - return $this->call_method('facebook.users.hasAppPermission', - array('ext_perm' => $ext_perm, 'uid' => $uid)); - } - - /** - * Returns whether or not the user corresponding to the current - * session object has the give the app basic authorization. - * - * @return boolean true if the user has authorized the app - */ - public function &users_isAppUser($uid=null) { - if ($uid === null && isset($this->is_user)) { - return $this->is_user; - } - - return $this->call_method('facebook.users.isAppUser', array('uid' => $uid)); - } - - /** - * Returns whether or not the user corresponding to the current - * session object is verified by Facebook. See the documentation - * for Users.isVerified for details. - * - * @return boolean true if the user is verified - */ - public function &users_isVerified() { - return $this->call_method('facebook.users.isVerified'); - } - - /** - * Sets the users' current status message. Message does NOT contain the - * word "is" , so make sure to include a verb. - * - * Example: setStatus("is loving the API!") - * will produce the status "Luke is loving the API!" - * - * @param string $status text-only message to set - * @param int $uid user to set for (defaults to the - * logged-in user) - * @param bool $clear whether or not to clear the status, - * instead of setting it - * @param bool $status_includes_verb if true, the word "is" will *not* be - * prepended to the status message - * - * @return boolean - */ - public function &users_setStatus($status, - $uid = null, - $clear = false, - $status_includes_verb = true) { - $args = array( - 'status' => $status, - 'uid' => $uid, - 'clear' => $clear, - 'status_includes_verb' => $status_includes_verb, - ); - return $this->call_method('facebook.users.setStatus', $args); - } - - /** - * Gets the comments for a particular xid. This is essentially a wrapper - * around the comment FQL table. - * - * @param string $xid external id associated with the comments - * - * @return array of comment objects - */ - public function &comments_get($xid) { - $args = array('xid' => $xid); - return $this->call_method('facebook.comments.get', $args); - } - - /** - * Add a comment to a particular xid on behalf of a user. If called - * without an app_secret (with session secret), this will only work - * for the session user. - * - * @param string $xid external id associated with the comments - * @param string $text text of the comment - * @param int $uid user adding the comment (def: session user) - * @param string $title optional title for the stream story - * @param string $url optional url for the stream story - * @param bool $publish_to_stream publish a feed story about this comment? - * a link will be generated to title/url in the story - * - * @return string comment_id associated with the comment - */ - public function &comments_add($xid, $text, $uid=0, $title='', $url='', - $publish_to_stream=false) { - $args = array( - 'xid' => $xid, - 'uid' => $this->get_uid($uid), - 'text' => $text, - 'title' => $title, - 'url' => $url, - 'publish_to_stream' => $publish_to_stream); - - return $this->call_method('facebook.comments.add', $args); - } - - /** - * Remove a particular comment. - * - * @param string $xid the external id associated with the comments - * @param string $comment_id id of the comment to remove (returned by - * comments.add and comments.get) - * - * @return boolean - */ - public function &comments_remove($xid, $comment_id) { - $args = array( - 'xid' => $xid, - 'comment_id' => $comment_id); - return $this->call_method('facebook.comments.remove', $args); - } - - /** - * Gets the stream on behalf of a user using a set of users. This - * call will return the latest $limit queries between $start_time - * and $end_time. - * - * @param int $viewer_id user making the call (def: session) - * @param array $source_ids users/pages to look at (def: all connections) - * @param int $start_time start time to look for stories (def: 1 day ago) - * @param int $end_time end time to look for stories (def: now) - * @param int $limit number of stories to attempt to fetch (def: 30) - * @param string $filter_key key returned by stream.getFilters to fetch - * @param array $metadata metadata to include with the return, allows - * requested metadata to be returned, such as - * profiles, albums, photo_tags - * - * @return array( - * 'posts' => array of posts, - * // if requested, the following data may be returned - * 'profiles' => array of profile metadata of users/pages in posts - * 'albums' => array of album metadata in posts - * 'photo_tags' => array of photo_tags for photos in posts - * ) - */ - public function &stream_get($viewer_id = null, - $source_ids = null, - $start_time = 0, - $end_time = 0, - $limit = 30, - $filter_key = '', - $exportable_only = false, - $metadata = null, - $post_ids = null) { - $args = array( - 'viewer_id' => $viewer_id, - 'source_ids' => $source_ids, - 'start_time' => $start_time, - 'end_time' => $end_time, - 'limit' => $limit, - 'filter_key' => $filter_key, - 'exportable_only' => $exportable_only, - 'metadata' => $metadata, - 'post_ids' => $post_ids); - return $this->call_method('facebook.stream.get', $args); - } - - /** - * Gets the filters (with relevant filter keys for stream.get) for a - * particular user. These filters are typical things like news feed, - * friend lists, networks. They can be used to filter the stream - * without complex queries to determine which ids belong in which groups. - * - * @param int $uid user to get filters for - * - * @return array of stream filter objects - */ - public function &stream_getFilters($uid = null) { - $args = array('uid' => $uid); - return $this->call_method('facebook.stream.getFilters', $args); - } - - /** - * Gets the full comments given a post_id from stream.get or the - * stream FQL table. Initially, only a set of preview comments are - * returned because some posts can have many comments. - * - * @param string $post_id id of the post to get comments for - * - * @return array of comment objects - */ - public function &stream_getComments($post_id) { - $args = array('post_id' => $post_id); - return $this->call_method('facebook.stream.getComments', $args); - } - - /** - * Sets the FBML for the profile of the user attached to this session. - * - * @param string $markup The FBML that describes the profile - * presence of this app for the user - * @param int $uid The user - * @param string $profile Profile FBML - * @param string $profile_action Profile action FBML (deprecated) - * @param string $mobile_profile Mobile profile FBML - * @param string $profile_main Main Tab profile FBML - * - * @return array A list of strings describing any compile errors for the - * submitted FBML - */ - public function profile_setFBML($markup, - $uid=null, - $profile='', - $profile_action='', - $mobile_profile='', - $profile_main='') { - return $this->call_method('facebook.profile.setFBML', - array('markup' => $markup, - 'uid' => $uid, - 'profile' => $profile, - 'profile_action' => $profile_action, - 'mobile_profile' => $mobile_profile, - 'profile_main' => $profile_main)); - } - - /** - * Gets the FBML for the profile box that is currently set for a user's - * profile (your application set the FBML previously by calling the - * profile.setFBML method). - * - * @param int $uid (Optional) User id to lookup; defaults to session. - * @param int $type (Optional) 1 for original style, 2 for profile_main boxes - * - * @return string The FBML - */ - public function &profile_getFBML($uid=null, $type=null) { - return $this->call_method('facebook.profile.getFBML', - array('uid' => $uid, - 'type' => $type)); - } - - /** - * Returns the specified user's application info section for the calling - * application. These info sections have either been set via a previous - * profile.setInfo call or by the user editing them directly. - * - * @param int $uid (Optional) User id to lookup; defaults to session. - * - * @return array Info fields for the current user. See wiki for structure: - * - * http://wiki.developers.facebook.com/index.php/Profile.getInfo - * - */ - public function &profile_getInfo($uid=null) { - return $this->call_method('facebook.profile.getInfo', - array('uid' => $uid)); - } - - /** - * Returns the options associated with the specified info field for an - * application info section. - * - * @param string $field The title of the field - * - * @return array An array of info options. - */ - public function &profile_getInfoOptions($field) { - return $this->call_method('facebook.profile.getInfoOptions', - array('field' => $field)); - } - - /** - * Configures an application info section that the specified user can install - * on the Info tab of her profile. For details on the structure of an info - * field, please see: - * - * http://wiki.developers.facebook.com/index.php/Profile.setInfo - * - * @param string $title Title / header of the info section - * @param int $type 1 for text-only, 5 for thumbnail views - * @param array $info_fields An array of info fields. See wiki for details. - * @param int $uid (Optional) - * - * @return bool true on success - */ - public function &profile_setInfo($title, $type, $info_fields, $uid=null) { - return $this->call_method('facebook.profile.setInfo', - array('uid' => $uid, - 'type' => $type, - 'title' => $title, - 'info_fields' => json_encode($info_fields))); - } - - /** - * Specifies the objects for a field for an application info section. These - * options populate the typeahead for a thumbnail. - * - * @param string $field The title of the field - * @param array $options An array of items for a thumbnail, including - * 'label', 'link', and optionally 'image', - * 'description' and 'sublabel' - * - * @return bool true on success - */ - public function profile_setInfoOptions($field, $options) { - return $this->call_method('facebook.profile.setInfoOptions', - array('field' => $field, - 'options' => json_encode($options))); - } - - ///////////////////////////////////////////////////////////////////////////// - // Data Store API - - /** - * Set a user preference. - * - * @param pref_id preference identifier (0-200) - * @param value preferece's value - * @param uid the user id (defaults to current session user) - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - * API_EC_PERMISSION_OTHER_USER - */ - public function &data_setUserPreference($pref_id, $value, $uid = null) { - return $this->call_method('facebook.data.setUserPreference', - array('pref_id' => $pref_id, - 'value' => $value, - 'uid' => $this->get_uid($uid))); - } - - /** - * Set a user's all preferences for this application. - * - * @param values preferece values in an associative arrays - * @param replace whether to replace all existing preferences or - * merge into them. - * @param uid the user id (defaults to current session user) - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - * API_EC_PERMISSION_OTHER_USER - */ - public function &data_setUserPreferences($values, - $replace = false, - $uid = null) { - return $this->call_method('facebook.data.setUserPreferences', - array('values' => json_encode($values), - 'replace' => $replace, - 'uid' => $this->get_uid($uid))); - } - - /** - * Get a user preference. - * - * @param pref_id preference identifier (0-200) - * @param uid the user id (defaults to current session user) - * @return preference's value - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - * API_EC_PERMISSION_OTHER_USER - */ - public function &data_getUserPreference($pref_id, $uid = null) { - return $this->call_method('facebook.data.getUserPreference', - array('pref_id' => $pref_id, - 'uid' => $this->get_uid($uid))); - } - - /** - * Get a user preference. - * - * @param uid the user id (defaults to current session user) - * @return preference values - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - * API_EC_PERMISSION_OTHER_USER - */ - public function &data_getUserPreferences($uid = null) { - return $this->call_method('facebook.data.getUserPreferences', - array('uid' => $this->get_uid($uid))); - } - - /** - * Create a new object type. - * - * @param name object type's name - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_ALREADY_EXISTS - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_createObjectType($name) { - return $this->call_method('facebook.data.createObjectType', - array('name' => $name)); - } - - /** - * Delete an object type. - * - * @param obj_type object type's name - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_dropObjectType($obj_type) { - return $this->call_method('facebook.data.dropObjectType', - array('obj_type' => $obj_type)); - } - - /** - * Rename an object type. - * - * @param obj_type object type's name - * @param new_name new object type's name - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_DATA_OBJECT_ALREADY_EXISTS - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_renameObjectType($obj_type, $new_name) { - return $this->call_method('facebook.data.renameObjectType', - array('obj_type' => $obj_type, - 'new_name' => $new_name)); - } - - /** - * Add a new property to an object type. - * - * @param obj_type object type's name - * @param prop_name name of the property to add - * @param prop_type 1: integer; 2: string; 3: text blob - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_ALREADY_EXISTS - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_defineObjectProperty($obj_type, - $prop_name, - $prop_type) { - return $this->call_method('facebook.data.defineObjectProperty', - array('obj_type' => $obj_type, - 'prop_name' => $prop_name, - 'prop_type' => $prop_type)); - } - - /** - * Remove a previously defined property from an object type. - * - * @param obj_type object type's name - * @param prop_name name of the property to remove - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_undefineObjectProperty($obj_type, $prop_name) { - return $this->call_method('facebook.data.undefineObjectProperty', - array('obj_type' => $obj_type, - 'prop_name' => $prop_name)); - } - - /** - * Rename a previously defined property of an object type. - * - * @param obj_type object type's name - * @param prop_name name of the property to rename - * @param new_name new name to use - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_DATA_OBJECT_ALREADY_EXISTS - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_renameObjectProperty($obj_type, $prop_name, - $new_name) { - return $this->call_method('facebook.data.renameObjectProperty', - array('obj_type' => $obj_type, - 'prop_name' => $prop_name, - 'new_name' => $new_name)); - } - - /** - * Retrieve a list of all object types that have defined for the application. - * - * @return a list of object type names - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PERMISSION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_getObjectTypes() { - return $this->call_method('facebook.data.getObjectTypes'); - } - - /** - * Get definitions of all properties of an object type. - * - * @param obj_type object type's name - * @return pairs of property name and property types - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_getObjectType($obj_type) { - return $this->call_method('facebook.data.getObjectType', - array('obj_type' => $obj_type)); - } - - /** - * Create a new object. - * - * @param obj_type object type's name - * @param properties (optional) properties to set initially - * @return newly created object's id - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_createObject($obj_type, $properties = null) { - return $this->call_method('facebook.data.createObject', - array('obj_type' => $obj_type, - 'properties' => json_encode($properties))); - } - - /** - * Update an existing object. - * - * @param obj_id object's id - * @param properties new properties - * @param replace true for replacing existing properties; - * false for merging - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_updateObject($obj_id, $properties, $replace = false) { - return $this->call_method('facebook.data.updateObject', - array('obj_id' => $obj_id, - 'properties' => json_encode($properties), - 'replace' => $replace)); - } - - /** - * Delete an existing object. - * - * @param obj_id object's id - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_deleteObject($obj_id) { - return $this->call_method('facebook.data.deleteObject', - array('obj_id' => $obj_id)); - } - - /** - * Delete a list of objects. - * - * @param obj_ids objects to delete - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_deleteObjects($obj_ids) { - return $this->call_method('facebook.data.deleteObjects', - array('obj_ids' => json_encode($obj_ids))); - } - - /** - * Get a single property value of an object. - * - * @param obj_id object's id - * @param prop_name individual property's name - * @return individual property's value - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_getObjectProperty($obj_id, $prop_name) { - return $this->call_method('facebook.data.getObjectProperty', - array('obj_id' => $obj_id, - 'prop_name' => $prop_name)); - } - - /** - * Get properties of an object. - * - * @param obj_id object's id - * @param prop_names (optional) properties to return; null for all. - * @return specified properties of an object - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_getObject($obj_id, $prop_names = null) { - return $this->call_method('facebook.data.getObject', - array('obj_id' => $obj_id, - 'prop_names' => json_encode($prop_names))); - } - - /** - * Get properties of a list of objects. - * - * @param obj_ids object ids - * @param prop_names (optional) properties to return; null for all. - * @return specified properties of an object - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_getObjects($obj_ids, $prop_names = null) { - return $this->call_method('facebook.data.getObjects', - array('obj_ids' => json_encode($obj_ids), - 'prop_names' => json_encode($prop_names))); - } - - /** - * Set a single property value of an object. - * - * @param obj_id object's id - * @param prop_name individual property's name - * @param prop_value new value to set - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_setObjectProperty($obj_id, $prop_name, - $prop_value) { - return $this->call_method('facebook.data.setObjectProperty', - array('obj_id' => $obj_id, - 'prop_name' => $prop_name, - 'prop_value' => $prop_value)); - } - - /** - * Read hash value by key. - * - * @param obj_type object type's name - * @param key hash key - * @param prop_name (optional) individual property's name - * @return hash value - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_getHashValue($obj_type, $key, $prop_name = null) { - return $this->call_method('facebook.data.getHashValue', - array('obj_type' => $obj_type, - 'key' => $key, - 'prop_name' => $prop_name)); - } - - /** - * Write hash value by key. - * - * @param obj_type object type's name - * @param key hash key - * @param value hash value - * @param prop_name (optional) individual property's name - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_setHashValue($obj_type, - $key, - $value, - $prop_name = null) { - return $this->call_method('facebook.data.setHashValue', - array('obj_type' => $obj_type, - 'key' => $key, - 'value' => $value, - 'prop_name' => $prop_name)); - } - - /** - * Increase a hash value by specified increment atomically. - * - * @param obj_type object type's name - * @param key hash key - * @param prop_name individual property's name - * @param increment (optional) default is 1 - * @return incremented hash value - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_incHashValue($obj_type, - $key, - $prop_name, - $increment = 1) { - return $this->call_method('facebook.data.incHashValue', - array('obj_type' => $obj_type, - 'key' => $key, - 'prop_name' => $prop_name, - 'increment' => $increment)); - } - - /** - * Remove a hash key and its values. - * - * @param obj_type object type's name - * @param key hash key - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_removeHashKey($obj_type, $key) { - return $this->call_method('facebook.data.removeHashKey', - array('obj_type' => $obj_type, - 'key' => $key)); - } - - /** - * Remove hash keys and their values. - * - * @param obj_type object type's name - * @param keys hash keys - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_removeHashKeys($obj_type, $keys) { - return $this->call_method('facebook.data.removeHashKeys', - array('obj_type' => $obj_type, - 'keys' => json_encode($keys))); - } - - /** - * Define an object association. - * - * @param name name of this association - * @param assoc_type 1: one-way 2: two-way symmetric 3: two-way asymmetric - * @param assoc_info1 needed info about first object type - * @param assoc_info2 needed info about second object type - * @param inverse (optional) name of reverse association - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_ALREADY_EXISTS - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_defineAssociation($name, $assoc_type, $assoc_info1, - $assoc_info2, $inverse = null) { - return $this->call_method('facebook.data.defineAssociation', - array('name' => $name, - 'assoc_type' => $assoc_type, - 'assoc_info1' => json_encode($assoc_info1), - 'assoc_info2' => json_encode($assoc_info2), - 'inverse' => $inverse)); - } - - /** - * Undefine an object association. - * - * @param name name of this association - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_undefineAssociation($name) { - return $this->call_method('facebook.data.undefineAssociation', - array('name' => $name)); - } - - /** - * Rename an object association or aliases. - * - * @param name name of this association - * @param new_name (optional) new name of this association - * @param new_alias1 (optional) new alias for object type 1 - * @param new_alias2 (optional) new alias for object type 2 - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_ALREADY_EXISTS - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_renameAssociation($name, $new_name, $new_alias1 = null, - $new_alias2 = null) { - return $this->call_method('facebook.data.renameAssociation', - array('name' => $name, - 'new_name' => $new_name, - 'new_alias1' => $new_alias1, - 'new_alias2' => $new_alias2)); - } - - /** - * Get definition of an object association. - * - * @param name name of this association - * @return specified association - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_getAssociationDefinition($name) { - return $this->call_method('facebook.data.getAssociationDefinition', - array('name' => $name)); - } - - /** - * Get definition of all associations. - * - * @return all defined associations - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PERMISSION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_getAssociationDefinitions() { - return $this->call_method('facebook.data.getAssociationDefinitions', - array()); - } - - /** - * Create or modify an association between two objects. - * - * @param name name of association - * @param obj_id1 id of first object - * @param obj_id2 id of second object - * @param data (optional) extra string data to store - * @param assoc_time (optional) extra time data; default to creation time - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_setAssociation($name, $obj_id1, $obj_id2, $data = null, - $assoc_time = null) { - return $this->call_method('facebook.data.setAssociation', - array('name' => $name, - 'obj_id1' => $obj_id1, - 'obj_id2' => $obj_id2, - 'data' => $data, - 'assoc_time' => $assoc_time)); - } - - /** - * Create or modify associations between objects. - * - * @param assocs associations to set - * @param name (optional) name of association - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_setAssociations($assocs, $name = null) { - return $this->call_method('facebook.data.setAssociations', - array('assocs' => json_encode($assocs), - 'name' => $name)); - } - - /** - * Remove an association between two objects. - * - * @param name name of association - * @param obj_id1 id of first object - * @param obj_id2 id of second object - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_removeAssociation($name, $obj_id1, $obj_id2) { - return $this->call_method('facebook.data.removeAssociation', - array('name' => $name, - 'obj_id1' => $obj_id1, - 'obj_id2' => $obj_id2)); - } - - /** - * Remove associations between objects by specifying pairs of object ids. - * - * @param assocs associations to remove - * @param name (optional) name of association - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_removeAssociations($assocs, $name = null) { - return $this->call_method('facebook.data.removeAssociations', - array('assocs' => json_encode($assocs), - 'name' => $name)); - } - - /** - * Remove associations between objects by specifying one object id. - * - * @param name name of association - * @param obj_id who's association to remove - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_removeAssociatedObjects($name, $obj_id) { - return $this->call_method('facebook.data.removeAssociatedObjects', - array('name' => $name, - 'obj_id' => $obj_id)); - } - - /** - * Retrieve a list of associated objects. - * - * @param name name of association - * @param obj_id who's association to retrieve - * @param no_data only return object ids - * @return associated objects - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_getAssociatedObjects($name, $obj_id, $no_data = true) { - return $this->call_method('facebook.data.getAssociatedObjects', - array('name' => $name, - 'obj_id' => $obj_id, - 'no_data' => $no_data)); - } - - /** - * Count associated objects. - * - * @param name name of association - * @param obj_id who's association to retrieve - * @return associated object's count - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_getAssociatedObjectCount($name, $obj_id) { - return $this->call_method('facebook.data.getAssociatedObjectCount', - array('name' => $name, - 'obj_id' => $obj_id)); - } - - /** - * Get a list of associated object counts. - * - * @param name name of association - * @param obj_ids whose association to retrieve - * @return associated object counts - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_DATA_OBJECT_NOT_FOUND - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_INVALID_OPERATION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_getAssociatedObjectCounts($name, $obj_ids) { - return $this->call_method('facebook.data.getAssociatedObjectCounts', - array('name' => $name, - 'obj_ids' => json_encode($obj_ids))); - } - - /** - * Find all associations between two objects. - * - * @param obj_id1 id of first object - * @param obj_id2 id of second object - * @param no_data only return association names without data - * @return all associations between objects - * @error - * API_EC_DATA_DATABASE_ERROR - * API_EC_PARAM - * API_EC_PERMISSION - * API_EC_DATA_QUOTA_EXCEEDED - * API_EC_DATA_UNKNOWN_ERROR - */ - public function &data_getAssociations($obj_id1, $obj_id2, $no_data = true) { - return $this->call_method('facebook.data.getAssociations', - array('obj_id1' => $obj_id1, - 'obj_id2' => $obj_id2, - 'no_data' => $no_data)); - } - - /** - * Get the properties that you have set for an app. - * - * @param properties List of properties names to fetch - * - * @return array A map from property name to value - */ - public function admin_getAppProperties($properties) { - return json_decode( - $this->call_method('facebook.admin.getAppProperties', - array('properties' => json_encode($properties))), true); - } - - /** - * Set properties for an app. - * - * @param properties A map from property names to values - * - * @return bool true on success - */ - public function admin_setAppProperties($properties) { - return $this->call_method('facebook.admin.setAppProperties', - array('properties' => json_encode($properties))); - } - - /** - * Sets href and text for a Live Stream Box xid's via link - * - * @param string $xid xid of the Live Stream - * @param string $via_href Href for the via link - * @param string $via_text Text for the via link - * - * @return boolWhether the set was successful - */ - public function admin_setLiveStreamViaLink($xid, $via_href, $via_text) { - return $this->call_method('facebook.admin.setLiveStreamViaLink', - array('xid' => $xid, - 'via_href' => $via_href, - 'via_text' => $via_text)); - } - - /** - * Gets href and text for a Live Stream Box xid's via link - * - * @param string $xid xid of the Live Stream - * - * @return Array Associative array with keys 'via_href' and 'via_text' - * False if there was an error. - */ - public function admin_getLiveStreamViaLink($xid) { - return $this->call_method('facebook.admin.getLiveStreamViaLink', - array('xid' => $xid)); - } - - /** - * Returns the allocation limit value for a specified integration point name - * Integration point names are defined in lib/api/karma/constants.php in the - * limit_map. - * - * @param string $integration_point_name Name of an integration point - * (see developer wiki for list). - * @param int $uid Specific user to check the limit. - * - * @return int Integration point allocation value - */ - public function &admin_getAllocation($integration_point_name, $uid=null) { - return $this->call_method('facebook.admin.getAllocation', - array('integration_point_name' => $integration_point_name, - 'uid' => $uid)); - } - - /** - * Returns values for the specified metrics for the current application, in - * the given time range. The metrics are collected for fixed-length periods, - * and the times represent midnight at the end of each period. - * - * @param start_time unix time for the start of the range - * @param end_time unix time for the end of the range - * @param period number of seconds in the desired period - * @param metrics list of metrics to look up - * - * @return array A map of the names and values for those metrics - */ - public function &admin_getMetrics($start_time, $end_time, $period, $metrics) { - return $this->call_method('admin.getMetrics', - array('start_time' => $start_time, - 'end_time' => $end_time, - 'period' => $period, - 'metrics' => json_encode($metrics))); - } - - /** - * Sets application restriction info. - * - * Applications can restrict themselves to only a limited user demographic - * based on users' age and/or location or based on static predefined types - * specified by facebook for specifying diff age restriction for diff - * locations. - * - * @param array $restriction_info The age restriction settings to set. - * - * @return bool true on success - */ - public function admin_setRestrictionInfo($restriction_info = null) { - $restriction_str = null; - if (!empty($restriction_info)) { - $restriction_str = json_encode($restriction_info); - } - return $this->call_method('admin.setRestrictionInfo', - array('restriction_str' => $restriction_str)); - } - - /** - * Gets application restriction info. - * - * Applications can restrict themselves to only a limited user demographic - * based on users' age and/or location or based on static predefined types - * specified by facebook for specifying diff age restriction for diff - * locations. - * - * @return array The age restriction settings for this application. - */ - public function admin_getRestrictionInfo() { - return json_decode( - $this->call_method('admin.getRestrictionInfo'), - true); - } - - - /** - * Bans a list of users from the app. Banned users can't - * access the app's canvas page and forums. - * - * @param array $uids an array of user ids - * @return bool true on success - */ - public function admin_banUsers($uids) { - return $this->call_method( - 'admin.banUsers', array('uids' => json_encode($uids))); - } - - /** - * Unban users that have been previously banned with - * admin_banUsers(). - * - * @param array $uids an array of user ids - * @return bool true on success - */ - public function admin_unbanUsers($uids) { - return $this->call_method( - 'admin.unbanUsers', array('uids' => json_encode($uids))); - } - - /** - * Gets the list of users that have been banned from the application. - * $uids is an optional parameter that filters the result with the list - * of provided user ids. If $uids is provided, - * only banned user ids that are contained in $uids are returned. - * - * @param array $uids an array of user ids to filter by - * @return bool true on success - */ - - public function admin_getBannedUsers($uids = null) { - return $this->call_method( - 'admin.getBannedUsers', - array('uids' => $uids ? json_encode($uids) : null)); - } - - - /* UTILITY FUNCTIONS */ - - /** - * Calls the specified normal POST method with the specified parameters. - * - * @param string $method Name of the Facebook method to invoke - * @param array $params A map of param names => param values - * - * @return mixed Result of method call; this returns a reference to support - * 'delayed returns' when in a batch context. - * See: http://wiki.developers.facebook.com/index.php/Using_batching_API - */ - public function &call_method($method, $params = array()) { - if ($this->format) { - $params['format'] = $this->format; - } - if (!$this->pending_batch()) { - if ($this->call_as_apikey) { - $params['call_as_apikey'] = $this->call_as_apikey; - } - $data = $this->post_request($method, $params); - $this->rawData = $data; - $result = $this->convert_result($data, $method, $params); - if (is_array($result) && isset($result['error_code'])) { - throw new FacebookRestClientException($result['error_msg'], - $result['error_code']); - } - } - else { - $result = null; - $batch_item = array('m' => $method, 'p' => $params, 'r' => & $result); - $this->batch_queue[] = $batch_item; - } - - return $result; - } - - protected function convert_result($data, $method, $params) { - $is_xml = (empty($params['format']) || - strtolower($params['format']) != 'json'); - return ($is_xml) ? $this->convert_xml_to_result($data, $method, $params) - : json_decode($data, true); - } - - /** - * Change the response format - * - * @param string $format The response format (json, xml) - */ - public function setFormat($format) { - $this->format = $format; - return $this; - } - - /** - * get the current response serialization format - * - * @return string 'xml', 'json', or null (which means 'xml') - */ - public function getFormat() { - return $this->format; - } - - /** - * Returns the raw JSON or XML output returned by the server in the most - * recent API call. - * - * @return string - */ - public function getRawData() { - return $this->rawData; - } - - /** - * Calls the specified file-upload POST method with the specified parameters - * - * @param string $method Name of the Facebook method to invoke - * @param array $params A map of param names => param values - * @param string $file A path to the file to upload (required) - * - * @return array A dictionary representing the response. - */ - public function call_upload_method($method, $params, $file, $server_addr = null) { - if (!$this->pending_batch()) { - if (!file_exists($file)) { - $code = - FacebookAPIErrorCodes::API_EC_PARAM; - $description = FacebookAPIErrorCodes::$api_error_descriptions[$code]; - throw new FacebookRestClientException($description, $code); - } - - if ($this->format) { - $params['format'] = $this->format; - } - $data = $this->post_upload_request($method, - $params, - $file, - $server_addr); - $result = $this->convert_result($data, $method, $params); - - if (is_array($result) && isset($result['error_code'])) { - throw new FacebookRestClientException($result['error_msg'], - $result['error_code']); - } - } - else { - $code = - FacebookAPIErrorCodes::API_EC_BATCH_METHOD_NOT_ALLOWED_IN_BATCH_MODE; - $description = FacebookAPIErrorCodes::$api_error_descriptions[$code]; - throw new FacebookRestClientException($description, $code); - } - - return $result; - } - - protected function convert_xml_to_result($xml, $method, $params) { - $sxml = simplexml_load_string($xml); - $result = self::convert_simplexml_to_array($sxml); - - if (!empty($GLOBALS['facebook_config']['debug'])) { - // output the raw xml and its corresponding php object, for debugging: - print '
'; - $this->cur_id++; - print $this->cur_id . ': Called ' . $method . ', show ' . - 'Params | '. - 'XML | '. - 'SXML | '. - 'PHP'; - print ''; - print ''; - print ''; - print ''; - print '
'; - } - return $result; - } - - protected function finalize_params($method, $params) { - list($get, $post) = $this->add_standard_params($method, $params); - // we need to do this before signing the params - $this->convert_array_values_to_json($post); - $post['sig'] = Facebook::generate_sig(array_merge($get, $post), - $this->secret); - return array($get, $post); - } - - private function convert_array_values_to_json(&$params) { - foreach ($params as $key => &$val) { - if (is_array($val)) { - $val = json_encode($val); - } - } - } - - /** - * Add the generally required params to our request. - * Params method, api_key, and v should be sent over as get. - */ - private function add_standard_params($method, $params) { - $post = $params; - $get = array(); - if ($this->call_as_apikey) { - $get['call_as_apikey'] = $this->call_as_apikey; - } - if ($this->using_session_secret) { - $get['ss'] = '1'; - } - - $get['method'] = $method; - $get['session_key'] = $this->session_key; - $get['api_key'] = $this->api_key; - $post['call_id'] = microtime(true); - if ($post['call_id'] <= $this->last_call_id) { - $post['call_id'] = $this->last_call_id + 0.001; - } - $this->last_call_id = $post['call_id']; - if (isset($post['v'])) { - $get['v'] = $post['v']; - unset($post['v']); - } else { - $get['v'] = '1.0'; - } - if (isset($this->use_ssl_resources)) { - $post['return_ssl_resources'] = (bool) $this->use_ssl_resources; - } - return array($get, $post); - } - - private function create_url_string($params) { - $post_params = array(); - foreach ($params as $key => &$val) { - $post_params[] = $key.'='.urlencode($val); - } - return implode('&', $post_params); - } - - private function run_multipart_http_transaction($method, $params, $file, $server_addr) { - - // the format of this message is specified in RFC1867/RFC1341. - // we add twenty pseudo-random digits to the end of the boundary string. - $boundary = '--------------------------FbMuLtIpArT' . - sprintf("%010d", mt_rand()) . - sprintf("%010d", mt_rand()); - $content_type = 'multipart/form-data; boundary=' . $boundary; - // within the message, we prepend two extra hyphens. - $delimiter = '--' . $boundary; - $close_delimiter = $delimiter . '--'; - $content_lines = array(); - foreach ($params as $key => &$val) { - $content_lines[] = $delimiter; - $content_lines[] = 'Content-Disposition: form-data; name="' . $key . '"'; - $content_lines[] = ''; - $content_lines[] = $val; - } - // now add the file data - $content_lines[] = $delimiter; - $content_lines[] = - 'Content-Disposition: form-data; filename="' . $file . '"'; - $content_lines[] = 'Content-Type: application/octet-stream'; - $content_lines[] = ''; - $content_lines[] = file_get_contents($file); - $content_lines[] = $close_delimiter; - $content_lines[] = ''; - $content = implode("\r\n", $content_lines); - return $this->run_http_post_transaction($content_type, $content, $server_addr); - } - - public function post_request($method, $params) { - list($get, $post) = $this->finalize_params($method, $params); - $post_string = $this->create_url_string($post); - $get_string = $this->create_url_string($get); - $url_with_get = $this->server_addr . '?' . $get_string; - if ($this->use_curl_if_available && function_exists('curl_init')) { - $useragent = 'Facebook API PHP5 Client 1.1 (curl) ' . phpversion(); - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url_with_get); - curl_setopt($ch, CURLOPT_POSTFIELDS, $post_string); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_USERAGENT, $useragent); - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); - curl_setopt($ch, CURLOPT_TIMEOUT, 30); - $result = $this->curl_exec($ch); - curl_close($ch); - } else { - $content_type = 'application/x-www-form-urlencoded'; - $content = $post_string; - $result = $this->run_http_post_transaction($content_type, - $content, - $url_with_get); - } - return $result; - } - - /** - * execute a curl transaction -- this exists mostly so subclasses can add - * extra options and/or process the response, if they wish. - * - * @param resource $ch a curl handle - */ - protected function curl_exec($ch) { - $result = curl_exec($ch); - return $result; - } - - protected function post_upload_request($method, $params, $file, $server_addr = null) { - $server_addr = $server_addr ? $server_addr : $this->server_addr; - list($get, $post) = $this->finalize_params($method, $params); - $get_string = $this->create_url_string($get); - $url_with_get = $server_addr . '?' . $get_string; - if ($this->use_curl_if_available && function_exists('curl_init')) { - // prepending '@' causes cURL to upload the file; the key is ignored. - $post['_file'] = '@' . $file; - $useragent = 'Facebook API PHP5 Client 1.1 (curl) ' . phpversion(); - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url_with_get); - // this has to come before the POSTFIELDS set! - curl_setopt($ch, CURLOPT_POST, 1); - // passing an array gets curl to use the multipart/form-data content type - curl_setopt($ch, CURLOPT_POSTFIELDS, $post); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_USERAGENT, $useragent); - $result = $this->curl_exec($ch); - curl_close($ch); - } else { - $result = $this->run_multipart_http_transaction($method, $post, - $file, $url_with_get); - } - return $result; - } - - private function run_http_post_transaction($content_type, $content, $server_addr) { - - $user_agent = 'Facebook API PHP5 Client 1.1 (non-curl) ' . phpversion(); - $content_length = strlen($content); - $context = - array('http' => - array('method' => 'POST', - 'user_agent' => $user_agent, - 'header' => 'Content-Type: ' . $content_type . "\r\n" . - 'Content-Length: ' . $content_length, - 'content' => $content)); - $context_id = stream_context_create($context); - $sock = fopen($server_addr, 'r', false, $context_id); - - $result = ''; - if ($sock) { - while (!feof($sock)) { - $result .= fgets($sock, 4096); - } - fclose($sock); - } - return $result; - } - - public static function convert_simplexml_to_array($sxml) { - $arr = array(); - if ($sxml) { - foreach ($sxml as $k => $v) { - if ($sxml['list']) { - $arr[] = self::convert_simplexml_to_array($v); - } else { - $arr[$k] = self::convert_simplexml_to_array($v); - } - } - } - if (sizeof($arr) > 0) { - return $arr; - } else { - return (string)$sxml; - } - } - - protected function get_uid($uid) { - return $uid ? $uid : $this->user; - } -} - - -class FacebookRestClientException extends Exception { -} - -// Supporting methods and values------ - -/** - * Error codes and descriptions for the Facebook API. - */ - -class FacebookAPIErrorCodes { - - const API_EC_SUCCESS = 0; - - /* - * GENERAL ERRORS - */ - const API_EC_UNKNOWN = 1; - const API_EC_SERVICE = 2; - const API_EC_METHOD = 3; - const API_EC_TOO_MANY_CALLS = 4; - const API_EC_BAD_IP = 5; - const API_EC_HOST_API = 6; - const API_EC_HOST_UP = 7; - const API_EC_SECURE = 8; - const API_EC_RATE = 9; - const API_EC_PERMISSION_DENIED = 10; - const API_EC_DEPRECATED = 11; - const API_EC_VERSION = 12; - const API_EC_INTERNAL_FQL_ERROR = 13; - const API_EC_HOST_PUP = 14; - const API_EC_SESSION_SECRET_NOT_ALLOWED = 15; - const API_EC_HOST_READONLY = 16; - - /* - * PARAMETER ERRORS - */ - const API_EC_PARAM = 100; - const API_EC_PARAM_API_KEY = 101; - const API_EC_PARAM_SESSION_KEY = 102; - const API_EC_PARAM_CALL_ID = 103; - const API_EC_PARAM_SIGNATURE = 104; - const API_EC_PARAM_TOO_MANY = 105; - const API_EC_PARAM_USER_ID = 110; - const API_EC_PARAM_USER_FIELD = 111; - const API_EC_PARAM_SOCIAL_FIELD = 112; - const API_EC_PARAM_EMAIL = 113; - const API_EC_PARAM_USER_ID_LIST = 114; - const API_EC_PARAM_FIELD_LIST = 115; - const API_EC_PARAM_ALBUM_ID = 120; - const API_EC_PARAM_PHOTO_ID = 121; - const API_EC_PARAM_FEED_PRIORITY = 130; - const API_EC_PARAM_CATEGORY = 140; - const API_EC_PARAM_SUBCATEGORY = 141; - const API_EC_PARAM_TITLE = 142; - const API_EC_PARAM_DESCRIPTION = 143; - const API_EC_PARAM_BAD_JSON = 144; - const API_EC_PARAM_BAD_EID = 150; - const API_EC_PARAM_UNKNOWN_CITY = 151; - const API_EC_PARAM_BAD_PAGE_TYPE = 152; - const API_EC_PARAM_BAD_LOCALE = 170; - const API_EC_PARAM_BLOCKED_NOTIFICATION = 180; - - /* - * USER PERMISSIONS ERRORS - */ - const API_EC_PERMISSION = 200; - const API_EC_PERMISSION_USER = 210; - const API_EC_PERMISSION_NO_DEVELOPERS = 211; - const API_EC_PERMISSION_OFFLINE_ACCESS = 212; - const API_EC_PERMISSION_ALBUM = 220; - const API_EC_PERMISSION_PHOTO = 221; - const API_EC_PERMISSION_MESSAGE = 230; - const API_EC_PERMISSION_OTHER_USER = 240; - const API_EC_PERMISSION_STATUS_UPDATE = 250; - const API_EC_PERMISSION_PHOTO_UPLOAD = 260; - const API_EC_PERMISSION_VIDEO_UPLOAD = 261; - const API_EC_PERMISSION_SMS = 270; - const API_EC_PERMISSION_CREATE_LISTING = 280; - const API_EC_PERMISSION_CREATE_NOTE = 281; - const API_EC_PERMISSION_SHARE_ITEM = 282; - const API_EC_PERMISSION_EVENT = 290; - const API_EC_PERMISSION_LARGE_FBML_TEMPLATE = 291; - const API_EC_PERMISSION_LIVEMESSAGE = 292; - const API_EC_PERMISSION_CREATE_EVENT = 296; - const API_EC_PERMISSION_RSVP_EVENT = 299; - - /* - * DATA EDIT ERRORS - */ - const API_EC_EDIT = 300; - const API_EC_EDIT_USER_DATA = 310; - const API_EC_EDIT_PHOTO = 320; - const API_EC_EDIT_ALBUM_SIZE = 321; - const API_EC_EDIT_PHOTO_TAG_SUBJECT = 322; - const API_EC_EDIT_PHOTO_TAG_PHOTO = 323; - const API_EC_EDIT_PHOTO_FILE = 324; - const API_EC_EDIT_PHOTO_PENDING_LIMIT = 325; - const API_EC_EDIT_PHOTO_TAG_LIMIT = 326; - const API_EC_EDIT_ALBUM_REORDER_PHOTO_NOT_IN_ALBUM = 327; - const API_EC_EDIT_ALBUM_REORDER_TOO_FEW_PHOTOS = 328; - - const API_EC_MALFORMED_MARKUP = 329; - const API_EC_EDIT_MARKUP = 330; - - const API_EC_EDIT_FEED_TOO_MANY_USER_CALLS = 340; - const API_EC_EDIT_FEED_TOO_MANY_USER_ACTION_CALLS = 341; - const API_EC_EDIT_FEED_TITLE_LINK = 342; - const API_EC_EDIT_FEED_TITLE_LENGTH = 343; - const API_EC_EDIT_FEED_TITLE_NAME = 344; - const API_EC_EDIT_FEED_TITLE_BLANK = 345; - const API_EC_EDIT_FEED_BODY_LENGTH = 346; - const API_EC_EDIT_FEED_PHOTO_SRC = 347; - const API_EC_EDIT_FEED_PHOTO_LINK = 348; - - const API_EC_EDIT_VIDEO_SIZE = 350; - const API_EC_EDIT_VIDEO_INVALID_FILE = 351; - const API_EC_EDIT_VIDEO_INVALID_TYPE = 352; - const API_EC_EDIT_VIDEO_FILE = 353; - - const API_EC_EDIT_FEED_TITLE_ARRAY = 360; - const API_EC_EDIT_FEED_TITLE_PARAMS = 361; - const API_EC_EDIT_FEED_BODY_ARRAY = 362; - const API_EC_EDIT_FEED_BODY_PARAMS = 363; - const API_EC_EDIT_FEED_PHOTO = 364; - const API_EC_EDIT_FEED_TEMPLATE = 365; - const API_EC_EDIT_FEED_TARGET = 366; - const API_EC_EDIT_FEED_MARKUP = 367; - - /** - * SESSION ERRORS - */ - const API_EC_SESSION_TIMED_OUT = 450; - const API_EC_SESSION_METHOD = 451; - const API_EC_SESSION_INVALID = 452; - const API_EC_SESSION_REQUIRED = 453; - const API_EC_SESSION_REQUIRED_FOR_SECRET = 454; - const API_EC_SESSION_CANNOT_USE_SESSION_SECRET = 455; - - - /** - * FQL ERRORS - */ - const FQL_EC_UNKNOWN_ERROR = 600; - const FQL_EC_PARSER = 601; // backwards compatibility - const FQL_EC_PARSER_ERROR = 601; - const FQL_EC_UNKNOWN_FIELD = 602; - const FQL_EC_UNKNOWN_TABLE = 603; - const FQL_EC_NOT_INDEXABLE = 604; // backwards compatibility - const FQL_EC_NO_INDEX = 604; - const FQL_EC_UNKNOWN_FUNCTION = 605; - const FQL_EC_INVALID_PARAM = 606; - const FQL_EC_INVALID_FIELD = 607; - const FQL_EC_INVALID_SESSION = 608; - const FQL_EC_UNSUPPORTED_APP_TYPE = 609; - const FQL_EC_SESSION_SECRET_NOT_ALLOWED = 610; - const FQL_EC_DEPRECATED_TABLE = 611; - const FQL_EC_EXTENDED_PERMISSION = 612; - const FQL_EC_RATE_LIMIT_EXCEEDED = 613; - const FQL_EC_UNRESOLVED_DEPENDENCY = 614; - const FQL_EC_INVALID_SEARCH = 615; - const FQL_EC_CONTAINS_ERROR = 616; - - const API_EC_REF_SET_FAILED = 700; - - /** - * DATA STORE API ERRORS - */ - const API_EC_DATA_UNKNOWN_ERROR = 800; - const API_EC_DATA_INVALID_OPERATION = 801; - const API_EC_DATA_QUOTA_EXCEEDED = 802; - const API_EC_DATA_OBJECT_NOT_FOUND = 803; - const API_EC_DATA_OBJECT_ALREADY_EXISTS = 804; - const API_EC_DATA_DATABASE_ERROR = 805; - const API_EC_DATA_CREATE_TEMPLATE_ERROR = 806; - const API_EC_DATA_TEMPLATE_EXISTS_ERROR = 807; - const API_EC_DATA_TEMPLATE_HANDLE_TOO_LONG = 808; - const API_EC_DATA_TEMPLATE_HANDLE_ALREADY_IN_USE = 809; - const API_EC_DATA_TOO_MANY_TEMPLATE_BUNDLES = 810; - const API_EC_DATA_MALFORMED_ACTION_LINK = 811; - const API_EC_DATA_TEMPLATE_USES_RESERVED_TOKEN = 812; - - /* - * APPLICATION INFO ERRORS - */ - const API_EC_NO_SUCH_APP = 900; - - /* - * BATCH ERRORS - */ - const API_EC_BATCH_TOO_MANY_ITEMS = 950; - const API_EC_BATCH_ALREADY_STARTED = 951; - const API_EC_BATCH_NOT_STARTED = 952; - const API_EC_BATCH_METHOD_NOT_ALLOWED_IN_BATCH_MODE = 953; - - /* - * EVENT API ERRORS - */ - const API_EC_EVENT_INVALID_TIME = 1000; - const API_EC_EVENT_NAME_LOCKED = 1001; - - /* - * INFO BOX ERRORS - */ - const API_EC_INFO_NO_INFORMATION = 1050; - const API_EC_INFO_SET_FAILED = 1051; - - /* - * LIVEMESSAGE API ERRORS - */ - const API_EC_LIVEMESSAGE_SEND_FAILED = 1100; - const API_EC_LIVEMESSAGE_EVENT_NAME_TOO_LONG = 1101; - const API_EC_LIVEMESSAGE_MESSAGE_TOO_LONG = 1102; - - /* - * PAYMENTS API ERRORS - */ - const API_EC_PAYMENTS_UNKNOWN = 1150; - const API_EC_PAYMENTS_APP_INVALID = 1151; - const API_EC_PAYMENTS_DATABASE = 1152; - const API_EC_PAYMENTS_PERMISSION_DENIED = 1153; - const API_EC_PAYMENTS_APP_NO_RESPONSE = 1154; - const API_EC_PAYMENTS_APP_ERROR_RESPONSE = 1155; - const API_EC_PAYMENTS_INVALID_ORDER = 1156; - const API_EC_PAYMENTS_INVALID_PARAM = 1157; - const API_EC_PAYMENTS_INVALID_OPERATION = 1158; - const API_EC_PAYMENTS_PAYMENT_FAILED = 1159; - const API_EC_PAYMENTS_DISABLED = 1160; - - /* - * CONNECT SESSION ERRORS - */ - const API_EC_CONNECT_FEED_DISABLED = 1300; - - /* - * Platform tag bundles errors - */ - const API_EC_TAG_BUNDLE_QUOTA = 1400; - - /* - * SHARE - */ - const API_EC_SHARE_BAD_URL = 1500; - - /* - * NOTES - */ - const API_EC_NOTE_CANNOT_MODIFY = 1600; - - /* - * COMMENTS - */ - const API_EC_COMMENTS_UNKNOWN = 1700; - const API_EC_COMMENTS_POST_TOO_LONG = 1701; - const API_EC_COMMENTS_DB_DOWN = 1702; - const API_EC_COMMENTS_INVALID_XID = 1703; - const API_EC_COMMENTS_INVALID_UID = 1704; - const API_EC_COMMENTS_INVALID_POST = 1705; - const API_EC_COMMENTS_INVALID_REMOVE = 1706; - - /* - * GIFTS - */ - const API_EC_GIFTS_UNKNOWN = 1900; - - /* - * APPLICATION MORATORIUM ERRORS - */ - const API_EC_DISABLED_ALL = 2000; - const API_EC_DISABLED_STATUS = 2001; - const API_EC_DISABLED_FEED_STORIES = 2002; - const API_EC_DISABLED_NOTIFICATIONS = 2003; - const API_EC_DISABLED_REQUESTS = 2004; - const API_EC_DISABLED_EMAIL = 2005; - - /** - * This array is no longer maintained; to view the description of an error - * code, please look at the message element of the API response or visit - * the developer wiki at http://wiki.developers.facebook.com/. - */ - public static $api_error_descriptions = array( - self::API_EC_SUCCESS => 'Success', - self::API_EC_UNKNOWN => 'An unknown error occurred', - self::API_EC_SERVICE => 'Service temporarily unavailable', - self::API_EC_METHOD => 'Unknown method', - self::API_EC_TOO_MANY_CALLS => 'Application request limit reached', - self::API_EC_BAD_IP => 'Unauthorized source IP address', - self::API_EC_PARAM => 'Invalid parameter', - self::API_EC_PARAM_API_KEY => 'Invalid API key', - self::API_EC_PARAM_SESSION_KEY => 'Session key invalid or no longer valid', - self::API_EC_PARAM_CALL_ID => 'Call_id must be greater than previous', - self::API_EC_PARAM_SIGNATURE => 'Incorrect signature', - self::API_EC_PARAM_USER_ID => 'Invalid user id', - self::API_EC_PARAM_USER_FIELD => 'Invalid user info field', - self::API_EC_PARAM_SOCIAL_FIELD => 'Invalid user field', - self::API_EC_PARAM_USER_ID_LIST => 'Invalid user id list', - self::API_EC_PARAM_FIELD_LIST => 'Invalid field list', - self::API_EC_PARAM_ALBUM_ID => 'Invalid album id', - self::API_EC_PARAM_BAD_EID => 'Invalid eid', - self::API_EC_PARAM_UNKNOWN_CITY => 'Unknown city', - self::API_EC_PERMISSION => 'Permissions error', - self::API_EC_PERMISSION_USER => 'User not visible', - self::API_EC_PERMISSION_NO_DEVELOPERS => 'Application has no developers', - self::API_EC_PERMISSION_ALBUM => 'Album not visible', - self::API_EC_PERMISSION_PHOTO => 'Photo not visible', - self::API_EC_PERMISSION_EVENT => 'Creating and modifying events required the extended permission create_event', - self::API_EC_PERMISSION_RSVP_EVENT => 'RSVPing to events required the extended permission rsvp_event', - self::API_EC_EDIT_ALBUM_SIZE => 'Album is full', - self::FQL_EC_PARSER => 'FQL: Parser Error', - self::FQL_EC_UNKNOWN_FIELD => 'FQL: Unknown Field', - self::FQL_EC_UNKNOWN_TABLE => 'FQL: Unknown Table', - self::FQL_EC_NOT_INDEXABLE => 'FQL: Statement not indexable', - self::FQL_EC_UNKNOWN_FUNCTION => 'FQL: Attempted to call unknown function', - self::FQL_EC_INVALID_PARAM => 'FQL: Invalid parameter passed in', - self::API_EC_DATA_UNKNOWN_ERROR => 'Unknown data store API error', - self::API_EC_DATA_INVALID_OPERATION => 'Invalid operation', - self::API_EC_DATA_QUOTA_EXCEEDED => 'Data store allowable quota was exceeded', - self::API_EC_DATA_OBJECT_NOT_FOUND => 'Specified object cannot be found', - self::API_EC_DATA_OBJECT_ALREADY_EXISTS => 'Specified object already exists', - self::API_EC_DATA_DATABASE_ERROR => 'A database error occurred. Please try again', - self::API_EC_BATCH_ALREADY_STARTED => 'begin_batch already called, please make sure to call end_batch first', - self::API_EC_BATCH_NOT_STARTED => 'end_batch called before begin_batch', - self::API_EC_BATCH_METHOD_NOT_ALLOWED_IN_BATCH_MODE => 'This method is not allowed in batch mode' - ); -} diff --git a/plugins/Facebook/facebook/jsonwrapper/JSON/JSON.php b/plugins/Facebook/facebook/jsonwrapper/JSON/JSON.php deleted file mode 100644 index 0cddbddb41..0000000000 --- a/plugins/Facebook/facebook/jsonwrapper/JSON/JSON.php +++ /dev/null @@ -1,806 +0,0 @@ - - * @author Matt Knapp - * @author Brett Stimmerman - * @copyright 2005 Michal Migurski - * @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $ - * @license http://www.opensource.org/licenses/bsd-license.php - * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198 - */ - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_SLICE', 1); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_STR', 2); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_ARR', 3); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_OBJ', 4); - -/** - * Marker constant for Services_JSON::decode(), used to flag stack state - */ -define('SERVICES_JSON_IN_CMT', 5); - -/** - * Behavior switch for Services_JSON::decode() - */ -define('SERVICES_JSON_LOOSE_TYPE', 16); - -/** - * Behavior switch for Services_JSON::decode() - */ -define('SERVICES_JSON_SUPPRESS_ERRORS', 32); - -/** - * Converts to and from JSON format. - * - * Brief example of use: - * - * - * // create a new instance of Services_JSON - * $json = new Services_JSON(); - * - * // convert a complexe value to JSON notation, and send it to the browser - * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4))); - * $output = $json->encode($value); - * - * print($output); - * // prints: ["foo","bar",[1,2,"baz"],[3,[4]]] - * - * // accept incoming POST data, assumed to be in JSON notation - * $input = file_get_contents('php://input', 1000000); - * $value = $json->decode($input); - * - */ -class Services_JSON -{ - /** - * constructs a new JSON instance - * - * @param int $use object behavior flags; combine with boolean-OR - * - * possible values: - * - SERVICES_JSON_LOOSE_TYPE: loose typing. - * "{...}" syntax creates associative arrays - * instead of objects in decode(). - * - SERVICES_JSON_SUPPRESS_ERRORS: error suppression. - * Values which can't be encoded (e.g. resources) - * appear as NULL instead of throwing errors. - * By default, a deeply-nested resource will - * bubble up with an error, so all return values - * from encode() should be checked with isError() - */ - function Services_JSON($use = 0) - { - $this->use = $use; - } - - /** - * convert a string from one UTF-16 char to one UTF-8 char - * - * Normally should be handled by mb_convert_encoding, but - * provides a slower PHP-only method for installations - * that lack the multibye string extension. - * - * @param string $utf16 UTF-16 character - * @return string UTF-8 character - * @access private - */ - function utf162utf8($utf16) - { - // oh please oh please oh please oh please oh please - if(function_exists('mb_convert_encoding')) { - return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); - } - - $bytes = (ord($utf16{0}) << 8) | ord($utf16{1}); - - switch(true) { - case ((0x7F & $bytes) == $bytes): - // this case should never be reached, because we are in ASCII range - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0x7F & $bytes); - - case (0x07FF & $bytes) == $bytes: - // return a 2-byte UTF-8 character - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0xC0 | (($bytes >> 6) & 0x1F)) - . chr(0x80 | ($bytes & 0x3F)); - - case (0xFFFF & $bytes) == $bytes: - // return a 3-byte UTF-8 character - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0xE0 | (($bytes >> 12) & 0x0F)) - . chr(0x80 | (($bytes >> 6) & 0x3F)) - . chr(0x80 | ($bytes & 0x3F)); - } - - // ignoring UTF-32 for now, sorry - return ''; - } - - /** - * convert a string from one UTF-8 char to one UTF-16 char - * - * Normally should be handled by mb_convert_encoding, but - * provides a slower PHP-only method for installations - * that lack the multibye string extension. - * - * @param string $utf8 UTF-8 character - * @return string UTF-16 character - * @access private - */ - function utf82utf16($utf8) - { - // oh please oh please oh please oh please oh please - if(function_exists('mb_convert_encoding')) { - return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8'); - } - - switch(strlen($utf8)) { - case 1: - // this case should never be reached, because we are in ASCII range - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return $utf8; - - case 2: - // return a UTF-16 character from a 2-byte UTF-8 char - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr(0x07 & (ord($utf8{0}) >> 2)) - . chr((0xC0 & (ord($utf8{0}) << 6)) - | (0x3F & ord($utf8{1}))); - - case 3: - // return a UTF-16 character from a 3-byte UTF-8 char - // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - return chr((0xF0 & (ord($utf8{0}) << 4)) - | (0x0F & (ord($utf8{1}) >> 2))) - . chr((0xC0 & (ord($utf8{1}) << 6)) - | (0x7F & ord($utf8{2}))); - } - - // ignoring UTF-32 for now, sorry - return ''; - } - - /** - * encodes an arbitrary variable into JSON format - * - * @param mixed $var any number, boolean, string, array, or object to be encoded. - * see argument 1 to Services_JSON() above for array-parsing behavior. - * if var is a strng, note that encode() always expects it - * to be in ASCII or UTF-8 format! - * - * @return mixed JSON string representation of input var or an error if a problem occurs - * @access public - */ - function encode($var) - { - switch (gettype($var)) { - case 'boolean': - return $var ? 'true' : 'false'; - - case 'NULL': - return 'null'; - - case 'integer': - return (int) $var; - - case 'double': - case 'float': - return (float) $var; - - case 'string': - // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT - $ascii = ''; - $strlen_var = strlen($var); - - /* - * Iterate over every character in the string, - * escaping with a slash or encoding to UTF-8 where necessary - */ - for ($c = 0; $c < $strlen_var; ++$c) { - - $ord_var_c = ord($var{$c}); - - switch (true) { - case $ord_var_c == 0x08: - $ascii .= '\b'; - break; - case $ord_var_c == 0x09: - $ascii .= '\t'; - break; - case $ord_var_c == 0x0A: - $ascii .= '\n'; - break; - case $ord_var_c == 0x0C: - $ascii .= '\f'; - break; - case $ord_var_c == 0x0D: - $ascii .= '\r'; - break; - - case $ord_var_c == 0x22: - case $ord_var_c == 0x2F: - case $ord_var_c == 0x5C: - // double quote, slash, slosh - $ascii .= '\\'.$var{$c}; - break; - - case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)): - // characters U-00000000 - U-0000007F (same as ASCII) - $ascii .= $var{$c}; - break; - - case (($ord_var_c & 0xE0) == 0xC0): - // characters U-00000080 - U-000007FF, mask 110XXXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, ord($var{$c + 1})); - $c += 1; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xF0) == 0xE0): - // characters U-00000800 - U-0000FFFF, mask 1110XXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2})); - $c += 2; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xF8) == 0xF0): - // characters U-00010000 - U-001FFFFF, mask 11110XXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3})); - $c += 3; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xFC) == 0xF8): - // characters U-00200000 - U-03FFFFFF, mask 111110XX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3}), - ord($var{$c + 4})); - $c += 4; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - - case (($ord_var_c & 0xFE) == 0xFC): - // characters U-04000000 - U-7FFFFFFF, mask 1111110X - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $char = pack('C*', $ord_var_c, - ord($var{$c + 1}), - ord($var{$c + 2}), - ord($var{$c + 3}), - ord($var{$c + 4}), - ord($var{$c + 5})); - $c += 5; - $utf16 = $this->utf82utf16($char); - $ascii .= sprintf('\u%04s', bin2hex($utf16)); - break; - } - } - - return '"'.$ascii.'"'; - - case 'array': - /* - * As per JSON spec if any array key is not an integer - * we must treat the the whole array as an object. We - * also try to catch a sparsely populated associative - * array with numeric keys here because some JS engines - * will create an array with empty indexes up to - * max_index which can cause memory issues and because - * the keys, which may be relevant, will be remapped - * otherwise. - * - * As per the ECMA and JSON specification an object may - * have any string as a property. Unfortunately due to - * a hole in the ECMA specification if the key is a - * ECMA reserved word or starts with a digit the - * parameter is only accessible using ECMAScript's - * bracket notation. - */ - - // treat as a JSON object - if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) { - $properties = array_map(array($this, 'name_value'), - array_keys($var), - array_values($var)); - - foreach($properties as $property) { - if(Services_JSON::isError($property)) { - return $property; - } - } - - return '{' . join(',', $properties) . '}'; - } - - // treat it like a regular array - $elements = array_map(array($this, 'encode'), $var); - - foreach($elements as $element) { - if(Services_JSON::isError($element)) { - return $element; - } - } - - return '[' . join(',', $elements) . ']'; - - case 'object': - $vars = get_object_vars($var); - - $properties = array_map(array($this, 'name_value'), - array_keys($vars), - array_values($vars)); - - foreach($properties as $property) { - if(Services_JSON::isError($property)) { - return $property; - } - } - - return '{' . join(',', $properties) . '}'; - - default: - return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS) - ? 'null' - : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string"); - } - } - - /** - * array-walking function for use in generating JSON-formatted name-value pairs - * - * @param string $name name of key to use - * @param mixed $value reference to an array element to be encoded - * - * @return string JSON-formatted name-value pair, like '"name":value' - * @access private - */ - function name_value($name, $value) - { - $encoded_value = $this->encode($value); - - if(Services_JSON::isError($encoded_value)) { - return $encoded_value; - } - - return $this->encode(strval($name)) . ':' . $encoded_value; - } - - /** - * reduce a string by removing leading and trailing comments and whitespace - * - * @param $str string string value to strip of comments and whitespace - * - * @return string string value stripped of comments and whitespace - * @access private - */ - function reduce_string($str) - { - $str = preg_replace(array( - - // eliminate single line comments in '// ...' form - '#^\s*//(.+)$#m', - - // eliminate multi-line comments in '/* ... */' form, at start of string - '#^\s*/\*(.+)\*/#Us', - - // eliminate multi-line comments in '/* ... */' form, at end of string - '#/\*(.+)\*/\s*$#Us' - - ), '', $str); - - // eliminate extraneous space - return trim($str); - } - - /** - * decodes a JSON string into appropriate variable - * - * @param string $str JSON-formatted string - * - * @return mixed number, boolean, string, array, or object - * corresponding to given JSON input string. - * See argument 1 to Services_JSON() above for object-output behavior. - * Note that decode() always returns strings - * in ASCII or UTF-8 format! - * @access public - */ - function decode($str) - { - $str = $this->reduce_string($str); - - switch (strtolower($str)) { - case 'true': - return true; - - case 'false': - return false; - - case 'null': - return null; - - default: - $m = array(); - - if (is_numeric($str)) { - // Lookie-loo, it's a number - - // This would work on its own, but I'm trying to be - // good about returning integers where appropriate: - // return (float)$str; - - // Return float or int, as appropriate - return ((float)$str == (integer)$str) - ? (integer)$str - : (float)$str; - - } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) { - // STRINGS RETURNED IN UTF-8 FORMAT - $delim = substr($str, 0, 1); - $chrs = substr($str, 1, -1); - $utf8 = ''; - $strlen_chrs = strlen($chrs); - - for ($c = 0; $c < $strlen_chrs; ++$c) { - - $substr_chrs_c_2 = substr($chrs, $c, 2); - $ord_chrs_c = ord($chrs{$c}); - - switch (true) { - case $substr_chrs_c_2 == '\b': - $utf8 .= chr(0x08); - ++$c; - break; - case $substr_chrs_c_2 == '\t': - $utf8 .= chr(0x09); - ++$c; - break; - case $substr_chrs_c_2 == '\n': - $utf8 .= chr(0x0A); - ++$c; - break; - case $substr_chrs_c_2 == '\f': - $utf8 .= chr(0x0C); - ++$c; - break; - case $substr_chrs_c_2 == '\r': - $utf8 .= chr(0x0D); - ++$c; - break; - - case $substr_chrs_c_2 == '\\"': - case $substr_chrs_c_2 == '\\\'': - case $substr_chrs_c_2 == '\\\\': - case $substr_chrs_c_2 == '\\/': - if (($delim == '"' && $substr_chrs_c_2 != '\\\'') || - ($delim == "'" && $substr_chrs_c_2 != '\\"')) { - $utf8 .= $chrs{++$c}; - } - break; - - case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)): - // single, escaped unicode character - $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2))) - . chr(hexdec(substr($chrs, ($c + 4), 2))); - $utf8 .= $this->utf162utf8($utf16); - $c += 5; - break; - - case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): - $utf8 .= $chrs{$c}; - break; - - case ($ord_chrs_c & 0xE0) == 0xC0: - // characters U-00000080 - U-000007FF, mask 110XXXXX - //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 2); - ++$c; - break; - - case ($ord_chrs_c & 0xF0) == 0xE0: - // characters U-00000800 - U-0000FFFF, mask 1110XXXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 3); - $c += 2; - break; - - case ($ord_chrs_c & 0xF8) == 0xF0: - // characters U-00010000 - U-001FFFFF, mask 11110XXX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 4); - $c += 3; - break; - - case ($ord_chrs_c & 0xFC) == 0xF8: - // characters U-00200000 - U-03FFFFFF, mask 111110XX - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 5); - $c += 4; - break; - - case ($ord_chrs_c & 0xFE) == 0xFC: - // characters U-04000000 - U-7FFFFFFF, mask 1111110X - // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 - $utf8 .= substr($chrs, $c, 6); - $c += 5; - break; - - } - - } - - return $utf8; - - } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) { - // array, or object notation - - if ($str{0} == '[') { - $stk = array(SERVICES_JSON_IN_ARR); - $arr = array(); - } else { - if ($this->use & SERVICES_JSON_LOOSE_TYPE) { - $stk = array(SERVICES_JSON_IN_OBJ); - $obj = array(); - } else { - $stk = array(SERVICES_JSON_IN_OBJ); - $obj = new stdClass(); - } - } - - array_push($stk, array('what' => SERVICES_JSON_SLICE, - 'where' => 0, - 'delim' => false)); - - $chrs = substr($str, 1, -1); - $chrs = $this->reduce_string($chrs); - - if ($chrs == '') { - if (reset($stk) == SERVICES_JSON_IN_ARR) { - return $arr; - - } else { - return $obj; - - } - } - - //print("\nparsing {$chrs}\n"); - - $strlen_chrs = strlen($chrs); - - for ($c = 0; $c <= $strlen_chrs; ++$c) { - - $top = end($stk); - $substr_chrs_c_2 = substr($chrs, $c, 2); - - if (($c == $strlen_chrs) || (($chrs{$c} == ',') && ($top['what'] == SERVICES_JSON_SLICE))) { - // found a comma that is not inside a string, array, etc., - // OR we've reached the end of the character list - $slice = substr($chrs, $top['where'], ($c - $top['where'])); - array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false)); - //print("Found split at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - if (reset($stk) == SERVICES_JSON_IN_ARR) { - // we are in an array, so just push an element onto the stack - array_push($arr, $this->decode($slice)); - - } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { - // we are in an object, so figure - // out the property name and set an - // element in an associative array, - // for now - $parts = array(); - - if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { - // "name":value pair - $key = $this->decode($parts[1]); - $val = $this->decode($parts[2]); - - if ($this->use & SERVICES_JSON_LOOSE_TYPE) { - $obj[$key] = $val; - } else { - $obj->$key = $val; - } - } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { - // name:value pair, where name is unquoted - $key = $parts[1]; - $val = $this->decode($parts[2]); - - if ($this->use & SERVICES_JSON_LOOSE_TYPE) { - $obj[$key] = $val; - } else { - $obj->$key = $val; - } - } - - } - - } elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) { - // found a quote, and we are not inside a string - array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c})); - //print("Found start of string at {$c}\n"); - - } elseif (($chrs{$c} == $top['delim']) && - ($top['what'] == SERVICES_JSON_IN_STR) && - ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) { - // found a quote, we're in a string, and it's not escaped - // we know that it's not escaped becase there is _not_ an - // odd number of backslashes at the end of the string so far - array_pop($stk); - //print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n"); - - } elseif (($chrs{$c} == '[') && - in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { - // found a left-bracket, and we are in an array, object, or slice - array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false)); - //print("Found start of array at {$c}\n"); - - } elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) { - // found a right-bracket, and we're in an array - array_pop($stk); - //print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - } elseif (($chrs{$c} == '{') && - in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { - // found a left-brace, and we are in an array, object, or slice - array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false)); - //print("Found start of object at {$c}\n"); - - } elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) { - // found a right-brace, and we're in an object - array_pop($stk); - //print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - } elseif (($substr_chrs_c_2 == '/*') && - in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { - // found a comment start, and we are in an array, object, or slice - array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false)); - $c++; - //print("Found start of comment at {$c}\n"); - - } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) { - // found a comment end, and we're in one now - array_pop($stk); - $c++; - - for ($i = $top['where']; $i <= $c; ++$i) - $chrs = substr_replace($chrs, ' ', $i, 1); - - //print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n"); - - } - - } - - if (reset($stk) == SERVICES_JSON_IN_ARR) { - return $arr; - - } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { - return $obj; - - } - - } - } - } - - /** - * @todo Ultimately, this should just call PEAR::isError() - */ - function isError($data, $code = null) - { - if (class_exists('pear')) { - return PEAR::isError($data, $code); - } elseif (is_object($data) && (get_class($data) == 'services_json_error' || - is_subclass_of($data, 'services_json_error'))) { - return true; - } - - return false; - } -} - -if (class_exists('PEAR_Error')) { - - class Services_JSON_Error extends PEAR_Error - { - function Services_JSON_Error($message = 'unknown error', $code = null, - $mode = null, $options = null, $userinfo = null) - { - parent::PEAR_Error($message, $code, $mode, $options, $userinfo); - } - } - -} else { - - /** - * @todo Ultimately, this class shall be descended from PEAR_Error - */ - class Services_JSON_Error - { - function Services_JSON_Error($message = 'unknown error', $code = null, - $mode = null, $options = null, $userinfo = null) - { - - } - } - -} - -?> diff --git a/plugins/Facebook/facebook/jsonwrapper/JSON/LICENSE b/plugins/Facebook/facebook/jsonwrapper/JSON/LICENSE deleted file mode 100644 index 4ae6bef55d..0000000000 --- a/plugins/Facebook/facebook/jsonwrapper/JSON/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - -Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. - -Redistributions in binary form must reproduce the above copyright -notice, this list of conditions and the following disclaimer in the -documentation and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED -WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN -NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF -USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/plugins/Facebook/facebook/jsonwrapper/jsonwrapper.php b/plugins/Facebook/facebook/jsonwrapper/jsonwrapper.php deleted file mode 100644 index 29509debad..0000000000 --- a/plugins/Facebook/facebook/jsonwrapper/jsonwrapper.php +++ /dev/null @@ -1,6 +0,0 @@ - diff --git a/plugins/Facebook/facebook/jsonwrapper/jsonwrapper_inner.php b/plugins/Facebook/facebook/jsonwrapper/jsonwrapper_inner.php deleted file mode 100644 index 36a3f28635..0000000000 --- a/plugins/Facebook/facebook/jsonwrapper/jsonwrapper_inner.php +++ /dev/null @@ -1,23 +0,0 @@ -encode($arg); -} - -function json_decode($arg) -{ - global $services_json; - if (!isset($services_json)) { - $services_json = new Services_JSON(); - } - return $services_json->decode($arg); -} - -?> diff --git a/plugins/Facebook/facebookaction.php b/plugins/Facebook/facebookaction.php deleted file mode 100644 index 003bf8cd7e..0000000000 --- a/plugins/Facebook/facebookaction.php +++ /dev/null @@ -1,531 +0,0 @@ -. - * - * @category Faceboook - * @package StatusNet - * @author Zach Copley - * @copyright 2008-2009 StatusNet, Inc. - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://status.net/ - */ - -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR . '/plugins/Facebook/facebookutil.php'; -require_once INSTALLDIR . '/plugins/Facebook/facebooknoticeform.php'; - -class FacebookAction extends Action -{ - var $facebook = null; - var $fbuid = null; - var $flink = null; - var $action = null; - var $app_uri = null; - var $app_name = null; - - function __construct($output='php://output', $indent=null, $facebook=null, $flink=null) - { - parent::__construct($output, $indent); - - $this->facebook = $facebook; - $this->flink = $flink; - - if ($this->flink) { - $this->fbuid = $flink->foreign_id; - $this->user = $flink->getUser(); - } - - $this->args = array(); - } - - function prepare($argarray) - { - parent::prepare($argarray); - - $this->facebook = getFacebook(); - $this->fbuid = $this->facebook->require_login(); - - $this->action = $this->trimmed('action'); - - $app_props = $this->facebook->api_client->Admin_getAppProperties( - array('canvas_name', 'application_name')); - - $this->app_uri = 'http://apps.facebook.com/' . $app_props['canvas_name']; - $this->app_name = $app_props['application_name']; - - $this->flink = Foreign_link::getByForeignID($this->fbuid, FACEBOOK_SERVICE); - - return true; - - } - - function showStylesheets() - { - // Loading CSS via files in Facebook FBML Canvas apps is still busted as of 1/31/11 - // See: http://bugs.developers.facebook.net/show_bug.cgi?id=10052 - $this->cssLink('css/display.css', 'base'); - $this->cssLink('css/display.css', null, 'screen, projection, tv'); - $this->cssLink('plugins/Facebook/facebookapp.css'); - - // Also, Facebook refuses to let me do this... gar! -/* - $baseCss = file_get_contents(INSTALLDIR . '/theme/base/css/display.css'); - $this->style($baseCss); - - $facebookCss = file_get_contents(INSTALLDIR . '/plugins/Facebook/facebookapp.css'); - $this->style($facebookCss); -*/ - } - - function showScripts() - { - $this->script('plugins/Facebook/facebookapp.js'); - } - - /** - * Start an Facebook ready HTML document - * - * For Facebook we don't want to actually output any headers, - * DTD info, etc. Just Stylesheet and JavaScript links. - * - * @param string $type MIME type to use; default is to do negotation. - * - * @return void - */ - function startHTML($type=null) - { - $this->showStylesheets(); - $this->showScripts(); - - $this->elementStart('div', array('class' => 'facebook-page')); - } - - /** - * Ends a Facebook ready HTML document - * - * @return void - */ - function endHTML() - { - $this->elementEnd('div'); - $this->endXML(); - } - - /** - * Show notice form. - * - * @return nothing - */ - function showNoticeForm() - { - // don't do it for most of the Facebook pages - } - - function showBody() - { - $this->elementStart('div', array('id' => 'wrap')); - $this->showHeader(); - $this->showCore(); - $this->showFooter(); - $this->elementEnd('div'); - } - - function showHead($error, $success) - { - if ($error) { - $this->element("h1", null, $error); - } - - if ($success) { - $this->element("h1", null, $success); - } - - $this->elementStart('fb:if-section-not-added', array('section' => 'profile')); - $this->elementStart('span', array('id' => 'add_to_profile')); - $this->element('fb:add-section-button', array('section' => 'profile')); - $this->elementEnd('span'); - $this->elementEnd('fb:if-section-not-added'); - - } - - // Make this into a widget later - function showLocalNav() - { - $this->elementStart('ul', array('class' => 'nav')); - - $this->elementStart('li', array('class' => - ($this->action == 'facebookhome') ? 'current' : 'facebook_home')); - $this->element('a', - // TRANS: Link description for 'Home' link that leads to a start page. - array('href' => 'index.php', 'title' => _m('MENU','Home')), - // TRANS: Tooltip for 'Home' link that leads to a start page. - _m('Home')); - $this->elementEnd('li'); - - if (common_config('invite', 'enabled')) { - $this->elementStart('li', - array('class' => - ($this->action == 'facebookinvite') ? 'current' : 'facebook_invite')); - $this->element('a', - // TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. - array('href' => 'invite.php', 'title' => _m('MENU','Invite')), - // TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. - _m('Invite')); - $this->elementEnd('li'); - } - - $this->elementStart('li', - array('class' => - ($this->action == 'facebooksettings') ? 'current' : 'facebook_settings')); - $this->element('a', - array('href' => 'settings.php', - // TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. - 'title' => _m('MENU','Settings')), - // TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. - _m('Settings')); - $this->elementEnd('li'); - - $this->elementEnd('ul'); - } - - /** - * Show header of the page. - * - * @return nothing - */ - function showHeader() - { - $this->elementStart('div', array('id' => 'header')); - $this->showLogo(); - $this->showNoticeForm(); - $this->elementEnd('div'); - } - - /** - * Show page, a template method. - * - * @return nothing - */ - function showPage($error = null, $success = null) - { - $this->startHTML(); - $this->showHead($error, $success); - $this->showBody(); - $this->endHTML(); - } - - function showInstructions() - { - $this->elementStart('div', array('class' => 'facebook_guide')); - - $this->elementStart('dl', array('class' => 'system_notice')); - $this->element('dt', null, 'Page Notice'); - - $loginmsg_part1 = _m('To use the %s Facebook Application you need to login ' . - 'with your username and password. Don\'t have a username yet?'); - $loginmsg_part2 = _m(' a new account.'); - - $this->elementStart('dd'); - $this->elementStart('p'); - $this->text(sprintf($loginmsg_part1, common_config('site', 'name'))); - // @todo FIXME: Bad i18n. Patchwork message in two parts. - $this->element('a', - array('href' => common_local_url('register')), _m('Register')); - $this->text( " " . $loginmsg_part2); - $this->elementEnd('p'); - $this->elementEnd('dd'); - - $this->elementEnd('dl'); - $this->elementEnd('div'); - } - - function showLoginForm($msg = null) - { - - $this->elementStart('div', array('id' => 'content')); - $this->element('h1', null, _m('Login')); - - if ($msg) { - $this->element('fb:error', array('message' => $msg)); - } - - $this->showInstructions(); - - $this->elementStart('div', array('id' => 'content_inner')); - - $this->elementStart('form', array('method' => 'post', - 'class' => 'form_settings', - 'id' => 'login', - 'action' => 'index.php')); - - $this->elementStart('fieldset'); - - $this->elementStart('ul', array('class' => 'form_datas')); - $this->elementStart('li'); - $this->input('nickname', _m('Nickname')); - $this->elementEnd('li'); - $this->elementStart('li'); - $this->password('password', _m('Password')); - $this->elementEnd('li'); - $this->elementEnd('ul'); - - // TRANS: Login button. - $this->submit('submit', _m('BUTTON','Login')); - $this->elementEnd('fieldset'); - $this->elementEnd('form'); - - $this->elementStart('p'); - $this->element('a', array('href' => common_local_url('recoverpassword')), - _m('Lost or forgotten password?')); - $this->elementEnd('p'); - - $this->elementEnd('div'); - $this->elementEnd('div'); - } - - /** - * Generate pagination links - * - * @param boolean $have_before is there something before? - * @param boolean $have_after is there something after? - * @param integer $page current page - * @param string $action current action - * @param array $args rest of query arguments - * - * @return nothing - */ - function pagination($have_before, $have_after, $page, $action, $args=null) - { - // Does a little before-after block for next/prev page - if ($have_before || $have_after) { - $this->elementStart('dl', 'pagination'); - $this->element('dt', null, _m('Pagination')); - $this->elementStart('dd', null); - $this->elementStart('ul', array('class' => 'nav')); - } - if ($have_before) { - $pargs = array('page' => $page-1); - $newargs = $args ? array_merge($args, $pargs) : $pargs; - $this->elementStart('li', array('class' => 'nav_prev')); - $this->element('a', array('href' => "$this->app_uri/$action?page=$newargs[page]", 'rel' => 'prev'), - _m('After')); - $this->elementEnd('li'); - } - if ($have_after) { - $pargs = array('page' => $page+1); - $newargs = $args ? array_merge($args, $pargs) : $pargs; - $this->elementStart('li', array('class' => 'nav_next')); - $this->element('a', array('href' => "$this->app_uri/$action?page=$newargs[page]", 'rel' => 'next'), - _m('Before')); - $this->elementEnd('li'); - } - if ($have_before || $have_after) { - $this->elementEnd('ul'); - $this->elementEnd('dd'); - $this->elementEnd('dl'); - } - } - - function saveNewNotice() - { - $user = $this->flink->getUser(); - - $content = $this->trimmed('status_textarea'); - - if (!$content) { - $this->showPage(_m('No notice content!')); - return; - } else { - $content_shortened = $user->shortenLinks($content); - - if (Notice::contentTooLong($content_shortened)) { - // @todo FIXME: i18n: Needs plural. - $this->showPage(sprintf(_m('That\'s too long. Max notice size is %d chars.'), - Notice::maxContent())); - return; - } - } - - $inter = new CommandInterpreter(); - - $cmd = $inter->handle_command($user, $content_shortened); - - if ($cmd) { - // XXX fix this - $cmd->execute(new WebChannel()); - return; - } - - $replyto = $this->trimmed('inreplyto'); - - try { - $notice = Notice::saveNew($user->id, $content, 'web', - array('reply_to' => ($replyto == 'false') ? null : $replyto)); - - } catch (Exception $e) { - $this->showPage($e->getMessage()); - return; - } - - } -} - -class FacebookNoticeList extends NoticeList -{ - /** - * constructor - * - * @param Notice $notice stream of notices from DB_DataObject - */ - - function __construct($notice, $out=null) - { - parent::__construct($notice, $out); - } - - /** - * show the list of notices - * - * "Uses up" the stream by looping through it. So, probably can't - * be called twice on the same list. - * - * @return int count of notices listed. - */ - function show() - { - $this->out->elementStart('div', array('id' =>'notices_primary')); - $this->out->element('h2', null, _m('Notices')); - $this->out->elementStart('ul', array('class' => 'notices')); - - $cnt = 0; - - while ($this->notice->fetch() && $cnt <= NOTICES_PER_PAGE) { - $cnt++; - - if ($cnt > NOTICES_PER_PAGE) { - break; - } - - $item = $this->newListItem($this->notice); - $item->show(); - } - - $this->out->elementEnd('ul'); - $this->out->elementEnd('div'); - - return $cnt; - } - - /** - * returns a new list item for the current notice - * - * Overridden to return a Facebook specific list item. - * - * @param Notice $notice the current notice - * - * @return FacebookNoticeListItem a list item for displaying the notice - * formatted for display in the Facebook App. - */ - function newListItem($notice) - { - return new FacebookNoticeListItem($notice, $this); - } -} - -class FacebookNoticeListItem extends NoticeListItem -{ - /** - * constructor - * - * Also initializes the profile attribute. - * - * @param Notice $notice The notice we'll display - */ - function __construct($notice, $out=null) - { - parent::__construct($notice, $out); - } - - /** - * recipe function for displaying a single notice in the Facebook App. - * - * Overridden to strip out some of the controls that we don't - * want to be available. - * - * @return void - */ - function show() - { - $this->showStart(); - $this->showNotice(); - $this->showNoticeInfo(); - - // XXX: Need to update to show attachements and controls - - $this->showEnd(); - } -} - -class FacebookProfileBoxNotice extends FacebookNoticeListItem -{ - /** - * constructor - * - * Also initializes the profile attribute. - * - * @param Notice $notice The notice we'll display - */ - function __construct($notice, $out=null) - { - parent::__construct($notice, $out); - } - - /** - * Recipe function for displaying a single notice in the - * Facebook App profile notice box - * - * @return void - */ - function show() - { - $this->showNotice(); - $this->showNoticeInfo(); - $this->showAppLink(); - } - - function showAppLink() - { - $this->facebook = getFacebook(); - - $app_props = $this->facebook->api_client->Admin_getAppProperties( - array('canvas_name', 'application_name')); - - $this->app_uri = 'http://apps.facebook.com/' . $app_props['canvas_name']; - $this->app_name = $app_props['application_name']; - - $this->out->elementStart('a', array('id' => 'facebook_statusnet_app', - 'href' => $this->app_uri)); - $this->out->text($this->app_name); - $this->out->elementEnd('a'); - } -} diff --git a/plugins/Facebook/facebookadminpanel.php b/plugins/Facebook/facebookadminpanel.php deleted file mode 100644 index ae26c7d3e8..0000000000 --- a/plugins/Facebook/facebookadminpanel.php +++ /dev/null @@ -1,212 +0,0 @@ -. - * - * @category Settings - * @package StatusNet - * @author Zach Copley - * @copyright 2010 StatusNet, Inc. - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://status.net/ - */ - -if (!defined('STATUSNET')) { - exit(1); -} - -/** - * Administer global Facebook integration settings - * - * @category Admin - * @package StatusNet - * @author Zach Copley - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://status.net/ - */ -class FacebookadminpanelAction extends AdminPanelAction -{ - /** - * Returns the page title - * - * @return string page title - */ - function title() - { - return _m('Facebook'); - } - - /** - * Instructions for using this form. - * - * @return string instructions - */ - function getInstructions() - { - return _m('Facebook integration settings'); - } - - /** - * Show the Facebook admin panel form - * - * @return void - */ - function showForm() - { - $form = new FacebookAdminPanelForm($this); - $form->show(); - return; - } - - /** - * Save settings from the form - * - * @return void - */ - function saveSettings() - { - static $settings = array( - 'facebook' => array('apikey', 'secret'), - ); - - $values = array(); - - foreach ($settings as $section => $parts) { - foreach ($parts as $setting) { - $values[$section][$setting] - = $this->trimmed($setting); - } - } - - // This throws an exception on validation errors - $this->validate($values); - - // assert(all values are valid); - - $config = new Config(); - - $config->query('BEGIN'); - - foreach ($settings as $section => $parts) { - foreach ($parts as $setting) { - Config::save($section, $setting, $values[$section][$setting]); - } - } - - $config->query('COMMIT'); - - return; - } - - function validate(&$values) - { - // Validate consumer key and secret (can't be too long) - - if (mb_strlen($values['facebook']['apikey']) > 255) { - $this->clientError( - _m("Invalid Facebook API key. Max length is 255 characters.") - ); - } - - if (mb_strlen($values['facebook']['secret']) > 255) { - $this->clientError( - _m("Invalid Facebook API secret. Max length is 255 characters.") - ); - } - } -} - -class FacebookAdminPanelForm extends AdminForm -{ - /** - * ID of the form - * - * @return int ID of the form - */ - function id() - { - return 'facebookadminpanel'; - } - - /** - * class of the form - * - * @return string class of the form - */ - function formClass() - { - return 'form_settings'; - } - - /** - * Action of the form - * - * @return string URL of the action - */ - function action() - { - return common_local_url('facebookadminpanel'); - } - - /** - * Data elements of the form - * - * @return void - */ - function formData() - { - $this->out->elementStart( - 'fieldset', - array('id' => 'settings_facebook-application') - ); - $this->out->element('legend', null, _m('Facebook application settings')); - $this->out->elementStart('ul', 'form_data'); - - $this->li(); - $this->input( - 'apikey', - _m('API key'), - _m('API key provided by Facebook'), - 'facebook' - ); - $this->unli(); - - $this->li(); - $this->input( - 'secret', - _m('Secret'), - _m('API secret provided by Facebook'), - 'facebook' - ); - $this->unli(); - - $this->out->elementEnd('ul'); - $this->out->elementEnd('fieldset'); - } - - /** - * Action elements - * - * @return void - */ - function formActions() - { - $this->out->submit('submit', _m('Save'), 'submit', null, _m('Save Facebook settings')); - } -} diff --git a/plugins/Facebook/facebookapp.css b/plugins/Facebook/facebookapp.css deleted file mode 100644 index 8cd06f78a8..0000000000 --- a/plugins/Facebook/facebookapp.css +++ /dev/null @@ -1,115 +0,0 @@ -* { -font-size:14px; -font-family:"Lucida Sans Unicode", "Lucida Grande", sans-serif; -} - -#wrap { -background-color:#F0F2F5; -padding-left:1.795%; -padding-right:1.795%; -width:auto; -} - -p,label, -h1,h2,h3,h4,h5,h6 { -color:#000; -} - -#header { -width:131%; -} - -#content { -width:92.7%; -} - -#aside_primary { -display:none; -} - -#site_nav_local_views a { -background-color:#D0DFE7; -} -#site_nav_local_views a:hover { -background-color:#FAFBFC; -} - -#form_notice .form_note + label, -#form_notice #notice_data-attach { -display:none; -} - -#form_notice #notice_action-submit { -height:47px !important; -} - - -span.facebook-button { -border: 2px solid #aaa; -padding: 3px; -display: block; -float: left; -margin-right: 20px; --moz-border-radius: 4px; -border-radius:4px; --webkit-border-radius:4px; -font-weight: bold; -background-color:#A9BF4F; -color:#fff; -font-size:1.2em -} - -span.facebook-button a { color:#fff } - -.facebook_guide { -margin-bottom:18px; -} -.facebook_guide p { -font-weight:bold; -} - - -input { -height:auto !important; -} - -#facebook-friends { -float:left; -width:100%; -} - -#facebook-friends li { -float:left; -margin-right:2%; -margin-bottom:11px; -width:18%; -height:115px; -} -#facebook-friends li a { -float:left; -} - -#add_to_profile { -position:absolute; -right:18px; -top:10px; -z-index:2; -} - -.notice div.entry-content dl, -.notice div.entry-content dt, -.notice div.entry-content dd { -margin-right:5px; -} - -#content_inner p { -margin-bottom:18px; -} - -#content_inner ul { -list-style-type:none; -} - -.form_settings label { -margin-right:18px; -} diff --git a/plugins/Facebook/facebookapp.js b/plugins/Facebook/facebookapp.js deleted file mode 100644 index 5deb6e42b3..0000000000 --- a/plugins/Facebook/facebookapp.js +++ /dev/null @@ -1,33 +0,0 @@ -/* -* StatusNet - a distributed open-source microblogging tool -* Copyright (C) 2008, StatusNet, 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 . -*/ - -var max = 140; -var noticeBox = document.getElementById('notice_data-text'); - -if (noticeBox) { - noticeBox.addEventListener('keyup', keypress); - noticeBox.addEventListener('keydown', keypress); - noticeBox.addEventListener('keypress', keypress); - noticeBox.addEventListener('change', keypress); -} - -// Do our the countdown -function keypress(evt) { - document.getElementById('notice_text-count').setTextValue( - max - noticeBox.getValue().length); -} diff --git a/plugins/Facebook/facebookhome.php b/plugins/Facebook/facebookhome.php deleted file mode 100644 index 9b18a695bf..0000000000 --- a/plugins/Facebook/facebookhome.php +++ /dev/null @@ -1,246 +0,0 @@ -. - */ - -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php'; - -class FacebookhomeAction extends FacebookAction -{ - var $page = null; - - function prepare($argarray) - { - parent::prepare($argarray); - - $this->page = $this->trimmed('page'); - - if (!$this->page) { - $this->page = 1; - } - - return true; - } - - function handle($args) - { - parent::handle($args); - - if (!empty($this->flink)) { - $this->user = $this->flink->getUser(); - - // If this is the first time the user has started the app - // prompt for Facebook status update permission - if (!$this->facebook->api_client->users_hasAppPermission('publish_stream')) { - $this->getUpdatePermission(); - return; - } - - if ($this->arg('status_submit') == 'Send') { - $this->saveNewNotice(); - } - - // User is authenticated and has already been prompted once for - // Facebook status update permission? Then show the main page - // of the app - $this->showPage(); - } else { - // User hasn't authenticated yet, prompt for creds - $this->login(); - } - } - - function login() - { - $this->showStylesheets(); - - $nickname = common_canonical_nickname($this->trimmed('nickname')); - $password = $this->arg('password'); - - $msg = null; - - if ($nickname) { - if (common_check_user($nickname, $password)) { - $user = User::staticGet('nickname', $nickname); - - if (!$user) { - $this->showLoginForm(_m("Server error: Couldn't get user!")); - } - - $flink = DB_DataObject::factory('foreign_link'); - $flink->user_id = $user->id; - $flink->foreign_id = $this->fbuid; - $flink->service = FACEBOOK_SERVICE; - $flink->created = common_sql_now(); - $flink->set_flags(true, false, false, false); - - $flink_id = $flink->insert(); - - // XXX: Do some error handling here - - $this->getUpdatePermission(); - return; - } else { - $msg = _m('Incorrect username or password.'); - } - } - - $this->showLoginForm($msg); - $this->showFooter(); - } - - function showNoticeForm() - { - $post_action = "$this->app_uri/index.php"; - - $notice_form = new FacebookNoticeForm($this, $post_action, null, - $post_action, $this->user); - $notice_form->show(); - } - - function title() - { - if ($this->page > 1) { - // @todo FIXME: Core should have methods to get "Full name (nickname)" in a localised form - // so that this can be used consistenly throughout StatusNet without having to implement it - // over and over.. - // TRANS: Page title. - // TRANS: %1$s is a user nickname, %2$s is a page number. - return sprintf(_m('%1$s and friends, page %2$d'), $this->user->nickname, $this->page); - } else { - // TRANS: Page title. - // TRANS: %s is a user nickname - return sprintf(_m("%s and friends"), $this->user->nickname); - } - } - - function showContent() - { - $notice = $this->user->noticeInbox(($this->page-1) * NOTICES_PER_PAGE, NOTICES_PER_PAGE + 1); - - $nl = new NoticeList($notice, $this); - - $cnt = $nl->show(); - - $this->pagination($this->page > 1, $cnt > NOTICES_PER_PAGE, - $this->page, 'index.php', array('nickname' => $this->user->nickname)); - } - - function showNoticeList($notice) - { - $nl = new NoticeList($notice, $this); - return $nl->show(); - } - - function getUpdatePermission() { - $this->showStylesheets(); - - $this->elementStart('div', array('class' => 'facebook_guide')); - - // TRANS: Instructions. %s is the application name. - $instructions = sprintf(_m('If you would like the %s app to automatically update ' . - 'your Facebook status with your latest notice, you need ' . - 'to give it permission.'), $this->app_name); - - $this->elementStart('p'); - $this->element('span', array('id' => 'permissions_notice'), $instructions); - $this->elementEnd('p'); - - $this->elementStart('form', array('method' => 'post', - 'action' => "index.php", - 'id' => 'facebook-skip-permissions')); - - $this->elementStart('ul', array('id' => 'fb-permissions-list')); - $this->elementStart('li', array('id' => 'fb-permissions-item')); - - $next = urlencode("$this->app_uri/index.php"); - $api_key = common_config('facebook', 'apikey'); - - $auth_url = 'http://www.facebook.com/authorize.php?api_key=' . - $api_key . '&v=1.0&ext_perm=publish_stream&next=' . $next . - '&next_cancel=' . $next . '&submit=skip'; - - $this->elementStart('span', array('class' => 'facebook-button')); - // @todo FIXME: sprintf not needed here? - $this->element('a', array('href' => $auth_url), - sprintf(_m('Okay, do it!'), $this->app_name)); - $this->elementEnd('span'); - - $this->elementEnd('li'); - - $this->elementStart('li', array('id' => 'fb-permissions-item')); - // TRANS: Button text. Clicking the button will skip updating Facebook permissions. - $this->submit('skip', _m('BUTTON','Skip')); - $this->elementEnd('li'); - $this->elementEnd('ul'); - - $this->elementEnd('form'); - $this->elementEnd('div'); - } - - /** - * Generate pagination links - * - * @param boolean $have_before is there something before? - * @param boolean $have_after is there something after? - * @param integer $page current page - * @param string $action current action - * @param array $args rest of query arguments - * - * @return nothing - */ - function pagination($have_before, $have_after, $page, $action, $args=null) - { - // Does a little before-after block for next/prev page - - // XXX: Fix so this uses common_local_url() if possible. - - if ($have_before || $have_after) { - $this->elementStart('dl', 'pagination'); - $this->element('dt', null, _m('Pagination')); - $this->elementStart('dd', null); - $this->elementStart('ul', array('class' => 'nav')); - } - if ($have_before) { - $pargs = array('page' => $page-1); - $newargs = $args ? array_merge($args, $pargs) : $pargs; - $this->elementStart('li', array('class' => 'nav_prev')); - $this->element('a', array('href' => "$action?page=$newargs[page]", 'rel' => 'prev'), - // TRANS: Pagination link. - _m('After')); - $this->elementEnd('li'); - } - if ($have_after) { - $pargs = array('page' => $page+1); - $newargs = $args ? array_merge($args, $pargs) : $pargs; - $this->elementStart('li', array('class' => 'nav_next')); - $this->element('a', array('href' => "$action?page=$newargs[page]", 'rel' => 'next'), - // TRANS: Pagination link. - _m('Before')); - $this->elementEnd('li'); - } - if ($have_before || $have_after) { - $this->elementEnd('ul'); - $this->elementEnd('dd'); - $this->elementEnd('dl'); - } - } -} diff --git a/plugins/Facebook/facebookinvite.php b/plugins/Facebook/facebookinvite.php deleted file mode 100644 index a50eace12f..0000000000 --- a/plugins/Facebook/facebookinvite.php +++ /dev/null @@ -1,145 +0,0 @@ -. - */ - -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php'; - -class FacebookinviteAction extends FacebookAction -{ - function handle($args) - { - parent::handle($args); - $this->showForm(); - } - - /** - * Wrapper for showing a page - * - * Stores an error and shows the page - * - * @param string $error Error, if any - * - * @return void - */ - function showForm($error=null) - { - $this->error = $error; - $this->showPage(); - } - - /** - * Show the page content - * - * Either shows the registration form or, if registration was successful, - * instructions for using the site. - * - * @return void - */ - function showContent() - { - if ($this->arg('ids')) { - $this->showSuccessContent(); - } else { - $this->showFormContent(); - } - } - - function showSuccessContent() - { - // TRANS: %s is the name of the site. - $this->element('h2', null, sprintf(_m('Thanks for inviting your friends to use %s.'), - common_config('site', 'name'))); - // TRANS: Followed by an unordered list with invited friends. - $this->element('p', null, _m('Invitations have been sent to the following users:')); - - $friend_ids = $_POST['ids']; // XXX: Hmm... is this the best way to access the list? - - $this->elementStart('ul', array('id' => 'facebook-friends')); - - foreach ($friend_ids as $friend) { - $this->elementStart('li'); - $this->element('fb:profile-pic', array('uid' => $friend, 'size' => 'square')); - $this->element('fb:name', array('uid' => $friend, - 'capitalize' => 'true')); - $this->elementEnd('li'); - } - - $this->elementEnd('ul'); - } - - function showFormContent() - { - $content = sprintf(_m('You have been invited to %s'), common_config('site', 'name')) . - htmlentities(''); - - $this->elementStart('fb:request-form', array('action' => 'invite.php', - 'method' => 'post', - 'invite' => 'true', - 'type' => common_config('site', 'name'), - 'content' => $content)); - $this->hidden('invite', 'true'); - // TRANS: %s is the name of the site. - $actiontext = sprintf(_m('Invite your friends to use %s'), common_config('site', 'name')); - - $multi_params = array('showborder' => 'false'); - $multi_params['actiontext'] = $actiontext; - $multi_params['bypass'] = 'cancel'; - $multi_params['cols'] = 4; - - // Get a list of users who are already using the app for exclusion - $exclude_ids = $this->facebook->api_client->friends_getAppUsers(); - $exclude_ids_csv = null; - - // fbml needs these as a csv string, not an array - if ($exclude_ids) { - $exclude_ids_csv = implode(',', $exclude_ids); - $multi_params['exclude_ids'] = $exclude_ids_csv; - } - - $this->element('fb:multi-friend-selector', $multi_params); - $this->elementEnd('fb:request-form'); - - if ($exclude_ids) { - - // TRANS: %s is the name of the site. - $this->element('h2', null, sprintf(_m('Friends already using %s:'), - common_config('site', 'name'))); - $this->elementStart('ul', array('id' => 'facebook-friends')); - - foreach ($exclude_ids as $friend) { - $this->elementStart('li'); - $this->element('fb:profile-pic', array('uid' => $friend, 'size' => 'square')); - $this->element('fb:name', array('uid' => $friend, - 'capitalize' => 'true')); - $this->elementEnd('li'); - } - - $this->elementEnd("ul"); - } - } - - function title() - { - // TRANS: Page title. - return sprintf(_m('Send invitations')); - } -} diff --git a/plugins/Facebook/facebooklogin.php b/plugins/Facebook/facebooklogin.php deleted file mode 100644 index 1961be57b6..0000000000 --- a/plugins/Facebook/facebooklogin.php +++ /dev/null @@ -1,97 +0,0 @@ -. - */ - -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php'; - -class FacebookinviteAction extends FacebookAction -{ - function handle($args) - { - parent::handle($args); - - $this->error = $error; - - if ($this->flink) { - if (!$this->facebook->api_client->users_hasAppPermission('publish_stream') && - $this->facebook->api_client->data_getUserPreference( - FACEBOOK_PROMPTED_UPDATE_PREF) == 'true') { - - // @todo FIXME: Missing i18n? - echo '

REDIRECT TO HOME

'; - } - } else { - $this->showPage(); - } - } - - function showContent() - { - // If the user has opted not to initially allow the app to have - // Facebook status update permission, store that preference. Only - // promt the user the first time she uses the app - if ($this->arg('skip')) { - $this->facebook->api_client->data_setUserPreference( - FACEBOOK_PROMPTED_UPDATE_PREF, 'true'); - } - - if ($this->flink) { - $this->user = $this->flink->getUser(); - - // If this is the first time the user has started the app - // prompt for Facebook status update permission - if (!$this->facebook->api_client->users_hasAppPermission('publish_stream')) { - - if ($this->facebook->api_client->data_getUserPreference( - FACEBOOK_PROMPTED_UPDATE_PREF) != 'true') { - $this->getUpdatePermission(); - return; - } - } - } else { - $this->showLoginForm(); - } - - } - - function showSuccessContent() - { - - } - - function showFormContent() - { - - } - - function title() - { - // @todo FIXME: Give a more precise description? Suggestion: "Login with Facebook Connect" - // TRANS: Page title. - return sprintf(_m('Login')); - } - - function redirectHome() - { - - } -} diff --git a/plugins/Facebook/facebooknoticeform.php b/plugins/Facebook/facebooknoticeform.php deleted file mode 100644 index d52222c933..0000000000 --- a/plugins/Facebook/facebooknoticeform.php +++ /dev/null @@ -1,198 +0,0 @@ -. - * - * @category Form - * @package StatusNet - * @author Evan Prodromou - * @author Sarven Capadisli - * @author Zach Copley - * @copyright 2009 StatusNet, Inc. - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://status.net/ - */ - -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR . '/lib/form.php'; - -/** - * Form for posting a notice from within the Facebook app - * - * @category Form - * @package StatusNet - * @author Evan Prodromou - * @author Sarven Capadisli - * @author Zach Copey - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 - * @link http://status.net/ - * - * @see HTMLOutputter - */ -class FacebookNoticeForm extends Form -{ - /** - * Current action, used for returning to this page. - */ - var $action = null; - - /** - * Pre-filled content of the form - */ - var $content = null; - - /** - * The current user - */ - var $user = null; - - /** - * The notice being replied to - */ - var $inreplyto = null; - - /** - * Constructor - * - * @param HTMLOutputter $out output channel - * @param string $action action to return to, if any - * @param string $content content to pre-fill - */ - function __construct($out=null, $action=null, $content=null, $post_action=null, $user=null, $inreplyto=null) - { - parent::__construct($out); - - $this->action = $action; - $this->post_action = $post_action; - $this->content = $content; - $this->inreplyto = $inreplyto; - - if ($user) { - $this->user = $user; - } else { - $this->user = common_current_user(); - } - - // Note: Facebook doesn't allow multipart/form-data posting to - // canvas pages, so don't try to set it--no file uploads, at - // least not this way. It can be done using multiple servers - // and iFrames, but it's a pretty hacky process. - } - - /** - * ID of the form - * - * @return string ID of the form - */ - function id() - { - return 'form_notice'; - } - - /** - * Class of the form - * - * @return string class of the form - */ - function formClass() - { - return 'form_notice'; - } - - /** - * Action of the form - * - * @return string URL of the action - */ - function action() - { - return $this->post_action; - } - - /** - * Legend of the Form - * - * @return void - */ - function formLegend() - { - // TRANS: Legend. - $this->out->element('legend', null, _m('Send a notice')); - } - - /** - * Data elements - * - * @return void - */ - function formData() - { - if (Event::handle('StartShowNoticeFormData', array($this))) { - $this->out->element('label', array('for' => 'notice_data-text'), - // TRANS: Field label. - sprintf(_m('What\'s up, %s?'), $this->user->nickname)); - // XXX: vary by defined max size - $this->out->element('textarea', array('id' => 'notice_data-text', - 'cols' => 35, - 'rows' => 4, - 'name' => 'status_textarea'), - ($this->content) ? $this->content : ''); - - $contentLimit = Notice::maxContent(); - - if ($contentLimit > 0) { - $this->out->elementStart('dl', 'form_note'); - $this->out->element('dt', null, _m('Available characters')); - $this->out->element('dd', array('id' => 'notice_text-count'), - $contentLimit); - $this->out->elementEnd('dl'); - } - - if ($this->action) { - $this->out->hidden('notice_return-to', $this->action, 'returnto'); - } - $this->out->hidden('notice_in-reply-to', $this->inreplyto, 'inreplyto'); - - Event::handle('StartShowNoticeFormData', array($this)); - } - } - - /** - * Action elements - * - * @return void - */ - function formActions() - { - $this->out->element('input', array('id' => 'notice_action-submit', - 'class' => 'submit', - 'name' => 'status_submit', - 'type' => 'submit', - // TRANS: Button text. - 'value' => _m('BUTTON','Send'))); - } -} diff --git a/plugins/Facebook/facebookqueuehandler.php b/plugins/Facebook/facebookqueuehandler.php deleted file mode 100644 index 524af7bc45..0000000000 --- a/plugins/Facebook/facebookqueuehandler.php +++ /dev/null @@ -1,51 +0,0 @@ -. - */ - -if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } - -require_once INSTALLDIR . '/plugins/Facebook/facebookutil.php'; - -class FacebookQueueHandler extends QueueHandler -{ - function transport() - { - return 'facebook'; - } - - function handle($notice) - { - if ($this->_isLocal($notice)) { - return facebookBroadcastNotice($notice); - } - return true; - } - - /** - * Determine whether the notice was locally created - * - * @param Notice $notice the notice - * - * @return boolean locality - */ - function _isLocal($notice) - { - return ($notice->is_local == Notice::LOCAL_PUBLIC || - $notice->is_local == Notice::LOCAL_NONPUBLIC); - } -} diff --git a/plugins/Facebook/facebookremove.php b/plugins/Facebook/facebookremove.php deleted file mode 100644 index bc76daaef6..0000000000 --- a/plugins/Facebook/facebookremove.php +++ /dev/null @@ -1,73 +0,0 @@ -. - */ - -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php'; - -class FacebookremoveAction extends FacebookAction -{ - function handle($args) - { - parent::handle($args); - - $secret = common_config('facebook', 'secret'); - - $sig = ''; - - ksort($_POST); - - foreach ($_POST as $key => $val) { - if (substr($key, 0, 7) == 'fb_sig_') { - $sig .= substr($key, 7) . '=' . $val; - } - } - - $sig .= $secret; - $verify = md5($sig); - - if ($verify == $this->arg('fb_sig')) { - - $flink = Foreign_link::getByForeignID($this->arg('fb_sig_user'), 2); - - if (!$flink) { - common_log(LOG_ERR, "Tried to delete missing foreign_link entry with Facebook ID " . $this->arg('fb_sig_user')); - $this->serverError(_m('Couldn\'t remove Facebook user: already deleted.')); - return; - } - - common_debug("Removing foreign link to Facebook - local user ID: $flink->user_id, Facebook ID: $flink->foreign_id"); - - $result = $flink->delete(); - - if (!$result) { - common_log_db_error($flink, 'DELETE', __FILE__); - $this->serverError(_m('Couldn\'t remove Facebook user.')); - return; - } - - } else { - # Someone bad tried to remove facebook link? - common_log(LOG_ERR, "Someone from $_SERVER[REMOTE_ADDR] " . - 'unsuccessfully tried to remove a foreign link to Facebook!'); - } - } -} diff --git a/plugins/Facebook/facebooksettings.php b/plugins/Facebook/facebooksettings.php deleted file mode 100644 index 1379b9a9cc..0000000000 --- a/plugins/Facebook/facebooksettings.php +++ /dev/null @@ -1,136 +0,0 @@ -. - */ - -if (!defined('STATUSNET') && !defined('LACONICA')) { - exit(1); -} - -require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php'; - -class FacebooksettingsAction extends FacebookAction -{ - function handle($args) - { - parent::handle($args); - $this->showPage(); - } - - /** - * Show the page content - * - * Either shows the registration form or, if registration was successful, - * instructions for using the site. - * - * @return void - */ - function showContent() - { - if ($this->arg('save')) { - $this->saveSettings(); - } else { - $this->showForm(); - } - } - - function saveSettings() { - - $noticesync = $this->boolean('noticesync'); - $replysync = $this->boolean('replysync'); - - $original = clone($this->flink); - $this->flink->set_flags($noticesync, false, $replysync, false); - $result = $this->flink->update($original); - - if ($result === false) { - $this->showForm(_m('There was a problem saving your sync preferences!')); - } else { - // TRANS: Confirmation that synchronisation settings have been saved into the system. - $this->showForm(_m('Sync preferences saved.'), true); - } - } - - function showForm($msg = null, $success = false) { - - if ($msg) { - if ($success) { - $this->element('fb:success', array('message' => $msg)); - } else { - $this->element('fb:error', array('message' => $msg)); - } - } - - if ($this->facebook->api_client->users_hasAppPermission('publish_stream')) { - - $this->elementStart('form', array('method' => 'post', - 'id' => 'facebook_settings')); - - $this->elementStart('ul', 'form_data'); - - $this->elementStart('li'); - - $this->checkbox('noticesync', _m('Automatically update my Facebook status with my notices.'), - ($this->flink) ? ($this->flink->noticesync & FOREIGN_NOTICE_SEND) : true); - - $this->elementEnd('li'); - - $this->elementStart('li'); - - $this->checkbox('replysync', _m('Send "@" replies to Facebook.'), - ($this->flink) ? ($this->flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) : true); - - $this->elementEnd('li'); - - $this->elementStart('li'); - - // TRANS: Submit button to save synchronisation settings. - $this->submit('save', _m('BUTTON','Save')); - - $this->elementEnd('li'); - - $this->elementEnd('ul'); - - $this->elementEnd('form'); - } else { - // TRANS: %s is the application name. - $instructions = sprintf(_m('If you would like %s to automatically update ' . - 'your Facebook status with your latest notice, you need ' . - 'to give it permission.'), $this->app_name); - - $this->elementStart('p'); - $this->element('span', array('id' => 'permissions_notice'), $instructions); - $this->elementEnd('p'); - - $this->elementStart('ul', array('id' => 'fb-permissions-list')); - $this->elementStart('li', array('id' => 'fb-permissions-item')); - $this->elementStart('fb:prompt-permission', array('perms' => 'publish_stream', - 'next_fbjs' => 'document.setLocation(\'' . "$this->app_uri/settings.php" . '\')')); - $this->element('span', array('class' => 'facebook-button'), - sprintf(_m('Allow %s to update my Facebook status'), common_config('site', 'name'))); - $this->elementEnd('fb:prompt-permission'); - $this->elementEnd('li'); - $this->elementEnd('ul'); - } - } - - function title() - { - // TRANS: Page title for synchronisation settings. - return _m('Sync preferences'); - } -} diff --git a/plugins/Facebook/facebookutil.php b/plugins/Facebook/facebookutil.php deleted file mode 100644 index 3996459a63..0000000000 --- a/plugins/Facebook/facebookutil.php +++ /dev/null @@ -1,409 +0,0 @@ -. - */ - -if (!defined('STATUSNET')) { - exit(1); -} - -require_once INSTALLDIR . '/plugins/Facebook/facebook/facebook.php'; -require_once INSTALLDIR . '/plugins/Facebook/facebookaction.php'; -require_once INSTALLDIR . '/lib/noticelist.php'; - -define("FACEBOOK_SERVICE", 2); // Facebook is foreign_service ID 2 -define("FACEBOOK_NOTICE_PREFIX", 1); -define("FACEBOOK_PROMPTED_UPDATE_PREF", 2); - -function getFacebook() -{ - static $facebook = null; - - $apikey = common_config('facebook', 'apikey'); - $secret = common_config('facebook', 'secret'); - - if ($facebook === null) { - $facebook = new Facebook($apikey, $secret); - } - - if (empty($facebook)) { - common_log(LOG_ERR, 'Could not make new Facebook client obj!', - __FILE__); - } - - return $facebook; -} - -function isFacebookBound($notice, $flink) { - if (empty($flink)) { - common_debug("QQQQQ empty flink"); - return false; - } - - // Avoid a loop - if ($notice->source == 'Facebook') { - common_log(LOG_INFO, "Skipping notice $notice->id because its " . - 'source is Facebook.'); - return false; - } - - // If the user does not want to broadcast to Facebook, move along - if (!($flink->noticesync & FOREIGN_NOTICE_SEND == FOREIGN_NOTICE_SEND)) { - common_log(LOG_INFO, "Skipping notice $notice->id " . - 'because user has FOREIGN_NOTICE_SEND bit off.'); - return false; - } - - // If it's not a reply, or if the user WANTS to send @-replies, - // then, yeah, it can go to Facebook. - if (!preg_match('/@[a-zA-Z0-9_]{1,15}\b/u', $notice->content) || - ($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY)) { - return true; - } - - return false; -} - -function facebookBroadcastNotice($notice) -{ - $facebook = getFacebook(); - $flink = Foreign_link::getByUserID( - $notice->profile_id, - FACEBOOK_SERVICE - ); - - if (isFacebookBound($notice, $flink)) { - // Okay, we're good to go, update the FB status - $fbuid = $flink->foreign_id; - $user = $flink->getUser(); - - try { - // Check permissions - common_debug( - 'FacebookPlugin - checking for publish_stream permission for user ' - . "$user->nickname ($user->id), Facebook UID: $fbuid" - ); - - // NOTE: $facebook->api_client->users_hasAppPermission('publish_stream', $fbuid) - // has been returning bogus results, so we're using FQL to check for - // publish_stream permission now - $fql = "SELECT publish_stream FROM permissions WHERE uid = $fbuid"; - $result = $facebook->api_client->fql_query($fql); - - $canPublish = 0; - - if (!empty($result)) { - $canPublish = $result[0]['publish_stream']; - } - - if ($canPublish == 1) { - common_debug( - "FacebookPlugin - $user->nickname ($user->id), Facebook UID: $fbuid " - . 'has publish_stream permission.' - ); - } else { - common_debug( - "FacebookPlugin - $user->nickname ($user->id), Facebook UID: $fbuid " - . 'does NOT have publish_stream permission. Facebook ' - . 'returned: ' . var_export($result, true) - ); - } - - common_debug( - 'FacebookPlugin - checking for status_update permission for user ' - . "$user->nickname ($user->id), Facebook UID: $fbuid. " - ); - - $canUpdate = $facebook->api_client->users_hasAppPermission( - 'status_update', - $fbuid - ); - - if ($canUpdate == 1) { - common_debug( - "FacebookPlugin - $user->nickname ($user->id), Facebook UID: $fbuid " - . 'has status_update permission.' - ); - } else { - common_debug( - "FacebookPlugin - $user->nickname ($user->id), Facebook UID: $fbuid " - .'does NOT have status_update permission. Facebook ' - . 'returned: ' . var_export($canPublish, true) - ); - } - - // Post to Facebook - if ($notice->hasAttachments() && $canPublish == 1) { - publishStream($notice, $user, $fbuid); - } elseif ($canUpdate == 1 || $canPublish == 1) { - statusUpdate($notice, $user, $fbuid); - } else { - $msg = "FacebookPlugin - Not sending notice $notice->id to Facebook " . - "because user $user->nickname has not given the " . - 'Facebook app \'status_update\' or \'publish_stream\' permission.'; - common_log(LOG_WARNING, $msg); - } - - } catch (FacebookRestClientException $e) { - return handleFacebookError($e, $notice, $flink); - } - } - - return true; -} - -function handleFacebookError($e, $notice, $flink) -{ - $fbuid = $flink->foreign_id; - $user = $flink->getUser(); - $code = $e->getCode(); - $errmsg = $e->getMessage(); - - // XXX: Check for any others? - switch($code) { - case 100: // Invalid parameter - $msg = "FacebookPlugin - Facebook claims notice %d was posted with an invalid parameter (error code 100):" - . "\"%s\" (Notice details: nickname=%s, user ID=%d, Facebook ID=%d, notice content=\"%s\"). " - . "Removing notice from the Facebook queue for safety."; - common_log( - LOG_ERR, sprintf( - $msg, - $notice->id, - $errmsg, - $user->nickname, - $user->id, - $fbuid, - $notice->content - ) - ); - return true; - break; - case 200: // Permissions error - case 250: // Updating status requires the extended permission status_update - remove_facebook_app($flink); - return true; // dequeue - break; - case 341: // Feed action request limit reached - $msg = "FacebookPlugin - User %s (User ID=%d, Facebook ID=%d) has exceeded " - . "his/her limit for posting notices to Facebook today. Dequeuing " - . "notice %d."; - common_log( - LOG_INFO, sprintf( - $msg, - $user->nickname, - $user->id, - $fbuid, - $notice->id - ) - ); - // @fixme: We want to rety at a later time when the throttling has expired - // instead of just giving up. - return true; - break; - default: - $msg = "FacebookPlugin - Facebook returned an error we don't know how to deal with while trying to " - . "post notice %d. Error code: %d, error message: \"%s\". (Notice details: " - . "nickname=%s, user ID=%d, Facebook ID=%d, notice content=\"%s\"). Removing notice " - . "from the Facebook queue for safety."; - common_log( - LOG_ERR, sprintf( - $msg, - $notice->id, - $code, - $errmsg, - $user->nickname, - $user->id, - $fbuid, - $notice->content - ) - ); - return true; // dequeue - break; - } -} - -function statusUpdate($notice, $user, $fbuid) -{ - common_debug( - "FacebookPlugin - Attempting to post notice $notice->id " - . "as a status update for $user->nickname ($user->id), " - . "Facebook UID: $fbuid" - ); - - $facebook = getFacebook(); - $result = $facebook->api_client->users_setStatus( - $notice->content, - $fbuid, - false, - true - ); - - common_debug('Facebook returned: ' . var_export($result, true)); - - common_log( - LOG_INFO, - "FacebookPlugin - Posted notice $notice->id as a status " - . "update for $user->nickname ($user->id), " - . "Facebook UID: $fbuid" - ); -} - -function publishStream($notice, $user, $fbuid) -{ - common_debug( - "FacebookPlugin - Attempting to post notice $notice->id " - . "as stream item with attachment for $user->nickname ($user->id), " - . "Facebook UID: $fbuid" - ); - - $fbattachment = format_attachments($notice->attachments()); - - $facebook = getFacebook(); - $facebook->api_client->stream_publish( - $notice->content, - $fbattachment, - null, - null, - $fbuid - ); - - common_log( - LOG_INFO, - "FacebookPlugin - Posted notice $notice->id as a stream " - . "item with attachment for $user->nickname ($user->id), " - . "Facebook UID: $fbuid" - ); -} - -function format_attachments($attachments) -{ - $fbattachment = array(); - $fbattachment['media'] = array(); - - foreach($attachments as $attachment) - { - if($enclosure = $attachment->getEnclosure()){ - $fbmedia = get_fbmedia_for_attachment($enclosure); - }else{ - $fbmedia = get_fbmedia_for_attachment($attachment); - } - if($fbmedia){ - $fbattachment['media'][]=$fbmedia; - }else{ - $fbattachment['name'] = ($attachment->title ? - $attachment->title : $attachment->url); - $fbattachment['href'] = $attachment->url; - } - } - if(count($fbattachment['media'])>0){ - unset($fbattachment['name']); - unset($fbattachment['href']); - } - return $fbattachment; -} - -/** -* given an File objects, returns an associative array suitable for Facebook media -*/ -function get_fbmedia_for_attachment($attachment) -{ - $fbmedia = array(); - - if (strncmp($attachment->mimetype, 'image/', strlen('image/')) == 0) { - $fbmedia['type'] = 'image'; - $fbmedia['src'] = $attachment->url; - $fbmedia['href'] = $attachment->url; - } else if ($attachment->mimetype == 'audio/mpeg') { - $fbmedia['type'] = 'mp3'; - $fbmedia['src'] = $attachment->url; - }else if ($attachment->mimetype == 'application/x-shockwave-flash') { - $fbmedia['type'] = 'flash'; - - // http://wiki.developers.facebook.com/index.php/Attachment_%28Streams%29 - // says that imgsrc is required... but we have no value to put in it - // $fbmedia['imgsrc']=''; - - $fbmedia['swfsrc'] = $attachment->url; - }else{ - return false; - } - return $fbmedia; -} - -function remove_facebook_app($flink) -{ - - $user = $flink->getUser(); - - common_log(LOG_INFO, 'Removing Facebook App Foreign link for ' . - "user $user->nickname (user id: $user->id)."); - - $result = $flink->delete(); - - if (empty($result)) { - common_log(LOG_ERR, 'Could not remove Facebook App ' . - "Foreign_link for $user->nickname (user id: $user->id)!"); - common_log_db_error($flink, 'DELETE', __FILE__); - } - - // Notify the user that we are removing their FB app access - - $result = mail_facebook_app_removed($user); - - if (!$result) { - - $msg = 'Unable to send email to notify ' . - "$user->nickname (user id: $user->id) " . - 'that their Facebook app link was ' . - 'removed!'; - - common_log(LOG_WARNING, $msg); - } -} - -/** - * Send a mail message to notify a user that her Facebook Application - * access has been removed. - * - * @param User $user user whose Facebook app link has been removed - * - * @return boolean success flag - */ -function mail_facebook_app_removed($user) -{ - $profile = $user->getProfile(); - - $site_name = common_config('site', 'name'); - - common_switch_locale($user->language); - - $subject = sprintf( - _m('Your %1$s Facebook application access has been disabled.', - $site_name)); - - $body = sprintf(_m("Hi, %1\$s. We're sorry to inform you that we are " . - 'unable to update your Facebook status from %2$s, and have disabled ' . - 'the Facebook application for your account. This may be because ' . - 'you have removed the Facebook application\'s authorization, or ' . - 'have deleted your Facebook account. You can re-enable the ' . - 'Facebook application and automatic status updating by ' . - "re-installing the %2\$s Facebook application.\n\nRegards,\n\n%2\$s"), - $user->nickname, $site_name); - - common_switch_locale(); - return mail_to_user($user, $subject, $body); -} diff --git a/plugins/Facebook/fbfavicon.ico b/plugins/Facebook/fbfavicon.ico deleted file mode 100644 index c57c0342fa643996277f32384d4d64decf1def26..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1150 zcmZQzU<5(|0R}M0U}0bo1F|%L7$l?s#Ef8)fx!VNM+>l~GV%Y6NNbWXNDs^{^O9Wu zZ)wTJiT^_ZvKo*cYUwBBc9{L>>R|Sxi=*=gO8=L4um6KE48Zs>_YrbGOdmQ;tbUj} zn0^=^Mia6hrjAnm$YB673uZ2{_OGr;KnX`u^~2Po(=huf%|9@6$f5uLpS`Dnk%566 I{2!PD0Wn1VCIA2c diff --git a/plugins/Facebook/locale/Facebook.pot b/plugins/Facebook/locale/Facebook.pot deleted file mode 100644 index b70a0f8ec8..0000000000 --- a/plugins/Facebook/locale/Facebook.pot +++ /dev/null @@ -1,535 +0,0 @@ -# SOME DESCRIPTIVE TITLE. -# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "" - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "" - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "" - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "" - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "" - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "" - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "" - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "" - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "" - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "" - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "" - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "" - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "" - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "" - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "" - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "" - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "" - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" - -#: facebookaction.php:235 -msgid " a new account." -msgstr "" - -#: facebookaction.php:242 -msgid "Register" -msgstr "" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "" - -#: facebookaction.php:431 -msgid "Notices" -msgstr "" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "" - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr "" - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "" - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "" - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "" - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "" - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "" - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "" - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "" diff --git a/plugins/Facebook/locale/be-tarask/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/be-tarask/LC_MESSAGES/Facebook.po deleted file mode 100644 index cef809c7c6..0000000000 --- a/plugins/Facebook/locale/be-tarask/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,562 +0,0 @@ -# Translation of StatusNet - Facebook to Belarusian (Taraškievica orthography) (‪Беларуская (тарашкевіца)‬) -# Exported from translatewiki.net -# -# Author: EugeneZelenko -# Author: Jim-by -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:42+0000\n" -"Language-Team: Belarusian (Taraškievica orthography) \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: be-tarask\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" -"Вітаем, %1$s!\n" -"\n" -"На жаль, мы вымушаныя паведаміць Вам, што ня можам абнавіць Ваш статус у " -"Facebook з %2$s, і выключаем дастасаваньне Facebook для Вашага рахунку. Гэта " -"магло здарыцца, таму што Вы выдалілі аўтарызацыю для дастасаваньня Facebook, " -"ці выдалілі Ваш рахунак на Facebook. Вы можаце зноў уключыць дастасаваньне " -"Facebook і аўтаматычнае абнаўленьне статусу пасьля паўторнага ўсталяваньня " -"дастасаваньне Facebook %2$s.\n" -"\n" -"З павагай,\n" -"%2$s" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "Вам неабходна ўвайсьці ў Facebook для выкарыстаньня Facebook Connect." - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "Ужо існуе лякальны карыстальнік злучаны з гэтым рахункам Facebook." - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "Узьнікла праблема з ключом Вашай сэсіі. Калі ласка, паспрабуйце зноў." - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "Вы ня можаце зарэгістравацца, калі Вы ня згодны з умовамі ліцэнзіі." - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "Узьнікла невядомая памылка." - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" -"Вы ўпершыню ўвайшлі ў %s, таму мы павінны злучыць Ваш рахунак на Facebook з " -"лякальным рахункам. Вы можаце стварыць новы рахунак, ці злучыць з ўжо " -"існуючым Вашым рахункам, калі Вы яго маеце." - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "Устаноўка рахунку на Facebook" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "Устаноўкі злучэньня" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" -"Мой тэкст і файлы даступныя на ўмовах %s за выключэньнем гэтых асабістых " -"зьвестак: пароль, адрас электроннай пошты, IM-адрас, і нумар тэлефона." - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Стварыць новы рахунак" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Стварыць новага карыстальніка з гэтай мянушкай." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Новая мянушка" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "1-64 малых літараў ці лічбаў, ніякай пунктуацыі ці прагалаў" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Стварыць" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "Далучыць існуючы рахунак" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" -"Калі Вы ўжо маеце рахунак, увайдзіце з Вашым імем карыстальніка і паролем, " -"каб далучыць яго да рахунку на Facebook." - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "Існуючая мянушка" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Пароль" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Злучыць" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "Рэгістрацыя не дазволеная." - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "Няслушны код запрашэньня." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "Мянушка забароненая." - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "Мянушка ўжо выкарыстоўваецца. Паспрабуйце іншую." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "Памылка далучэньня карыстальніка да Facebook." - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "Няслушнае імя карыстальніка ці пароль." - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Увайсьці" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "Даслаць паведамленьне" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "Як справы, %s?" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Даступныя сымбалі" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Даслаць" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "Памылка сэрвэра: немагчыма атрымаць карыстальніка!" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "Няслушнае імя карыстальніка ці пароль." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s і сябры, старонка %2$d" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s і сябры" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" -"Калі Вы жадаеце, каб дастасаваньне %s аўтаматычна абнаўляла Ваш статус у " -"Facebook з апошнімі паведамленьнямі, Вы павінны даць дазвол." - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "Так, зрабіць гэта!" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Прапусьціць" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "Нумарацыя старонак" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Пасьля" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Перад" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "Дзякуем за запрашэньне Вашых сяброў карыстацца %s." - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "Запрашэньні былі дасланыя наступным карыстальнікам:" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "Вы былі запрошаныя ў %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "Запрасіць Вашых сяброў карыстацца %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "Сябры, якія ўжо карыстаюцца %s:" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Даслаць запрашэньні" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "Налады інтэграцыі Facebook" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "Карыстальнік злучэньня Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "Увайсьці ці зарэгістравацца з выкарыстаньнем Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "" - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "" - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "" - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" - -#: facebookaction.php:235 -msgid " a new account." -msgstr "" - -#: facebookaction.php:242 -msgid "Register" -msgstr "" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "" - -#: facebookaction.php:431 -msgid "Notices" -msgstr "" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "" - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr "" - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "" - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "" - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "" - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "" - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "" - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "" - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "" diff --git a/plugins/Facebook/locale/br/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/br/LC_MESSAGES/Facebook.po deleted file mode 100644 index 282f8fbea6..0000000000 --- a/plugins/Facebook/locale/br/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,544 +0,0 @@ -# Translation of StatusNet - Facebook to Breton (Brezhoneg) -# Exported from translatewiki.net -# -# Author: Fulup -# Author: Y-M D -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:42+0000\n" -"Language-Team: Breton \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: br\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "" -"Rankout a rit bezañ kevreet war Facebook evit implijout Facebook Connect." - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "Un implijer lec'hel liammet d'ar gont Facebook-se a zo dija." - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "Ur gudenn 'zo bet gant ho jedaouer dalc'h. Mar plij adklaskit." - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "" -"Rankout a rit bezañ a-du gant termenoù an aotre-implijout evit krouiñ ur " -"gont." - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "Ur gudenn dizanv a zo bet." - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "Kefluniadur ar gont Facebook" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "Dibarzhioù kevreañ" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Krouiñ ur gont nevez" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Krouiñ un implijer nevez gant al lesanv-se." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Lesanv nevez" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "1 da 64 lizherenn vihan pe sifr, hep poentaouiñ nag esaouenn" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Krouiñ" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "Kevreañ d'ur gont a zo dioutañ" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "Lesanv a zo dioutañ" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Ger-tremen" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Kevreañ" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "N'eo ket aotreet krouiñ kontoù." - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "N'eo ket reizh ar c'hod pedadenn." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "Lesanv nann-aotreet." - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "Implijet eo dija al lesanv-se. Klaskit unan all." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "" - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "Anv implijer pe ger-tremen direizh." - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Kevreañ" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "Kas un ali" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "Penaos 'mañ kont, %s ?" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Arouezennoù a chom" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Kas" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "Anv implijer pe ger-tremen direizh." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s hag e vignoned, pajenn %2$d" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s hag e vignoned" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "Ok, en ober !" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Mont hebiou" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "Pajennadur" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "War-lerc'h" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "A-raok" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "Trugarez da bediñ ho mignoned da implijout %s." - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "Pedadennoù a zo bet kaset d'an implijerien da-heul :" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "Pedet oc'h bet da %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "Pedit ho mignoned da implijout %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "Mignoned hag a implij dija %s :" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Kas pedadennoù" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "Implijer Facebook Connect" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "Kevreañ pe en em enskrivañ dre Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "Arventennoù evit Facebook Connect" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "Kevreet oc'h dija." - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "Kevreit gant ho kont Facebook" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "Kevreadenn Facebook" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "" - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "Dibosupl eo dilemel an implijer Facebook." - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "Degemer" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "Degemer" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "Pediñ" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "Pediñ" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Arventennoù" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Penndibaboù" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" - -#: facebookaction.php:235 -msgid " a new account." -msgstr "ur gont nevez." - -#: facebookaction.php:242 -msgid "Register" -msgstr "En em enskrivañ" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "Lesanv" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Kevreañ" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "Ha kollet ho peus ho ker-tremen ?" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "Danvez ebet en ali !" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "Re hir eo ! Ment hirañ an ali a zo a %d arouezenn." - -#: facebookaction.php:431 -msgid "Notices" -msgstr "Alioù" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "Facebook" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "Arventennoù enframmañ Facebook" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "Arventennoù poellad Facebook" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "Alc'hwez API" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "Alc'hwez API pourchaset gant Facebook" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "Kuzh" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "Alc'hwez API kuzh pourchaset gant Facebook" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Enrollañ" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "Enrollañ arventennoù Facebook" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "Merañ an doare ma kevre ho kont ouzh Facebook" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "" - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "Implijer Facebook kevreet" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "Digevreañ ma c'hont deus Facebook" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "Termeniñ ur ger-tremen" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr "da gentañ." - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "Digevrañ" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "N'eus ket bet gallet diverkañ al liamm war-du Facebook." - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "" - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "N'omp ket sur eus ar pezh emaoc'h o klask ober aze." - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "" - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "" - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "Kas respontoù \"@\" da Facebook." - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Enrollañ" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "Penndibaboù ar c'hempredañ" diff --git a/plugins/Facebook/locale/ca/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/ca/LC_MESSAGES/Facebook.po deleted file mode 100644 index 8628e7e777..0000000000 --- a/plugins/Facebook/locale/ca/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,575 +0,0 @@ -# Translation of StatusNet - Facebook to Catalan (Català) -# Exported from translatewiki.net -# -# Author: Toniher -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-30 22:50+0000\n" -"PO-Revision-Date: 2011-01-30 22:53:17+0000\n" -"Language-Team: Catalan \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-29 22:24:12+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81224); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: ca\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" -"Hola, %1$s. lamentem informar-vos que no podem actualitzar l'estat del " -"vostre Facebook des de %2$s, i hem inhabilitat l'aplicació del Facebook del " -"vostre compte. Això pot ser perquè hagiu eliminat l'autorització de " -"l'aplicació al Facebook, o perquè hàgiu eliminat el vostre compte del " -"Facebook. Podeu tornar a habilitar l'aplicació del Facebook i " -"l'actualització automàtica d'estat reinstal·lant l'aplicació de Facebook de %" -"2$s.\n" -"\n" -"Atentament,\n" -"\n" -"%2$s" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "" -"Heu d'iniciar una sessió al Facebook per fer servir el Facebook Connect." - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "Ja hi ha un usuari local enllaçat amb aquest compte del Facebook." - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "" -"S'ha produït un problema amb el testimoni de la vostre sessió. Torneu-ho a " -"provar." - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "No us podeu registrar si no accepteu la llicència." - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "S'ha produït un error desconegut." - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" -"És la primera vegada que inicieu una sessió a %s, per tant hem de connectar " -"el vostre Facebook a un compte local. Podeu crear un compte nou, o bé " -"connectar-vos amb un ja existent si ja en teniu un." - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "Configuració del compte del Facebook" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "Opcions de connexió" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" -"El meu text i fitxers es troben disponibles sota %s, excepte les dades " -"privades següents: contrasenya, adreça electrònica, adreça de MI i número de " -"telèfon." - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Crea un compte nou" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Crea un compte nou amb aquest sobrenom." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Nou sobrenom" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "" -"1-64 lletres en minúscules o nombres, sense signes de puntuació o espais" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Crea" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "Connecta un compte existent" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" -"Si ja teniu un compte, inicieu una sessió amb el nom d'usuari i contrasenya " -"per connectar-lo al vostre Facebook." - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "Sobrenom ja existent" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Contrasenya" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Connecta" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "No es permet el registre" - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "No és un codi d'invitació vàlid." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "No es permet el sobrenom." - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "El sobrenom ja és en ús. Proveu-ne un altre." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "S'ha produït un error en connectar l'usuari al Facebook." - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "Nom d'usuari o contrasenya no vàlids." - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Inici de sessió" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "Envia un avís" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "Com va, %s?" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Caràcters disponibles" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Envia" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "Error del servidor: no es pot obtenir l'usuari!" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "Usuari o contrasenya incorrectes." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s i amics, pàgina %2$d" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s i amics" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" -"Si voleu que l'aplicació %s actualitzi automàticament el vostre estat del " -"Facebook amb el darrer avís, cal que li doneu permisos." - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "Endavant, fes-ho!" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Omet" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "Paginació" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Després" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Abans" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "Gràcies per convidar els vostres amics perquè facin servir el %s." - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "S'han enviat invitacions als usuaris següents:" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "Us han convidat a %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "Convideu els vostres amics a fer servir %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "Amics que ja fan servir %s:" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Envia invitacions" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "Configuració d'integració del Facebook" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "Usuari de connexió del Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "Inicieu una sessió o registreu-vos fent servir el Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "Paràmetres de connexió del Facebook" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" -"El connector del Facebook permet integrar instàncies de l'StatusNet amb el " -"Facebook i el Facebook Connect." - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "Ja heu iniciat una sessió." - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "Inicieu una sessió amb el compte del Facebook" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "Inici de sessió del Facebook" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "No s'ha pogut eliminar l'usuari del Facebook: ja s'ha eliminat." - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "No s'ha pogut eliminar l'usuari del Facebook." - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "Inici" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "Inici" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "Convida" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "Convida" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Paràmetres" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Paràmetres" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" -"Per fer servir l'aplicació del Facebook %s cal que inicieu una sessió amb el " -"vostre usuari i contrasenya. No teniu cap nom d'usuari encara?" - -#: facebookaction.php:235 -msgid " a new account." -msgstr " un compte nou." - -#: facebookaction.php:242 -msgid "Register" -msgstr "Registre" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "Sobrenom" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Inici de sessió" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "Heu perdut o oblidat la contrasenya?" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "No hi ha contingut a l'avís!" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "És massa llarg. La mida màxima d'un avís són %d caràcters." - -#: facebookaction.php:431 -msgid "Notices" -msgstr "Avisos" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "Facebook" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "Paràmetres d'integració del Facebook" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "Clau API del Facebook no vàlida. La longitud màxima són 255 caràcters." - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" -"Clau secreta API del Facebook no vàlida. La longitud màxima són 255 " -"caràcters." - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "Paràmetres d'aplicació del Facebook" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "Clau API" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "Clau API proporcionada pel Facebook" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "Clau secreta" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "Clau secreta API proporcionada pel Facebook" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Desa" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "Desa els paràmetres del Facebook" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "Gestiona com el vostre compte es connecta al Facebook" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "No hi ha cap usuari del Facebook connectat a aquest compte." - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "Usuari del Facebook connectat" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "Desconnecta el meu compte del Facebook" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" -"Si desconnecteu el vostre Facebook, serà impossible iniciar una sessió!" - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "definiu una contrasenya" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr " abans de res." - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "Desconnecta" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "No s'ha pogut eliminar l'enllaç al Facebook." - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "Us heu desconnectat del Facebook." - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "No estic segur del que proveu de fer." - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "S'ha produït un problema en desar les preferències de sincronització!" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "S'han desat les preferències de sincronització." - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "" -"Actualitza automàticament el meu estat del Facebook amb els meus avisos." - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "Envia respostes «@» al Facebook." - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Desa" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" -"Si voleu que %s actualitzi automàticament el vostre estat del Facebook amb " -"el darrer avís, cal que li doneu permís." - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "Permet que %s actualitzi el meu estat del Facebook" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "Preferències de sincronització" diff --git a/plugins/Facebook/locale/de/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/de/LC_MESSAGES/Facebook.po deleted file mode 100644 index f28334bffc..0000000000 --- a/plugins/Facebook/locale/de/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,578 +0,0 @@ -# Translation of StatusNet - Facebook to German (Deutsch) -# Exported from translatewiki.net -# -# Author: Michael -# Author: The Evil IP address -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:43+0000\n" -"Language-Team: German \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: de\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" -"Hallo %1$s. Wir konnten leider nicht deinen Facebook-Status von %2$s aus " -"aktualisieren und haben daher das Facebook-Programm für dein Benutzerkonto " -"deaktiviert. Dies könnte daran liegen, dass du die Erlaubnis des Facebook-" -"Programms entfernt hast oder dein Facebook-Benutzerkonto gelöscht hast. Du " -"kannst das Facebook-Programm und die automatische Aktualisierung des Status, " -"indem du das %2$s-Facebook-Programm neu installierst.\n" -"\n" -"Mit freundlichen Grüßen,\n" -"\n" -"%2$s" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "" -"Du musst auf Facebook eingeloggt sein, um Facebook Connect benutzen zu " -"können." - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "" -"Es gibt bereits einen lokalen Benutzer, der mit diesem Facebook-" -"Benutzerkonto verknüpft ist." - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "Es gab ein Problem mit deinem Sitzungstoken. Bitte versuche es erneut." - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "" -"Du kannst dich nicht registrieren, wenn du die Lizenz nicht akzeptierst." - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "Ein unbekannter Fehler ist aufgetreten." - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" -"Dies ist das erste Mal, dass du dich auf %s anmeldest, sodass wir dein " -"Facebook-Benutzerkonto mit einem lokalen Benutzerkonto verbinden müssen. Du " -"kannst entweder ein neues Benutzerkonto erstellen oder dich mit deinem " -"existierendem Benutzerkonto verbinden." - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "Verbindungsoptionen" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" -"Abgesehen von den folgenden Daten: Passwort, E-Mail-Adresse, IM-Adresse und " -"Telefonnummer, sind all meine Texte und Dateien unter %s verfügbar." - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Neues Benutzerkonto erstellen" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Neues Benutzerkonto mit diesem Benutzernamen erstellen." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Neuer Benutzername" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "1-64 Kleinbuchstaben oder Zahlen, keine Satz- oder Leerzeichen" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Erstellen" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "Bestehendes Benutzerkonto verbinden" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" -"Wenn du bereits ein Benutzerkonto hast, melde dich mit deinem Benutzernamen " -"und Passwort an, um ihn mit Facebook zu verbinden." - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "Bestehender Benutzername" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Passwort" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Verbinden" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "Registrierung nicht erlaubt." - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "Kein gültiger Einladungscode." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "Benutzername nicht erlaubt." - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "Benutzername wird bereits verwendet. Suche dir einen anderen aus." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "Fehler beim Verbinden des Benutzers mit Facebook." - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "Benutzername oder Passwort falsch." - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Anmelden" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "Nachricht senden" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "Was geht, %s?" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Verfügbare Zeichen" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Senden" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "Server-Fehler: Konnte Benutzer nicht kriegen!" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "Falscher Benutzername oder Passwort." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s und Freunde, Seite %2$d" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s und Freunde" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" -"Wenn du möchtest, dass das %s-Programm automatisch deinen Facebook-Status " -"mit deiner neuesten Nachricht aktualisiert, musst du ihm die Erlaubnis dazu " -"geben." - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "Okay, mach es!" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Überspringen" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Nach" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Vor" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "Danke für das Einladen deiner Freunde auf %s." - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "Einladungen wurden an die folgenden Benutzer gesendet:" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "Du wurdest auf %s eingeladen" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "Lade deine Freunde auf %s ein" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "Auf %s bereits angemeldete Freunde" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Einladungen senden" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "Mit Facebook anmelden oder registrieren" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" -"Das Facebook-Plugin integriert StatusNet mit Facebook und Facebook Connect." - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "Bereits angemeldet." - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "Logge dich mit deinem Facebook-Benutzerkonto ein" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "Facebook Login" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "Konnte Facebook-Benutzer nicht entfernen: bereits gelöscht." - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "Konnte Facebook-Benutzer nicht entfernen." - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "Startseite" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "Startseite" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "Einladen" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "Einladen" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Einstellungen" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Einstellungen" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" -"Um das %s-Facebook-Programm zu benutzen, musst du dich mit deinem " -"Benutzernamen und Passwort einloggen. Hast du noch keinen Benutzernamen?" - -#: facebookaction.php:235 -msgid " a new account." -msgstr "" - -#: facebookaction.php:242 -msgid "Register" -msgstr "Registrieren" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "Benutzername" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Anmelden" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "Passwort vergessen?" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "Kein Nachrichten-Inhalt!" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "" -"Das war zu lang. Die Länge einer Nachricht ist auf %d Zeichen beschränkt." - -#: facebookaction.php:431 -msgid "Notices" -msgstr "Nachrichten" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "Facebook" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "" -"Ungültiger Facebook-API-Schlüssel. Die maximale Länge liegt bei 255 Zeichen." - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "API-Schlüssel" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "Von Facebook bereitgestellter API-Schlüssel" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "Geheim" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Speichern" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "Facebook-Einstellungen speichern" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "Verwalte, wie dein Benutzerkonto sich mit Facebook verbindet" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "" -"Es gibt keinen Facebook-Benutzer, der mit diesem Benutzerkonto verbunden ist." - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "Verbundener Facebook-Benutzer" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "Passwort vergeben" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr "" - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "Abmelden" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "Link zu Facebook konnte nicht gelöscht werden." - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "Sie sind bei Facebook abgemeldet." - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "Prozess konnte nicht verarbeitet werden." - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" -"Es gab ein Problem beim Speichern deiner Synchronisierungs-Einstellungen!" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "Synchronisierungs-Einstellungen gespeichert." - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "" -"Meinen Facebook-Status automatisch mit meinen Nachrichten aktualisieren." - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "@-Antworten an Facebook versenden." - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Speichern" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" -"Wenn du möchtest, dass %s automatisch deinen Facebook-Status mit deiner " -"neuesten Nachricht aktualisiert, musst du ihm die Erlaubnis dazu geben." - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "%s erlauben, meinen Facebook-Status zu aktualisieren" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "Synchronisierungs-Einstellungen" diff --git a/plugins/Facebook/locale/es/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/es/LC_MESSAGES/Facebook.po deleted file mode 100644 index 39381fe624..0000000000 --- a/plugins/Facebook/locale/es/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,563 +0,0 @@ -# Translation of StatusNet - Facebook to Spanish (Español) -# Exported from translatewiki.net -# -# Author: Locos epraix -# Author: Peter17 -# Author: Translationista -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:43+0000\n" -"Language-Team: Spanish \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: es\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: facebookutil.php:429 -#, fuzzy, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" -"Hola, %$1s: Lamentamos informarte que no podemos actualizar tu estado de " -"Facebook desde %$2s y hemos inhabilitado la aplicación de Facebook en tu " -"cuenta. Esto puede deberse a que has eliminado la autorización de Facebook o " -"porque hax borrado tu cuenta de Facebook. Puedes volver a habilitar la " -"aplicación de Facebook y la actualización automática de estados mediante la " -"reinstalación de la aplicación de Facebook %2$s." - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "" -"Debes haber iniciado sesión en Facebook para poder utilizar Facebook Connect." - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "Ya hay un usuario local vinculado a esta cuenta de Facebook." - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "" -"Hubo un problema con tu token de sesión. Por favor, inténtalo de nuevo." - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "No puedes registrarte si no estás de acuerdo con la licencia." - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "Ha ocurrido un error desconocido." - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" -"Esta es la primera vez que inicias sesión en %s, así que debemos conectar " -"Facebook a una cuenta local. Puedes crear una cuenta nueva o conectarte con " -"tu cuenta, de tenerla." - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "Configuración de cuenta de Facebook" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "Opciones de conexión" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" -"Mi texto y archivos están disponibles en %s, salvo estos datos privados: " -"contraseña, dirección de correo electrónico, dirección de mensajería " -"instantánea y número de teléfono." - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Crear cuenta nueva" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Crear un nuevo usuario con este nombre de usuario." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Nuevo nombre de usuario" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "" -"1-64 letras en minúscula o números, sin signos de puntuación o espacios" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Crear" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "Conectar cuenta existente" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" -"Si ya tienes una cuenta, ingresa con tu nombre de usuario y contraseña para " -"conectarte a tu Facebook." - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "El nombre de usuario ya existe" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Contraseña" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Conectar" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "Registro de usuario no permitido." - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "No es un código de invitación válido." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "Nombre de usuario no autorizado." - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "El nombre de usuario ya existe. Prueba con otro." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "Error de conexión del usuario a Facebook." - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "Nombre de usuario o contraseña inválidos." - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Iniciar sesión" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "Enviar un mensaje" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "¿Qué tal, %s?" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Caracteres disponibles" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Enviar" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "Error de servidor: ¡No se pudo obtener el usuario!" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "" -"Nombre de usuario o contraseña incorrectos\n" -"." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, fuzzy, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%s y sus amistades" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s y sus amistades" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" -"Si desesa que la aplicación %s actualice automáticamente tu estado de " -"Facebook con tu último mensaje, tienes que darle permiso." - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "Ok, ¡hazlo!" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Omitir" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "Paginación" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Después" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Antes" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "Gracias por invitar a tus amistades a usar %s." - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "Se ha enviado invitaciones a los siguientes usuarios:" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "Te han invitado a %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "Invita a tus amistades a usar %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "Amistades que ya usan %s:" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Enviar invitaciones" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "Configuración de integración de Facebook" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "" - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "" - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "" - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "Pagina principal" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "Pagina principal" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "Invitar" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "Invitar" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Preferencias" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Preferencias" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" - -#: facebookaction.php:235 -msgid " a new account." -msgstr "" - -#: facebookaction.php:242 -msgid "Register" -msgstr "Registrarse" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "Nickname" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Iniciar sesión" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "" - -#: facebookaction.php:431 -msgid "Notices" -msgstr "Avisos" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "Facebook" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "Configuración de integración de Facebook" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "Secreto" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Guardar" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "" - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "establecer una contraseña" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr "" - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "" - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "" - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "" - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "" - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "" - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "" - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Guardar" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "" diff --git a/plugins/Facebook/locale/fr/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/fr/LC_MESSAGES/Facebook.po deleted file mode 100644 index eb9f440878..0000000000 --- a/plugins/Facebook/locale/fr/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,581 +0,0 @@ -# Translation of StatusNet - Facebook to French (Français) -# Exported from translatewiki.net -# -# Author: Peter17 -# Author: Verdy p -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:43+0000\n" -"Language-Team: French \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: fr\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" -"Salut, %1$s. Nous sommes désolés de vous informer que nous ne sommes pas en " -"mesure de mettre à jour votre statut Facebook depuis %2$s et que nous avons " -"désactivé l’application Facebook sur votre compte. C’est peut-être parce que " -"vous avez retiré l’autorisation de l’application Facebook, ou avez supprimé " -"votre compte Facebook. Vous pouvez réactiver l’application Facebook et la " -"mise à jour d’état automatique en réinstallant l’application %2$s pour " -"Facebook.\n" -"\n" -"Cordialement,\n" -"\n" -"%2$s" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "Vous devez être identifié sur Facebook pour utiliser Facebook Connect." - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "Il existe déjà un utilisateur local lié à ce compte Facebook." - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "" -"Un problème est survenu avec votre jeton de session. Veuillez essayer à " -"nouveau." - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "Vous ne pouvez pas vous inscrire si vous n’acceptez pas la licence." - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "Une erreur inconnue s’est produite." - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" -"C’est la première fois que vous êtes connecté à %s via Facebook, il nous " -"faut donc lier votre compte Facebook à un compte local. Vous pouvez soit " -"créer un nouveau compte, soit vous connecter avec votre compte local " -"existant si vous en avez un." - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "Configuration du compte Facebook" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "Options de connexion" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" -"Mon texte et mes fichiers sont disponibles sous licence %s, à l’exception " -"des données privées suivantes : mot de passe, adresse courriel, adresse de " -"messagerie instantanée et numéro de téléphone." - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Créer un nouveau compte" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Créer un nouvel utilisateur avec ce pseudonyme." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Nouveau pseudonyme" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "1 à 64 lettres minuscules ou chiffres, sans ponctuation ni espaces" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Créer" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "Se connecter à un compte existant" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" -"Si vous avez déjà un compte ici, connectez-vous avec votre nom d’utilisateur " -"et mot de passe pour l’associer à votre compte Facebook." - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "Pseudonyme existant" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Mot de passe" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Connexion" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "Inscription non autorisée." - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "Le code d’invitation n’est pas valide." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "Pseudonyme non autorisé." - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "Pseudonyme déjà utilisé. Essayez-en un autre." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "Erreur de connexion de l’utilisateur à Facebook." - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "Nom d’utilisateur ou mot de passe incorrect." - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Connexion" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "Envoyer un avis" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "Quoi de neuf, %s ?" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Caractères restants" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Envoyer" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "Erreur de serveur : impossible d’obtenir l’utilisateur !" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "Nom d’utilisateur ou mot de passe incorrect." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s et ses amis, page %2$d" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s et ses amis" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" -"Si vous souhaitez que l’application %s mette à jour automatiquement votre " -"statut Facebook avec votre dernier avis, vous devez lui en donner " -"l’autorisation." - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "Ok, le faire !" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Sauter cette étape" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "Pagination" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Après" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Avant" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "Merci d’inviter vos amis à utiliser %s." - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "Des invitations ont été envoyées aux utilisateurs suivants :" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "Vous avez été invité à %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "Invitez vos amis à utiliser %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "Amis utilisant déjà %s :" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Envoyer des invitations" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "Configuration de l’intégration Facebook" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "Utilisateur de Facebook Connect" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "Se connecter ou s’inscrire via Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "Paramètres pour Facebook Connect" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" -"Le greffon Facebook permet d’intégrer des instances StatusNet avec Facebook et Facebook Connect." - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "Déjà connecté." - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "Connectez-vous avec votre compte Facebook" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "Connexion Facebook" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "Impossible de supprimer l’utilisateur Facebook : déjà supprimé." - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "Impossible de supprimer l’utilisateur Facebook." - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "Accueil" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "Accueil" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "Inviter" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "Inviter" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Paramètres" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Préférences de l’utilisateur" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" -"Pour utiliser l’application %s pour Facebook, vous devez vous identifier " -"avec votre nom d’utilisateur et mot de passe. Vous n’avez pas encore un nom " -"d’utilisateur ?" - -#: facebookaction.php:235 -msgid " a new account." -msgstr "un nouveau compte." - -#: facebookaction.php:242 -msgid "Register" -msgstr "S’inscrire" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "Pseudonyme" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Connexion" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "Mot de passe perdu ou oublié ?" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "Aucun contenu dans l’avis !" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "C’est trop long ! La taille maximale de l’avis est de %d caractères." - -#: facebookaction.php:431 -msgid "Notices" -msgstr "Avis publiés" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "Facebook" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "Paramètres d’intégration Facebook" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "" -"Clé invalide pour l’API Facebook. La longueur maximum est de 255 caractères." - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" -"Code secret invalide pour l’API Facebook. La longueur maximum est de 255 " -"caractères." - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "Paramètres de l’application Facebook" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "Clé API" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "Clé API fournie par Facebook" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "Code secret" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "Code secret pour l’API fourni par Facebook" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Sauvegarder" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "Sauvegarder les paramètres Facebook" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "Gérez la façon dont votre compte se connecte à Facebook" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "Il n’y a pas d’utilisateur Facebook connecté à ce compte." - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "Utilisateur Facebook connecté" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "Déconnecter mon compte de Facebook" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" -"La déconnexion de votre compte Facebook ne vous permettrait plus de vous " -"connecter ! S’il vous plaît " - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "définissez un mot de passe" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr " tout d’abord." - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "Déconnecter" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "Impossible de supprimer le lien vers Facebook." - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "Vous avez été déconnecté de Facebook." - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "Pas certain de ce que vous essayez de faire." - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" -"Il y a eu un problème lors de la sauvegarde de vos préférences de " -"synchronisation !" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "Préférences de synchronisation enregistrées." - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "Mettre à jour automatiquement mon statut Facebook avec mes avis." - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "Envoyez des réponses « @ » à Facebook." - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Sauvegarder" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" -"Si vous souhaitez que l’application %s mette à jour automatiquement votre " -"statut Facebook avec votre dernier avis, vous devez lui en donner " -"l’autorisation." - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "Autoriser %s à mettre à jour mon statut Facebook" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "Préférences de synchronisation" diff --git a/plugins/Facebook/locale/gl/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/gl/LC_MESSAGES/Facebook.po deleted file mode 100644 index 8392821035..0000000000 --- a/plugins/Facebook/locale/gl/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,545 +0,0 @@ -# Translation of StatusNet - Facebook to Galician (Galego) -# Exported from translatewiki.net -# -# Author: Toliño -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:43+0000\n" -"Language-Team: Galician \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: gl\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "" - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "" - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "Houbo un erro co seu pase. Inténteo de novo." - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "Non pode rexistrarse se non acepta a licenza." - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "Houbo un erro descoñecido." - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "Opcións de conexión" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" -"Os meus textos e ficheiros están dispoñibles baixo %s, salvo os seguintes " -"datos privados: contrasinais, enderezos de correo electrónico e mensaxería " -"instantánea e números de teléfono." - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Crear unha conta nova" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Crear un novo usuario con este alcume." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Novo alcume" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "" -"Entre 1 e 64 letras minúsculas ou números, sen signos de puntuación, " -"espazos, tiles ou eñes" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Crear" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Contrasinal" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Conectar" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "Non se permite o rexistro." - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "O código da invitación é incorrecto." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "" - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "Ese alcume xa está en uso. Probe con outro." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "" - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "O nome de usuario ou contrasinal non son correctos." - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Rexistro" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "Enviar unha nota" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "Que hai de novo, %s?" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Caracteres dispoñibles" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Enviar" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "Nome de usuario ou contrasinal incorrectos." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s e amigos, páxina %2$d" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s e amigos" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "De acordo, facédeo!" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Saltar" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "Paxinación" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Despois" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Antes" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "" - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Enviar as invitacións" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "Configuración de integración do Facebook" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "Usuario do Facebook Connect" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "Xa se identificou." - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "" - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "" - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "Inicio" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "Inicio" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "Convidar" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "Convidar" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Parámetros" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Configuracións" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" - -#: facebookaction.php:235 -msgid " a new account." -msgstr " unha nova conta." - -#: facebookaction.php:242 -msgid "Register" -msgstr "Rexistrarse" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "Alcume" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Rexistro" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "Esqueceu ou perdeu o contrasinal?" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "" - -#: facebookaction.php:431 -msgid "Notices" -msgstr "Avisos" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "Facebook" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "Clave API" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "Clave API proporcionada polo Facebook" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Gardar" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "" - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr " primeiro." - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "Desconectarse" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "" - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "" - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "" - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "" - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "" - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "" - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Gardar" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "" diff --git a/plugins/Facebook/locale/ia/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/ia/LC_MESSAGES/Facebook.po deleted file mode 100644 index 59e4457f7b..0000000000 --- a/plugins/Facebook/locale/ia/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,572 +0,0 @@ -# Translation of StatusNet - Facebook to Interlingua (Interlingua) -# Exported from translatewiki.net -# -# Author: McDutchie -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:43+0000\n" -"Language-Team: Interlingua \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: ia\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" -"Salute, %1$s. Nos regretta informar te que nos es incapace de actualisar tu " -"stato de Facebook ab %2$s, e que nos ha disactivate le application Facebook " -"pro tu conto. Isto pote esser proque tu ha removite le autorisation del " -"application Facebook, o ha delite tu conto de Facebook. Tu pote reactivar le " -"application Facebook e le actualisation automatic de tu stato per " -"reinstallar le application Facebook %2$s.\n" -"\n" -"Attentemente,\n" -"\n" -"%2$s" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "Tu debe aperir un session a Facebook pro usar Facebook Connect." - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "Il ha jam un usator local ligate a iste conto de Facebook." - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "Occurreva un problema con le indicio de tu session. Per favor reproba." - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "Tu non pote crear un conto si tu non accepta le licentia." - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "Un error incognite ha occurrite." - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" -"Isto es le prime vice que tu ha aperite un session in %s, dunque nos debe " -"connecter tu Facebook a un conto local. Tu pote crear un nove conto, o " -"connecter con tu conto existente si tu ha un." - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "Configuration de conto Facebook" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "Optiones de connexion" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" -"Mi texto e files es disponibile sub %s excepte iste datos private: " -"contrasigno, adresse de e-mail, adresse de messageria instantanee, numero de " -"telephono." - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Crear nove conto" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Crear un nove usator con iste pseudonymo." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Nove pseudonymo" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "1-64 minusculas o numeros, sin punctuation o spatios" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Crear" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "Connecter conto existente" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" -"Si tu ha jam un conto, aperi session con tu nomine de usator e contrasigno " -"pro connecter lo a tu Facebook." - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "Pseudonymo existente" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Contrasigno" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Connecter" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "Creation de conto non permittite." - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "Le codice de invitation es invalide." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "Pseudonymo non permittite." - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "Pseudonymo ja in uso. Proba un altere." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "Error durante le connexion del usator a Facebook." - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "Nomine de usator o contrasigno invalide." - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Aperir session" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "Inviar un nota" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "Como sta, %s?" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Characteres disponibile" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Inviar" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "Error de servitor: Non poteva obtener le usator!" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "Nomine de usator o contrasigno incorrecte." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s e amicos, pagina %2$d" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s e amicos" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" -"Si tu vole que le application %s actualisa automaticamente tu stato de " -"Facebook con tu ultim enota, tu debe dar permission a illo." - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "OK, face lo!" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Saltar" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "Pagination" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Post" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Ante" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "Gratias pro invitar tu amicos a usar %s." - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "Invitationes ha essite inviate al sequente usatores:" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "Tu ha essite invitate a %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "Invita tu amicos a usar %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "Amicos que jam usa %s:" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Inviar invitationes" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "Configuration del integration de Facebook" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "Usator de Facebook Connect" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "Aperir session o crear conto usante Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "Configurationes de connexion a Facebook" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" -"Le plug-in de Facebook permitte integrar installationes de StatusNet con Facebook e Facebook Connect." - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "Tu es jam authenticate." - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "Aperir session con tu conto de Facebook" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "Authentication con Facebook" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "Non poteva remover usator de Facebook: jam delite." - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "Non poteva remover le usator de Facebook." - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "Initio" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "Initio" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "Invitar" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "Invitar" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Configurationes" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Configurationes" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" -"Pro usar le application Facebook %s tu debe aperir un session con tu nomine " -"de usator e contrasigno. Tu non ha ancora un nomine de usator?" - -#: facebookaction.php:235 -msgid " a new account." -msgstr " un nove conto." - -#: facebookaction.php:242 -msgid "Register" -msgstr "Crear conto" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "Pseudonymo" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Aperir session" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "Contrasigno perdite o oblidate?" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "Le nota non ha contento!" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "" -"Isto es troppo longe. Le longitude maximal del notas es %d characteres." - -#: facebookaction.php:431 -msgid "Notices" -msgstr "Notas" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "Facebook" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "Configurationes de integration de Facebook" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "Clave API de Facebook invalide. Longitude maximal es 255 characteres." - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" -"Secreto API de Facebook invalide. Longitude maximal es 255 characteres." - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "Configurationes del application de Facebook" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "Clave API" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "Clave API providite per Facebook" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "Secreto" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "Secreto API providite per Facebook" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Salveguardar" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "Salveguardar configuration Facebook" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "Configura como tu conto se connecte a Facebook" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "Il non ha un usator de Facebook connectite a iste conto." - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "Usator de Facebook connectite" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "Disconnecter mi conto ab Facebook" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" -"Le disconnexion de tu Facebook renderea le authentication impossibile! Per " -"favor " - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "defini un contrasigno" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr " primo." - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "Disconnecter" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "Non poteva deler le ligamine a Facebook." - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "Tu te ha disconnectite de Facebook." - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "Non es clar lo que tu tenta facer." - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" -"Occurreva un problema durante le salveguarda de tu preferentias de " -"synchronisation!" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "Preferentias de synchronisation salveguardate." - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "Actualisar automaticamente mi stato de Facebook con mi notas." - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "Inviar responsas \"@\" a Facebook." - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Salveguardar" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" -"Si tu vole que %s actualisa automaticamente tu stato de Facebook con tu " -"ultime nota, tu debe dar permission a illo." - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "Permitter a %s de actualisar mi stato de Facebook" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "Preferentias de synchronisation" diff --git a/plugins/Facebook/locale/mk/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/mk/LC_MESSAGES/Facebook.po deleted file mode 100644 index 09dedf13ae..0000000000 --- a/plugins/Facebook/locale/mk/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,568 +0,0 @@ -# Translation of StatusNet - Facebook to Macedonian (Македонски) -# Exported from translatewiki.net -# -# Author: Bjankuloski06 -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:43+0000\n" -"Language-Team: Macedonian \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: mk\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=2; plural=(n == 1 || n%10 == 1) ? 0 : 1;\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" -"Здраво, %1$s. Нажалост, не можеме да го смениме Вашиот статус на Facebook од " -"%2$s, и го имаме оневозможено програмчето за Facebook на Вашата сметка. Ова " -"можеби се должи на тоа што сте го отстраниле овластувањето на програмчето за " -"Facebook, или пак сте ја избришале самата сметка на Facebook. Можете " -"повторно да го овозможите програмчето за Facebook и автоматското менување на " -"статус со преинсталирање на програмчето %2$s - Facebook.\n" -"\n" -"Поздрав,\n" -"\n" -"%2$s" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "" -"Мора да сте најавени на Facebook за да можете да користите Facebook Connect." - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "Веќе постои локален корисник поврзан со оваа сметка на Facebook." - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "Се појави проблем со жетонот на Вашата сесија. Обидете се повторно." - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "Не можете да се регистрирате ако не се согласувате со лиценцата." - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "Се појави непозната грешка." - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" -"Ова е прв пат како се најавувате на %s, па затоа мораме да го поврземе " -"Вашиот профил на Facebook со локална сметка. Можете да создадете нова " -"сметка, или пак да се поврзете со Вашата постоечка сметка (ако ја имате)." - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "Поставки за сметка на Facebook" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "Нагодувања за врска" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" -"Мојот текст и податотеки се достапни под %s освен следниве приватни " -"податоци: лозинка, е-пошта, IM-адреса, и телефонскиот број." - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Создај нова сметка" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Создај нов корисник со овој прекар." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Нов прекар" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "1-64 мали букви или бројки, без интерпункциски знаци и празни места" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Создај" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "Поврзи постоечка сметка" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" -"Ако веќе имате сметка, најавете се со корисничкото име и лозинката за да ја " -"поврзете со профилот на Facebook." - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "Постоечки прекар" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Лозинка" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Поврзи се" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "Регистрацијата не е дозволена." - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "Ова не е важечки код за покана." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "Прекарот не е дозволен." - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "Прекарот е зафатен. Одберете друг." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "Грешка при поврзувањето на корисникот со Facebook." - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "Неважечко корисничко име или лозинка." - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Најава" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "Испрати забелешка" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "Како е, %s?" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Расположиви знаци" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Испрати" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "Грешка во опслужувачот: Не можев да го добијам корисникот!" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "Погрешно корисничко име или лозинка." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s и пријателите, страница %2$d" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s и пријателите" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" -"Доколку сакате %s автоматски да Ви го менува Вашиот статус на Facebook " -"(прикажувајќи ја најновата забелешка), ќе морате да дадете дозвола." - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "Во ред, ајде!" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Прескокни" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "Прелом на страници" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Потоа" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Претходно" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "Ви благодариме што ги поканивте пријателите да користат %s." - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "Испратени се покани до следениве корисници:" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "Поканети сте на %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "Поканете ги пријателите да користат %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "Пријатели што веќе користат %s:" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Испрати покани" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "Поставки за обединување со Facebook" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "Поврзување на корисник со Facebook Connect" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "Најава или регистрација со Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "Нагодувања за поврзување со Facebook" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" -"Приклучокот за Facebook овозможува соединување на примероци на StatusNet со " -"Facebook и Facebook Connect." - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "Веќе сте најавени." - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "Најавете се со Вашата сметка на Facebook" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "Најава со Facebook" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "Не можев да го отстранам корисникот на Facebook: веќе е избришан." - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "Не можев да го отстранам корисниот на Facebook." - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "Почетна" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "Почетна" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "Покани" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "Покани" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Нагодувања" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Нагодувања" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" -"За да го користите програмчето %s - Facebook ќе мора да сте најавени со " -"Вашето корисничко име и лозинка. Сè уште немате корисничко име?" - -#: facebookaction.php:235 -msgid " a new account." -msgstr " нова сметка." - -#: facebookaction.php:242 -msgid "Register" -msgstr "Регистрација" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "Прекар" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Најава" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "Ја загубивте/заборавивте лозинката?" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "Нема содржина за забелешката!" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "Ова е предолго. Забелешката може да содржи највеќе %d знаци." - -#: facebookaction.php:431 -msgid "Notices" -msgstr "Забелешки" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "Facebook" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "Поставки за обединување со Facebook" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "Неважечки API-клуч за Facebook. Дозволени се највеќе 255 знаци." - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "Неважечки API-тајна за Facebook. Дозволени се највеќе 255 знаци." - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "Нагодувања за прог. Facebook" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "API-клуч" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "API-клучот е обезбеден од Facebook" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "Тајна" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "API-тајната е обезбедена од Facebook" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Зачувај" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "Зачувај нагодувања за Facebook" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "Раководење со начинот на поврзување на Вашата сметка со Facebook" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "Нема корисник на Facebook поврзан со оваа сметка." - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "Поврзан корисник на Facebook" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "Исклучи ја мојата сметка од Facebook" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" -"Ако ја исклучите врската со Facebook нема да можете да се најавите! Затоа, " - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "ставете лозинка" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr " пред да продолжите." - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "Прекини" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "Не можев да ја избришам врската до Facebook." - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "Сега е исклучена врската со Facebook." - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "Не ми е јасно што сакате да направите." - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" -"Се појави проблем при зачувувањето на Вашите поставки за услогласување!" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "Поставките за усогласување се зачувани." - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "Автоматски заменувај ми го статусот на Facebook со моите забелешки." - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "Испрати „@“ одговори на Facebook." - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Зачувај" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" -"Ако сакате %s автоматски да го заменува Вашиот статус на Facebook со Вашата " -"најновата забелешка, ќе треба да дадете дозвола." - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "Дозволи %s да го менува мојот статус на Facebook" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "Услогласи нагодувања" diff --git a/plugins/Facebook/locale/nb/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/nb/LC_MESSAGES/Facebook.po deleted file mode 100644 index 5a22e47527..0000000000 --- a/plugins/Facebook/locale/nb/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,540 +0,0 @@ -# Translation of StatusNet - Facebook to Norwegian (bokmål)‬ (‪Norsk (bokmål)‬) -# Exported from translatewiki.net -# -# Author: Nghtwlkr -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:44+0000\n" -"Language-Team: Norwegian (bokmål)‬ \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: no\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "" - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "" - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "" - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "" - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "" - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Opprett ny konto" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Opprett en ny bruker med dette kallenavnet." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Nytt kallenavn" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "1-64 små bokstaver eller tall, ingen punktum eller mellomrom" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Opprett" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "Eksisterende kallenavn" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Passord" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Koble til" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "Registrering ikke tillatt." - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "Ikke en gyldig invitasjonskode." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "Kallenavn er ikke tillatt." - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "Kallenavnet er allerede i bruk. Prøv et annet." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "" - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "Ugyldig brukernavn eller passord." - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Logg inn" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "Send en notis" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "Hva skjer %s?" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Tilgjengelige tegn" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Send" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "Tjenerfeil: Kunne ikke hente bruker!" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "Feil brukernavn eller passord." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s og venner, side %2$d" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s og venner" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Hopp over" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "Paginering" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Etter" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Før" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "Takk for at du inviterte vennene dine til å bruke %s." - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "Invitasjoner har blitt sendt til følgende brukere:" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "Du har blitt invitert til å %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "Inviter vennene dine til å bruke %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Send invitasjoner" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "Allerede innlogget." - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "" - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "" - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "Hjem" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "Hjem" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "Inviter" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "Inviter" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Innstillinger" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Innstillinger" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" - -#: facebookaction.php:235 -msgid " a new account." -msgstr " en ny konto." - -#: facebookaction.php:242 -msgid "Register" -msgstr "Registrer" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "Kallenavn" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Logg inn" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "Mistet eller glemt passordet?" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "" - -#: facebookaction.php:431 -msgid "Notices" -msgstr "" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "Facebook" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Lagre" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "" - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "angi et passord" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr " først." - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "" - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "" - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "" - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "" - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "" - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "Send «@»-svar til Facebook." - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Lagre" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "Tillat %s å oppdatere min Facebook-status" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "" diff --git a/plugins/Facebook/locale/nl/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/nl/LC_MESSAGES/Facebook.po deleted file mode 100644 index fda8b1054d..0000000000 --- a/plugins/Facebook/locale/nl/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,578 +0,0 @@ -# Translation of StatusNet - Facebook to Dutch (Nederlands) -# Exported from translatewiki.net -# -# Author: Siebrand -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:43+0000\n" -"Language-Team: Dutch \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: nl\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" -"Hallo %1$s.\n" -"\n" -"Het spijt ons u te moeten meedelen dat het niet mogelijk is uw " -"Facebookstatus bij te werken vanuit %2$s. De Facebookapplicatie is " -"uitgeschakeld voor uw gebruiker. Dit kan komen doordat u de toegangsrechten " -"voor de Facebookapplicatie hebt ingetrokken of omdat u uw Facebookgebruiker " -"hebt verwijderd. U kunt deze Facebookapplicatie opnieuw inschakelen en " -"automatisch uw status laten bijwerken door de Facebookapplicatie van %2$s " -"opnieuw te installeren.\n" -"\n" -"\n" -"Met vriendelijke groet,\n" -"\n" -"%2$s" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "U moet zijn aangemeld bij Facebook om Facebook Connect te gebruiken." - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "Er is al een lokale gebruiker verbonden met deze Facebookgebruiker" - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "" -"Er is een probleem ontstaan met uw sessie. Probeer het nog een keer, " -"alstublieft." - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "U kunt zich niet registreren als u niet met de licentie akkoord gaat." - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "Er is een onbekende fout opgetreden." - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" -"Dit is de eerste keer dat u aanmeldt bij %s en dan moeten we uw " -"Facebookgebruiker koppelen met uw lokale gebruiker. U kunt een nieuwe " -"gebruiker aanmaken of koppelen met een bestaande gebruiker als u die al hebt." - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "Facebookgebruiker instellen" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "Verbindingsinstellingen" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" -"Mijn teksten en bestanden zijn beschikbaar onder %s, behalve de volgende " -"privégegevens: wachtwoord, e-mailadres, IM-adres, telefoonnummer." - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Nieuwe gebruiker aanmaken" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Nieuwe gebruiker aanmaken met deze gebruikersnaam." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Nieuwe gebruikersnaam" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "1-64 kleine letters of cijfers, geen leestekens of spaties" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Aanmaken" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "Verbinden met een bestaande gebruiker" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" -"Als u al een gebruiker hebt, meld dan aan met uw gebruikersnaam en " -"wachtwoord om deze daarna te koppelen met uw Facebookgebruiker." - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "Bestaande gebruikersnaam" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Wachtwoord" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Koppelen" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "Registratie is niet toegestaan." - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "De uitnodigingscode is ongeldig." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "Gebruikersnaam niet toegestaan." - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "" -"De opgegeven gebruikersnaam is al in gebruik. Kies een andere gebruikersnaam." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "Fout bij het verbinden van de gebruiker met Facebook." - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "Ongeldige gebruikersnaam of wachtwoord." - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Aanmelden" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "Mededeling verzenden" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "Hallo, %s." - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Beschikbare tekens" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Verzenden" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "Serverfout: de gebruiker kon niet geladen worden." - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "De gebruikersnaam of wachtwoord is onjuist." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s en vrienden, pagina %2$d" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s en vrienden" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" -"Als u wilt dat het programma %s automatisch uw Facebookstatus bijwerkt met " -"uw laatste bericht, dan moet u daarvoor toestemming geven." - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "Toestemming geven" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Overslaan" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "Paginering" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Later" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Eerder" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "Dank u wel voor het uitnodigen van uw vrienden om %s te gebruiken." - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "Er is een uitnodiging verstuurd naar de volgende gebruikers:" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "U bent uitgenodigd bij %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "Vrienden uitnodigen om %s te gebruiken" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "Vrienden die %s al gebruiken:" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Uitnodigingen verzenden" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "Instellingen voor Facebookintegratie" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "Facebook Connectgebruiker" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "Aanmelden of registreren via Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "Instellingen voor Facebook Connect" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" -"Via de de Facebookplug-in is het mogelijk StatusNet-installaties te koppelen " -"met Facebook en Facebook Connect." - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "U bent al aangemeld." - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "Aanmelden met uw Facebookgebruiker" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "Aanmelden via Facebook" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "" -"Het was niet mogelijk om de Facebookgebruiker te verwijderen: gebruiker is " -"al verwijderd." - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "Het was niet mogelijk de Facebookgebruiker te verwijderen." - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "Hoofdmenu" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "Hoofdmenu" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "Uitnodigen" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "Uitnodigen" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Instellingen" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Instellingen" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" -"Om het Facebookprograma %s te gebruiken moet u aanmelden met uw " -"gebruikersnaam en wachtwoord. Hebt u nog geen gebruiker?" - -#: facebookaction.php:235 -msgid " a new account." -msgstr " een nieuwe gebruiker." - -#: facebookaction.php:242 -msgid "Register" -msgstr "Registreren" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "Gebruikersnaam" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Aanmelden" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "Wachtwoord kwijt of vergeten?" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "Geen berichtinhoud!" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "De mededeling is te lang. Gebruik maximaal %d tekens." - -#: facebookaction.php:431 -msgid "Notices" -msgstr "Mededelingen" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "Facebook" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "Instellingen voor Facebookkoppeling" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "Ongeldige Facebook API-sleutel. De maximale lengte is 255 tekens." - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "Ongeldig Facebook API-geheim. De maximale lengte is 255 tekens." - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "Applicatieinstellingen voor Facebook" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "API-sleutel" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "API-sleutel die door Facebook is uitgeven" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "Geheim" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "API-geheim dat door Facebook is uitgeven" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Opslaan" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "Facebookinstellingen opslaan" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "Beheren hoe uw gebruiker is gekoppeld met Facebook" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "Er is geen Facebookgebruiker gekoppeld met deze gebruiker." - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "Gekoppelde Facebookgebruiker" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "Mijn gebruiker loskoppelen van Facebook" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" -"Loskoppelen van uw Facebookgebruiker zou ervoor zorgen dat u niet langer " -"kunt aanmelden. U moet eerst " - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "een wachtwoord instellen" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr " voordat u verder kunt met deze handeling." - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "Loskoppelen" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "Het was niet mogelijk de verwijzing naar Facebook te verwijderen." - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "U bent losgekoppeld van Facebook." - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "Het is niet duidelijk wat u wilt bereiken." - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" -"Er is een fout opgetreden tijdens het opslaan van uw " -"synchronisatievoorkeuren!" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "Uw synchronisatievoorkeuren zijn opgeslagen." - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "Mijn Facebookstatus automatisch bijwerken met mijn mededelingen." - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "Antwoorden met \"@\" naar Facebook verzenden." - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Opslaan" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" -"Als u wilt dat %s automatisch uw Facebookstatus bijwerkt met uw laatste " -"mededeling, dat moet u daar toestemming voor geven." - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "%s toestaan mijn Facebookstatus bij te werken" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "Synchronisatievooreuren" diff --git a/plugins/Facebook/locale/pt_BR/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/pt_BR/LC_MESSAGES/Facebook.po deleted file mode 100644 index 6a6dcff9c0..0000000000 --- a/plugins/Facebook/locale/pt_BR/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,544 +0,0 @@ -# Translation of StatusNet - Facebook to Brazilian Portuguese (Português do Brasil) -# Exported from translatewiki.net -# -# Author: Giro720 -# Author: Luckas Blade -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:44+0000\n" -"Language-Team: Brazilian Portuguese \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: pt-br\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "" - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "" - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "" - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "Você não pode se registrar se não aceitar a licença." - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "Ocorreu um erro desconhecido." - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "Opções de conexão" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Criar nova conta" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Criar um novo usuário com este apelido." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Novo apelido" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Criar" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Senha" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Conectar" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "Não é permitido o registro." - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "O código de convite é inválido." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "Apelido não permitido." - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "Este apelido já está em uso. Tente outro." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "Erro ao conectar o usuário ao Facebook." - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "" - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Entrar" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Caracteres disponíveis" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Enviar" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "Nome de usuário e/ou senha incorreto(s)." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s e amigos, pág. %2$d" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s e amigos" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" -"Se você deseja que o %s aplicativo atualize automaticamente seu estado no " -"Facebook com seus último anúncio, você deve autorizá-lo para isso." - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Avançar" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "Paginação" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Depois" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Antes" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "Obrigado por convidar seus amigos a usar %s" - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "Você foi convidado para %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "Convidar seus amigos a usar %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "Amigos já usando %s:" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Enviar convites" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "Entrar ou se registrar usando o Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "Já está autenticado." - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "" - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "" - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "Convidar" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "Convidar" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Configurações" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Configurações" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" - -#: facebookaction.php:235 -msgid " a new account." -msgstr "" - -#: facebookaction.php:242 -msgid "Register" -msgstr "Registrar-se" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "Apelido" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Entrar" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "Perdeu ou esqueceu sua senha?" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "" - -#: facebookaction.php:431 -msgid "Notices" -msgstr "" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Salvar" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "Salvar configurações do Facebook" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "" - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "Desconectar minha conta do Facebook" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr "" - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "Desconectar" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "" - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "" - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "" - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "" - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "" - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "" - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Salvar" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "" diff --git a/plugins/Facebook/locale/tl/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/tl/LC_MESSAGES/Facebook.po deleted file mode 100644 index aa791f367f..0000000000 --- a/plugins/Facebook/locale/tl/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,583 +0,0 @@ -# Translation of StatusNet - Facebook to Tagalog (Tagalog) -# Exported from translatewiki.net -# -# Author: AnakngAraw -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:44+0000\n" -"Language-Team: Tagalog \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: tl\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" -"Kumusta, %1$s. May pagpapaumanhin naming ipinababatid sa iyo na hindi namin " -"naisapanahon ang iyong katayuan ng Facebook mula %2$s, at hindi namin " -"pinagana ang aplikasyon ng Facebook para sa iyong akawnt. Maaaring dahil " -"ito sa inalis mo ang pahintulot sa aplikasyon ng Facebook, o pagbura ng " -"iyong akawnt sa Facebook. Maaari mong muling buhayin ang aplikasyon ng " -"Facebook at kusang pagsasapanahon ng kalagayan sa pamamagitan ng muling " -"pagtatalaga ng aplikasyon ng Facebook na %2$s.\n" -"\n" -"Nagpapahalaga,\n" -"\n" -"%2$s" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "Dapat na nakalagda ka sa Facebook upang magamit ang Ugnay sa Facebook." - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "" -"Mayroon nang isang katutubong tagagamit na nakakawing sa ganitong akawnt ng " -"Facebook." - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "May isang suliranin sa iyong token ng sesyon. Paki subukan uli." - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "Hindi ka makapagpapatala kung hindi ka sumasang-ayon sa lisensiya." - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "Isang hindi nalalamang kamalian ang naganap." - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" -"Ito ang iyong unang pagkakataong lumagda sa %s kaya't kailangan naming " -"iugnay ang iyong Facebook sa isang katutubong akawnt. Maaari kang lumikha " -"ng isang bagong akawnt, o umugnay sa pamamagitan ng iyong umiiral na akawnt, " -"kung mayroon ka." - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "Pagtatakda ng Akawnt ng Facebook" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "Mga pagpipilian na pang-ugnay" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" -"Ang aking teksto at mga talaksan ay makukuha sa ilalim ng %s maliban sa " -"pribadong dato na ito: hudyat, tirahan ng e-liham, tirahan ng IM, at bilang " -"na pangtelepono." - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Lumikha ng bagong akawnt" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Lumikha ng isang bagong tagagamit na may ganitong palayaw." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Bagong palayaw" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "" -"1 hanggang 64 na maliliit na mga titik o mga bilang, walang bantas o mga " -"patlang" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Likhain" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "Umugnay sa umiiral na akawnt" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" -"Kung mayroon ka nang akawnt, lumagda sa pamamagitan ng iyong pangalan ng " -"tagagamit at hudyat upang iugnay ito sa iyong Facebook." - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "Umiiral na palayaw" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Hudyat" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Umugnay" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "Hindi pinapahintulutan ang pagpapatala." - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "Hindi isang tanggap na kodigo ng paanyaya." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "Hindi pinapahintulutan ang palayaw." - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "Ginagamit na ang palayaw. Subukan ang iba." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "May kamalian sa pag-ugnay ng tagagamit sa Facebook." - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "Hindi tanggap na pangalan ng tagagamit o hudyat." - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Lumagda" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "Magpadala ng pabatid" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "Anong balita, %s?" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Makukuhang mga panitik" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Ipadala" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "Kamalian ng tapaghain: Hindi makuha ang tagagamit!" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "Hindi tamang pangalan ng tagagamit o hudyat." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s at mga kaibigan, pahina %2$d" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s at mga kaibigan" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" -"Kung nais mong kusang isapanahon ng aplikasyong %s ang iyong katayuan ng " -"Facebook na may pinakabagong pabatid, kailangan mong bigyan ito ng " -"pahintulot." - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "Sige, gawin iyan!" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Lagtawan" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "Pagbilang ng pahina" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Pagkalipas ng" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Bago ang" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "Salamat sa pag-anyaya sa iyong mga kaibigan na gamitin ang %s." - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "Ipinadala na ang mga paanyaya sa sumusunod ng mga tagagamit:" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "Inaanyayahan ka sa %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "Anyayahan ang iyong mga kaibigan na gamitin ang %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "Mga kaibigang gumagamit na ng %s:" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Ipadala ang mga paanyaya" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "Pagkakaayos ng integrasyon ng Facebook" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "Tagagamit ng Ugnay sa Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "Lumagda o magpatalang ginagamit ang Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "Mga Pagtatakda sa Ugnay sa Facebook" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" -"Ang pamasak na Facebook ay nagpapahintulot ng integrasyon ng mga pagkakataon " -"sa StatusNet sa pamamagitan ng Facebook " -"at Ugnay sa Facebook." - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "Nakalagda na." - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "Lumagda sa pamamagitan ng iyong Akawnt sa Facebook" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "Paglagda sa Facebook" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "" - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "Hindi matanggal ang tagagamit ng Facebook." - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "Tahanan" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "Tahanan" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "Anyayahan" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "Anyayahan" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Mga pagtatakda" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Mga pagtatakda" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" -"Upang magamit ang Aplikasyon ng Facebook na %s kailangan mong lumagda sa " -"pamamagitan ng iyong pangalan ng tagagamit at hudyat. Wala ka pa bang " -"bansag?" - -#: facebookaction.php:235 -msgid " a new account." -msgstr "isang bagong akawnt." - -#: facebookaction.php:242 -msgid "Register" -msgstr "Magpatala" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "Palayaw" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Lumagda" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "Hudyat na nawala o nakalimutan?" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "Walang laman ang pabatid!" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "" -"Napakahaba niyan. Ang pinakamataas na sukat ng pabatid ay %d mga panitik." - -#: facebookaction.php:431 -msgid "Notices" -msgstr "Mga pabatid" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "Facebook" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "Mga pagtatakda sa integrasyon ng Facebook" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "" -"Hindi tanggap na susi sa API ng Facebook. Ang pinakamataas na haba ay 255 " -"mga panitik." - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" -"Hindi tanggap na lihim sa API ng Facebook. Ang pinakamataas na haba ay 255 " -"mga panitik." - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "Mga pagtatakda sa aplikasyon ng Facebook" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "Susi ng API" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "Ang susi ng API ay ibinigay ng Facebook" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "Lihim" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "Ang lihim ng API ay ibinigay ng Facebook" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Sagipin" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "Sagipin ang mga katakdaan ng Facebook" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "Pamahalaan kung paano umuugnay ang iyong akawnt sa Facebook" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "Walang tagagamit ng Facebook na nakaugnay sa akawnt na ito." - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "Nakaugnay na tagagamit ng Facebook" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "Huwag iugnay ang aking akawnt mula sa Facebook" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" -"Ang pagtatanggal ng ugnay sa Facebook ay magsasanhi ng hindi mangyayaring " -"paglagda! Paki " - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "magtakda ng isang hudyat" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr "muna." - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "Huwag umugnay" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "Hindi maalis ang pagkabit sa Facebook." - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "Hindi ka na nakaugnay sa Facebook." - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "Hindi sigurado kung ano ang sinusubok mong gawin." - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "May isang suliranin sa pagsagip ng iyong mga nais sa pagsabay!" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "Nasagip ang mga nais sa pagsabay." - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "" -"Kusang isapanahon ang aking katayuan ng Facebook na may mga pabatid ko." - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "Ipadala ang mga tugong \"@\" sa Facebook." - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Sagipin" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" -"Kung nais mong kusang isapanahon ng %s ang iyong katayuan ng Facebook na may " -"pinakabagong mga pabatid mo, kailangan mo itong bigyan ng pahintulot." - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "Pahintulutan si %s na isapanahon ang aking katayuan ng Facebook" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "Mga nais sa pagsabay" diff --git a/plugins/Facebook/locale/uk/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/uk/LC_MESSAGES/Facebook.po deleted file mode 100644 index 2bbe18f092..0000000000 --- a/plugins/Facebook/locale/uk/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,573 +0,0 @@ -# Translation of StatusNet - Facebook to Ukrainian (Українська) -# Exported from translatewiki.net -# -# Author: Boogie -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:44+0000\n" -"Language-Team: Ukrainian \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: uk\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=3; plural=(n%10 == 1 && n%100 != 11) ? 0 : ( (n%10 >= " -"2 && n%10 <= 4 && (n%100 < 10 || n%100 >= 20)) ? 1 : 2 );\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" -"Вітаємо, %1$s. Нам дуже прикро про це повідомляти, але ми не в змозі " -"оновлювати ваш статус у Facebook з %2$s і відключаємо додаток Facebook для " -"вашого акаунту. Таке могло статися тому, що ви, можливо, скасували " -"авторизацію для додатку Facebook або видалили ваш акаунт Facebook. Ви маєте " -"можливість перезапустити додаток для Facebook і автоматичний імпорт ваших " -"статусів з %2$s до Facebook буде поновлено.\n" -"\n" -"З повагою,\n" -"\n" -"%2$s" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "Ви повинні увійти до Facebook або використати Facebook Connect." - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "" -"На даному сайті вже є користувач, котрий підключив цей акаунт Facebook." - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "Виникли певні проблеми з токеном сесії. Спробуйте знов, будь ласка." - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "Ви не зможете зареєструватись, якщо не погодитесь з умовами ліцензії." - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "Виникла якась незрозуміла помилка." - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" -"Ви вперше увійшли до сайту %s, отже ми мусимо приєднати ваш акаунт Facebook " -"до акаунту на даному сайті. Ви маєте можливість створити новий акаунт або " -"використати такий, що вже існує." - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "Налаштування акаунту Facebook" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "Опції з’єднання" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" -"Мої дописи і файли доступні на умовах %s, окрім цих приватних даних: пароль, " -"електронна адреса, адреса IM, телефонний номер." - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "Створити новий акаунт" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "Створити нового користувача з цим нікнеймом." - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "Новий нікнейм" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "" -"1-64 літери нижнього регістру і цифри, ніякої пунктуації або інтервалів" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Створити" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "Приєднати акаунт, який вже існує" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" -"Якщо ви вже маєте акаунт, увійдіть з вашим ім’ям користувача та паролем, аби " -"приєднати їх до Facebook." - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "Нікнейм, який вже існує" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Пароль" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Під’єднати" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "Реєстрацію не дозволено." - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "Це не дійсний код запрошення." - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "Нікнейм не допускається." - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "Цей нікнейм вже використовується. Спробуйте інший." - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "Помилка при підключенні до Facebook." - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "Невірне ім’я або пароль." - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Увійти" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "Надіслати допис" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "Що нового, %s?" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "Лишилось знаків" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Так" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "Помилка сервера: не вдалося отримати користувача!" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "Неточне ім’я або пароль." - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s з друзями, сторінка %2$d" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s з друзями" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" -"Якщо ви бажаєте, щоб додаток %s автоматично оновлював ваш статус у Facebook " -"останнім повідомленням, ви повинні надати дозвіл." - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "Так, зробіть це!" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Проскочити" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "Нумерація сторінок" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Вперед" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Назад" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "Дякуємо, що запросили своїх друзів на %s." - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "Запрошення було надіслано таким користувачам:" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "Вас було запрошено до %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "Запросіть своїх друзів до %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "Деякі друзі вже користуються %s:" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "Розсилка запрошень" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "Налаштування інтеграції з Facebook" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "Facebook Connect" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "Увійти або зареєструватись з Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "Налаштування Facebook Connect" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" -"Додаток Facebook дозволяє інтегрувати StatusNet-сумісні сервіси з Facebook та Facebook Connect." - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "Тепер ви увійшли." - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "Увійти з акаунтом Facebook" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "Вхід Facebook" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "Не вдалося видалити користувача Facebook: вже видалений." - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "Не вдалося видалити користувача Facebook." - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "Дім" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "Дім" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "Запросити" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "Запросити" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Налаштування" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Налаштування" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" -"Щоб використовувати додаток %s для Facebook, ви мусите увійти, " -"використовуючи своє ім’я користувача та пароль. Ще не маєте імені " -"користувача?" - -#: facebookaction.php:235 -msgid " a new account." -msgstr " новий акаунт." - -#: facebookaction.php:242 -msgid "Register" -msgstr "Зареєструвати" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "Нікнейм" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Увійти" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "Загубили або забули пароль?" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "Повідомлення порожнє!" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "Надто довго. Максимальний розмір допису — %d знаків." - -#: facebookaction.php:431 -msgid "Notices" -msgstr "Дописи" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "Facebook" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "Налаштування інтеграції з Facebook" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "" -"Помилковий ключ Facebook API. Максимальна довжина ключа — 255 символів." - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" -"Помилковий секретний код Facebook API. Максимальна довжина — 255 символів." - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "Налаштування додатку для Facebook" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "API-ключ" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "API-ключ, що був наданий Facebook" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "Секретний код" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "Секретний код API, що був наданий Facebook" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Зберегти" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "Зберегти налаштування Facebook" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "Зазначте, яким чином ваш акаунт буде під’єднано до Facebook" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "Наразі жоден користувач Facebook не під’єднаний до цього акаунту." - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "Під’єднаний користувач Facebook" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "Від’єднати мій акаунт від Facebook" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" -"Якщо ви від’єднаєте свій Facebook, то це унеможливить вхід до системи у " -"майбутньому! Будь ласка, " - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "встановіть пароль" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr " спочатку." - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "Від’єднати" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "Не можу видалити посилання на Facebook." - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "Ви від’єдналися від Facebook." - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "Хто зна, що ви намагаєтеся зробити." - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "Виникла проблема при збереженні параметрів синхронізації!" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "Параметри синхронізації збережено." - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "Автоматично оновлювати статус у Facebook моїми дописами." - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "Надсилати «@» відповіді до Facebook." - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Зберегти" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" -"Якщо ви бажаєте, щоб додаток %s автоматично оновлював ваш статус у Facebook " -"останнім повідомленням, ви повинні надати дозвіл." - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "Дозволити додатку %s оновлювати мій статус у Facebook" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "Параметри синхронізації" diff --git a/plugins/Facebook/locale/vi/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/vi/LC_MESSAGES/Facebook.po deleted file mode 100644 index 15c861e90e..0000000000 --- a/plugins/Facebook/locale/vi/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,540 +0,0 @@ -# Translation of StatusNet - Facebook to Vietnamese (Tiếng Việt) -# Expored from translatewiki.net -# -# Author: Minh Nguyen -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-14 10:29+0000\n" -"PO-Revision-Date: 2011-01-14 10:33:07+0000\n" -"Language-Team: Vietnamese \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-10 18:26:00+0000\n" -"X-Generator: MediaWiki 1.18alpha (r80246); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: vi\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "" - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "" - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "" - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "" - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "" - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "Thiết lập Tài khoản Facebook" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "" - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "Tạo" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "" - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "Mật khẩu" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "Kết nối" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:237 FBConnectAuth.php:247 -msgid "Registration not allowed." -msgstr "" - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:255 -msgid "Not a valid invitation code." -msgstr "" - -#: FBConnectAuth.php:267 -msgid "Nickname not allowed." -msgstr "" - -#: FBConnectAuth.php:272 -msgid "Nickname already in use. Try another one." -msgstr "" - -#: FBConnectAuth.php:290 FBConnectAuth.php:324 FBConnectAuth.php:344 -msgid "Error connecting user to Facebook." -msgstr "" - -#: FBConnectAuth.php:310 -msgid "Invalid username or password." -msgstr "" - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "Đăng nhập" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "Gửi" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "" - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s và bạn bè" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "Bỏ qua" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "Sau" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "Trước" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "" - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "Người dùng Kết nối Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "Thiết lập Kết nối Facebook" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "" - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "Đăng nhập vào Facebook" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "" - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "" - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "Trang chủ" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "Trang chủ" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "Thiết lập" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "Thiết lập" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" - -#: facebookaction.php:235 -msgid " a new account." -msgstr "" - -#: facebookaction.php:242 -msgid "Register" -msgstr "Đăng ký" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "Đăng nhập" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "" - -#: facebookaction.php:431 -msgid "Notices" -msgstr "" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "Facebook" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "Thiết lập ứng dụng Facebook" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "Lưu" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "Lưu các thiết lập Facebook" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "" - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "Người dùng Facebook kết nối" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr "" - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "Ngắt kết nối" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "" - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "" - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "" - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "" - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "" - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "" - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "Lưu" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "" diff --git a/plugins/Facebook/locale/zh_CN/LC_MESSAGES/Facebook.po b/plugins/Facebook/locale/zh_CN/LC_MESSAGES/Facebook.po deleted file mode 100644 index 7bb44631be..0000000000 --- a/plugins/Facebook/locale/zh_CN/LC_MESSAGES/Facebook.po +++ /dev/null @@ -1,556 +0,0 @@ -# Translation of StatusNet - Facebook to Simplified Chinese (‪中文(简体)‬) -# Exported from translatewiki.net -# -# Author: Chenxiaoqino -# Author: Hydra -# Author: ZhengYiFeng -# -- -# This file is distributed under the same license as the StatusNet package. -# -msgid "" -msgstr "" -"Project-Id-Version: StatusNet - Facebook\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-01-29 21:45+0000\n" -"PO-Revision-Date: 2011-01-29 21:49:44+0000\n" -"Language-Team: Simplified Chinese \n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-POT-Import-Date: 2011-01-22 19:30:29+0000\n" -"X-Generator: MediaWiki 1.18alpha (r81195); Translate extension (2010-09-17)\n" -"X-Translation-Project: translatewiki.net at http://translatewiki.net\n" -"X-Language-Code: zh-hans\n" -"X-Message-Group: #out-statusnet-plugin-facebook\n" -"Plural-Forms: nplurals=1; plural=0;\n" - -#: facebookutil.php:429 -#, php-format -msgid "" -"Hi, %1$s. We're sorry to inform you that we are unable to update your " -"Facebook status from %2$s, and have disabled the Facebook application for " -"your account. This may be because you have removed the Facebook " -"application's authorization, or have deleted your Facebook account. You can " -"re-enable the Facebook application and automatic status updating by re-" -"installing the %2$s Facebook application.\n" -"\n" -"Regards,\n" -"\n" -"%2$s" -msgstr "" -"你好,%1$s。我们很抱歉的通知你我们无法从%2$s更新你的Facebook状态,并已禁用你" -"帐户的Facebook应用。这可能是因为你取消了Facebook应用的授权,或者你删除了你的" -"Facebook帐户。通过重新安装Facebook应用你可以重新启用你的Facebook应用的自动状" -"态更新。\n" -"\n" -"祝好,\n" -"\n" -"%2$s" - -#: FBConnectAuth.php:55 -msgid "You must be logged into Facebook to use Facebook Connect." -msgstr "你必须使用Facebook Connect来登入Facebook帐号。" - -#: FBConnectAuth.php:79 -msgid "There is already a local user linked with this Facebook account." -msgstr "这里已经有一个用户连接了此Facebook帐号。" - -#: FBConnectAuth.php:91 FBConnectSettings.php:166 -msgid "There was a problem with your session token. Try again, please." -msgstr "你的session token出错了。请重试。" - -#: FBConnectAuth.php:96 -msgid "You can't register if you don't agree to the license." -msgstr "你必须同意许可协议才能注册。" - -#: FBConnectAuth.php:106 -msgid "An unknown error has occured." -msgstr "发生未知错误。" - -#. TRANS: %s is the site name. -#: FBConnectAuth.php:121 -#, php-format -msgid "" -"This is the first time you've logged into %s so we must connect your " -"Facebook to a local account. You can either create a new account, or connect " -"with your existing account, if you have one." -msgstr "" -" 这是你第一次登录到 %s,我们需要将你的Facebook帐号与一个本地的帐号关联。你可" -"以新建一个帐号,或者使用你在本站已有的帐号。" - -#. TRANS: Page title. -#: FBConnectAuth.php:128 -msgid "Facebook Account Setup" -msgstr "Facebook帐号设置" - -#. TRANS: Legend. -#: FBConnectAuth.php:162 -msgid "Connection options" -msgstr "连接选项" - -#. TRANS: %s is the name of the license used by the user for their status updates. -#: FBConnectAuth.php:172 -#, php-format -msgid "" -"My text and files are available under %s except this private data: password, " -"email address, IM address, and phone number." -msgstr "" -" 我的文字和文件在%s下提供,除了如下隐私内容:密码、电子邮件地址、IM 地址和电" -"话号码。" - -#. TRANS: Legend. -#: FBConnectAuth.php:189 -msgid "Create new account" -msgstr "创建新帐户" - -#: FBConnectAuth.php:191 -msgid "Create a new user with this nickname." -msgstr "以此昵称创建新帐户" - -#. TRANS: Field label. -#: FBConnectAuth.php:195 -msgid "New nickname" -msgstr "新昵称" - -#: FBConnectAuth.php:197 -msgid "1-64 lowercase letters or numbers, no punctuation or spaces" -msgstr "1 到 64 个小写字母或数字,不包含标点或空格" - -#. TRANS: Submit button. -#: FBConnectAuth.php:201 -msgctxt "BUTTON" -msgid "Create" -msgstr "创建" - -#: FBConnectAuth.php:207 -msgid "Connect existing account" -msgstr "连接现有帐号" - -#: FBConnectAuth.php:209 -msgid "" -"If you already have an account, login with your username and password to " -"connect it to your Facebook." -msgstr "如果你已有帐号,请输入用户名和密码登录并连接至Facebook。" - -#. TRANS: Field label. -#: FBConnectAuth.php:213 -msgid "Existing nickname" -msgstr "已存在的昵称" - -#: FBConnectAuth.php:216 facebookaction.php:277 -msgid "Password" -msgstr "密码" - -#. TRANS: Submit button. -#: FBConnectAuth.php:220 -msgctxt "BUTTON" -msgid "Connect" -msgstr "连接" - -#. TRANS: Client error trying to register with registrations not allowed. -#. TRANS: Client error trying to register with registrations 'invite only'. -#: FBConnectAuth.php:241 FBConnectAuth.php:251 -msgid "Registration not allowed." -msgstr "不允许注册。" - -#. TRANS: Client error trying to register with an invalid invitation code. -#: FBConnectAuth.php:259 -msgid "Not a valid invitation code." -msgstr "对不起,无效的邀请码。" - -#: FBConnectAuth.php:271 -msgid "Nickname not allowed." -msgstr "昵称不被允许。" - -#: FBConnectAuth.php:276 -msgid "Nickname already in use. Try another one." -msgstr "昵称已被使用,换一个吧。" - -#: FBConnectAuth.php:294 FBConnectAuth.php:330 FBConnectAuth.php:350 -msgid "Error connecting user to Facebook." -msgstr "连接用户至Facebook时发生错误。" - -#: FBConnectAuth.php:316 -msgid "Invalid username or password." -msgstr "用户名或密码不正确。" - -#. TRANS: Page title. -#: facebooklogin.php:90 facebookaction.php:255 -msgid "Login" -msgstr "登录" - -#. TRANS: Legend. -#: facebooknoticeform.php:144 -msgid "Send a notice" -msgstr "发送一个通知" - -#. TRANS: Field label. -#: facebooknoticeform.php:157 -#, php-format -msgid "What's up, %s?" -msgstr "%s,最近怎么样?" - -#: facebooknoticeform.php:169 -msgid "Available characters" -msgstr "可用的字符" - -#. TRANS: Button text. -#: facebooknoticeform.php:196 -msgctxt "BUTTON" -msgid "Send" -msgstr "发送" - -#: facebookhome.php:103 -msgid "Server error: Couldn't get user!" -msgstr "服务器错误:无法获取用户。" - -#: facebookhome.php:122 -msgid "Incorrect username or password." -msgstr "用户名或密码不正确。" - -#. TRANS: Page title. -#. TRANS: %1$s is a user nickname, %2$s is a page number. -#: facebookhome.php:153 -#, php-format -msgid "%1$s and friends, page %2$d" -msgstr "%1$s 和页 %2$d 的朋友" - -#. TRANS: Page title. -#. TRANS: %s is a user nickname -#: facebookhome.php:157 -#, php-format -msgid "%s and friends" -msgstr "%s 和好友们" - -#. TRANS: Instructions. %s is the application name. -#: facebookhome.php:185 -#, php-format -msgid "" -"If you would like the %s app to automatically update your Facebook status " -"with your latest notice, you need to give it permission." -msgstr "" -"如果你希望 %s 应用自动更新你最新的状态到Facebook状态上,你需要给它设置权限。" - -#: facebookhome.php:210 -msgid "Okay, do it!" -msgstr "好的!" - -#. TRANS: Button text. Clicking the button will skip updating Facebook permissions. -#: facebookhome.php:217 -msgctxt "BUTTON" -msgid "Skip" -msgstr "跳过" - -#: facebookhome.php:244 facebookaction.php:336 -msgid "Pagination" -msgstr "分页" - -#. TRANS: Pagination link. -#: facebookhome.php:254 facebookaction.php:345 -msgid "After" -msgstr "之后" - -#. TRANS: Pagination link. -#: facebookhome.php:263 facebookaction.php:353 -msgid "Before" -msgstr "之前" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:69 -#, php-format -msgid "Thanks for inviting your friends to use %s." -msgstr "谢谢你邀请你的朋友们来使用 %s。" - -#. TRANS: Followed by an unordered list with invited friends. -#: facebookinvite.php:72 -msgid "Invitations have been sent to the following users:" -msgstr "邀请已发给一些的用户:" - -#: facebookinvite.php:91 -#, php-format -msgid "You have been invited to %s" -msgstr "你被邀请来到 %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:101 -#, php-format -msgid "Invite your friends to use %s" -msgstr "邀请你的朋友们来使用 %s" - -#. TRANS: %s is the name of the site. -#: facebookinvite.php:124 -#, php-format -msgid "Friends already using %s:" -msgstr "已经使用 %s 的好友们:" - -#. TRANS: Page title. -#: facebookinvite.php:143 -msgid "Send invitations" -msgstr "发送邀请" - -#. TRANS: Menu item. -#. TRANS: Menu item tab. -#: FacebookPlugin.php:188 FacebookPlugin.php:461 FacebookPlugin.php:485 -msgctxt "MENU" -msgid "Facebook" -msgstr "Facebook" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:190 -msgid "Facebook integration configuration" -msgstr "Facebook整合设置" - -#: FacebookPlugin.php:431 -msgid "Facebook Connect User" -msgstr "Facebook Connect 用户" - -#. TRANS: Tooltip for menu item "Facebook". -#: FacebookPlugin.php:463 -msgid "Login or register using Facebook" -msgstr "使用 Facebook 登陆或注册" - -#. TRANS: Tooltip for menu item "Facebook". -#. TRANS: Page title. -#: FacebookPlugin.php:487 FBConnectSettings.php:55 -msgid "Facebook Connect Settings" -msgstr "Facebook Connect 设置" - -#: FacebookPlugin.php:591 -msgid "" -"The Facebook plugin allows integrating StatusNet instances with Facebook and Facebook Connect." -msgstr "" - -#: FBConnectLogin.php:33 -msgid "Already logged in." -msgstr "已登录。" - -#. TRANS: Instructions. -#: FBConnectLogin.php:42 -msgid "Login with your Facebook Account" -msgstr "使用你的 Facebook 帐号登录" - -#. TRANS: Page title. -#: FBConnectLogin.php:57 -msgid "Facebook Login" -msgstr "" - -#: facebookremove.php:53 -msgid "Couldn't remove Facebook user: already deleted." -msgstr "" - -#: facebookremove.php:63 -msgid "Couldn't remove Facebook user." -msgstr "" - -#. TRANS: Link description for 'Home' link that leads to a start page. -#: facebookaction.php:169 -msgctxt "MENU" -msgid "Home" -msgstr "首页" - -#. TRANS: Tooltip for 'Home' link that leads to a start page. -#: facebookaction.php:171 -msgid "Home" -msgstr "首页" - -#. TRANS: Link description for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:180 -msgctxt "MENU" -msgid "Invite" -msgstr "邀请" - -#. TRANS: Tooltip for 'Invite' link that leads to a page where friends can be invited. -#: facebookaction.php:182 -msgid "Invite" -msgstr "邀请" - -#. TRANS: Link description for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:192 -msgctxt "MENU" -msgid "Settings" -msgstr "设置" - -#. TRANS: Tooltip for 'Settings' link that leads to a page user preferences can be set. -#: facebookaction.php:194 -msgid "Settings" -msgstr "设置" - -#: facebookaction.php:233 -#, php-format -msgid "" -"To use the %s Facebook Application you need to login with your username and " -"password. Don't have a username yet?" -msgstr "" - -#: facebookaction.php:235 -msgid " a new account." -msgstr "" - -#: facebookaction.php:242 -msgid "Register" -msgstr "" - -#: facebookaction.php:274 -msgid "Nickname" -msgstr "" - -#. TRANS: Login button. -#: facebookaction.php:282 -msgctxt "BUTTON" -msgid "Login" -msgstr "" - -#: facebookaction.php:288 -msgid "Lost or forgotten password?" -msgstr "" - -#: facebookaction.php:370 -msgid "No notice content!" -msgstr "" - -#: facebookaction.php:377 -#, php-format -msgid "That's too long. Max notice size is %d chars." -msgstr "" - -#: facebookaction.php:431 -msgid "Notices" -msgstr "" - -#: facebookadminpanel.php:52 -msgid "Facebook" -msgstr "" - -#: facebookadminpanel.php:62 -msgid "Facebook integration settings" -msgstr "" - -#: facebookadminpanel.php:123 -msgid "Invalid Facebook API key. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:129 -msgid "Invalid Facebook API secret. Max length is 255 characters." -msgstr "" - -#: facebookadminpanel.php:178 -msgid "Facebook application settings" -msgstr "" - -#: facebookadminpanel.php:184 -msgid "API key" -msgstr "" - -#: facebookadminpanel.php:185 -msgid "API key provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:193 -msgid "Secret" -msgstr "" - -#: facebookadminpanel.php:194 -msgid "API secret provided by Facebook" -msgstr "" - -#: facebookadminpanel.php:210 -msgid "Save" -msgstr "" - -#: facebookadminpanel.php:210 -msgid "Save Facebook settings" -msgstr "" - -#. TRANS: Instructions. -#: FBConnectSettings.php:66 -msgid "Manage how your account connects to Facebook" -msgstr "" - -#: FBConnectSettings.php:90 -msgid "There is no Facebook user connected to this account." -msgstr "" - -#: FBConnectSettings.php:98 -msgid "Connected Facebook user" -msgstr "" - -#. TRANS: Legend. -#: FBConnectSettings.php:118 -msgid "Disconnect my account from Facebook" -msgstr "" - -#. TRANS: Followed by a link containing text "set a password". -#: FBConnectSettings.php:125 -msgid "" -"Disconnecting your Faceboook would make it impossible to log in! Please " -msgstr "" - -#. TRANS: Preceded by "Please " and followed by " first." -#: FBConnectSettings.php:130 -msgid "set a password" -msgstr "" - -#. TRANS: Preceded by "Please set a password". -#: FBConnectSettings.php:132 -msgid " first." -msgstr "" - -#. TRANS: Submit button. -#: FBConnectSettings.php:145 -msgctxt "BUTTON" -msgid "Disconnect" -msgstr "" - -#: FBConnectSettings.php:180 -msgid "Couldn't delete link to Facebook." -msgstr "" - -#: FBConnectSettings.php:196 -msgid "You have disconnected from Facebook." -msgstr "" - -#: FBConnectSettings.php:199 -msgid "Not sure what you're trying to do." -msgstr "" - -#: facebooksettings.php:61 -msgid "There was a problem saving your sync preferences!" -msgstr "" - -#. TRANS: Confirmation that synchronisation settings have been saved into the system. -#: facebooksettings.php:64 -msgid "Sync preferences saved." -msgstr "" - -#: facebooksettings.php:87 -msgid "Automatically update my Facebook status with my notices." -msgstr "" - -#: facebooksettings.php:94 -msgid "Send \"@\" replies to Facebook." -msgstr "" - -#. TRANS: Submit button to save synchronisation settings. -#: facebooksettings.php:102 -msgctxt "BUTTON" -msgid "Save" -msgstr "" - -#. TRANS: %s is the application name. -#: facebooksettings.php:111 -#, php-format -msgid "" -"If you would like %s to automatically update your Facebook status with your " -"latest notice, you need to give it permission." -msgstr "" - -#: facebooksettings.php:124 -#, php-format -msgid "Allow %s to update my Facebook status" -msgstr "" - -#. TRANS: Page title for synchronisation settings. -#: facebooksettings.php:134 -msgid "Sync preferences" -msgstr "" From b595c3f0d5781c96c4976005ac40fddb9ae63131 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Mon, 31 Jan 2011 18:57:19 -0800 Subject: [PATCH 21/89] API - Return integers instead of strings for group IDs and DM sender/recipients in JSON output --- lib/apiaction.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/apiaction.php b/lib/apiaction.php index dcce18ef27..0b539bb397 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -412,7 +412,7 @@ class ApiAction extends Action { $twitter_group = array(); - $twitter_group['id'] = $group->id; + $twitter_group['id'] = intval($group->id); $twitter_group['url'] = $group->permalink(); $twitter_group['nickname'] = $group->nickname; $twitter_group['fullname'] = $group->fullname; @@ -561,7 +561,7 @@ class ApiAction extends Action $details['notifications_enabled'] = $notifications; $details['blocking'] = $source->hasBlocked($target); - $details['id'] = $source->id; + $details['id'] = intval($source->id); return $details; } @@ -945,10 +945,10 @@ class ApiAction extends Action $from_profile = $message->getFrom(); $to_profile = $message->getTo(); - $dmsg['id'] = $message->id; - $dmsg['sender_id'] = $message->from_profile; + $dmsg['id'] = intval($message->id); + $dmsg['sender_id'] = intval($from_profile); $dmsg['text'] = trim($message->content); - $dmsg['recipient_id'] = $message->to_profile; + $dmsg['recipient_id'] = intval($to_profile); $dmsg['created_at'] = $this->dateTwitter($message->created); $dmsg['sender_screen_name'] = $from_profile->nickname; $dmsg['recipient_screen_name'] = $to_profile->nickname; From 7977454456fd65b31859089a14bfca0d4a453138 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 1 Feb 2011 14:35:42 -0800 Subject: [PATCH 22/89] Ticket #3022: fix formatting output for ApiAction::clientError and ApiAction::serverError when caller doesn't explicitly pass the format. Format's already available as a member variable, so use it! Fixes some error reponses in api/statusnet/groups/leave.json which were coming through as XML. May fix some others as well. --- lib/apiaction.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/apiaction.php b/lib/apiaction.php index dcce18ef27..6caf468bf2 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -1236,9 +1236,12 @@ class ApiAction extends Action return; } - function clientError($msg, $code = 400, $format = 'xml') + function clientError($msg, $code = 400, $format = null) { $action = $this->trimmed('action'); + if ($format === null) { + $format = $this->format; + } common_debug("User error '$code' on '$action': $msg", __FILE__); @@ -1278,9 +1281,12 @@ class ApiAction extends Action } } - function serverError($msg, $code = 500, $content_type = 'xml') + function serverError($msg, $code = 500, $content_type = null) { $action = $this->trimmed('action'); + if ($content_type === null) { + $content_type = $this->format; + } common_debug("Server error '$code' on '$action': $msg", __FILE__); From f06e661a9bd2cde41c9974896bb5f819469dad14 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 10:36:25 -0500 Subject: [PATCH 23/89] new methods for paths to plugin static files --- README | 17 +++++++++++++++++ lib/default.php | 3 +++ lib/plugin.php | 43 +++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 61 insertions(+), 2 deletions(-) diff --git a/README b/README index d972bf5676..b71d21aba5 100644 --- a/README +++ b/README @@ -1572,6 +1572,23 @@ proxy_user: Username to use for authenticating to the HTTP proxy. Default null. proxy_password: Password to use for authenticating to the HTTP proxy. Default null. proxy_auth_scheme: Scheme to use for authenticating to the HTTP proxy. Default null. +plugins +------- + +default: associative array mapping plugin name to array of arguments. To disable + a default plugin, unset its value in this array. +locale_path: path for finding plugin locale files. In the plugin's directory + by default. +server: Server to find static files for a plugin when the page is plain old HTTP. + Defaults to site/server (same as pages). Use this to move plugin CSS and + JS files to a CDN. +sslserver: Server to find static files for a plugin when the page is HTTPS. Defaults + to site/server (same as pages). Use this to move plugin CSS and JS files + to a CDN. +path: Path to the plugin files. defaults to site/path + '/plugins/'. Expects that + each plugin will have a subdirectory at plugins/NameOfPlugin. Change this + if you're using a CDN. + Plugins ======= diff --git a/lib/default.php b/lib/default.php index 2ddc47bd17..7d8b1fec7a 100644 --- a/lib/default.php +++ b/lib/default.php @@ -314,6 +314,9 @@ $default = 'RSSCloud' => null, 'OpenID' => null), 'locale_path' => false, // Set to a path to use *instead of* each plugin's own locale subdirectories + 'server' => null, + 'sslserver' => null, + 'path' => null, ), 'admin' => array('panels' => array('design', 'site', 'user', 'paths', 'access', 'sessions', 'sitenotice', 'license')), diff --git a/lib/plugin.php b/lib/plugin.php index 3f84afa27e..1ca5deb5c5 100644 --- a/lib/plugin.php +++ b/lib/plugin.php @@ -110,11 +110,16 @@ class Plugin { $this->log(LOG_DEBUG, $msg); } + + function name() + { + $cls = get_class($this); + return mb_substr($cls, 0, -6); + } function onPluginVersion(&$versions) { - $cls = get_class($this); - $name = mb_substr($cls, 0, -6); + $name = $this->name(); $versions[] = array('name' => $name, // TRANS: Displayed as version information for a plugin if no version information was found. @@ -122,4 +127,38 @@ class Plugin return true; } + + function path($relative) + { + return self::staticPath($this->name(), $relative); + } + + static function staticPath($plugin, $relative) + { + $isHTTPS = StatusNet::isHTTPS(); + + if ($isHTTPS) { + $server = common_config('plugins', 'sslserver'); + } else { + $server = common_config('plugins', 'server'); + } + + if (is_null($server)) { + if ($isHTTPS) { + $server = common_config('site', 'sslserver'); + } else { + $server = common_config('site', 'server'); + } + } + + $path = common_config('plugins', 'path'); + + if (is_null($path)) { + $path = common_config('site', 'path') . '/plugins/'; + } + + $protocol = ($isHTTPS) ? 'https' : 'http'; + + return $protocol.'://'.$server.$path.$plugin.'/'.$relative; + } } From 52c3c4468d6088d5328b0014b65df9ec8ca1ce46 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 10:46:56 -0500 Subject: [PATCH 24/89] BlankAd uses plugins server --- plugins/BlankAd/BlankAdPlugin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/BlankAd/BlankAdPlugin.php b/plugins/BlankAd/BlankAdPlugin.php index 49243aeea9..9128e7bcdb 100644 --- a/plugins/BlankAd/BlankAdPlugin.php +++ b/plugins/BlankAd/BlankAdPlugin.php @@ -65,7 +65,7 @@ class BlankAdPlugin extends UAPPlugin $action->element('img', array('width' => 300, 'height' => 250, - 'src' => common_path('plugins/BlankAd/redpixel.png')), + 'src' => $this->path('redpixel.png')), ''); } @@ -81,7 +81,7 @@ class BlankAdPlugin extends UAPPlugin $action->element('img', array('width' => 180, 'height' => 150, - 'src' => common_path('plugins/BlankAd/redpixel.png')), + 'src' => $this->path('redpixel.png')), ''); } @@ -97,7 +97,7 @@ class BlankAdPlugin extends UAPPlugin $action->element('img', array('width' => 160, 'height' => 600, - 'src' => common_path('plugins/BlankAd/redpixel.png')), + 'src' => $this->path('redpixel.png')), ''); } @@ -113,7 +113,7 @@ class BlankAdPlugin extends UAPPlugin $action->element('img', array('width' => 728, 'height' => 90, - 'src' => common_path('plugins/BlankAd/redpixel.png')), + 'src' => $this->path('redpixel.png')), ''); } From 429cbb66b4f1d1b8ffd0bed6a75fcd6e2ce2d553 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 10:50:11 -0500 Subject: [PATCH 25/89] Mapstraction plugin uses Plugin::path() --- plugins/Mapstraction/MapstractionPlugin.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/Mapstraction/MapstractionPlugin.php b/plugins/Mapstraction/MapstractionPlugin.php index 020c0818ad..13c5e22057 100644 --- a/plugins/Mapstraction/MapstractionPlugin.php +++ b/plugins/Mapstraction/MapstractionPlugin.php @@ -129,7 +129,7 @@ class MapstractionPlugin extends Plugin break; case 'openlayers': // Use our included stripped & minified OpenLayers. - $action->script(common_path('plugins/Mapstraction/OpenLayers/OpenLayers.js')); + $action->script($this->path('OpenLayers/OpenLayers.js')); break; case 'yahoo': $action->script(sprintf('http://api.maps.yahoo.com/ajaxymap?v=3.8&appid=%s', @@ -145,13 +145,13 @@ class MapstractionPlugin extends Plugin // // Note that OpenLayers.js needs to be separate, or it won't // be able to find its UI images and styles. - $action->script(common_path('plugins/Mapstraction/usermap-mxn-openlayers.min.js')); + $action->script($this->path('usermap-mxn-openlayers.min.js')); } else { $action->script(sprintf('%s?(%s)', - common_path('plugins/Mapstraction/js/mxn.js'), + $this->path('js/mxn.js'), $this->provider)); - $action->script(common_path('plugins/Mapstraction/usermap.js')); + $action->script($this->path('usermap.js')); } $action->inlineScript(sprintf('var _provider = "%s";', $this->provider)); From 0a6d2d24b13436933bbda75290d9c5108c1fb367 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 10:51:59 -0500 Subject: [PATCH 26/89] MeteorPlugin uses Plugin::path() --- plugins/Meteor/MeteorPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Meteor/MeteorPlugin.php b/plugins/Meteor/MeteorPlugin.php index 1bdccae7a8..6e93e364f7 100644 --- a/plugins/Meteor/MeteorPlugin.php +++ b/plugins/Meteor/MeteorPlugin.php @@ -89,7 +89,7 @@ class MeteorPlugin extends RealtimePlugin { $scripts = parent::_getScripts(); $scripts[] = 'http://'.$this->webserver.(($this->webport == 80) ? '':':'.$this->webport).'/meteor.js'; - $scripts[] = common_path('plugins/Meteor/meteorupdater.min.js'); + $scripts[] = $this->path('meteorupdater.min.js'); return $scripts; } From 26407c3e35a328879816f56f3b722b1b1c3b5d8a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 10:58:06 -0500 Subject: [PATCH 27/89] Realtime plugin uses Plugin::path() --- plugins/Realtime/RealtimePlugin.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 113187e1e3..5d119982f5 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -116,8 +116,9 @@ class RealtimePlugin extends Plugin function onEndShowStatusNetStyles($action) { - $action->cssLink('plugins/Realtime/realtimeupdate.css', - null, 'screen, projection, tv'); + $action->cssLink($this->path('realtimeupdate.css'), + null, + 'screen, projection, tv'); return true; } @@ -322,7 +323,7 @@ class RealtimePlugin extends Plugin function _getScripts() { - return array('plugins/Realtime/realtimeupdate.min.js'); + return array($this->path('realtimeupdate.min.js')); } /** From c8386c7ecb9f77f1a4eb606b6ae0c43c9337a86a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:03:24 -0500 Subject: [PATCH 28/89] TwitterBridge uses Plugin::staticPath() --- plugins/TwitterBridge/twitterlogin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/TwitterBridge/twitterlogin.php b/plugins/TwitterBridge/twitterlogin.php index 5b5bfae191..062c781f77 100644 --- a/plugins/TwitterBridge/twitterlogin.php +++ b/plugins/TwitterBridge/twitterlogin.php @@ -83,7 +83,7 @@ class TwitterloginAction extends Action $this->elementStart('a', array('href' => common_local_url('twitterauthorization', null, array('signin' => true)))); - $this->element('img', array('src' => common_path('plugins/TwitterBridge/Sign-in-with-Twitter-lighter.png'), + $this->element('img', array('src' => Plugin::staticPath('TwitterBridge', 'Sign-in-with-Twitter-lighter.png'), 'alt' => _m('Sign in with Twitter'))); $this->elementEnd('a'); } From 22e8893fbaccc31294e3916e141d0d83fc54df90 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:09:26 -0500 Subject: [PATCH 29/89] OStatus uses Plugin::path() --- plugins/OStatus/OStatusPlugin.php | 4 ++-- plugins/OStatus/classes/Ostatus_profile.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 59c18746f0..8e6e2d2891 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -419,12 +419,12 @@ class OStatusPlugin extends Plugin } function onEndShowStatusNetStyles($action) { - $action->cssLink('plugins/OStatus/theme/base/css/ostatus.css'); + $action->cssLink($this->path('theme/base/css/ostatus.css')); return true; } function onEndShowStatusNetScripts($action) { - $action->script('plugins/OStatus/js/ostatus.js'); + $action->script($this->path('js/ostatus.js')); return true; } diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 303e177a57..13711d39f4 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -1112,7 +1112,8 @@ class Ostatus_profile extends Memcached_DataObject return $url; } } - return common_path('plugins/OStatus/images/96px-Feed-icon.svg.png'); + + return Plugin::staticPath('OStatus', 'images/96px-Feed-icon.svg.png'); } /** From 0bab5e4a9ef114c89b2b12d105d4d68f80f101cd Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:16:30 -0500 Subject: [PATCH 30/89] Autocomplete uses Plugin::path() --- plugins/Autocomplete/AutocompletePlugin.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Autocomplete/AutocompletePlugin.php b/plugins/Autocomplete/AutocompletePlugin.php index 230ba089de..ca495f79f4 100644 --- a/plugins/Autocomplete/AutocompletePlugin.php +++ b/plugins/Autocomplete/AutocompletePlugin.php @@ -51,15 +51,15 @@ class AutocompletePlugin extends Plugin function onEndShowScripts($action){ if (common_logged_in()) { - $action->script('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.pack.js'); - $action->script('plugins/Autocomplete/Autocomplete.js'); + $action->script($this->path('jquery-autocomplete/jquery.autocomplete.pack.js')); + $action->script($this->path('Autocomplete.js')); } } function onEndShowStatusNetStyles($action) { if (common_logged_in()) { - $action->cssLink('plugins/Autocomplete/jquery-autocomplete/jquery.autocomplete.css'); + $action->cssLink($this->path('jquery-autocomplete/jquery.autocomplete.css')); } } From 6494f5938cfe74ae539e15d14d9ae6ba46ab20a5 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:19:03 -0500 Subject: [PATCH 31/89] ClientSideShorten uses Plugin::path() --- plugins/ClientSideShorten/ClientSideShortenPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ClientSideShorten/ClientSideShortenPlugin.php b/plugins/ClientSideShorten/ClientSideShortenPlugin.php index 27a3a56f72..443d2fffe0 100644 --- a/plugins/ClientSideShorten/ClientSideShortenPlugin.php +++ b/plugins/ClientSideShorten/ClientSideShortenPlugin.php @@ -53,7 +53,7 @@ class ClientSideShortenPlugin extends Plugin function onEndShowScripts($action){ $action->inlineScript('var Notice_maxContent = ' . Notice::maxContent()); if (common_logged_in()) { - $action->script('plugins/ClientSideShorten/shorten.js'); + $action->script($this->path('shorten.js')); } } From 0ba450373d3ca788fa4baf7d85e266c4dc77f2ca Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:20:57 -0500 Subject: [PATCH 32/89] DirectionDetector uses Plugin::path() --- plugins/DirectionDetector/DirectionDetectorPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/DirectionDetector/DirectionDetectorPlugin.php b/plugins/DirectionDetector/DirectionDetectorPlugin.php index 4a38f390f1..ec206dd75c 100644 --- a/plugins/DirectionDetector/DirectionDetectorPlugin.php +++ b/plugins/DirectionDetector/DirectionDetectorPlugin.php @@ -129,7 +129,7 @@ class DirectionDetectorPlugin extends Plugin { */ function onEndShowScripts($action){ if (common_logged_in()) { - $action->script('plugins/DirectionDetector/jquery.DirectionDetector.js'); + $action->script($this->path('jquery.DirectionDetector.js')); } } From 3496559d8e29d73aa6ebf3c759ec81eca4c466b9 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:23:39 -0500 Subject: [PATCH 33/89] InfiniteScroll uses Plugin::path() --- plugins/InfiniteScroll/InfiniteScrollPlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/InfiniteScroll/InfiniteScrollPlugin.php b/plugins/InfiniteScroll/InfiniteScrollPlugin.php index 50c1b5a208..b6c4fabba0 100644 --- a/plugins/InfiniteScroll/InfiniteScrollPlugin.php +++ b/plugins/InfiniteScroll/InfiniteScrollPlugin.php @@ -40,8 +40,8 @@ class InfiniteScrollPlugin extends Plugin function onEndShowScripts($action) { - $action->script('plugins/InfiniteScroll/jquery.infinitescroll.js'); - $action->script('plugins/InfiniteScroll/infinitescroll.js'); + $action->script($this->path('jquery.infinitescroll.js')); + $action->script($this->path('infinitescroll.js')); } function onPluginVersion(&$versions) From 2f598f8c7be264bcb945c7fb04a4dd0be95bafc8 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:25:56 -0500 Subject: [PATCH 34/89] LinkPreview uses Plugin::path() --- plugins/LinkPreview/LinkPreviewPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/LinkPreview/LinkPreviewPlugin.php b/plugins/LinkPreview/LinkPreviewPlugin.php index 65f896ca27..8bc726413d 100644 --- a/plugins/LinkPreview/LinkPreviewPlugin.php +++ b/plugins/LinkPreview/LinkPreviewPlugin.php @@ -51,7 +51,7 @@ class LinkPreviewPlugin extends Plugin { $user = common_current_user(); if ($user && common_config('attachments', 'process_links')) { - $action->script('plugins/LinkPreview/linkpreview.min.js'); + $action->script($this->path('linkpreview.min.js')); $data = json_encode(array( 'api' => common_local_url('oembedproxy'), 'width' => common_config('attachments', 'thumbwidth'), From 50675e356b4e5b184de35c3bfdc1d5207f5a4da0 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:28:39 -0500 Subject: [PATCH 35/89] ModPlus uses Plugin::path() --- plugins/ModPlus/ModPlusPlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/ModPlus/ModPlusPlugin.php b/plugins/ModPlus/ModPlusPlugin.php index 3e7a8c7455..d2b7c09346 100644 --- a/plugins/ModPlus/ModPlusPlugin.php +++ b/plugins/ModPlus/ModPlusPlugin.php @@ -51,13 +51,13 @@ class ModPlusPlugin extends Plugin { $user = common_current_user(); if ($user) { - $action->script('plugins/ModPlus/modplus.js'); + $action->script($this->path('modplus.js')); } return true; } function onEndShowStatusNetStyles($action) { - $action->cssLink('plugins/ModPlus/modplus.css'); + $action->cssLink($this->path('modplus.css')); return true; } From 21950205668c913e905a1e458af8062ab37c6730 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:30:14 -0500 Subject: [PATCH 36/89] TabFocus uses Plugin::path() --- plugins/TabFocus/TabFocusPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/TabFocus/TabFocusPlugin.php b/plugins/TabFocus/TabFocusPlugin.php index dd8a972767..1b1d1c2b0a 100644 --- a/plugins/TabFocus/TabFocusPlugin.php +++ b/plugins/TabFocus/TabFocusPlugin.php @@ -41,7 +41,7 @@ class TabFocusPlugin extends Plugin function onEndShowScripts($action) { - $action->script('plugins/TabFocus/tabfocus.js'); + $action->script($this->path('tabfocus.js')); } function onPluginVersion(&$versions) From 27eeee08c1534859dc944346422597610ab2f7c7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:38:11 -0500 Subject: [PATCH 37/89] FIXME for Plugin::path() in TinyMCE --- plugins/TinyMCE/TinyMCEPlugin.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/TinyMCE/TinyMCEPlugin.php b/plugins/TinyMCE/TinyMCEPlugin.php index e0640ebdf3..49bbdf90db 100644 --- a/plugins/TinyMCE/TinyMCEPlugin.php +++ b/plugins/TinyMCE/TinyMCEPlugin.php @@ -38,6 +38,10 @@ if (!defined('STATUSNET')) { * Use TinyMCE library to allow rich text editing in the browser * * Converts the notice form in browser to a rich-text editor. + * + * FIXME: this plugin DOES NOT load its static files from the configured + * plugin server if one exists. There are cross-server permissions errors + * if you try to do that (something about window.tinymce). * * @category WYSIWYG * @package StatusNet From 9ae3d3de36e069d215fbc11f29d6058d1759b65c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:41:47 -0500 Subject: [PATCH 38/89] NewMenu uses Plugin::path() --- plugins/NewMenu/NewMenuPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/NewMenu/NewMenuPlugin.php b/plugins/NewMenu/NewMenuPlugin.php index 7aad0672bf..2454f867d6 100644 --- a/plugins/NewMenu/NewMenuPlugin.php +++ b/plugins/NewMenu/NewMenuPlugin.php @@ -331,7 +331,7 @@ class NewMenuPlugin extends Plugin array('default', 'identica', 'h4ck3r'))) && ($action instanceof AccountSettingsAction || $action instanceof ConnectSettingsAction)) { - $action->cssLink(common_path('plugins/NewMenu/newmenu.css')); + $action->cssLink($this->path('newmenu.css')); } return true; } From 70cf37cb8884740c3aa5db7df728336cf5215604 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:42:36 -0500 Subject: [PATCH 39/89] fix variable name in NewMenu --- plugins/NewMenu/NewMenuPlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/NewMenu/NewMenuPlugin.php b/plugins/NewMenu/NewMenuPlugin.php index 7aad0672bf..382a3acc01 100644 --- a/plugins/NewMenu/NewMenuPlugin.php +++ b/plugins/NewMenu/NewMenuPlugin.php @@ -326,7 +326,7 @@ class NewMenuPlugin extends Plugin function onEndShowStyles($action) { - if (($this->showCSS || + if (($this->loadCSS || in_array(common_config('site', 'theme'), array('default', 'identica', 'h4ck3r'))) && ($action instanceof AccountSettingsAction || From 0c7104ec2fd3aeb9f0e1b8df2d2f853ade459085 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:46:20 -0500 Subject: [PATCH 40/89] MobileProfile uses Plugin::path() --- plugins/MobileProfile/MobileProfilePlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/MobileProfile/MobileProfilePlugin.php b/plugins/MobileProfile/MobileProfilePlugin.php index b50440682f..b9c25ab998 100644 --- a/plugins/MobileProfile/MobileProfilePlugin.php +++ b/plugins/MobileProfile/MobileProfilePlugin.php @@ -241,13 +241,13 @@ class MobileProfilePlugin extends WAP20Plugin if (file_exists(Theme::file('css/mp-screen.css'))) { $action->cssLink('css/mp-screen.css', null, 'screen'); } else { - $action->cssLink('plugins/MobileProfile/mp-screen.css',null,'screen'); + $action->cssLink($this->path('mp-screen.css'),null,'screen'); } if (file_exists(Theme::file('css/mp-handheld.css'))) { $action->cssLink('css/mp-handheld.css', null, 'handheld'); } else { - $action->cssLink('plugins/MobileProfile/mp-handheld.css',null,'handheld'); + $action->cssLink($this->path('mp-handheld.css'),null,'handheld'); } // Allow other plugins to load their styles. From 55af561887d1c2992af75994bef9615a42aec60e Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:49:00 -0500 Subject: [PATCH 41/89] ShareNotice uses Plugin::path() --- plugins/ShareNotice/ShareNoticePlugin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ShareNotice/ShareNoticePlugin.php b/plugins/ShareNotice/ShareNoticePlugin.php index 8b94f83c8f..0cd248e213 100644 --- a/plugins/ShareNotice/ShareNoticePlugin.php +++ b/plugins/ShareNotice/ShareNoticePlugin.php @@ -33,7 +33,7 @@ class ShareNoticePlugin extends Plugin ); function onEndShowStatusNetStyles($action) { - $action->cssLink('plugins/ShareNotice/css/sharenotice.css'); + $action->cssLink($this->path('css/sharenotice.css')); return true; } From 77769e4b3c9cb48fbbad13b8b2e17f29131c25cd Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 11:51:58 -0500 Subject: [PATCH 42/89] YammerImport uses Plugin::path() --- plugins/YammerImport/actions/yammeradminpanel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/YammerImport/actions/yammeradminpanel.php b/plugins/YammerImport/actions/yammeradminpanel.php index 3faf390ac1..4714154290 100644 --- a/plugins/YammerImport/actions/yammeradminpanel.php +++ b/plugins/YammerImport/actions/yammeradminpanel.php @@ -176,12 +176,12 @@ class YammeradminpanelAction extends AdminPanelAction function showStylesheets() { parent::showStylesheets(); - $this->cssLink('plugins/YammerImport/css/admin.css', null, 'screen, projection, tv'); + $this->cssLink(Plugin::staticPath('YammerImport', 'css/admin.css'), null, 'screen, projection, tv'); } function showScripts() { parent::showScripts(); - $this->script('plugins/YammerImport/js/yammer-admin.js'); + $this->script(Plugin::staticPath('YammerImport', 'js/yammer-admin.js')); } } From 68cf2bdced6fab78639fed15d72a134ce2a3f657 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 12:04:54 -0500 Subject: [PATCH 43/89] Bookmark uses Plugin::path() --- plugins/Bookmark/BookmarkPlugin.php | 2 +- plugins/Bookmark/bookmarkpopup.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Bookmark/BookmarkPlugin.php b/plugins/Bookmark/BookmarkPlugin.php index 800a26e795..2e6baf5e4e 100644 --- a/plugins/Bookmark/BookmarkPlugin.php +++ b/plugins/Bookmark/BookmarkPlugin.php @@ -149,7 +149,7 @@ class BookmarkPlugin extends Plugin function onEndShowStyles($action) { - $action->cssLink('plugins/Bookmark/bookmark.css'); + $action->cssLink($this->path('bookmark.css')); return true; } diff --git a/plugins/Bookmark/bookmarkpopup.php b/plugins/Bookmark/bookmarkpopup.php index 24ed79612b..33f983a93a 100644 --- a/plugins/Bookmark/bookmarkpopup.php +++ b/plugins/Bookmark/bookmarkpopup.php @@ -107,6 +107,6 @@ class BookmarkpopupAction extends NewbookmarkAction function showScripts() { parent::showScripts(); - $this->script(common_path('plugins/Bookmark/bookmarkpopup.js')); + $this->script(Plugin::staticPath('Bookmark', 'bookmarkpopup.js')); } } From ffb7ca3e9939076285b7823048c0a5eae90cf3b8 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 12:18:57 -0500 Subject: [PATCH 44/89] Realtime needs to load from own directory, not subclass's --- plugins/Realtime/RealtimePlugin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Realtime/RealtimePlugin.php b/plugins/Realtime/RealtimePlugin.php index 5d119982f5..246b1f9735 100644 --- a/plugins/Realtime/RealtimePlugin.php +++ b/plugins/Realtime/RealtimePlugin.php @@ -116,7 +116,7 @@ class RealtimePlugin extends Plugin function onEndShowStatusNetStyles($action) { - $action->cssLink($this->path('realtimeupdate.css'), + $action->cssLink(Plugin::staticPath('Realtime', 'realtimeupdate.css'), null, 'screen, projection, tv'); return true; @@ -323,7 +323,7 @@ class RealtimePlugin extends Plugin function _getScripts() { - return array($this->path('realtimeupdate.min.js')); + return array(Plugin::staticPath('Realtime', 'realtimeupdate.min.js')); } /** From 67b83bcca83293c29ea19ec9b0dd78159d9dc626 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 12:22:39 -0500 Subject: [PATCH 45/89] FacebookBridge use Plugin::path() --- plugins/FacebookBridge/actions/facebooklogin.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/FacebookBridge/actions/facebooklogin.php b/plugins/FacebookBridge/actions/facebooklogin.php index f8a45c41b2..924dd46565 100644 --- a/plugins/FacebookBridge/actions/facebooklogin.php +++ b/plugins/FacebookBridge/actions/facebooklogin.php @@ -89,10 +89,7 @@ class FacebookloginAction extends Action ); $attrs = array( - 'src' => common_path( - 'plugins/FacebookBridge/images/login-button.png', - true - ), + 'src' => Plugin::staticPath('FacebookBridge', 'images/login-button.png'), 'alt' => 'Login with Facebook', 'title' => 'Login with Facebook' ); From 5f365e75ca15c9777ab1930b416abae4d9d4d7cc Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 13:58:56 -0500 Subject: [PATCH 46/89] only blow public timeline cache if notice is in it --- classes/Notice.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index e9ea479e14..2d13828f1f 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -446,7 +446,10 @@ class Notice extends Memcached_DataObject function blowOnInsert($conversation = false) { self::blow('profile:notice_ids:%d', $this->profile_id); - self::blow('public'); + + if ($this->isPublic()) { + self::blow('public'); + } // XXX: Before we were blowing the casche only if the notice id // was not the root of the conversation. What to do now? @@ -481,7 +484,10 @@ class Notice extends Memcached_DataObject $this->blowOnInsert(); self::blow('profile:notice_ids:%d;last', $this->profile_id); - self::blow('public;last'); + + if ($this->isPublic()) { + self::blow('public;last'); + } } /** save all urls in the notice to the db @@ -2107,4 +2113,14 @@ class Notice extends Memcached_DataObject $obj->whereAdd($max); } } + + function isPublic() + { + if (common_config('public', 'localonly')) { + return ($this->is_local == Notice::LOCAL_PUBLIC); + } else { + return (($this->is_local != Notice::LOCAL_NONPUBLIC) && + ($this->is_local != Notice::GATEWAY)); + } + } } From 094bb9e1c36cff414b824210ac6395ef51a7a623 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 15:28:41 -0500 Subject: [PATCH 47/89] redo the group dm schema, again --- plugins/PrivateGroup/Group_message.php | 105 ++++------------- .../PrivateGroup/Group_message_profile.php | 111 ++++++++++++++++++ plugins/PrivateGroup/PrivateGroupPlugin.php | 33 +++--- 3 files changed, 150 insertions(+), 99 deletions(-) create mode 100644 plugins/PrivateGroup/Group_message_profile.php diff --git a/plugins/PrivateGroup/Group_message.php b/plugins/PrivateGroup/Group_message.php index 404f663a1f..27f4cff0ed 100644 --- a/plugins/PrivateGroup/Group_message.php +++ b/plugins/PrivateGroup/Group_message.php @@ -1,6 +1,6 @@ * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 @@ -55,9 +47,15 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; class Group_message extends Memcached_DataObject { - public $__table = 'user_greeting_count'; // table name - public $user_id; // int(4) primary_key not_null - public $greeting_count; // int(4) + public $__table = 'group_message'; // table name + public $id; // char(36) primary_key not_null + public $uri; // varchar(255) + public $from_profile; // int + public $to_group; // int + public $content; + public $rendered; + public $url; + public $created; /** * Get an instance by key @@ -85,8 +83,14 @@ class Group_message extends Memcached_DataObject */ function table() { - return array('user_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, - 'greeting_count' => DB_DATAOBJECT_INT); + return array('id' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, + 'uri' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, + 'from_profile' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, + 'to_group' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, + 'content' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, + 'rendered' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, + 'url' => DB_DATAOBJECT_STR, + 'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL); } /** @@ -106,79 +110,12 @@ class Group_message extends Memcached_DataObject /** * return key definitions for Memcached_DataObject * - * Our caching system uses the same key definitions, but uses a different - * method to get them. This key information is used to store and clear - * cached data, so be sure to list any key that will be used for static - * lookups. - * * @return array associative array of key definitions, field name to type: * 'K' for primary key: for compound keys, add an entry for each component; * 'U' for unique keys: compound keys are not well supported here. */ function keyTypes() { - return array('user_id' => 'K'); - } - - /** - * Magic formula for non-autoincrementing integer primary keys - * - * If a table has a single integer column as its primary key, DB_DataObject - * assumes that the column is auto-incrementing and makes a sequence table - * to do this incrementation. Since we don't need this for our class, we - * overload this method and return the magic formula that DB_DataObject needs. - * - * @return array magic three-false array that stops auto-incrementing. - */ - function sequenceKey() - { - return array(false, false, false); - } - - /** - * Increment a user's greeting count and return instance - * - * This method handles the ins and outs of creating a new greeting_count for a - * user or fetching the existing greeting count and incrementing its value. - * - * @param integer $user_id ID of the user to get a count for - * - * @return Group_message instance for this user, with count already incremented. - */ - static function inc($user_id) - { - $gc = Group_message::staticGet('user_id', $user_id); - - if (empty($gc)) { - - $gc = new Group_message(); - - $gc->user_id = $user_id; - $gc->greeting_count = 1; - - $result = $gc->insert(); - - if (!$result) { - // TRANS: Exception thrown when the user greeting count could not be saved in the database. - // TRANS: %d is a user ID (number). - throw Exception(sprintf(_m("Could not save new greeting count for %d."), - $user_id)); - } - } else { - $orig = clone($gc); - - $gc->greeting_count++; - - $result = $gc->update($orig); - - if (!$result) { - // TRANS: Exception thrown when the user greeting count could not be saved in the database. - // TRANS: %d is a user ID (number). - throw Exception(sprintf(_m("Could not increment greeting count for %d."), - $user_id)); - } - } - - return $gc; + return array('id' => 'K', 'uri' => 'U'); } } diff --git a/plugins/PrivateGroup/Group_message_profile.php b/plugins/PrivateGroup/Group_message_profile.php new file mode 100644 index 0000000000..b32341ca77 --- /dev/null +++ b/plugins/PrivateGroup/Group_message_profile.php @@ -0,0 +1,111 @@ + + * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 + * @link http://status.net/ + * + * StatusNet - the distributed open-source microblogging tool + * Copyright (C) 2010, StatusNet, 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 . + */ + +if (!defined('STATUSNET')) { + exit(1); +} + +require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; + +/** + * Data class for group direct messages for users + * + * @category PrivateGroup + * @package StatusNet + * @author Evan Prodromou + * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 + * @link http://status.net/ + * + * @see DB_DataObject + */ + +class Group_message_profile extends Memcached_DataObject +{ + public $__table = 'group_message_profile'; // table name + public $to_profile; // int + public $group_message_id; // char(36) primary_key not_null + public $created; + + /** + * Get an instance by key + * + * This is a utility method to get a single instance with a given key value. + * + * @param string $k Key to use to lookup (usually 'user_id' for this class) + * @param mixed $v Value to lookup + * + * @return Group_message object found, or null for no hits + * + */ + function staticGet($k, $v=null) + { + return Memcached_DataObject::staticGet('Group_message_profile', $k, $v); + } + + /** + * return table definition for DB_DataObject + * + * DB_DataObject needs to know something about the table to manipulate + * instances. This method provides all the DB_DataObject needs to know. + * + * @return array array of column definitions + */ + function table() + { + return array('to_profile' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL, + 'group_message_id' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL, + 'created' => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL); + } + + /** + * return key definitions for DB_DataObject + * + * DB_DataObject needs to know about keys that the table has, since it + * won't appear in StatusNet's own keys list. In most cases, this will + * simply reference your keyTypes() function. + * + * @return array list of key field names + */ + function keys() + { + return array_keys($this->keyTypes()); + } + + /** + * return key definitions for Memcached_DataObject + * + * @return array associative array of key definitions, field name to type: + * 'K' for primary key: for compound keys, add an entry for each component; + * 'U' for unique keys: compound keys are not well supported here. + */ + function keyTypes() + { + return array('to_profile' => 'K', 'group_message_id' => 'K'); + } +} diff --git a/plugins/PrivateGroup/PrivateGroupPlugin.php b/plugins/PrivateGroup/PrivateGroupPlugin.php index 9851313ff4..cd0ef0a22d 100644 --- a/plugins/PrivateGroup/PrivateGroupPlugin.php +++ b/plugins/PrivateGroup/PrivateGroupPlugin.php @@ -110,26 +110,21 @@ class PrivateGroupPlugin extends Plugin false, 'UNI'), new ColumnDef('created', - 'datetime'), - new ColumnDef('modified', - 'timestamp'))); + 'datetime'))); - - $schema->ensureTable('group_message_copy', - array(new ColumnDef('group_message_id', + $schema->ensureTable('group_message_profile', + array(new ColumnDef('to_profile', + 'integer', + null, + false, + 'PRI'), + new ColumnDef('group_message_id', 'char', 36, false, 'PRI'), - new ColumnDef('message_uri', - 'varchar', - 255, - false, - 'PRI'), new ColumnDef('created', - 'datetime'), - new ColumnDef('modified', - 'timestamp'))); + 'datetime'))); return true; } @@ -205,7 +200,7 @@ class PrivateGroupPlugin extends Plugin /** * Create default group privacy settings at group create time * - * @param $group Group that was just created + * @param User_group $group Group that was just created * * @result boolean hook value */ @@ -227,6 +222,14 @@ class PrivateGroupPlugin extends Plugin return true; } + /** + * Show group privacy controls on group edit form + * + * @param Action $action EditgroupAction being executed + * + * + */ + function onPluginVersion(&$versions) { $versions[] = array('name' => 'PrivateGroup', From 8bf57019c1e88ebf4c00eaf1641dbc82fc724ec7 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 15:30:57 -0500 Subject: [PATCH 48/89] autoload private group classes --- plugins/PrivateGroup/PrivateGroupPlugin.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/PrivateGroup/PrivateGroupPlugin.php b/plugins/PrivateGroup/PrivateGroupPlugin.php index cd0ef0a22d..66fd7430b1 100644 --- a/plugins/PrivateGroup/PrivateGroupPlugin.php +++ b/plugins/PrivateGroup/PrivateGroupPlugin.php @@ -147,7 +147,8 @@ class PrivateGroupPlugin extends Plugin include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; return false; case 'Group_privacy_settings': - case 'Group_private_inbox': + case 'Group_message': + case 'Group_message_profile': include_once $dir . '/'.$cls.'.php'; return false; default: From 2cdba23df418245e9981753e473b2eeaf1420dad Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 16:19:41 -0500 Subject: [PATCH 49/89] hook for new group through a form, same as editing --- actions/newgroup.php | 186 ++++++++++++++++++++++--------------------- 1 file changed, 96 insertions(+), 90 deletions(-) diff --git a/actions/newgroup.php b/actions/newgroup.php index 53c95d03f0..9682b875cb 100644 --- a/actions/newgroup.php +++ b/actions/newgroup.php @@ -120,103 +120,109 @@ class NewgroupAction extends Action function trySave() { - try { - $nickname = Nickname::normalize($this->trimmed('nickname')); - } catch (NicknameException $e) { - $this->showForm($e->getMessage()); - } - $fullname = $this->trimmed('fullname'); - $homepage = $this->trimmed('homepage'); - $description = $this->trimmed('description'); - $location = $this->trimmed('location'); - $aliasstring = $this->trimmed('aliases'); + if (Event::handle('StartGroupSaveForm', array($this))) { + try { + $nickname = Nickname::normalize($this->trimmed('nickname')); + } catch (NicknameException $e) { + $this->showForm($e->getMessage()); + } + $fullname = $this->trimmed('fullname'); + $homepage = $this->trimmed('homepage'); + $description = $this->trimmed('description'); + $location = $this->trimmed('location'); + $aliasstring = $this->trimmed('aliases'); - if ($this->nicknameExists($nickname)) { - // TRANS: Group create form validation error. - $this->showForm(_('Nickname already in use. Try another one.')); - return; - } else if (!User_group::allowedNickname($nickname)) { - // TRANS: Group create form validation error. - $this->showForm(_('Not a valid nickname.')); - return; - } else if (!is_null($homepage) && (strlen($homepage) > 0) && - !Validate::uri($homepage, - array('allowed_schemes' => - array('http', 'https')))) { - // TRANS: Group create form validation error. - $this->showForm(_('Homepage is not a valid URL.')); - return; - } else if (!is_null($fullname) && mb_strlen($fullname) > 255) { - // TRANS: Group create form validation error. - $this->showForm(_('Full name is too long (maximum 255 characters).')); - return; - } else if (User_group::descriptionTooLong($description)) { - // TRANS: Group create form validation error. - // TRANS: %d is the maximum number of allowed characters. - $this->showForm(sprintf(_m('Description is too long (maximum %d character).', - 'Description is too long (maximum %d characters).', - User_group::maxDescription()), - User_group::maxDescription())); - return; - } else if (!is_null($location) && mb_strlen($location) > 255) { - // TRANS: Group create form validation error. - $this->showForm(_('Location is too long (maximum 255 characters).')); - return; - } - - if (!empty($aliasstring)) { - $aliases = array_map('common_canonical_nickname', array_unique(preg_split('/[\s,]+/', $aliasstring))); - } else { - $aliases = array(); - } - - if (count($aliases) > common_config('group', 'maxaliases')) { - // TRANS: Group create form validation error. - // TRANS: %d is the maximum number of allowed aliases. - $this->showForm(sprintf(_m('Too many aliases! Maximum %d allowed.', - 'Too many aliases! Maximum %d allowed.', - common_config('group', 'maxaliases')), - common_config('group', 'maxaliases'))); - return; - } - - foreach ($aliases as $alias) { - if (!Nickname::isValid($alias)) { + if ($this->nicknameExists($nickname)) { // TRANS: Group create form validation error. - // TRANS: %s is the invalid alias. - $this->showForm(sprintf(_('Invalid alias: "%s"'), $alias)); + $this->showForm(_('Nickname already in use. Try another one.')); return; - } - if ($this->nicknameExists($alias)) { - // TRANS: Group create form validation error. %s is the already used alias. - $this->showForm(sprintf(_('Alias "%s" already in use. Try another one.'), - $alias)); - return; - } - // XXX assumes alphanum nicknames - if (strcmp($alias, $nickname) == 0) { + } else if (!User_group::allowedNickname($nickname)) { // TRANS: Group create form validation error. - $this->showForm(_('Alias cannot be the same as nickname.')); + $this->showForm(_('Not a valid nickname.')); + return; + } else if (!is_null($homepage) && (strlen($homepage) > 0) && + !Validate::uri($homepage, + array('allowed_schemes' => + array('http', 'https')))) { + // TRANS: Group create form validation error. + $this->showForm(_('Homepage is not a valid URL.')); + return; + } else if (!is_null($fullname) && mb_strlen($fullname) > 255) { + // TRANS: Group create form validation error. + $this->showForm(_('Full name is too long (maximum 255 characters).')); + return; + } else if (User_group::descriptionTooLong($description)) { + // TRANS: Group create form validation error. + // TRANS: %d is the maximum number of allowed characters. + $this->showForm(sprintf(_m('Description is too long (maximum %d character).', + 'Description is too long (maximum %d characters).', + User_group::maxDescription()), + User_group::maxDescription())); + return; + } else if (!is_null($location) && mb_strlen($location) > 255) { + // TRANS: Group create form validation error. + $this->showForm(_('Location is too long (maximum 255 characters).')); return; } + + if (!empty($aliasstring)) { + $aliases = array_map('common_canonical_nickname', array_unique(preg_split('/[\s,]+/', $aliasstring))); + } else { + $aliases = array(); + } + + if (count($aliases) > common_config('group', 'maxaliases')) { + // TRANS: Group create form validation error. + // TRANS: %d is the maximum number of allowed aliases. + $this->showForm(sprintf(_m('Too many aliases! Maximum %d allowed.', + 'Too many aliases! Maximum %d allowed.', + common_config('group', 'maxaliases')), + common_config('group', 'maxaliases'))); + return; + } + + foreach ($aliases as $alias) { + if (!Nickname::isValid($alias)) { + // TRANS: Group create form validation error. + // TRANS: %s is the invalid alias. + $this->showForm(sprintf(_('Invalid alias: "%s"'), $alias)); + return; + } + if ($this->nicknameExists($alias)) { + // TRANS: Group create form validation error. %s is the already used alias. + $this->showForm(sprintf(_('Alias "%s" already in use. Try another one.'), + $alias)); + return; + } + // XXX assumes alphanum nicknames + if (strcmp($alias, $nickname) == 0) { + // TRANS: Group create form validation error. + $this->showForm(_('Alias cannot be the same as nickname.')); + return; + } + } + + $cur = common_current_user(); + + // Checked in prepare() above + + assert(!is_null($cur)); + + $group = User_group::register(array('nickname' => $nickname, + 'fullname' => $fullname, + 'homepage' => $homepage, + 'description' => $description, + 'location' => $location, + 'aliases' => $aliases, + 'userid' => $cur->id, + 'local' => true)); + + $this->group = $group; + + Event::handle('EndGroupSaveForm', array($this)); + + common_redirect($group->homeUrl(), 303); } - - $cur = common_current_user(); - - // Checked in prepare() above - - assert(!is_null($cur)); - - $group = User_group::register(array('nickname' => $nickname, - 'fullname' => $fullname, - 'homepage' => $homepage, - 'description' => $description, - 'location' => $location, - 'aliases' => $aliases, - 'userid' => $cur->id, - 'local' => true)); - - common_redirect($group->homeUrl(), 303); } function nicknameExists($nickname) From a002d577364a1e92f693ff005d71bdaae14d67a5 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 16:39:52 -0500 Subject: [PATCH 50/89] save group privacy settings --- plugins/PrivateGroup/PrivateGroupPlugin.php | 65 ++++++++++++++++++++- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/plugins/PrivateGroup/PrivateGroupPlugin.php b/plugins/PrivateGroup/PrivateGroupPlugin.php index 66fd7430b1..67e1cfb65e 100644 --- a/plugins/PrivateGroup/PrivateGroupPlugin.php +++ b/plugins/PrivateGroup/PrivateGroupPlugin.php @@ -226,10 +226,69 @@ class PrivateGroupPlugin extends Plugin /** * Show group privacy controls on group edit form * - * @param Action $action EditgroupAction being executed - * - * + * @param GroupEditForm $form form being shown */ + + function onEndGroupEditFormData($form) + { + $gps = null; + + if (!empty($form->group)) { + $gps = Group_privacy_settings::staticGet('group_id', $form->group->id); + } + + $form->out->elementStart('li'); + $form->out->dropdown('allow_privacy', + _('Private messages'), + array(Group_privacy_settings::SOMETIMES => _('Sometimes'), + Group_privacy_settings::ALWAYS => _('Always'), + Group_privacy_settings::NEVER => _('Never')), + _('Whether to allow private messages to this group'), + false, + (empty($gps)) ? Group_privacy_settings::SOMETIMES : $gps->allow_privacy); + $form->out->elementEnd('li'); + $form->out->elementStart('li'); + $form->out->dropdown('allow_sender', + _('Private sender'), + array(Group_privacy_settings::EVERYONE => _('Everyone'), + Group_privacy_settings::MEMBER => _('Member'), + Group_privacy_settings::ADMIN => _('Admin')), + _('Who can send private messages to the group'), + false, + (empty($gps)) ? Group_privacy_settings::MEMBER : $gps->allow_sender); + $form->out->elementEnd('li'); + return true; + } + + function onEndGroupSaveForm($action) + { + $gps = null; + + if (!empty($action->group)) { + $gps = Group_privacy_settings::staticGet('group_id', $action->group->id); + } + + $orig = null; + + if (empty($gps)) { + $gps = new Group_privacy_settings(); + $gps->group_id = $action->group->id; + } else { + $orig = clone($gps); + } + + $gps->allow_privacy = $action->trimmed('allow_privacy'); + $gps->allow_sender = $action->trimmed('allow_sender'); + + if (empty($orig)) { + $gps->created = common_sql_now(); + $gps->insert(); + } else { + $gps->update($orig); + } + + return true; + } function onPluginVersion(&$versions) { From 21feac3bea72b0ecd88a39d95345a0c78fe5fd89 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 17:04:16 -0500 Subject: [PATCH 51/89] hooks for commands --- EVENTS.txt | 13 + lib/commandinterpreter.php | 487 ++++++++++++++++++++----------------- 2 files changed, 273 insertions(+), 227 deletions(-) diff --git a/EVENTS.txt b/EVENTS.txt index d26c576e19..98927127b7 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -1069,3 +1069,16 @@ StartGroupSave: After initializing but before saving a group EndGroupSave: After saving a group, aliases, and first member - $group: group that was saved + +StartInterpretCommand: Before running a command +- $cmd: First word in the string, 'foo' in 'foo argument' +- $arg: Argument, if any, like 'argument' in 'foo argument' +- $user: User who issued the command +- &$result: Resulting command; you can set this! + +EndInterpretCommand: Before running a command +- $cmd: First word in the string, 'foo' in 'foo argument' +- $arg: Argument, if any, like 'argument' in 'foo argument' +- $user: User who issued the command +- $result: Resulting command + diff --git a/lib/commandinterpreter.php b/lib/commandinterpreter.php index c288c2e5f0..2e79fb27ee 100644 --- a/lib/commandinterpreter.php +++ b/lib/commandinterpreter.php @@ -25,252 +25,285 @@ class CommandInterpreter { function handle_command($user, $text) { - # XXX: localise + // XXX: localise $text = preg_replace('/\s+/', ' ', trim($text)); list($cmd, $arg) = $this->split_arg($text); - # We try to support all the same commands as Twitter, see - # http://getsatisfaction.com/twitter/topics/what_are_the_twitter_commands - # There are a few compatibility commands from earlier versions of - # StatusNet + // We try to support all the same commands as Twitter, see + // http://getsatisfaction.com/twitter/topics/what_are_the_twitter_commands + // There are a few compatibility commands from earlier versions of + // StatusNet - switch(strtolower($cmd)) { - case 'help': - if ($arg) { - return null; - } - return new HelpCommand($user); - case 'login': - if ($arg) { - return null; - } else { - return new LoginCommand($user); - } - case 'lose': - if ($arg) { + if (Event::handle('StartIntepretCommand', array($cmd, $arg, $user, &$result))) { + switch(strtolower($cmd)) { + case 'help': + if ($arg) { + $result = null; + } + $result = new HelpCommand($user); + break; + case 'login': + if ($arg) { + $result = null; + } else { + $result = new LoginCommand($user); + } + break; + case 'lose': + if ($arg) { + list($other, $extra) = $this->split_arg($arg); + if ($extra) { + $result = null; + } else { + $result = new LoseCommand($user, $other); + } + } else { + $result = null; + } + break; + case 'subscribers': + if ($arg) { + $result = null; + } else { + $result = new SubscribersCommand($user); + } + break; + case 'subscriptions': + if ($arg) { + $result = null; + } else { + $result = new SubscriptionsCommand($user); + } + break; + case 'groups': + if ($arg) { + $result = null; + } else { + $result = new GroupsCommand($user); + } + break; + case 'on': + if ($arg) { + list($other, $extra) = $this->split_arg($arg); + if ($extra) { + $result = null; + } else { + $result = new OnCommand($user, $other); + } + } else { + $result = new OnCommand($user); + } + break; + case 'off': + if ($arg) { + list($other, $extra) = $this->split_arg($arg); + if ($extra) { + $result = null; + } else { + $result = new OffCommand($user, $other); + } + } else { + $result = new OffCommand($user); + } + break; + case 'stop': + case 'quit': + if ($arg) { + $result = null; + } else { + $result = new OffCommand($user); + } + break; + case 'join': + if (!$arg) { + $result = null; + } list($other, $extra) = $this->split_arg($arg); if ($extra) { - return null; + $result = null; } else { - return new LoseCommand($user, $other); + $result = new JoinCommand($user, $other); + } + break; + case 'drop': + if (!$arg) { + $result = null; } - } else { - return null; - } - case 'subscribers': - if ($arg) { - return null; - } else { - return new SubscribersCommand($user); - } - case 'subscriptions': - if ($arg) { - return null; - } else { - return new SubscriptionsCommand($user); - } - case 'groups': - if ($arg) { - return null; - } else { - return new GroupsCommand($user); - } - case 'on': - if ($arg) { list($other, $extra) = $this->split_arg($arg); if ($extra) { - return null; + $result = null; } else { - return new OnCommand($user, $other); + $result = new DropCommand($user, $other); } - } else { - return new OnCommand($user); - } - case 'off': - if ($arg) { + break; + case 'follow': + case 'sub': + if (!$arg) { + $result = null; + } + list($other, $extra) = $this->split_arg($arg); if ($extra) { - return null; + $result = null; } else { - return new OffCommand($user, $other); + $result = new SubCommand($user, $other); } - } else { - return new OffCommand($user); + break; + case 'leave': + case 'unsub': + if (!$arg) { + $result = null; + } + + list($other, $extra) = $this->split_arg($arg); + if ($extra) { + $result = null; + } else { + $result = new UnsubCommand($user, $other); + } + break; + case 'get': + case 'last': + if (!$arg) { + $result = null; + } + list($other, $extra) = $this->split_arg($arg); + if ($extra) { + $result = null; + } else { + $result = new GetCommand($user, $other); + } + break; + case 'd': + case 'dm': + if (!$arg) { + $result = null; + } + list($other, $extra) = $this->split_arg($arg); + if (!$extra) { + $result = null; + } else { + $result = new MessageCommand($user, $other, $extra); + } + break; + case 'r': + case 'reply': + if (!$arg) { + $result = null; + } + list($other, $extra) = $this->split_arg($arg); + if (!$extra) { + $result = null; + } else { + $result = new ReplyCommand($user, $other, $extra); + } + break; + case 'repeat': + case 'rp': + case 'rt': + case 'rd': + if (!$arg) { + $result = null; + } + list($other, $extra) = $this->split_arg($arg); + if ($extra) { + $result = null; + } else { + $result = new RepeatCommand($user, $other); + } + break; + case 'whois': + if (!$arg) { + $result = null; + } + list($other, $extra) = $this->split_arg($arg); + if ($extra) { + $result = null; + } else { + $result = new WhoisCommand($user, $other); + } + break; + case 'fav': + if (!$arg) { + $result = null; + } + list($other, $extra) = $this->split_arg($arg); + if ($extra) { + $result = null; + } else { + $result = new FavCommand($user, $other); + } + break; + case 'nudge': + if (!$arg) { + $result = null; + } + list($other, $extra) = $this->split_arg($arg); + if ($extra) { + $result = null; + } else { + $result = new NudgeCommand($user, $other); + } + break; + case 'stats': + if ($arg) { + $result = null; + } + $result = new StatsCommand($user); + break; + case 'invite': + if (!$arg) { + $result = null; + } + list($other, $extra) = $this->split_arg($arg); + if ($extra) { + $result = null; + } else { + $result = new InviteCommand($user, $other); + } + break; + case 'track': + if (!$arg) { + $result = null; + } + list($word, $extra) = $this->split_arg($arg); + if ($extra) { + $result = null; + } else if ($word == 'off') { + $result = new TrackOffCommand($user); + } else { + $result = new TrackCommand($user, $word); + } + break; + case 'untrack': + if (!$arg) { + $result = null; + } + list($word, $extra) = $this->split_arg($arg); + if ($extra) { + $result = null; + } else if ($word == 'all') { + $result = new TrackOffCommand($user); + } else { + $result = new UntrackCommand($user, $word); + } + break; + case 'tracks': + case 'tracking': + if ($arg) { + $result = null; + } + $result = new TrackingCommand($user); + break; + default: + $result = false; } - case 'stop': - case 'quit': - if ($arg) { - return null; - } else { - return new OffCommand($user); - } - case 'join': - if (!$arg) { - return null; - } - list($other, $extra) = $this->split_arg($arg); - if ($extra) { - return null; - } else { - return new JoinCommand($user, $other); - } - case 'drop': - if (!$arg) { - return null; - } - list($other, $extra) = $this->split_arg($arg); - if ($extra) { - return null; - } else { - return new DropCommand($user, $other); - } - case 'follow': - case 'sub': - if (!$arg) { - return null; - } - list($other, $extra) = $this->split_arg($arg); - if ($extra) { - return null; - } else { - return new SubCommand($user, $other); - } - case 'leave': - case 'unsub': - if (!$arg) { - return null; - } - list($other, $extra) = $this->split_arg($arg); - if ($extra) { - return null; - } else { - return new UnsubCommand($user, $other); - } - case 'get': - case 'last': - if (!$arg) { - return null; - } - list($other, $extra) = $this->split_arg($arg); - if ($extra) { - return null; - } else { - return new GetCommand($user, $other); - } - case 'd': - case 'dm': - if (!$arg) { - return null; - } - list($other, $extra) = $this->split_arg($arg); - if (!$extra) { - return null; - } else { - return new MessageCommand($user, $other, $extra); - } - case 'r': - case 'reply': - if (!$arg) { - return null; - } - list($other, $extra) = $this->split_arg($arg); - if (!$extra) { - return null; - } else { - return new ReplyCommand($user, $other, $extra); - } - case 'repeat': - case 'rp': - case 'rt': - case 'rd': - if (!$arg) { - return null; - } - list($other, $extra) = $this->split_arg($arg); - if ($extra) { - return null; - } else { - return new RepeatCommand($user, $other); - } - case 'whois': - if (!$arg) { - return null; - } - list($other, $extra) = $this->split_arg($arg); - if ($extra) { - return null; - } else { - return new WhoisCommand($user, $other); - } - case 'fav': - if (!$arg) { - return null; - } - list($other, $extra) = $this->split_arg($arg); - if ($extra) { - return null; - } else { - return new FavCommand($user, $other); - } - case 'nudge': - if (!$arg) { - return null; - } - list($other, $extra) = $this->split_arg($arg); - if ($extra) { - return null; - } else { - return new NudgeCommand($user, $other); - } - case 'stats': - if ($arg) { - return null; - } - return new StatsCommand($user); - case 'invite': - if (!$arg) { - return null; - } - list($other, $extra) = $this->split_arg($arg); - if ($extra) { - return null; - } else { - return new InviteCommand($user, $other); - } - case 'track': - if (!$arg) { - return null; - } - list($word, $extra) = $this->split_arg($arg); - if ($extra) { - return null; - } else if ($word == 'off') { - return new TrackOffCommand($user); - } else { - return new TrackCommand($user, $word); - } - case 'untrack': - if (!$arg) { - return null; - } - list($word, $extra) = $this->split_arg($arg); - if ($extra) { - return null; - } else if ($word == 'all') { - return new TrackOffCommand($user); - } else { - return new UntrackCommand($user, $word); - } - case 'tracks': - case 'tracking': - if ($arg) { - return null; - } - return new TrackingCommand($user); - default: - return false; + + Event::handle('EndInterpretCommand', array($cmd, $arg, $user, $result)); } + + return $result; } /** From d7b2b141be24b8de813733bafb07e624c99e4a02 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 3 Feb 2011 17:06:15 -0500 Subject: [PATCH 52/89] commands are always lowercased in interpreter --- lib/commandinterpreter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/commandinterpreter.php b/lib/commandinterpreter.php index 2e79fb27ee..f2caf48bdb 100644 --- a/lib/commandinterpreter.php +++ b/lib/commandinterpreter.php @@ -35,8 +35,10 @@ class CommandInterpreter // There are a few compatibility commands from earlier versions of // StatusNet + $cmd = strtolower($cmd); + if (Event::handle('StartIntepretCommand', array($cmd, $arg, $user, &$result))) { - switch(strtolower($cmd)) { + switch($cmd) { case 'help': if ($arg) { $result = null; From 842bc5708e4aed14d8e10a559234bd5fdce9d2a8 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Fri, 4 Feb 2011 15:51:59 -0500 Subject: [PATCH 53/89] Send a private group message with a d command --- plugins/PrivateGroup/Group_message.php | 94 +++++++++++++++++++ .../PrivateGroup/Group_message_profile.php | 75 +++++++++++++++ plugins/PrivateGroup/PrivateGroupPlugin.php | 49 +++++++++- plugins/PrivateGroup/groupmessagecommand.php | 85 +++++++++++++++++ 4 files changed, 302 insertions(+), 1 deletion(-) create mode 100644 plugins/PrivateGroup/groupmessagecommand.php diff --git a/plugins/PrivateGroup/Group_message.php b/plugins/PrivateGroup/Group_message.php index 27f4cff0ed..b3d34cf287 100644 --- a/plugins/PrivateGroup/Group_message.php +++ b/plugins/PrivateGroup/Group_message.php @@ -118,4 +118,98 @@ class Group_message extends Memcached_DataObject { return array('id' => 'K', 'uri' => 'U'); } + + static function send($user, $group, $text) + { + if (!$user->hasRight(Right::NEWMESSAGE)) { + // XXX: maybe break this out into a separate right + throw new Exception(sprintf(_('User %s not allowed to send private messages.'), + $user->nickname)); + } + + $gps = Group_privacy_settings::staticGet('group_id', $group->id); + + if (empty($gps)) { + // make a fake one with defaults + $gps = new Group_privacy_settings(); + $gps->allow_privacy = Group_privacy_settings::SOMETIMES; + $gps->allow_sender = Group_privacy_settings::MEMBER; + } + + if ($gps->allow_privacy == Group_privacy_settings::NEVER) { + throw new Exception(sprintf(_('Group %s does not allow private messages.'), + $group->nickname)); + } + + switch ($gps->allow_sender) { + case Group_privacy_settings::EVERYONE: + $profile = $user->getProfile(); + if (Group_block::isBlocked($group, $profile)) { + throw new Exception(sprintf(_('User %s is blocked from group %s.'), + $user->nickname, + $group->nickname)); + } + break; + case Group_privacy_settings::MEMBER: + if (!$user->isMember($group)) { + throw new Exception(sprintf(_('User %s is not a member of group %s.'), + $user->nickname, + $group->nickname)); + } + break; + case Group_privacy_settings::ADMIN: + if (!$user->isAdmin($group)) { + throw new Exception(sprintf(_('User %s is not an administrator of group %s.'), + $user->nickname, + $group->nickname)); + } + break; + default: + throw new Exception(sprintf(_('Unknown privacy settings for group %s.'), + $group->nickname)); + } + + $text = $user->shortenLinks($text); + + // We use the same limits as for 'regular' private messages. + + if (Message::contentTooLong($text)) { + throw new Exception(sprintf(_m('That\'s too long. Maximum message size is %d character.', + 'That\'s too long. Maximum message size is %d characters.', + Message::maxContent()), + Message::maxContent())); + } + + // Valid! Let's do this thing! + + $gm = new Group_message(); + + $gm->id = UUID::gen(); + $gm->uri = common_local_url('showgroupmessage', array('id' => $gm->id)); + $gm->from_profile = $user->id; + $gm->to_group = $group->id; + $gm->content = $text; // XXX: is this cool?! + $gm->rendered = common_render_text($text); + $gm->url = $gm->uri; + $gm->created = common_sql_now(); + + // This throws a conniption if there's a problem + + $gm->insert(); + + $gm->distribute(); + + return $gm; + } + + function distribute() + { + $group = User_group::staticGet('id', $this->to_group); + + $member = $group->getMembers(); + + while ($member->fetch()) { + Group_message_profile::send($this, $member); + } + } } diff --git a/plugins/PrivateGroup/Group_message_profile.php b/plugins/PrivateGroup/Group_message_profile.php index b32341ca77..fc1ff1bceb 100644 --- a/plugins/PrivateGroup/Group_message_profile.php +++ b/plugins/PrivateGroup/Group_message_profile.php @@ -108,4 +108,79 @@ class Group_message_profile extends Memcached_DataObject { return array('to_profile' => 'K', 'group_message_id' => 'K'); } + + /** + * No sequence keys in this table. + */ + function sequenceKey() + { + return array(false, false, false); + } + + function send($gm, $profile) + { + $gmp = new Group_message_profile(); + + $gmp->group_message_id = $gm->id; + $gmp->to_profile = $profile->id; + $gmp->created = common_sql_now(); + + $gmp->insert(); + + $gmp->notify(); + + return $gmp; + } + + function notify() + { + // XXX: add more here + $this->notifyByMail(); + } + + function notifyByMail() + { + $to = User::staticGet('id', $this->to_profile); + + if (empty($to) || is_null($to->email) || !$to->emailnotifymsg) { + return true; + } + + $gm = Group_message::staticGet('id', $this->group_message_id); + + $from_profile = Profile::staticGet('id', $gm->from_profile); + + common_switch_locale($to->language); + + // TRANS: Subject for direct-message notification email. + // TRANS: %s is the sending user's nickname. + $subject = sprintf(_('New private message from %s'), $from->nickname); + + $from_profile = $from->getProfile(); + + // TRANS: Body for direct-message notification email. + // TRANS: %1$s is the sending user's long name, %2$s is the sending user's nickname, + // TRANS: %3$s is the message content, %4$s a URL to the message, + // TRANS: %5$s is the StatusNet sitename. + $body = sprintf(_("%1\$s (%2\$s) sent you a private message:\n\n". + "------------------------------------------------------\n". + "%3\$s\n". + "------------------------------------------------------\n\n". + "You can reply to their message here:\n\n". + "%4\$s\n\n". + "Don't reply to this email; it won't get to them.\n\n". + "With kind regards,\n". + "%5\$s\n"), + $from_profile->getBestName(), + $from->nickname, + $this->content, + common_local_url('newmessage', array('to' => $from->id)), + common_config('site', 'name')); + + $headers = _mail_prepare_headers('message', $to->nickname, $from->nickname); + + common_switch_locale(); + + return mail_to_user($to, $subject, $body, $headers); + } } diff --git a/plugins/PrivateGroup/PrivateGroupPlugin.php b/plugins/PrivateGroup/PrivateGroupPlugin.php index 67e1cfb65e..4d8f2b370b 100644 --- a/plugins/PrivateGroup/PrivateGroupPlugin.php +++ b/plugins/PrivateGroup/PrivateGroupPlugin.php @@ -144,6 +144,7 @@ class PrivateGroupPlugin extends Plugin switch ($cls) { case 'GroupinboxAction': + case 'ShowgroupmessageAction': include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; return false; case 'Group_privacy_settings': @@ -151,6 +152,9 @@ class PrivateGroupPlugin extends Plugin case 'Group_message_profile': include_once $dir . '/'.$cls.'.php'; return false; + case 'GroupMessageCommand': + include_once $dir . '/'.strtolower($cls).'.php'; + return false; default: return true; } @@ -170,6 +174,10 @@ class PrivateGroupPlugin extends Plugin array('action' => 'groupinbox'), array('nickname' => Nickname::DISPLAY_FMT)); + $m->connect('group/message/:id', + array('action' => 'showgroupmessage'), + array('id' => '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}')); + return true; } @@ -289,7 +297,46 @@ class PrivateGroupPlugin extends Plugin return true; } - + + /** + * Overload 'd' command to send private messages to groups. + * + * 'd !group word word word' will send the private message + * 'word word word' to the group 'group'. + * + * @param string $cmd Command being run + * @param string $arg Rest of the message (including address) + * @param User $user User sending the message + * @param Command &$result The resulting command object to be run. + * + * @return boolean hook value + */ + function onStartIntepretCommand($cmd, $arg, $user, &$result) + { + if ($cmd == 'd' || $cmd == 'dm') { + + $this->debug('Got a d command'); + + // Break off the first word as the address + + $pieces = explode(' ', $arg, 2); + + if (count($pieces) == 1) { + $pieces[] = null; + } + + list($addr, $msg) = $pieces; + + if (!empty($addr) && $addr[0] == '!') { + $result = new GroupMessageCommand($user, substr($addr, 1), $msg); + Event::handle('EndInterpretCommand', array($cmd, $arg, $user, $result)); + return false; + } + } + + return true; + } + function onPluginVersion(&$versions) { $versions[] = array('name' => 'PrivateGroup', diff --git a/plugins/PrivateGroup/groupmessagecommand.php b/plugins/PrivateGroup/groupmessagecommand.php new file mode 100644 index 0000000000..19136f1318 --- /dev/null +++ b/plugins/PrivateGroup/groupmessagecommand.php @@ -0,0 +1,85 @@ +. + * + * @category Command + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET')) { + // This check helps protect against security problems; + // your code file can't be executed directly from the web. + exit(1); +} + +/** + * Command object for messages to groups + * + * @category General + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +class GroupMessageCommand extends Command +{ + /** User sending the message. */ + var $user; + /** Nickname of the group they're sending to. */ + var $nickname; + /** Text of the message. */ + var $text; + + /** + * Constructor + * + * @param User $user User sending the message + * @param string $nickname Nickname of the group + * @param string $text Text of message + */ + + function __construct($user, $nickname, $text) + { + $this->user = $user; + $this->nickname = $nickname; + $this->text = $text; + } + + function handle($channel) + { + // Throws a command exception if group not found + $group = $this->getGroup($this->nickname); + + $gm = Group_message::send($this->user, $group, $this->text); + + $channel->output($this->user, + sprintf(_('Direct message to group %s sent.'), + $group->nickname)); + + return true; + } +} From cd536e30991c61bcfc432fa48b8d31b2b0f8e41a Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Sat, 5 Feb 2011 16:18:59 -0500 Subject: [PATCH 54/89] move MESSAGES_PER_PAGE to common.php --- lib/common.php | 1 + lib/mailbox.php | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/common.php b/lib/common.php index 08779fb6fd..4fd49a5592 100644 --- a/lib/common.php +++ b/lib/common.php @@ -36,6 +36,7 @@ define('AVATAR_MINI_SIZE', 24); define('NOTICES_PER_PAGE', 20); define('PROFILES_PER_PAGE', 20); +define('MESSAGES_PER_PAGE', 20); define('FOREIGN_NOTICE_SEND', 1); define('FOREIGN_NOTICE_RECV', 2); diff --git a/lib/mailbox.php b/lib/mailbox.php index 2b00f5ffde..63bffa75cc 100644 --- a/lib/mailbox.php +++ b/lib/mailbox.php @@ -31,8 +31,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -define('MESSAGES_PER_PAGE', 20); - /** * common superclass for direct messages inbox and outbox * From 143cc4bdd08ee363518219f1d0b769028c508e11 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 09:46:26 -0500 Subject: [PATCH 55/89] Show private messages to groups in a list Shows the messages to a private group in a list. New classes for showing a group private message and list of group private messages. New actions for showing a stream of group private messages and a single group private message. --- plugins/PrivateGroup/Group_message.php | 32 +++ plugins/PrivateGroup/PrivateGroupPlugin.php | 2 + plugins/PrivateGroup/groupinbox.php | 214 +++++++++--------- plugins/PrivateGroup/groupmessagelist.php | 77 +++++++ plugins/PrivateGroup/groupmessagelistitem.php | 113 +++++++++ plugins/PrivateGroup/showgroupmessage.php | 188 +++++++++++++++ 6 files changed, 516 insertions(+), 110 deletions(-) create mode 100644 plugins/PrivateGroup/groupmessagelist.php create mode 100644 plugins/PrivateGroup/groupmessagelistitem.php create mode 100644 plugins/PrivateGroup/showgroupmessage.php diff --git a/plugins/PrivateGroup/Group_message.php b/plugins/PrivateGroup/Group_message.php index b3d34cf287..21147b4629 100644 --- a/plugins/PrivateGroup/Group_message.php +++ b/plugins/PrivateGroup/Group_message.php @@ -212,4 +212,36 @@ class Group_message extends Memcached_DataObject Group_message_profile::send($this, $member); } } + + function getGroup() + { + $group = User_group::staticGet('id', $this->to_group); + if (empty($group)) { + throw new ServerException(_('No group for group message')); + } + return $group; + } + + function getSender() + { + $sender = Profile::staticGet('id', $this->from_profile); + if (empty($sender)) { + throw new ServerException(_('No sender for group message')); + } + return $sender; + } + + static function forGroup($group, $offset, $limit) + { + // XXX: cache + $gm = new Group_message(); + + $gm->to_group = $group->id; + $gm->orderBy('created DESC'); + $gm->limit($offset, $limit); + + $gm->find(); + + return $gm; + } } diff --git a/plugins/PrivateGroup/PrivateGroupPlugin.php b/plugins/PrivateGroup/PrivateGroupPlugin.php index 4d8f2b370b..39e788074c 100644 --- a/plugins/PrivateGroup/PrivateGroupPlugin.php +++ b/plugins/PrivateGroup/PrivateGroupPlugin.php @@ -153,6 +153,8 @@ class PrivateGroupPlugin extends Plugin include_once $dir . '/'.$cls.'.php'; return false; case 'GroupMessageCommand': + case 'GroupMessageList': + case 'GroupMessageListItem': include_once $dir . '/'.strtolower($cls).'.php'; return false; default: diff --git a/plugins/PrivateGroup/groupinbox.php b/plugins/PrivateGroup/groupinbox.php index a793ac6de2..8b16e0632a 100644 --- a/plugins/PrivateGroup/groupinbox.php +++ b/plugins/PrivateGroup/groupinbox.php @@ -1,17 +1,11 @@ - * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://status.net/ - * * StatusNet - the distributed open-source microblogging tool - * Copyright (C) 2009, StatusNet, Inc. + * Copyright (C) 2010, StatusNet, Inc. + * + * List of private messages to this group + * + * PHP version 5 * * 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 @@ -25,140 +19,140 @@ * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . + * + * @category PrivateGroup + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ */ if (!defined('STATUSNET')) { + // This check helps protect against security problems; + // your code file can't be executed directly from the web. exit(1); } /** - * Give a warm greeting to our friendly user + * Show a list of private messages to this group * - * This sample action shows some basic ways of doing output in an action - * class. - * - * Action classes have several output methods that they override from - * the parent class. - * - * @category Sample - * @package StatusNet - * @author Evan Prodromou - * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 - * @link http://status.net/ + * @category PrivateGroup + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ */ -class HelloAction extends Action + +class GroupinboxAction extends GroupDesignAction { - var $user = null; - var $gc = null; + var $gm; /** - * Take arguments for running + * For initializing members of the class. * - * This method is called first, and it lets the action class get - * all its arguments and validate them. It's also the time - * to fetch any relevant data from the database. + * @param array $argarray misc. arguments * - * Action classes should run parent::prepare($args) as the first - * line of this method to make sure the default argument-processing - * happens. - * - * @param array $args $_REQUEST args - * - * @return boolean success flag + * @return boolean true */ - function prepare($args) + function prepare($argarray) { - parent::prepare($args); + parent::prepare($argarray); - $this->user = common_current_user(); + $cur = common_current_user(); - if (!empty($this->user)) { - $this->gc = User_greeting_count::inc($this->user->id); + if (empty($cur)) { + throw new ClientException(_('Only for logged-in users'), 403); } + $nicknameArg = $this->trimmed('nickname'); + + $nickname = common_canonical_nickname($nicknameArg); + + if ($nickname != $nicknameArg) { + $url = common_local_url('groupinbox', array('nickname' => $nickname)); + common_redirect($url); + return false; + } + + $localGroup = Local_group::staticGet('nickname', $nickname); + + if (empty($localGroup)) { + throw new ClientException(_('No such group'), 404); + } + + $this->group = User_group::staticGet('id', $localGroup->group_id); + + if (empty($this->group)) { + throw new ClientException(_('No such group'), 404); + } + + if (!$cur->isMember($this->group)) { + throw new ClientException(_('Only for members'), 403); + } + + $this->page = $this->trimmed('page'); + + if (!$this->page) { + $this->page = 1; + } + + $this->gm = Group_message::forGroup($this->group, + ($this->page - 1) * MESSAGES_PER_PAGE, + MESSAGES_PER_PAGE + 1); return true; } - /** - * Handle request - * - * This is the main method for handling a request. Note that - * most preparation should be done in the prepare() method; - * by the time handle() is called the action should be - * more or less ready to go. - * - * @param array $args $_REQUEST args; handled in prepare() - * - * @return void - */ - function handle($args) - { - parent::handle($args); - - $this->showPage(); - } - - /** - * Title of this page - * - * Override this method to show a custom title. - * - * @return string Title of the page - */ - function title() - { - if (empty($this->user)) { - return _m('Hello'); - } else { - return sprintf(_m('Hello, %s!'), $this->user->nickname); - } - } - - /** - * Show content in the content area - * - * The default StatusNet page has a lot of decorations: menus, - * logos, tabs, all that jazz. This method is used to show - * content in the content area of the page; it's the main - * thing you want to overload. - * - * This method also demonstrates use of a plural localized string. - * - * @return void - */ function showContent() { - if (empty($this->user)) { - $this->element('p', array('class' => 'greeting'), - _m('Hello, stranger!')); - } else { - $this->element('p', array('class' => 'greeting'), - sprintf(_m('Hello, %s'), $this->user->nickname)); - $this->element('p', array('class' => 'greeting_count'), - sprintf(_m('I have greeted you %d time.', - 'I have greeted you %d times.', - $this->gc->greeting_count), - $this->gc->greeting_count)); - } + $gml = new GroupMessageList($this, $this->gm); + $gml->show(); + } + + /** + * Handler method + * + * @param array $argarray is ignored since it's now passed in in prepare() + * + * @return void + */ + function handle($argarray=null) + { + $this->showPage(); } /** * Return true if read only. * - * Some actions only read from the database; others read and write. - * The simple database load-balancer built into StatusNet will - * direct read-only actions to database mirrors (if they are configured), - * and read-write actions to the master database. + * MAY override * - * This defaults to false to avoid data integrity issues, but you - * should make sure to overload it for performance gains. - * - * @param array $args other arguments, if RO/RW status depends on them. + * @param array $args other arguments * * @return boolean is read only action? */ function isReadOnly($args) { - return false; + return true; + } + + /** + * Title of the page + * + * @return string page title, with page number + */ + function title() + { + $base = $this->group->getFancyName(); + + if ($this->page == 1) { + return sprintf(_('%s group inbox'), $base); + } else { + // TRANS: Page title for any but first group page. + // TRANS: %1$s is a group name, $2$s is a page number. + return sprintf(_('%1$s group inbox, page %2$d'), + $base, + $this->page); + } } } diff --git a/plugins/PrivateGroup/groupmessagelist.php b/plugins/PrivateGroup/groupmessagelist.php new file mode 100644 index 0000000000..09f453d520 --- /dev/null +++ b/plugins/PrivateGroup/groupmessagelist.php @@ -0,0 +1,77 @@ +. + * + * @category PrivateGroup + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET')) { + // This check helps protect against security problems; + // your code file can't be executed directly from the web. + exit(1); +} + +/** + * Widget for showing list of group messages + * + * @category PrivateGroup + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ +class GroupMessageList extends Widget +{ + var $gm; + + /** + * Constructor + * + * @param HTMLOutputter $out output context + * @param Group_message $gm Group message stream + */ + function __construct($out, $gm) + { + parent::__construct($out); + $this->gm = $gm; + } + + /** + * Show the list + * + * @return void + */ + function show() + { + $this->out->elementStart('ul', 'notices messages group-messages'); + while ($this->gm->fetch()) { + $gmli = new GroupMessageListItem($this->out, $this->gm); + $gmli->show(); + } + $this->out->elementEnd('ul'); + } +} diff --git a/plugins/PrivateGroup/groupmessagelistitem.php b/plugins/PrivateGroup/groupmessagelistitem.php new file mode 100644 index 0000000000..e7b7c6a8f8 --- /dev/null +++ b/plugins/PrivateGroup/groupmessagelistitem.php @@ -0,0 +1,113 @@ +. + * + * @category PrivateGroup + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET')) { + // This check helps protect against security problems; + // your code file can't be executed directly from the web. + exit(1); +} + +/** + * Widget for showing a single group message + * + * @category PrivateGroup + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ +class GroupMessageListItem extends Widget +{ + var $gm; + + /** + * Constructor + * + * @param HTMLOutputter $out output context + * @param Group_message $gm Group message + */ + function __construct($out, $gm) + { + parent::__construct($out); + $this->gm = $gm; + } + + /** + * Show the item + * + * @return void + */ + function show() + { + $group = $this->gm->getGroup(); + $sender = $this->gm->getSender(); + + $this->out->elementStart('li', array('class' => 'hentry notice message group-message', + 'id' => 'message-' . $this->gm->id)); + + $this->out->elementStart('div', 'entry-title'); + $this->out->elementStart('span', 'vcard author'); + $this->out->elementStart('a', + array('href' => $sender->profileurl, + 'class' => 'url')); + $avatar = $sender->getAvatar(AVATAR_STREAM_SIZE); + $this->out->element('img', array('src' => ($avatar) ? + $avatar->displayUrl() : + Avatar::defaultImage(AVATAR_STREAM_SIZE), + 'width' => AVATAR_STREAM_SIZE, + 'height' => AVATAR_STREAM_SIZE, + 'class' => 'photo avatar', + 'alt' => $sender->getBestName())); + $this->out->element('span', + array('class' => 'nickname fn'), + $sender->nickname); + $this->out->elementEnd('a'); + $this->out->elementEnd('span'); + + $this->out->elementStart('p', array('class' => 'entry-content message-content')); + $this->out->raw($this->gm->rendered); + $this->out->elementEnd('p'); + $this->out->elementEnd('div'); + + $this->out->elementStart('div', 'entry-content'); + $this->out->elementStart('a', array('rel' => 'bookmark', + 'class' => 'timestamp', + 'href' => $this->gm->url)); + $dt = common_date_iso8601($this->gm->created); + $this->out->element('abbr', array('class' => 'published', + 'title' => $dt), + common_date_string($this->gm->created)); + $this->out->elementEnd('a'); + $this->out->elementEnd('div'); + + $this->out->elementEnd('li'); + } +} diff --git a/plugins/PrivateGroup/showgroupmessage.php b/plugins/PrivateGroup/showgroupmessage.php new file mode 100644 index 0000000000..cc0126e03d --- /dev/null +++ b/plugins/PrivateGroup/showgroupmessage.php @@ -0,0 +1,188 @@ +. + * + * @category PrivateGroup + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET')) { + // This check helps protect against security problems; + // your code file can't be executed directly from the web. + exit(1); +} + +/** + * Show a single private group message + * + * @category PrivateGroup + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +class ShowgroupmessageAction extends Action +{ + var $gm; + var $group; + var $sender; + var $user; + + /** + * For initializing members of the class. + * + * @param array $argarray misc. arguments + * + * @return boolean true + */ + + function prepare($argarray) + { + parent::prepare($argarray); + + $this->user = common_current_user(); + + if (empty($this->user)) { + throw new ClientException(_('Only logged-in users can view private messages.'), + 403); + } + + $id = $this->trimmed('id'); + + $this->gm = Group_message::staticGet('id', $id); + + if (empty($this->gm)) { + throw new ClientException(_('No such message'), 404); + } + + $this->group = User_group::staticGet('id', $this->gm->to_group); + + if (empty($this->group)) { + throw new ServerException(_('Group not found.')); + } + + if (!$this->user->isMember($this->group)) { + throw new ClientException(_('Cannot read message.'), 403); + } + + $this->sender = Profile::staticGet('id', $this->gm->from_profile); + + if (empty($this->sender)) { + throw new ServerException(_('No sender found.')); + } + + return true; + } + + /** + * Handler method + * + * @param array $argarray is ignored since it's now passed in in prepare() + * + * @return void + */ + + function handle($argarray=null) + { + $this->showPage(); + } + + /** + * Title of the page + */ + + function title() + { + return sprintf(_('Message from %1$s to group %2$s on %3$s'), + $this->sender->nickname, + $this->group->nickname, + common_exact_date($this->gm->created)); + } + + /** + * Show the content area. + */ + + function showContent() + { + $this->elementStart('ul', 'notices messages'); + $gmli = new GroupMessageListItem($this, $this->gm); + $gmli->show(); + $this->elementEnd('ul'); + } + + /** + * Return true if read only. + * + * MAY override + * + * @param array $args other arguments + * + * @return boolean is read only action? + */ + + function isReadOnly($args) + { + return true; + } + + /** + * Return last modified, if applicable. + * + * MAY override + * + * @return string last modified http header + */ + function lastModified() + { + return max(strtotime($this->group->modified), + strtotime($this->sender->modified), + strtotime($this->gm->modified)); + } + + /** + * Return etag, if applicable. + * + * MAY override + * + * @return string etag http header + */ + function etag() + { + $avatar = $this->sender->getAvatar(AVATAR_STREAM_SIZE); + + $avtime = ($avatar) ? strtotime($avatar->modified) : 0; + + return 'W/"' . implode(':', array($this->arg('action'), + common_user_cache_hash(), + common_language(), + $this->gm->id, + strtotime($this->sender->modified), + strtotime($this->group->modified), + $avtime)) . '"'; + } +} From 4a435e6670a22935e2e964cafffe26e2c7d7eee4 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 10:18:54 -0500 Subject: [PATCH 56/89] Show group local nav on group inbox --- plugins/PrivateGroup/groupinbox.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/PrivateGroup/groupinbox.php b/plugins/PrivateGroup/groupinbox.php index 8b16e0632a..419053151c 100644 --- a/plugins/PrivateGroup/groupinbox.php +++ b/plugins/PrivateGroup/groupinbox.php @@ -104,6 +104,12 @@ class GroupinboxAction extends GroupDesignAction return true; } + function showLocalNav() + { + $nav = new GroupNav($this, $this->group); + $nav->show(); + } + function showContent() { $gml = new GroupMessageList($this, $this->gm); From 8b20399932ea3466a6019295be761249da70c52c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 10:23:56 -0500 Subject: [PATCH 57/89] Add a hook for group action list --- EVENTS.txt | 8 ++++++++ actions/showgroup.php | 35 +++++++++++++++++++---------------- 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/EVENTS.txt b/EVENTS.txt index 98927127b7..d6d8004674 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -1082,3 +1082,11 @@ EndInterpretCommand: Before running a command - $user: User who issued the command - $result: Resulting command +StartGroupActionsList: Start the list of actions on a group profile page (after
    , before first
  • ) +- $action: action being executed (for output and params) +- $group: group for the page + +EndGroupActionsList: End the list of actions on a group profile page (before
, after last ) +- $action: action being executed (for output and params) +- $group: group for the page + diff --git a/actions/showgroup.php b/actions/showgroup.php index f38cd420ac..58d7ec7c6f 100644 --- a/actions/showgroup.php +++ b/actions/showgroup.php @@ -303,25 +303,28 @@ class ShowgroupAction extends GroupDesignAction // TRANS: Group actions header (h2). Text hidden by default. $this->element('h2', null, _('Group actions')); $this->elementStart('ul'); - $this->elementStart('li', 'entity_subscribe'); - if (Event::handle('StartGroupSubscribe', array($this, $this->group))) { - if ($cur) { - if ($cur->isMember($this->group)) { - $lf = new LeaveForm($this, $this->group); - $lf->show(); - } else if (!Group_block::isBlocked($this->group, $cur->getProfile())) { - $jf = new JoinForm($this, $this->group); - $jf->show(); + if (Event::handle('StartGroupActionsList', array($this, $this->group))) { + $this->elementStart('li', 'entity_subscribe'); + if (Event::handle('StartGroupSubscribe', array($this, $this->group))) { + if ($cur) { + if ($cur->isMember($this->group)) { + $lf = new LeaveForm($this, $this->group); + $lf->show(); + } else if (!Group_block::isBlocked($this->group, $cur->getProfile())) { + $jf = new JoinForm($this, $this->group); + $jf->show(); + } } + Event::handle('EndGroupSubscribe', array($this, $this->group)); } - Event::handle('EndGroupSubscribe', array($this, $this->group)); - } - $this->elementEnd('li'); - if ($cur && $cur->hasRight(Right::DELETEGROUP)) { - $this->elementStart('li', 'entity_delete'); - $df = new DeleteGroupForm($this, $this->group); - $df->show(); $this->elementEnd('li'); + if ($cur && $cur->hasRight(Right::DELETEGROUP)) { + $this->elementStart('li', 'entity_delete'); + $df = new DeleteGroupForm($this, $this->group); + $df->show(); + $this->elementEnd('li'); + } + Event::handle('EndGroupActionsList', array($this, $this->group)); } $this->elementEnd('ul'); $this->elementEnd('div'); From 5db1479a9526fbb264d1d51647e925355ed6f062 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 11:24:00 -0500 Subject: [PATCH 58/89] Form for posting a group message on group inbox --- plugins/PrivateGroup/Group_message.php | 43 +---- .../PrivateGroup/Group_privacy_settings.php | 47 +++++ plugins/PrivateGroup/PrivateGroupPlugin.php | 6 + plugins/PrivateGroup/groupinbox.php | 6 + plugins/PrivateGroup/groupmessageform.php | 166 ++++++++++++++++++ plugins/PrivateGroup/newgroupmessage.php | 155 ++++++++++++++++ 6 files changed, 382 insertions(+), 41 deletions(-) create mode 100644 plugins/PrivateGroup/groupmessageform.php create mode 100644 plugins/PrivateGroup/newgroupmessage.php diff --git a/plugins/PrivateGroup/Group_message.php b/plugins/PrivateGroup/Group_message.php index 21147b4629..07d4c57c08 100644 --- a/plugins/PrivateGroup/Group_message.php +++ b/plugins/PrivateGroup/Group_message.php @@ -127,48 +127,8 @@ class Group_message extends Memcached_DataObject $user->nickname)); } - $gps = Group_privacy_settings::staticGet('group_id', $group->id); + Group_privacy_settings::ensurePost($user, $group); - if (empty($gps)) { - // make a fake one with defaults - $gps = new Group_privacy_settings(); - $gps->allow_privacy = Group_privacy_settings::SOMETIMES; - $gps->allow_sender = Group_privacy_settings::MEMBER; - } - - if ($gps->allow_privacy == Group_privacy_settings::NEVER) { - throw new Exception(sprintf(_('Group %s does not allow private messages.'), - $group->nickname)); - } - - switch ($gps->allow_sender) { - case Group_privacy_settings::EVERYONE: - $profile = $user->getProfile(); - if (Group_block::isBlocked($group, $profile)) { - throw new Exception(sprintf(_('User %s is blocked from group %s.'), - $user->nickname, - $group->nickname)); - } - break; - case Group_privacy_settings::MEMBER: - if (!$user->isMember($group)) { - throw new Exception(sprintf(_('User %s is not a member of group %s.'), - $user->nickname, - $group->nickname)); - } - break; - case Group_privacy_settings::ADMIN: - if (!$user->isAdmin($group)) { - throw new Exception(sprintf(_('User %s is not an administrator of group %s.'), - $user->nickname, - $group->nickname)); - } - break; - default: - throw new Exception(sprintf(_('Unknown privacy settings for group %s.'), - $group->nickname)); - } - $text = $user->shortenLinks($text); // We use the same limits as for 'regular' private messages. @@ -244,4 +204,5 @@ class Group_message extends Memcached_DataObject return $gm; } + } diff --git a/plugins/PrivateGroup/Group_privacy_settings.php b/plugins/PrivateGroup/Group_privacy_settings.php index 7861571222..898ac266ce 100644 --- a/plugins/PrivateGroup/Group_privacy_settings.php +++ b/plugins/PrivateGroup/Group_privacy_settings.php @@ -144,4 +144,51 @@ class Group_privacy_settings extends Memcached_DataObject { return array(false, false, false); } + + function ensurePost($user, $group) + { + $gps = Group_privacy_settings::staticGet('group_id', $group->id); + + if (empty($gps)) { + // make a fake one with defaults + $gps = new Group_privacy_settings(); + $gps->allow_privacy = Group_privacy_settings::SOMETIMES; + $gps->allow_sender = Group_privacy_settings::MEMBER; + } + + if ($gps->allow_privacy == Group_privacy_settings::NEVER) { + throw new Exception(sprintf(_('Group %s does not allow private messages.'), + $group->nickname)); + } + + switch ($gps->allow_sender) { + case Group_privacy_settings::EVERYONE: + $profile = $user->getProfile(); + if (Group_block::isBlocked($group, $profile)) { + throw new Exception(sprintf(_('User %s is blocked from group %s.'), + $user->nickname, + $group->nickname)); + } + break; + case Group_privacy_settings::MEMBER: + if (!$user->isMember($group)) { + throw new Exception(sprintf(_('User %s is not a member of group %s.'), + $user->nickname, + $group->nickname)); + } + break; + case Group_privacy_settings::ADMIN: + if (!$user->isAdmin($group)) { + throw new Exception(sprintf(_('User %s is not an administrator of group %s.'), + $user->nickname, + $group->nickname)); + } + break; + default: + throw new Exception(sprintf(_('Unknown privacy settings for group %s.'), + $group->nickname)); + } + + return true; + } } diff --git a/plugins/PrivateGroup/PrivateGroupPlugin.php b/plugins/PrivateGroup/PrivateGroupPlugin.php index 39e788074c..001f085c0d 100644 --- a/plugins/PrivateGroup/PrivateGroupPlugin.php +++ b/plugins/PrivateGroup/PrivateGroupPlugin.php @@ -145,6 +145,7 @@ class PrivateGroupPlugin extends Plugin { case 'GroupinboxAction': case 'ShowgroupmessageAction': + case 'NewgroupmessageAction': include_once $dir . '/' . strtolower(mb_substr($cls, 0, -6)) . '.php'; return false; case 'Group_privacy_settings': @@ -155,6 +156,7 @@ class PrivateGroupPlugin extends Plugin case 'GroupMessageCommand': case 'GroupMessageList': case 'GroupMessageListItem': + case 'GroupMessageForm': include_once $dir . '/'.strtolower($cls).'.php'; return false; default: @@ -180,6 +182,10 @@ class PrivateGroupPlugin extends Plugin array('action' => 'showgroupmessage'), array('id' => '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}')); + $m->connect('group/:nickname/message/new', + array('action' => 'newgroupmessage'), + array('nickname' => Nickname::DISPLAY_FMT)); + return true; } diff --git a/plugins/PrivateGroup/groupinbox.php b/plugins/PrivateGroup/groupinbox.php index 419053151c..55bf4b0ee2 100644 --- a/plugins/PrivateGroup/groupinbox.php +++ b/plugins/PrivateGroup/groupinbox.php @@ -110,6 +110,12 @@ class GroupinboxAction extends GroupDesignAction $nav->show(); } + function showNoticeForm() + { + $form = new GroupMessageForm($this, $this->group); + $form->show(); + } + function showContent() { $gml = new GroupMessageList($this, $this->gm); diff --git a/plugins/PrivateGroup/groupmessageform.php b/plugins/PrivateGroup/groupmessageform.php new file mode 100644 index 0000000000..4564a60761 --- /dev/null +++ b/plugins/PrivateGroup/groupmessageform.php @@ -0,0 +1,166 @@ +. + * + * @category PrivateGroup + * @package StatusNet + * @author Evan Prodromou + * @copyright 2011 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET')) { + // This check helps protect against security problems; + // your code file can't be executed directly from the web. + exit(1); +} + +/** + * Form for posting a group message + * + * @category PrivateGroup + * @package StatusNet + * @author Evan Prodromou + * @copyright 2011 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +class GroupMessageForm extends Form +{ + var $group; + var $content; + + /** + * Constructor + * + * @param HTMLOutputter $out Output context + * @param User_group $group Group to post to + * + * @todo add a drop-down list to post to any group + */ + + function __construct($out, $group, $content=null) + { + parent::__construct($out); + + $this->group = $group; + $this->content = $content; + } + + /** + * Action for the form + */ + function action() + { + return common_local_url('newgroupmessage', + array('nickname' => $this->group->nickname)); + } + + /** + * Legend for the form + * + * @param + * + * @return + */ + function formLegend() + { + $this->out->element('legend', + null, + sprintf(_('Message to %s'), $this->group->nickname)); + } + + /** + * id for the form + * + * @param + * + * @return + */ + + function id() + { + return 'form_notice-group-message'; + } + + /** + * class for the form + * + * @param + * + * @return + */ + + function formClass() + { + return 'form_notice'; + } + + /** + * Entry data + * + * @param + * + * @return + */ + + function formData() + { + $this->out->element('label', array('for' => 'notice_data-text', + 'id' => 'notice_data-text-label'), + sprintf(_('Direct message to %s'), $this->group->nickname)); + + $this->out->element('textarea', array('id' => 'notice_data-text', + 'cols' => 35, + 'rows' => 4, + 'name' => 'content'), + ($this->content) ? $this->content : ''); + + $contentLimit = Message::maxContent(); + + if ($contentLimit > 0) { + $this->out->elementStart('dl', 'form_note'); + $this->out->element('dt', null, _('Available characters')); + $this->out->element('dd', array('id' => 'notice_text-count'), + $contentLimit); + $this->out->elementEnd('dl'); + } + } + + /** + * Legend for the form + * + * @param + * + * @return + */ + + function formActions() + { + $this->out->element('input', array('id' => 'notice_action-submit', + 'class' => 'submit', + 'name' => 'message_send', + 'type' => 'submit', + 'value' => _m('Send button for sending notice', 'Send'))); + } +} diff --git a/plugins/PrivateGroup/newgroupmessage.php b/plugins/PrivateGroup/newgroupmessage.php new file mode 100644 index 0000000000..c2755596b5 --- /dev/null +++ b/plugins/PrivateGroup/newgroupmessage.php @@ -0,0 +1,155 @@ +. + * + * @category Cache + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET')) { + // This check helps protect against security problems; + // your code file can't be executed directly from the web. + exit(1); +} + +/** + * Action for adding a new group message + * + * @category Action + * @package StatusNet + * @author Evan Prodromou + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +class NewgroupmessageAction extends Action +{ + var $group; + var $user; + var $text; + + /** + * For initializing members of the class. + * + * @param array $argarray misc. arguments + * + * @return boolean true + */ + + function prepare($argarray) + { + parent::prepare($argarray); + + $this->user = common_current_user(); + + if (empty($this->user)) { + throw new ClientException(_('Must be logged in.'), 403); + } + + if (!$this->user->hasRight(Right::NEWMESSAGE)) { + throw new Exception(sprintf(_('User %s not allowed to send private messages.'), + $this->user->nickname)); + } + + $nicknameArg = $this->trimmed('nickname'); + + $nickname = common_canonical_nickname($nicknameArg); + + if ($nickname != $nicknameArg) { + $url = common_local_url('newgroupmessage', array('nickname' => $nickname)); + common_redirect($url, 301); + return false; + } + + $localGroup = Local_group::staticGet('nickname', $nickname); + + if (empty($localGroup)) { + throw new ClientException(_('No such group'), 404); + } + + $this->group = User_group::staticGet('id', $localGroup->group_id); + + if (empty($this->group)) { + throw new ClientException(_('No such group'), 404); + } + + // This throws an exception on error + + Group_privacy_settings::ensurePost($this->user, $this->group); + + // If we're posted to, check session token and get text + + if ($this->isPost()) { + $this->checkSessionToken(); + $this->text = $this->trimmed('content'); + } + + return true; + } + + /** + * Handler method + * + * @param array $argarray is ignored since it's now passed in in prepare() + * + * @return void + */ + + function handle($argarray=null) + { + if ($this->isPost()) { + $this->sendNewMessage(); + } else { + $this->showPage(); + } + } + + function sendNewMessage() + { + $gm = Group_message::send($this->user, $this->group, $this->text); + + if ($this->boolean('ajax')) { + $this->startHTML('text/xml;charset=utf-8'); + $this->elementStart('head'); + $this->element('title', null, _('Message sent')); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->element('p', + array('id' => 'command_result'), + sprintf(_('Direct message to %s sent.'), + $this->group->nickname)); + $this->elementEnd('body'); + $this->elementEnd('html'); + } else { + common_redirect($gm->url, 303); + } + } + + function title() + { + return sprintf(_('New message to group %s'), $this->group->nickname); + } +} From 951df6b02f1dcb51ae173d3ee5b822edc1e1661c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 11:51:38 -0500 Subject: [PATCH 59/89] button on the group page to post a new message --- plugins/PrivateGroup/PrivateGroupPlugin.php | 33 +++++++++++++++++++++ plugins/PrivateGroup/newgroupmessage.php | 6 ++++ 2 files changed, 39 insertions(+) diff --git a/plugins/PrivateGroup/PrivateGroupPlugin.php b/plugins/PrivateGroup/PrivateGroupPlugin.php index 001f085c0d..6ead6965ec 100644 --- a/plugins/PrivateGroup/PrivateGroupPlugin.php +++ b/plugins/PrivateGroup/PrivateGroupPlugin.php @@ -345,6 +345,39 @@ class PrivateGroupPlugin extends Plugin return true; } + /** + * To add a "Message" button to the group profile page + * + * @param Action $action The showgroup action being shown + * @param User_group $group The current group + * + * @return boolean hook value + */ + function onEndGroupActionsList($action, $group) + { + $cur = common_current_user(); + + if (empty($cur)) { + return true; + } + + try { + Group_privacy_settings::ensurePost($cur, $group); + } catch (Exception $e) { + return true; + } + + $action->elementStart('li', 'entity_send-a-message'); + $action->element('a', array('href' => common_local_url('newgroupmessage', array('nickname' => $group->nickname)), + 'title' => _('Send a direct message to this group')), + _('Message')); + // $form = new GroupMessageForm($action, $group); + // $form->hidden = true; + // $form->show(); + $action->elementEnd('li'); + return true; + } + function onPluginVersion(&$versions) { $versions[] = array('name' => 'PrivateGroup', diff --git a/plugins/PrivateGroup/newgroupmessage.php b/plugins/PrivateGroup/newgroupmessage.php index c2755596b5..a2c5dfdbdb 100644 --- a/plugins/PrivateGroup/newgroupmessage.php +++ b/plugins/PrivateGroup/newgroupmessage.php @@ -127,6 +127,12 @@ class NewgroupmessageAction extends Action } } + function showNoticeForm() + { + $form = new GroupMessageForm($this, $this->group); + $form->show(); + } + function sendNewMessage() { $gm = Group_message::send($this->user, $this->group, $this->text); From ee0bbdf89cc6691b16a851a3beab19b7befeb480 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 11:55:16 -0500 Subject: [PATCH 60/89] Add group info to new group message email --- plugins/PrivateGroup/Group_message_profile.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/PrivateGroup/Group_message_profile.php b/plugins/PrivateGroup/Group_message_profile.php index fc1ff1bceb..332337423a 100644 --- a/plugins/PrivateGroup/Group_message_profile.php +++ b/plugins/PrivateGroup/Group_message_profile.php @@ -150,11 +150,13 @@ class Group_message_profile extends Memcached_DataObject $from_profile = Profile::staticGet('id', $gm->from_profile); + $group = $gm->getGroup(); + common_switch_locale($to->language); // TRANS: Subject for direct-message notification email. // TRANS: %s is the sending user's nickname. - $subject = sprintf(_('New private message from %s'), $from->nickname); + $subject = sprintf(_('New private message from %s to group %s'), $from->nickname, $group->nickname); $from_profile = $from->getProfile(); @@ -162,17 +164,18 @@ class Group_message_profile extends Memcached_DataObject // TRANS: %1$s is the sending user's long name, %2$s is the sending user's nickname, // TRANS: %3$s is the message content, %4$s a URL to the message, // TRANS: %5$s is the StatusNet sitename. - $body = sprintf(_("%1\$s (%2\$s) sent you a private message:\n\n". + $body = sprintf(_("%1\$s (%2\$s) sent a private message to group %3\$s:\n\n". "------------------------------------------------------\n". - "%3\$s\n". + "%4\$s\n". "------------------------------------------------------\n\n". "You can reply to their message here:\n\n". - "%4\$s\n\n". + "%5\$s\n\n". "Don't reply to this email; it won't get to them.\n\n". "With kind regards,\n". - "%5\$s\n"), + "%6\$s\n"), $from_profile->getBestName(), $from->nickname, + $group->nickname, $this->content, common_local_url('newmessage', array('to' => $from->id)), common_config('site', 'name')); From 20824292c986733d3efb71fb4aaf411e5b008b94 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 11:57:34 -0500 Subject: [PATCH 61/89] Rename PrivateGroup to GroupPrivateMessage to be clearer --- .../GroupPrivateMessagePlugin.php} | 6 +++--- .../{PrivateGroup => GroupPrivateMessage}/Group_message.php | 0 .../Group_message_profile.php | 0 .../Group_privacy_settings.php | 0 .../{PrivateGroup => GroupPrivateMessage}/groupinbox.php | 0 .../groupmessagecommand.php | 0 .../groupmessageform.php | 0 .../groupmessagelist.php | 0 .../groupmessagelistitem.php | 0 .../newgroupmessage.php | 0 .../showgroupmessage.php | 0 11 files changed, 3 insertions(+), 3 deletions(-) rename plugins/{PrivateGroup/PrivateGroupPlugin.php => GroupPrivateMessage/GroupPrivateMessagePlugin.php} (98%) rename plugins/{PrivateGroup => GroupPrivateMessage}/Group_message.php (100%) rename plugins/{PrivateGroup => GroupPrivateMessage}/Group_message_profile.php (100%) rename plugins/{PrivateGroup => GroupPrivateMessage}/Group_privacy_settings.php (100%) rename plugins/{PrivateGroup => GroupPrivateMessage}/groupinbox.php (100%) rename plugins/{PrivateGroup => GroupPrivateMessage}/groupmessagecommand.php (100%) rename plugins/{PrivateGroup => GroupPrivateMessage}/groupmessageform.php (100%) rename plugins/{PrivateGroup => GroupPrivateMessage}/groupmessagelist.php (100%) rename plugins/{PrivateGroup => GroupPrivateMessage}/groupmessagelistitem.php (100%) rename plugins/{PrivateGroup => GroupPrivateMessage}/newgroupmessage.php (100%) rename plugins/{PrivateGroup => GroupPrivateMessage}/showgroupmessage.php (100%) diff --git a/plugins/PrivateGroup/PrivateGroupPlugin.php b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php similarity index 98% rename from plugins/PrivateGroup/PrivateGroupPlugin.php rename to plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php index 6ead6965ec..9707c08107 100644 --- a/plugins/PrivateGroup/PrivateGroupPlugin.php +++ b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php @@ -47,7 +47,7 @@ if (!defined('STATUSNET')) { * @link http://status.net/ */ -class PrivateGroupPlugin extends Plugin +class GroupPrivateMessagePlugin extends Plugin { /** * Database schema setup @@ -380,10 +380,10 @@ class PrivateGroupPlugin extends Plugin function onPluginVersion(&$versions) { - $versions[] = array('name' => 'PrivateGroup', + $versions[] = array('name' => 'GroupPrivateMessage', 'version' => STATUSNET_VERSION, 'author' => 'Evan Prodromou', - 'homepage' => 'http://status.net/wiki/Plugin:PrivateGroup', + 'homepage' => 'http://status.net/wiki/Plugin:GroupPrivateMessage', 'rawdescription' => _m('Allow posting DMs to a group.')); return true; diff --git a/plugins/PrivateGroup/Group_message.php b/plugins/GroupPrivateMessage/Group_message.php similarity index 100% rename from plugins/PrivateGroup/Group_message.php rename to plugins/GroupPrivateMessage/Group_message.php diff --git a/plugins/PrivateGroup/Group_message_profile.php b/plugins/GroupPrivateMessage/Group_message_profile.php similarity index 100% rename from plugins/PrivateGroup/Group_message_profile.php rename to plugins/GroupPrivateMessage/Group_message_profile.php diff --git a/plugins/PrivateGroup/Group_privacy_settings.php b/plugins/GroupPrivateMessage/Group_privacy_settings.php similarity index 100% rename from plugins/PrivateGroup/Group_privacy_settings.php rename to plugins/GroupPrivateMessage/Group_privacy_settings.php diff --git a/plugins/PrivateGroup/groupinbox.php b/plugins/GroupPrivateMessage/groupinbox.php similarity index 100% rename from plugins/PrivateGroup/groupinbox.php rename to plugins/GroupPrivateMessage/groupinbox.php diff --git a/plugins/PrivateGroup/groupmessagecommand.php b/plugins/GroupPrivateMessage/groupmessagecommand.php similarity index 100% rename from plugins/PrivateGroup/groupmessagecommand.php rename to plugins/GroupPrivateMessage/groupmessagecommand.php diff --git a/plugins/PrivateGroup/groupmessageform.php b/plugins/GroupPrivateMessage/groupmessageform.php similarity index 100% rename from plugins/PrivateGroup/groupmessageform.php rename to plugins/GroupPrivateMessage/groupmessageform.php diff --git a/plugins/PrivateGroup/groupmessagelist.php b/plugins/GroupPrivateMessage/groupmessagelist.php similarity index 100% rename from plugins/PrivateGroup/groupmessagelist.php rename to plugins/GroupPrivateMessage/groupmessagelist.php diff --git a/plugins/PrivateGroup/groupmessagelistitem.php b/plugins/GroupPrivateMessage/groupmessagelistitem.php similarity index 100% rename from plugins/PrivateGroup/groupmessagelistitem.php rename to plugins/GroupPrivateMessage/groupmessagelistitem.php diff --git a/plugins/PrivateGroup/newgroupmessage.php b/plugins/GroupPrivateMessage/newgroupmessage.php similarity index 100% rename from plugins/PrivateGroup/newgroupmessage.php rename to plugins/GroupPrivateMessage/newgroupmessage.php diff --git a/plugins/PrivateGroup/showgroupmessage.php b/plugins/GroupPrivateMessage/showgroupmessage.php similarity index 100% rename from plugins/PrivateGroup/showgroupmessage.php rename to plugins/GroupPrivateMessage/showgroupmessage.php From e759b15a92f48c2be32388c948571eaa3006f383 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 12:08:18 -0500 Subject: [PATCH 62/89] pagination for group inbox --- plugins/GroupPrivateMessage/groupinbox.php | 8 +++++++- plugins/GroupPrivateMessage/groupmessagelist.php | 15 ++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/plugins/GroupPrivateMessage/groupinbox.php b/plugins/GroupPrivateMessage/groupinbox.php index 55bf4b0ee2..409f59aa1c 100644 --- a/plugins/GroupPrivateMessage/groupinbox.php +++ b/plugins/GroupPrivateMessage/groupinbox.php @@ -119,7 +119,13 @@ class GroupinboxAction extends GroupDesignAction function showContent() { $gml = new GroupMessageList($this, $this->gm); - $gml->show(); + $cnt = $gml->show(); + + $this->pagination($this->page > 1, + $cnt > MESSAGES_PER_PAGE, + $this->page, + 'groupinbox', + array('nickname' => $this->group->nickname)); } /** diff --git a/plugins/GroupPrivateMessage/groupmessagelist.php b/plugins/GroupPrivateMessage/groupmessagelist.php index 09f453d520..fb49f5c239 100644 --- a/plugins/GroupPrivateMessage/groupmessagelist.php +++ b/plugins/GroupPrivateMessage/groupmessagelist.php @@ -68,10 +68,23 @@ class GroupMessageList extends Widget function show() { $this->out->elementStart('ul', 'notices messages group-messages'); - while ($this->gm->fetch()) { + + $cnt = 0; + + while ($this->gm->fetch() && $cnt <= MESSAGES_PER_PAGE) { + + $cnt++; + + if ($cnt > MESSAGES_PER_PAGE) { + break; + } + $gmli = new GroupMessageListItem($this->out, $this->gm); $gmli->show(); } + $this->out->elementEnd('ul'); + + return $cnt; } } From 80a4b9c76fbc2ec8d6818d98f5cfe43b7581060f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 12:28:58 -0500 Subject: [PATCH 63/89] Change category and copyright year --- .../GroupPrivateMessage/GroupPrivateMessagePlugin.php | 6 +++--- plugins/GroupPrivateMessage/Group_message.php | 2 +- plugins/GroupPrivateMessage/Group_message_profile.php | 4 ++-- plugins/GroupPrivateMessage/groupinbox.php | 10 +++++----- plugins/GroupPrivateMessage/groupmessagecommand.php | 6 +++--- plugins/GroupPrivateMessage/groupmessageform.php | 4 ++-- plugins/GroupPrivateMessage/groupmessagelist.php | 10 +++++----- plugins/GroupPrivateMessage/groupmessagelistitem.php | 10 +++++----- plugins/GroupPrivateMessage/newgroupmessage.php | 6 +++--- plugins/GroupPrivateMessage/showgroupmessage.php | 10 +++++----- 10 files changed, 34 insertions(+), 34 deletions(-) diff --git a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php index 9707c08107..f97bba9446 100644 --- a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php +++ b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php @@ -1,7 +1,7 @@ - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ @@ -42,7 +42,7 @@ if (!defined('STATUSNET')) { * @category Privacy * @package StatusNet * @author Evan Prodromou - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ diff --git a/plugins/GroupPrivateMessage/Group_message.php b/plugins/GroupPrivateMessage/Group_message.php index 07d4c57c08..f8c0c707c3 100644 --- a/plugins/GroupPrivateMessage/Group_message.php +++ b/plugins/GroupPrivateMessage/Group_message.php @@ -36,7 +36,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; /** * Data class for group direct messages * - * @category PrivateGroup + * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 diff --git a/plugins/GroupPrivateMessage/Group_message_profile.php b/plugins/GroupPrivateMessage/Group_message_profile.php index 332337423a..bd778b815a 100644 --- a/plugins/GroupPrivateMessage/Group_message_profile.php +++ b/plugins/GroupPrivateMessage/Group_message_profile.php @@ -11,7 +11,7 @@ * @link http://status.net/ * * StatusNet - the distributed open-source microblogging tool - * Copyright (C) 2010, StatusNet, Inc. + * Copyright (C) 2011, StatusNet, 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 @@ -36,7 +36,7 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php'; /** * Data class for group direct messages for users * - * @category PrivateGroup + * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3 diff --git a/plugins/GroupPrivateMessage/groupinbox.php b/plugins/GroupPrivateMessage/groupinbox.php index 409f59aa1c..c7dfb966d5 100644 --- a/plugins/GroupPrivateMessage/groupinbox.php +++ b/plugins/GroupPrivateMessage/groupinbox.php @@ -1,7 +1,7 @@ . * - * @category PrivateGroup + * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ @@ -37,10 +37,10 @@ if (!defined('STATUSNET')) { /** * Show a list of private messages to this group * - * @category PrivateGroup + * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ diff --git a/plugins/GroupPrivateMessage/groupmessagecommand.php b/plugins/GroupPrivateMessage/groupmessagecommand.php index 19136f1318..3b3cf4cfea 100644 --- a/plugins/GroupPrivateMessage/groupmessagecommand.php +++ b/plugins/GroupPrivateMessage/groupmessagecommand.php @@ -1,7 +1,7 @@ - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ @@ -40,7 +40,7 @@ if (!defined('STATUSNET')) { * @category General * @package StatusNet * @author Evan Prodromou - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ diff --git a/plugins/GroupPrivateMessage/groupmessageform.php b/plugins/GroupPrivateMessage/groupmessageform.php index 4564a60761..7205d3f0b9 100644 --- a/plugins/GroupPrivateMessage/groupmessageform.php +++ b/plugins/GroupPrivateMessage/groupmessageform.php @@ -20,7 +20,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . * - * @category PrivateGroup + * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou * @copyright 2011 StatusNet, Inc. @@ -37,7 +37,7 @@ if (!defined('STATUSNET')) { /** * Form for posting a group message * - * @category PrivateGroup + * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou * @copyright 2011 StatusNet, Inc. diff --git a/plugins/GroupPrivateMessage/groupmessagelist.php b/plugins/GroupPrivateMessage/groupmessagelist.php index fb49f5c239..07f8ed5e4c 100644 --- a/plugins/GroupPrivateMessage/groupmessagelist.php +++ b/plugins/GroupPrivateMessage/groupmessagelist.php @@ -1,7 +1,7 @@ . * - * @category PrivateGroup + * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ @@ -37,10 +37,10 @@ if (!defined('STATUSNET')) { /** * Widget for showing list of group messages * - * @category PrivateGroup + * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ diff --git a/plugins/GroupPrivateMessage/groupmessagelistitem.php b/plugins/GroupPrivateMessage/groupmessagelistitem.php index e7b7c6a8f8..4c0fd2ce64 100644 --- a/plugins/GroupPrivateMessage/groupmessagelistitem.php +++ b/plugins/GroupPrivateMessage/groupmessagelistitem.php @@ -1,7 +1,7 @@ . * - * @category PrivateGroup + * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ @@ -37,10 +37,10 @@ if (!defined('STATUSNET')) { /** * Widget for showing a single group message * - * @category PrivateGroup + * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ diff --git a/plugins/GroupPrivateMessage/newgroupmessage.php b/plugins/GroupPrivateMessage/newgroupmessage.php index a2c5dfdbdb..1ad24c4a0a 100644 --- a/plugins/GroupPrivateMessage/newgroupmessage.php +++ b/plugins/GroupPrivateMessage/newgroupmessage.php @@ -1,7 +1,7 @@ - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ @@ -40,7 +40,7 @@ if (!defined('STATUSNET')) { * @category Action * @package StatusNet * @author Evan Prodromou - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ diff --git a/plugins/GroupPrivateMessage/showgroupmessage.php b/plugins/GroupPrivateMessage/showgroupmessage.php index cc0126e03d..73293255cf 100644 --- a/plugins/GroupPrivateMessage/showgroupmessage.php +++ b/plugins/GroupPrivateMessage/showgroupmessage.php @@ -1,7 +1,7 @@ . * - * @category PrivateGroup + * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ @@ -37,10 +37,10 @@ if (!defined('STATUSNET')) { /** * Show a single private group message * - * @category PrivateGroup + * @category GroupPrivateMessage * @package StatusNet * @author Evan Prodromou - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ From 1d439ef5d887fe31740915c5a51388a167bcd532 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 12:58:42 -0500 Subject: [PATCH 64/89] Force notices to DMs when privacy = always --- .../GroupPrivateMessagePlugin.php | 80 +++++++++++++++++++ .../Group_privacy_settings.php | 9 ++- 2 files changed, 88 insertions(+), 1 deletion(-) diff --git a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php index f97bba9446..7598b3f2b7 100644 --- a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php +++ b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php @@ -377,6 +377,86 @@ class GroupPrivateMessagePlugin extends Plugin $action->elementEnd('li'); return true; } + + /** + * When saving a notice, check its groups. If any of them has + * privacy == always, force a group private message to all mentioned groups. + * If any of the groups disallows private messages, skip it. + * + * @param + * + */ + + function onStartNoticeSave(&$notice) { + + // Look for group tags + // FIXME: won't work for remote groups + + $count = preg_match_all('/(?:^|\s)!([A-Za-z0-9]{1,64})/', + strtolower($notice->content), + $match); + + $groups = array(); + $ignored = array(); + + $forcePrivate = false; + + if ($count > 0) { + + /* Add them to the database */ + + foreach (array_unique($match[1]) as $nickname) { + + $group = User_group::getForNickname($nickname, $profile); + + if (empty($group)) { + continue; + } + + $gps = Group_privacy_settings::forGroup($group); + + switch ($gps->allow_privacy) { + case Group_privacy_settings::ALWAYS: + $forcePrivate = true; + // fall through + case Group_privacy_settings::SOMETIMES: + $groups[] = $group; + break; + case Group_privacy_settings::NEVER: + $ignored[] = $group; + break; + } + } + + if ($forcePrivate) { + + foreach ($ignored as $group) { + common_log(LOG_NOTICE, + "Notice forced to group direct message ". + "but group ".$group->nickname." does not allow them."); + } + + $user = User::staticGet('id', $notice->profile_id); + + if (empty($user)) { + common_log(LOG_WARNING, + "Notice forced to group direct message ". + "but profile ".$notice->profile_id." is not a local user."); + } else { + foreach ($groups as $group) { + Group_message::send($user, $group, $notice->content); + } + } + + // Don't save the notice! + // FIXME: this is probably cheating. + throw new ClientException(sprintf(_('Forced notice to private group message.')), + 200); + } + } + + return true; + } function onPluginVersion(&$versions) { diff --git a/plugins/GroupPrivateMessage/Group_privacy_settings.php b/plugins/GroupPrivateMessage/Group_privacy_settings.php index 898ac266ce..0176d3bd6e 100644 --- a/plugins/GroupPrivateMessage/Group_privacy_settings.php +++ b/plugins/GroupPrivateMessage/Group_privacy_settings.php @@ -145,7 +145,7 @@ class Group_privacy_settings extends Memcached_DataObject return array(false, false, false); } - function ensurePost($user, $group) + function forGroup($group) { $gps = Group_privacy_settings::staticGet('group_id', $group->id); @@ -156,6 +156,13 @@ class Group_privacy_settings extends Memcached_DataObject $gps->allow_sender = Group_privacy_settings::MEMBER; } + return $gps; + } + + function ensurePost($user, $group) + { + $gps = self::forGroup($group); + if ($gps->allow_privacy == Group_privacy_settings::NEVER) { throw new Exception(sprintf(_('Group %s does not allow private messages.'), $group->nickname)); From b41816fdc16df562d894aa5d3b4026dda15f392b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 14:04:58 -0500 Subject: [PATCH 65/89] add hooks for Group profile information --- EVENTS.txt | 7 +++ actions/showgroup.php | 141 ++++++++++++++++++++++-------------------- 2 files changed, 82 insertions(+), 66 deletions(-) diff --git a/EVENTS.txt b/EVENTS.txt index d6d8004674..f675c199a0 100644 --- a/EVENTS.txt +++ b/EVENTS.txt @@ -1090,3 +1090,10 @@ EndGroupActionsList: End the list of actions on a group profile page (before showGroupProfile(); + $this->showGroupActions(); $this->showGroupNotices(); } @@ -216,88 +217,96 @@ class ShowgroupAction extends GroupDesignAction $this->elementStart('div', array('id' => 'i', 'class' => 'entity_profile vcard author')); - // TRANS: Group profile header (h2). Text hidden by default. - $this->element('h2', null, _('Group profile')); + if (Event::handle('StartGroupProfileElements', array($this, $this->group))) { - $this->elementStart('dl', 'entity_depiction'); - // TRANS: Label for group avatar (dt). Text hidden by default. - $this->element('dt', null, _('Avatar')); - $this->elementStart('dd'); + // TRANS: Group profile header (h2). Text hidden by default. + $this->element('h2', null, _('Group profile')); - $logo = ($this->group->homepage_logo) ? - $this->group->homepage_logo : User_group::defaultLogo(AVATAR_PROFILE_SIZE); - - $this->element('img', array('src' => $logo, - 'class' => 'photo avatar', - 'width' => AVATAR_PROFILE_SIZE, - 'height' => AVATAR_PROFILE_SIZE, - 'alt' => $this->group->nickname)); - $this->elementEnd('dd'); - $this->elementEnd('dl'); - - $this->elementStart('dl', 'entity_nickname'); - // TRANS: Label for group nickname (dt). Text hidden by default. - $this->element('dt', null, _('Nickname')); - $this->elementStart('dd'); - $hasFN = ($this->group->fullname) ? 'nickname url uid' : 'fn org nickname url uid'; - $this->element('a', array('href' => $this->group->homeUrl(), - 'rel' => 'me', 'class' => $hasFN), - $this->group->nickname); - $this->elementEnd('dd'); - $this->elementEnd('dl'); - - if ($this->group->fullname) { - $this->elementStart('dl', 'entity_fn'); - // TRANS: Label for full group name (dt). Text hidden by default. - $this->element('dt', null, _('Full name')); + $this->elementStart('dl', 'entity_depiction'); + // TRANS: Label for group avatar (dt). Text hidden by default. + $this->element('dt', null, _('Avatar')); $this->elementStart('dd'); - $this->element('span', 'fn org', $this->group->fullname); + + $logo = ($this->group->homepage_logo) ? + $this->group->homepage_logo : User_group::defaultLogo(AVATAR_PROFILE_SIZE); + + $this->element('img', array('src' => $logo, + 'class' => 'photo avatar', + 'width' => AVATAR_PROFILE_SIZE, + 'height' => AVATAR_PROFILE_SIZE, + 'alt' => $this->group->nickname)); $this->elementEnd('dd'); $this->elementEnd('dl'); - } - if ($this->group->location) { - $this->elementStart('dl', 'entity_location'); - // TRANS: Label for group location (dt). Text hidden by default. - $this->element('dt', null, _('Location')); - $this->element('dd', 'label', $this->group->location); - $this->elementEnd('dl'); - } - - if ($this->group->homepage) { - $this->elementStart('dl', 'entity_url'); - // TRANS: Label for group URL (dt). Text hidden by default. - $this->element('dt', null, _('URL')); + $this->elementStart('dl', 'entity_nickname'); + // TRANS: Label for group nickname (dt). Text hidden by default. + $this->element('dt', null, _('Nickname')); $this->elementStart('dd'); - $this->element('a', array('href' => $this->group->homepage, - 'rel' => 'me', 'class' => 'url'), - $this->group->homepage); + $hasFN = ($this->group->fullname) ? 'nickname url uid' : 'fn org nickname url uid'; + $this->element('a', array('href' => $this->group->homeUrl(), + 'rel' => 'me', 'class' => $hasFN), + $this->group->nickname); $this->elementEnd('dd'); $this->elementEnd('dl'); - } - if ($this->group->description) { - $this->elementStart('dl', 'entity_note'); - // TRANS: Label for group description or group note (dt). Text hidden by default. - $this->element('dt', null, _('Note')); - $this->element('dd', 'note', $this->group->description); - $this->elementEnd('dl'); - } - - if (common_config('group', 'maxaliases') > 0) { - $aliases = $this->group->getAliases(); - - if (!empty($aliases)) { - $this->elementStart('dl', 'entity_aliases'); - // TRANS: Label for group aliases (dt). Text hidden by default. - $this->element('dt', null, _('Aliases')); - $this->element('dd', 'aliases', implode(' ', $aliases)); + if ($this->group->fullname) { + $this->elementStart('dl', 'entity_fn'); + // TRANS: Label for full group name (dt). Text hidden by default. + $this->element('dt', null, _('Full name')); + $this->elementStart('dd'); + $this->element('span', 'fn org', $this->group->fullname); + $this->elementEnd('dd'); $this->elementEnd('dl'); } + + if ($this->group->location) { + $this->elementStart('dl', 'entity_location'); + // TRANS: Label for group location (dt). Text hidden by default. + $this->element('dt', null, _('Location')); + $this->element('dd', 'label', $this->group->location); + $this->elementEnd('dl'); + } + + if ($this->group->homepage) { + $this->elementStart('dl', 'entity_url'); + // TRANS: Label for group URL (dt). Text hidden by default. + $this->element('dt', null, _('URL')); + $this->elementStart('dd'); + $this->element('a', array('href' => $this->group->homepage, + 'rel' => 'me', 'class' => 'url'), + $this->group->homepage); + $this->elementEnd('dd'); + $this->elementEnd('dl'); + } + + if ($this->group->description) { + $this->elementStart('dl', 'entity_note'); + // TRANS: Label for group description or group note (dt). Text hidden by default. + $this->element('dt', null, _('Note')); + $this->element('dd', 'note', $this->group->description); + $this->elementEnd('dl'); + } + + if (common_config('group', 'maxaliases') > 0) { + $aliases = $this->group->getAliases(); + + if (!empty($aliases)) { + $this->elementStart('dl', 'entity_aliases'); + // TRANS: Label for group aliases (dt). Text hidden by default. + $this->element('dt', null, _('Aliases')); + $this->element('dd', 'aliases', implode(' ', $aliases)); + $this->elementEnd('dl'); + } + } + + Event::handle('EndGroupProfileElements', array($this, $this->group)); } $this->elementEnd('div'); + } + function showGroupActions() + { $cur = common_current_user(); $this->elementStart('div', 'entity_actions'); // TRANS: Group actions header (h2). Text hidden by default. From 204b5e8a63e98d143a9f1f37e7c90fbfdbed8a10 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 14:21:54 -0500 Subject: [PATCH 66/89] Show a little indicator for private-only groups --- .../GroupPrivateMessagePlugin.php | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php index 7598b3f2b7..e086fe91dc 100644 --- a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php +++ b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php @@ -457,7 +457,27 @@ class GroupPrivateMessagePlugin extends Plugin return true; } - + + /** + * Show an indicator that the group is (essentially) private on the group page + * + * @param Action $action The action being shown + * @param User_group $group The group being shown + * + * @return boolean hook value + */ + + function onEndGroupProfileElements($action, $group) + { + $gps = Group_privacy_settings::forGroup($group); + + if ($gps->allow_privacy == Group_privacy_settings::ALWAYS) { + $action->element('p', 'privategroupindicator', _('Private')); + } + + return true; + } + function onPluginVersion(&$versions) { $versions[] = array('name' => 'GroupPrivateMessage', From dbd496f9014adee1d003c08366795a292cf73776 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 7 Feb 2011 14:24:35 -0500 Subject: [PATCH 67/89] hide feeds from group page if it's private-only --- .../GroupPrivateMessagePlugin.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php index e086fe91dc..6a58ec3e21 100644 --- a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php +++ b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php @@ -478,6 +478,18 @@ class GroupPrivateMessagePlugin extends Plugin return true; } + function onStartShowExportData($action) + { + if ($action instanceof ShowgroupAction) { + $gps = Group_privacy_settings::forGroup($action->group); + + if ($gps->allow_privacy == Group_privacy_settings::ALWAYS) { + return false; + } + } + return true; + } + function onPluginVersion(&$versions) { $versions[] = array('name' => 'GroupPrivateMessage', From 4883069177fbdd4c430661fc47c4669d0b1ff230 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 7 Feb 2011 12:18:41 -0800 Subject: [PATCH 68/89] Fix group regexes that got missed in Nickname::DISPLAY_FMT update: fixes bug where group linking happened, but not actual delivery, when using _underscores_ in the !group_name --- classes/Notice.php | 2 +- plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/classes/Notice.php b/classes/Notice.php index 2d13828f1f..4522d1fc38 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -964,7 +964,7 @@ class Notice extends Memcached_DataObject $groups = array(); /* extract all !group */ - $count = preg_match_all('/(?:^|\s)!([A-Za-z0-9]{1,64})/', + $count = preg_match_all('/(?:^|\s)!(' . Nickname::DISPLAY_FMT . ')/', strtolower($this->content), $match); if (!$count) { diff --git a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php index 7598b3f2b7..9468423bed 100644 --- a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php +++ b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php @@ -391,8 +391,10 @@ class GroupPrivateMessagePlugin extends Plugin // Look for group tags // FIXME: won't work for remote groups + // @fixme if Notice::saveNew is refactored so we can just pull its list + // of groups between processing and saving, make use of it - $count = preg_match_all('/(?:^|\s)!([A-Za-z0-9]{1,64})/', + $count = preg_match_all('/(?:^|\s)!(' . Nickname::DISPLAY_FMT . ')/', strtolower($notice->content), $match); From 1c3fabbc271f21b9de7f7610612c6225717356c7 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 7 Feb 2011 12:39:40 -0800 Subject: [PATCH 69/89] Add a brief explanation of what group inbox is at the top of the page (instructions section), plus a message to show when there are no private messages in the inbox. --- plugins/GroupPrivateMessage/groupinbox.php | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/plugins/GroupPrivateMessage/groupinbox.php b/plugins/GroupPrivateMessage/groupinbox.php index c7dfb966d5..39789cc9af 100644 --- a/plugins/GroupPrivateMessage/groupinbox.php +++ b/plugins/GroupPrivateMessage/groupinbox.php @@ -121,6 +121,9 @@ class GroupinboxAction extends GroupDesignAction $gml = new GroupMessageList($this, $this->gm); $cnt = $gml->show(); + if ($cnt == 0) { + $this->element('p', 'guide', _m('This group has not received any private messages.')); + } $this->pagination($this->page > 1, $cnt > MESSAGES_PER_PAGE, $this->page, @@ -173,4 +176,33 @@ class GroupinboxAction extends GroupDesignAction $this->page); } } + + /** + * Show the page notice + * + * Shows instructions for the page + * + * @return void + */ + + function showPageNotice() + { + $instr = $this->getInstructions(); + $output = common_markup_to_html($instr); + + $this->elementStart('div', 'instructions'); + $this->raw($output); + $this->elementEnd('div'); + } + + /** + * Instructions for using this page + * + * @return string localised instructions for using the page + */ + function getInstructions() + { + // TRANS: Instructions for user inbox page. + return _m('This is the group inbox, which lists all incoming private messages for this group.'); + } } From c858e2bc3484d58833650cf64bb2fbe2a4871cf8 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 7 Feb 2011 14:38:35 -0800 Subject: [PATCH 70/89] Issue #3025: string -> boolean for profile_background_tile entry in JSON user results from Twitter-compat API This entry was using the strings 'true' and 'false' instead of literal booleans, which could confuse clients expecting literal booleans as in other places and on Twitter in this place. --- lib/apiaction.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/apiaction.php b/lib/apiaction.php index b6e8f87b6d..5d70425720 100644 --- a/lib/apiaction.php +++ b/lib/apiaction.php @@ -263,8 +263,7 @@ class ApiAction extends Action ? Design::url($design->backgroundimage) : ''; $twitter_user['profile_background_tile'] - = empty($design->disposition) - ? '' : ($design->disposition & BACKGROUND_TILE) ? 'true' : 'false'; + = (bool)($design->disposition & BACKGROUND_TILE); $twitter_user['statuses_count'] = $profile->noticeCount(); From f500d4ea5be3583e7c2e9ad21d0c300bceda83f2 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 8 Feb 2011 11:11:21 -0500 Subject: [PATCH 71/89] Create and use MessageList widget Our mailbox actions (inbox and outbox) were doing their own display of messages. This was causing issues with especially showmessage, which since the more rigourous nickname checks were added, no longer works as a mailbox subclass. I've taken the time to rip out the message listing code from MailboxAction and moved it to a MessageList widget. The different mailboxes now have their own subclasses that show the correct profile in the list. --- actions/inbox.php | 34 ++++++---- actions/outbox.php | 37 +++++++---- lib/mailbox.php | 121 ++++------------------------------ lib/messagelist.php | 107 ++++++++++++++++++++++++++++++ lib/messagelistitem.php | 140 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 306 insertions(+), 133 deletions(-) create mode 100644 lib/messagelist.php create mode 100644 lib/messagelistitem.php diff --git a/actions/inbox.php b/actions/inbox.php index 3a50f4964f..6ab58f9751 100644 --- a/actions/inbox.php +++ b/actions/inbox.php @@ -90,18 +90,9 @@ class InboxAction extends MailboxAction } } - /** - * Returns the profile we want to show with the message - * - * For inboxes, we show the sender; for outboxes, the recipient. - * - * @param Message $message The message to get the profile for - * - * @return Profile The profile that matches the message - */ - function getMessageProfile($message) + function getMessageList($message) { - return $message->getFrom(); + return new InboxMessageList($this, $message); } /** @@ -115,3 +106,24 @@ class InboxAction extends MailboxAction return _('This is your inbox, which lists your incoming private messages.'); } } + +class InboxMessageList extends MessageList +{ + function newItem($message) + { + return new InboxMessageListItem($this->out, $message); + } +} + +class InboxMessageListItem extends MessageListItem +{ + /** + * Returns the profile we want to show with the message + * + * @return Profile The profile that matches the message + */ + function getMessageProfile() + { + return $this->message->getFrom(); + } +} \ No newline at end of file diff --git a/actions/outbox.php b/actions/outbox.php index b81d4b9d0d..cad19bba24 100644 --- a/actions/outbox.php +++ b/actions/outbox.php @@ -88,21 +88,9 @@ class OutboxAction extends MailboxAction } } - /** - * returns the profile we want to show with the message - * - * For outboxes, we show the recipient. - * - * @param Message $message The message to get the profile for - * - * @return Profile The profile of the message recipient - * - * @see MailboxAction::getMessageProfile() - */ - - function getMessageProfile($message) + function getMessageList($message) { - return $message->getTo(); + return new OutboxMessageList($this, $message); } /** @@ -116,3 +104,24 @@ class OutboxAction extends MailboxAction return _('This is your outbox, which lists private messages you have sent.'); } } + +class OutboxMessageList extends MessageList +{ + function newItem($message) + { + return new OutboxMessageListItem($this->out, $message); + } +} + +class OutboxMessageListItem extends MessageListItem +{ + /** + * Returns the profile we want to show with the message + * + * @return Profile The profile that matches the message + */ + function getMessageProfile() + { + return $this->message->getTo(); + } +} \ No newline at end of file diff --git a/lib/mailbox.php b/lib/mailbox.php index 63bffa75cc..bbcf2ef5dd 100644 --- a/lib/mailbox.php +++ b/lib/mailbox.php @@ -109,32 +109,22 @@ class MailboxAction extends CurrentUserDesignAction $message = $this->getMessages(); if ($message) { - $cnt = 0; - $this->elementStart('div', array('id' =>'notices_primary')); - $this->element('h2', null, _('Notices')); - $this->elementStart('ul', 'notices'); - while ($message->fetch() && $cnt <= MESSAGES_PER_PAGE) { - $cnt++; + $ml = $this->getMessageList($message); - if ($cnt > MESSAGES_PER_PAGE) { - break; - } + $cnt = $ml->show(); - $this->showMessage($message); - } - - $this->elementEnd('ul'); - - $this->pagination($this->page > 1, $cnt > MESSAGES_PER_PAGE, - $this->page, $this->trimmed('action'), + $this->pagination($this->page > 1, + $cnt > MESSAGES_PER_PAGE, + $this->page, + $this->trimmed('action'), array('nickname' => $this->user->nickname)); - $this->elementEnd('div'); - $message->free(); - unset($message); - } - else { - $this->element('p', 'guide', _('You have no private messages. You can send private message to engage other users in conversation. People can send you messages for your eyes only.')); + } else { + $this->element('p', + 'guide', + _('You have no private messages. '. + 'You can send private message to engage other users in conversation. '. + 'People can send you messages for your eyes only.')); } } @@ -143,95 +133,11 @@ class MailboxAction extends CurrentUserDesignAction return null; } - /** - * returns the profile we want to show with the message - * - * For inboxes, we show the sender; for outboxes, the recipient. - * - * @param Message $message The message to get the profile for - * - * @return Profile The profile that matches the message - */ - - function getMessageProfile($message) + function getMessageList($message) { return null; } - /** - * show a single message in the list format - * - * XXX: This needs to be extracted out into a MessageList similar - * to NoticeList. - * - * @param Message $message the message to show - * - * @return void - */ - - function showMessage($message) - { - $this->elementStart('li', array('class' => 'hentry notice', - 'id' => 'message-' . $message->id)); - - $profile = $this->getMessageProfile($message); - - $this->elementStart('div', 'entry-title'); - $this->elementStart('span', 'vcard author'); - $this->elementStart('a', array('href' => $profile->profileurl, - 'class' => 'url')); - $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE); - $this->element('img', array('src' => ($avatar) ? - $avatar->displayUrl() : - Avatar::defaultImage(AVATAR_STREAM_SIZE), - 'class' => 'photo avatar', - 'width' => AVATAR_STREAM_SIZE, - 'height' => AVATAR_STREAM_SIZE, - 'alt' => - ($profile->fullname) ? $profile->fullname : - $profile->nickname)); - $this->element('span', array('class' => 'nickname fn'), - $profile->nickname); - $this->elementEnd('a'); - $this->elementEnd('span'); - - // FIXME: URL, image, video, audio - $this->elementStart('p', array('class' => 'entry-content')); - $this->raw($message->rendered); - $this->elementEnd('p'); - $this->elementEnd('div'); - - $messageurl = common_local_url('showmessage', - array('message' => $message->id)); - - // XXX: we need to figure this out better. Is this right? - if (strcmp($message->uri, $messageurl) != 0 && - preg_match('/^http/', $message->uri)) { - $messageurl = $message->uri; - } - - $this->elementStart('div', 'entry-content'); - $this->elementStart('a', array('rel' => 'bookmark', - 'class' => 'timestamp', - 'href' => $messageurl)); - $dt = common_date_iso8601($message->created); - $this->element('abbr', array('class' => 'published', - 'title' => $dt), - common_date_string($message->created)); - $this->elementEnd('a'); - - if ($message->source) { - $this->elementStart('span', 'source'); - // FIXME: bad i18n. Device should be a parameter (from %s). - $this->text(_('from')); - $this->element('span', 'device', $this->showSource($message->source)); - $this->elementEnd('span'); - } - $this->elementEnd('div'); - - $this->elementEnd('li'); - } - /** * Show the page notice * @@ -300,5 +206,4 @@ class MailboxAction extends CurrentUserDesignAction { return true; } - } diff --git a/lib/messagelist.php b/lib/messagelist.php new file mode 100644 index 0000000000..da7e9a6c27 --- /dev/null +++ b/lib/messagelist.php @@ -0,0 +1,107 @@ +. + * + * @category Widget + * @package StatusNet + * @author Evan Prodromou + * @copyright 2011 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET')) { + // This check helps protect against security problems; + // your code file can't be executed directly from the web. + exit(1); +} + +/** + * Message list widget + * + * @category Widget + * @package StatusNet + * @author Evan Prodromou + * @copyright 2011 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +abstract class MessageList extends Widget +{ + var $message; + + /** + * Constructor + * + * @param HTMLOutputter $out Output context + * @param Message $message Stream of messages to show + */ + function __construct($out, $message) + { + parent::__construct($out); + $this->message = $message; + } + + /** + * Show the widget + * + * Uses newItem() to create each new item. + * + * @return integer count of messages seen. + */ + function show() + { + $cnt = 0; + + $this->out->elementStart('div', array('id' =>'notices_primary')); + + $this->out->element('h2', null, _('Messages')); + + $this->out->elementStart('ul', 'notices messages'); + + while ($this->message->fetch() && $cnt <= MESSAGES_PER_PAGE) { + + $cnt++; + + if ($cnt > MESSAGES_PER_PAGE) { + break; + } + + $mli = $this->newItem($this->message); + + $mli->show(); + } + + $this->out->elementEnd('ul'); + + $this->out->elementEnd('div'); + } + + /** + * Create a new message item for a message + * + * @param Message $message The message to show + * + * @return MessageListItem an item to show + */ + abstract function newItem($message); +} diff --git a/lib/messagelistitem.php b/lib/messagelistitem.php new file mode 100644 index 0000000000..2907eab274 --- /dev/null +++ b/lib/messagelistitem.php @@ -0,0 +1,140 @@ +. + * + * @category Widget + * @package StatusNet + * @author Evan Prodromou + * @copyright 2011 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +if (!defined('STATUSNET')) { + // This check helps protect against security problems; + // your code file can't be executed directly from the web. + exit(1); +} + +/** + * A single item in a message list + * + * @category Widget + * @package StatusNet + * @author Evan Prodromou + * @copyright 2011 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ +abstract class MessageListItem extends Widget +{ + var $message; + + /** + * Constructor + * + * @param HTMLOutputter $out Output context + * @param Message $message Message to show + */ + function __construct($out, $message) + { + parent::__construct($out); + $this->message = $message; + } + + /** + * Show the widget + * + * @return void + */ + + function show() + { + $this->out->elementStart('li', array('class' => 'hentry notice', + 'id' => 'message-' . $this->message->id)); + + $profile = $this->getMessageProfile(); + + $this->out->elementStart('div', 'entry-title'); + $this->out->elementStart('span', 'vcard author'); + $this->out->elementStart('a', array('href' => $profile->profileurl, + 'class' => 'url')); + $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE); + $this->out->element('img', array('src' => ($avatar) ? + $avatar->displayUrl() : + Avatar::defaultImage(AVATAR_STREAM_SIZE), + 'class' => 'photo avatar', + 'width' => AVATAR_STREAM_SIZE, + 'height' => AVATAR_STREAM_SIZE, + 'alt' => + ($profile->fullname) ? $profile->fullname : + $profile->nickname)); + $this->out->element('span', array('class' => 'nickname fn'), + $profile->nickname); + $this->out->elementEnd('a'); + $this->out->elementEnd('span'); + + // FIXME: URL, image, video, audio + $this->out->elementStart('p', array('class' => 'entry-content')); + $this->out->raw($this->message->rendered); + $this->out->elementEnd('p'); + $this->out->elementEnd('div'); + + $messageurl = common_local_url('showmessage', + array('message' => $this->message->id)); + + // XXX: we need to figure this out better. Is this right? + if (strcmp($this->message->uri, $messageurl) != 0 && + preg_match('/^http/', $this->message->uri)) { + $messageurl = $this->message->uri; + } + + $this->out->elementStart('div', 'entry-content'); + $this->out->elementStart('a', array('rel' => 'bookmark', + 'class' => 'timestamp', + 'href' => $messageurl)); + $dt = common_date_iso8601($this->message->created); + $this->out->element('abbr', array('class' => 'published', + 'title' => $dt), + common_date_string($this->message->created)); + $this->out->elementEnd('a'); + + if ($this->message->source) { + $this->out->elementStart('span', 'source'); + // FIXME: bad i18n. Device should be a parameter (from %s). + $this->out->text(_('from')); + $this->out->element('span', 'device', $this->out->showSource($this->message->source)); + $this->out->elementEnd('span'); + } + $this->out->elementEnd('div'); + + $this->out->elementEnd('li'); + } + + /** + * Return the profile to show in the message item + * + * Overridden in sub-classes to show sender, receiver, or whatever + * + * @return Profile profile to show avatar and name of + */ + abstract function getMessageProfile(); +} From 3b19b63babc538d7dece46fa818049c92a3eae3f Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 8 Feb 2011 11:32:35 -0500 Subject: [PATCH 72/89] correctly show the source of messages in a message list --- lib/mailbox.php | 38 -------------------------------------- lib/messagelistitem.php | 40 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 39 deletions(-) diff --git a/lib/mailbox.php b/lib/mailbox.php index bbcf2ef5dd..7faeb7dba3 100644 --- a/lib/mailbox.php +++ b/lib/mailbox.php @@ -156,44 +156,6 @@ class MailboxAction extends CurrentUserDesignAction $this->elementEnd('div'); } - /** - * Show the source of the message - * - * Returns either the name (and link) of the API client that posted the notice, - * or one of other other channels. - * - * @param string $source the source of the message - * - * @return void - */ - - function showSource($source) - { - $source_name = _($source); - switch ($source) { - case 'web': - case 'xmpp': - case 'mail': - case 'omb': - case 'api': - $this->element('span', 'device', $source_name); - break; - default: - $ns = Notice_source::staticGet($source); - if ($ns) { - $this->elementStart('span', 'device'); - $this->element('a', array('href' => $ns->url, - 'rel' => 'external'), - $ns->name); - $this->elementEnd('span'); - } else { - $this->element('span', 'device', $source_name); - } - break; - } - return; - } - /** * Mailbox actions are read only * diff --git a/lib/messagelistitem.php b/lib/messagelistitem.php index 2907eab274..44e6976454 100644 --- a/lib/messagelistitem.php +++ b/lib/messagelistitem.php @@ -121,7 +121,7 @@ abstract class MessageListItem extends Widget $this->out->elementStart('span', 'source'); // FIXME: bad i18n. Device should be a parameter (from %s). $this->out->text(_('from')); - $this->out->element('span', 'device', $this->out->showSource($this->message->source)); + $this->showSource($this->message->source); $this->out->elementEnd('span'); } $this->out->elementEnd('div'); @@ -129,6 +129,44 @@ abstract class MessageListItem extends Widget $this->out->elementEnd('li'); } + + /** + * Show the source of the message + * + * Returns either the name (and link) of the API client that posted the notice, + * or one of other other channels. + * + * @param string $source the source of the message + * + * @return void + */ + function showSource($source) + { + $source_name = _($source); + switch ($source) { + case 'web': + case 'xmpp': + case 'mail': + case 'omb': + case 'api': + $this->out->element('span', 'device', $source_name); + break; + default: + $ns = Notice_source::staticGet($source); + if ($ns) { + $this->out->elementStart('span', 'device'); + $this->out->element('a', array('href' => $ns->url, + 'rel' => 'external'), + $ns->name); + $this->out->elementEnd('span'); + } else { + $this->out->element('span', 'device', $source_name); + } + break; + } + return; + } + /** * Return the profile to show in the message item * From e903ff0525099be10681123c42a2b2d55c8649b6 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 8 Feb 2011 11:33:36 -0500 Subject: [PATCH 73/89] Make ShowmessageAction not be a subclass of MailboxAction The ShowmessageAction was using the MailboxAction to do its display of a single direct message. Since we redid the nickname management, this was breaking (MailboxAction requires a nickname argument, ShowmessageAction does not, and nickname validation that used to quietly fail now throws an exception). I've moved the message list processing to its own widget class, so the need to subclass MailboxAction has disappeared. I've rewritten this action to use the MessageListItem widget, and it works fine now. --- actions/showmessage.php | 105 ++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 63 deletions(-) diff --git a/actions/showmessage.php b/actions/showmessage.php index d737f85d3a..1c867af119 100644 --- a/actions/showmessage.php +++ b/actions/showmessage.php @@ -30,20 +30,17 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } -require_once INSTALLDIR.'/lib/mailbox.php'; - /** * Show a single message * - * // XXX: It is totally weird how this works! - * * @category Personal * @package StatusNet * @author Evan Prodromou * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 * @link http://status.net/ */ -class ShowmessageAction extends MailboxAction + +class ShowmessageAction extends Action { /** * Message object to show @@ -82,22 +79,20 @@ class ShowmessageAction extends MailboxAction $this->user = common_current_user(); + if (empty($this->user) || + ($this->user->id != $this->message->from_profile && + $this->user->id != $this->message->to_profile)) { + // TRANS: Client error displayed requesting a single direct message the requesting user was not a party in. + throw new ClientException(_('Only the sender and recipient ' . + 'may read this message.'), 403); + } + return true; } function handle($args) { - Action::handle($args); - - if ($this->user && ($this->user->id == $this->message->from_profile || - $this->user->id == $this->message->to_profile)) { - $this->showPage(); - } else { - // TRANS: Client error displayed requesting a single direct message the requesting user was not a party in. - $this->clientError(_('Only the sender and recipient ' . - 'may read this message.'), 403); - return; - } + $this->showPage(); } function title() @@ -121,12 +116,38 @@ class ShowmessageAction extends MailboxAction } } - function getMessages() + + function showContent() { - $message = new Message(); - $message->id = $this->message->id; - $message->find(); - return $message; + $this->elementStart('ul', 'notices messages'); + $ml = new ShowMessageListItem($this, $this->message, $this->user); + $ml->show(); + $this->elementEnd('ul'); + } + + function isReadOnly($args) + { + return true; + } + + /** + * Don't show aside + * + * @return void + */ + + function showAside() { + } +} + +class ShowMessageListItem extends MessageListItem +{ + var $user; + + function __construct($out, $message, $user) + { + parent::__construct($out, $message); + $this->user = $user; } function getMessageProfile() @@ -140,46 +161,4 @@ class ShowmessageAction extends MailboxAction return null; } } - - /** - * Don't show local navigation - * - * @return void - */ - function showLocalNavBlock() - { - } - - /** - * Don't show page notice - * - * @return void - */ - function showPageNoticeBlock() - { - } - - /** - * Don't show aside - * - * @return void - */ - function showAside() - { - } - - /** - * Don't show any instructions - * - * @return string - */ - function getInstructions() - { - return ''; - } - - function isReadOnly($args) - { - return true; - } } From ecf0dec0c12221550772400392d4007de71bf8f3 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 8 Feb 2011 11:53:30 -0500 Subject: [PATCH 74/89] change alpha1 to beta1 --- lib/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common.php b/lib/common.php index 4fd49a5592..a5cfb6f8f7 100644 --- a/lib/common.php +++ b/lib/common.php @@ -23,7 +23,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } if (isset($_REQUEST['p']) && $_REQUEST['p'] == 'check-fancy') { exit; } define('STATUSNET_BASE_VERSION', '0.9.7'); -define('STATUSNET_LIFECYCLE', 'alpha1'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release' +define('STATUSNET_LIFECYCLE', 'beta1'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release' define('STATUSNET_VERSION', STATUSNET_BASE_VERSION . STATUSNET_LIFECYCLE); define('LACONICA_VERSION', STATUSNET_VERSION); // compatibility From 98af8d2a196906cfc1831c8b83104189e1bc255f Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 9 Feb 2011 04:49:39 +0000 Subject: [PATCH 75/89] FacebookBridge plugin - allow Facebook app ID and secret to be initialized via config.php --- .../FacebookBridge/FacebookBridgePlugin.php | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/plugins/FacebookBridge/FacebookBridgePlugin.php b/plugins/FacebookBridge/FacebookBridgePlugin.php index 000b214ff4..7e17c2d7ec 100644 --- a/plugins/FacebookBridge/FacebookBridgePlugin.php +++ b/plugins/FacebookBridge/FacebookBridgePlugin.php @@ -24,7 +24,7 @@ * @category Pugin * @package StatusNet * @author Zach Copley - * @copyright 2010 StatusNet, Inc. + * @copyright 2011 StatusNet, Inc. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 * @link http://status.net/ */ @@ -47,8 +47,9 @@ define("FACEBOOK_SERVICE", 2); */ class FacebookBridgePlugin extends Plugin { - public $appId = null; // Facebook application ID - public $secret = null; // Facebook application secret + public $appId; // Facebook application ID + public $secret; // Facebook application secret + public $facebook = null; // Facebook application instance public $dir = null; // Facebook plugin dir @@ -61,6 +62,28 @@ class FacebookBridgePlugin extends Plugin */ function initialize() { + + // Allow the id and key to be passed in + // Control panel will override + + if (isset($this->appId)) { + $appId = common_config('facebook', 'appid'); + if (empty($appId)) { + Config::save( + 'facebook', + 'appid', + $this->appId + ); + } + } + + if (isset($this->secret)) { + $secret = common_config('facebook', 'secret'); + if (empty($secret)) { + Config::save('facebook', 'secret', $this->secret); + } + } + $this->facebook = Facebookclient::getFacebook( $this->appId, $this->secret From ae492c71326eb63109751071a18a8f5d6ccbf666 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 8 Feb 2011 22:28:23 -0800 Subject: [PATCH 76/89] Revert jQuery Form to r2.17 -- the latest fails with our Meteor stuff the way it tweaks document.domain (which also causes other AJAX-related problems and needs to be destroyed one of these days...) --- js/jquery.form.js | 1435 ++++++++++++++++++----------------------- js/jquery.form.min.js | 12 +- 2 files changed, 633 insertions(+), 814 deletions(-) diff --git a/js/jquery.form.js b/js/jquery.form.js index 14e14572af..936b847abe 100644 --- a/js/jquery.form.js +++ b/js/jquery.form.js @@ -1,803 +1,632 @@ -/*! - * jQuery Form Plugin - * version: 2.63 (29-JAN-2011) - * @requires jQuery v1.3.2 or later - * - * Examples and documentation at: http://malsup.com/jquery/form/ - * Dual licensed under the MIT and GPL licenses: - * http://www.opensource.org/licenses/mit-license.php - * http://www.gnu.org/licenses/gpl.html - */ -;(function($) { - -/* - Usage Note: - ----------- - Do not use both ajaxSubmit and ajaxForm on the same form. These - functions are intended to be exclusive. Use ajaxSubmit if you want - to bind your own submit handler to the form. For example, - - $(document).ready(function() { - $('#myForm').bind('submit', function(e) { - e.preventDefault(); // <-- important - $(this).ajaxSubmit({ - target: '#output' - }); - }); - }); - - Use ajaxForm when you want the plugin to manage all the event binding - for you. For example, - - $(document).ready(function() { - $('#myForm').ajaxForm({ - target: '#output' - }); - }); - - When using ajaxForm, the ajaxSubmit function will be invoked for you - at the appropriate time. -*/ - -/** - * ajaxSubmit() provides a mechanism for immediately submitting - * an HTML form using AJAX. - */ -$.fn.ajaxSubmit = function(options) { - // fast fail if nothing selected (http://dev.jquery.com/ticket/2752) - if (!this.length) { - log('ajaxSubmit: skipping submit process - no element selected'); - return this; - } - - if (typeof options == 'function') { - options = { success: options }; - } - - var action = this.attr('action'); - var url = (typeof action === 'string') ? $.trim(action) : ''; - if (url) { - // clean url (don't include hash vaue) - url = (url.match(/^([^#]+)/)||[])[1]; - } - url = url || window.location.href || ''; - - options = $.extend(true, { - url: url, - type: this[0].getAttribute('method') || 'GET', // IE7 massage (see issue 57) - iframeSrc: /^https/i.test(window.location.href || '') ? 'javascript:false' : 'about:blank' - }, options); - - // hook for manipulating the form data before it is extracted; - // convenient for use with rich editors like tinyMCE or FCKEditor - var veto = {}; - this.trigger('form-pre-serialize', [this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-pre-serialize trigger'); - return this; - } - - // provide opportunity to alter form data before it is serialized - if (options.beforeSerialize && options.beforeSerialize(this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSerialize callback'); - return this; - } - - var n,v,a = this.formToArray(options.semantic); - if (options.data) { - options.extraData = options.data; - for (n in options.data) { - if(options.data[n] instanceof Array) { - for (var k in options.data[n]) { - a.push( { name: n, value: options.data[n][k] } ); - } - } - else { - v = options.data[n]; - v = $.isFunction(v) ? v() : v; // if value is fn, invoke it - a.push( { name: n, value: v } ); - } - } - } - - // give pre-submit callback an opportunity to abort the submit - if (options.beforeSubmit && options.beforeSubmit(a, this, options) === false) { - log('ajaxSubmit: submit aborted via beforeSubmit callback'); - return this; - } - - // fire vetoable 'validate' event - this.trigger('form-submit-validate', [a, this, options, veto]); - if (veto.veto) { - log('ajaxSubmit: submit vetoed via form-submit-validate trigger'); - return this; - } - - var q = $.param(a); - - if (options.type.toUpperCase() == 'GET') { - options.url += (options.url.indexOf('?') >= 0 ? '&' : '?') + q; - options.data = null; // data is null for 'get' - } - else { - options.data = q; // data is the query string for 'post' - } - - var $form = this, callbacks = []; - if (options.resetForm) { - callbacks.push(function() { $form.resetForm(); }); - } - if (options.clearForm) { - callbacks.push(function() { $form.clearForm(); }); - } - - // perform a load on the target only if dataType is not provided - if (!options.dataType && options.target) { - var oldSuccess = options.success || function(){}; - callbacks.push(function(data) { - var fn = options.replaceTarget ? 'replaceWith' : 'html'; - $(options.target)[fn](data).each(oldSuccess, arguments); - }); - } - else if (options.success) { - callbacks.push(options.success); - } - - options.success = function(data, status, xhr) { // jQuery 1.4+ passes xhr as 3rd arg - var context = options.context || options; // jQuery 1.4+ supports scope context - for (var i=0, max=callbacks.length; i < max; i++) { - callbacks[i].apply(context, [data, status, xhr || $form, $form]); - } - }; - - // are there files to upload? - var fileInputs = $('input:file', this).length > 0; - var mp = 'multipart/form-data'; - var multipart = ($form.attr('enctype') == mp || $form.attr('encoding') == mp); - - // options.iframe allows user to force iframe mode - // 06-NOV-09: now defaulting to iframe mode if file input is detected - if (options.iframe !== false && (fileInputs || options.iframe || multipart)) { - // hack to fix Safari hang (thanks to Tim Molendijk for this) - // see: http://groups.google.com/group/jquery-dev/browse_thread/thread/36395b7ab510dd5d - if (options.closeKeepAlive) { - $.get(options.closeKeepAlive, fileUpload); - } - else { - fileUpload(); - } - } - else { - $.ajax(options); - } - - // fire 'notify' event - this.trigger('form-submit-notify', [this, options]); - return this; - - - // private function for handling file uploads (hat tip to YAHOO!) - function fileUpload() { - var form = $form[0]; - - if ($(':input[name=submit],:input[id=submit]', form).length) { - // if there is an input with a name or id of 'submit' then we won't be - // able to invoke the submit fn on the form (at least not x-browser) - alert('Error: Form elements must not have name or id of "submit".'); - return; - } - - var s = $.extend(true, {}, $.ajaxSettings, options); - s.context = s.context || s; - var id = 'jqFormIO' + (new Date().getTime()), fn = '_'+id; - var $io = $('