Newer
Older
/**
*
*/
public function setDefaultTools()
{
$this->tools = [];

André Noack
committed
foreach (array_values($this->getSemClass()->getActivatedModuleObjects()) as $module) {
PluginManager::getInstance()->setPluginActivated($module->getPluginId(), $this->id, true);
$this->tools[] = ToolActivation::find([$this->id, $module->getPluginId()]);
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
}
}
/**
* @param $name string name of tool / plugin
* @return bool
*/
public function isToolActive($name)
{
$plugin = PluginEngine::getPlugin($name);
return $plugin && $this->tools->findOneby('plugin_id', $plugin->getPluginId());
}
/**
* returns all activated plugins/modules for this course
* @return StudipModule[]
*/
public function getActivatedTools()
{
return array_filter($this->tools->getStudipModule());
}
/**
* @see Range::__toString()
*/
public function __toString() : string
{
return $this->getFullName();
}