Ejemplo n.º 1
0
                             // And assign them
                             foreach ($lessons_proposed as $lesson) {
                                 $editedUser->addLessons($lesson['lesson_ID']);
                             }
                         }
                     }
                 }
             }
         }
         exit;
     }
 }
 if (isset($_GET['ajax']) && $_GET['ajax'] == 'toggle_user' && $_GET['type'] == 'lesson' && $_change_lessons_) {
     $response = array('status' => 1);
     $editLesson = new EfrontLesson($_GET['id']);
     if ($editLesson->isUserActiveInLesson($editedUser)) {
         $editLesson->unConfirm($editedUser);
         $response['access'] = 0;
     } else {
         $editLesson->confirm($editedUser);
         $response['access'] = 1;
     }
     echo json_encode($response);
     exit;
 } else {
     if (isset($_GET['ajax']) && in_array($_GET['ajax'], array('lessonsTable'))) {
         $roles = EfrontLessonUser::getLessonsRoles(true);
         $smarty->assign("T_ROLES_ARRAY", $roles);
         $directionsTree = new EfrontDirectionsTree();
         $smarty->assign("T_DIRECTION_PATHS", $directionsTree->toPathString());
         $rolesBasic = EfrontLessonUser::getLessonsRoles();