We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 0a17e7cf authored by Evan Prodromou's avatar Evan Prodromou

Merge remote-tracking branch 'gitorious/1.0.x' into 1.0.x

Conflicts:
	classes/Memcached_DataObject.php
parents ff656a8b 83c988e1
......@@ -4,7 +4,7 @@
* Copyright (C) 2011, StatusNet, Inc.
*
* Show a stream of notices in a particular conversation
*
*
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
......@@ -46,12 +46,11 @@ require_once INSTALLDIR . '/lib/apiauth.php';
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
class ApiconversationAction extends ApiAuthAction
{
protected $conversation = null;
protected $notices = null;
protected $conversation = null;
protected $notices = null;
/**
* For initializing members of the class.
*
......@@ -59,35 +58,36 @@ class ApiconversationAction extends ApiAuthAction
*
* @return boolean true
*/
function prepare($argarray)
{
parent::prepare($argarray);
$convId = $this->trimmed('id');
if (empty($convId)) {
throw new ClientException(_m('no conversation id'));
// TRANS: Client exception thrown when no conversation ID is given.
throw new ClientException(_('No conversation ID.'));
}
$this->conversation = Conversation::staticGet('id', $convId);
if (empty($this->conversation)) {
throw new ClientException(sprintf(_m('No conversation with id %d'), $convId),
404);
// TRANS: Client exception thrown when referring to a non-existing conversation ID (%d).
throw new ClientException(sprintf(_('No conversation with ID %d.'), $convId),
404);
}
$profile = Profile::current();
$stream = new ConversationNoticeStream($convId, $profile);
$notice = $stream->getNotices(($this->page-1) * $this->count,
$this->count,
$this->since_id,
$this->max_id);
$this->notices = $notice->fetchAll();
return true;
}
......@@ -98,17 +98,16 @@ class ApiconversationAction extends ApiAuthAction
*
* @return void
*/
function handle($argarray=null)
{
$sitename = common_config('site', 'name');
// TRANS: Timeline title for user and friends. %s is a user nickname.
$title = _("Conversation");
// TRANS: Title for conversion timeline.
$title = _m('TITLE', 'Conversation');
$id = common_local_url('apiconversation', array('id' => $this->conversation->id, 'format' => $this->format));
$link = common_local_url('conversation', array('id' => $this->conversation->id));
$self = $id;
switch($this->format) {
case 'xml':
$this->showXmlTimeline($this->notices);
......@@ -168,7 +167,6 @@ class ApiconversationAction extends ApiAuthAction
*
* @return boolean is read only action?
*/
function isReadOnly($args)
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
......@@ -202,7 +200,6 @@ class ApiconversationAction extends ApiAuthAction
*
* @return string etag http header
*/
function etag()
{
if (!empty($this->notices) && (count($this->notices) > 0)) {
......@@ -220,7 +217,7 @@ class ApiconversationAction extends ApiAuthAction
)
. '"';
}
return null;
}
......@@ -229,7 +226,6 @@ class ApiconversationAction extends ApiAuthAction
*
* @return boolean true if delete, else false
*/
function requiresAuth()
{
if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
......@@ -239,4 +235,4 @@ class ApiconversationAction extends ApiAuthAction
return true;
}
}
}
\ No newline at end of file
}
......@@ -251,21 +251,24 @@ class ShowApplicationAction extends Action
$this->elementStart('div', 'entity_data');
// TRANS: Header on the OAuth application page.
$this->element('h2', null, _('Application info'));
$this->element('div',
'entity_consumer_key',
$consumer->consumer_key);
$this->element('div',
'entity_consumer_secret',
$consumer->consumer_secret);
$this->element('div',
'entity_request_token_url',
common_local_url('ApiOauthRequestToken'));
$this->element('div', 'entity_access_token_url', common_local_url('ApiOauthAccessToken'));
$this->element('div', 'entity_authorize_url', common_local_url('ApiOauthAuthorize'));
$this->elementStart('dl');
// TRANS: Field label on application page.
$this->element('dt', null, _('Consumer key'));
$this->element('dd', null, $consumer->consumer_key);
// TRANS: Field label on application page.
$this->element('dt', null, _('Consumer secret'));
$this->element('dd', null, $consumer->consumer_secret);
// TRANS: Field label on application page.
$this->element('dt', null, _('Request token URL'));
$this->element('dd', null, common_local_url('ApiOauthRequestToken'));
// TRANS: Field label on application page.
$this->element('dt', null, _('Access token URL'));
$this->element('dd', null, common_local_url('ApiOauthAccessToken'));
// TRANS: Field label on application page.
$this->element('dt', null, _('Authorize URL'));
$this->element('dd', null, common_local_url('ApiOauthAuthorize'));
$this->elementEnd('dl');
$this->element('p', 'note',
// TRANS: Note on the OAuth application page about signature support.
......
......@@ -63,44 +63,44 @@ class Memcached_DataObject extends Safe_DataObject
}
return $i;
}
/**
* Get multiple items from the database by key
*
*
* @param string $cls Class to fetch
* @param string $keyCol name of column for key
* @param array $keyVals key values to fetch
* @param boolean $skipNulls return only non-null results?
*
*
* @return array Array of objects, in order
*/
function multiGet($cls, $keyCol, $keyVals, $skipNulls=true)
{
$result = self::pivotGet($cls, $keyCol, $keyVals);
$values = array_values($result);
if ($skipNulls) {
$tmp = array();
foreach ($values as $value) {
if (!empty($value)) {
$tmp[] = $value;
}
}
$values = $tmp;
}
return new ArrayWrapper($values);
$result = self::pivotGet($cls, $keyCol, $keyVals);
$values = array_values($result);
if ($skipNulls) {
$tmp = array();
foreach ($values as $value) {
if (!empty($value)) {
$tmp[] = $value;
}
}
$values = $tmp;
}
return new ArrayWrapper($values);
}
/**
* Get multiple items from the database by key
*
*
* @param string $cls Class to fetch
* @param string $keyCol name of column for key
* @param array $keyVals key values to fetch
* @param boolean $otherCols Other columns to hold fixed
*
*
* @return array Array mapping $keyVals to objects, or null if not found
*/
static function pivotGet($cls, $keyCol, $keyVals, $otherCols = array())
......@@ -346,7 +346,7 @@ class Memcached_DataObject extends Safe_DataObject
}
/**
* @fixme Should this return false on lookup fail to match staticGet?
* @todo FIXME: Should this return false on lookup fail to match staticGet?
*/
function pkeyGet($cls, $kv)
{
......@@ -359,13 +359,13 @@ class Memcached_DataObject extends Safe_DataObject
return false;
}
foreach ($kv as $k => $v) {
if (is_null($v)) {
// XXX: possible SQL injection...? Don't
// pass keys from the browser, eh.
$i->whereAdd("$k is null");
} else {
$i->$k = $v;
}
if (is_null($v)) {
// XXX: possible SQL injection...? Don't
// pass keys from the browser, eh.
$i->whereAdd("$k is null");
} else {
$i->$k = $v;
}
}
if ($i->find(true)) {
$i->encache();
......@@ -696,7 +696,7 @@ class Memcached_DataObject extends Safe_DataObject
continue;
}
if (in_array($func, $ignoreStatic)) {
continue; // @fixme this shouldn't be needed?
continue; // @todo FIXME: This shouldn't be needed?
}
$here = get_class($frame['object']) . '->' . $func;
break;
......@@ -839,7 +839,7 @@ class Memcached_DataObject extends Safe_DataObject
if (!$dsn) {
// TRANS: Exception thrown when database name or Data Source Name could not be found.
throw new Exception(_("No database name or DSN found anywhere."));
throw new Exception(_('No database name or DSN found anywhere.'));
}
return $dsn;
......
......@@ -136,7 +136,7 @@ class FavorForm extends Form
'submit',
null,
// TRANS: Button title for adding the favourite status to a notice.
_('Add this notice to your list of favorite notices.');
_('Add this notice to your list of favorite notices.'));
}
/**
......
......@@ -84,8 +84,10 @@ class GroupsNav extends MoreMenu
function seeAllItem() {
return array('usergroups',
array('nickname' => $this->user->nickname),
// TRANS: Link description for seeing all groups.
_('See all'),
_('See all groups you belong to'));
// TRANS: Link title for seeing all groups.
_('See all groups you belong to.'));
}
}
......@@ -58,11 +58,11 @@ class ListsNav extends MoreMenu
{
return 'lists';
}
function getItems()
{
$items = array();
while ($this->lists->fetch()) {
$mode = $this->lists->private ? 'private' : 'public';
$items[] = array('showprofiletag',
......@@ -84,7 +84,9 @@ class ListsNav extends MoreMenu
{
return array('peopletagsbyuser',
array('nickname' => $this->profile->nickname),
// TRANS: Link description for seeing all lists.
_('See all'),
_('See all lists you have created'));
// TRANS: Link title for seeing all lists.
_('See all lists you have created.'));
}
}
......@@ -4,7 +4,7 @@
* Copyright (C) 2011, StatusNet, Inc.
*
* A menu with a More... button to show more elements
*
*
* PHP version 5
*
* This program is free software: you can redistribute it and/or modify
......@@ -44,12 +44,11 @@ if (!defined('STATUSNET')) {
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0
* @link http://status.net/
*/
class MoreMenu extends Menu
{
const SOFT_MAX = 5;
const HARD_MAX = 15;
/**
* Show a menu with a limited number of elements
*
......@@ -57,7 +56,6 @@ class MoreMenu extends Menu
*
* @return
*/
function show()
{
$items = $this->getItems();
......@@ -72,7 +70,6 @@ class MoreMenu extends Menu
}
if (Event::handle('StartNav', array($this, &$tag, &$items))) {
$this->out->elementStart('ul', $attrs);
$total = count($items);
......@@ -89,10 +86,10 @@ class MoreMenu extends Menu
}
if ($total > self::SOFT_MAX + 1) {
$this->out->elementStart('li', array('class' => 'more_link'));
$this->out->element('a', array('href' => '#',
'onclick' => 'SN.U.showMoreMenuItems("'.$menuID.'"); return false;'),
// TRANS: Link description to show more items in a list.
_('More ▼'));
$this->out->elementEnd('li');
......@@ -112,7 +109,7 @@ class MoreMenu extends Menu
}
}
}
$this->out->elementEnd('ul');
Event::handle('EndNav', array($this, $tag, $items));
......@@ -123,5 +120,4 @@ class MoreMenu extends Menu
{
return null;
}
}
......@@ -15,19 +15,19 @@ msgid ""
msgstr ""
"Project-Id-Version: StatusNet - Core\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2011-08-15 14:19+0000\n"
"PO-Revision-Date: 2011-08-15 14:21:37+0000\n"
"POT-Creation-Date: 2011-08-20 18:34+0000\n"
"PO-Revision-Date: 2011-08-20 18:36:16+0000\n"
"Language-Team: Arabic <//translatewiki.net/wiki/Portal:ar>\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: MediaWiki 1.19alpha (r94516); Translate extension (2011-07-09)\n"
"X-Generator: MediaWiki 1.19alpha (r95098); Translate extension (2011-07-09)\n"
"X-Translation-Project: translatewiki.net at //translatewiki.net\n"
"X-Language-Code: ar\n"
"X-Message-Group: #out-statusnet-core\n"
"Plural-Forms: nplurals=6; plural=(n == 0) ? 0 : ( (n == 1) ? 1 : ( (n == "
"2) ? 2 : ( (n%100 >= 3 && n%100 <= 10) ? 3 : ( (n%100 >= 11 && n%100 <= "
"99) ? 4 : 5 ) ) ) );\n"
"X-POT-Import-Date: 2011-07-21 13:51:19+0000\n"
"X-POT-Import-Date: 2011-08-16 06:58:31+0000\n"
#. TRANS: Database error message.
#, php-format
......@@ -71,7 +71,7 @@ msgstr "تسجيل"
#. TRANS: Checkbox instructions for admin setting "Private".
msgid "Prohibit anonymous users (not logged in) from viewing site?"
msgstr "أأمنع المستخدمين المجهولين (غير الوالجين) من عرض الموقع؟"
msgstr "أأمنع المستخدمين المجهولين (غير الوالجين) من مشاهدة الموقع؟"
#. TRANS: Checkbox label for prohibiting anonymous users from viewing site.
#. TRANS: Checkbox label to show private tags.
......@@ -96,11 +96,12 @@ msgstr "عطّل التسجيل الجديد."
msgid "Closed"
msgstr "مُغلق"
#. TRANS: Title for button to save access settings in site admin panel.
msgid "Save access settings"
#. TRANS: Button title to save access settings in site admin panel.
#, fuzzy
msgid "Save access settings."
msgstr "حفظ إعدادت الوصول"
#. TRANS: Tooltip for button to save access settings in site admin panel.
#. TRANS: Button text to save access settings in site admin panel.
#. TRANS: Button label to save e-mail preferences.
#. TRANS: Button label to save IM preferences.
#. TRANS: Button text in the license admin panel.
......@@ -429,16 +430,19 @@ msgstr "فشل منع المستخدم."
msgid "Unblock user failed."
msgstr "فشل إلغاء منع المستخدم."
#. TRANS: Client exception thrown when no conversation ID is given.
#, fuzzy
msgid "no conversation id"
msgid "No conversation ID."
msgstr "محادثة"
#, php-format
msgid "No conversation with id %d"
msgstr ""
#. TRANS: Client exception thrown when referring to a non-existing conversation ID (%d).
#, fuzzy, php-format
msgid "No conversation with ID %d."
msgstr "محادثة"
#. TRANS: Timeline title for user and friends. %s is a user nickname.
#. TRANS: Title for page with a conversion (multiple notices in context).
#, fuzzy
msgctxt "TITLE"
msgid "Conversation"
msgstr "محادثة"
......@@ -1717,6 +1721,10 @@ msgstr "أكد العنوان"
msgid "The address \"%s\" has been confirmed for your account."
msgstr "لقد تم التأكد من عنوان حسابك \"%s\"."
#. TRANS: Title for page with a conversion (multiple notices in context).
msgid "Conversation"
msgstr "محادثة"
#. TRANS: Title for link to notice feed.
#. TRANS: %s is a user nickname.
msgid "Conversation feed (Activity Streams JSON)"
......@@ -1787,7 +1795,8 @@ msgid "Enter \"%s\" to confirm that you want to delete your account."
msgstr "أدخل \"%s\" لتأكيد رغبتك في حذف حسابك."
#. TRANS: Button title for user account deletion.
msgid "Permanently delete your account"
#, fuzzy
msgid "Permanently delete your account."
msgstr "احذف حسابك إلى الأبد"
#. TRANS: Client error displayed trying to delete an application while not logged in.
......@@ -1932,7 +1941,7 @@ msgstr "احذف هذا المستخدم."
#. TRANS: Client error displayed when trying to remove favorite status for a notice that is not a favorite.
msgid "This notice is not a favorite!"
msgstr "هذا الشعار ليس مفضلًا!"
msgstr "هذا الإشعار ليس مفضلًا!"
#. TRANS: Title for page on which favorites can be added.
msgid "Add to favorites"
......@@ -2311,7 +2320,7 @@ msgstr "لا عنوان بريد إلكتروني وارد."
#. TRANS: Client error displayed when trying to mark a notice as favorite that already is a favorite.
msgid "This notice is already a favorite!"
msgstr "هذا الإشعار مفضلة مسبقًا!"
msgstr "هذا الإشعار مفضل سابقا!"
#. TRANS: Page title for page on which favorite notices can be unfavourited.
msgid "Disfavor favorite."
......@@ -2371,7 +2380,7 @@ msgstr "المستجدات التي فضلها %1$s في %2$s!"
#. TRANS: Title for featured users section.
#. TRANS: Menu item title in search group navigation panel.
msgid "Featured users"
msgstr "مستخدمون مختارون"
msgstr "مستخدمون مميزون"
#. TRANS: Page title for all but first page of featured users.
#. TRANS: %d is the page number being displayed.
......@@ -2652,10 +2661,10 @@ msgstr "إعدادات المراسلة الفورية"
#. TRANS: Instant messaging settings page instructions.
#. TRANS: [instant messages] is link text, "(%%doc.im%%)" is the link.
#. TRANS: the order and formatting of link text and link should remain unchanged.
#, php-format
#, fuzzy, php-format
msgid ""
"You can send and receive notices through instant messaging [instant messages]"
"(%%doc.im%%). Configure your addresses and settings below."
"You can send and receive notices through [instant messaging](%%doc.im%%). "
"Configure your addresses and settings below."
msgstr ""
"يمكنك إرسال واستقبال الإشعارات عبر [المراسلة الفورية](%%doc.im%%). اضبط "
"عنوانك وإعدادتك أدناه."
......@@ -3651,8 +3660,9 @@ msgid "Server to direct SSL requests to."
msgstr "الخادوم الذي ستوجه طلبات SSL إليه."
#. TRANS: Button title text to store form data in the Paths admin panel.
msgid "Save paths"
msgstr "احفظ المسارات"
#, fuzzy
msgid "Save path settings."
msgstr "احفظ إعدادت الموقع."
#. TRANS: Instructions for the "People search" page.
#. TRANS: %%site.name%% is the name of the StatusNet site.
......@@ -4145,24 +4155,20 @@ msgid "Public timeline"
msgstr "المسار الزمني العام"
#. TRANS: Link description for public timeline feed.
#, fuzzy
msgid "Public Timeline Feed (Activity Streams JSON)"
msgstr "تغذية الردود على %s (آكتفتي ستريمز جيسن)"
msgstr "تغذية المسار الزمني العام (آكتفتي ستريمز جيسن)"
#. TRANS: Link description for public timeline feed.
#, fuzzy
msgid "Public Timeline Feed (RSS 1.0)"
msgstr "المسار الزمني العام، صفحة %d"
msgstr "تغذية المسار الزمني العام (آرإس​إس 1.0)"
#. TRANS: Link description for public timeline feed.
#, fuzzy
msgid "Public Timeline Feed (RSS 2.0)"
msgstr "المسار الزمني العام، صفحة %d"
msgstr "تغذية المسار الزمني العام (آرإس​إس 2.0)"
#. TRANS: Link description for public timeline feed.
#, fuzzy
msgid "Public Timeline Feed (Atom)"
msgstr "المسار الزمني العام، صفحة %d"