X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Frouter.php;h=d20730abb8382b94f1e86fc65e3d267dd82053b8;hb=ccfeefc874686101f7425cc9d1bdd3841c4cba09;hp=0a835ce4d8d5f5e317856ab20f175c6253833fc8;hpb=d7c40e77b2001678f5836e22ba3369b958a8352c;p=quix0rs-gnu-social.git diff --git a/lib/router.php b/lib/router.php index 0a835ce4d8..d20730abb8 100644 --- a/lib/router.php +++ b/lib/router.php @@ -34,7 +34,7 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { /** * URL Router * - * Cheap wrapper around Net_URL_Mapper + * Cheap wrapper around URLMapper * * @category URL * @package StatusNet @@ -143,7 +143,7 @@ class Router $main = array('login', 'logout', 'register', 'subscribe', 'unsubscribe', 'cancelsubscription', 'approvesub', 'confirmaddress', 'recoverpassword', - 'invite', 'favor', 'disfavor', 'sup', + 'invite', 'sup', 'block', 'unblock', 'subedit', 'groupblock', 'groupunblock', 'sandbox', 'unsandbox', @@ -163,6 +163,9 @@ class Router $m->connect('main/'.$a, array('action' => $a)); } + $m->connect('main/public', array('action' => 'public')); + $m->connect('main/all', array('action' => 'networkpublic')); + $m->connect('main/tagprofile/:id', array('action' => 'tagprofile'), array('id' => '[0-9]+')); @@ -209,7 +212,7 @@ class Router // The second of these is needed to make the link work correctly // when inserted into the page. The first is needed to match the - // route on the way in. Seems to be another Net_URL_Mapper bug to me. + // route on the way in. Seems to be another URLMapper bug to me. $m->connect('search/notice/rss?q=:q', array('action' => 'noticesearchrss'), array('q' => '.+')); $m->connect('search/notice/rss', array('action' => 'noticesearchrss')); @@ -249,12 +252,6 @@ class Router array('action' => 'conversation'), array('id' => '[0-9]+')); - $m->connect('message/new', array('action' => 'newmessage')); - $m->connect('message/new?to=:to', array('action' => 'newmessage'), array('to' => Nickname::DISPLAY_FMT)); - $m->connect('message/:message', - array('action' => 'showmessage'), - array('message' => '[0-9]+')); - $m->connect('user/:id', array('action' => 'userbyid'), array('id' => '[0-9]+')); @@ -454,11 +451,6 @@ class Router 'format' => '(xml|json)')); // START qvitter API additions - - $m->connect('api/statuses/favs/:id.:format', - array('action' => 'ApiStatusesFavs', - 'id' => '[0-9]+', - 'format' => '(xml|json)')); $m->connect('api/attachment/:id.:format', array('action' => 'ApiAttachment', @@ -512,21 +504,6 @@ class Router 'screen_name' => Nickname::DISPLAY_FMT, 'format' => '(xml|json)')); - // direct messages - - $m->connect('api/direct_messages.:format', - array('action' => 'ApiDirectMessage', - 'format' => '(xml|json|rss|atom)')); - - $m->connect('api/direct_messages/sent.:format', - array('action' => 'ApiDirectMessage', - 'format' => '(xml|json|rss|atom)', - 'sent' => true)); - - $m->connect('api/direct_messages/new.:format', - array('action' => 'ApiDirectMessageNew', - 'format' => '(xml|json)')); - // friendships $m->connect('api/friendships/show.:format', @@ -595,39 +572,6 @@ class Router $m->connect('api/account/rate_limit_status.:format', array('action' => 'ApiAccountRateLimitStatus')); - // favorites - - $m->connect('api/favorites/create.:format', - array('action' => 'ApiFavoriteCreate', - 'format' => '(xml|json)')); - - $m->connect('api/favorites/destroy.:format', - array('action' => 'ApiFavoriteDestroy', - 'format' => '(xml|json)')); - - $m->connect('api/favorites/list.:format', - array('action' => 'ApiTimelineFavorites', - 'format' => '(xml|json|rss|atom|as)')); - - $m->connect('api/favorites/:id.:format', - array('action' => 'ApiTimelineFavorites', - 'id' => Nickname::INPUT_FMT, - 'format' => '(xml|json|rss|atom|as)')); - - $m->connect('api/favorites.:format', - array('action' => 'ApiTimelineFavorites', - 'format' => '(xml|json|rss|atom|as)')); - - $m->connect('api/favorites/create/:id.:format', - array('action' => 'ApiFavoriteCreate', - 'id' => '[0-9]+', - 'format' => '(xml|json)')); - - $m->connect('api/favorites/destroy/:id.:format', - array('action' => 'ApiFavoriteDestroy', - 'id' => '[0-9]+', - 'format' => '(xml|json)')); - // blocks $m->connect('api/blocks/create/:id.:format', @@ -921,16 +865,12 @@ class Router 'nickname' => $nickname)); } - foreach (array('all', 'replies', 'favorites') as $a) { + foreach (array('all', 'replies') as $a) { $m->connect($a.'/rss', array('action' => $a.'rss', 'nickname' => $nickname)); } - $m->connect('favorites', - array('action' => 'showfavorites', - 'nickname' => $nickname)); - $m->connect('avatar', array('action' => 'avatarbynickname', 'nickname' => $nickname)); @@ -1008,14 +948,13 @@ class Router array('tag' => self::REGEX_TAG)); } } else { + $m->connect('main/public', array('action' => 'public')); $m->connect('', array('action' => 'public')); + $m->connect('main/all', array('action' => 'networkpublic')); $m->connect('rss', array('action' => 'publicrss')); $m->connect('featuredrss', array('action' => 'featuredrss')); - $m->connect('favoritedrss', array('action' => 'favoritedrss')); $m->connect('featured/', array('action' => 'featured')); $m->connect('featured', array('action' => 'featured')); - $m->connect('favorited/', array('action' => 'favorited')); - $m->connect('favorited', array('action' => 'favorited')); $m->connect('rsd.xml', array('action' => 'rsd')); foreach (array('subscriptions', 'subscribers', @@ -1096,16 +1035,12 @@ class Router array('nickname' => Nickname::DISPLAY_FMT)); } - foreach (array('all', 'replies', 'favorites') as $a) { + foreach (array('all', 'replies') as $a) { $m->connect(':nickname/'.$a.'/rss', array('action' => $a.'rss'), array('nickname' => Nickname::DISPLAY_FMT)); } - $m->connect(':nickname/favorites', - array('action' => 'showfavorites'), - array('nickname' => Nickname::DISPLAY_FMT)); - $m->connect(':nickname/avatar', array('action' => 'avatarbynickname'), array('nickname' => Nickname::DISPLAY_FMT)); @@ -1155,15 +1090,6 @@ class Router array('action' => 'AtomPubSubscriptionFeed'), array('subscriber' => '[0-9]+')); - $m->connect('api/statusnet/app/favorites/:profile/:notice.atom', - array('action' => 'AtomPubShowFavorite'), - array('profile' => '[0-9]+', - 'notice' => '[0-9]+')); - - $m->connect('api/statusnet/app/favorites/:profile.atom', - array('action' => 'AtomPubFavoriteFeed'), - array('profile' => '[0-9]+')); - $m->connect('api/statusnet/app/memberships/:profile/:group.atom', array('action' => 'AtomPubShowMembership'), array('profile' => '[0-9]+', @@ -1213,7 +1139,7 @@ class Router } $url = $this->m->generate($args, $params, $fragment); - // Due to a bug in the Net_URL_Mapper code, the returned URL may + // Due to a bug in the URLMapper code, the returned URL may // contain a malformed query of the form ?p1=v1?p2=v2?p3=v3. We // repair that here rather than modifying the upstream code...