aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-01-20 15:30:45 -0800
committerFriendika <info@friendika.com>2011-01-20 15:30:45 -0800
commitaeb585fee1c634f75128a60cdb10ef8c8451e69a (patch)
tree19b50bf5dcc0b906885fcc9e437401cd00c7ac8c
parent623ae24109677859c787e4bb66a9dedd6ba58c38 (diff)
downloadvolse-hubzilla-aeb585fee1c634f75128a60cdb10ef8c8451e69a.tar.gz
volse-hubzilla-aeb585fee1c634f75128a60cdb10ef8c8451e69a.tar.bz2
volse-hubzilla-aeb585fee1c634f75128a60cdb10ef8c8451e69a.zip
profile edit hooks
-rw-r--r--addon/README8
-rw-r--r--mod/network.php1
-rw-r--r--mod/profiles.php5
3 files changed, 14 insertions, 0 deletions
diff --git a/addon/README b/addon/README
index 33b84e10d..2e4ed6029 100644
--- a/addon/README
+++ b/addon/README
@@ -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
diff --git a/mod/network.php b/mod/network.php
index 11d1c5291..096c8a79f 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -3,6 +3,7 @@
function network_init(&$a) {
if(! local_user()) {
+ notice( t('Permission denied.') . EOL);
return;
}
diff --git a/mod/profiles.php b/mod/profiles.php
index 54c57f73e..0bb476549 100644
--- a/mod/profiles.php
+++ b/mod/profiles.php
@@ -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 {