X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fmodules%2Fcontrib%2Ffilefield_sources%2Fsrc%2FFilefieldSourceManager.php;fp=web%2Fmodules%2Fcontrib%2Ffilefield_sources%2Fsrc%2FFilefieldSourceManager.php;h=5c320d1919b66bdbee0302f1748b30ede5697143;hp=0000000000000000000000000000000000000000;hb=8acec36f19c470dfcda1ae2336826a782f41874c;hpb=e0411c4e83ba0d079034db83c3f7f55be24a0e35 diff --git a/web/modules/contrib/filefield_sources/src/FilefieldSourceManager.php b/web/modules/contrib/filefield_sources/src/FilefieldSourceManager.php new file mode 100644 index 000000000..5c320d191 --- /dev/null +++ b/web/modules/contrib/filefield_sources/src/FilefieldSourceManager.php @@ -0,0 +1,54 @@ +setCacheBackend($cache_backend, 'filefield_sources'); + + parent::__construct('Plugin/FilefieldSource', $namespaces, $module_handler, 'Drupal\filefield_sources\FilefieldSourceInterface', 'Drupal\filefield_sources\Annotation\FilefieldSource'); + } + + /** + * {@inheritdoc} + */ + public function getDefinitions() { + $definitions = parent::getDefinitions(); + if (!\Drupal::moduleHandler()->moduleExists('imce')) { + unset($definitions['imce']); + } + if (!filefield_sources_curl_enabled()) { + unset($definitions['remote']); + } + return $definitions; + } + +}