]> git.mxchange.org Git - friendica.git/commitdiff
new profile_sidebar_enter hook, changed profile_sidebar to array
authorFriendika <info@friendika.com>
Wed, 19 Jan 2011 04:05:44 +0000 (20:05 -0800)
committerFriendika <info@friendika.com>
Wed, 19 Jan 2011 04:05:44 +0000 (20:05 -0800)
addon/README
boot.php

index 89f39e399e759cad906147c0c0dd36728e91e240..33b84e10d08d830d0620e6fc4e6d82dc19968dc0 100644 (file)
@@ -100,9 +100,13 @@ Current hooks:
                'contact' => contact (array) record for the person from the database
                'entry' => the (string) HTML of the generated entry 
 
+'profile_sidebar_enter' - called prior to generating the sidebar "short" profile for a page
+       $b is (array) the person's profile array
+
 'profile_sidebar' - called when generating the sidebar "short" profile for a page
-       $b is the (string) generated HTML of the entry
-               (The profile array details are in $a->profile)
+       $b is an array
+               'profile' => profile (array) record for the person from the database
+               'entry' => the (string) HTML of the generated entry
 
 'contact_block_end' - called when formatting the block of contacts/friends on a 
        profile sidebar has completed
index 0567e41d65112bdbfd40306c51edb23983ef4706..d7f32dbafe52bc64bdbc95d985ed12b55f8ad8ce 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -2009,6 +2009,8 @@ function profile_sidebar($profile) {
        if((! is_array($profile)) && (! count($profile)))
                return $o;
 
+       call_hooks('profile_sidebar_enter', $profile);
+
        $fullname = '<div class="fn">' . $profile['name'] . '</div>';
 
        $pdesc = '<div class="title">' . $profile['pdesc'] . '</div>';
@@ -2062,7 +2064,10 @@ function profile_sidebar($profile) {
                '$homepage' => $homepage
        ));
 
-       call_hooks('profile_sidebar', $o);
+
+       $arr = array('profile' => $profile, 'entry' => $o);
+
+       call_hooks('profile_sidebar', $arr);
 
        return $o;
 }}