Exemplo n.º 1
0
                             foreach ($courses_proposed as $course) {
                                 $editedUser->addCourses($course['courses_ID']);
                             }
                         }
                     }
                 }
             }
         }
         exit;
     }
 }
 $smarty->assign("T_DATASOURCE_SORT_BY", 0);
 if (isset($_GET['ajax']) && $_GET['ajax'] == 'toggle_user' && $_GET['type'] == 'course') {
     $response = array('status' => 1);
     $editCourse = new EfrontCourse($_GET['id']);
     if ($editCourse->isUserActiveInCourse($editedUser)) {
         $editCourse->unConfirm($editedUser);
         $response['access'] = 0;
     } else {
         $editCourse->confirm($editedUser);
         $response['access'] = 1;
     }
     echo json_encode($response);
     exit;
 } else {
     if (isset($_GET['ajax']) && in_array($_GET['ajax'], array('courseLessonsTable', 'instancesTable', 'coursesTable'))) {
         $roles = EfrontLessonUser::getLessonsRoles(true);
         $smarty->assign("T_ROLES_ARRAY", $roles);
         $directionsTree = new EfrontDirectionsTree();
         $smarty->assign("T_DIRECTION_PATHS", $directionsTree->toPathString());
         $rolesBasic = EfrontLessonUser::getLessonsRoles();