* i18n/L10n updates
* whitespace updates.
This commit is contained in:
parent
1c5e00df30
commit
ba6538ed78
@ -45,7 +45,6 @@ require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
|
||||
* @link http://status.net/
|
||||
* @link http://twitter.com/
|
||||
*/
|
||||
|
||||
class TwitterBridgePlugin extends Plugin
|
||||
{
|
||||
|
||||
@ -55,7 +54,6 @@ class TwitterBridgePlugin extends Plugin
|
||||
/**
|
||||
* Initializer for the plugin.
|
||||
*/
|
||||
|
||||
function initialize()
|
||||
{
|
||||
// Allow the key and secret to be passed in
|
||||
@ -86,7 +84,6 @@ class TwitterBridgePlugin extends Plugin
|
||||
*
|
||||
* @return boolean result
|
||||
*/
|
||||
|
||||
static function hasKeys()
|
||||
{
|
||||
$ckey = common_config('twitter', 'consumer_key');
|
||||
@ -113,7 +110,6 @@ class TwitterBridgePlugin extends Plugin
|
||||
*
|
||||
* @return boolean hook return
|
||||
*/
|
||||
|
||||
function onRouterInitialized($m)
|
||||
{
|
||||
$m->connect('admin/twitter', array('action' => 'twitteradminpanel'));
|
||||
@ -310,7 +306,6 @@ class TwitterBridgePlugin extends Plugin
|
||||
*
|
||||
* @return boolean hook value
|
||||
*/
|
||||
|
||||
function onPluginVersion(&$versions)
|
||||
{
|
||||
$versions[] = array(
|
||||
@ -319,8 +314,8 @@ class TwitterBridgePlugin extends Plugin
|
||||
'author' => 'Zach Copley, Julien C',
|
||||
'homepage' => 'http://status.net/wiki/Plugin:TwitterBridge',
|
||||
'rawdescription' => _m(
|
||||
'The Twitter "bridge" plugin allows you to integrate ' .
|
||||
'your StatusNet instance with ' .
|
||||
'The Twitter "bridge" plugin allows integration ' .
|
||||
'of a StatusNet instance with ' .
|
||||
'<a href="http://twitter.com/">Twitter</a>.'
|
||||
)
|
||||
);
|
||||
@ -374,7 +369,6 @@ class TwitterBridgePlugin extends Plugin
|
||||
*
|
||||
* @return boolean hook value; true means continue processing, false means stop.
|
||||
*/
|
||||
|
||||
function onCheckSchema()
|
||||
{
|
||||
$schema = Schema::get();
|
||||
@ -416,7 +410,6 @@ class TwitterBridgePlugin extends Plugin
|
||||
*
|
||||
* @return boolean hook value
|
||||
*/
|
||||
|
||||
function onStartDeleteOwnNotice(User $user, Notice $notice)
|
||||
{
|
||||
$n2s = Notice_to_status::staticGet('notice_id', $notice->id);
|
||||
@ -452,7 +445,6 @@ class TwitterBridgePlugin extends Plugin
|
||||
* @param Notice $notice being favored
|
||||
* @return hook return value
|
||||
*/
|
||||
|
||||
function onEndFavorNotice(Profile $profile, Notice $notice)
|
||||
{
|
||||
$flink = Foreign_link::getByUserID($profile->id,
|
||||
@ -489,7 +481,6 @@ class TwitterBridgePlugin extends Plugin
|
||||
*
|
||||
* @return hook return value
|
||||
*/
|
||||
|
||||
function onEndDisfavorNotice(Profile $profile, Notice $notice)
|
||||
{
|
||||
$flink = Foreign_link::getByUserID($profile->id,
|
||||
|
@ -48,7 +48,6 @@ require_once INSTALLDIR . '/classes/Memcached_DataObject.php';
|
||||
*
|
||||
* @see DB_DataObject
|
||||
*/
|
||||
|
||||
class Twitter_synch_status extends Memcached_DataObject
|
||||
{
|
||||
public $__table = 'twitter_synch_status'; // table name
|
||||
@ -67,7 +66,6 @@ class Twitter_synch_status extends Memcached_DataObject
|
||||
* @return Twitter_synch_status object found, or null for no hits
|
||||
*
|
||||
*/
|
||||
|
||||
function staticGet($k, $v=null)
|
||||
{
|
||||
throw new Exception("Use pkeyGet() for this class.");
|
||||
@ -81,7 +79,6 @@ class Twitter_synch_status extends Memcached_DataObject
|
||||
* @return Twitter_synch_status object found, or null for no hits
|
||||
*
|
||||
*/
|
||||
|
||||
function pkeyGet($kv)
|
||||
{
|
||||
return Memcached_DataObject::pkeyGet('Twitter_synch_status', $kv);
|
||||
@ -95,7 +92,6 @@ class Twitter_synch_status extends Memcached_DataObject
|
||||
*
|
||||
* @return array array of column definitions
|
||||
*/
|
||||
|
||||
function table()
|
||||
{
|
||||
return array('foreign_id' => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
|
||||
@ -115,7 +111,6 @@ class Twitter_synch_status extends Memcached_DataObject
|
||||
*
|
||||
* @return array list of key field names
|
||||
*/
|
||||
|
||||
function keys()
|
||||
{
|
||||
return array_keys($this->keyTypes());
|
||||
@ -133,7 +128,6 @@ class Twitter_synch_status extends Memcached_DataObject
|
||||
* '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('foreign_id' => 'K',
|
||||
@ -150,7 +144,6 @@ class Twitter_synch_status extends Memcached_DataObject
|
||||
*
|
||||
* @return array magic three-false array that stops auto-incrementing.
|
||||
*/
|
||||
|
||||
function sequenceKey()
|
||||
{
|
||||
return array(false, false, false);
|
||||
@ -174,7 +167,6 @@ class Twitter_synch_status extends Memcached_DataObject
|
||||
'timeline' => $timeline));
|
||||
|
||||
if (empty($tss)) {
|
||||
|
||||
$tss = new Twitter_synch_status();
|
||||
|
||||
$tss->foreign_id = $foreign_id;
|
||||
@ -186,9 +178,7 @@ class Twitter_synch_status extends Memcached_DataObject
|
||||
$tss->insert();
|
||||
|
||||
return true;
|
||||
|
||||
} else {
|
||||
|
||||
$orig = clone($tss);
|
||||
|
||||
$tss->last_id = $last_id;
|
||||
|
@ -45,7 +45,6 @@ require_once INSTALLDIR . '/plugins/TwitterBridge/twitteroauthclient.php';
|
||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||
* @link http://status.net/
|
||||
*/
|
||||
|
||||
class SyncTwitterFriendsDaemon extends ParallelizingDaemon
|
||||
{
|
||||
/**
|
||||
@ -59,7 +58,6 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
|
||||
* @return void
|
||||
*
|
||||
**/
|
||||
|
||||
function __construct($id = null, $interval = 60,
|
||||
$max_children = 2, $debug = null)
|
||||
{
|
||||
@ -71,7 +69,6 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
|
||||
*
|
||||
* @return string Name of the daemon.
|
||||
*/
|
||||
|
||||
function name()
|
||||
{
|
||||
return ('synctwitterfriends.' . $this->_id);
|
||||
@ -110,12 +107,10 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
|
||||
}
|
||||
|
||||
function childTask($flink) {
|
||||
|
||||
// Each child ps needs its own DB connection
|
||||
|
||||
// Note: DataObject::getDatabaseConnection() creates
|
||||
// a new connection if there isn't one already
|
||||
|
||||
$conn = &$flink->getDatabaseConnection();
|
||||
|
||||
$this->subscribeTwitterFriends($flink);
|
||||
@ -127,7 +122,6 @@ class SyncTwitterFriendsDaemon extends ParallelizingDaemon
|
||||
|
||||
// XXX: Couldn't find a less brutal way to blow
|
||||
// away a cached connection
|
||||
|
||||
global $_DB_DATAOBJECT;
|
||||
unset($_DB_DATAOBJECT['CONNECTIONS']);
|
||||
}
|
||||
@ -277,4 +271,3 @@ if (have_option('d') || have_option('debug')) {
|
||||
|
||||
$syncer = new SyncTwitterFriendsDaemon($id, 60, 2, $debug);
|
||||
$syncer->runOnce();
|
||||
|
||||
|
@ -62,7 +62,6 @@ require_once INSTALLDIR . '/plugins/TwitterBridge/twitteroauthclient.php';
|
||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||
* @link http://status.net/
|
||||
*/
|
||||
|
||||
class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
{
|
||||
/**
|
||||
@ -87,7 +86,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
*
|
||||
* @return string Name of the daemon.
|
||||
*/
|
||||
|
||||
function name()
|
||||
{
|
||||
return ('twitterstatusfetcher.'.$this->_id);
|
||||
@ -99,7 +97,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
*
|
||||
* @return array flinks an array of Foreign_link objects
|
||||
*/
|
||||
|
||||
function getObjects()
|
||||
{
|
||||
global $_DB_DATAOBJECT;
|
||||
@ -133,12 +130,10 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
}
|
||||
|
||||
function childTask($flink) {
|
||||
|
||||
// Each child ps needs its own DB connection
|
||||
|
||||
// Note: DataObject::getDatabaseConnection() creates
|
||||
// a new connection if there isn't one already
|
||||
|
||||
$conn = &$flink->getDatabaseConnection();
|
||||
|
||||
$this->getTimeline($flink);
|
||||
@ -150,7 +145,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
|
||||
// XXX: Couldn't find a less brutal way to blow
|
||||
// away a cached connection
|
||||
|
||||
global $_DB_DATAOBJECT;
|
||||
unset($_DB_DATAOBJECT['CONNECTIONS']);
|
||||
}
|
||||
@ -201,9 +195,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
// Reverse to preserve order
|
||||
|
||||
foreach (array_reverse($timeline) as $status) {
|
||||
|
||||
// Hacktastic: filter out stuff coming from this StatusNet
|
||||
|
||||
$source = mb_strtolower(common_config('integration', 'source'));
|
||||
|
||||
if (preg_match("/$source/", mb_strtolower($status->source))) {
|
||||
@ -214,7 +206,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
|
||||
// Don't save it if the user is protected
|
||||
// FIXME: save it but treat it as private
|
||||
|
||||
if ($status->user->protected) {
|
||||
continue;
|
||||
}
|
||||
@ -232,7 +223,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
}
|
||||
|
||||
// Okay, record the time we synced with Twitter for posterity
|
||||
|
||||
$flink->last_noticesync = common_sql_now();
|
||||
$flink->update();
|
||||
}
|
||||
@ -250,7 +240,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
$statusUri = $this->makeStatusURI($status->user->screen_name, $status->id);
|
||||
|
||||
// check to see if we've already imported the status
|
||||
|
||||
$n2s = Notice_to_status::staticGet('status_id', $status->id);
|
||||
|
||||
if (!empty($n2s)) {
|
||||
@ -263,7 +252,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
}
|
||||
|
||||
// If it's a retweet, save it as a repeat!
|
||||
|
||||
if (!empty($status->retweeted_status)) {
|
||||
common_log(LOG_INFO, "Status {$status->id} is a retweet of {$status->retweeted_status->id}.");
|
||||
$original = $this->saveStatus($status->retweeted_status);
|
||||
@ -273,7 +261,7 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
$author = $original->getProfile();
|
||||
// TRANS: Message used to repeat a notice. RT is the abbreviation of 'retweet'.
|
||||
// TRANS: %1$s is the repeated user's name, %2$s is the repeated notice.
|
||||
$content = sprintf(_('RT @%1$s %2$s'),
|
||||
$content = sprintf(_m('RT @%1$s %2$s'),
|
||||
$author->nickname,
|
||||
$original->content);
|
||||
|
||||
@ -365,7 +353,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
*
|
||||
* @return string URI
|
||||
*/
|
||||
|
||||
function makeStatusURI($username, $id)
|
||||
{
|
||||
return 'http://twitter.com/'
|
||||
@ -383,7 +370,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
*
|
||||
* @return mixed value the first Profile with that url, or null
|
||||
*/
|
||||
|
||||
function getProfileByUrl($nickname, $profileurl)
|
||||
{
|
||||
$profile = new Profile();
|
||||
@ -407,7 +393,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
*
|
||||
* @return mixed value a matching Notice or null
|
||||
*/
|
||||
|
||||
function checkDupe($profile, $statusUri)
|
||||
{
|
||||
$notice = new Notice();
|
||||
@ -426,7 +411,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
function ensureProfile($user)
|
||||
{
|
||||
// check to see if there's already a profile for this user
|
||||
|
||||
$profileurl = 'http://twitter.com/' . $user->screen_name;
|
||||
$profile = $this->getProfileByUrl($user->screen_name, $profileurl);
|
||||
|
||||
@ -440,7 +424,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
return $profile;
|
||||
|
||||
} else {
|
||||
|
||||
common_debug($this->name() . ' - Adding profile and remote profile ' .
|
||||
"for Twitter user: $profileurl.");
|
||||
|
||||
@ -472,7 +455,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
$remote_pro = Remote_profile::staticGet('uri', $profileurl);
|
||||
|
||||
if (empty($remote_pro)) {
|
||||
|
||||
$remote_pro = new Remote_profile();
|
||||
|
||||
$remote_pro->id = $id;
|
||||
@ -619,7 +601,6 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
$avatar = $profile->getAvatar($sizes[$size]);
|
||||
|
||||
// Delete the avatar, if present
|
||||
|
||||
if ($avatar) {
|
||||
$avatar->delete();
|
||||
}
|
||||
@ -644,10 +625,8 @@ class TwitterStatusFetcher extends ParallelizingDaemon
|
||||
$avatar->height = 48;
|
||||
break;
|
||||
default:
|
||||
|
||||
// Note: Twitter's big avatars are a different size than
|
||||
// StatusNet's (StatusNet's = 96)
|
||||
|
||||
$avatar->width = 73;
|
||||
$avatar->height = 73;
|
||||
}
|
||||
@ -822,4 +801,3 @@ if (have_option('d') || have_option('debug')) {
|
||||
|
||||
$fetcher = new TwitterStatusFetcher($id, 60, 2, $debug);
|
||||
$fetcher->runOnce();
|
||||
|
||||
|
@ -69,7 +69,6 @@ function save_twitter_user($twitter_id, $screen_name)
|
||||
{
|
||||
// Check to see whether the Twitter user is already in the system,
|
||||
// and update its screen name and uri if so.
|
||||
|
||||
$fuser = Foreign_user::getForeignUser($twitter_id, TWITTER_SERVICE);
|
||||
|
||||
if (!empty($fuser)) {
|
||||
@ -87,9 +86,7 @@ function save_twitter_user($twitter_id, $screen_name)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// Kill any old, invalid records for this screen name
|
||||
|
||||
$fuser = Foreign_user::getByNickname($screen_name, TWITTER_SERVICE);
|
||||
|
||||
if (!empty($fuser)) {
|
||||
@ -110,13 +107,11 @@ function save_twitter_user($twitter_id, $screen_name)
|
||||
}
|
||||
|
||||
function is_twitter_bound($notice, $flink) {
|
||||
|
||||
// Check to see if notice should go to Twitter
|
||||
if (!empty($flink) && ($flink->noticesync & FOREIGN_NOTICE_SEND)) {
|
||||
|
||||
// If it's not a Twitter-style reply, or if the user WANTS to send replies,
|
||||
// or if it's in reply to a twitter notice
|
||||
|
||||
if (!preg_match('/^@[a-zA-Z0-9_]{1,15}\b/u', $notice->content) ||
|
||||
($flink->noticesync & FOREIGN_NOTICE_SEND_REPLY) ||
|
||||
is_twitter_notice($notice->reply_to)) {
|
||||
@ -242,7 +237,6 @@ function broadcast_oauth($notice, $flink) {
|
||||
}
|
||||
|
||||
// Notice crossed the great divide
|
||||
|
||||
$msg = sprintf('Twitter bridge - posted notice %d to Twitter using ' .
|
||||
'OAuth for User %s (user id %d).',
|
||||
$notice->id,
|
||||
@ -378,4 +372,3 @@ function mail_twitter_bridge_removed($user)
|
||||
common_switch_locale();
|
||||
return mail_to_user($user, $subject, $body);
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,6 @@ if (!defined('STATUSNET')) {
|
||||
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
|
||||
* @link http://status.net/
|
||||
*/
|
||||
|
||||
class TwitteradminpanelAction extends AdminPanelAction
|
||||
{
|
||||
/**
|
||||
@ -48,7 +47,6 @@ class TwitteradminpanelAction extends AdminPanelAction
|
||||
*
|
||||
* @return string page title
|
||||
*/
|
||||
|
||||
function title()
|
||||
{
|
||||
return _m('Twitter');
|
||||
@ -59,7 +57,6 @@ class TwitteradminpanelAction extends AdminPanelAction
|
||||
*
|
||||
* @return string instructions
|
||||
*/
|
||||
|
||||
function getInstructions()
|
||||
{
|
||||
return _m('Twitter bridge settings');
|
||||
@ -70,7 +67,6 @@ class TwitteradminpanelAction extends AdminPanelAction
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function showForm()
|
||||
{
|
||||
$form = new TwitterAdminPanelForm($this);
|
||||
@ -83,7 +79,6 @@ class TwitteradminpanelAction extends AdminPanelAction
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function saveSettings()
|
||||
{
|
||||
static $settings = array(
|
||||
@ -173,7 +168,6 @@ class TwitterAdminPanelForm extends AdminForm
|
||||
*
|
||||
* @return int ID of the form
|
||||
*/
|
||||
|
||||
function id()
|
||||
{
|
||||
return 'twitteradminpanel';
|
||||
@ -184,7 +178,6 @@ class TwitterAdminPanelForm extends AdminForm
|
||||
*
|
||||
* @return string class of the form
|
||||
*/
|
||||
|
||||
function formClass()
|
||||
{
|
||||
return 'form_settings';
|
||||
@ -195,7 +188,6 @@ class TwitterAdminPanelForm extends AdminForm
|
||||
*
|
||||
* @return string URL of the action
|
||||
*/
|
||||
|
||||
function action()
|
||||
{
|
||||
return common_local_url('twitteradminpanel');
|
||||
@ -206,7 +198,6 @@ class TwitterAdminPanelForm extends AdminForm
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function formData()
|
||||
{
|
||||
$this->out->elementStart(
|
||||
@ -239,7 +230,7 @@ class TwitterAdminPanelForm extends AdminForm
|
||||
|
||||
if (!empty($globalConsumerKey) && !empty($globalConsumerSec)) {
|
||||
$this->li();
|
||||
$this->out->element('p', 'form_guide', _('Note: a global consumer key and secret are set.'));
|
||||
$this->out->element('p', 'form_guide', _m('Note: a global consumer key and secret are set.'));
|
||||
$this->unli();
|
||||
}
|
||||
|
||||
@ -292,9 +283,8 @@ class TwitterAdminPanelForm extends AdminForm
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function formActions()
|
||||
{
|
||||
$this->out->submit('submit', _('Save'), 'submit', null, _('Save Twitter settings'));
|
||||
$this->out->submit('submit', _m('Save'), 'submit', null, _m('Save Twitter settings'));
|
||||
}
|
||||
}
|
||||
|
@ -117,13 +117,13 @@ class TwitterauthorizationAction extends Action
|
||||
$token = $this->trimmed('token');
|
||||
|
||||
if (!$token || $token != common_session_token()) {
|
||||
$this->showForm(_('There was a problem with your session token. Try again, please.'));
|
||||
$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(_('You can\'t register if you don\'t agree to the license.'),
|
||||
$this->showForm(_m('You can\'t register if you don\'t agree to the license.'),
|
||||
$this->trimmed('newname'));
|
||||
return;
|
||||
}
|
||||
@ -132,7 +132,7 @@ class TwitterauthorizationAction extends Action
|
||||
$this->connectNewUser();
|
||||
} else {
|
||||
common_debug('Twitter bridge - ' . print_r($this->args, true));
|
||||
$this->showForm(_('Something weird happened.'),
|
||||
$this->showForm(_m('Something weird happened.'),
|
||||
$this->trimmed('newname'));
|
||||
}
|
||||
} else {
|
||||
@ -231,7 +231,6 @@ class TwitterauthorizationAction extends Action
|
||||
}
|
||||
|
||||
if (common_logged_in()) {
|
||||
|
||||
// Save the access token and Twitter user info
|
||||
|
||||
$user = common_current_user();
|
||||
@ -298,7 +297,7 @@ class TwitterauthorizationAction extends Action
|
||||
|
||||
if (empty($flink_id)) {
|
||||
common_log_db_error($flink, 'INSERT', __FILE__);
|
||||
$this->serverError(_('Couldn\'t link your Twitter account.'));
|
||||
$this->serverError(_m('Couldn\'t link your Twitter account.'));
|
||||
}
|
||||
|
||||
return $flink_id;
|
||||
@ -310,13 +309,13 @@ class TwitterauthorizationAction extends Action
|
||||
$this->element('div', array('class' => 'error'), $this->error);
|
||||
} else {
|
||||
$this->element('div', 'instructions',
|
||||
sprintf(_('This is the first time you\'ve logged into %s so we must connect your Twitter account 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')));
|
||||
sprintf(_m('This is the first time you\'ve logged into %s so we must connect your Twitter account 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()
|
||||
{
|
||||
return _('Twitter Account Setup');
|
||||
return _m('Twitter Account Setup');
|
||||
}
|
||||
|
||||
function showForm($error=null, $username=null)
|
||||
@ -349,7 +348,7 @@ class TwitterauthorizationAction extends Action
|
||||
'class' => 'form_settings',
|
||||
'action' => common_local_url('twitterauthorization')));
|
||||
$this->elementStart('fieldset', array('id' => 'settings_twitter_connect_options'));
|
||||
$this->element('legend', null, _('Connection options'));
|
||||
$this->element('legend', null, _m('Connection options'));
|
||||
$this->elementStart('ul', 'form_data');
|
||||
$this->elementStart('li');
|
||||
$this->element('input', array('type' => 'checkbox',
|
||||
@ -358,7 +357,7 @@ class TwitterauthorizationAction extends Action
|
||||
'name' => 'license',
|
||||
'value' => 'true'));
|
||||
$this->elementStart('label', array('class' => 'checkbox', 'for' => 'license'));
|
||||
$message = _('My text and files are available under %s ' .
|
||||
$message = _m('My text and files are available under %s ' .
|
||||
'except this private data: password, ' .
|
||||
'email address, IM address, and phone number.');
|
||||
$link = '<a href="' .
|
||||
@ -379,33 +378,33 @@ class TwitterauthorizationAction extends Action
|
||||
$this->elementStart('fieldset');
|
||||
$this->hidden('token', common_session_token());
|
||||
$this->element('legend', null,
|
||||
_('Create new account'));
|
||||
_m('Create new account'));
|
||||
$this->element('p', null,
|
||||
_('Create a new user with this nickname.'));
|
||||
_m('Create a new user with this nickname.'));
|
||||
$this->elementStart('ul', 'form_data');
|
||||
$this->elementStart('li');
|
||||
$this->input('newname', _('New nickname'),
|
||||
$this->input('newname', _m('New nickname'),
|
||||
($this->username) ? $this->username : '',
|
||||
_('1-64 lowercase letters or numbers, no punctuation or spaces'));
|
||||
_m('1-64 lowercase letters or numbers, no punctuation or spaces'));
|
||||
$this->elementEnd('li');
|
||||
$this->elementEnd('ul');
|
||||
$this->submit('create', _('Create'));
|
||||
$this->submit('create', _m('Create'));
|
||||
$this->elementEnd('fieldset');
|
||||
|
||||
$this->elementStart('fieldset');
|
||||
$this->element('legend', null,
|
||||
_('Connect existing account'));
|
||||
_m('Connect existing account'));
|
||||
$this->element('p', null,
|
||||
_('If you already have an account, login with your username and password to connect it to your Twitter account.'));
|
||||
_m('If you already have an account, login with your username and password to connect it to your Twitter account.'));
|
||||
$this->elementStart('ul', 'form_data');
|
||||
$this->elementStart('li');
|
||||
$this->input('nickname', _('Existing nickname'));
|
||||
$this->input('nickname', _m('Existing nickname'));
|
||||
$this->elementEnd('li');
|
||||
$this->elementStart('li');
|
||||
$this->password('password', _('Password'));
|
||||
$this->password('password', _m('Password'));
|
||||
$this->elementEnd('li');
|
||||
$this->elementEnd('ul');
|
||||
$this->submit('connect', _('Connect'));
|
||||
$this->submit('connect', _m('Connect'));
|
||||
$this->elementEnd('fieldset');
|
||||
|
||||
$this->elementEnd('fieldset');
|
||||
@ -421,7 +420,7 @@ class TwitterauthorizationAction extends Action
|
||||
function createNewUser()
|
||||
{
|
||||
if (common_config('site', 'closed')) {
|
||||
$this->clientError(_('Registration not allowed.'));
|
||||
$this->clientError(_m('Registration not allowed.'));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -430,14 +429,14 @@ class TwitterauthorizationAction extends Action
|
||||
if (common_config('site', 'inviteonly')) {
|
||||
$code = $_SESSION['invitecode'];
|
||||
if (empty($code)) {
|
||||
$this->clientError(_('Registration not allowed.'));
|
||||
$this->clientError(_m('Registration not allowed.'));
|
||||
return;
|
||||
}
|
||||
|
||||
$invite = Invitation::staticGet($code);
|
||||
|
||||
if (empty($invite)) {
|
||||
$this->clientError(_('Not a valid invitation code.'));
|
||||
$this->clientError(_m('Not a valid invitation code.'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -447,17 +446,17 @@ class TwitterauthorizationAction extends Action
|
||||
if (!Validate::string($nickname, array('min_length' => 1,
|
||||
'max_length' => 64,
|
||||
'format' => NICKNAME_FMT))) {
|
||||
$this->showForm(_('Nickname must have only lowercase letters and numbers and no spaces.'));
|
||||
$this->showForm(_m('Nickname must have only lowercase letters and numbers and no spaces.'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!User::allowed_nickname($nickname)) {
|
||||
$this->showForm(_('Nickname not allowed.'));
|
||||
$this->showForm(_m('Nickname not allowed.'));
|
||||
return;
|
||||
}
|
||||
|
||||
if (User::staticGet('nickname', $nickname)) {
|
||||
$this->showForm(_('Nickname already in use. Try another one.'));
|
||||
$this->showForm(_m('Nickname already in use. Try another one.'));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -472,7 +471,7 @@ class TwitterauthorizationAction extends Action
|
||||
$user = User::register($args);
|
||||
|
||||
if (empty($user)) {
|
||||
$this->serverError(_('Error registering user.'));
|
||||
$this->serverError(_m('Error registering user.'));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -483,7 +482,7 @@ class TwitterauthorizationAction extends Action
|
||||
save_twitter_user($this->twuid, $this->tw_fields['screen_name']);
|
||||
|
||||
if (!$result) {
|
||||
$this->serverError(_('Error connecting user to Twitter.'));
|
||||
$this->serverError(_m('Error connecting user to Twitter.'));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -503,7 +502,7 @@ class TwitterauthorizationAction extends Action
|
||||
$password = $this->trimmed('password');
|
||||
|
||||
if (!common_check_user($nickname, $password)) {
|
||||
$this->showForm(_('Invalid username or password.'));
|
||||
$this->showForm(_m('Invalid username or password.'));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -521,7 +520,7 @@ class TwitterauthorizationAction extends Action
|
||||
save_twitter_user($this->twuid, $this->tw_fields['screen_name']);
|
||||
|
||||
if (!$result) {
|
||||
$this->serverError(_('Error connecting user to Twitter.'));
|
||||
$this->serverError(_m('Error connecting user to Twitter.'));
|
||||
return;
|
||||
}
|
||||
|
||||
@ -541,7 +540,7 @@ class TwitterauthorizationAction extends Action
|
||||
$result = $this->flinkUser($user->id, $this->twuid);
|
||||
|
||||
if (empty($result)) {
|
||||
$this->serverError(_('Error connecting user to Twitter.'));
|
||||
$this->serverError(_m('Error connecting user to Twitter.'));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -46,7 +46,6 @@ require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
|
||||
*
|
||||
* @see SettingsAction
|
||||
*/
|
||||
|
||||
class TwitterloginAction extends Action
|
||||
{
|
||||
function handle($args)
|
||||
@ -54,7 +53,7 @@ class TwitterloginAction extends Action
|
||||
parent::handle($args);
|
||||
|
||||
if (common_is_real_login()) {
|
||||
$this->clientError(_('Already logged in.'));
|
||||
$this->clientError(_m('Already logged in.'));
|
||||
}
|
||||
|
||||
$this->showPage();
|
||||
@ -62,12 +61,12 @@ class TwitterloginAction extends Action
|
||||
|
||||
function title()
|
||||
{
|
||||
return _('Twitter Login');
|
||||
return _m('Twitter Login');
|
||||
}
|
||||
|
||||
function getInstructions()
|
||||
{
|
||||
return _('Login with your Twitter account');
|
||||
return _m('Login with your Twitter account');
|
||||
}
|
||||
|
||||
function showPageNotice()
|
||||
@ -85,7 +84,7 @@ class TwitterloginAction extends Action
|
||||
null,
|
||||
array('signin' => true))));
|
||||
$this->element('img', array('src' => common_path('plugins/TwitterBridge/Sign-in-with-Twitter-lighter.png'),
|
||||
'alt' => 'Sign in with Twitter'));
|
||||
'alt' => _m('Sign in with Twitter')));
|
||||
$this->elementEnd('a');
|
||||
}
|
||||
|
||||
|
@ -200,7 +200,6 @@ class TwitterOAuthClient extends OAuthClient
|
||||
function statusesHomeTimeline($since_id = null, $max_id = null,
|
||||
$cnt = null, $page = null)
|
||||
{
|
||||
|
||||
$url = 'https://twitter.com/statuses/home_timeline.json';
|
||||
|
||||
$params = array('include_entities' => 'true');
|
||||
|
@ -45,7 +45,6 @@ require_once INSTALLDIR . '/plugins/TwitterBridge/twitter.php';
|
||||
*
|
||||
* @see SettingsAction
|
||||
*/
|
||||
|
||||
class TwittersettingsAction extends ConnectSettingsAction
|
||||
{
|
||||
/**
|
||||
@ -79,7 +78,6 @@ class TwittersettingsAction extends ConnectSettingsAction
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function showContent()
|
||||
{
|
||||
|
||||
@ -139,7 +137,7 @@ class TwittersettingsAction extends ConnectSettingsAction
|
||||
$this->text(_m(' first.'));
|
||||
$this->elementEnd('p');
|
||||
} else {
|
||||
|
||||
// TRANS: %1$s is the current website name.
|
||||
$note = _m('Keep your %1$s account but disconnect from Twitter. ' .
|
||||
'You can use your %1$s password to log in.');
|
||||
|
||||
@ -219,7 +217,6 @@ class TwittersettingsAction extends ConnectSettingsAction
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function handlePost()
|
||||
{
|
||||
// CSRF protection
|
||||
@ -244,7 +241,6 @@ class TwittersettingsAction extends ConnectSettingsAction
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function removeTwitterAccount()
|
||||
{
|
||||
$user = common_current_user();
|
||||
@ -266,7 +262,6 @@ class TwittersettingsAction extends ConnectSettingsAction
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
function savePreferences()
|
||||
{
|
||||
$noticesend = $this->boolean('noticesend');
|
||||
@ -295,5 +290,4 @@ class TwittersettingsAction extends ConnectSettingsAction
|
||||
|
||||
$this->showForm(_m('Twitter preferences saved.'), true);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user