* @license http://www.fsf.org/licensing/licenses/agpl.html AGPLv3
* @link http://status.net/
*/
-
class HelloAction extends Action
{
var $user = null;
*
* @return boolean success flag
*/
-
function prepare($args)
{
parent::prepare($args);
*
* @return void
*/
-
function handle($args)
{
parent::handle($args);
*
* @return string Title of the page
*/
-
function title()
{
if (empty($this->user)) {
+ // TRANS: Page title for sample plugin.
return _m('Hello');
} else {
- return sprintf(_m('Hello, %s'), $this->user->nickname);
+ // TRANS: Page title for sample plugin. %s is a user nickname.
+ return sprintf(_m('Hello, %s!'), $this->user->nickname);
}
}
*
* @return void
*/
-
function showContent()
{
if (empty($this->user)) {
$this->element('p', array('class' => 'greeting'),
+ // TRANS: Message in sample plugin.
_m('Hello, stranger!'));
} else {
$this->element('p', array('class' => 'greeting'),
+ // TRANS: Message in sample plugin. %s is a user nickname.
sprintf(_m('Hello, %s'), $this->user->nickname));
$this->element('p', array('class' => 'greeting_count'),
+ // TRANS: Message in sample plugin.
+ // TRANS: %d is the number of times a user is greeted.
sprintf(_m('I have greeted you %d time.',
'I have greeted you %d times.',
$this->gc->greeting_count),
*
* @return boolean is read only action?
*/
-
function isReadOnly($args)
{
return false;