Merge branch 'pretty-title2' into 0.9.x
This commit is contained in:
commit
81e0653080
|
@ -63,23 +63,26 @@ class ShowstreamAction extends ProfileAction
|
||||||
|
|
||||||
function title()
|
function title()
|
||||||
{
|
{
|
||||||
if (!empty($this->profile->fullname)) {
|
$base = $this->profile->getFancyName();
|
||||||
$base = $this->profile->fullname . ' (' . $this->user->nickname . ') ';
|
|
||||||
} else {
|
|
||||||
$base = $this->user->nickname;
|
|
||||||
}
|
|
||||||
if (!empty($this->tag)) {
|
if (!empty($this->tag)) {
|
||||||
$base .= sprintf(_(' tagged %s'), $this->tag);
|
if ($this->page == 1) {
|
||||||
|
// TRANS: Page title showing tagged notices in one user's stream. Param 1 is the username, 2 is the hash tag.
|
||||||
|
return sprintf(_('%1$s tagged %2$s'), $base, $this->tag);
|
||||||
|
} else {
|
||||||
|
// TRANS: Page title showing tagged notices in one user's stream. Param 1 is the username, 2 is the hash tag, 3 is the page number.
|
||||||
|
return sprintf(_('%1$s tagged %2$s, page %3$d'), $base, $this->tag, $this->page);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
if ($this->page == 1) {
|
if ($this->page == 1) {
|
||||||
return $base;
|
return $base;
|
||||||
} else {
|
} else {
|
||||||
|
// TRANS: Extended page title showing tagged notices in one user's stream. Param 1 is the username, param 2 is the page number.
|
||||||
return sprintf(_('%1$s, page %2$d'),
|
return sprintf(_('%1$s, page %2$d'),
|
||||||
$base,
|
$base,
|
||||||
$this->page);
|
$this->page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function handle($args)
|
function handle($args)
|
||||||
{
|
{
|
||||||
|
|
|
@ -141,11 +141,32 @@ class Profile extends Memcached_DataObject
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets either the full name (if filled) or the nickname.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
function getBestName()
|
function getBestName()
|
||||||
{
|
{
|
||||||
return ($this->fullname) ? $this->fullname : $this->nickname;
|
return ($this->fullname) ? $this->fullname : $this->nickname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the full name (if filled) with nickname as a parenthetical, or the nickname alone
|
||||||
|
* if no fullname is provided.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function getFancyName()
|
||||||
|
{
|
||||||
|
if ($this->fullname) {
|
||||||
|
// TRANS: Full name of a profile or group followed by nickname in parens
|
||||||
|
return sprintf(_('%1$s (%2$s)'), $this->fullname, $this->nickname);
|
||||||
|
} else {
|
||||||
|
return $this->nickname;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the most recent notice posted by this user, if any.
|
* Get the most recent notice posted by this user, if any.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user