]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add RSS 1.0 link to header of showstream
authorEvan Prodromou <evan@prodromou.name>
Wed, 21 May 2008 15:24:04 +0000 (11:24 -0400)
committerEvan Prodromou <evan@prodromou.name>
Wed, 21 May 2008 15:24:04 +0000 (11:24 -0400)
darcs-hash:20080521152404-84dde-bc5a2121ca9acddca9ed43c07935f713cf5c0b8e.gz

actions/showstream.php
lib/util.php

index 7e887a9d9ec00dd07698b792dc21d7863d8d06f8..c98c8b6be1049fcf9cd6768ef94831dc90a33072 100644 (file)
@@ -47,7 +47,7 @@ class ShowstreamAction extends StreamAction {
 
                # Looks like we're good; show the header
 
-               common_show_header($profile->nickname);
+               common_show_header($profile->nickname, array($this, 'show_header'), $user);
 
                $cur = common_current_user();
 
@@ -62,6 +62,14 @@ class ShowstreamAction extends StreamAction {
                common_show_footer();
        }
 
+       function show_header($user) {
+               common_element('link', array('rel' => 'alternate',
+                                                                        'href' => common_local_url('rss10', array('nickname' =>
+                                                                                                                                                          $user->nickname)),
+                                                                        'type' => 'application/rdf+xml',
+                                                                        'title' => _t('Notice feed for ') . $user->nickname));
+       }
+       
        function no_such_user() {
                common_user_error('No such user');
        }
index 31bf0de1f755c183ffa4b64855081f980e69cd9c..9635c1abbd4dd30ee77a91c41dfc90d0cae40c66 100644 (file)
@@ -82,7 +82,7 @@ function common_end_xml() {
        $xw->flush();
 }
 
-function common_show_header($pagetitle) {
+function common_show_header($pagetitle, $callable=NULL, $data=NULL) {
        global $config, $xw;
 
        header('Content-Type: application/xhtml+xml');
@@ -112,6 +112,13 @@ function common_show_header($pagetitle) {
                                                                 'type' => 'text/css',
                                                                 'href' => $config['site']['path'] . 'theme/default/style/print.css',
                                                                 'media' => 'print'));
+       if ($callable) {
+               if ($data) {
+                       call_user_func($callable, $data);
+               } else {
+                       call_user_func($callable);
+               }
+       }
        common_element_end('head');
        common_element_start('body');
        common_element_start('div', array('id' => 'wrapper'));