本文整理汇总了PHP中calendar::import_ical_file方法的典型用法代码示例。如果您正苦于以下问题:PHP calendar::import_ical_file方法的具体用法?PHP calendar::import_ical_file怎么用?PHP calendar::import_ical_file使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类calendar
的用法示例。
在下文中一共展示了calendar::import_ical_file方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: calendar
require $GO_MODULES->path . 'classes/calendar.class.inc';
$cal = new calendar();
$date = isset($_REQUEST['date']) ? $_REQUEST['date'] : getdate();
$year = isset($_POST['year']) ? $_POST['year'] : $date["year"];
$month = isset($_POST['month']) ? $_POST['month'] : $date["mon"];
$day = isset($_POST['day']) ? $_POST['day'] : $date["mday"];
$task = isset($_POST['task']) ? $_POST['task'] : '';
$return_to = isset($_REQUEST['return_to']) ? $_REQUEST['return_to'] : $_SERVER['HTTP_REFERER'];
$calendar_id = isset($_REQUEST['calendar_id']) ? $_REQUEST['calendar_id'] : 0;
$hours = array("00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23");
switch ($task) {
case 'import':
if (!isset($_FILES['ical_file']['tmp_name'])) {
$feedback = 'No file';
} else {
if ($cal->import_ical_file($GO_SECURITY->user_id, $_FILES['ical_file']['tmp_name'], $calendar_id)) {
$feedback = '<p class="Success">' . $cal_import_success . '</p>';
} else {
$feedback = '<p class="Error">' . $strDataError . '</p>';
}
unlink($_FILES['ical_file']['tmp_name']);
}
break;
case 'save':
$name = smart_addslashes(trim($_POST['name']));
if ($name != "") {
if ($_POST['calendar_start_hour'] > $_POST['calendar_end_hour']) {
$feedback = '<p class="Error">' . $error_invalid_hour_range . '</p>';
} else {
if ($calendar_id > 0) {
$existing_calendar = $cal->get_calendar_by_name($name);