$sessions = $skill->getSessionsBySkill($id); $html = ''; if (!empty($courses) || !empty($sessions)) { Display::display_no_header(); Display::$global_template->assign('skill', $skill_info); Display::$global_template->assign('courses', $courses); Display::$global_template->assign('sessions', $sessions); $html = Display::$global_template->fetch('default/skill/skill_info.tpl'); } echo $html; break; case 'get_skills_tree_json': $user_id = isset($_REQUEST['load_user']) && $_REQUEST['load_user'] == 1 ? api_get_user_id() : 0; $skill_id = isset($_REQUEST['skill_id']) ? intval($_REQUEST['skill_id']) : 0; $depth = isset($_REQUEST['main_depth']) ? intval($_REQUEST['main_depth']) : 2; $all = $skill->get_skills_tree_json($user_id, $skill_id, false, $depth); echo $all; break; case 'get_user_skill': $userId = api_get_user_id(); $skillId = isset($_REQUEST['profile_id']) ? intval($_REQUEST['profile_id']) : 0; $skill = $skill->user_has_skill($userId, $skillId); if ($skill) { echo 1; } else { echo 0; } break; case 'get_all_user_skills': $userId = api_get_user_id(); $skills = $skill->get_user_skills($user_id, true);