forked from GNUsocial/gnu-social
Moved common_profile_new_message_nudge() to showstream.php
This commit is contained in:
parent
9376003871
commit
6c78421298
@ -88,7 +88,7 @@ class NudgeAction extends Action
|
|||||||
$this->notify($user, $other);
|
$this->notify($user, $other);
|
||||||
|
|
||||||
if ($this->boolean('ajax')) {
|
if ($this->boolean('ajax')) {
|
||||||
common_start_html('text/xml;charset=utf-8', true);
|
$this->startHTML('text/xml;charset=utf-8', true);
|
||||||
$this->elementStart('head');
|
$this->elementStart('head');
|
||||||
$this->element('title', null, _('Nudge sent'));
|
$this->element('title', null, _('Nudge sent'));
|
||||||
$this->elementEnd('head');
|
$this->elementEnd('head');
|
||||||
|
@ -326,7 +326,24 @@ class ShowstreamAction extends Action
|
|||||||
}
|
}
|
||||||
$this->elementEnd('li');
|
$this->elementEnd('li');
|
||||||
|
|
||||||
common_profile_new_message_nudge($cur, $this->user, $this->profile);
|
// common_profile_new_message_nudge($cur, $this->user, $this->profile);
|
||||||
|
|
||||||
|
$user = User::staticGet('id', $this->profile->id);
|
||||||
|
if ($cur && $cur->id != $user->id && $cur->mutuallySubscribed($user)) {
|
||||||
|
$this->elementStart('li', array('id' => 'user_send_a_new_message'));
|
||||||
|
$this->element('a', array('href' => common_local_url('newmessage', array('to' => $user->id))),
|
||||||
|
_('Send a message'));
|
||||||
|
$this->elementEnd('li');
|
||||||
|
|
||||||
|
if ($user->email && $user->emailnotifynudge) {
|
||||||
|
$this->elementStart('li', array('id' => 'user_nudge'));
|
||||||
|
$nf = new NudgeForm($this, $user);
|
||||||
|
$nf->show();
|
||||||
|
$this->elementEnd('li');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($cur && $cur->id != $this->profile->id) {
|
if ($cur && $cur->id != $this->profile->id) {
|
||||||
$blocked = $cur->hasBlocked($this->profile);
|
$blocked = $cur->hasBlocked($this->profile);
|
||||||
@ -349,7 +366,7 @@ class ShowstreamAction extends Action
|
|||||||
$url = common_local_url('remotesubscribe',
|
$url = common_local_url('remotesubscribe',
|
||||||
array('nickname' => $this->profile->nickname));
|
array('nickname' => $this->profile->nickname));
|
||||||
$this->element('a', array('href' => $url,
|
$this->element('a', array('href' => $url,
|
||||||
'id' => 'remotesubscribe'),
|
'id' => 'user_subscribe_remote'),
|
||||||
_('Subscribe'));
|
_('Subscribe'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,9 +77,22 @@ class NudgeForm extends Form
|
|||||||
|
|
||||||
function id()
|
function id()
|
||||||
{
|
{
|
||||||
return 'nudge';
|
return 'form_user_nudge';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* class of the form
|
||||||
|
*
|
||||||
|
* @return string of the form class
|
||||||
|
*/
|
||||||
|
|
||||||
|
function formClass()
|
||||||
|
{
|
||||||
|
return 'form_user_nudge';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action of the form
|
* Action of the form
|
||||||
*
|
*
|
||||||
|
19
lib/util.php
19
lib/util.php
@ -1645,25 +1645,6 @@ function common_nudge_response()
|
|||||||
common_element('p', array('id' => 'nudge_response'), _('Nudge sent!'));
|
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)
|
function common_cache_key($extra)
|
||||||
{
|
{
|
||||||
return 'laconica:' . common_keyize(common_config('site', 'name')) . ':' . $extra;
|
return 'laconica:' . common_keyize(common_config('site', 'name')) . ':' . $extra;
|
||||||
|
Loading…
Reference in New Issue
Block a user