From: Evan Prodromou Date: Wed, 18 Jun 2008 03:57:39 +0000 (-0400) Subject: move instructions up to the "whats up" area X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=56de8727405ce4c08c38adec2f830d845e528190;p=quix0rs-gnu-social.git move instructions up to the "whats up" area darcs-hash:20080618035739-84dde-a562cffe186780d5f03cf53798ea249b2bda9fb1.gz --- diff --git a/actions/avatar.php b/actions/avatar.php index 61d7e770d3..a22512750e 100644 --- a/actions/avatar.php +++ b/actions/avatar.php @@ -23,20 +23,25 @@ require_once(INSTALLDIR.'/lib/settingsaction.php'); 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(); diff --git a/actions/login.php b/actions/login.php index 5544fd8786..5acb157f4f 100644 --- a/actions/login.php +++ b/actions/login.php @@ -60,14 +60,7 @@ class LoginAction extends Action { } 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'))); @@ -77,4 +70,14 @@ class LoginAction extends Action { 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. ')); + } + } } diff --git a/actions/password.php b/actions/password.php index 603ae58eaf..3481ad33bb 100644 --- a/actions/password.php +++ b/actions/password.php @@ -23,14 +23,21 @@ require_once(INSTALLDIR.'/lib/settingsaction.php'); 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' => diff --git a/actions/profilesettings.php b/actions/profilesettings.php index a5682b23bd..44abb8e99c 100644 --- a/actions/profilesettings.php +++ b/actions/profilesettings.php @@ -23,18 +23,25 @@ require_once(INSTALLDIR.'/lib/settingsaction.php'); 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' => diff --git a/actions/register.php b/actions/register.php index d2c87f7bb3..cad5c2ed70 100644 --- a/actions/register.php +++ b/actions/register.php @@ -115,16 +115,19 @@ class RegisterAction extends 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'))); diff --git a/actions/shownotice.php b/actions/shownotice.php index 4b954d57ba..cc4149d482 100644 --- a/actions/shownotice.php +++ b/actions/shownotice.php @@ -40,7 +40,9 @@ class ShownoticeAction extends StreamAction { # 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); @@ -49,6 +51,14 @@ class ShownoticeAction extends StreamAction { 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.'); } diff --git a/actions/subscribed.php b/actions/subscribed.php index 5527b276f3..2b5bbd1b88 100644 --- a/actions/subscribed.php +++ b/actions/subscribed.php @@ -41,11 +41,20 @@ class SubscribedAction extends Action { } $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; diff --git a/actions/subscriptions.php b/actions/subscriptions.php index 566a053ead..35a7078944 100644 --- a/actions/subscriptions.php +++ b/actions/subscriptions.php @@ -38,11 +38,20 @@ class SubscriptionsAction extends Action { $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');