diff options
author | csarven <csarven@controlyourself.ca> | 2008-11-20 18:26:55 -0500 |
---|---|---|
committer | csarven <csarven@controlyourself.ca> | 2008-11-20 18:26:55 -0500 |
commit | 171bedf24bca7bd195dd4a8ee79cb3f04e6de5d5 (patch) | |
tree | c4b84cffe4fcd70e7906d18cab288cc221e1019a /lib | |
parent | 41f29ab662a5587b1505303ff6d39efb4b6b77c9 (diff) |
(Un)Subscribe form using ajaxForm()
darcs-hash:20081120232655-eefa4-cf6a71e246828793d3bfa413db724ab33bc58bcf.gz
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util.php | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/lib/util.php b/lib/util.php index 2f64ea599..1365380ab 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1903,6 +1903,9 @@ function common_nudge_form($profile) { 'value' => _('Send a nudge'))); common_element_end('form'); } +function common_nudge_response() { + common_element('p', array('id' => 'nudge_response'), _('Nudge sent!')); +} function common_subscribe_form($profile) { common_element_start('form', array('id' => 'subscribe-' . $profile->nickname, @@ -1936,8 +1939,22 @@ function common_unsubscribe_form($profile) { common_element_end('form'); } -function common_nudge_response() { - common_element('p', array('id' => 'nudge_response'), _('Nudge sent!')); +// XXX: Refactor this code +function common_profile_new_message_nudge ($cur, $profile) { + $user = User::staticGet('id', $profile->id); + + if ($cur && $cur->id != $user->id && $cur->mutuallySubscribed($user)) { + common_element_start('li', array('id' => 'profile_send_a_new_message')); + common_element('a', array('href' => common_local_url('newmessage', array('to' => $user->id))), + _('Send a message')); + common_element_end('li'); + + if ($user->email && $user->emailnotifynudge) { + common_element_start('li', array('id' => 'profile_nudge')); + common_nudge_form($user); + common_element_end('li'); + } + } } function common_cache_key($extra) { |