reduce nesting of the required app XML

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
This commit is contained in:
Arthur Schiwon 2017-09-27 01:22:17 +02:00
parent 3db3e65121
commit 937a80c941
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23
1 changed files with 12 additions and 3 deletions

View File

@ -174,9 +174,18 @@ class OC_App {
\OC::$server->getActivityManager()->registerProvider($provider);
}
}
if (!empty($info['collaboration']['collaborators']['searchPlugins'])) {
foreach ($info['collaboration']['collaborators']['searchPlugins'] as $plugin) {
\OC::$server->getCollaboratorSearch()->registerPlugin($plugin);
if (!empty($info['collaboration']['plugins'])) {
// deal with one or many plugin entries
$plugins = isset($info['collaboration']['plugins']['plugin']['@value']) ?
[$info['collaboration']['plugins']['plugin']] : $info['collaboration']['plugins']['plugin'];
foreach ($plugins as $plugin) {
if($plugin['@attributes']['type'] === 'collaborator-search') {
$pluginInfo = [
'shareType' => $plugin['@attributes']['shareType'],
'class' => $plugin['@value'],
];
\OC::$server->getCollaboratorSearch()->registerPlugin($pluginInfo);
}
}
}
}