本文整理汇总了PHP中event_access_tool函数的典型用法代码示例。如果您正苦于以下问题:PHP event_access_tool函数的具体用法?PHP event_access_tool怎么用?PHP event_access_tool使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了event_access_tool函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prolog
/**
* 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_access_tool(TOOL_NOTEBOOK);
}
示例2: api_protect_course_script
<?php
/* For licensing terms, see /license.txt */
/**
* Layout (principal view) used for structuring other views
* @author Christian Fasanando <christian1827@gmail.com>
* @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_access_tool(TOOL_COURSE_DESCRIPTION);
// Display
echo $content;
// Footer
Display::display_footer();
示例3: prolog
/**
* Prepare the environment. Set up breadcrumps and raise tracking event.
*/
protected function prolog()
{
event_access_tool(TOOL_GLOSSARY);
}
示例4: header
}
}
header('Location: ../newscorm/lp_controller.php?' . api_get_cidreq() . '&lp_id=' . $o_ppt->lp_id . '&action=view_item&id=' . $first_item_id);
} else {
if (!empty($o_ppt->error)) {
$errorMessage = $o_ppt->error;
} else {
$errorMessage = get_lang('OogieUnknownError');
}
}
} else {
$errorMessage = get_lang('OogieBadExtension');
}
}
}
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);
}
$form = new FormValidator('upload_ppt', 'POST', '', '');
$form->addElement('header', get_lang("WelcomeOogieSubtitle"));
$form->addElement('html', Display::return_message($message, 'info', false));
示例5: array
}
/* Header */
if (isset($origin) && $origin == 'learnpath') {
Display::display_reduced_header();
} else {
if (isset($_GET['keyword']) && !empty($_GET['keyword'])) {
$interbreadcrumb[] = array("url" => "user.php", "name" => get_lang("Users"));
$tool_name = get_lang('SearchResults');
} else {
$tool_name = get_lang('Users');
$origin = 'users';
}
Display::display_header($tool_name, "User");
}
//statistics
event_access_tool(TOOL_USER);
/* Setting the permissions for this page */
$is_allowed_to_track = api_is_course_admin() || $is_courseTutor;
// Tool introduction
Display::display_introduction_section(TOOL_USER, 'left');
$actions = '';
if (api_is_allowed_to_edit(null, true)) {
echo '<div class="actions">';
// the action links
if (api_get_setting('allow_user_course_subscription_by_course_admin') == 'true' or api_is_platform_admin()) {
$actions .= '<a href="subscribe_user.php?' . api_get_cidreq() . '">' . Display::return_icon('user_subscribe_course.png', get_lang("SubscribeUserToCourse"), '', ICON_SIZE_MEDIUM) . '</a> ';
$actions .= "<a href=\"subscribe_user.php?" . api_get_cidreq() . "&type=teacher\">" . Display::return_icon('teacher_subscribe_course.png', get_lang("SubscribeUserToCourseAsTeacher"), '', ICON_SIZE_MEDIUM) . "</a> ";
}
$actions .= '<a href="user.php?' . api_get_cidreq() . '&action=export&type=csv">' . Display::return_icon('export_csv.png', get_lang('ExportAsCSV'), '', ICON_SIZE_MEDIUM) . '</a> ';
$actions .= '<a href="user.php?' . api_get_cidreq() . '&action=export&type=xls">' . Display::return_icon('export_excel.png', get_lang('ExportAsXLS'), '', ICON_SIZE_MEDIUM) . '</a> ';
if (api_get_setting('allow_user_course_subscription_by_course_admin') == 'true' or api_is_platform_admin()) {
示例6: api_get_path
* @package chamilo.learnpath
* @author Diego Escalante Urrelo <diegoe@gmail.com>
* @author Marco Antonio Villegas Vega <marvil07@gmail.com>
* @author Julio Montoya <gugli100@gmail.com> 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';
$htmlHeadXtra[] = '<link rel="stylesheet" type="text/css" href="'. api_get_path(WEB_PATH) .'main/newscorm/lp_list_search.css" />';
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');
示例7: get_last_tool_access
/* For licensing terms, see /license.txt */
// The file that contains all the initialisation stuff (and includes all the configuration stuff)
require_once 'dropbox_init.inc.php';
// get the last time the user accessed the tool
if ($_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 {
$last_access = $_SESSION[$_course['id']]['last_access'][TOOL_DROPBOX];
}
$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_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']);
}
示例8: api_protect_course_script
<?php
/* For licensing terms, see /license.txt */
// protect a course script
api_protect_course_script(true);
Display::display_reduced_header();
// Tracking
event_access_tool($tool);
// Display
echo $content;
示例9: api_get_path
<?php
/* For licensing terms, see /license.txt */
/**
* Script allowing simple edition of learnpath information (title, description, etc)
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
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_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\';
}
示例10: array
// the learning path, we do not include the banner so we have to explicitly
// include the stylesheet, which is normally done in the header
if (!empty($group_id)) {
$group_properties = GroupManager::get_group_properties($group_id);
$interbreadcrumb[] = array("url" => "../group/group.php", "name" => get_lang('Groups'));
$interbreadcrumb[] = array("url" => "../group/group_space.php?gidReq=" . $group_id, "name" => get_lang('GroupSpace') . ' ' . $group_properties['name']);
Display::display_header($nameTools, 'Agenda');
} elseif (empty($origin) or $origin != 'learnpath') {
Display::display_header($nameTools, 'Agenda');
} else {
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"" . api_get_path(WEB_CODE_PATH) . "css/default.css\"/>";
}
/*
TRACKING
*/
event_access_tool(TOOL_CALENDAR_EVENT);
/* SETTING SOME VARIABLES
*/
// Variable definitions
// Defining the shorts for the days. We use camelcase because these are arrays of language variables
$DaysShort = api_get_week_days_short();
// Defining the days of the week to allow translation of the days. We use camelcase because these are arrays of language variables
$DaysLong = api_get_week_days_long();
// Defining the months of the year to allow translation of the months. We use camelcase because these are arrays of language variables
$MonthsLong = api_get_months_long();
// Database table definitions
$TABLEAGENDA = Database::get_course_table(TABLE_AGENDA);
$TABLE_ITEM_PROPERTY = Database::get_course_table(TABLE_ITEM_PROPERTY);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_courseUser = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_group = Database::get_course_table(TABLE_GROUP);
示例11: api_protect_course_script
// 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_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
示例12: setFocus
// Additional javascript
$htmlHeadXtra[] = NotebookManager::javascript_notebook();
$htmlHeadXtra[] = '<script type="text/javascript">
function setFocus(){
$("#note_title").focus();
}
$(document).ready(function () {
setFocus();
});
</script>';
// Setting the tool constants
$tool = TOOL_NOTEBOOK;
// Tracking
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
示例13: get_lang
$("#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();
/* TRACKING */
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) {
示例14: get_lang
handle: ".moved", //only the class "moved"
});
});
</script>';
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_access_tool(TOOL_QUIZ);
// Tool introduction
Display::display_introduction_section(TOOL_QUIZ);
HotPotGCt($documentPath, 1, api_get_user_id());
// Only for administrator
if ($is_allowedToEdit) {
if (!empty($choice)) {
// Construction of Exercise
$objExerciseTmp = new Exercise();
$check = Security::check_token('get');
$exercise_action_locked = api_resource_is_locked_by_gradebook($exerciseId, LINK_EXERCISE);
if ($objExerciseTmp->read($exerciseId)) {
if ($check) {
switch ($choice) {
case 'delete':
// deletes an exercise
示例15: api_get_course_int_id
$course_id = api_get_course_int_id();
// Create default category if it doesn't exist when group categories aren't allowed
if (api_get_setting('allow_group_categories') == 'false') {
$cat_table = Database::get_course_table(TABLE_GROUP_CATEGORY);
$sql = "SELECT * FROM {$cat_table} WHERE c_id = {$course_id} AND id = '" . GroupManager::DEFAULT_GROUP_CATEGORY . "'";
$res = Database::query($sql);
$num = Database::num_rows($res);
if ($num == 0) {
$sql = "INSERT INTO " . $cat_table . "\n (c_id, id, title, description, forum_state, wiki_state, max_student, self_reg_allowed, self_unreg_allowed, groups_per_user, display_order)\n VALUES ({$course_id}, '2', '" . Database::escape_string(get_lang('DefaultGroupCategory')) . "', '', '1', '1', '8', '0', '0', '0', '0');";
Database::query($sql);
}
}
/* Header */
if (!isset($_GET['origin']) || $_GET['origin'] != 'learnpath') {
// So we are not in learnpath tool
event_access_tool(TOOL_GROUP);
if (!$is_allowed_in_course) {
api_not_allowed(true);
}
}
Display::display_header(get_lang('Groups'));
// Tool introduction
Display::display_introduction_section(TOOL_GROUP);
/*
* Self-registration and un-registration
*/
$my_group_id = isset($_GET['group_id']) ? intval($_GET['group_id']) : null;
$my_msg = isset($_GET['msg']) ? Security::remove_XSS($_GET['msg']) : null;
$my_group = isset($_REQUEST['group']) ? Security::remove_XSS($_REQUEST['group']) : null;
$my_get_id1 = isset($_GET['id1']) ? Security::remove_XSS($_GET['id1']) : null;
$my_get_id2 = isset($_GET['id2']) ? Security::remove_XSS($_GET['id2']) : null;