class AvatarAction extends SettingsAction {
- function show_form($msg=NULL, $success=false) {
- common_show_header(_t('Avatar'), NULL, NULL, array($this, 'settings_menu'));
+ function show_top($arr) {
+ $msg = $arr[0];
+ $success = $arr[1];
if ($msg) {
$this->message($msg, $success);
} else {
common_element('div', 'instructions',
- _t('You can upload a new "avatar" (user picture) here. ' .
- 'You can\'t edit the picture after you upload it, so you should ' .
- 'edit it in your desktop image-manipulation software first. ' .
- 'Everything works best if your picture is more or less square. ' .
- 'And remember: your image will be released under the site license, ' .
- 'So don\'t upload images that don\'t belong to you or that you don\'t ' .
+ _t('Upload a new "avatar" (user image) here. ' .
+ 'You can\'t edit the picture after you upload it, so ' .
+ 'make sure it\'s more or less square. ' .
+ 'It must be under the site license, also. ' .
+ 'Use a picture that belongs to you and that you ' .
'want to share.'));
}
+ $this->settings_menu();
+ }
+
+ function show_form($msg=NULL, $success=false) {
+ common_show_header(_t('Avatar'), NULL, array($msg, $success), array($this, 'show_top'));
$user = common_current_user();
$profile = $user->getProfile();
}
function show_form($error=NULL) {
- common_show_header(_t('Login'));
- if ($error) {
- common_element('div', array('class' => 'error'), $error);
- } else {
- common_element('div', 'instructions',
- _t('Login with your username and password. ' .
- 'Don\'t have a username yet? Choose register above. '));
- }
+ common_show_header(_t('Login'), NULL, $error, array($this, 'show_top'));
common_element_start('form', array('method' => 'POST',
'id' => 'login',
'action' => common_local_url('login')));
common_element_end('form');
common_show_footer();
}
+
+ function show_top($error=NULL) {
+ if ($error) {
+ common_element('p', 'error', $error);
+ } else {
+ common_element('p', 'instructions',
+ _t('Login with your username and password. ' .
+ 'Don\'t have a username yet? Choose register above. '));
+ }
+ }
}
class PasswordAction extends SettingsAction {
- function show_form($msg=NULL, $success=false) {
- common_show_header(_t('Change password'), NULL, NULL, array($this, 'settings_menu'));
+ function show_top($arr) {
+ $msg = $arr[0];
+ $success = $arr[1];
if ($msg) {
$this->message($msg, $success);
} else {
common_element('div', 'instructions',
_t('You can change your password here. Choose a good one!'));
}
+ $this->settings_menu();
+ }
+
+ function show_form($msg=NULL, $success=false) {
+ common_show_header(_t('Change password'), NULL,
+ array($msg, $success), array($this, 'show_top'));
common_element_start('form', array('method' => 'POST',
'id' => 'password',
'action' =>
class ProfilesettingsAction extends SettingsAction {
- function show_form($msg=NULL, $success=false) {
- $user = common_current_user();
- $profile = $user->getProfile();
- common_show_header(_t('Profile settings'), NULL, NULL, array($this, 'settings_menu'));
-
+ function show_top($arr) {
+ $msg = $arr[0];
+ $success = $arr[1];
if ($msg) {
$this->message($msg, $success);
} else {
common_element('div', 'instructions',
_t('You can update your personal profile info here '.
- 'so people know more about you. '));
+ 'so people know more about you.'));
}
+ $this->settings_menu();
+ }
+
+ function show_form($msg=NULL, $success=false) {
+ $user = common_current_user();
+ $profile = $user->getProfile();
+ common_show_header(_t('Profile settings'), NULL, array($msg, $success),
+ array($this, 'show_top'));
+
common_element_start('form', array('method' => 'POST',
'id' => 'profilesettings',
'action' =>
return $result;
}
- function show_form($error=NULL) {
- global $config;
-
- common_show_header(_t('Register'));
+ function show_top($error=NULL) {
if ($error) {
- common_element('div', 'error', $error);
+ common_element('p', 'error', $error);
} else {
- common_element('div', 'instructions',
- _t('You can create a new account to start posting notices. '));
+ common_element('p', 'instructions',
+ _t('You can create a new account to start posting notices.'));
}
+ }
+
+ function show_form($error=NULL) {
+ global $config;
+
+ common_show_header(_t('Register'), NULL, $error, array($this, 'show_top'));
common_element_start('form', array('method' => 'POST',
'id' => 'login',
'action' => common_local_url('register')));
# Looks like we're good; show the header
- common_show_header($profile->nickname."'s status on ".common_date_string($notice->created));
+ common_show_header($profile->nickname."'s status on ".common_date_string($notice->created),
+ NULL, $user,
+ array($this, 'show_top'));
common_element_start('ul', array('id' => 'notices'));
$this->show_notice($notice);
common_show_footer();
}
+ function show_top($user) {
+ $cur = common_current_user();
+
+ if ($cur && $cur->id == $user->id) {
+ common_notice_form();
+ }
+ }
+
function no_such_notice() {
common_user_error('No such notice.');
}
}
$page = $this->arg('page') || 1;
- common_show_header($profile->nickname . ": " . _t('Subscribers'));
+ common_show_header($profile->nickname . ": " . _t('Subscribers'),
+ NULL, $profile,
+ array($this, 'show_top'));
$this->show_subscribed($profile, $page);
common_show_footer();
}
+ function show_top($profile) {
+ $user = common_current_user();
+ common_element('p', 'instructions',
+ _t('These are the people who listen to ') .
+ (($user && ($user->id == $profile->id)) ? _t('your notices.') : ($profile->nickname . _t('\'s notices.'))));
+ }
+
function show_subscribed($profile, $page) {
global $config;
$this->no_such_user();
}
$page = $this->arg('page') || 1;
- common_show_header($profile->nickname . ": " . _t('Subscriptions'));
+ common_show_header($profile->nickname . ": " . _t('Subscriptions'),
+ NULL, $profile,
+ array($this, 'show_top'));
$this->show_subscriptions($profile, $page);
common_show_footer();
}
+ function show_top($profile) {
+ $user = common_current_user();
+ common_element('p', 'instructions',
+ _t('These are the people whose notices ') .
+ (($user && ($user->id == $profile->id)) ? _t('you listen to.') : ($profile->nickname . _t(' listens to.'))));
+ }
+
function show_subscriptions($profile, $page) {
$subs = DB_DataObject::factory('subscription');