Changeset View
Changeset View
Standalone View
Standalone View
src/applications/herald/adapter/HeraldAdapter.php
| Show First 20 Lines • Show All 1,077 Lines • ▼ Show 20 Lines | throw new Exception( | ||||
| pht( | pht( | ||||
| 'No adapter exists for Herald content type "%s".', | 'No adapter exists for Herald content type "%s".', | ||||
| $content_type)); | $content_type)); | ||||
| } | } | ||||
| public static function getEnabledAdapterMap(PhabricatorUser $viewer) { | public static function getEnabledAdapterMap(PhabricatorUser $viewer) { | ||||
| $map = array(); | $map = array(); | ||||
| $adapters = HeraldAdapter::getAllAdapters(); | $adapters = self::getAllAdapters(); | ||||
| foreach ($adapters as $adapter) { | foreach ($adapters as $adapter) { | ||||
| if (!$adapter->isAvailableToUser($viewer)) { | if (!$adapter->isAvailableToUser($viewer)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| $type = $adapter->getAdapterContentType(); | $type = $adapter->getAdapterContentType(); | ||||
| $name = $adapter->getAdapterContentName(); | $name = $adapter->getAdapterContentName(); | ||||
| $map[$type] = $name; | $map[$type] = $name; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 557 Lines • Show Last 20 Lines | |||||