2011-05-28 04:01:30 +00:00
|
|
|
<?php
|
2016-06-19 20:04:34 +00:00
|
|
|
/**
|
|
|
|
* @file include/event.php
|
|
|
|
* @brief functions specific to event handling
|
|
|
|
*/
|
2011-05-28 04:01:30 +00:00
|
|
|
|
2015-10-17 07:41:58 +00:00
|
|
|
function format_event_html($ev, $simple = false) {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::getHTML($ev, $simple);
|
2011-06-08 03:10:43 +00:00
|
|
|
}
|
|
|
|
|
2011-06-09 23:24:29 +00:00
|
|
|
function format_event_bbcode($ev) {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::getBBCode($ev);
|
2011-06-09 23:24:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function bbtoevent($s) {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::fromBBCode($s);
|
2011-06-09 23:24:29 +00:00
|
|
|
}
|
2011-06-09 04:06:02 +00:00
|
|
|
|
2017-01-16 20:59:16 +00:00
|
|
|
function sort_by_date($a) {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::sortByDate($a);
|
2011-06-06 06:10:07 +00:00
|
|
|
}
|
|
|
|
|
2015-10-16 23:25:25 +00:00
|
|
|
function event_delete($event_id) {
|
2018-03-17 01:22:40 +00:00
|
|
|
\Friendica\Model\Event::delete($event_id);
|
2015-10-16 23:25:25 +00:00
|
|
|
}
|
2011-06-14 02:06:49 +00:00
|
|
|
|
|
|
|
function event_store($arr) {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::store($arr);
|
2011-06-14 02:06:49 +00:00
|
|
|
}
|
2016-06-19 20:04:34 +00:00
|
|
|
|
|
|
|
function get_event_strings() {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::getStrings();
|
2016-06-19 20:04:34 +00:00
|
|
|
}
|
|
|
|
|
2017-01-27 17:04:52 +00:00
|
|
|
function event_remove_duplicates($dates) {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::removeDuplicates($dates);
|
2017-01-27 17:04:52 +00:00
|
|
|
}
|
|
|
|
|
2016-06-19 20:04:34 +00:00
|
|
|
function event_by_id($owner_uid = 0, $event_params, $sql_extra = '') {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::getListById($owner_uid, $event_params['event-id'], $sql_extra);
|
2016-06-19 20:04:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function events_by_date($owner_uid = 0, $event_params, $sql_extra = '') {
|
2018-03-17 01:22:40 +00:00
|
|
|
$event_params['ignore'] = $event_params['ignored'];
|
|
|
|
return \Friendica\Model\Event::getListByDate($owner_uid, $event_params, $sql_extra);
|
2016-06-19 20:04:34 +00:00
|
|
|
}
|
|
|
|
|
2017-01-27 17:04:52 +00:00
|
|
|
function process_events($arr) {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::prepareListForTemplate($arr);
|
2016-06-19 20:04:34 +00:00
|
|
|
}
|
2016-06-20 21:31:49 +00:00
|
|
|
|
2018-01-04 02:12:19 +00:00
|
|
|
function event_format_export($events, $format = 'ical', $timezone)
|
|
|
|
{
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::formatListForExport($events, $format, $timezone);
|
2016-06-20 21:31:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function events_by_uid($uid = 0, $sql_extra = '') {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::getListByUserId($uid);
|
2016-06-20 21:31:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function event_export($uid, $format = 'ical') {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::exportListByUserId($uid, $format);
|
2016-06-20 21:31:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function widget_events() {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Content\Widget\CalendarExport::getHTML();
|
2016-06-20 21:31:49 +00:00
|
|
|
}
|
2017-10-13 17:42:27 +00:00
|
|
|
|
|
|
|
function format_event_item($item) {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::getItemHTML($item);
|
2017-10-13 17:42:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function event_location2array($s = '') {
|
2018-03-17 01:22:40 +00:00
|
|
|
return \Friendica\Model\Event::locationToArray($s);
|
2017-10-13 17:42:27 +00:00
|
|
|
}
|