# Looks like we're good; show the header
common_show_header($profile->nickname . _t(" and friends"),
- array($this, 'show_header'), $user);
-
- $cur = common_current_user();
-
- if ($cur && $cur->id == $profile->id) {
- common_notice_form();
- }
-
- $this->views_menu();
+ array($this, 'show_header'), $user,
+ array($this, 'show_top'));
$this->show_notices($profile);
'title' => _t('Feed for friends of ') . $user->nickname));
}
+ function show_top($user) {
+ $cur = common_current_user();
+
+ if ($cur && $cur->id == $user->id) {
+ common_notice_form();
+ }
+
+ $this->views_menu();
+ }
+
function show_notices($profile) {
$notice = DB_DataObject::factory('notice');
class AvatarAction extends SettingsAction {
function show_form($msg=NULL, $success=false) {
- common_show_header(_t('Avatar'));
- $this->settings_menu();
+ common_show_header(_t('Avatar'), NULL, NULL, array($this, 'settings_menu'));
if ($msg) {
$this->message($msg, $success);
} else {
class PasswordAction extends SettingsAction {
function show_form($msg=NULL, $success=false) {
- common_show_header(_t('Change password'));
- $this->settings_menu();
+ common_show_header(_t('Change password'), NULL, NULL, array($this, 'settings_menu'));
if ($msg) {
$this->message($msg, $success);
} else {
function show_form($msg=NULL, $success=false) {
$user = common_current_user();
$profile = $user->getProfile();
- common_show_header(_t('Profile settings'));
- $this->settings_menu();
+ common_show_header(_t('Profile settings'), NULL, NULL, array($this, 'settings_menu'));
+
if ($msg) {
$this->message($msg, $success);
} else {
header('X-XRDS-Location: '. common_local_url('xrds', array('nickname' =>
$user->nickname)));
- common_show_header($profile->nickname, array($this, 'show_header'), $user);
+ common_show_header($profile->nickname,
+ array($this, 'show_header'), $user,
+ array($this, 'show_top'));
$cur = common_current_user();
common_show_footer();
}
+ function show_top($user) {
+
+ $cur = common_current_user();
+
+ if ($cur && $cur->id == $user->id) {
+ common_notice_form();
+ }
+
+ $this->views_menu();
+ }
+
function show_header($user) {
common_element('link', array('rel' => 'alternate',
'href' => common_local_url('userrss', array('nickname' =>
$xw->flush();
}
-function common_show_header($pagetitle, $callable=NULL, $data=NULL, $notice=NULL) {
+function common_show_header($pagetitle, $callable=NULL, $data=NULL, $headercall=NULL) {
global $config, $xw;
header('Content-Type: application/xhtml+xml');
'alt' => $config['site']['name'],
'id' => 'logo'));
common_element_end('a');
+ if ($headercall) {
+ if ($data) {
+ call_user_func($headercall, $data);
+ } else {
+ call_user_func($headercall);
+ }
+ }
common_element_end('div');
common_element_start('div', array('id' => 'content'));
}