Only load js and css once.

This commit is contained in:
Thomas Tanghus 2012-08-23 05:02:09 +02:00
parent 2d97164f80
commit c90c358f0d
1 changed files with 13 additions and 11 deletions

View File

@ -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);