Only load js and css once.
This commit is contained in:
parent
2d97164f80
commit
c90c358f0d
|
@ -69,8 +69,10 @@ class Share {
|
|||
public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) {
|
||||
if (!isset(self::$backendTypes[$itemType])) {
|
||||
self::$backendTypes[$itemType] = array('class' => $class, 'collectionOf' => $collectionOf, 'supportedFileExtensions' => $supportedFileExtensions);
|
||||
if(count(self::$backendTypes) === 1) {
|
||||
\OC_Util::addScript('core', 'share');
|
||||
\OC_Util::addStyle('core', 'share');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
\OC_Log::write('OCP\Share', 'Sharing backend '.$class.' not registered, '.self::$backendTypes[$itemType]['class'].' is already registered for '.$itemType, \OC_Log::WARN);
|
||||
|
|
Loading…
Reference in New Issue