]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
push notice form and sub-menu into header div
authorEvan Prodromou <evan@prodromou.name>
Wed, 11 Jun 2008 18:36:34 +0000 (14:36 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 11 Jun 2008 18:36:34 +0000 (14:36 -0400)
darcs-hash:20080611183634-84dde-97119e7ef1abb01f6ce8723955dc5d6e06e644a8.gz

actions/all.php
actions/avatar.php
actions/password.php
actions/profilesettings.php
actions/showstream.php
lib/util.php

index 06d88477d5197db74e6f2e752e61b48ed1575cf8..44e3fd2394be28d1ff6dfc1e5edf3b8b71dcf514 100644 (file)
@@ -45,15 +45,8 @@ class AllAction extends StreamAction {
                # 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);
                
@@ -68,6 +61,16 @@ class AllAction extends StreamAction {
                                                                         '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');
index 2d8a9f81d2d491bc4ff3565d20ee6030a25b50db..b91dd794ce6b356ce64ba9242a6d8fd4df631124 100644 (file)
@@ -24,8 +24,7 @@ require_once(INSTALLDIR.'/lib/settingsaction.php');
 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 {
index fe19f5f71dfdec0ec58383f4d74ffbda32d81e1f..ee61c3e9782ee7ed667a6ef9d752007845e31b38 100644 (file)
@@ -24,8 +24,7 @@ require_once(INSTALLDIR.'/lib/settingsaction.php');
 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 {
index e94d846bdfa2dbae175551d81d68c9910643e827..755c293c703375ffcb1cd8976c939b294cf2f577 100644 (file)
@@ -26,8 +26,8 @@ class ProfilesettingsAction extends SettingsAction {
        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 {
index 6fed6df1282046e3edaed30d85504ab441f9064c..52dbcd0ffbf0f4038f019bf619212a0e67354e62 100644 (file)
@@ -52,7 +52,9 @@ class ShowstreamAction extends StreamAction {
                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();
                
@@ -69,6 +71,17 @@ class ShowstreamAction extends StreamAction {
                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' =>
index aa0b8f02c1af5bde54b0956c71f41bd98bdd499b..bbc411d81e4f881eb2f97f15e3ec7995d3fa3c84 100644 (file)
@@ -123,7 +123,7 @@ function common_end_xml() {
        $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');
@@ -170,6 +170,13 @@ function common_show_header($pagetitle, $callable=NULL, $data=NULL, $notice=NULL
                                                                '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'));
 }