6 files changed +1
-136
lines changed Original file line number Diff line number Diff line change 2777
2777
'PhrictionDocumentPreviewController ' => 'applications/phriction/controller/PhrictionDocumentPreviewController.php ' ,
2778
2778
'PhrictionDocumentQuery ' => 'applications/phriction/query/PhrictionDocumentQuery.php ' ,
2779
2779
'PhrictionDocumentStatus ' => 'applications/phriction/constants/PhrictionDocumentStatus.php ' ,
2780
- 'PhrictionDocumentTestCase ' => 'applications/phriction/storage/__tests__/PhrictionDocumentTestCase.php ' ,
2781
2780
'PhrictionEditConduitAPIMethod ' => 'applications/phriction/conduit/PhrictionEditConduitAPIMethod.php ' ,
2782
2781
'PhrictionEditController ' => 'applications/phriction/controller/PhrictionEditController.php ' ,
2783
2782
'PhrictionHistoryConduitAPIMethod ' => 'applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php ' ,
5995
5994
'PhrictionDocumentPreviewController ' => 'PhrictionController ' ,
5996
5995
'PhrictionDocumentQuery ' => 'PhabricatorCursorPagedPolicyAwareQuery ' ,
5997
5996
'PhrictionDocumentStatus ' => 'PhrictionConstants ' ,
5998
- 'PhrictionDocumentTestCase ' => 'PhabricatorTestCase ' ,
5999
5997
'PhrictionEditConduitAPIMethod ' => 'PhrictionConduitAPIMethod ' ,
6000
5998
'PhrictionEditController ' => 'PhrictionController ' ,
6001
5999
'PhrictionHistoryConduitAPIMethod ' => 'PhrictionConduitAPIMethod ' ,
Original file line number Diff line number Diff line change @@ -40,17 +40,6 @@ public function processRequest() {
40
40
41
41
$ document = new PhrictionDocument ();
42
42
43
- if (PhrictionDocument::isProjectSlug ($ slug )) {
44
- $ project = id (new PhabricatorProjectQuery ())
45
- ->setViewer ($ user )
46
- ->withPhrictionSlugs (array (
47
- PhrictionDocument::getProjectSlugIdentifier ($ slug ),
48
- ))
49
- ->executeOne ();
50
- if (!$ project ) {
51
- return new Aphront404Response ();
52
- }
53
- }
54
43
$ create_uri = '/phriction/edit/?slug= ' .$ slug ;
55
44
56
45
$ notice = new AphrontErrorView ();
@@ -258,34 +247,10 @@ private function buildPropertyListView(
258
247
->setUser ($ viewer )
259
248
->setObject ($ document );
260
249
261
- $ project_phid = null ;
262
- if (PhrictionDocument::isProjectSlug ($ slug )) {
263
- $ project = id (new PhabricatorProjectQuery ())
264
- ->setViewer ($ viewer )
265
- ->withPhrictionSlugs (array (
266
- PhrictionDocument::getProjectSlugIdentifier ($ slug ),
267
- ))
268
- ->executeOne ();
269
- if ($ project ) {
270
- $ project_phid = $ project ->getPHID ();
271
- }
272
- }
273
-
274
- $ phids = array_filter (
275
- array (
276
- $ content ->getAuthorPHID (),
277
- $ project_phid ,
278
- ));
250
+ $ phids = array ($ content ->getAuthorPHID ());
279
251
280
252
$ this ->loadHandles ($ phids );
281
253
282
- $ project_info = null ;
283
- if ($ project_phid ) {
284
- $ view ->addProperty (
285
- pht ('Project Info ' ),
286
- $ this ->getHandle ($ project_phid )->renderLink ());
287
- }
288
-
289
254
$ view ->addProperty (
290
255
pht ('Last Author ' ),
291
256
$ this ->getHandle ($ content ->getAuthorPHID ())->renderLink ());
Original file line number Diff line number Diff line change @@ -62,17 +62,6 @@ public function processRequest() {
62
62
$ content = $ document ->getContent ();
63
63
$ current_version = $ content ->getVersion ();
64
64
} else {
65
- if (PhrictionDocument::isProjectSlug ($ slug )) {
66
- $ project = id (new PhabricatorProjectQuery ())
67
- ->setViewer ($ user )
68
- ->withPhrictionSlugs (array (
69
- PhrictionDocument::getProjectSlugIdentifier ($ slug ),
70
- ))
71
- ->executeOne ();
72
- if (!$ project ) {
73
- return new Aphront404Response ();
74
- }
75
- }
76
65
$ document = PhrictionDocument::initializeNewDocument ($ user , $ slug );
77
66
$ content = $ document ->getContent ();
78
67
}
Original file line number Diff line number Diff line change @@ -30,25 +30,6 @@ public function processRequest() {
30
30
->addSubmitButton (pht ('Edit Document ' ));
31
31
32
32
return id (new AphrontDialogResponse ())->setDialog ($ dialog );
33
- } else if (PhrictionDocument::isProjectSlug ($ slug )) {
34
- $ project = id (new PhabricatorProjectQuery ())
35
- ->setViewer ($ user )
36
- ->withPhrictionSlugs (array (
37
- PhrictionDocument::getProjectSlugIdentifier ($ slug ),
38
- ))
39
- ->executeOne ();
40
- if (!$ project ) {
41
- $ dialog = new AphrontDialogView ();
42
- $ dialog ->setSubmitURI ('/w/ ' )
43
- ->setTitle (pht ('Oops! ' ))
44
- ->setUser ($ user )
45
- ->appendChild (pht (
46
- 'You cannot create wiki pages under "projects/",
47
- because they are reserved as project pages.
48
- Create a new project with this name first. ' ))
49
- ->addCancelButton ('/w/ ' , 'Okay ' );
50
- return id (new AphrontDialogResponse ())->setDialog ($ dialog );
51
- }
52
33
}
53
34
54
35
$ uri = '/phriction/edit/?slug= ' .$ slug ;
Original file line number Diff line number Diff line change @@ -144,26 +144,6 @@ public function attachAncestor($slug, $ancestor) {
144
144
return $ this ;
145
145
}
146
146
147
- public static function isProjectSlug ($ slug ) {
148
- $ slug = PhabricatorSlug::normalize ($ slug );
149
- $ prefix = 'projects/ ' ;
150
- if ($ slug == $ prefix ) {
151
- // The 'projects/' document is not itself a project slug.
152
- return false ;
153
- }
154
- return !strncmp ($ slug , $ prefix , strlen ($ prefix ));
155
- }
156
-
157
- public static function getProjectSlugIdentifier ($ slug ) {
158
- if (!self ::isProjectSlug ($ slug )) {
159
- throw new Exception ("Slug ' {$ slug }' is not a project slug! " );
160
- }
161
-
162
- $ slug = PhabricatorSlug::normalize ($ slug );
163
- $ parts = explode ('/ ' , $ slug );
164
- return $ parts [1 ].'/ ' ;
165
- }
166
-
167
147
168
148
/* -( PhabricatorPolicyInterface )----------------------------------------- */
169
149
Load Diff This file was deleted.
0 commit comments