Example #1
0
 /**
  * Get all glossary ids
  *
  * @param
  * @return
  */
 function getAllGlossaryIds($a_include_offline_childs = false)
 {
     global $tree;
     if ($this->isVirtual()) {
         $glo_ids = array();
         $virtual_mode = $this->getRefId() ? $this->getVirtualMode() : '';
         switch ($virtual_mode) {
             case "level":
                 $glo_arr = $tree->getChildsByType($tree->getParentId($this->getRefId()), "glo");
                 $glo_ids[] = $this->getId();
                 foreach ($glo_arr as $glo) {
                     $glo_ids[] = $glo['obj_id'];
                 }
                 if (!$a_include_offline_childs) {
                     $glo_ids = ilObjGlossary::removeOfflineGlossaries($glo_ids);
                 }
                 // always show entries of current glossary (if no permission is given, user will not come to the presentation screen)
                 // see bug #14477
                 if (!in_array($this->getId(), $glo_ids)) {
                     $glo_ids[] = $this->getId();
                 }
                 break;
             case "subtree":
                 $subtree_nodes = $tree->getSubTree($tree->getNodeData($tree->getParentId($this->getRefId())));
                 foreach ($subtree_nodes as $node) {
                     if ($node['type'] == 'glo') {
                         $glo_ids[] = $node['obj_id'];
                     }
                 }
                 if (!$a_include_offline_childs) {
                     $glo_ids = ilObjGlossary::removeOfflineGlossaries($glo_ids);
                 }
                 // always show entries of current glossary (if no permission is given, user will not come to the presentation screen)
                 // see bug #14477
                 if (!in_array($this->getId(), $glo_ids)) {
                     $glo_ids[] = $this->getId();
                 }
                 break;
                 // fallback to none virtual mode in case of error
             // fallback to none virtual mode in case of error
             default:
                 $glo_ids[] = $this->getId();
                 break;
         }
     } else {
         $glo_ids = $this->getId();
     }
     return $glo_ids;
 }
 /**
  * Get all glossary ids
  *
  * @param
  * @return
  */
 function getAllGlossaryIds($a_include_offline_childs = false)
 {
     global $tree;
     if ($this->isVirtual()) {
         $glo_ids = array();
         $virtual_mode = $this->getRefId() ? $this->getVirtualMode() : '';
         switch ($virtual_mode) {
             case "level":
                 $glo_arr = $tree->getChildsByType($tree->getParentId($this->getRefId()), "glo");
                 $glo_ids[] = $this->getId();
                 foreach ($glo_arr as $glo) {
                     $glo_ids[] = $glo['obj_id'];
                 }
                 if (!$a_include_offline_childs) {
                     $glo_ids = ilObjGlossary::removeOfflineGlossaries($glo_ids);
                 }
                 break;
             case "subtree":
                 $subtree_nodes = $tree->getSubTree($tree->getNodeData($tree->getParentId($this->getRefId())));
                 foreach ($subtree_nodes as $node) {
                     if ($node['type'] == 'glo') {
                         $glo_ids[] = $node['obj_id'];
                     }
                 }
                 if (!$a_include_offline_childs) {
                     $glo_ids = ilObjGlossary::removeOfflineGlossaries($glo_ids);
                 }
                 break;
                 // fallback to none virtual mode in case of error
             // fallback to none virtual mode in case of error
             default:
                 $glo_ids[] = $this->getId();
                 break;
         }
     } else {
         $glo_ids = $this->getId();
     }
     return $glo_ids;
 }