本文整理汇总了PHP中Agenda::parseAgendaFilter方法的典型用法代码示例。如果您正苦于以下问题:PHP Agenda::parseAgendaFilter方法的具体用法?PHP Agenda::parseAgendaFilter怎么用?PHP Agenda::parseAgendaFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Agenda
的用法示例。
在下文中一共展示了Agenda::parseAgendaFilter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: FormValidator
$tpl->addGlobal('type_label', $type_label);
$tpl->addGlobal('type_event_class', $type_event_class);
// Current user can add event?
$tpl->addGlobal('can_add_events', $can_add_events);
//Setting AJAX caller
if (!empty($userId)) {
$agenda_ajax_url = api_get_path(WEB_AJAX_PATH) . 'agenda.ajax.php?user_id=' . $userId . '&type=' . $type;
} else {
$agenda_ajax_url = api_get_path(WEB_AJAX_PATH) . 'agenda.ajax.php?type=' . $type;
}
$tpl->addGlobal('web_agenda_ajax_url', $agenda_ajax_url);
$course_code = api_get_course_id();
//This will fill the select called #users_to_send_id
$form = new FormValidator('form', 'get', null, null, array('id' => 'add_event_form'));
$form->addElement('html', '<div id="visible_to_input">');
$sendTo = $agenda->parseAgendaFilter($userId);
$addOnlyItemsInSendTo = true;
if ($sendTo['everyone']) {
$addOnlyItemsInSendTo = false;
}
$agenda->showToForm($form, $sendTo, array(), $addOnlyItemsInSendTo);
$form->addElement('html', '</div>');
$form->addElement('html', '<div id="visible_to_read_only" style="display: none">');
$form->addElement('label', get_lang('To'), '<div id="visible_to_read_only_users"></div>');
$form->addElement('html', '</div>');
$form->addElement('label', get_lang('Agenda'), '<div id="color_calendar"></div>');
$form->addElement('label', get_lang('Date'), '<span id="start_date"></span><span id="end_date"></span>');
$form->addElement('text', 'title', get_lang('Title'), array('id' => 'title'));
$form->addElement('textarea', 'content', get_lang('Description'), array('id' => 'content'));
if ($agenda->type == 'course') {
$form->addElement('html', '<div id="add_as_announcement_div" style="display: none">');
示例2: explode
$agenda->resizeEvent($id, $day_delta, $minute_delta);
break;
case 'move_event':
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':
$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