예제 #1
0
        // Run onNewPageLoad code of the module (if such is defined)
        $module->onNewPageLoad();
    }
} catch (Exception $e) {
    handleNormalFlowExceptions($e);
}
/*Ajax call to enter group and get group lessons */
if (isset($_GET['ajax']) && isset($_GET['group_key'])) {
    try {
        if (!eF_checkParameter($_GET['group_key'], 'alnum_general')) {
            throw new Exception(_INVALIDDATA . ': ' . $_GET['group_key']);
        }
        $result = eF_getTableData("groups", "*", "unique_key = '" . $_GET['group_key'] . "'");
        if (sizeof($result) > 0) {
            $group = new EfrontGroup($result[0]);
            echo json_encode($group->useKeyForUser($currentUser));
        } else {
            throw new Exception(_INVALIDKEY . ': ' . $_GET['group_key']);
        }
    } catch (Exception $e) {
        handleAjaxExceptions($e);
    }
    exit;
}
if (isset($_GET['bookmarks']) && EfrontUser::isOptionVisible('bookmarks')) {
    try {
        $bookmarks = bookmarks::getBookmarks($currentUser, $currentLesson);
        if ($_GET['bookmarks'] == 'remove' && in_array($_GET['id'], array_keys($bookmarks))) {
            $bookmark = new bookmarks($_GET['id']);
            $bookmark->delete();
        } elseif ($_GET['bookmarks'] == 'add') {