2014-07-23 10:03:09 +10:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
final class PhabricatorPhameApplication extends PhabricatorApplication {
|
|
|
|
|
|
2014-07-23 08:15:44 -07:00
|
|
|
public function getName() {
|
|
|
|
|
return pht('Phame');
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-23 10:03:09 +10:00
|
|
|
public function getBaseURI() {
|
|
|
|
|
return '/phame/';
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-28 08:40:22 -08:00
|
|
|
public function getIcon() {
|
2015-01-24 23:41:43 -08:00
|
|
|
return 'fa-star';
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-23 10:03:09 +10:00
|
|
|
public function getShortDescription() {
|
2015-06-09 23:06:52 +10:00
|
|
|
return pht('Blog');
|
2014-07-23 10:03:09 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getTitleGlyph() {
|
|
|
|
|
return "\xe2\x9c\xa9";
|
|
|
|
|
}
|
|
|
|
|
|
2015-04-01 08:13:12 -07:00
|
|
|
public function getHelpDocumentationArticles(PhabricatorUser $viewer) {
|
|
|
|
|
return array(
|
|
|
|
|
array(
|
|
|
|
|
'name' => pht('Phame User Guide'),
|
|
|
|
|
'href' => PhabricatorEnv::getDoclink('Phame User Guide'),
|
|
|
|
|
),
|
|
|
|
|
);
|
2014-07-23 10:03:09 +10:00
|
|
|
}
|
|
|
|
|
|
2014-09-17 18:25:57 -07:00
|
|
|
public function isPrototype() {
|
2014-07-23 10:03:09 +10:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getRoutes() {
|
|
|
|
|
return array(
|
|
|
|
|
'/phame/' => array(
|
2015-12-01 00:25:59 +00:00
|
|
|
'' => 'PhameHomeController',
|
Remove skins from Phame
Summary:
Ref T9897. Purge a bunch of stuff:
- Remove skins.
- Remove all custom sites for skin resources.
- Remove "framed", "notlive", "preview", separate "live" controllers (see below).
- Merge "publish" and "unpublish" controllers into one.
New behavior:
- Blogs and posts have three views:
- "View": Internal view URI, which is a normal detail page.
- "Internal Live": Internal view URI which is a little prettier.
- "External Live": External view URI for an external domain.
Right now, the differences are pretty minor (basically, different crumbs/chrome). This mostly gives us room to put some milder flavor of skins back later (photography or more "presentation" elements, for example).
This removes 9 million lines of code so I probably missed a couple of things, but I think it's like 95% of the way there.
Test Plan:
Here are some examples of what the "view", "internal" and "external" views look like for blogs (posts are similar):
"View": Unchanged
{F1021634}
"Internal": No chrome or footer. Still write actions (edit, post commments). Has crumbs to get back into Phame.
{F1021635}
"External": No chrome or footer. No write actions. No Phabricator crumbs. No policy/status information.
{F1021638}
I figure we'll probably tweak these a bit to figure out what makes sense (like: maybe no actions on "internal, live"? and "external, live" probably needs a way to set a root "Company >" crumb?) but that they're reasonable-ish as a first cut?
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T9897
Differential Revision: https://secure.phabricator.com/D14740
2015-12-11 07:07:45 -08:00
|
|
|
|
|
|
|
|
// NOTE: The live routes include an initial "/", so leave it off
|
|
|
|
|
// this route.
|
2015-12-11 17:27:48 -08:00
|
|
|
'(?P<live>live)/(?P<blogID>\d+)' => $this->getLiveRoutes(),
|
2014-07-23 10:03:09 +10:00
|
|
|
'post/' => array(
|
2015-09-23 12:48:19 -07:00
|
|
|
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhamePostListController',
|
2014-07-23 10:03:09 +10:00
|
|
|
'blogger/(?P<bloggername>[\w\.-_]+)/' => 'PhamePostListController',
|
|
|
|
|
'edit/(?:(?P<id>[^/]+)/)?' => 'PhamePostEditController',
|
2015-12-03 15:27:01 -08:00
|
|
|
'history/(?P<id>\d+)/' => 'PhamePostHistoryController',
|
Remove skins from Phame
Summary:
Ref T9897. Purge a bunch of stuff:
- Remove skins.
- Remove all custom sites for skin resources.
- Remove "framed", "notlive", "preview", separate "live" controllers (see below).
- Merge "publish" and "unpublish" controllers into one.
New behavior:
- Blogs and posts have three views:
- "View": Internal view URI, which is a normal detail page.
- "Internal Live": Internal view URI which is a little prettier.
- "External Live": External view URI for an external domain.
Right now, the differences are pretty minor (basically, different crumbs/chrome). This mostly gives us room to put some milder flavor of skins back later (photography or more "presentation" elements, for example).
This removes 9 million lines of code so I probably missed a couple of things, but I think it's like 95% of the way there.
Test Plan:
Here are some examples of what the "view", "internal" and "external" views look like for blogs (posts are similar):
"View": Unchanged
{F1021634}
"Internal": No chrome or footer. Still write actions (edit, post commments). Has crumbs to get back into Phame.
{F1021635}
"External": No chrome or footer. No write actions. No Phabricator crumbs. No policy/status information.
{F1021638}
I figure we'll probably tweak these a bit to figure out what makes sense (like: maybe no actions on "internal, live"? and "external, live" probably needs a way to set a root "Company >" crumb?) but that they're reasonable-ish as a first cut?
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T9897
Differential Revision: https://secure.phabricator.com/D14740
2015-12-11 07:07:45 -08:00
|
|
|
'view/(?P<id>\d+)/(?:(?P<slug>[^/]+)/)?' => 'PhamePostViewController',
|
|
|
|
|
'(?P<action>publish|unpublish)/(?P<id>\d+)/'
|
|
|
|
|
=> 'PhamePostPublishController',
|
2015-12-02 13:27:56 -08:00
|
|
|
'preview/(?P<id>\d+)/' => 'PhamePostPreviewController',
|
2015-11-23 10:28:59 -08:00
|
|
|
'preview/' => 'PhabricatorMarkupPreviewController',
|
2014-07-23 10:03:09 +10:00
|
|
|
'framed/(?P<id>\d+)/' => 'PhamePostFramedController',
|
2015-12-07 14:12:05 -08:00
|
|
|
'move/(?P<id>\d+)/' => 'PhamePostMoveController',
|
2016-06-13 10:34:13 -07:00
|
|
|
'archive/(?P<id>\d+)/' => 'PhamePostArchiveController',
|
2015-11-09 21:20:35 -08:00
|
|
|
'comment/(?P<id>[1-9]\d*)/' => 'PhamePostCommentController',
|
2014-07-23 10:03:09 +10:00
|
|
|
),
|
|
|
|
|
'blog/' => array(
|
2015-09-23 12:48:19 -07:00
|
|
|
'(?:query/(?P<queryKey>[^/]+)/)?' => 'PhameBlogListController',
|
2015-11-21 08:51:07 -08:00
|
|
|
'archive/(?P<id>[^/]+)/' => 'PhameBlogArchiveController',
|
2016-03-02 11:38:59 -08:00
|
|
|
$this->getEditRoutePattern('edit/')
|
|
|
|
|
=> 'PhameBlogEditController',
|
2015-12-11 17:27:48 -08:00
|
|
|
'view/(?P<blogID>\d+)/' => 'PhameBlogViewController',
|
2015-11-30 08:47:46 -08:00
|
|
|
'manage/(?P<id>[^/]+)/' => 'PhameBlogManageController',
|
2014-07-23 10:03:09 +10:00
|
|
|
'feed/(?P<id>[^/]+)/' => 'PhameBlogFeedController',
|
2015-11-28 12:42:36 -08:00
|
|
|
'picture/(?P<id>[1-9]\d*)/' => 'PhameBlogProfilePictureController',
|
2016-06-17 11:23:12 -07:00
|
|
|
'header/(?P<id>[1-9]\d*)/' => 'PhameBlogHeaderPictureController',
|
2014-07-23 10:03:09 +10:00
|
|
|
),
|
2015-08-31 04:01:01 -07:00
|
|
|
) + $this->getResourceSubroutes(),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getResourceRoutes() {
|
|
|
|
|
return array(
|
|
|
|
|
'/phame/' => $this->getResourceSubroutes(),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function getResourceSubroutes() {
|
|
|
|
|
return array(
|
|
|
|
|
'r/(?P<id>\d+)/(?P<hash>[^/]+)/(?P<name>.*)' =>
|
|
|
|
|
'PhameResourceController',
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getBlogRoutes() {
|
Remove skins from Phame
Summary:
Ref T9897. Purge a bunch of stuff:
- Remove skins.
- Remove all custom sites for skin resources.
- Remove "framed", "notlive", "preview", separate "live" controllers (see below).
- Merge "publish" and "unpublish" controllers into one.
New behavior:
- Blogs and posts have three views:
- "View": Internal view URI, which is a normal detail page.
- "Internal Live": Internal view URI which is a little prettier.
- "External Live": External view URI for an external domain.
Right now, the differences are pretty minor (basically, different crumbs/chrome). This mostly gives us room to put some milder flavor of skins back later (photography or more "presentation" elements, for example).
This removes 9 million lines of code so I probably missed a couple of things, but I think it's like 95% of the way there.
Test Plan:
Here are some examples of what the "view", "internal" and "external" views look like for blogs (posts are similar):
"View": Unchanged
{F1021634}
"Internal": No chrome or footer. Still write actions (edit, post commments). Has crumbs to get back into Phame.
{F1021635}
"External": No chrome or footer. No write actions. No Phabricator crumbs. No policy/status information.
{F1021638}
I figure we'll probably tweak these a bit to figure out what makes sense (like: maybe no actions on "internal, live"? and "external, live" probably needs a way to set a root "Company >" crumb?) but that they're reasonable-ish as a first cut?
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T9897
Differential Revision: https://secure.phabricator.com/D14740
2015-12-11 07:07:45 -08:00
|
|
|
return $this->getLiveRoutes();
|
2015-08-31 04:01:01 -07:00
|
|
|
}
|
|
|
|
|
|
Remove skins from Phame
Summary:
Ref T9897. Purge a bunch of stuff:
- Remove skins.
- Remove all custom sites for skin resources.
- Remove "framed", "notlive", "preview", separate "live" controllers (see below).
- Merge "publish" and "unpublish" controllers into one.
New behavior:
- Blogs and posts have three views:
- "View": Internal view URI, which is a normal detail page.
- "Internal Live": Internal view URI which is a little prettier.
- "External Live": External view URI for an external domain.
Right now, the differences are pretty minor (basically, different crumbs/chrome). This mostly gives us room to put some milder flavor of skins back later (photography or more "presentation" elements, for example).
This removes 9 million lines of code so I probably missed a couple of things, but I think it's like 95% of the way there.
Test Plan:
Here are some examples of what the "view", "internal" and "external" views look like for blogs (posts are similar):
"View": Unchanged
{F1021634}
"Internal": No chrome or footer. Still write actions (edit, post commments). Has crumbs to get back into Phame.
{F1021635}
"External": No chrome or footer. No write actions. No Phabricator crumbs. No policy/status information.
{F1021638}
I figure we'll probably tweak these a bit to figure out what makes sense (like: maybe no actions on "internal, live"? and "external, live" probably needs a way to set a root "Company >" crumb?) but that they're reasonable-ish as a first cut?
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T9897
Differential Revision: https://secure.phabricator.com/D14740
2015-12-11 07:07:45 -08:00
|
|
|
private function getLiveRoutes() {
|
2015-08-31 04:01:01 -07:00
|
|
|
return array(
|
Remove skins from Phame
Summary:
Ref T9897. Purge a bunch of stuff:
- Remove skins.
- Remove all custom sites for skin resources.
- Remove "framed", "notlive", "preview", separate "live" controllers (see below).
- Merge "publish" and "unpublish" controllers into one.
New behavior:
- Blogs and posts have three views:
- "View": Internal view URI, which is a normal detail page.
- "Internal Live": Internal view URI which is a little prettier.
- "External Live": External view URI for an external domain.
Right now, the differences are pretty minor (basically, different crumbs/chrome). This mostly gives us room to put some milder flavor of skins back later (photography or more "presentation" elements, for example).
This removes 9 million lines of code so I probably missed a couple of things, but I think it's like 95% of the way there.
Test Plan:
Here are some examples of what the "view", "internal" and "external" views look like for blogs (posts are similar):
"View": Unchanged
{F1021634}
"Internal": No chrome or footer. Still write actions (edit, post commments). Has crumbs to get back into Phame.
{F1021635}
"External": No chrome or footer. No write actions. No Phabricator crumbs. No policy/status information.
{F1021638}
I figure we'll probably tweak these a bit to figure out what makes sense (like: maybe no actions on "internal, live"? and "external, live" probably needs a way to set a root "Company >" crumb?) but that they're reasonable-ish as a first cut?
Reviewers: chad
Reviewed By: chad
Maniphest Tasks: T9897
Differential Revision: https://secure.phabricator.com/D14740
2015-12-11 07:07:45 -08:00
|
|
|
'/' => array(
|
|
|
|
|
'' => 'PhameBlogViewController',
|
2015-12-11 17:27:48 -08:00
|
|
|
'post/(?P<id>\d+)/(?:(?P<slug>[^/]+)/)?' => 'PhamePostViewController',
|
2016-06-02 07:15:39 -07:00
|
|
|
'.*' => 'PhameBlog404Controller',
|
2014-07-23 10:03:09 +10:00
|
|
|
),
|
2016-06-02 07:15:39 -07:00
|
|
|
|
2014-07-23 10:03:09 +10:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2015-05-12 14:44:47 -07:00
|
|
|
public function getQuicksandURIPatternBlacklist() {
|
|
|
|
|
return array(
|
|
|
|
|
'/phame/live/.*',
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2015-11-07 11:57:34 -08:00
|
|
|
protected function getCustomCapabilities() {
|
|
|
|
|
return array(
|
|
|
|
|
PhameBlogCreateCapability::CAPABILITY => array(
|
|
|
|
|
'default' => PhabricatorPolicies::POLICY_USER,
|
|
|
|
|
'caption' => pht('Default create policy for blogs.'),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
2014-07-23 10:03:09 +10:00
|
|
|
}
|