mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-02 11:42:42 +01:00
7a43181337
Summary: Ref T13025. We're getting kind of a lot of actions, so put them in nice groups so they're easier to work with. Test Plan: {F5386038} Reviewers: amckinley Reviewed By: amckinley Maniphest Tasks: T13025 Differential Revision: https://secure.phabricator.com/D18880
59 lines
1.4 KiB
PHP
59 lines
1.4 KiB
PHP
<?php
|
|
|
|
abstract class PhabricatorEditEngineExtension extends Phobject {
|
|
|
|
private $viewer;
|
|
|
|
final public function getExtensionKey() {
|
|
return $this->getPhobjectClassConstant('EXTENSIONKEY');
|
|
}
|
|
|
|
final public function setViewer($viewer) {
|
|
$this->viewer = $viewer;
|
|
return $this;
|
|
}
|
|
|
|
final public function getViewer() {
|
|
return $this->viewer;
|
|
}
|
|
|
|
public function getExtensionPriority() {
|
|
return 1000;
|
|
}
|
|
|
|
abstract public function isExtensionEnabled();
|
|
abstract public function getExtensionName();
|
|
|
|
abstract public function supportsObject(
|
|
PhabricatorEditEngine $engine,
|
|
PhabricatorApplicationTransactionInterface $object);
|
|
|
|
abstract public function buildCustomEditFields(
|
|
PhabricatorEditEngine $engine,
|
|
PhabricatorApplicationTransactionInterface $object);
|
|
|
|
public function newBulkEditGroups(PhabricatorEditEngine $engine) {
|
|
return array();
|
|
}
|
|
|
|
final public static function getAllExtensions() {
|
|
return id(new PhutilClassMapQuery())
|
|
->setAncestorClass(__CLASS__)
|
|
->setUniqueMethod('getExtensionKey')
|
|
->setSortMethod('getExtensionPriority')
|
|
->execute();
|
|
}
|
|
|
|
final public static function getAllEnabledExtensions() {
|
|
$extensions = self::getAllExtensions();
|
|
|
|
foreach ($extensions as $key => $extension) {
|
|
if (!$extension->isExtensionEnabled()) {
|
|
unset($extensions[$key]);
|
|
}
|
|
}
|
|
|
|
return $extensions;
|
|
}
|
|
|
|
}
|