} try { $avatar = new EfrontFile($editedUser->user['avatar']); } catch (Exception $e) { $avatar = new EfrontFile(G_SYSTEMAVATARSPATH . "unknown_small.png"); } $smarty->assign("T_AVATAR", $avatar['url_path']); $smarty->assign("T_EMPLOYEE_SKILLS", $skills_sorted); $smarty->assign("T_EMPLOYEE_SKILL_CATEGORIES", $skill_categories); $smarty->assign('T_EVALUATIONS', $evaluations = $editedEmployee->getEvaluations()); $smarty->assign("T_FORM_PLACEMENTS", $jobs = $editedEmployee->getJobs()); } #cpp#endif if ($editedUser->user['user_type'] != 'administrator') { $directionsTree = new EfrontDirectionsTree(); $directionsArray = $directionsTree->getFlatTree(); $smarty->assign("T_DIRECTIONS_TREE", $directionsPathStrings = $directionsTree->toPathString()); $studentRoles = EfrontLessonUser::getRoles(); foreach ($studentRoles as $key => $value) { if ($value != 'student') { unset($studentRoles[$key]); } } $constraints = array('archive' => false); if ($_COOKIE['setUserFormSelectedSort']) { preg_match("/\\d_(\\w+)--(\\w+)/", $_COOKIE['setUserFormSelectedSort'], $matches); in_array($matches[1], array('name', 'directions_ID', 'active_in_course', 'completed', 'score')) ? $constraints['sort'] = $matches[1] : ($constraints['sort'] = 'name'); $matches[2] == 'desc' ? $constraints['order'] = 'asc' : ($constraints['order'] = 'desc'); } $userCourses = $editedUser->getUserCourses($constraints); foreach ($userCourses as $key => $value) {
if (isset($_GET['id']) && eF_checkParameter($_GET['id'], 'id') && isset($_GET['directions_ID']) && eF_checkParameter($_GET['directions_ID'], 'id')) { $course = new EfrontCourse($_GET['id']); if ($_GET['directions_ID'] != $course->course['directions_ID']) { $updateCourseInstancesCategory = true; //This means we need to update instances to match the course's new category } $course->course['directions_ID'] = $_GET['directions_ID']; $course->persist(); if (isset($updateCourseInstancesCategory) && $updateCourseInstancesCategory) { eF_updateTableData("courses", array("directions_ID" => $course->course['directions_ID']), "instance_source=" . $course->course['id']); } } exit; } catch (Exception $e) { echo $e->getMessage() . ' (' . $e->getCode() . ')'; } } } } else { $directionsTree = new EfrontDirectionsTree(); $directionsPaths = $directionsTree->toPathString(false); $flatTree = $directionsTree->getFlatTree(); foreach ($flatTree as $key => $value) { $flatTree[$key]['pathString'] = $directionsPaths[$value['id']]; $direction = new EfrontDirection($flatTree[$key]); $flatTree[$key]['lessons'] = sizeof($direction->getLessons()); $flatTree[$key]['courses'] = sizeof($direction->getCourses()); } unset($value); $smarty->assign("T_DIRECTIONS_DATA", $flatTree); }