mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-10 23:01:04 +01:00
Add a PhabricatorApplication for files
Summary: Basic step toward modernizing Files, makes it appear on /applications/ and in typeahead. Test Plan: Looked at /applications/. Reviewers: btrahan, vrana Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D3575
This commit is contained in:
parent
92ff9c092b
commit
49c45b10c0
3 changed files with 58 additions and 20 deletions
|
@ -562,6 +562,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorApplicationDiffusion' => 'applications/diffusion/application/PhabricatorApplicationDiffusion.php',
|
||||
'PhabricatorApplicationDiviner' => 'applications/diviner/application/PhabricatorApplicationDiviner.php',
|
||||
'PhabricatorApplicationFact' => 'applications/fact/application/PhabricatorApplicationFact.php',
|
||||
'PhabricatorApplicationFiles' => 'applications/files/application/PhabricatorApplicationFiles.php',
|
||||
'PhabricatorApplicationFlags' => 'applications/flag/application/PhabricatorApplicationFlags.php',
|
||||
'PhabricatorApplicationHerald' => 'applications/herald/application/PhabricatorApplicationHerald.php',
|
||||
'PhabricatorApplicationLaunchView' => 'applications/meta/view/PhabricatorApplicationLaunchView.php',
|
||||
|
@ -1726,6 +1727,7 @@ phutil_register_library_map(array(
|
|||
'PhabricatorApplicationDiffusion' => 'PhabricatorApplication',
|
||||
'PhabricatorApplicationDiviner' => 'PhabricatorApplication',
|
||||
'PhabricatorApplicationFact' => 'PhabricatorApplication',
|
||||
'PhabricatorApplicationFiles' => 'PhabricatorApplication',
|
||||
'PhabricatorApplicationFlags' => 'PhabricatorApplication',
|
||||
'PhabricatorApplicationHerald' => 'PhabricatorApplication',
|
||||
'PhabricatorApplicationLaunchView' => 'AphrontView',
|
||||
|
|
|
@ -39,26 +39,6 @@ class AphrontDefaultApplicationConfiguration
|
|||
'(?:(?P<subfilter>[^/]+)/)?' =>
|
||||
'PhabricatorDirectoryMainController',
|
||||
),
|
||||
'/F(?P<id>\d+)' => 'PhabricatorFileShortcutController',
|
||||
'/file/' => array(
|
||||
'' => 'PhabricatorFileListController',
|
||||
'filter/(?P<filter>\w+)/' => 'PhabricatorFileListController',
|
||||
'upload/' => 'PhabricatorFileUploadController',
|
||||
'dropupload/' => 'PhabricatorFileDropUploadController',
|
||||
'delete/(?P<id>\d+)/' => 'PhabricatorFileDeleteController',
|
||||
'info/(?P<phid>[^/]+)/' => 'PhabricatorFileInfoController',
|
||||
|
||||
'data/(?P<key>[^/]+)/(?P<phid>[^/]+)/.*'
|
||||
=> 'PhabricatorFileDataController',
|
||||
// TODO: This is a deprecated version of /data/. Remove it after
|
||||
// old links have had a chance to rot.
|
||||
'alt/(?P<key>[^/]+)/(?P<phid>[^/]+)/'
|
||||
=> 'PhabricatorFileDataController',
|
||||
|
||||
'proxy/' => 'PhabricatorFileProxyController',
|
||||
'xform/(?P<transform>[^/]+)/(?P<phid>[^/]+)/'
|
||||
=> 'PhabricatorFileTransformController',
|
||||
),
|
||||
|
||||
'/typeahead/' => array(
|
||||
'common/(?P<type>\w+)/'
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2012 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
final class PhabricatorApplicationFiles extends PhabricatorApplication {
|
||||
|
||||
public function getBaseURI() {
|
||||
return '/file/';
|
||||
}
|
||||
|
||||
public function getShortDescription() {
|
||||
return 'Store and Share Files';
|
||||
}
|
||||
|
||||
public function getAutospriteName() {
|
||||
return 'files';
|
||||
}
|
||||
|
||||
public function getTitleGlyph() {
|
||||
return "\xE2\x87\xAA";
|
||||
}
|
||||
|
||||
public function getRoutes() {
|
||||
return array(
|
||||
'/F(?P<id>\d+)' => 'PhabricatorFileShortcutController',
|
||||
'/file/' => array(
|
||||
'' => 'PhabricatorFileListController',
|
||||
'filter/(?P<filter>\w+)/' => 'PhabricatorFileListController',
|
||||
'upload/' => 'PhabricatorFileUploadController',
|
||||
'dropupload/' => 'PhabricatorFileDropUploadController',
|
||||
'delete/(?P<id>\d+)/' => 'PhabricatorFileDeleteController',
|
||||
'info/(?P<phid>[^/]+)/' => 'PhabricatorFileInfoController',
|
||||
'data/(?P<key>[^/]+)/(?P<phid>[^/]+)/.*'
|
||||
=> 'PhabricatorFileDataController',
|
||||
'proxy/' => 'PhabricatorFileProxyController',
|
||||
'xform/(?P<transform>[^/]+)/(?P<phid>[^/]+)/'
|
||||
=> 'PhabricatorFileTransformController',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue