diff options
Diffstat (limited to 'lib/models/Institute.class.php')
| -rw-r--r-- | lib/models/Institute.class.php | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/models/Institute.class.php b/lib/models/Institute.class.php index 1ba4eb0..9e662cc 100644 --- a/lib/models/Institute.class.php +++ b/lib/models/Institute.class.php @@ -320,17 +320,11 @@ class Institute extends SimpleORMap implements Range */ public function setDefaultTools() { - $this->tools = []; - foreach (array_values($this->getSemClass()->getActivatedModuleObjects()) as $pos => $module) { - $this->tools[] = ToolActivation::create( - [ - 'plugin_id' => $module->getPluginId(), - 'range_type' => 'institute', - 'range_id' => $this->id, - 'position' => $pos - ] - ); - } + $this->tools = []; + foreach (array_values($this->getSemClass()->getActivatedModuleObjects()) as $module) { + PluginManager::getInstance()->setPluginActivated($module->getPluginId(), $this->id, true); + $this->tools[] = ToolActivation::find([$this->id, $module->getPluginId()]); + } } /** |
