summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-05-30 13:43:10 -0400
committerEvan Prodromou <evan@prodromou.name>2008-05-30 13:43:10 -0400
commitbf5ae8e69a971b6310641f5a963292a64609d0e8 (patch)
tree73cdf4e079c324f332f02362d52fc846e0286ff3 /actions
parentf8a070394f8d9ba9bd5eab4bcf7eab628ceb852b (diff)
remotesubscribe form
darcs-hash:20080530174310-84dde-1e05966eb48573ced8e73acf3f3b59e7bc4f1170.gz
Diffstat (limited to 'actions')
-rw-r--r--actions/remotesubscribe.php2
-rw-r--r--actions/showstream.php23
2 files changed, 20 insertions, 5 deletions
diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php
index 68f5f0fc3..29e62c3e9 100644
--- a/actions/remotesubscribe.php
+++ b/actions/remotesubscribe.php
@@ -41,12 +41,14 @@ class RemotesubscribeAction extends Action {
}
function show_form($err=NULL) {
+ $nickname = $this->trimmed('nickname');
common_show_header(_t('Remote subscribe'));
if ($err) {
common_element('div', 'error', $err);
}
common_element_start('form', array('id' => 'remotesubscribe', 'method' => 'POST',
'action' => common_local_url('remotesubscribe')));
+ common_input('nickname', _t('User nickname'), $nickname);
common_input('profile', _t('Profile URL'));
common_submit('submit', _t('Subscribe'));
common_element_end('form');
diff --git a/actions/showstream.php b/actions/showstream.php
index 7bdc7c679..a4c476534 100644
--- a/actions/showstream.php
+++ b/actions/showstream.php
@@ -88,12 +88,16 @@ class ShowstreamAction extends StreamAction {
$cur = common_current_user();
- if ($cur && $cur->id != $profile->id) {
- if ($cur->isSubscribed($profile)) {
- $this->show_unsubscribe_form($profile);
- } else {
- $this->show_subscribe_form($profile);
+ if ($cur) {
+ if ($cur->id != $profile->id) {
+ if ($cur->isSubscribed($profile)) {
+ $this->show_unsubscribe_form($profile);
+ } else {
+ $this->show_subscribe_form($profile);
+ }
}
+ } else {
+ $this->show_remote_subscribe_form($profile);
}
$this->show_statistics($profile);
@@ -146,6 +150,15 @@ class ShowstreamAction extends StreamAction {
common_element_end('form');
}
+ function show_remote_subscribe_form($profile) {
+ common_element_start('form', array('id' => 'remotesubscribe', 'method' => 'POST',
+ 'action' => common_local_url('remotesubscribe')));
+ common_hidden('nickname', $profile->nickname);
+ common_input('profile', _t('Profile'));
+ common_submit('submit',_t('Subscribe'));
+ common_element_end('form');
+ }
+
function show_unsubscribe_form($profile) {
common_element_start('form', array('id' => 'unsubscribe', 'method' => 'POST',
'action' => common_local_url('unsubscribe')));