$this->elementStart('dd', null);
if (common_config('site', 'broughtby')) {
// TRANS: First sentence of the StatusNet site license. Used if 'broughtby' is set.
+ // TRANS: Text between [] is a link description, text between () is the link itself.
+ // TRANS: Make sure there is no whitespace between "]" and "(".
+ // TRANS: "%%site.broughtby%%" is the value of the variable site.broughtby
$instr = _('**%%site.name%%** is a microblogging service brought to you by [%%site.broughtby%%](%%site.broughtbyurl%%).');
} else {
// TRANS: First sentence of the StatusNet site license. Used if 'broughtby' is not set.
}
$instr .= ' ';
// TRANS: Second sentence of the StatusNet site license. Mentions the StatusNet source code license.
+ // TRANS: Make sure there is no whitespace between "]" and "(".
+ // TRANS: Text between [] is a link description, text between () is the link itself.
+ // TRANS: %s is the version of StatusNet that is being used.
$instr .= sprintf(_('It runs the [StatusNet](http://status.net/) microblogging software, version %s, available under the [GNU Affero General Public License](http://www.fsf.org/licensing/licenses/agpl-3.0.html).'), STATUSNET_VERSION);
$output = common_markup_to_html($instr);
$this->raw($output);
'width' => '80',
'height' => '15'));
$this->text(' ');
- // TRANS: license message in footer. %1$s is the site name, %2$s is a link to the license URL, with a licence name set in configuration.
+ // TRANS: license message in footer.
+ // TRANS: %1$s is the site name, %2$s is a link to the license URL, with a licence name set in configuration.
$notice = _('All %1$s content and data are available under the %2$s license.');
$link = "<a class=\"license\" rel=\"external license\" href=\"" .
htmlspecialchars(common_config('license', 'url')) .
// CSRF protection
$token = $this->trimmed('token');
if (empty($token) || $token != common_session_token()) {
+ // TRANS: Client error text when there is a problem with the session token.
$this->clientError(_('There was a problem with your session token.'));
}
}
return ActivityUtils::child($element, $tag, $namespace);
}
}
-
$attention = array();
for ($i = 0; $i < $links->length; $i++) {
-
$link = $links->item($i);
$linkRel = $link->getAttribute(ActivityUtils::REL);
ActivityObject::MEDIA_DESCRIPTION,
Activity::MEDIA
);
-
}
}
);
foreach ($sizes as $size) {
-
$alink = null;
$avatar = $profile->getAvatar($size);
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/
*/
-
class ActivityUtils
{
const ATOM = 'http://www.w3.org/2005/Atom';
*
* @return string related link, if any
*/
-
static function getPermalink($element)
{
return self::getLink($element, 'alternate', 'text/html');
*
* @return string related link, if any
*/
-
static function getLink(DOMNode $element, $rel, $type=null)
{
$els = $element->childNodes;
*
* @return DOMElement found element or null
*/
-
static function child(DOMNode $element, $tag, $namespace=self::ATOM)
{
$els = $element->childNodes;
*
* @return string content of the child
*/
-
static function childContent(DOMNode $element, $tag, $namespace=self::ATOM)
{
$el = self::child($element, $tag, $namespace);
* @todo handle embedded XML mime types
* @todo handle base64-encoded non-XML and non-text mime types
*/
-
static function getContent($element)
{
return self::childHtmlContent($element, self::CONTENT, self::ATOM);
$src = $el->getAttribute(self::SRC);
if (!empty($src)) {
+ // TRANS: Client exception thrown when there is no source attribute.
throw new ClientException(_("Can't handle remote content yet."));
}
return trim($text);
} else if (in_array($type, array('text/xml', 'application/xml')) ||
preg_match('#(+|/)xml$#', $type)) {
+ // TRANS: Client exception thrown when there embedded XML content is found that cannot be processed yet.
throw new ClientException(_("Can't handle embedded XML content yet."));
} else if (strncasecmp($type, 'text/', 5)) {
return $el->textContent;
} else {
+ // TRANS: Client exception thrown when base64 encoded content is found that cannot be processed yet.
throw new ClientException(_("Can't handle embedded Base64 content yet."));
}
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
* @link http://status.net/
*/
-
class ActivityVerb
{
const POST = 'http://activitystrea.ms/schema/1.0/post';
*
* @see Form
*/
-
class AdminForm extends Form
{
/**
*
* @return void
*/
-
function input($setting, $title, $instructions, $section='site')
{
$this->out->input($setting, $title, $this->value($setting, $section), $instructions);
*
* @return string param value if posted, or current config value
*/
-
function value($setting, $main='site')
{
$value = $this->out->trimmed($setting);
*
* @todo Find some commonalities with SettingsAction and combine
*/
-
class AdminPanelAction extends Action
{
var $success = true;
*
* @return boolean success flag
*/
-
function prepare($args)
{
parent::prepare($args);
*
* @return void
*/
-
function handle($args)
{
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
* @return void
* @see AdminPanelNav
*/
-
function showLocalNav()
{
$nav = new AdminPanelNav($this);
*
* @return void.
*/
-
function showContent()
{
$this->showForm();
*
* @return void
*/
-
function showPageNotice()
{
if ($this->msg) {
*
* @return void
*/
-
function showForm()
{
// TRANS: Client error message.
*
* @return void
*/
-
function getInstructions()
{
return '';
*
* @return void
*/
-
function saveSettings()
{
// TRANS: Client error message
*
* @return mixed $result false if something didn't work
*/
-
function deleteSetting($section, $setting)
{
$config = new Config();
*
* @see Widget
*/
-
class AdminPanelNav extends Widget
{
var $action = null;
*
* @param Action $action current action, used for output
*/
-
function __construct($action=null)
{
parent::__construct($action);
*
* @return void
*/
-
function show()
{
$action_name = $this->action->trimmed('action');
}
$this->action->elementEnd('ul');
}
-
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class ApiAction extends Action
{
const READ_ONLY = 1;
*
* @return boolean false if user doesn't exist
*/
-
function prepare($args)
{
StatusNet::setApi(true); // reduce exception reports to aid in debugging
*
* @return void
*/
-
function handle($args)
{
header('Access-Control-Allow-Origin: *');
}
$this->endDocument('atom');
-
}
function showRssGroups($group, $title, $link, $subtitle)
function showAtomGroups($group, $title, $id, $link, $subtitle=null, $selfuri=null)
{
-
$this->initDocument('atom');
$this->element('title', null, common_xml_safe_str($title));
function showJsonTimeline($notice)
{
-
$this->initDocument('json');
$statuses = array();
function showJsonGroups($group)
{
-
$this->initDocument('json');
$groups = array();
function showTwitterXmlUsers($user)
{
-
$this->initDocument('xml');
$this->elementStart('users', array('type' => 'array',
'xmlns:statusnet' => 'http://status.net/schema/api/1/'));
function showJsonUsers($user)
{
-
$this->initDocument('json');
$users = array();
$this->endXML();
break;
case 'json':
-
// Check for JSONP callback
if (isset($this->callback)) {
print ')';
*/
function arg($key, $def=null)
{
-
// XXX: Do even more input validation/scrubbing?
if (array_key_exists($key, $this->args)) {
return $uri;
}
-
}
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
-
class ApiAuthAction extends ApiAction
{
var $auth_user_nickname = null;
* @return boolean success flag
*
*/
-
function prepare($args)
{
parent::prepare($args);
*
* @return mixed the OAuthRequest or false
*/
-
function getOAuthRequest()
{
ApiOauthAction::cleanRequest();
*
* @return nothing
*/
-
function checkOAuthRequest($request)
{
$datastore = new ApiStatusNetOAuthDataStore();
$server->add_signature_method($hmac_method);
try {
-
$server->verify_request($request);
$consumer = $request->get_parameter('oauth_consumer_key');
common_log(LOG_WARNING,
'Couldn\'t find the OAuth app for consumer key: ' .
$consumer);
- throw new OAuthException('No application for that consumer key.');
+ // TRANS: OAuth exception thrown when no application is found for a given consumer key.
+ throw new OAuthException(_('No application for that consumer key.'));
}
// set the source attr
$appUser = Oauth_application_user::staticGet('token', $access_token);
if (!empty($appUser)) {
-
// If access_type == 0 we have either a request token
// or a bad / revoked access token
if ($appUser->access_type != 0) {
-
// Set the access level for the api call
-
$this->access = ($appUser->access_type & Oauth_application::$writeAccess)
? self::READ_WRITE : self::READ_ONLY;
// Set the auth user
-
if (Event::handle('StartSetApiUser', array(&$user))) {
$this->auth_user = User::staticGet('id', $appUser->profile_id);
Event::handle('EndSetApiUser', array($user));
'read-write' : 'read-only'
));
} else {
- throw new OAuthException('Bad access token.');
+ // TRANS: OAuth exception given when an incorrect access token was given for a user.
+ throw new OAuthException(_('Bad access token.'));
}
} else {
-
// Also should not happen
-
- throw new OAuthException('No user for that token.');
+ // TRANS: OAuth exception given when no user was found for a given token (no token was found).
+ throw new OAuthException(_('No user for that token.'));
}
} catch (OAuthException $e) {
*
* @return boolean true
*/
-
function requiresAuth()
{
return true;
*
* @return boolean true or false
*/
-
function checkBasicAuthUser($required = true)
{
$this->basicAuthProcessHeader();
header('WWW-Authenticate: Basic realm="' . $realm . '"');
// show error if the user clicks 'cancel'
-
- $this->clientError("Could not authenticate you.", 401, $this->format);
+ // TRANS: Client error thrown when authentication fails becaus a user clicked "Cancel".
+ $this->clientError(_("Could not authenticate you."), 401, $this->format);
exit;
} else {
}
// By default, basic auth users have rw access
-
$this->access = self::READ_WRITE;
if (empty($this->auth_user) && ($required || isset($_SERVER['PHP_AUTH_USER']))) {
// basic authentication failed
-
list($proxy, $ip) = common_client_ip();
$msg = sprintf( 'Failed API auth attempt, nickname = %1$s, ' .
$proxy,
$ip);
common_log(LOG_WARNING, $msg);
- $this->clientError("Could not authenticate you.", 401, $this->format);
+ // TRANS: Client error thrown when authentication fails.
+ $this->clientError(_("Could not authenticate you."), 401, $this->format);
exit;
}
}
*
* @return void
*/
-
function basicAuthProcessHeader()
{
$authHeaders = array('AUTHORIZATION',
// Decode the HTTP_AUTHORIZATION header on php-cgi server self
// on fcgid server the header name is AUTHORIZATION
-
$auth_hash = base64_decode(substr($authorization_header, 6));
list($this->auth_user_nickname,
$this->auth_user_password) = explode(':', $auth_hash);
function title()
{
+ // TRANS: Title.
return _('Notices where this attachment appears');
}
{
function title()
{
+ // TRANS: Title.
return _('Tags for this attachment');
}