예제 #1
0
 /**
  * Prepare the environment. Set up breadcrumps and raise tracking event.
  */
 protected function prolog()
 {
     global $interbreadcrumb;
     $interbreadcrumb = array();
     $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Notebook'));
     global $this_section;
     $this_section = SECTION_COURSES;
     global $current_course_tool;
     $current_course_tool = TOOL_NOTEBOOK;
     // Tracking
     Event::event_access_tool(TOOL_NOTEBOOK);
 }
예제 #2
0
    $nameTools = '';
    $interbreadcrumb[] = array('url' => 'link.php?' . api_get_cidreq(), 'name' => get_lang('Links'));
    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('AddLink'));
}
if ($action == 'addcategory') {
    $nameTools = '';
    $interbreadcrumb[] = array('url' => 'link.php?' . api_get_cidreq(), 'name' => get_lang('Links'));
    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('AddCategory'));
}
if ($action == 'editlink') {
    $nameTools = '';
    $interbreadcrumb[] = array('url' => 'link.php?' . api_get_cidreq(), 'name' => get_lang('Links'));
    $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditLink'));
}
// Statistics
Event::event_access_tool(TOOL_LINK);
/*	Action Handling */
$nameTools = get_lang('Links');
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
$scope = isset($_REQUEST['scope']) ? $_REQUEST['scope'] : null;
$show = isset($_REQUEST['show']) && in_array(trim($_REQUEST['show']), ['all', 'none']) ? $_REQUEST['show'] : '';
$categoryId = isset($_REQUEST['category_id']) ? intval($_REQUEST['category_id']) : '';
$linkListUrl = api_get_self() . '?' . api_get_cidreq() . '&category_id=' . $categoryId . '&show=' . $show;
$content = null;
switch ($action) {
    case 'addlink':
        if (api_is_allowed_to_edit(null, true)) {
            $form = Link::getLinkForm(null, 'addlink');
            if ($form->validate()) {
                // Here we add a link
                Link::addlinkcategory("link");
예제 #3
0
<?php

/* For licensing terms, see /license.txt */
/**
* Layout (principal view) used for structuring other views
* @author Christian Fasanando <*****@*****.**>
* @package chamilo.course_progress
*/
// protect a course script
api_protect_course_script(true);
// Header
$tool = TOOL_COURSE_PROGRESS;
Display::display_header('');
// Introduction section
Display::display_introduction_section($tool);
// Tracking
Event::event_access_tool($tool);
// Display
echo $content;
// Footer
Display::display_footer();
예제 #4
0
 /**
  * Prepare the environment. Set up breadcrumps and raise tracking event.
  */
 protected function prolog()
 {
     Event::event_access_tool(TOOL_COURSE_DESCRIPTION);
 }
예제 #5
0
<?php

/* For licensing terms, see /license.txt */
/**
 * Script allowing simple edition of learnpath information (title, description, etc)
 * @package chamilo.learnpath
 * @author Yannick Warnier <*****@*****.**>
*/
require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
global $charset;
$show_description_field = false;
//for now
$nameTools = get_lang('Doc');
$this_section = SECTION_COURSES;
Event::event_access_tool(TOOL_LEARNPATH);
api_protect_course_script();
if (isset($_SESSION['gradebook'])) {
    $gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
    $interbreadcrumb[] = array('url' => '../gradebook/' . $_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook'));
}
$interbreadcrumb[] = array('url' => 'lp_controller.php?action=list', 'name' => get_lang('LearningPaths'));
$interbreadcrumb[] = array('url' => api_get_self() . "?action=build&lp_id=" . $_SESSION['oLP']->get_id(), 'name' => $_SESSION['oLP']->get_name());
$htmlHeadXtra[] = '<script>
function activate_start_date() {
	if(document.getElementById(\'start_date_div\').style.display == \'none\') {
		document.getElementById(\'start_date_div\').style.display = \'block\';
	} else {
		document.getElementById(\'start_date_div\').style.display = \'none\';
	}
예제 #6
0
                }
                header('Location: ../newscorm/lp_controller.php?' . api_get_cidreq() . '&lp_id=' . $o_ppt->lp_id . '&action=view_item&id=' . $first_item_id);
                exit;
            } else {
                if (!empty($o_ppt->error)) {
                    $errorMessage = $o_ppt->error;
                } else {
                    $errorMessage = get_lang('OogieUnknownError');
                }
            }
        } else {
            $errorMessage = get_lang('OogieBadExtension');
        }
    }
}
Event::event_access_tool(TOOL_UPLOAD);
// check access permissions (edit permission is needed to add a document or a LP)
$is_allowed_to_edit = api_is_allowed_to_edit();
if (!$is_allowed_to_edit) {
    api_not_allowed(true);
}
$interbreadcrumb[] = array("url" => "../newscorm/lp_controller.php?action=list", "name" => get_lang("Doc"));
$nameTools = get_lang("OogieConversionPowerPoint");
Display::display_header($nameTools);
$message = get_lang("WelcomeOogieConverter");
if (!empty($errorMessage)) {
    echo Display::return_message($errorMessage, 'warning', false);
}
$div_upload_limit = get_lang('UploadMaxSize') . ' : ' . ini_get('post_max_size');
$form = new FormValidator('upload_ppt', 'POST', '', '');
$form->addElement('header', get_lang("WelcomeOogieSubtitle"));
예제 #7
0
파일: user.php 프로젝트: KRCM13/chamilo-lms
} else {
    // If student can unsubscribe
    if (isset($_REQUEST['unregister']) && $_REQUEST['unregister'] == 'yes') {
        if ($course_info['unsubscribe'] == 1) {
            $user_id = api_get_user_id();
            CourseManager::unsubscribe_user($user_id, $course_info['code']);
            header('Location: ' . api_get_path(WEB_PATH) . 'user_portal.php');
            exit;
        }
    }
}
if (!$is_allowed_in_course) {
    api_not_allowed(true);
}
// Statistics
Event::event_access_tool(TOOL_USER);
/**
 * Get the users to display on the current page.
 */
function get_number_of_users()
{
    $counter = 0;
    $sessionId = api_get_session_id();
    $courseCode = api_get_course_id();
    $active = isset($_GET['active']) ? $_GET['active'] : null;
    if (!empty($sessionId)) {
        $a_course_users = CourseManager::get_user_list_from_course_code($courseCode, $sessionId, null, null, null, null, false, false, null, null, null, $active);
    } else {
        $a_course_users = CourseManager::get_user_list_from_course_code($courseCode, 0, null, null, null, null, false, false, null, null, null, $active);
    }
    foreach ($a_course_users as $o_course_user) {
예제 #8
0
파일: work.php 프로젝트: KRCM13/chamilo-lms
        if (!empty($my_folder_data)) {
            $interbreadcrumb[] = array('url' => 'work.php?id=' . $work_id . '&' . api_get_cidreq(), 'name' => $my_folder_data['title']);
        }
        if ($action == 'upload_form') {
            $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('UploadADocument'));
        }
        if ($action == 'settings') {
            $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('EditToolOptions'));
        }
        if ($action == 'create_dir') {
            $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('CreateAssignment'));
        }
    }
}
// Stats
Event::event_access_tool(TOOL_STUDENTPUBLICATION);
$is_allowed_to_edit = api_is_allowed_to_edit();
$student_can_edit_in_session = api_is_allowed_to_session_edit(false, true);
/*	Display links to upload form and tool options */
if (!in_array($action, array('add', 'create_dir'))) {
    $token = Security::get_token();
}
$courseInfo = api_get_course_info();
$currentUrl = api_get_path(WEB_CODE_PATH) . 'work/work.php?' . api_get_cidreq();
$content = null;
// For teachers
switch ($action) {
    case 'settings':
        //if posts
        if ($is_allowed_to_edit && !empty($_POST['changeProperties'])) {
            updateSettings($course, $_POST['show_score'], $_POST['student_delete_own_publication']);
예제 #9
0
파일: chat.php 프로젝트: KRCM13/chamilo-lms
$current_course_tool = TOOL_CHAT;
$this_section = SECTION_COURSES;
$nameTools = get_lang('ToolChat');
$origin = isset($_GET["origin"]) ? Security::remove_XSS($_GET["origin"]) : null;
$target = isset($_GET["target"]) ? Security::remove_XSS($_GET["target"]) : null;
if ($origin != 'whoisonline') {
    api_protect_course_script(true);
} else {
    $origin = $_SESSION['origin'];
    $target = $_SESSION['target'];
    $_SESSION['origin'] = $origin;
    $_SESSION['target'] = $target;
}
api_protect_course_group(GroupManager::GROUP_TOOL_CHAT, false);
/*  TRACKING */
Event::event_access_tool(TOOL_CHAT);
header('Content-Type: text/html; charset=UTF-8');
/*
 * Choose CSS style (platform's, user's, or course's)
 */
$my_style = api_get_visual_theme();
$mycourseid = api_get_course_id();
if (!empty($mycourseid) && $mycourseid != -1) {
    $open_chat_window = api_get_course_setting('allow_open_chat_window');
}
$courseCode = Security::remove_XSS($_GET['cidReq']);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
예제 #10
0
    } else {
        $errorXmlExport = Display::return_message(get_lang('ErrorWritingXMLFile'), 'error');
    }
}
if ($origin != 'learnpath') {
    //so we are not in learnpath tool
    Display::display_header($nameTools, get_lang('Exercise'));
    if (isset($_GET['message'])) {
        if (in_array($_GET['message'], array('ExerciseEdited'))) {
            Display::display_confirmation_message(get_lang($_GET['message']));
        }
    }
} else {
    Display::display_reduced_header();
}
Event::event_access_tool(TOOL_QUIZ);
// Tool introduction
Display::display_introduction_section(TOOL_QUIZ);
if (!empty($errorXmlExport)) {
    echo $errorXmlExport;
}
HotPotGCt($documentPath, 1, $userId);
// Only for administrator
if ($is_allowedToEdit) {
    if (!empty($choice)) {
        // All test choice, clean all test's results
        if ($choice == 'clean_all_test') {
            $check = Security::check_token('get');
            if ($check) {
                // list of exercises in a course/session
                // we got variable $courseId $courseInfo session api_get_session_id()
예제 #11
0
// Notice for unauthorized people.
api_protect_course_script(true);
// Additional javascript
$htmlHeadXtra[] = NotebookManager::javascript_notebook();
$htmlHeadXtra[] = '<script>
function setFocus(){
$("#note_title").focus();
}
$(document).ready(function () {
  setFocus();
});
</script>';
// Setting the tool constants
$tool = TOOL_NOTEBOOK;
// Tracking
Event::event_access_tool(TOOL_NOTEBOOK);
// Tool name
if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
    $tool = 'NoteAddNew';
    $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
}
if (isset($_GET['action']) && $_GET['action'] == 'editnote') {
    $tool = 'ModifyNote';
    $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('ToolNotebook'));
}
// Displaying the header
Display::display_header(get_lang(ucfirst($tool)));
// Tool introduction
Display::display_introduction_section(TOOL_NOTEBOOK);
// Action handling: Adding a note
if (isset($_GET['action']) && $_GET['action'] == 'addnote') {
예제 #12
0
 /**
  * Prepare the environment. Set up breadcrumps and raise tracking event.
  */
 protected function prolog()
 {
     global $interbreadcrumb;
     $interbreadcrumb = array();
     $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('CourseProgram'));
     $type_id = Request::get_description_type();
     $type = CourseDescriptionType::repository()->find_one_by_id($type_id);
     if ($type) {
         $interbreadcrumb[] = array('url' => '#', 'name' => $type->get_title());
     }
     global $this_section;
     $this_section = SECTION_COURSES;
     global $current_course_tool;
     $current_course_tool = TOOL_COURSE_DESCRIPTION;
     // Tracking
     Event::event_access_tool(TOOL_COURSE_DESCRIPTION);
 }
예제 #13
0
 /**
  * Prepare the environment. Set up breadcrumps and raise tracking event.
  */
 protected function prolog()
 {
     Event::event_access_tool(TOOL_LINK);
 }
예제 #14
0
 /**
  * Prepare the environment. Set up breadcrumps and raise tracking event.
  */
 protected function prolog()
 {
     Event::event_access_tool(TOOL_NOTEBOOK);
 }
예제 #15
0
/**
 * Script to draw the results from a query
 * @package chamilo.learnpath
 * @author Diego Escalante Urrelo <*****@*****.**>
 * @author Marco Antonio Villegas Vega <*****@*****.**>
 * @author Julio Montoya <*****@*****.**> Lots of bug fixing
 *
 */
/**
 * Code
 */
require api_get_path(LIBRARY_PATH) . 'search/search_widget.php';
require api_get_path(LIBRARY_PATH) . 'search/ChamiloQuery.php';
require_once api_get_path(LIBRARY_PATH) . 'search/IndexableChunk.class.php';
require_once api_get_path(LIBRARY_PATH) . 'specific_fields_manager.lib.php';
Event::event_access_tool(TOOL_SEARCH);
if (isset($_SESSION['gradebook'])) {
    $gradebook = $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook == 'view') {
    $interbreadcrumb[] = array('url' => '../gradebook/' . $_SESSION['gradebook_dest'], 'name' => get_lang('ToolGradebook'));
}
$interbreadcrumb[] = array('url' => './index.php', 'name' => get_lang(ucfirst(TOOL_SEARCH)));
search_widget_prepare($htmlHeadXtra);
Display::display_header(null, 'Path');
if (api_get_setting('search_enabled') !== 'true') {
    Display::display_error_message(get_lang('SearchFeatureNotEnabledComment'));
} else {
    if (!empty($_GET['action'])) {
        search_widget_show($_GET['action']);
    } else {
예제 #16
0
    } else {
        $url = api_get_path(WEB_CODE_PATH) . 'calendar/agenda_js.php?';
    }
    header("Location: {$url}");
    exit;
}
/* 	Resource linker */
Session::write('source_type', 'Agenda');
//require_once '../resourcelinker/resourcelinker.inc.php';
$group_id = api_get_group_id();
$eventId = isset($_REQUEST['id']) ? $_REQUEST['id'] : null;
$type = $event_type = isset($_GET['type']) ? $_GET['type'] : null;
$htmlHeadXtra[] = "<script>\n\nfunction plus_repeated_event() {\n    if (document.getElementById('options2').style.display == 'none') {\n        document.getElementById('options2').style.display = 'block';\n    } else {\n        document.getElementById('options2').style.display = 'none';\n    }\n}\n    \$(function() {\n        var checked = \$('input[name=repeat]').attr('checked');\n        if (checked) {\n            \$('#options2').show();\n        }\n    });\n</script>\n";
// setting the name of the tool
$nameTools = get_lang('Agenda');
Event::event_access_tool(TOOL_CALENDAR_EVENT);
// permission stuff - also used by loading from global in agenda.inc.php
$is_allowed_to_edit = api_is_allowed_to_edit(false, true) || api_get_course_setting('allow_user_edit_agenda') && !api_is_anonymous();
$agenda = new Agenda();
$agenda->type = $type;
$actions = $agenda->displayActions('calendar');
if ($type == 'fromjs') {
    $id_list = explode('_', $eventId);
    $eventId = $id_list[1];
    $event_type = $id_list[0];
}
if (!api_is_allowed_to_edit(null, true) && $event_type == 'course') {
    api_not_allowed(true);
}
if ($event_type == 'course') {
    $agendaUrl = api_get_path(WEB_CODE_PATH) . 'calendar/agenda_js.php?' . api_get_cidreq() . '&type=course';
예제 #17
0
if (isset($_SESSION[$_course['id']]) && $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX] == '') {
    $last_access = get_last_tool_access(TOOL_DROPBOX);
    $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX] = $last_access;
} else {
    if (isset($_SESSION[$_course['id']])) {
        $last_access = $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX];
    }
}
$categoryName = isset($_POST['category_name']) ? $_POST['category_name'] : '';
$editId = isset($_POST['edit_id']) ? $_POST['edit_id'] : '';
$postAction = isset($_POST['action']) ? $_POST['action'] : null;
$view = isset($_GET['view']) ? Security::remove_XSS($_GET['view']) : null;
$viewReceivedCategory = isset($_GET['view_received_category']) ? Security::remove_XSS($_GET['view_received_category']) : null;
$viewSentCategory = isset($_GET['view_sent_category']) ? Security::remove_XSS($_GET['view_sent_category']) : null;
// Do the tracking
Event::event_access_tool(TOOL_DROPBOX);
// This var is used to give a unique value to every page request. This is to prevent resubmiting data
$dropbox_unid = md5(uniqid(rand(), true));
/*	DISPLAY SECTION */
Display::display_introduction_section(TOOL_DROPBOX);
// Build URL-parameters for table-sorting
$sort_params = array();
if (isset($_GET['dropbox_column'])) {
    $sort_params[] = 'dropbox_column=' . $_GET['dropbox_column'];
}
if (isset($_GET['dropbox_page_nr'])) {
    $sort_params[] = 'page_nr=' . intval($_GET['page_nr']);
}
if (isset($_GET['dropbox_per_page'])) {
    $sort_params[] = 'dropbox_per_page=' . intval($_GET['dropbox_per_page']);
}
예제 #18
0
<?php

/* For licensing terms, see /license.txt */
/**
* Layout (principal view) used for structuring other views
* @author Christian Fasanando <*****@*****.**>
* @package chamilo.course_description
*/
// protect a course script
api_protect_course_script(true);
// Header
Display::display_header('');
// Introduction section
Display::display_introduction_section(TOOL_COURSE_DESCRIPTION);
// Tracking
Event::event_access_tool(TOOL_COURSE_DESCRIPTION);
// Display
echo $content;
// Footer
Display::display_footer();
예제 #19
0
// Maximum title messages to display
$maximum = '12';
// Length of the titles
$length = '36';
// Database Table Definitions
$tbl_courses = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_sessions = Database::get_main_table(TABLE_MAIN_SESSION);
$tbl_announcement = Database::get_course_table(TABLE_ANNOUNCEMENT);
$tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
$course_id = api_get_course_int_id();
$_course = api_get_course_info_by_id($course_id);
$group_id = api_get_group_id();
$sessionId = api_get_session_id();
api_protect_course_group(GroupManager::GROUP_TOOL_ANNOUNCEMENT);
/*	Tracking	*/
Event::event_access_tool(TOOL_ANNOUNCEMENT);
$announcement_id = isset($_GET['id']) ? intval($_GET['id']) : null;
$origin = isset($_GET['origin']) ? Security::remove_XSS($_GET['origin']) : null;
$action = isset($_GET['action']) ? Security::remove_XSS($_GET['action']) : 'list';
$announcement_number = AnnouncementManager::getNumberAnnouncements();
$homeUrl = api_get_self() . '?action=list&' . api_get_cidreq();
$content = '';
$searchFormToString = '';
switch ($action) {
    case 'move':
        /* Move announcement up/down */
        if (!empty($_GET['down'])) {
            $thisAnnouncementId = intval($_GET['down']);
            $sortDirection = "DESC";
        }
        if (!empty($_GET['up'])) {
예제 #20
0
// Notification for unauthorized people.
api_protect_course_script(true);
// Additional javascripts.
$htmlHeadXtra[] = GlossaryManager::javascript_glossary();
$htmlHeadXtra[] = '<script>
function setFocus(){
    $("#glossary_title").focus();
}
$(document).ready(function () {
    setFocus();
});
</script>';
// setting the tool constants
$tool = TOOL_GLOSSARY;
// Tracking
Event::event_access_tool(TOOL_GLOSSARY);
function sorter($item1, $item2)
{
    if ($item1[2] == $item2[2]) {
        return 0;
    }
    return $item1[2] < $item2[2] ? -1 : 1;
}
// Displaying the header
$action = isset($_GET['action']) ? $_GET['action'] : null;
$tool = 'GlossaryManagement';
$interbreadcrumb[] = array("url" => "index.php", "name" => get_lang('Glossary'));
if (!empty($action)) {
}
switch ($action) {
    case 'addglossary':
예제 #21
0
    //if is called from a learning path lp_id
    $lp_id = isset($_REQUEST['lp_id']) ? intval($_REQUEST['lp_id']) : null;
    handle_forum_and_forumcategories($lp_id);
}
// Notification
if ($actions == 'notify' && isset($_GET['content']) && isset($_GET['id'])) {
    if (api_get_session_id() != 0 && api_is_allowed_to_session_edit(false, true) == false) {
        api_not_allowed();
    }
    $return_message = set_notification($_GET['content'], $_GET['id']);
    Display::display_confirmation_message($return_message, false);
}
get_whats_new();
$whatsnew_post_info = Session::read('whatsnew_post_info');
/* TRACKING */
Event::event_access_tool(TOOL_FORUM);
/*
    RETRIEVING ALL THE FORUM CATEGORIES AND FORUMS
    note: we do this here just after het handling of the actions to be
    sure that we already incorporate the latest changes
*/
// Step 1: We store all the forum categories in an array $forum_categories.
$forumCategories = get_forum_categories();
// Step 2: We find all the forums (only the visible ones if it is a student).
// display group forum in general forum tool depending to configuration option
$setting = api_get_setting('display_groups_forum_in_general_tool');
$forum_list = get_forums('', '', $setting == 'true');
$user_id = api_get_user_id();
/* RETRIEVING ALL GROUPS AND THOSE OF THE USER */
// The groups of the user.
$groups_of_user = array();
예제 #22
0
    });

    $("#end_date_toggle").click(function() {
        $("#end_date").toggle();
    });
});

</script>';
/* Constants and variables */
$tool_name = get_lang('ToolWiki');
/* ACCESS */
api_protect_course_script();
api_block_anonymous_users();
api_protect_course_group(GroupManager::GROUP_TOOL_WIKI);
/* TRACKING */
Event::event_access_tool(TOOL_WIKI);
if ($groupId) {
    $group_properties = GroupManager::get_group_properties($groupId);
    $interbreadcrumb[] = array("url" => api_get_path(WEB_CODE_PATH) . "group/group.php?" . api_get_cidreq(), "name" => get_lang('Groups'));
    $interbreadcrumb[] = array("url" => api_get_path(WEB_CODE_PATH) . "group/group_space.php?" . api_get_cidreq(), "name" => get_lang('GroupSpace') . ' ' . Security::remove_XSS($group_properties['name']));
    //ensure this tool in groups whe it's private or deactivated
    if ($group_properties['wiki_state'] == 0) {
        api_not_allowed();
    } elseif ($group_properties['wiki_state'] == 2) {
        if (!api_is_allowed_to_edit(false, true) and !GroupManager::is_user_in_group(api_get_user_id(), api_get_group_id())) {
            api_not_allowed();
        }
    }
}
$is_allowed_to_edit = api_is_allowed_to_edit(false, true);
// The page we are dealing with
예제 #23
0
 /**
  * Prepare the environment. Set up breadcrumps and raise tracking event.
  */
 protected function prolog()
 {
     Event::event_access_tool(TOOL_GLOSSARY);
 }
예제 #24
0
// Language file that needs to be included
$language_file = 'survey';
if (!isset($_GET['cidReq'])) {
    $_GET['cidReq'] = 'none';
    // Prevent sql errors
    $cidReset = true;
}
// Including the global initialization file
//require_once '../inc/global.inc.php';
$this_section = SECTION_COURSES;
$current_course_tool = TOOL_SURVEY;
api_protect_course_script(true);
// Including additional libraries
require_once 'survey.lib.php';
// Tracking
Event::event_access_tool(TOOL_SURVEY);
/** @todo This has to be moved to a more appropriate place (after the display_header of the code)*/
if (!api_is_allowed_to_edit(false, true)) {
    // Coach can see this
    Display::display_header(get_lang('SurveyList'));
    SurveyUtil::survey_list_user($_user['user_id']);
    Display::display_footer();
    exit;
}
$extend_rights_for_coachs = api_get_setting('extend_rights_for_coach_on_survey');
// Database table definitions
$table_survey = Database::get_course_table(TABLE_SURVEY);
$table_survey_question = Database::get_course_table(TABLE_SURVEY_QUESTION);
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
// Language variables
예제 #25
0
        $req_gid = '&amp;gidReq=' . $groupId;
        $interbreadcrumb[] = array("url" => "../group/group_space.php?gidReq=" . $groupId, "name" => get_lang('GroupSpace'));
        $noPHP_SELF = true;
        $path = explode('/', $dir);
        if ('/' . $path[1] != $group_properties['directory']) {
            api_not_allowed(true);
        }
    }
    $interbreadcrumb[] = array("url" => "./document.php?curdirpath=" . urlencode($dir) . $req_gid, "name" => get_lang('Documents'));
} else {
    $interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . 'gradebook/' . $_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
}
if (!($is_allowed_to_edit || GroupManager::groupMemberWithUploadRights() || is_my_shared_folder($_user['user_id'], Security::remove_XSS($dir), api_get_session_id()))) {
    api_not_allowed(true);
}
Event::event_access_tool(TOOL_DOCUMENT);
$display_dir = $dir;
if (isset($group_properties)) {
    $display_dir = explode('/', $dir);
    unset($display_dir[0]);
    unset($display_dir[1]);
    $display_dir = implode('/', $display_dir);
}
$select_cat = isset($_GET['selectcat']) ? intval($_GET['selectcat']) : null;
// Create a new form
$form = new FormValidator('create_document', 'post', api_get_self() . '?' . api_get_cidreq() . '&dir=' . Security::remove_XSS(urlencode($dir)) . '&selectcat=' . $select_cat, null, array('class' => 'form-horizontal'));
// form title
$form->addElement('header', $nameTools);
if ($is_certificate_mode) {
    //added condition for certicate in gradebook
    $form->addElement('hidden', 'certificate', 'true', array('id' => 'certificate'));
예제 #26
0
 public function prolog()
 {
     Event::event_access_tool(TOOL_LINK);
     //legacy
     global $interbreadcrumb;
     $interbreadcrumb = array();
     $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('Links'));
     global $current_course_tool;
     global $this_section;
     global $nameTools;
     $current_course_tool = TOOL_LINK;
     $this_section = SECTION_COURSES;
     $nameTools = get_lang('Links');
 }