当前位置: 首页>>代码示例>>PHP>>正文


PHP Agenda::getEvents方法代码示例

本文整理汇总了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);
开发者ID:secuencia24,项目名称:chamilo-lms,代码行数:31,代码来源:agenda_list.php

示例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());
开发者ID:KRCM13,项目名称:chamilo-lms,代码行数:31,代码来源:agenda_list.php

示例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();
         }
开发者ID:jloguercio,项目名称:chamilo-lms,代码行数:31,代码来源:agenda.ajax.php


注:本文中的Agenda::getEvents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。