public function getFilePath($requestedUrl) { if (claro_is_in_a_course()) { if (claro_is_in_a_group() && claro_is_group_allowed()) { $intermediatePath = get_path('coursesRepositorySys') . claro_get_course_path() . '/group/' . claro_get_current_group_data('directory'); } else { $intermediatePath = get_path('coursesRepositorySys') . claro_get_course_path() . '/document'; } } else { $intermediatePath = rtrim(str_replace('\\', '/', get_path('rootSys')), '/') . '/platform/document'; } if (get_conf('secureDocumentDownload') && $GLOBALS['is_Apache']) { // pretty url $path = realpath($intermediatePath . '/' . $requestedUrl); } else { // TODO check if we can remove rawurldecode $path = $intermediatePath . implode('/', array_map('rawurldecode', explode('/', $requestedUrl))); } return $path; }
require_once get_path('incRepositorySys') . '/lib/image.lib.php'; /* * Permissions */ if (claro_is_in_a_course() && !claro_is_in_a_group()) { // course context $is_allowedToEdit = claro_is_allowed_to_edit(); $pathSys = get_path('coursesRepositorySys') . claro_get_course_path() . '/document/'; $pathWeb = get_path('coursesRepositoryWeb') . claro_get_course_path() . '/document/'; require claro_get_conf_repository() . 'CLDOC.conf.php'; $maxFilledSpace = get_conf('maxFilledSpace_for_course'); } elseif (claro_is_in_a_group()) { // course context $is_allowedToEdit = claro_is_allowed_to_edit(); $pathSys = get_path('coursesRepositorySys') . claro_get_course_path() . '/group/' . claro_get_current_group_data('directory'); $pathWeb = get_path('coursesRepositoryWeb') . claro_get_course_path() . '/group/' . claro_get_current_group_data('directory'); require claro_get_conf_repository() . 'CLDOC.conf.php'; $maxFilledSpace = get_conf('maxFilledSpace_for_course'); } else { // platform context $is_allowedToEdit = claro_is_platform_admin(); $pathSys = get_path('rootSys') . 'platform/document/'; $pathWeb = get_path('rootWeb') . 'platform/document/'; } /* * Libraries */ include_once $includePath . '/lib/fileUpload.lib.php'; include_once $includePath . '/lib/fileManage.lib.php'; /* * Init directory
/***************** * DISPLAY SECTION ******************/ Claroline::getDisplay()->body->appendContent(claro_html_tool_title(array('supraTitle' => get_lang("Groups"), 'mainTitle' => claro_get_current_group_data('name') . ' <img src="' . get_icon_url('group') . '" alt="" />'))); $groupSpaceTemplate = new CoreTemplate('group_space.tpl.php'); $groupSpaceTemplate->assign('dialogBox', $dialogBox); $groupSpaceTemplate->assign('displayRegistrationLink', $is_allowedToSelfRegInGroup && !array_key_exists('registration', $_REQUEST)); $groupSpaceTemplate->assign('displayUnregistrationLink', $is_allowedToSelfUnregInGroup && !array_key_exists('unregistration', $_REQUEST)); $groupSpaceTemplate->assign('displayTutorRegistrationLink', $isTutorRegAllowed && !array_key_exists('tutorRegistration', $_REQUEST)); $groupSpaceTemplate->assign('displayTutorUnregistrationLink', $isTutorUnregAllowed && !array_key_exists('tutorUnregistration', $_REQUEST)); $groupSpaceTemplate->assign('toolLinkList', $toolLinkList); /*---------------------------------------------------------------------------- DISPLAY GROUP DESCRIPTION ----------------------------------------------------------------------------*/ if (strlen(claro_get_current_group_data('description')) > 0) { $groupSpaceTemplate->assign('groupDescription', claro_get_current_group_data('description')); } else { $groupSpaceTemplate->assign('groupDescription', get_lang("(none)")); } /*---------------------------------------------------------------------------- DISPLAY GROUP TUTOR INFORMATION ----------------------------------------------------------------------------*/ $groupSpaceTemplate->assign('tutorDataList', $tutorDataList); /*---------------------------------------------------------------------------- DISPLAY GROUP MEMBER LIST ----------------------------------------------------------------------------*/ $context = Claro_Context::getCurrentContext(); $context[CLARO_CONTEXT_GROUP] = null; $urlContext = Claro_Context::getUrlContext($context); $groupSpaceTemplate->assign('urlContext', $urlContext); $groupSpaceTemplate->assign('groupMemberList', $groupMemberList);
$_course = claro_get_current_course_data(); function is_parent_path($parentPath, $childPath) { // convert the path for operating system harmonize $parentPath = realpath($parentPath); $childPath = realpath($parentPath . $childPath); if ($childPath !== false) { // verify if the file exists and if the file is under parent path return preg_match('|^' . preg_quote($parentPath) . '|', $childPath); } else { return false; } } if (claro_is_in_a_group() && claro_is_group_allowed()) { $_group = claro_get_current_group_data(); $courseDir = claro_get_course_path() . '/group/' . claro_get_current_group_data('directory'); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Documents and Links'), 'document.php'); ClaroBreadCrumbs::getInstance()->prepend(get_lang('Groups'), '../group/group.php'); } else { $courseDir = claro_get_course_path() . '/document'; ClaroBreadCrumbs::getInstance()->prepend(get_lang('Documents and Links'), 'document.php'); } $noPHP_SELF = true; $baseWorkDir = get_path('coursesRepositorySys') . $courseDir; if (!empty($_REQUEST['cmd'])) { $cmd = $_REQUEST['cmd']; } else { $cmd = null; } if (!empty($_REQUEST['cwd'])) { $cwd = $_REQUEST['cwd'];
/** * @param string $template name of the template */ public function __construct($template) { $template = secure_file_path($template); $customTemplatePath = get_path('rootSys') . '/platform/templates/' . $template; $defaultTemplatePath = get_path('includePath') . '/templates/' . $template; if (file_exists($customTemplatePath)) { parent::__construct($customTemplatePath); } elseif (file_exists($defaultTemplatePath)) { parent::__construct($defaultTemplatePath); } else { throw new Exception("Template not found {$template} " . "at custom location {$customTemplatePath} " . "or default location {$defaultTemplatePath} !"); } if (claro_is_in_a_course()) { $this->course = claro_get_current_course_data(); require_once dirname(__FILE__) . '/../claroCourse.class.php'; $this->courseObject = new ClaroCourse(); $this->courseObject->load(claro_get_current_course_id()); // Fetch related courses $this->relatedCourses = $this->courseObject->getRelatedCourses(); // $this->relatedUserCourses = $this->courseObject->getRelatedUserCourses(claro_get_current_user_id()); if (claro_is_in_a_group()) { $this->group = claro_get_current_group_data(); } } if (claro_is_user_authenticated()) { $this->user = claro_get_current_user_data(); } }
/** * Return the breadcrumb to display in the header * * @global string $nameTools * @global array $interbredcrump * @global boolean $noPHP_SELF * @global boolean $noQUERY_STRING * * @return string html content */ function claro_html_breadcrumb() { // dirty global to keep value (waiting a refactoring) global $nameTools, $interbredcrump, $noPHP_SELF, $noQUERY_STRING; /****************************************************************************** BREADCRUMB LINE ******************************************************************************/ $htmlBC = ''; if (claro_is_in_a_course() || isset($nameTools) || isset($interbredcrump) && is_array($interbredcrump)) { $htmlBC .= '<div id="breadcrumbLine">' . "\n\n" . '<hr />' . "\n"; $breadcrumbUrlList = array(); $breadcrumbNameList = array(); $breadcrumbUrlList[] = get_path('url') . '/index.php'; $breadcrumbNameList[] = get_conf('siteName'); if (claro_is_in_a_course()) { $breadcrumbUrlList[] = get_path('clarolineRepositoryWeb') . 'course/index.php?cid=' . claro_htmlspecialchars(claro_get_current_course_id()); $breadcrumbNameList[] = claro_get_current_course_data('officialCode'); } if (claro_is_in_a_group()) { $breadcrumbUrlList[] = get_module_url('CLGRP') . '/index.php?cidReq=' . claro_htmlspecialchars(claro_get_current_course_id()); $breadcrumbNameList[] = get_lang('Groups'); $breadcrumbUrlList[] = get_module_url('CLGRP') . '/group_space.php?cidReq=' . claro_htmlspecialchars(claro_get_current_course_id()) . '&gidReq=' . (int) claro_get_current_group_id(); $breadcrumbNameList[] = claro_get_current_group_data('name'); } if (isset($interbredcrump) && is_array($interbredcrump)) { while (list(, $bredcrumpStep) = each($interbredcrump)) { $breadcrumbUrlList[] = $bredcrumpStep['url']; $breadcrumbNameList[] = $bredcrumpStep['name']; } } if (isset($nameTools)) { $breadcrumbNameList[] = $nameTools; if (isset($noPHP_SELF) && $noPHP_SELF) { $breadcrumbUrlList[] = null; } elseif (isset($noQUERY_STRING) && $noQUERY_STRING) { $breadcrumbUrlList[] = $_SERVER['PHP_SELF']; } else { // set Query string to empty if not exists if (!isset($_SERVER['QUERY_STRING'])) { $_SERVER['QUERY_STRING'] = ''; } $breadcrumbUrlList[] = $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']; } } $htmlBC .= claro_html_breadcrumbtrail($breadcrumbNameList, $breadcrumbUrlList, ' > ', get_icon_url('home')); if (!claro_is_user_authenticated()) { $htmlBC .= "\n" . '<div id="toolViewOption" style="padding-right:10px">' . '<a href="' . get_path('clarolineRepositoryWeb') . 'auth/login.php' . '?sourceUrl=' . urlencode(base64_encode((isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'])) . '" target="_top">' . get_lang('Login') . '</a>' . '</div>' . "\n"; } elseif (claro_is_in_a_course() && !claro_is_course_member() && claro_get_current_course_data('registrationAllowed') && !claro_is_platform_admin()) { $htmlBC .= '<div id="toolViewOption">' . '<a href="' . get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=exReg&course=' . claro_get_current_course_id() . '">' . '<img src="' . get_icon_url('enroll') . '" alt="" /> ' . '<b>' . get_lang('Enrolment') . '</b>' . '</a>' . '</div>' . "\n"; } elseif (claro_is_display_mode_available()) { $htmlBC .= "\n" . '<div id="toolViewOption">' . "\n"; if (isset($_REQUEST['View mode'])) { $htmlBC .= claro_html_tool_view_option($_REQUEST['View mode']); } else { $htmlBC .= claro_html_tool_view_option(); } if (claro_is_platform_admin() && !claro_is_course_member()) { $htmlBC .= ' | <a href="' . get_path('clarolineRepositoryWeb') . 'auth/courses.php?cmd=exReg&course=' . claro_get_current_course_id() . '">'; $htmlBC .= '<img src="' . get_icon_url('enroll') . '" alt="" /> '; $htmlBC .= '<b>' . get_lang('Enrolment') . '</b>'; $htmlBC .= '</a>'; } $htmlBC .= "\n" . '</div>' . "\n"; } $htmlBC .= '<div class="spacer"></div>' . "\n" . '<hr />' . "\n" . '</div>' . "\n"; } else { // $htmlBC .= '<div style="height:1em"></div>'; } return $htmlBC; }
// Used for the breadcrumb when one need to add a parameter after the filename $_SERVER['QUERY_STRING'] = ''; // Display (3 view modes: image, thumbnails or files) JavascriptLanguage::getInstance()->addLangVar('Are you sure to delete %name ?'); JavascriptLanguage::getInstance()->addLangVar('Click to zoom out'); JavascriptLanguage::getInstance()->addLangVar('Click to zoom in'); JavascriptLoader::getInstance()->load('documents'); $out = ''; $dspCurDirName = claro_htmlspecialchars($curDirName); $dspCurDirPath = claro_htmlspecialchars($curDirPath); $cmdCurDirPath = rawurlencode($curDirPath); $cmdParentDir = rawurlencode($parentDir); // Define toot title and subtitle $titleElement['mainTitle'] = get_lang("Documents and Links"); if (claro_is_in_a_group() && claro_is_group_allowed()) { $titleElement['supraTitle'] = claro_get_current_group_data('name'); } // Get image list from file list if (($docView == 'image' || $docView == 'thumbnails') && isset($fileList)) { $imageList = get_image_list($fileList, $is_allowedToEdit); } // Command list $cmdList = array(); /* * if the $curDirName is empty, we're in the root point * and we can't go to a parent dir */ if ($curDirName || $cmd == 'exSearch') { $cmdList[] = array('img' => 'parent', 'name' => get_lang('Up'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=exChDir&file=' . download_url_encode($parentDir)))); } $cmdList[] = array('img' => 'search', 'name' => get_lang('Search'), 'url' => claro_htmlspecialchars(Url::Contextualize($_SERVER['PHP_SELF'] . '?cmd=rqSearch&cwd=' . $cmdCurDirPath)));
// A PREVIOUS CHECK (AND CREATE IF NEEDED) IS THUS NECESSARY if (!is_dir($curChatRep)) { mkdir($curChatRep, CLARO_FILE_PERMISSIONS); } // DETERMINE IF THE CHAT SYSTEM WILL WORK // EITHER AT THE COURSE LEVEL OR THE GROUP LEVEL if (claro_is_in_a_group()) { if (claro_is_group_allowed()) { $groupContext = TRUE; $courseContext = FALSE; $is_allowedToManage = $is_allowedToManage || claro_is_group_tutor(); $is_allowedToStore = $is_allowedToStore || claro_is_group_tutor(); $is_allowedToReset = $is_allowedToReset || claro_is_group_tutor(); $activeChatFile = $curChatRep . $courseId . '.' . $groupId . '.chat.html'; $onflySaveFile = $curChatRep . $courseId . '.' . $groupId . '.tmpChatArchive.html'; $exportFile = $coursePath . '/group/' . claro_get_current_group_data('directory') . '/'; } else { die('<center>' . get_lang('You are not a member of this group') . '</center>'); } } else { $groupContext = FALSE; $courseContext = TRUE; $activeChatFile = $curChatRep . $courseId . '.chat.html'; $onflySaveFile = $curChatRep . $courseId . '.tmpChatArchive.html'; $exportFile = $coursePath . '/document/'; } $dateNow = claro_html_localised_date(get_locale('dateTimeFormatLong')); $timeNow = claro_html_localised_date('[%d/%m/%y %H:%M]'); if (!file_exists($activeChatFile)) { // create the file $fp = @fopen($activeChatFile, 'w') or die('<center>' . get_lang('Error : Cannot initialize chat') . '</center>');
ClaroBreadCrumbs::getInstance()->append(claro_htmlspecialchars('Properties')); break; case 'rqDelete': ClaroBreadCrumbs::getInstance()->append($wikiTitle); ClaroBreadCrumbs::getInstance()->append(claro_htmlspecialchars('Delete')); break; case 'list': default: $noQUERY_STRING = true; } $out = ''; // --------- Start of display ---------------- // Tool title $toolTitle = array(); if (claro_is_in_a_group()) { $toolTitle['supraTitle'] = claro_get_current_group_data('name'); } switch ($action) { // edit form case 'rqEdit': if ($wikiId == 0) { $toolTitle['mainTitle'] = get_lang("Wiki : Create new Wiki"); } else { $toolTitle['mainTitle'] = get_lang("Wiki : Edit properties"); $toolTitle['subTitle'] = $wikiTitle; } break; // delete form // delete form case 'rqDelete': $toolTitle['mainTitle'] = get_lang("Delete Wiki");
function printInit($selection = "*") { global $uidReset, $cidReset, $gidReset, $tidReset, $uidReq, $cidReq, $gidReq, $tidReq, $tlabelReq, $_user, $_course, $_groupUser, $_courseTool, $_SESSION, $_claro_local_run; if ($_claro_local_run) { echo "local init runned"; } else { echo '<font color="red"> local init never runned during this script </font>'; } echo ' <table width="100%" border="1" cellspacing="4" cellpadding="1" bordercolor="#808080" bgcolor="#C0C0C0" lang="en"> <TR>'; if ($selection == "*" or strstr($selection, "u")) { echo ' <TD valign="top" > <strong>User</strong> : (_uid) : ' . var_export(claro_get_current_user_id(), 1) . ' | (session[_uid]) : ' . var_export($_SESSION["_uid"], 1) . ' <br /> reset = ' . var_export($uidReset, 1) . ' | req = ' . var_export($uidReq, 1) . '<br /> _user : <pre>' . var_export($_user, 1) . '</pre> <br />is_platformAdmin :' . var_export(claro_is_platform_admin(), 1) . ' <br />is_allowedCreateCourse :' . var_export(claro_is_allowed_to_create_course(), 1) . ' </TD>'; } if ($selection == "*" or strstr($selection, "c")) { echo "\n <TD valign=\"top\" >\n <strong>Course</strong> : (_cid)" . var_export(claro_get_current_course_id(), 1) . "\n <br />\n reset = " . var_export($cidReset, 1) . " | req = " . var_export($cidReq, 1) . "\n <br />\n _course : <pre>" . var_export($_course, 1) . "</pre>\n <br />\n _groupProperties :\n <PRE>\n " . var_export(claro_get_current_group_properties_data(), 1) . "\n </PRE>\n </TD>"; } echo ' </TR> <TR>'; if ($selection == "*" or strstr($selection, "g")) { echo '<TD valign="top" ><strong>Group</strong> : (_gid) ' . var_export(claro_get_current_group_id(), 1) . '<br /> reset = ' . var_export($GLOBALS['gidReset'], 1) . ' | req = ' . var_export($gidReq, 1) . "<br />\n _group :<pre>" . var_export(claro_get_current_group_data(), 1) . "</pre></TD>"; } if ($selection == "*" or strstr($selection, "t")) { echo '<TD valign="top" ><strong>Tool</strong> : (_tid)' . var_export(claro_get_current_tool_id(), 1) . '<br /> reset = ' . var_export($tidReset, 1) . ' | req = ' . var_export($tidReq, 1) . '| req = ' . var_export($tlabelReq, 1) . ' <br /> _tool :' . var_export(get_init('_tool'), 1) . "</TD>"; } echo "</TR>"; if ($selection == "*" or strstr($selection, "u") && strstr($selection, "c")) { echo '<TR><TD valign="top" colspan="2"><strong>Course-User</strong>'; if (claro_is_user_authenticated()) { echo '<br /><strong>User</strong> :' . var_export(claro_is_in_a_course(), 1); } if (claro_is_in_a_course()) { echo ' in ' . var_export(claro_get_current_course_id(), 1) . '<br />'; } if (claro_is_user_authenticated() && claro_get_current_course_id()) { echo '_courseUser : <pre>' . var_export(getInit('_courseUser'), 1) . '</pre>'; } echo '<br />is_courseMember : ' . var_export(claro_is_course_member(), 1); echo '<br />is_courseAdmin : ' . var_export(claro_is_course_manager(), 1); echo '<br />is_courseAllowed : ' . var_export(claro_is_course_allowed(), 1); echo '<br />is_courseTutor : ' . var_export(claro_is_course_tutor(), 1); echo '</TD></TR>'; } echo ""; if ($selection == "*" or strstr($selection, "u") && strstr($selection, "g")) { echo '<TR><TD valign="top" colspan="2">' . '<strong>Course-Group-User</strong>'; if (claro_is_user_authenticated()) { echo '<br /><strong>User</strong> :' . var_export(claro_is_in_a_course(), 1); } if (claro_is_in_a_group()) { echo ' in ' . var_export(claro_get_current_group_id(), 1); } if (claro_is_in_a_group()) { echo '<br />_groupUser:'******'_groupUser'), 1); } echo '<br />is_groupMember:' . var_export(claro_is_group_member(), 1) . '<br />is_groupTutor: ' . var_export(claro_is_group_tutor(), 1) . '<br />is_groupAllowed:' . var_export(claro_is_group_allowed(), 1) . '</TD>' . '</tr>'; } if ($selection == "*" or strstr($selection, "c") && strstr($selection, "t")) { echo '<tr> <TD valign="top" colspan="2" ><strong>Course-Tool</strong><br />'; if (claro_get_current_tool_id()) { echo 'Tool :' . claro_get_current_tool_id(); } if (claro_is_in_a_course()) { echo ' in ' . claro_get_current_course_id() . '<br />'; } if (claro_get_current_tool_id()) { echo "_courseTool : <pre>" . var_export($_courseTool, 1) . '</pre><br />'; } echo 'is_toolAllowed : ' . var_export(claro_is_tool_allowed(), 1); echo "</TD>"; } echo "</TR></TABLE>"; }
} else { // Delete all members of this group $sql = 'DELETE FROM `' . $tbl_group_rel_team_user . '` WHERE `team` = "' . (int) claro_get_current_group_id() . '"'; $delGroupUsers = claro_sql_query($sql); $numberMembers--; for ($i = 0; $i <= $numberMembers; $i++) { $sql = "INSERT INTO `" . $tbl_group_rel_team_user . "`\n SET user = "******",\n team = " . (int) claro_get_current_group_id(); $registerUserGroup = claro_sql_query($sql); } $dialogBox->success(get_lang("Group settings modified") . '<br />' . '<a href="' . claro_htmlspecialchars(Url::Contextualize('./group_space.php')) . '">' . get_lang("Group area") . '</a>' . ' - ' . '<a href="' . claro_htmlspecialchars(Url::Contextualize('./group.php')) . '">' . get_lang("Groups") . '</a>'); } // else $gidReset = TRUE; $gidReq = claro_get_current_group_id(); include get_path('incRepositorySys') . '/claro_init_local.inc.php'; $myStudentGroup = claro_get_current_group_data(); } // end if $modify // SELECT TUTORS $tutorList = get_course_tutor_list($currentCourseId); // AND student_group.id='claro_get_current_group_id()' // This statement is DEACTIVATED $tutor_list = array(); $tutor_list[get_lang("(none)")] = 0; foreach ($tutorList as $myTutor) { $tutor_list[claro_htmlspecialchars($myTutor['name'] . ' ' . $myTutor['firstname'])] = $myTutor['userId']; } // Student registered to the course but inserted in no group $limitNumOfGroups = is_null($nbMaxGroupPerUser) || $nbMaxGroupPerUser == 0 ? "" : " AND nbg < " . (int) $nbMaxGroupPerUser; // Get the users not in group $sql = "SELECT `u`.`user_id` AS `user_id`,\n `u`.`nom` AS `lastName`,\n `u`.`prenom` AS `firstName`,\n `cu`.`role` AS `role`,\n COUNT(`ug`.`id`) AS `nbg`,\n COUNT(`ugbloc`.`id`) AS `BLOCK`\n \n FROM (`" . $tbl_user . "` AS u\n , `" . $tbl_rel_user_course . "` AS cu )\n \n LEFT JOIN `" . $tbl_group_rel_team_user . "` AS ug\n ON `u`.`user_id`=`ug`.`user`\n \n LEFT JOIN `" . $tbl_group_rel_team_user . "` AS `ugbloc`\n ON `u`.`user_id`=`ugbloc`.`user` AND `ugbloc`.`team` = " . (int) claro_get_current_group_id() . "\n \n WHERE `cu`.`code_cours` = '" . $currentCourseId . "'\n AND `cu`.`user_id` = `u`.`user_id`\n AND ( `cu`.`isCourseManager` = 0 )\n AND `cu`.`tutor` = 0\n AND ( `ug`.`team` <> " . (int) claro_get_current_group_id() . " OR `ug`.`team` IS NULL )\n \n GROUP BY `u`.`user_id`\n HAVING `BLOCK` = 0\n " . $limitNumOfGroups . "\n ORDER BY\n #`nbg`, #disabled because different of right box\n UPPER(`u`.`nom`), UPPER(`u`.`prenom`), `u`.`user_id`"; $result = Claroline::getDatabase()->query($sql);
$userInput->setValidator('topic', new Claro_Validator_NotEmpty()); $userInput->setValidator('title', new Claro_Validator_ValueType('string')); $userInput->setValidator('title', new Claro_Validator_NotEmpty()); } else { $userInput->setValidator('cmd', new Claro_Validator_AllowedList(array('show', 'exNotify', 'exdoNotNotify'))); } $userInput->setValidator('forum', new Claro_Validator_ValueType('numeric')); $userInput->setValidator('forum', new Claro_Validator_NotEmpty()); $userInput->setValidator('start', new Claro_Validator_ValueType('numeric')); //collect user input $cmd = $userInput->get('cmd', 'show'); try { $forumId = $userInput->getMandatory('forum'); } catch (Exception $e) { if (!isset($forumId) && claro_is_in_a_group() && claro_is_group_allowed()) { $forumId = claro_get_current_group_data('forumId'); if (!$forumId) { throw $e; } } else { throw $e; } } $start = $userInput->get('start', 0); //TODO notification commands should be handled by ajax calls if (!in_array($cmd, array('exNotify', 'exdoNotNotify', 'show'))) { $topicId = $userInput->getMandatory('topic'); } if ('exEditTopic' == $cmd) { $topicTitle = $userInput->getMandatory('title'); }
// description of assignment if (trim($assignment->getDescription()) != '') { $out .= '<b><small>' . get_lang('Description') . '</small></b><br />' . "\n" . '<blockquote>' . "\n" . '<small>' . "\n" . claro_parse_user_text($assignment->getDescription()) . '</small>' . "\n" . '</blockquote>' . "\n" . '<br />' . "\n"; } $out .= '<h4>' . $txtForFormTitle . '</h4>' . "\n" . '<p><a class="backLink" href="' . claro_htmlspecialchars(Url::Contextualize($_SERVER['SCRIPT_NAME'] . '?authId=' . $_REQUEST['authId'] . '&assigId=' . $assignmentId)) . '">' . get_lang('Back') . '</a></p>' . "\n" . '<form method="post" action="' . $_SERVER['PHP_SELF'] . '?assigId=' . $assignmentId . '&authId=' . $_REQUEST['authId'] . '" enctype="multipart/form-data">' . "\n" . '<input type="hidden" name="claroFormId" value="' . uniqid('') . '" />' . "\n" . '<input type="hidden" name="cmd" value="' . $cmdToSend . '" />' . "\n" . claro_form_relay_context(); if (isset($_REQUEST['wrkId'])) { $out .= '<input type="hidden" name="wrkId" value="' . $_REQUEST['wrkId'] . '" />' . "\n"; } elseif (isset($_REQUEST['gradedWrkId'])) { $out .= '<input type="hidden" name="gradedWrkId" value="' . $_REQUEST['gradedWrkId'] . '" />' . "\n"; } $out .= '<fieldset>' . "\n" . '<dl>' . "\n" . '<dt><label for="wrkTitle">' . get_lang('Title') . ' <span class="required">*</span></label></dt>' . "\n" . '<dd><input type="text" name="wrkTitle" id="wrkTitle" size="50" maxlength="200" value="' . claro_htmlspecialchars($form['wrkTitle']) . '" /></dd>' . "\n" . '<dt><label for="wrkAuthors">' . get_lang('Author(s)') . ' <span class="required">*</span></label></dt>' . "\n" . '<dd><input type="text" name="wrkAuthors" id="wrkAuthors" size="50" maxlength="200" value="' . claro_htmlspecialchars($form['wrkAuthors']) . '" /></dd>' . "\n"; // display the list of groups of the user if ($assignment->getAssignmentType() == "GROUP" && !empty($userGroupList) || claro_is_course_manager() && claro_is_in_a_group()) { $out .= '<dt><label for="wrkGroup">' . get_lang('Group') . '</label></dt>' . "\n"; if (claro_is_in_a_group()) { $out .= '<dd>' . "\n" . '<input type="hidden" name="wrkGroup" value="' . claro_get_current_group_id() . '" />' . claro_get_current_group_data('name') . '</dd>' . "\n"; } elseif (isset($_REQUEST['authId'])) { $out .= '<dd>' . "\n" . '<input type="hidden" name="wrkGroup" value="' . $_REQUEST['authId'] . '" />' . $userGroupList[$_REQUEST['authId']]['name'] . '</dd>' . "\n"; } else { // this part is mainly for courseadmin as he have a link in the workList to submit a work $out .= '<dd>' . "\n" . '<select name="wrkGroup" id="wrkGroup">' . "\n"; foreach ($userGroupList as $group) { $out .= '<option value="' . $group['id'] . '"'; if (isset($form['wrkGroup']) && $form['wrkGroup'] == $group['id'] || $_REQUEST['authId'] == $group['id']) { $out .= 'selected="selected"'; } $out .= '>' . $group['name'] . '</option>' . "\n"; } $out .= '</select>' . "\n" . '</dd>' . "\n"; } }
private function autoPrepend() { if (empty($this->currentNode) && array_key_exists('nameTools', $GLOBALS)) { $name = $GLOBALS['nameTools']; if (array_key_exists('noPHP_SELF', $GLOBALS) && $GLOBALS['noPHP_SELF']) { $url = null; } elseif (array_key_exists('noQUERY_STRING', $GLOBALS) && $GLOBALS['noQUERY_STRING']) { $url = $_SERVER['PHP_SELF']; } else { if (!array_key_exists('noQUERY_STRING', $_SERVER)) { $url = $_SERVER['PHP_SELF']; } else { $url = $_SERVER['PHP_SELF'] . '?' . claro_htmlspecialchars(strip_tags($_SERVER['QUERY_STRING'])); } } $url = claro_htmlspecialchars(Url::Contextualize($url)); $this->setCurrentNode(new BreadCrumbsNode($name, $url)); } if (claro_is_in_a_group()) { $this->prependNode(new BreadCrumbsNode(claro_get_current_group_data('name'), claro_htmlspecialchars(get_module_url('CLGRP') . '/group_space.php?cidReq=' . claro_htmlspecialchars(claro_get_current_course_id()) . '&gidReq=' . (int) claro_get_current_group_id()))); $this->prependNode(new BreadCrumbsNode(get_lang('Groups'), claro_htmlspecialchars(get_module_url('CLGRP') . '/index.php?cidReq=' . claro_htmlspecialchars(claro_get_current_course_id())))); } if (claro_is_in_a_course()) { $this->prependNode(new BreadCrumbsNode(claro_get_current_course_data('officialCode'), claro_htmlspecialchars(get_path('clarolineRepositoryWeb') . 'course/index.php?cid=' . claro_get_current_course_id()))); } $this->prependNode(new BreadCrumbsNode(get_conf('siteName'), claro_htmlspecialchars(get_path('url') . '/index.php'), get_icon_url('home'))); }
* * @version $Revision: 13348 $ * @copyright (c) 2001-2011, Universite catholique de Louvain (UCL) * @author Claroline Team <*****@*****.**> * @author Frederic Minne <*****@*****.**> * @license http://www.gnu.org/copyleft/gpl.html * GNU GENERAL PUBLIC LICENSE version 2.0 * @package KERNEL */ require dirname(__FILE__) . '/../inc/claro_init_global.inc.php'; require_once get_path('includePath') . '/lib/thumbnails.lib.php'; require_once get_path('includePath') . '/lib/fileManage.lib.php'; require_once get_path('includePath') . '/lib/file.lib.php'; if (claro_is_in_a_group() && claro_is_group_allowed()) { $documentRootDir = get_path('coursesRepositorySys') . claro_get_course_path() . '/group/' . claro_get_current_group_data('directory'); $thumbnailsDirectory = get_path('coursesRepositorySys') . claro_get_course_path() . '/tmp/thumbs/' . claro_get_current_group_data('directory'); } elseif (claro_is_in_a_course() && claro_is_course_allowed()) { $documentRootDir = get_path('coursesRepositorySys') . claro_get_course_path() . '/document'; $thumbnailsDirectory = get_path('coursesRepositorySys') . claro_get_course_path() . '/tmp/thumbs'; } else { header('HTTP/1.1 403 Forbidden'); exit; } $image = array_key_exists('img', $_REQUEST) ? secure_file_path($_REQUEST['img']) : null; if (is_null($image)) { header('HTTP/1.1 403 Forbidden'); exit; } $imagePath = $documentRootDir . $image; if (file_exists($imagePath)) { list($width, $height, $type, $attr) = getimagesize($imagePath);