]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
remotesubscribe form
authorEvan Prodromou <evan@prodromou.name>
Fri, 30 May 2008 17:43:10 +0000 (13:43 -0400)
committerEvan Prodromou <evan@prodromou.name>
Fri, 30 May 2008 17:43:10 +0000 (13:43 -0400)
darcs-hash:20080530174310-84dde-1e05966eb48573ced8e73acf3f3b59e7bc4f1170.gz

actions/remotesubscribe.php
actions/showstream.php
doc/TODO
lib/common.php
lib/util.php

index 68f5f0fc3473ab5200c84af80ff58a8904a6a582..29e62c3e97360e4145441571b03de89a04b9875d 100644 (file)
@@ -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');
index 7bdc7c67938ed7d47f2de4b7a80b6a685886edc6..a4c476534c9c2a0bd86fb3f2744f775b432dfdd4 100644 (file)
@@ -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')));
index 6c4996709b931398e2d805f368b3d91eb37eb66f..10a072a8799f0bd6f6cb68655e695078e8334bc1 100644 (file)
--- a/doc/TODO
+++ b/doc/TODO
@@ -60,8 +60,8 @@
 - server side of user authorization
 - server side of request token
 - server side of access token
-- OAuth store
-- log of consumers who ask for access
++ OAuth store
++ log of consumers who ask for access
 - receive remote notice
 - send remote notice
 - subscribe form for not-logged-in users on showstream
 + add a next page link to all
 - AGPL notification
 - Check licenses of all libraries for compatibility
-- gettext
++ @ messages
++ Automatically linkify URLs in notices
 - release 0.3
+- email notification on subscriptions
+- gettext
 - license per notice
-- Automatically linkify URLs in notices
 - tinyurl-ification of URLs
 - use only canonical email addresses
 - allow mixed-case usernames
 - theme per site
 - theme per profile
 - email confirmation for registration
+- email options
+- email newsletter
 - change cookie handling for anon users to be more cache-friendly
 - jQuery for as much as possible
 - content negotiation for interface language
 - RDFa for stream pages
 - RDFa for subscriber pages
 - RDFa for subscribed pages
-- @ messages
 - # tags
 - L: location
 - hreviews
 - receive notices from mobile phone
 - machine tags
 - release 0.6
+- OAuth for third-party tools (desktop, other sites)
 - Twitter-compatible API
 - Pownce-compatible API
 - include twitter subscriptions (push and pull)
index 1954dfc2ab343a26f798067918405da2e920af86..6ff40ab5f0f058d01af883ffea4f5ab0a3cc2244 100644 (file)
@@ -17,8 +17,6 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/* XXX: break up into separate modules (HTTP, HTML, user, files) */
-
 if (!defined('LACONICA')) { exit(1); }
 
 define('AVATAR_PROFILE_SIZE', 96);
index 72876cef734a1a26474380fda67fc6f8e3dc9923..12680112634e444a5aa18b80bbb5b49ec25dee75 100644 (file)
@@ -238,6 +238,13 @@ function common_input($id, $label, $value=NULL) {
        common_element_end('p');
 }
 
+function common_hidden($id, $value) {
+       common_element('input', array('name' => $id,
+                                                                 'type' => 'hidden',
+                                                                 'id' => $id,
+                                                                 'value' => $value));
+}
+
 function common_password($id, $label) {
        common_element_start('p');
        common_element('label', array('for' => $id), $label);