1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-02-08 21:08:29 +01:00
phorge-phorge/src/applications/dashboard/application/PhabricatorDashboardApplication.php
Arturas Moskvinas 960c447aab Support more than 9 portals
Summary: If portal is created with id > 9 - then those portals are not reachable and always return 404.

Test Plan: Create at least 10 portals, 10th and rest of them will no longer return 404.

Reviewers: epriestley, Pawka, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D20852
2019-10-02 22:35:59 +03:00

86 lines
2.6 KiB
PHP

<?php
final class PhabricatorDashboardApplication extends PhabricatorApplication {
public function getName() {
return pht('Dashboards');
}
public function getBaseURI() {
return '/dashboard/';
}
public function getTypeaheadURI() {
return '/dashboard/console/';
}
public function getShortDescription() {
return pht('Create Custom Pages');
}
public function getIcon() {
return 'fa-dashboard';
}
public function isPinnedByDefault(PhabricatorUser $viewer) {
return true;
}
public function getApplicationOrder() {
return 0.160;
}
public function getRoutes() {
$menu_rules = $this->getProfileMenuRouting(
'PhabricatorDashboardPortalViewController');
return array(
'/W(?P<id>\d+)' => 'PhabricatorDashboardPanelViewController',
'/dashboard/' => array(
'(?:query/(?P<queryKey>[^/]+)/)?'
=> 'PhabricatorDashboardListController',
'view/(?P<id>\d+)/' => 'PhabricatorDashboardViewController',
'archive/(?P<id>\d+)/' => 'PhabricatorDashboardArchiveController',
$this->getEditRoutePattern('edit/') =>
'PhabricatorDashboardEditController',
'install/(?P<id>\d+)/'.
'(?:(?P<workflowKey>[^/]+)/'.
'(?:(?P<modeKey>[^/]+)/)?)?' =>
'PhabricatorDashboardInstallController',
'console/' => 'PhabricatorDashboardConsoleController',
'adjust/(?P<op>remove|add|move)/'
=> 'PhabricatorDashboardAdjustController',
'panel/' => array(
'install/(?P<engineKey>[^/]+)/(?:(?P<queryKey>[^/]+)/)?' =>
'PhabricatorDashboardQueryPanelInstallController',
'(?:query/(?P<queryKey>[^/]+)/)?'
=> 'PhabricatorDashboardPanelListController',
$this->getEditRoutePattern('edit/')
=> 'PhabricatorDashboardPanelEditController',
'render/(?P<id>\d+)/' => 'PhabricatorDashboardPanelRenderController',
'archive/(?P<id>\d+)/'
=> 'PhabricatorDashboardPanelArchiveController',
'tabs/(?P<id>\d+)/(?P<op>add|move|remove|rename)/'
=> 'PhabricatorDashboardPanelTabsController',
),
),
'/portal/' => array(
$this->getQueryRoutePattern() =>
'PhabricatorDashboardPortalListController',
$this->getEditRoutePattern('edit/') =>
'PhabricatorDashboardPortalEditController',
'view/(?P<portalID>\d+)/' => array(
'' => 'PhabricatorDashboardPortalViewController',
) + $menu_rules,
),
);
}
public function getRemarkupRules() {
return array(
new PhabricatorDashboardRemarkupRule(),
);
}
}