本文整理汇总了PHP中Agenda::get_events方法的典型用法代码示例。如果您正苦于以下问题:PHP Agenda::get_events方法的具体用法?PHP Agenda::get_events怎么用?PHP Agenda::get_events使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Agenda
的用法示例。
在下文中一共展示了Agenda::get_events方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
if (!api_is_allowed_to_edit(null, true) && $type == 'course') {
break;
}
$day_delta = $_REQUEST['day_delta'];
$minute_delta = $_REQUEST['minute_delta'];
$id = explode('_', $_REQUEST['id']);
$id = $id[1];
$agenda->move_event($id, $day_delta, $minute_delta);
break;
case 'get_events':
$user_id = isset($_REQUEST['user_id']) ? $_REQUEST['user_id'] : null;
if (substr($user_id, 0, 1) == 'G') {
$length = strlen($user_id);
$group_id = substr($user_id, 2, $length - 1);
}
$events = $agenda->get_events($_REQUEST['start'], $_REQUEST['end'], api_get_course_int_id(), $group_id, $user_id);
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();
}
示例2: array
<?php
/* For licensing terms, see /license.txt */
/**
* @package chamilo.calendar
*/
// name of the language file that needs to be included
$language_file = array('agenda', 'group', 'announcements');
require_once '../inc/global.inc.php';
require_once 'agenda.lib.php';
require_once 'agenda.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->get_events(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
// Little hack to sort the events by start date in personal agenda (Agenda events List view - See #8014)
usort($events, function ($a, $b) {
$t1 = strtotime($a['start']);
$t2 = strtotime($b['start']);
return $t1 - $t2;
});
$url = false;
foreach ($events as &$event) {
$event['url'] = api_get_self() . '?cid=' . $event['course_id'] . '&type=' . $event['type'];
}
$url = api_get_self() . '?' . api_get_cidreq();
$this_section = SECTION_COURSES;
示例3: explode
break;
}
$day_delta = $_REQUEST['day_delta'];
$minute_delta = $_REQUEST['minute_delta'];
$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;
$result = $agenda->parseAgendaFilter($filter);
$groupId = current($result['groups']);
$userId = current($result['users']);
$start = isset($_REQUEST['start']) ? $_REQUEST['start'] : null;
$end = isset($_REQUEST['end']) ? $_REQUEST['end'] : null;
$events = $agenda->get_events($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();
}