Skip to content

Commit b462a80

Browse files
committedNov 11, 2014
Phriction - kill off rest of project integration
Summary: we don't need this stuff no mo'. Fixes T6506. Test Plan: cruised the wiki, noting workingess Reviewers: chad, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T6506 Differential Revision: https://secure.phabricator.com/D10832
1 parent 9252d2a commit b462a80

6 files changed

+1
-136
lines changed
 

‎src/__phutil_library_map__.php

-2
Original file line numberDiff line numberDiff line change
@@ -2777,7 +2777,6 @@
27772777
'PhrictionDocumentPreviewController' => 'applications/phriction/controller/PhrictionDocumentPreviewController.php',
27782778
'PhrictionDocumentQuery' => 'applications/phriction/query/PhrictionDocumentQuery.php',
27792779
'PhrictionDocumentStatus' => 'applications/phriction/constants/PhrictionDocumentStatus.php',
2780-
'PhrictionDocumentTestCase' => 'applications/phriction/storage/__tests__/PhrictionDocumentTestCase.php',
27812780
'PhrictionEditConduitAPIMethod' => 'applications/phriction/conduit/PhrictionEditConduitAPIMethod.php',
27822781
'PhrictionEditController' => 'applications/phriction/controller/PhrictionEditController.php',
27832782
'PhrictionHistoryConduitAPIMethod' => 'applications/phriction/conduit/PhrictionHistoryConduitAPIMethod.php',
@@ -5995,7 +5994,6 @@
59955994
'PhrictionDocumentPreviewController' => 'PhrictionController',
59965995
'PhrictionDocumentQuery' => 'PhabricatorCursorPagedPolicyAwareQuery',
59975996
'PhrictionDocumentStatus' => 'PhrictionConstants',
5998-
'PhrictionDocumentTestCase' => 'PhabricatorTestCase',
59995997
'PhrictionEditConduitAPIMethod' => 'PhrictionConduitAPIMethod',
60005998
'PhrictionEditController' => 'PhrictionController',
60015999
'PhrictionHistoryConduitAPIMethod' => 'PhrictionConduitAPIMethod',

‎src/applications/phriction/controller/PhrictionDocumentController.php

+1-36
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,6 @@ public function processRequest() {
4040

4141
$document = new PhrictionDocument();
4242

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-
}
5443
$create_uri = '/phriction/edit/?slug='.$slug;
5544

5645
$notice = new AphrontErrorView();
@@ -258,34 +247,10 @@ private function buildPropertyListView(
258247
->setUser($viewer)
259248
->setObject($document);
260249

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());
279251

280252
$this->loadHandles($phids);
281253

282-
$project_info = null;
283-
if ($project_phid) {
284-
$view->addProperty(
285-
pht('Project Info'),
286-
$this->getHandle($project_phid)->renderLink());
287-
}
288-
289254
$view->addProperty(
290255
pht('Last Author'),
291256
$this->getHandle($content->getAuthorPHID())->renderLink());

‎src/applications/phriction/controller/PhrictionEditController.php

-11
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,6 @@ public function processRequest() {
6262
$content = $document->getContent();
6363
$current_version = $content->getVersion();
6464
} 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-
}
7665
$document = PhrictionDocument::initializeNewDocument($user, $slug);
7766
$content = $document->getContent();
7867
}

‎src/applications/phriction/controller/PhrictionNewController.php

-19
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,6 @@ public function processRequest() {
3030
->addSubmitButton(pht('Edit Document'));
3131

3232
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-
}
5233
}
5334

5435
$uri = '/phriction/edit/?slug='.$slug;

‎src/applications/phriction/storage/PhrictionDocument.php

-20
Original file line numberDiff line numberDiff line change
@@ -144,26 +144,6 @@ public function attachAncestor($slug, $ancestor) {
144144
return $this;
145145
}
146146

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-
167147

168148
/* -( PhabricatorPolicyInterface )----------------------------------------- */
169149

‎src/applications/phriction/storage/__tests__/PhrictionDocumentTestCase.php

-48
This file was deleted.

0 commit comments

Comments
 (0)
Failed to load comments.