array('user_id' => '[0-9]+',
'token' => '.+'));
+ // these take a code; before the main part
+
+ foreach (array('register', 'confirmaddress', 'recoverpassword') as $c) {
+ $m->connect('main/'.$c.'/:code', array('action' => $c));
+ }
+
+ // Also need a block variant accepting ID on URL for mail links
+ $m->connect('main/block/:profileid',
+ array('action' => 'block'),
+ array('profileid' => '[0-9]+'));
+
+ $m->connect('main/sup/:seconds', array('action' => 'sup'),
+ array('seconds' => '[0-9]+'));
+
// main stuff is repetitive
$main = array('login', 'logout', 'register', 'subscribe',
'backupaccount',
'deleteaccount',
'restoreaccount',
+ 'top',
);
foreach ($main as $a) {
$m->connect('main/'.$a, array('action' => $a));
}
- // Also need a block variant accepting ID on URL for mail links
- $m->connect('main/block/:profileid',
- array('action' => 'block'),
- array('profileid' => '[0-9]+'));
-
- $m->connect('main/sup/:seconds', array('action' => 'sup'),
- array('seconds' => '[0-9]+'));
-
- $m->connect('main/tagprofile', array('action' => 'tagprofile'));
$m->connect('main/tagprofile/:id', array('action' => 'tagprofile'),
array('id' => '[0-9]+'));
+ $m->connect('main/tagprofile', array('action' => 'tagprofile'));
+
$m->connect('main/oembed',
array('action' => 'oembed'));
$m->connect('main/xrds',
array('action' => 'publicxrds'));
- $m->connect('.well-known/host-meta',
- array('action' => 'hostmeta'));
- $m->connect('main/xrd',
- array('action' => 'userxrd'));
-
- // these take a code
-
- foreach (array('register', 'confirmaddress', 'recoverpassword') as $c) {
- $m->connect('main/'.$c.'/:code', array('action' => $c));
- }
// settings
$m->connect('settings/'.$s, array('action' => $s.'settings'));
}
+ if (common_config('oldschool', 'enabled')) {
+ $m->connect('settings/oldschool', array('action' => 'oldschoolsettings'));
+ }
+
$m->connect('settings/oauthapps/show/:id',
array('action' => 'showapplication'),
array('id' => '[0-9]+')
// search
foreach (array('group', 'people', 'notice') as $s) {
- $m->connect('search/'.$s, array('action' => $s.'search'));
$m->connect('search/'.$s.'?q=:q',
array('action' => $s.'search'),
array('q' => '.+'));
+ $m->connect('search/'.$s, array('action' => $s.'search'));
}
// 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.
- $m->connect('search/notice/rss', array('action' => 'noticesearchrss'));
$m->connect('search/notice/rss?q=:q', array('action' => 'noticesearchrss'),
array('q' => '.+'));
+ $m->connect('search/notice/rss', array('action' => 'noticesearchrss'));
$m->connect('attachment/:attachment',
array('action' => 'attachment'),
array('action' => 'userbyid'),
array('id' => '[0-9]+'));
- $m->connect('tags/', array('action' => 'publictagcloud'));
- $m->connect('tag/', array('action' => 'publictagcloud'));
- $m->connect('tags', array('action' => 'publictagcloud'));
- $m->connect('tag', array('action' => 'publictagcloud'));
+ if (!common_config('performance', 'high')) {
+ $m->connect('tags/', array('action' => 'publictagcloud'));
+ $m->connect('tag/', array('action' => 'publictagcloud'));
+ $m->connect('tags', array('action' => 'publictagcloud'));
+ $m->connect('tag', array('action' => 'publictagcloud'));
+ }
$m->connect('tag/:tag/rss',
array('action' => 'tagrss'),
array('tag' => self::REGEX_TAG));
array('action' => 'showgroup'),
array('nickname' => Nickname::DISPLAY_FMT));
+ $m->connect('group/:nickname/',
+ array('action' => 'showgroup'),
+ array('nickname' => Nickname::DISPLAY_FMT));
+
$m->connect('group/', array('action' => 'groups'));
$m->connect('group', array('action' => 'groups'));
$m->connect('groups/', array('action' => 'groups'));
array('action' => 'getfile'),
array('filename' => '[A-Za-z0-9._-]+'));
+ // Common people-tag stuff
+
+ $m->connect('peopletag/:tag', array('action' => 'peopletag',
+ 'tag' => self::REGEX_TAG));
+
+ $m->connect('selftag/:tag', array('action' => 'selftag',
+ 'tag' => self::REGEX_TAG));
+
+ $m->connect('main/addpeopletag', array('action' => 'addpeopletag'));
+
+ $m->connect('main/removepeopletag', array('action' => 'removepeopletag'));
+
+ $m->connect('main/profilecompletion', array('action' => 'profilecompletion'));
+
+ $m->connect('main/peopletagautocomplete', array('action' => 'peopletagautocomplete'));
+
// In the "root"
if (common_config('singleuser', 'enabled')) {
foreach (array('subscriptions', 'subscribers',
'all', 'foaf', 'replies',
- 'microsummary', 'hcard') as $a) {
+ 'microsummary') as $a) {
$m->connect($a,
array('action' => $a,
'nickname' => $nickname));
array('action' => 'showfavorites',
'nickname' => $nickname));
+ $m->connect('avatar',
+ array('action' => 'avatarbynickname',
+ 'nickname' => $nickname));
$m->connect('avatar/:size',
array('action' => 'avatarbynickname',
'nickname' => $nickname),
- array('size' => '(original|96|48|24)'));
+ array('size' => '(|original|\d+)'));
$m->connect('tag/:tag/rss',
array('action' => 'userrss',
$m->connect('',
array('action' => 'showstream',
'nickname' => $nickname));
+
+ // peopletags
+
+ $m->connect('peopletags',
+ array('action' => 'peopletagsbyuser'));
+
+ $m->connect('peopletags/private',
+ array('action' => 'peopletagsbyuser',
+ 'private' => 1));
+
+ $m->connect('peopletags/public',
+ array('action' => 'peopletagsbyuser',
+ 'public' => 1));
+
+ $m->connect('othertags',
+ array('action' => 'peopletagsforuser'));
+
+ $m->connect('peopletagsubscriptions',
+ array('action' => 'peopletagsubscriptions'));
+
+ $m->connect('all/:tag/subscribers',
+ array('action' => 'peopletagsubscribers',
+ 'tag' => self::REGEX_TAG));
+
+ $m->connect('all/:tag/tagged',
+ array('action' => 'peopletagged',
+ 'tag' => self::REGEX_TAG));
+
+ $m->connect('all/:tag/edit',
+ array('action' => 'editpeopletag',
+ 'tag' => self::REGEX_TAG));
+
+ foreach(array('subscribe', 'unsubscribe') as $v) {
+ $m->connect('peopletag/:id/'.$v,
+ array('action' => $v.'peopletag',
+ 'id' => '[0-9]{1,64}'));
+ }
+ $m->connect('user/:tagger_id/profiletag/:id/id',
+ array('action' => 'profiletagbyid',
+ 'tagger_id' => '[0-9]+',
+ 'id' => '[0-9]+'));
+
+ $m->connect('all/:tag',
+ array('action' => 'showprofiletag',
+ 'tag' => self::REGEX_TAG));
+
+ foreach (array('subscriptions', 'subscribers') as $a) {
+ $m->connect($a.'/:tag',
+ array('action' => $a),
+ array('tag' => self::REGEX_TAG));
+ }
} else {
$m->connect('', array('action' => 'public'));
$m->connect('rss', array('action' => 'publicrss'));
foreach (array('subscriptions', 'subscribers',
'nudge', 'all', 'foaf', 'replies',
- 'inbox', 'outbox', 'microsummary', 'hcard') as $a) {
+ 'inbox', 'outbox', 'microsummary') as $a) {
$m->connect(':nickname/'.$a,
array('action' => $a),
array('nickname' => Nickname::DISPLAY_FMT));
// people tags
- $m->connect('peopletags', array('action' => 'publicpeopletagcloud'));
-
- $m->connect('peopletag/:tag', array('action' => 'peopletag',
- 'tag' => self::REGEX_TAG));
-
- $m->connect('selftag/:tag', array('action' => 'selftag',
- 'tag' => self::REGEX_TAG));
-
- $m->connect('main/addpeopletag', array('action' => 'addpeopletag'));
-
- $m->connect('main/removepeopletag', array('action' => 'removepeopletag'));
-
- $m->connect('main/profilecompletion', array('action' => 'profilecompletion'));
-
- $m->connect('main/peopletagautocomplete', array('action' => 'peopletagautocomplete'));
-
$m->connect(':nickname/peopletags',
array('action' => 'peopletagsbyuser',
'nickname' => Nickname::DISPLAY_FMT));
array('action' => 'showfavorites'),
array('nickname' => Nickname::DISPLAY_FMT));
+ $m->connect(':nickname/avatar',
+ array('action' => 'avatarbynickname'),
+ array('nickname' => Nickname::DISPLAY_FMT));
$m->connect(':nickname/avatar/:size',
array('action' => 'avatarbynickname'),
- array('size' => '(original|96|48|24)',
+ array('size' => '(|original|\d+)',
'nickname' => Nickname::DISPLAY_FMT));
$m->connect(':nickname/tag/:tag/rss',
$m->connect(':nickname',
array('action' => 'showstream'),
array('nickname' => Nickname::DISPLAY_FMT));
+
+ $m->connect(':nickname/',
+ array('action' => 'showstream'),
+ array('nickname' => Nickname::DISPLAY_FMT));
}
// AtomPub API