"../group/group_space.php?".api_get_cidreq(), "name" => get_lang('Group area'), ]; $noPHP_SELF = true; $group = GroupManager::get_group_properties($groupId); $path = explode('/', $dir); if ('/'.$path[1] != $group['directory']) { api_not_allowed(true); } } $interbreadcrumb[] = [ "url" => "./document.php?id=".$documentId."&".api_get_cidreq(), "name" => get_lang('Documents'), ]; if (!api_is_allowed_in_course()) { api_not_allowed(true); } $isMySharedFolder = DocumentManager::is_my_shared_folder($userId, Security::remove_XSS($dir), $sessionId); if (!($isAllowedToEdit || $groupRights || $isMySharedFolder)) { api_not_allowed(true); } /* Header */ Event::event_access_tool(TOOL_DOCUMENT); $displayDir = $dir; if (isset($group)) { $displayDir = explode('/', $dir); unset($displayDir[0]); unset($displayDir[1]); $displayDir = implode('/', $displayDir); } // Interbreadcrumb for the current directory root path $counter = 0; if (isset($documentData['parents'])) { foreach ($documentData['parents'] as $documentSubData) { //fixing double group folder in breadcrumb if ($groupId) { if ($counter == 0) { $counter++; continue; } } $interbreadcrumb[] = [ 'url' => $documentSubData['document_url'], 'name' => $documentSubData['title'], ]; $counter++; } } $actions = Display::toolbarAction( 'webcam_toolbar', [ Display::url( Display::return_icon( 'back.png', get_lang('Back to').' '.get_lang('Documents overview'), [], ICON_SIZE_MEDIUM ), 'document.php?id='.$documentId.'&'.api_get_cidreq() ), ] ); $template = new Template($nameTools); $template->assign('webcam_dir', $webcamdir); $template->assign('user_id', $userId); $template->assign('filename', 'video_clip.jpg'); $layout = $template->get_template('document/webcam.tpl'); $content = $template->fetch($layout); $template->assign('header', get_lang('Take your photos')); $template->assign('actions', $actions); $template->assign('content', $content); $template->display_one_col_template();