/**
  * Get basic skills under node
  *
  * @param
  * @return
  */
 static function getSkillTreeNodes($a_node_id, $a_only_basic = false)
 {
     $skills = array();
     if ($a_node_id > 0) {
         include_once "./Services/Skill/classes/class.ilSkillTemplateReference.php";
         include_once "./Services/Skill/classes/class.ilSkillTree.php";
         $stree = new ilSkillTree();
         if ($stree->isInTree($a_node_id)) {
             $cnode = $stree->getNodeData($a_node_id);
             // is node basic skill?
             if ($cnode["type"] == "skll" || !$a_only_basic) {
                 $skills[] = array("id" => $a_node_id, "type" => $cnode["type"], "parent" => $cnode["parent"], "tref" => 0);
             }
             // is node skill template reference?
             if ($cnode["type"] == "sktr") {
                 $tr_ref = new ilSkillTemplateReference($cnode["child"]);
                 if ($tr_ref->getSkillTemplateId() > 0) {
                     $cnode2 = $stree->getNodeData($tr_ref->getSkillTemplateId());
                     if ($cnode2["child"] > 0) {
                         $childs2 = $stree->getSubTree($cnode2);
                         foreach ($childs2 as $child2) {
                             // find basic skills templates
                             if ($child2["type"] == "sktp" || !$a_only_basic) {
                                 $par = $tr_ref->getSkillTemplateId() == $child2["child"] ? $cnode["child"] : $child2["parent"];
                                 $skills[] = array("id" => $child2["child"], "type" => $child2["type"], "parent" => $par, "tref" => $cnode["child"]);
                             }
                         }
                     }
                 }
             } else {
                 $childs = $stree->getSubTree($cnode);
                 foreach ($childs as $child) {
                     // getSubTree($cnode) will also return $cnode
                     if ($child["child"] == $cnode["child"]) {
                         continue;
                     }
                     // find basic skills
                     if ($child["type"] == "skll" || !$a_only_basic) {
                         $skills[] = array("id" => $child["child"], "type" => $child["type"], "parent" => $child["parent"], "tref" => 0);
                     }
                     // handle template references
                     if ($child["type"] == "sktr") {
                         $tr_ref = new ilSkillTemplateReference($child["child"]);
                         $cnode2 = $stree->getNodeData($tr_ref->getSkillTemplateId());
                         if ($tr_ref->getSkillTemplateId() > 0) {
                             if ($cnode2["child"] > 0) {
                                 $childs2 = $stree->getSubTree($cnode2);
                                 foreach ($childs2 as $child2) {
                                     $par = $tr_ref->getSkillTemplateId() == $child2["child"] ? $cnode2["child"] : $child2["parent"];
                                     // find basic skills templates
                                     if ($child2["type"] == "sktp" || !$a_only_basic) {
                                         $skills[] = array("id" => $child2["child"], "type" => $child2["type"], "parent" => $par, "tref" => $child["child"]);
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     //var_dump($skills);
     return $skills;
 }