} 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') { foreach ($bookmarks as $value) { $urls[] = $value['url']; } if (!in_array($_SERVER['PHP_SELF'] . "?view_unit=" . $currentUnit['id'], $urls)) { $fields = array('users_LOGIN' => $currentUser->user['login'], 'lessons_ID' => $currentLesson->lesson['id'], 'name' => $currentUnit['name'], 'url' => $_SERVER['PHP_SELF'] . "?view_unit=" . $currentUnit['id']); bookmarks::create($fields); } } else { echo json_encode($bookmarks); } } catch (Exception $e) { handleAjaxExceptions($e); } exit; } /*Added Session variable for search results*/ $_SESSION['referer'] = $_SERVER['REQUEST_URI']; //$_SESSION['last_action_timestamp'] = time(); //Keep the last time something happened to the session /*Horizontal menus*/ $onlineUsers = EfrontUser::getUsersOnline($GLOBALS['configuration']['autologout_time'] * 60); if ($GLOBALS['currentTheme']->options['sidebar_interface']) {