Ejemplo n.º 1
0
 public function switchTree()
 {
     $set = new ilSetting('common');
     $type = $set->get('main_tree_impl', 'ns') == 'ns' ? 'ns' : 'mp';
     if ($type == 'ns' and $_POST['tree_impl_type'] == 'mp') {
         // To mp
         include_once './Services/Tree/classes/class.ilMaterializedPathTree.php';
         ilMaterializedPathTree::createFromParentReleation();
         $set->set('main_tree_impl', 'mp');
     } elseif ($type == 'mp' and $_POST['tree_impl_type'] == 'ns') {
         include_once './Services/Tree/classes/class.ilTree.php';
         $GLOBALS['ilSetting'] = $set;
         $tree = new ilTree(1);
         $tree->renumber(1);
         $set->set('main_tree_impl', 'ns');
     }
     ilUtil::sendInfo($this->lng->txt("tree_implementation_switched"), true);
     $this->displayTools();
 }