]> git.mxchange.org Git - friendica.git/commitdiff
profile edit hooks
authorFriendika <info@friendika.com>
Thu, 20 Jan 2011 23:30:45 +0000 (15:30 -0800)
committerFriendika <info@friendika.com>
Thu, 20 Jan 2011 23:30:45 +0000 (15:30 -0800)
addon/README
mod/network.php
mod/profiles.php

index 33b84e10d08d830d0620e6fc4e6d82dc19968dc0..2e4ed602908512697f011b4feed90653aaf0ae48 100644 (file)
@@ -91,6 +91,14 @@ Current hooks:
 'plugin_settings_post' - called when the Addon Settings pages are submitted.
        $b is the $_POST array
 
+'profile_post' - called when posting a profile page.
+       $b is the $_POST array
+
+'profile_edit' - called prior to output of profile edit page
+       $b is array
+               'profile' => profile (array) record from the database
+               'entry' => the (string) HTML of the generated entry
+
 'profile_advanced' - called when the HTML is generated for the 'Advanced profile', 
        corresponding to the 'Profile' tab within a person's profile page.
        $b is the (string) HTML representation of the generated profile
index 11d1c5291f0044d852f674401df43fd7fd7d9f91..096c8a79ff1e45a59fdfb9ca5476b8eb40df0cca 100644 (file)
@@ -3,6 +3,7 @@
 
 function network_init(&$a) {
        if(! local_user()) {
+               notice( t('Permission denied.') . EOL);
                return;
        }
   
index 54c57f73e45adb74db054617371c977d67b46e8d..0bb476549eb89d93b624c404740b72aba13cd7b3 100644 (file)
@@ -10,6 +10,8 @@ function profiles_post(&$a) {
 
        $namechanged = false;
 
+       call_hooks('profile_post', $_POST);
+
        if(($a->argc > 1) && ($a->argv[1] !== "new") && intval($a->argv[1])) {
                $orig = q("SELECT * FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                        intval($a->argv[1]),
@@ -389,6 +391,9 @@ function profiles_content(&$a) {
                        '$contact' => $r[0]['contact']
                ));
 
+               $arr = array('profile' => $r[0], 'entry' => $o);
+               call_hooks('profile_edit', $arr);
+
                return $o;
        }
        else {