aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-01-07 03:15:52 -0800
committerFriendika <info@friendika.com>2011-01-07 03:15:52 -0800
commit0147520e903789aba3802a306b9f6b14326b486f (patch)
tree9ba1d7cb09d4dd2ba3586147af8b9062413d5019
parent65989470495ef1f45387bdec9779cf644f9a028c (diff)
downloadvolse-hubzilla-0147520e903789aba3802a306b9f6b14326b486f.tar.gz
volse-hubzilla-0147520e903789aba3802a306b9f6b14326b486f.tar.bz2
volse-hubzilla-0147520e903789aba3802a306b9f6b14326b486f.zip
add contact edit hooks
-rw-r--r--addon/README10
-rw-r--r--mod/contacts.php9
-rw-r--r--mod/dfrn_request.php2
3 files changed, 19 insertions, 2 deletions
diff --git a/addon/README b/addon/README
index b92b418b4..c6931c2b3 100644
--- a/addon/README
+++ b/addon/README
@@ -130,6 +130,16 @@ Current hooks:
'home_content' - called prior to output home page content, shown to unlogged users
$b is (string) HTML of section region
+'contact_edit' - called when editing contact details on an individual from the Contacts page
+ $b is (array)
+ 'contact' => contact record (array) of target contact
+ 'output' => the (string) generated HTML of the contact edit page
+
+'contact_edit_post' - called when posting the contact edit page
+ $b is the $_POST array
+
+
+
*** = subject to change
diff --git a/mod/contacts.php b/mod/contacts.php
index 92bce0a73..7236a200d 100644
--- a/mod/contacts.php
+++ b/mod/contacts.php
@@ -40,6 +40,8 @@ function contacts_post(&$a) {
return; // NOTREACHED
}
+ call_hooks('contact_edit_post', $_POST);
+
$profile_id = intval($_POST['profile-assign']);
if($profile_id) {
$r = q("SELECT `id` FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
@@ -260,7 +262,11 @@ function contacts_content(&$a) {
));
- return $o;
+ $arr = array('contact' => $r[0],'output' => $o);
+
+ call_hooks('contact_edit', $arr);
+
+ return $arr['output'];
}
@@ -350,6 +356,7 @@ function contacts_content(&$a) {
'$url' => $url
));
}
+
$o .= '<div id="contact-edit-end"></div>';
}
diff --git a/mod/dfrn_request.php b/mod/dfrn_request.php
index d5c5b83d5..6850f4be4 100644
--- a/mod/dfrn_request.php
+++ b/mod/dfrn_request.php
@@ -256,7 +256,7 @@ function dfrn_request_post(&$a) {
FROM `intro` LEFT JOIN `contact` on `intro`.`contact-id` = `contact`.`id`
WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0 AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 30 MINUTE ");
if(count($r)) {
- foreach($r as ($rr) {
+ foreach($r as $rr) {
if(! $rr['rel']) {
q("DELETE FROM `contact` WHERE `id` = %d LIMIT 1",
intval($rr['cid'])