Skip to content
Snippets Groups Projects
Commit 2c14e026 authored by André Noack's avatar André Noack Committed by André Noack
Browse files

fixes #381

parent e3c988b9
No related branches found
No related tags found
No related merge requests found
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
class Step00349 extends Migration class Step00349 extends Migration
{ {
private $registered_modules = [ private $registered_modules = [
'overview' => ['id' => 20, 'const' => '', 'sem' => true, 'inst' => false], 'overview' => ['id' => 20, 'const' => '', 'sem' => true, 'inst' => true],
'admin' => ['id' => 17, 'const' => '', 'sem' => true, 'inst' => false], 'admin' => ['id' => 17, 'const' => '', 'sem' => true, 'inst' => true],
'forum' => ['id' => 0, 'const' => '', 'sem' => true, 'inst' => true], 'forum' => ['id' => 0, 'const' => '', 'sem' => true, 'inst' => true],
'documents' => ['id' => 1, 'const' => '', 'sem' => true, 'inst' => true], 'documents' => ['id' => 1, 'const' => '', 'sem' => true, 'inst' => true],
'schedule' => ['id' => 2, 'const' => '', 'sem' => true, 'inst' => false], 'schedule' => ['id' => 2, 'const' => '', 'sem' => true, 'inst' => false],
...@@ -263,11 +263,13 @@ class Step00349 extends Migration ...@@ -263,11 +263,13 @@ class Step00349 extends Migration
$modules_list = []; $modules_list = [];
$pos = 0; $pos = 0;
foreach ($this->registered_modules as $key => $val) { foreach ($this->registered_modules as $key => $val) {
$module = $sem_class->getSlotModule($key); if ($val[$range_type === 'sem' ? 'sem' : 'inst']) {
if ($sem_class->isModuleAllowed($module)) { $module = $sem_class->getSlotModule($key);
if (($modules & pow(2, $val['id'])) || $sem_class->isSlotMandatory($key)) { if ($sem_class->isModuleAllowed($module)) {
$modules_list[$pos] = $module; if (($modules & pow(2, $val['id'])) || $sem_class->isSlotMandatory($key)) {
$pos++; $modules_list[$pos] = $module;
$pos++;
}
} }
} }
} }
...@@ -294,7 +296,8 @@ class OldSemClass implements ArrayAccess ...@@ -294,7 +296,8 @@ class OldSemClass implements ArrayAccess
"scm", "scm",
"wiki", "wiki",
"calendar", "calendar",
"elearning_interface" "elearning_interface",
"personal"
]; ];
protected static $core_modules = [ protected static $core_modules = [
"CoreOverview", "CoreOverview",
...@@ -352,6 +355,8 @@ class OldSemClass implements ArrayAccess ...@@ -352,6 +355,8 @@ class OldSemClass implements ArrayAccess
'admin' => 'CoreAdmin' // always available 'admin' => 'CoreAdmin' // always available
]; ];
$slots = [ $slots = [
'overview' => 'CoreOverview',
'admin' => 'CoreAdmin',
'forum' => 'Blubber', 'forum' => 'Blubber',
'documents' => 'CoreDocuments', 'documents' => 'CoreDocuments',
'scm' => 'CoreScm', 'scm' => 'CoreScm',
...@@ -360,15 +365,15 @@ class OldSemClass implements ArrayAccess ...@@ -360,15 +365,15 @@ class OldSemClass implements ArrayAccess
'elearning_interface' => 'CoreElearningInterface', 'elearning_interface' => 'CoreElearningInterface',
'personal' => 'CorePersonal' 'personal' => 'CorePersonal'
]; ];
$modules = [ $modules = [];
'CoreOverview' => ['activated' => 1, 'sticky' => 1],
'CoreAdmin' => ['activated' => 1, 'sticky' => 1]
];
foreach ($slots as $slot => $module) { foreach ($slots as $slot => $module) {
$data[$slot] = $module; $data[$slot] = $module;
$modules[$module] = ['activated' => (int)$INST_MODULES[$type][$slot], 'sticky' => 0]; $modules[$module] = ['activated' => (int)$INST_MODULES[$type][$slot], 'sticky' => 0];
} }
$modules = array_merge($modules, [
'CoreOverview' => ['activated' => 1, 'sticky' => 1],
'CoreAdmin' => ['activated' => 1, 'sticky' => 1]
]);
$data['modules'] = json_encode($modules); $data['modules'] = json_encode($modules);
return new self($data); return new self($data);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment