示例#1
0
    $lessonData = \PTA\App::getLesson($level, $lesson);
    $bgImage = $user->getBackgroundImage();
    # Get the preceding and following lessons for back/next style buttons
    $prev_lesson = $user->getPreviousLesson($level, $lesson);
    $next_lesson = $user->getNextLesson($level, $lesson);
    if ($prev_lesson !== null) {
        $prev_lesson = '/level/' . $prev_lesson[0] . '/' . $prev_lesson[1] . '/exam';
    }
    if ($next_lesson !== null) {
        $next_lesson = '/level/' . $next_lesson[0] . '/' . $next_lesson[1] . '/exam';
    }
    $app->render('lesson-exam.twig', ['pjax' => array_key_exists('X-PJAX', getallheaders()), 'bgImage' => $bgImage, 'lesson' => $lesson, 'level' => $level, 'neturl' => \PTA\App::getNetConnectionUrl(), 'next_lesson' => $next_lesson, 'prev_lesson' => $prev_lesson, 'title_ar' => $lessonData['title_ar'], 'title_en' => $lessonData['title_en'], 'url' => \PTA\App::getExamURL($level, $lesson, $user->getUserId(), $user->createNonce($_SERVER['REMOTE_ADDR'], 'exam')), 'user_id' => $user->getUserId()]);
});
$app->get('/level/:level/congratulations', function ($level) use($app, $user) {
    # If the request is for a higher level than is available then redirect to the home screen
    if ($level < 2 || !$user->isLevelAvailable($level)) {
        $app->redirect('/home');
    }
    $names = preg_split('/\\s/', $user->getName());
    $app->render('congratulations.twig', ['pjax' => array_key_exists('X-PJAX', getallheaders()), 'level' => $level, 'firstname' => $names[0]]);
});
$app->get('/apihelp/', function () use($app, $user) {
    $app->contentType('text/plain');
    print_r(\AM_Lite::getInstance()->getAccess());
    print_r(\AM_Lite::getInstance()->getProducts());
    echo "\n\n# AM_Lite User Array\n\n";
    print_r(\AM_Lite::getInstance()->getUser());
    echo "\n\n# AM_Lite Methods\n\n";
    $class = new ReflectionClass(get_class(\AM_Lite::getInstance()));
    print_r($class->getMethods());
});
示例#2
0
 public function getEmail()
 {
     $email = \AM_Lite::getInstance()->getEmail();
     return strtolower(trim($email));
 }