Esempio n. 1
0
 public function __construct()
 {
     $this->courseCode = claro_get_current_course_id();
     $this->courseId = ClaroCourse::getIdFromCode($this->courseCode);
     $this->userId = claro_get_current_user_id();
     $this->profileId = claro_get_current_user_profile_id_in_course();
     $this->viewMode = claro_get_tool_view_mode();
     $this->courseObject = new ClaroCourse();
     $this->courseObject->load($this->courseCode);
     $this->currentCourseContext = Claro_Context::getUrlContext(array(CLARO_CONTEXT_COURSE => $this->courseCode));
     $this->template = new CoreTemplate('coursetoollist.tpl.php');
 }
Esempio n. 2
0
/**
 * Function that removes the need to directly use is_courseAdmin global in
 * tool scripts. It returns true or false depending on the user's rights in
 * this particular course.
 *
 * @version 1.1, February 2004
 * @return boolean true: the user has the rights to edit, false: he does not
 * @author Roan Embrechts
 * @author Patrick Cool
 */
function claro_is_allowed_to_edit()
{
    if (claro_is_course_manager()) {
        $isAllowedToEdit = true;
    } else {
        if (claro_is_in_a_tool()) {
            $isAllowedToEdit = claro_is_allowed_tool_edit();
        } else {
            $isAllowedToEdit = false;
        }
    }
    if (claro_is_display_mode_available()) {
        return $isAllowedToEdit && claro_get_tool_view_mode() != 'STUDENT';
    } else {
        return $isAllowedToEdit;
    }
}