本文整理汇总了PHP中availableCalendars函数的典型用法代码示例。如果您正苦于以下问题:PHP availableCalendars函数的具体用法?PHP availableCalendars怎么用?PHP availableCalendars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了availableCalendars函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: draw_admin
function draw_admin()
{
global $template, $getdate, $cal, $master_array, $is_loged_in;
if ($is_loged_in == TRUE) {
// Print Calendar Checkboxes
$COLUMNS_TO_PRINT = 3;
$column = 1;
$filelist = availableCalendars('', '', '', true);
foreach ($filelist as $file) {
if ($column > $COLUMNS_TO_PRINT) {
$delete_table .= '</tr>';
$column = 1;
}
if ($column == 1) {
$delete_table .= '<tr>';
}
$cal_filename_tmp = getCalendarName($file);
$cal_tmp = urlencode($file);
$cal_displayname_tmp = str_replace("32", " ", $cal_filename_tmp);
$delete_table .= '<td align="left"><input name="delete_calendar[]" value="' . $cal_tmp . '" type="checkbox" />' . $cal_displayname_tmp . '</td>';
$column++;
}
// Print remaining empty columns if necessary
$number_of_columns = count($filelist);
while (gettype($number_of_columns / $COLUMNS_TO_PRINT) != "integer") {
$delete_table .= '<td> </td>';
$number_of_columns++;
}
$this->page = str_replace('{DELETE_TABLE}', $delete_table, $this->page);
} else {
$this->page = preg_replace('!<\\!-- switch logged_in on -->(.*)<\\!-- switch logged_in off -->!is', '', $this->page);
$this->page = preg_replace('!<\\!-- switch logged_in2 on -->(.*)<\\!-- switch logged_in2 off -->!is', '', $this->page);
}
}
示例2: ereg
ereg("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_month = $day_array2[2];
$this_year = $day_array2[1];
$next_year = strtotime("+1 year", strtotime($getdate));
$next_year = date("Ymd", $next_year);
$prev_year = strtotime("-1 year", strtotime($getdate));
$prev_year = date("Ymd", $prev_year);
$sidebar_date = localizeDate($dateFormat_week_list, strtotime($getdate));
// For the side months
ereg("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_month = $day_array2[2];
$this_year = $day_array2[1];
// select for calendars
$available = availableCalendars($username, $password, $phpiCal_config->ALL_CALENDARS_COMBINED);
$list_icals = display_ical_list($available);
$list_years = list_years();
$list_months = list_months();
$list_weeks = list_weeks();
$list_jumps = list_jumps();
$list_calcolors = '<img src="templates/' . $template . '/images/allday_dot.gif" alt=" " width="11" height="10" border="0" />' . $lang['l_all_day'] . '<br>
<img src="templates/' . $template . '/images/event_dot.gif" alt=" " width="11" height="10" border="0" />' . $lang['l_event'] . "<br>";
$list_icals_pick = display_ical_list($available, TRUE);
// login/logout
$is_logged_in = $username != '' && !$invalid_login ? true : false;
$show_user_login = !$is_logged_in && $phpiCal_config->allow_login == 'yes';
$login_querys = login_querys();
$logout_querys = logout_querys();
$page = new Page(BASE . 'templates/' . $template . '/year.tpl');
$page->replace_files(array('header' => BASE . 'templates/' . $template . '/header.tpl', 'event_js' => BASE . 'functions/event.js', 'footer' => BASE . 'templates/' . $template . '/footer.tpl', 'sidebar' => BASE . 'templates/' . $template . '/sidebar_year.tpl', 'search_box' => BASE . 'templates/' . $template . '/search_box.tpl'));
示例3: exit
exit(error($lang['l_error_remotecal'], $web_cal));
}
// Pull the display name off the URL.
# $cal_displaynames[] = substr(str_replace('32', ' ', basename($web_cal)), 0, -4);
$cal_displaynames[] = substr(basename($web_cal), 0, -4);
if (in_array($web_cal, $list_webcals)) {
$web_cal = md5($phpiCal_config->salt . $web_cal);
}
$cals[] = urlencode($web_cal);
$subscribe_path = $cal_webcalPrefix;
// Add the webcal to the available calendars.
$cal_filelist[] = $cal_httpPrefix;
}
// Process the local calendars.
if (count($local_cals) > 0) {
$local_cals = availableCalendars($username, $password, $local_cals);
foreach ($local_cals as $local_cal) {
$cal_displaynames[] = str_replace('32', ' ', getCalendarName($local_cal));
}
$cal_filelist = array_merge($cal_filelist, $local_cals);
$cals = array_merge($cals, array_map("urlencode", array_map("getCalendarName", $local_cals)));
// Set the download and subscribe paths from the config, if there is
// only one calendar being displayed and those paths are defined.
if (count($local_cals) == 1) {
$filename = $local_cals[0];
$add_cpath = '';
if (isset($cpath) && $cpath != '') {
$add_cpath = "{$cpath}/";
}
if ($phpiCal_config->download_uri == '' && preg_match('/(^\\/|\\.\\.\\/)/', $filename) == 0) {
$subscribe_path = 'webcal://' . $_SERVER['SERVER_NAME'] . dirname($_SERVER['PHP_SELF']) . '/' . $filename;
示例4: strtotime
$weekstart = 1;
$unix_time = strtotime($getdate);
$today_today = date('Ymd', time() + $second_offset);
$next_day = date('Ymd', strtotime("+1 day", $unix_time));
$prev_day = date('Ymd', strtotime("-1 day", $unix_time));
$display_date = localizeDate($dateFormat_day, $unix_time);
$sidebar_date = localizeDate($dateFormat_week_list, $unix_time);
$start_week_time = strtotime(dateOfWeek($getdate, $week_start_day));
// select for calendars
$list_icals = display_ical_list(availableCalendars($username, $password, $ALL_CALENDARS_COMBINED));
$list_years = list_years();
$list_months = list_months();
$list_weeks = list_weeks();
$list_jumps = list_jumps();
$list_calcolors = list_calcolors();
$list_icals_pick = display_ical_list(availableCalendars($username, $password, $ALL_CALENDARS_COMBINED), TRUE);
// login/logout
$is_logged_in = $username != '' && !$invalid_login ? true : false;
$show_user_login = !$is_logged_in && $allow_login == 'yes';
$login_querys = login_querys();
$logout_querys = logout_querys();
$page = new Page(BASE . 'templates/' . $template . '/day.tpl');
$page->replace_files(array('header' => BASE . 'templates/' . $template . '/header.tpl', 'event_js' => BASE . 'functions/event.js', 'footer' => BASE . 'templates/' . $template . '/footer.tpl', 'sidebar' => BASE . 'templates/' . $template . '/sidebar.tpl', 'search_box' => BASE . 'templates/' . $template . '/search_box.tpl'));
$page->replace_tags(array('version' => $phpicalendar_version, 'charset' => $charset, 'default_path' => '', 'template' => $template, 'cal' => $cal, 'getdate' => $getdate, 'getcpath' => "&cpath={$cpath}", 'cpath' => $cpath, 'calendar_name' => $cal_displayname, 'current_view' => $current_view, 'display_date' => $display_date, 'sidebar_date' => $sidebar_date, 'rss_powered' => $rss_powered, 'rss_available' => '', 'rss_valid' => '', 'show_search' => $show_search, 'next_day' => $next_day, 'prev_day' => $prev_day, 'show_goto' => '', 'show_user_login' => $show_user_login, 'invalid_login' => $invalid_login, 'login_querys' => $login_querys, 'is_logged_in' => $is_logged_in, 'username' => $username, 'logout_querys' => $logout_querys, 'list_icals' => $list_icals, 'list_icals_pick' => $list_icals_pick, 'list_years' => $list_years, 'list_months' => $list_months, 'list_weeks' => $list_weeks, 'list_jumps' => $list_jumps, 'legend' => $list_calcolors, 'style_select' => $style_select, 'l_goprint' => $lang['l_goprint'], 'l_preferences' => $lang['l_preferences'], 'l_calendar' => $lang['l_calendar'], 'l_legend' => $lang['l_legend'], 'l_tomorrows' => $lang['l_tomorrows'], 'l_jump' => $lang['l_jump'], 'l_todo' => $lang['l_todo'], 'l_day' => $lang['l_day'], 'l_week' => $lang['l_week'], 'l_month' => $lang['l_month'], 'l_year' => $lang['l_year'], 'l_pick_multiple' => $lang['l_pick_multiple'], 'l_powered_by' => $lang['l_powered_by'], 'l_subscribe' => $lang['l_subscribe'], 'l_download' => $lang['l_download'], 'l_search' => $lang['l_search'], 'l_this_site_is' => $lang['l_this_site_is']));
if ($allow_preferences != 'yes') {
$page->replace_tags(array('allow_preferences' => ''));
}
if ($allow_login == 'yes') {
$page->replace_tags(array('l_invalid_login' => $lang['l_invalid_login'], 'l_password' => $lang['l_password'], 'l_username' => $lang['l_username'], 'l_login' => $lang['l_login'], 'l_logout' => $lang['l_logout']));
}
if ($show_search != 'yes') {
示例5: availableCalendarNames
function availableCalendarNames($username, $password, $cal_filename, $admin = false)
{
// Grab the available calendar paths.
$calendars = availableCalendars($username, $password, $cal_filename, $admin);
// Strip the paths off the calendars.
foreach (array_keys($calendars) as $key) {
$calendars[$key] = getCalendarName($key);
}
// Return the sorted calendar names.
natcasesort($calendars);
return $calendars;
}
示例6: display_ical_list
<?php
if ($display_ical_list == "yes") {
echo "<select name=\"action\" class=\"query_style\" onChange=\"window.location=(this.options[this.selectedIndex].value+'";
if (isset($query)) {
echo $query;
}
echo "');\">";
// List the calendars.
display_ical_list(availableCalendars($username, $password, $ALL_CALENDARS_COMBINED));
print "</select>";
}
?>
示例7: urlencode
$dir_handle = @opendir(BASE . 'languages/');
$tmp_pref_language = urlencode(ucfirst($language));
$language_select = '';
while ($file = readdir($dir_handle)) {
if (substr($file, -8) == ".inc.php") {
$language_tmp = urlencode(ucfirst(substr($file, 0, -8)));
if ($language_tmp == $cookie_language) {
$language_select .= '<option value="' . $language_tmp . '" selected="selected">' . $language_tmp . '</option>';
} else {
$language_select .= '<option value="' . $language_tmp . '">' . $language_tmp . '</option>';
}
}
}
closedir($dir_handle);
// select for calendars
$calendar_select = display_ical_list(availableCalendars($username, $password, $phpiCal_config->ALL_CALENDARS_COMBINED), TRUE);
$calendar_select .= "<option value=\"{$phpiCal_config->ALL_CALENDARS_COMBINED}\">{$all_cal_comb_lang}</option>";
$calendar_select = str_replace("<option value=\"{$cookie_calendar}\">", "<option value=\"{$cookie_calendar}\" selected='selected'>", $calendar_select);
// select for dayview
$view_select = $phpiCal_config->default_view == 'day' ? '<option value="day" selected="selected">{L_DAY}</option>' : '<option value="day">{L_DAY}</option>';
$view_select .= $phpiCal_config->default_view == 'week' ? '<option value="week" selected="selected">{L_WEEK}</option>' : '<option value="week">{L_WEEK}</option>';
$view_select .= $phpiCal_config->default_view == 'month' ? '<option value="month" selected="selected">{L_MONTH}</option>' : '<option value="month">{L_MONTH}</option>';
// select for time
$time_select = '';
for ($i = 0; $i <= 2400; $i += 100) {
$s = sprintf("%04d", $i);
$time_select .= '<option value="' . $s . '"';
if ($s == $cookie_time) {
$time_select .= ' selected="selected"';
}
$time_select .= ">{$s}</option>\n";
示例8: array
$filename = $cal_filename;
$subscribe_path = $cal_webcalPrefix;
// empty the filelist array
$cal_filelist = array();
array_push($cal_filelist, $filename);
} else {
exit(error($error_remotecal_lang, $HTTP_GET_VARS['cal']));
}
} else {
$cal_displayname = str_replace('32', ' ', $cal_filename);
$cal = urlencode($cal_filename);
if (in_array($cal_filename, $blacklisted_cals)) {
exit(error($error_restrictedcal_lang, $cal_filename));
} else {
if (!isset($filename)) {
$cal_filelist = availableCalendars($username, $password, $cal_filename);
if (count($cal_filelist) == 1) {
$filename = $cal_filelist[0];
}
}
// Sets the download and subscribe paths from the config if present.
if ($download_uri == '' && preg_match('/(^\\/|\\.\\.\\/)/', $filename) == 0) {
$subscribe_path = 'webcal://' . $HTTP_SERVER_VARS['SERVER_NAME'] . dirname($HTTP_SERVER_VARS['PHP_SELF']) . '/' . $filename;
$download_filename = $filename;
} elseif ($download_uri != '') {
$newurl = eregi_replace("^(http://)", "", $download_uri);
$subscribe_path = 'webcal://' . $newurl . '/' . $cal_filename . '.ics';
$download_filename = $download_uri . '/' . $cal_filename . '.ics';
} else {
$subscribe_path = '';
$download_filename = '';
示例9: exit
require_once BASE . 'functions/calendar_functions.php';
if ($enable_rss != 'yes') {
exit(error($lang['l_rss_notenabled'], $cal, '../'));
}
if (empty($default_path)) {
if (isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'on') {
$default_path = 'https://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], '/rss/'));
} else {
$default_path = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], '/rss/'));
}
}
$current_view = "rssindex";
$display_date = "RSS Info";
$rss_list = "<table>\n";
$xml_icon = "<img src = 'xml.gif' alt='xml'>";
$filelist = availableCalendars($username, $password, $ALL_CALENDARS_COMBINED);
foreach ($filelist as $file) {
// $cal_filename is the filename of the calendar without .ics
// $cal is a urlencoded version of $cal_filename
// $cal_displayname is $cal_filename with occurrences of "32" replaced with " "
if (is_numeric(array_search($file, $cal_filelist))) {
$cal_displayname_tmp = $cal_displaynames[array_search($file, $cal_filelist)];
} else {
$cal_displayname_tmp = str_replace("32", " ", str_replace(".ics", '', basename($file)));
}
$rss_list .= '<tr><td rowspan ="3"><font class="V12" color="blue"><b>' . $cal_displayname_tmp . ' ' . $lang['l_calendar'] . '</b></font></td>';
/* Changed to show links without urlencode, but links valid urls */
$rss_list .= "<td>" . $lang['l_day'] . "</td>";
$rss_list .= '<td><a href=' . $default_path . '/rss/rss.php?cal=' . rawurlencode($file) . '&cpath=' . $cpath . '&rssview=day>' . $xml_icon . '</a> RSS 0.91</td>';
$rss_list .= '<td><a href=' . $default_path . '/rss/rss1.0.php?cal=' . rawurlencode($file) . '&cpath=' . $cpath . '&rssview=day>' . $xml_icon . '</a> RSS 1.0</td>';
$rss_list .= '<td><a href=' . $default_path . '/rss/rss2.0.php?cal=' . rawurlencode($file) . '&cpath=' . $cpath . '&rssview=day>' . $xml_icon . '</a> RSS 2.0</td></tr>';
示例10: _phpicalendar
public function _phpicalendar($current_view)
{
$default_cal_alba = $this->archivo;
//substr($this->archivo,0, -4);
// $default_cal_alba = BASE.'calendars/'.'Home.ics';
// echo substr($this->archivo,0, -4);
// echo $this->archivo;
// print_r( file($this->archivo));
$context = sfContext::getInstance();
require_once BASE . 'ical_parser.php';
require_once BASE . 'list_functions.php';
require_once BASE . 'template.php';
$context->getResponse()->addStylesheet("cal/templates/{$template}/default", '', array());
$context->getResponse()->addJavascript("cal/event");
// if (isset($_GET['jumpto_day'])) {
// $jumpto_day_time = strtotime($_GET['jumpto_day']);
// if ($jumpto_day_time == -1) {
// $getdate = date('Ymd', time() + $second_offset);
// } else {
// $getdate = date('Ymd', $jumpto_day_time);
// }
// }
//datos para construir las urls
$modulo = $context->getRequest()->getParameter('module');
$action = $context->getRequest()->getParameter('action');
//sacado de arriba para prueba
if (!$this->date) {
$getdate = date('Ymd', time() + $second_offset);
} else {
$getdate = $this->date;
}
// $current_view = 'day';
// header("Content-Type: text/html; charset=$charset");
if ($minical_view == 'current') {
$minical_view = $current_view;
}
if ($current_view == 'month') {
// from month.php
ereg("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_month = $day_array2[2];
$this_year = $day_array2[1];
$unix_time = strtotime($getdate);
$today_today = date('Ymd', time() + $second_offset);
$tomorrows_date = date('Ymd', strtotime("+1 day", $unix_time));
$yesterdays_date = date('Ymd', strtotime("-1 day", $unix_time));
$sidebar_date = localizeDate($dateFormat_week_list, $unix_time, $globals_local);
// find out next month
$next_month_month = $this_month + 1 == '13' ? '1' : $this_month + 1;
$next_month_day = $this_day;
$next_month_year = $next_month_month == '1' ? $this_year + 1 : $this_year;
while (!checkdate($next_month_month, $next_month_day, $next_month_year)) {
$next_month_day--;
}
$next_month_time = mktime(0, 0, 0, $next_month_month, $next_month_day, $next_month_year);
// find out last month
$prev_month_month = $this_month - 1 == '0' ? '12' : $this_month - 1;
$prev_month_day = $this_day;
$prev_month_year = $prev_month_month == '12' ? $this_year - 1 : $this_year;
while (!checkdate($prev_month_month, $prev_month_day, $prev_month_year)) {
$prev_month_day--;
}
$prev_month_time = mktime(0, 0, 0, $prev_month_month, $prev_month_day, $prev_month_year);
$next_month = date("Ymd", $next_month_time);
$prev_month = date("Ymd", $prev_month_time);
$display_date = localizeDate($dateFormat_month, $unix_time, $globals_local);
$parse_month = date("Ym", $unix_time);
$first_of_month = $this_year . $this_month . "01";
$start_month_day = dateOfWeek($first_of_month, $week_start_day);
$thisday2 = localizeDate($dateFormat_week_list, $unix_time, $globals_local);
$num_of_events2 = 0;
$list_icals = display_ical_list(availableCalendars($username, $password, $ALL_CALENDARS_COMBINED));
$list_years = list_years();
$list_months = list_months();
$list_weeks = list_weeks();
$list_jumps = list_jumps();
$list_calcolors = list_calcolors();
$list_icals_pick = display_ical_list(availableCalendars($username, $password, $ALL_CALENDARS_COMBINED), TRUE);
} elseif ($current_view == 'year') {
// from year.php
ereg("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_month = $day_array2[2];
$this_year = $day_array2[1];
$next_year = strtotime("+1 year", strtotime($getdate));
$next_year = date("Ymd", $next_year);
$prev_year = strtotime("-1 year", strtotime($getdate));
$prev_year = date("Ymd", $prev_year);
$sidebar_date = localizeDate($dateFormat_day, strtotime($getdate), $globals_local);
// For the side months
ereg("([0-9]{4})([0-9]{2})([0-9]{2})", $getdate, $day_array2);
$this_day = $day_array2[3];
$this_month = $day_array2[2];
$this_year = $day_array2[1];
}
$weekstart = 1;
$unix_time = strtotime($getdate);
$today_today = date('Ymd', time() + $second_offset);
$next_day = date('Ymd', strtotime("+1 day", $unix_time));
$prev_day = date('Ymd', strtotime("-1 day", $unix_time));
//.........这里部分代码省略.........