]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
These same params are used in most API actions; moved to base API class
authorZach Copley <zach@status.net>
Sat, 10 Oct 2009 00:32:53 +0000 (17:32 -0700)
committerZach Copley <zach@status.net>
Sat, 10 Oct 2009 00:32:53 +0000 (17:32 -0700)
13 files changed:
actions/apidirectmessage.php
actions/apigrouplist.php
actions/apigrouplistall.php
actions/apigroupmembership.php
actions/apisubscriptions.php
actions/apitimelinefavorites.php
actions/apitimelinefriends.php
actions/apitimelinegroup.php
actions/apitimelinementions.php
actions/apitimelinepublic.php
actions/apitimelinetag.php
actions/apitimelineuser.php
lib/api.php

index cede4c07217630206220fe78f25a5ea99611e61b..f0013c54c5c1353ad2e78eaa135fba8e53f233d0 100644 (file)
@@ -46,11 +46,6 @@ require_once INSTALLDIR.'/lib/apiauth.php';
 class ApiDirectMessageAction extends ApiAuthAction
 {
     var $messages     = null;
-    var $page         = null;
-    var $count        = null;
-    var $max_id       = null;
-    var $since_id     = null;
-    var $since        = null;
     var $title        = null;
     var $subtitle     = null;
     var $link         = null;
@@ -77,12 +72,6 @@ class ApiDirectMessageAction extends ApiAuthAction
             return;
         }
 
-        $this->page     = (int)$this->arg('page', 1);
-        $this->count    = (int)$this->arg('count', 20);
-        $this->max_id   = (int)$this->arg('max_id', 0);
-        $this->since_id = (int)$this->arg('since_id', 0);
-        $this->since    = $this->arg('since');
-
         $server   = common_root_url();
         $taguribase = common_config('integration', 'taguri');
 
index 00ceeed760b12ac63f19e3855082bfa9dbdf7f84..7a5aab72eb49d6a9624cbfc000cb924ce2bd2511 100644 (file)
@@ -45,12 +45,6 @@ require_once INSTALLDIR . '/lib/apibareauth.php';
 
 class ApiGroupListAction extends ApiBareAuthAction
 {
-    var $user     = null;
-    var $page     = null;
-    var $count    = null;
-    var $max_id   = null;
-    var $since_id = null;
-    var $since    = null;
     var $groups   = null;
 
     /**
@@ -65,12 +59,6 @@ class ApiGroupListAction extends ApiBareAuthAction
     function prepare($args)
     {
         parent::prepare($args);
-
-        $this->page     = (int)$this->arg('page', 1);
-        $this->count    = (int)$this->arg('count', 20);
-        $this->max_id   = (int)$this->arg('max_id', 0);
-        $this->since_id = (int)$this->arg('since_id', 0);
-        $this->since    = $this->arg('since');
         
         $this->user   = $this->getTargetUser($id);
         $this->groups = $this->getGroups();
index 070927b1eae792552d697194f553e3951a78cac2..3e236816abebb4872bbb88c388bb6db942b7db82 100644 (file)
@@ -45,11 +45,6 @@ require_once INSTALLDIR . '/lib/api.php';
 
 class ApiGroupListAllAction extends ApiAction
 {
-    var $page     = null;
-    var $count    = null;
-    var $max_id   = null;
-    var $since_id = null;
-    var $since    = null;
     var $groups   = null;
 
     /**
@@ -65,12 +60,6 @@ class ApiGroupListAllAction extends ApiAction
     {
         parent::prepare($args);
 
-        $this->page     = (int)$this->arg('page', 1);
-        $this->count    = (int)$this->arg('count', 20);
-        $this->max_id   = (int)$this->arg('max_id', 0);
-        $this->since_id = (int)$this->arg('since_id', 0);
-        $this->since    = $this->arg('since');
-
         $this->user   = $this->getTargetUser($id);
         $this->groups = $this->getGroups();
 
index 0e9510d713700db2eebe34ea427319763a13f72f..0bc846d60450e9c2598c40797616ebeb2aeea3d2 100644 (file)
@@ -45,11 +45,6 @@ require_once INSTALLDIR . '/lib/api.php';
 
 class ApiGroupMembershipAction extends ApiAction
 {
-    var $page     = null;
-    var $count    = null;
-    var $max_id   = null;
-    var $since_id = null;
-    var $since    = null;
     var $group    = null;
     var $profiles = null;
 
@@ -66,14 +61,7 @@ class ApiGroupMembershipAction extends ApiAction
     {
         parent::prepare($args);
 
-        $this->page     = (int)$this->arg('page', 1);
-        $this->count    = (int)$this->arg('count', 20);
-        $this->max_id   = (int)$this->arg('max_id', 0);
-        $this->since_id = (int)$this->arg('since_id', 0);
-        $this->since    = $this->arg('since');
-
-        $this->group  = $this->getTargetGroup($this->arg('id'));
-
+        $this->group    = $this->getTargetGroup($this->arg('id'));
         $this->profiles = $this->getProfiles();
 
         return true;
index 9dbddbd9bdf3df6691be74da8f148269089652b7..1332fd71c668a1e5e61e4eb9a7b0aed7558f170d 100644 (file)
@@ -47,10 +47,6 @@ require_once INSTALLDIR.'/lib/apibareauth.php';
 
 class ApiSubscriptionsAction extends ApiBareAuthAction
 {
-
-    var $page     = null;
-    var $count    = null;
-    var $user     = null;
     var $profiles = null;
     var $tag      = null;
     var $lite     = null;
@@ -69,7 +65,6 @@ class ApiSubscriptionsAction extends ApiBareAuthAction
     {
         parent::prepare($args);
 
-        $this->page     = (int)$this->arg('page', 1);
         $this->tag      = $this->arg('tag');
 
         // Note: Twitter no longer supports 'lite'
index 231f2ae49c92bce08756b67a834e4f328bef91d0..d35e051835aad1cbe9dea1571def59e5bbbb5dea 100644 (file)
@@ -46,14 +46,7 @@ require_once INSTALLDIR.'/lib/apibareauth.php';
 
 class ApiTimelineFavoritesAction extends ApiBareAuthAction
 {
-
-    var $user     = null;
     var $notices  = null;
-    var $page     = null;
-    var $count    = null;
-    var $max_id   = null;
-    var $since_id = null;
-    var $since    = null;
 
     /**
      * Take arguments for running
@@ -68,12 +61,6 @@ class ApiTimelineFavoritesAction extends ApiBareAuthAction
     {
         parent::prepare($args);
 
-        $this->page     = (int)$this->arg('page', 1);
-        $this->count    = (int)$this->arg('count', 20);
-        $this->max_id   = (int)$this->arg('max_id', 0);
-        $this->since_id = (int)$this->arg('since_id', 0);
-        $this->since    = $this->arg('since');
-
         $this->user = $this->getTargetUser($this->arg('id'));
 
         if (empty($this->user)) {
index 02e352569565164172908ffe5914c55d8d0347fc..544824078e972f8ce68418ba74ad6a8a6905f713 100644 (file)
@@ -46,13 +46,7 @@ require_once INSTALLDIR.'/lib/apibareauth.php';
 
 class ApiTimelineFriendsAction extends ApiBareAuthAction
 {
-
-    var $user     = null;
     var $notices  = null;
-    var $count    = null;
-    var $max_id   = null;
-    var $since_id = null;
-    var $since    = null;
 
     /**
      * Take arguments for running
@@ -67,12 +61,6 @@ class ApiTimelineFriendsAction extends ApiBareAuthAction
     {
         parent::prepare($args);
 
-        $this->page     = (int)$this->arg('page', 1);
-        $this->count    = (int)$this->arg('count', 20);
-        $this->max_id   = (int)$this->arg('max_id', 0);
-        $this->since_id = (int)$this->arg('since_id', 0);
-        $this->since    = $this->arg('since');
-
         $this->user = $this->getTargetUser($this->arg('id'));
 
         if (empty($this->user)) {
index abe7f0c5d84b5e0b1f0350a3596128e04bcdc7c3..6f2043fb65830340b8bb87c3fabc68085e4ea49b 100644 (file)
@@ -62,14 +62,7 @@ class ApiTimelineGroupAction extends ApiAction
     {
         parent::prepare($args);
 
-        $this->page     = (int)$this->arg('page', 1);
-        $this->count    = (int)$this->arg('count', 20);
-        $this->max_id   = (int)$this->arg('max_id', 0);
-        $this->since_id = (int)$this->arg('since_id', 0);
-        $this->since    = $this->arg('since');
-
-        $this->group = $this->getTargetGroup($this->arg('id'));
-
+        $this->group   = $this->getTargetGroup($this->arg('id'));
         $this->notices = $this->getNotices();
 
         return true;
index 7549b4722de13d95b6e26ff557fc0c6d014c9d0b..60669d9ba3553889a9dd43f8e398059d3746c5ad 100644 (file)
@@ -62,12 +62,6 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
     {
         parent::prepare($args);
 
-        $this->page     = (int)$this->arg('page', 1);
-        $this->count    = (int)$this->arg('count', 20);
-        $this->max_id   = (int)$this->arg('max_id', 0);
-        $this->since_id = (int)$this->arg('since_id', 0);
-        $this->since    = $this->arg('since');
-
         $this->user = $this->getTargetUser($this->arg('id'));
 
         if (empty($this->user)) {
index a635ddc91e3abc96e565166f4727ea4c2151bd3f..b992136d1f4dc4a35896872973e18b45430151cd 100644 (file)
@@ -61,12 +61,6 @@ class ApiTimelinePublicAction extends ApiAction
     {
         parent::prepare($args);
 
-        $this->page     = (int)$this->arg('page', 1);
-        $this->count    = (int)$this->arg('count', 20);
-        $this->max_id   = (int)$this->arg('max_id', 0);
-        $this->since_id = (int)$this->arg('since_id', 0);
-        $this->since    = $this->arg('since');
-
         $this->notices = $this->getNotices();
 
         return true;
index 8211b01226b04ded65d63028077769710d83eea9..53e79e4b9e9c10c88ce7dea2dddd10dadf47e7e6 100644 (file)
@@ -61,10 +61,7 @@ class ApiTimelineTagAction extends ApiAction
     {
         parent::prepare($args);
 
-        $this->page     = (int)$this->arg('page', 1);
-        $this->count    = (int)$this->arg('count', 20);
-        $this->tag      = $this->arg('tag');
-
+        $this->tag     = $this->arg('tag');
         $this->notices = $this->getNotices();
 
         return true;
index 81e23116b73ba145d79afc8be2f8b404fda325e3..652a1b0d955896d2bfaacee42335778c3810b1b3 100644 (file)
@@ -64,12 +64,6 @@ class ApiTimelineUserAction extends ApiBareAuthAction
     {
         parent::prepare($args);
 
-        $this->page     = (int)$this->arg('page', 1);
-        $this->count    = (int)$this->arg('count', 20);
-        $this->max_id   = (int)$this->arg('max_id', 0);
-        $this->since_id = (int)$this->arg('since_id', 0);
-        $this->since    = $this->arg('since');
-
         $this->user = $this->getTargetUser($this->arg('id'));
 
         if (empty($this->user)) {
index 3afb20612d8c379e7cbb51ee4e8a35db637c48ad..95a0779add67c0cd18f64c904d31101e6029e7dd 100644 (file)
@@ -43,8 +43,14 @@ if (!defined('STATUSNET')) {
 
 class ApiAction extends Action
 {
-     var $format = null;
-
+     var $format   = null;
+     var $user     = null;
+     var $page     = null;
+     var $count    = null;
+     var $max_id   = null;
+     var $since_id = null;
+     var $since    = null;
+     
     /**
      * Initialization.
      *
@@ -56,7 +62,14 @@ class ApiAction extends Action
     function prepare($args)
     {
         parent::prepare($args);
+        
         $this->format   = $this->arg('format');
+        $this->page     = (int)$this->arg('page', 1);
+        $this->count    = (int)$this->arg('count', 20);
+        $this->max_id   = (int)$this->arg('max_id', 0);
+        $this->since_id = (int)$this->arg('since_id', 0);
+        $this->since    = $this->arg('since');
+        
         return true;
     }