]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add Activity Streams feeds to export data
authorEvan Prodromou <evan@status.net>
Wed, 22 Jun 2011 21:09:04 +0000 (17:09 -0400)
committerEvan Prodromou <evan@status.net>
Wed, 22 Jun 2011 21:09:04 +0000 (17:09 -0400)
actions/showstream.php
lib/feed.php
lib/feedlist.php
theme/base/css/display.css
theme/base/images/icons/activitystreams.png [new file with mode: 0644]

index fe819d30cf8302341ae0f975d709c9a13a6846fd..b4b7faf80afb12279bfd2aa9fc0202eed5718143 100644 (file)
@@ -127,7 +127,16 @@ class ShowstreamAction extends ProfileAction
                                           $this->user->nickname, $this->tag)));
         }
 
-        return array(new Feed(Feed::RSS1,
+        return array(new Feed(Feed::JSON,
+                              common_local_url('ApiTimelineUser',
+                                               array(
+                                                    'id' => $this->user->id,
+                                                    'format' => 'as')),
+                              // TRANS: Title for link to notice feed.
+                              // TRANS: %s is a user nickname.
+                              sprintf(_('Notice feed for %s (Activity Streams JSON)'),
+                                      $this->user->nickname)),
+                     new Feed(Feed::RSS1,
                               common_local_url('userrss',
                                                array('nickname' => $this->user->nickname)),
                               // TRANS: Title for link to notice feed.
index e5a97a0cb839af2555e42e692ef7e4dc0d50bc18..7632aea09c1fb5de9d47a9d3f8ce18a491468c97 100644 (file)
@@ -49,6 +49,7 @@ class Feed
     const RSS2 = 2;
     const ATOM = 3;
     const FOAF = 4;
+    const JSON = 5; // Activity Streams
 
     var $type = null;
     var $url = null;
@@ -72,6 +73,8 @@ class Feed
             return 'application/atom+xml';
          case Feed::FOAF:
             return 'application/rdf+xml';
+         case Feed::JSON:
+            return 'application/json';
          default:
             return null;
         }
@@ -92,6 +95,9 @@ class Feed
          case Feed::FOAF:
             // TRANS: Feed type name. FOAF stands for Friend of a Friend.
             return _('FOAF');
+         case Feed::JSON:
+            // TRANS: Feed type name. See http://activitystrea.ms/
+            return _('Activity Streams');
          default:
             return null;
         }
@@ -103,6 +109,7 @@ class Feed
          case Feed::RSS1:
          case Feed::RSS2:
          case Feed::ATOM:
+         case Feed::JSON:
             return 'alternate';
          case Feed::FOAF:
             return 'meta';
index bbe66b2e74af62470b05bb020f1199f9ece32c26..c57f377238f6b981d32c6517faa7d87225d08e25 100644 (file)
@@ -93,6 +93,9 @@ class FeedList extends Widget
             case Feed::FOAF:
                 $classname = 'foaf';
                 break;
+            case Feed::JSON:
+                $classname = 'json';
+                break;
             }
 
             $this->out->elementStart('li');
index 40656b7cf959ce642e9aa7e9ce30e851d36d76ea..c9655d52c06c75b46e29fbb127d4e13063dadc35 100644 (file)
@@ -2009,6 +2009,13 @@ background-position:0 -64px;
 #export_data li a.foaf {
 background-position:0 1px;
 }
+
+#export_data li a.json {
+background-image:url(../images/icons/activitystreams.png);
+background-repeat:no-repeat;
+background-color:transparent;
+}
+
 .form_group_leave input.submit,
 .form_user_unsubscribe input.submit,
 .form_user_remove_peopletag input.submit,
diff --git a/theme/base/images/icons/activitystreams.png b/theme/base/images/icons/activitystreams.png
new file mode 100644 (file)
index 0000000..dfb3269
Binary files /dev/null and b/theme/base/images/icons/activitystreams.png differ