9aee90f8c1
Summary:
Ref T9132. This just makes edited forms do //something//, albeit not anything very useful yet.
You can now edit a form and:
- Retitle it;
- add a preamble (instructions on top of the form); and
- reorder the form's fields.
Test Plan:
{F974632}
{F974633}
{F974634}
{F974635}
{F974636}
Reviewers: chad
Reviewed By: chad
Subscribers: hach-que
Maniphest Tasks: T9132
Differential Revision: https://secure.phabricator.com/D14503
54 lines
1.1 KiB
PHP
54 lines
1.1 KiB
PHP
<?php
|
|
|
|
final class PhabricatorEditEngineQuery
|
|
extends PhabricatorCursorPagedPolicyAwareQuery {
|
|
|
|
private $engineKeys;
|
|
|
|
public function withEngineKeys(array $keys) {
|
|
$this->engineKeys = $keys;
|
|
return $this;
|
|
}
|
|
|
|
protected function loadPage() {
|
|
$engines = PhabricatorEditEngine::getAllEditEngines();
|
|
|
|
if ($this->engineKeys !== null) {
|
|
$engines = array_select_keys($engines, $this->engineKeys);
|
|
}
|
|
|
|
return $engines;
|
|
}
|
|
|
|
protected function willFilterPage(array $engines) {
|
|
$viewer = $this->getViewer();
|
|
|
|
foreach ($engines as $key => $engine) {
|
|
$app_class = $engine->getEngineApplicationClass();
|
|
if ($app_class === null) {
|
|
continue;
|
|
}
|
|
|
|
$can_see = PhabricatorApplication::isClassInstalledForViewer(
|
|
$app_class,
|
|
$viewer);
|
|
if (!$can_see) {
|
|
$this->didRejectResult($engine);
|
|
unset($engines[$key]);
|
|
continue;
|
|
}
|
|
}
|
|
|
|
return $engines;
|
|
}
|
|
|
|
public function getQueryApplicationClass() {
|
|
return 'PhabricatorTransactionsApplication';
|
|
}
|
|
|
|
protected function getResultCursor($object) {
|
|
return null;
|
|
}
|
|
|
|
}
|