summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-04-01 14:40:58 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-04-01 14:40:58 -0400
commit3bec08c878d50cfa43ffb72466842bda5dd88171 (patch)
treeabb5c38a0567dfb9af37c68801832b8bb56e9335 /actions
parent783d292739886811ab41215c614940d24214358f (diff)
parente7381493ad036e686f82f432066f00ff911ad5d5 (diff)
Merge branch '0.7.x' of git@gitorious.org:laconica/dev
Conflicts: README lib/router.php
Diffstat (limited to 'actions')
-rw-r--r--actions/public.php55
-rw-r--r--actions/recoverpassword.php22
-rw-r--r--actions/showgroup.php15
-rw-r--r--actions/showstream.php14
4 files changed, 93 insertions, 13 deletions
diff --git a/actions/public.php b/actions/public.php
index a20ae4032..96c766a57 100644
--- a/actions/public.php
+++ b/actions/public.php
@@ -166,6 +166,50 @@ class PublicAction extends Action
$nav->show();
}
+ function showPageNotice()
+ {
+ $notice = Notice::publicStream(0, 1);
+
+ if (!$notice) {
+ $this->serverError(_('Could not retrieve public stream.'));
+ return;
+ }
+
+ // no notices in the public stream, let's get out of here
+ if ($notice->count()) {
+ return;
+ }
+
+ $message = _('This is the public timeline for %%site.name%% but noone has posted anything yet.') . ' ';
+
+ if (common_logged_in()) {
+ $message .= _('Be the first to post!');
+/*
+ sprintf(_('You are logged in... %%%%site.name%%%% groups let you find and talk with ' .
+ 'people of similar interests. After you join a group ' .
+ 'you can send messages to all other members using the ' .
+ 'syntax "!groupname". Don\'t see a group you like? Try ' .
+ '[searching for one](%%%%action.groupsearch%%%%) or ' .
+ '[start your own!](%%%%action.newgroup%%%%)'));
+*/
+ }
+ else {
+ $message .= _('Why not [register an account](%%action.register%%) and be the first to post!');
+/*
+ sprintf(_('You are not logged in... %%%%site.name%%%% groups let you find and talk with ' .
+ 'people of similar interests. After you join a group ' .
+ 'you can send messages to all other members using the ' .
+ 'syntax "!groupname". Don\'t see a group you like? Try ' .
+ '[searching for one](%%%%action.groupsearch%%%%) or ' .
+ '[start your own!](%%%%action.newgroup%%%%)'));
+*/
+ }
+
+ $this->elementStart('div', 'blankfiller');
+ $this->raw(common_markup_to_html($message));
+ $this->elementEnd('div');
+ }
+
/**
* Fill the content area
*
@@ -207,9 +251,14 @@ class PublicAction extends Action
function showAnonymousMessage()
{
- $m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
- 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' .
- '[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ([Read more](%%doc.help%%))');
+ if (! (common_config('site','closed') || common_config('site','inviteonly'))) {
+ $m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
+ 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' .
+ '[Join now](%%action.register%%) to share notices about yourself with friends, family, and colleagues! ([Read more](%%doc.help%%))');
+ } else {
+ $m = _('This is %%site.name%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
+ 'based on the Free Software [Laconica](http://laconi.ca/) tool.');
+ }
$this->elementStart('div', array('id' => 'anon_notice'));
$this->raw(common_markup_to_html($m));
$this->elementEnd('div');
diff --git a/actions/recoverpassword.php b/actions/recoverpassword.php
index eeb6b2516..620fe7eb8 100644
--- a/actions/recoverpassword.php
+++ b/actions/recoverpassword.php
@@ -181,13 +181,21 @@ class RecoverpasswordAction extends Action
function showRecoverForm()
{
$this->elementStart('form', array('method' => 'post',
- 'id' => 'recoverpassword',
+ 'id' => 'form_password_recover',
+ 'class' => 'form_settings',
'action' => common_local_url('recoverpassword')));
+ $this->elementStart('fieldset');
+ $this->element('legend', null, _('Password recover'));
+ $this->elementStart('ul', 'form_data');
+ $this->elementStart('li');
$this->input('nicknameoremail', _('Nickname or email'),
$this->trimmed('nicknameoremail'),
_('Your nickname on this server, ' .
'or your registered email address.'));
+ $this->elementEnd('li');
+ $this->elementEnd('ul');
$this->submit('recover', _('Recover'));
+ $this->elementEnd('fieldset');
$this->elementEnd('form');
}
@@ -213,14 +221,24 @@ class RecoverpasswordAction extends Action
function showResetForm()
{
$this->elementStart('form', array('method' => 'post',
- 'id' => 'recoverpassword',
+ 'id' => 'form_password_change',
+ 'class' => 'form_settings',
'action' => common_local_url('recoverpassword')));
+ $this->elementStart('fieldset');
+ $this->element('legend', null, _('Password change'));
$this->hidden('token', common_session_token());
+ $this->elementStart('ul', 'form_data');
+ $this->elementStart('li');
$this->password('newpassword', _('New password'),
_('6 or more characters, and don\'t forget it!'));
+ $this->elementEnd('li');
+ $this->elementStart('li');
$this->password('confirm', _('Confirm'),
_('Same as password above'));
+ $this->elementEnd('li');
+ $this->elementEnd('ul');
$this->submit('reset', _('Reset'));
+ $this->elementEnd('fieldset');
$this->elementEnd('form');
}
diff --git a/actions/showgroup.php b/actions/showgroup.php
index 95d2914ba..79445851f 100644
--- a/actions/showgroup.php
+++ b/actions/showgroup.php
@@ -396,11 +396,18 @@ class ShowgroupAction extends Action
function showAnonymousMessage()
{
- $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
- 'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' .
- 'short messages about their life and interests. '.
- '[Join now](%%%%action.register%%%%) to become part of this group and many more! ([Read more](%%%%doc.help%%%%))'),
+ if (!(common_config('site','closed') || common_config('site','inviteonly'))) {
+ $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
+ 'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' .
+ 'short messages about their life and interests. '.
+ '[Join now](%%%%action.register%%%%) to become part of this group and many more! ([Read more](%%%%doc.help%%%%))'),
$this->group->nickname);
+ } else {
+ $m = sprintf(_('**%s** is a user group on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
+ 'based on the Free Software [Laconica](http://laconi.ca/) tool. Its members share ' .
+ 'short messages about their life and interests. '),
+ $this->group->nickname);
+ }
$this->elementStart('div', array('id' => 'anon_notice'));
$this->raw(common_markup_to_html($m));
$this->elementEnd('div');
diff --git a/actions/showstream.php b/actions/showstream.php
index 9b6536293..f5886f3d3 100644
--- a/actions/showstream.php
+++ b/actions/showstream.php
@@ -535,10 +535,16 @@ class ShowstreamAction extends Action
function showAnonymousMessage()
{
- $m = sprintf(_('**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
- 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' .
- '[Join now](%%%%action.register%%%%) to follow **%s**\'s notices and many more! ([Read more](%%%%doc.help%%%%))'),
- $this->user->nickname, $this->user->nickname);
+ if (!(common_config('site','closed') || common_config('site','inviteonly'))) {
+ $m = sprintf(_('**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
+ 'based on the Free Software [Laconica](http://laconi.ca/) tool. ' .
+ '[Join now](%%%%action.register%%%%) to follow **%s**\'s notices and many more! ([Read more](%%%%doc.help%%%%))'),
+ $this->user->nickname, $this->user->nickname);
+ } else {
+ $m = sprintf(_('**%s** has an account on %%%%site.name%%%%, a [micro-blogging](http://en.wikipedia.org/wiki/Micro-blogging) service ' .
+ 'based on the Free Software [Laconica](http://laconi.ca/) tool. '),
+ $this->user->nickname, $this->user->nickname);
+ }
$this->elementStart('div', array('id' => 'anon_notice'));
$this->raw(common_markup_to_html($m));
$this->elementEnd('div');