本文整理汇总了PHP中Agenda::getEvents方法的典型用法代码示例。如果您正苦于以下问题:PHP Agenda::getEvents方法的具体用法?PHP Agenda::getEvents怎么用?PHP Agenda::getEvents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Agenda
的用法示例。
在下文中一共展示了Agenda::getEvents方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.calendar
*/
require_once '../inc/global.inc.php';
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . "calendar/agenda_js.php", 'name' => get_lang('Agenda'));
$currentCourseId = api_get_course_int_id();
$agenda = new Agenda();
$type = isset($_REQUEST['type']) ? $_REQUEST['type'] : null;
$agenda->setType($type);
$events = $agenda->getEvents(null, null, $currentCourseId, api_get_group_id(), null, 'array');
$this_section = SECTION_MYAGENDA;
if (!empty($currentCourseId) && $currentCourseId != -1) {
// Agenda is inside a course tool
$url = api_get_self() . '?' . api_get_cidreq();
$this_section = SECTION_COURSES;
} else {
// Agenda is out of the course tool (e.g personal agenda)
$url = false;
foreach ($events as &$event) {
$courseId = isset($event['course_id']) ? $event['course_id'] : '';
$event['url'] = api_get_self() . '?cid=' . $courseId . '&type=' . $event['type'];
}
}
$actions = $agenda->displayActions('list');
$tpl = new Template(get_lang('Events'));
$tpl->assign('agenda_events', $events);
$tpl->assign('url', $url);
$tpl->assign('actions', $actions);
示例2: array
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.calendar
*/
require_once '../inc/global.inc.php';
$interbreadcrumb[] = array('url' => api_get_path(WEB_CODE_PATH) . "calendar/agenda_js.php", 'name' => get_lang('Agenda'));
$agenda = new Agenda();
$type = isset($_REQUEST['type']) ? $_REQUEST['type'] : null;
$agenda->setType($type);
$events = $agenda->getEvents(null, null, api_get_course_int_id(), api_get_group_id(), null, 'array');
$this_section = SECTION_MYAGENDA;
if (!empty($GLOBALS['_cid']) && $GLOBALS['_cid'] != -1) {
// Agenda is inside a course tool
$url = api_get_self() . '?' . api_get_cidreq();
$this_section = SECTION_COURSES;
} else {
// Agenda is out of the course tool (e.g personal agenda)
$url = false;
foreach ($events as &$event) {
$courseId = isset($event['course_id']) ? $event['course_id'] : '';
$event['url'] = api_get_self() . '?cid=' . $courseId . '&type=' . $event['type'];
}
}
$tpl = new Template(get_lang('Events'));
$tpl->assign('agenda_events', $events);
$actions = $agenda->displayActions('list');
$tpl->assign('url', $url);
$tpl->assign('actions', $actions);
$tpl->assign('is_allowed_to_edit', api_is_allowed_to_edit());
示例3: explode
$id = explode('_', $_REQUEST['id']);
$id = $id[1];
$agenda->move_event($id, $day_delta, $minute_delta);
break;
case 'get_events':
$filter = isset($_REQUEST['user_id']) ? $_REQUEST['user_id'] : null;
$sessionId = isset($_REQUEST['session_id']) ? $_REQUEST['session_id'] : null;
$result = $agenda->parseAgendaFilter($filter);
$groupId = current($result['groups']);
$userId = current($result['users']);
$start = isset($_REQUEST['start']) ? api_strtotime($_REQUEST['start']) : null;
$end = isset($_REQUEST['end']) ? api_strtotime($_REQUEST['end']) : null;
if ($type == 'personal' && !empty($sessionId)) {
$agenda->setSessionId($sessionId);
}
$events = $agenda->getEvents($start, $end, api_get_course_int_id(), $groupId, $userId);
echo $events;
break;
case 'get_user_agenda':
//Used in the admin user list
api_protect_admin_script();
if (api_is_allowed_to_edit(null, true)) {
//@todo move this in the agenda class
$DaysShort = api_get_week_days_short();
$MonthsLong = api_get_months_long();
$user_id = intval($_REQUEST['user_id']);
$my_course_list = CourseManager::get_courses_list_by_user_id($user_id, true);
if (!is_array($my_course_list)) {
// this is for the special case if the user has no courses (otherwise you get an error)
$my_course_list = array();
}