From: <ji...@us...> - 2008-12-12 06:23:04
|
Update of /cvsroot/phpicalendar/phpicalendar In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9036 Modified Files: day.php month.php preferences.php week.php year.php Log Message: misc changes for new config model Index: day.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/day.php,v retrieving revision 1.133 retrieving revision 1.134 diff -C2 -d -r1.133 -r1.134 *** day.php 12 Dec 2008 00:08:47 -0000 1.133 --- day.php 12 Dec 2008 06:22:57 -0000 1.134 *************** *** 39,43 **** // 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(); --- 39,43 ---- // 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(); *************** *** 46,54 **** $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' )); --- 46,54 ---- $page->replace_files(array( ! 'header' => BASE.'templates/'.$phpiCal_config->template.'/header.tpl', 'event_js' => BASE.'functions/event.js', ! 'footer' => BASE.'templates/'.$phpiCal_config->template.'/footer.tpl', ! 'sidebar' => BASE.'templates/'.$phpiCal_config->template.'/sidebar.tpl', ! 'search_box' => BASE.'templates/'.$phpiCal_config->template.'/search_box.tpl' )); *************** *** 69,73 **** 'rss_available' => '', 'rss_valid' => '', ! 'show_search' => $show_search, 'next_day' => $next_day, 'prev_day' => $prev_day, --- 69,73 ---- 'rss_available' => '', 'rss_valid' => '', ! 'show_search' => $phpiCal_config->show_search, 'next_day' => $next_day, 'prev_day' => $prev_day, *************** *** 106,110 **** )); ! if ($allow_preferences != 'yes') { $page->replace_tags(array( 'allow_preferences' => '' --- 106,110 ---- )); ! if ($phpiCal_config->allow_preferences != 'yes') { $page->replace_tags(array( 'allow_preferences' => '' *************** *** 112,116 **** } ! if ($allow_login == 'yes') { $page->replace_tags(array( 'l_invalid_login' => $lang['l_invalid_login'], --- 112,116 ---- } ! if ($phpiCal_config->allow_login == 'yes') { $page->replace_tags(array( 'l_invalid_login' => $lang['l_invalid_login'], *************** *** 122,126 **** } ! if ($show_search != 'yes') { $page->nosearch($page); } --- 122,126 ---- } ! if ($phpiCal_config->show_search != 'yes') { $page->nosearch($page); } Index: month.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/month.php,v retrieving revision 1.141 retrieving revision 1.142 diff -C2 -d -r1.141 -r1.142 *** month.php 11 Dec 2008 21:54:52 -0000 1.141 --- month.php 12 Dec 2008 06:22:58 -0000 1.142 *************** *** 47,58 **** $list_icals_pick = display_ical_list(availableCalendars($username, $password, $phpiCal_config->ALL_CALENDARS_COMBINED), TRUE); ! $page = new Page(BASE.'templates/'.$template.'/month.tpl'); $page->replace_files(array( ! 'header' => BASE.'templates/'.$template.'/header.tpl', 'event_js' => BASE.'functions/event.js', ! 'footer' => BASE.'templates/'.$template.'/footer.tpl', ! 'calendar_nav' => BASE.'templates/'.$template.'/calendar_nav.tpl', ! 'search_box' => BASE.'templates/'.$template.'/search_box.tpl' )); --- 47,58 ---- $list_icals_pick = display_ical_list(availableCalendars($username, $password, $phpiCal_config->ALL_CALENDARS_COMBINED), TRUE); ! $page = new Page(BASE.'templates/'.$phpiCal_config->template.'/month.tpl'); $page->replace_files(array( ! 'header' => BASE.'templates/'.$phpiCal_config->template.'/header.tpl', 'event_js' => BASE.'functions/event.js', ! 'footer' => BASE.'templates/'.$phpiCal_config->template.'/footer.tpl', ! 'calendar_nav' => BASE.'templates/'.$phpiCal_config->template.'/calendar_nav.tpl', ! 'search_box' => BASE.'templates/'.$phpiCal_config->template.'/search_box.tpl' )); *************** *** 106,110 **** )); ! if ($allow_preferences != 'yes') { $page->replace_tags(array( 'allow_preferences' => '' --- 106,110 ---- )); ! if ($phpiCal_config->allow_preferences != 'yes') { $page->replace_tags(array( 'allow_preferences' => '' *************** *** 112,116 **** } ! if ($allow_login == 'yes') { $page->replace_tags(array( 'l_invalid_login' => $lang['l_invalid_login'], --- 112,116 ---- } ! if ($phpiCal_config->allow_login == 'yes') { $page->replace_tags(array( 'l_invalid_login' => $lang['l_invalid_login'], *************** *** 122,126 **** } ! if ($show_search != 'yes') { $page->nosearch($page); } --- 122,126 ---- } ! if ($phpiCal_config->show_search != 'yes') { $page->nosearch($page); } Index: preferences.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/preferences.php,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** preferences.php 10 Apr 2006 02:21:07 -0000 1.60 --- preferences.php 12 Dec 2008 06:22:58 -0000 1.61 *************** *** 7,21 **** $display_date = $preferences_lang; ! if ($allow_preferences != 'yes') { exit(error('Preferences are not available for this installation.', $cal)); } - if ($cookie_uri == '') { - $cookie_uri = $_SERVER['SERVER_NAME'].substr($_SERVER['PHP_SELF'],0,strpos($_SERVER['PHP_SELF'], '/')); - } - $current_view = "preferences"; $back_page = BASE.$default_view.'.php?cal='.$cal.'&getdate='.$getdate.'&cpath='.$cpath; ! if ($allow_preferences == 'no') header("Location: $back_page"); if (isset($_GET['action'])) { --- 7,17 ---- $display_date = $preferences_lang; ! if ($phpiCal_config->allow_preferences != 'yes') { exit(error('Preferences are not available for this installation.', $cal)); } $current_view = "preferences"; $back_page = BASE.$default_view.'.php?cal='.$cal.'&getdate='.$getdate.'&cpath='.$cpath; ! if ($phpiCal_config->allow_preferences == 'no') header("Location: $back_page"); if (isset($_GET['action'])) { *************** *** 40,46 **** $the_cookie = serialize($the_cookie); if ($cookie_unset) { ! setcookie("$cookie_name","$the_cookie",time()-(60*60*24*7) ,"/","$cookie_uri",0); } else { ! setcookie("$cookie_name","$the_cookie",time()+(60*60*24*7*12*10) ,"/","$cookie_uri",0); if (isset($_POST['cookie_view'])) $default_view = $_POST['cookie_view']; --- 36,42 ---- $the_cookie = serialize($the_cookie); if ($cookie_unset) { ! setcookie("$cookie_name","$the_cookie",time()-(60*60*24*7) ,"/","$phpiCal_config->cookie_uri",0); } else { ! setcookie("$cookie_name","$the_cookie",time()+(60*60*24*7*12*10) ,"/","$phpiCal_config->cookie_uri",0); echo "setcookie"; if (isset($_POST['cookie_view'])) $default_view = $_POST['cookie_view']; *************** *** 71,79 **** # No cookie set -> use defaults from config file. $cookie_language = ucfirst($language); ! $cookie_calendar = $default_cal; ! $cookie_view = $default_view; ! $cookie_style = $template; ! $cookie_startday = $week_start_day; ! $cookie_time = $day_start; } --- 67,75 ---- # No cookie set -> use defaults from config file. $cookie_language = ucfirst($language); ! $cookie_calendar = $phpiCal_config->default_cal; ! $cookie_view = $phpiCal_config->default_view; ! $cookie_style = $phpiCal_config->template; ! $cookie_startday = $phpiCal_config->week_start_day; ! $cookie_time = $phpiCal_config->day_start; } *************** *** 147,161 **** $generated = number_format(($php_ended-$php_started),3); ! $page = new Page(BASE.'templates/'.$template.'/preferences.tpl'); $page->replace_files(array( ! 'header' => BASE.'templates/'.$template.'/header.tpl', ! 'footer' => BASE.'templates/'.$template.'/footer.tpl' )); $page->replace_tags(array( ! 'version' => $phpicalendar_version, ! 'charset' => $charset, ! 'template' => $template, 'default_path' => '', 'cpath' => $cpath, --- 143,157 ---- $generated = number_format(($php_ended-$php_started),3); ! $page = new Page(BASE.'templates/'.$phpiCal_config->template.'/preferences.tpl'); $page->replace_files(array( ! 'header' => BASE.'templates/'.$phpiCal_config->template.'/header.tpl', ! 'footer' => BASE.'templates/'.$phpiCal_config->template.'/footer.tpl' )); $page->replace_tags(array( ! 'version' => $phpiCal_config->phpicalendar_version, ! 'charset' => $phpiCal_config->charset, ! 'template' => $phpiCal_config->template, 'default_path' => '', 'cpath' => $cpath, Index: week.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/week.php,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** week.php 11 Dec 2008 21:54:52 -0000 1.132 --- week.php 12 Dec 2008 06:22:58 -0000 1.133 *************** *** 16,21 **** $next_day = date('Ymd', strtotime("+1 day", $unix_time)); $prev_day = date('Ymd', strtotime("-1 day", $unix_time)); ! $start_week_time = strtotime(dateOfWeek($getdate, $week_start_day)); ! $end_week_time = $start_week_time + (($week_length - 1) * 25 * 60 * 60); $start_week = localizeDate($dateFormat_week, $start_week_time); $end_week = localizeDate($dateFormat_week, $end_week_time); --- 16,21 ---- $next_day = date('Ymd', strtotime("+1 day", $unix_time)); $prev_day = date('Ymd', strtotime("-1 day", $unix_time)); ! $start_week_time = strtotime(dateOfWeek($getdate, $phpiCal_config->week_start_day)); ! $end_week_time = $start_week_time + (($phpiCal_config->week_length - 1) * 25 * 60 * 60); $start_week = localizeDate($dateFormat_week, $start_week_time); $end_week = localizeDate($dateFormat_week, $end_week_time); *************** *** 40,55 **** // 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.'/week.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' )); --- 40,55 ---- // 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/'.$phpiCal_config->template.'/week.tpl'); $page->replace_files(array( ! 'header' => BASE.'templates/'.$phpiCal_config->template.'/header.tpl', 'event_js' => BASE.'functions/event.js', ! 'footer' => BASE.'templates/'.$phpiCal_config->template.'/footer.tpl', ! 'sidebar' => BASE.'templates/'.$phpiCal_config->template.'/sidebar.tpl', ! 'search_box' => BASE.'templates/'.$phpiCal_config->template.'/search_box.tpl' )); *************** *** 62,66 **** 'getdate' => $getdate, 'getcpath' => "&cpath=$cpath", ! 'cpath' => $cpath, 'calendar_name' => $cal_displayname, 'display_date' => $display_date, --- 62,66 ---- 'getdate' => $getdate, 'getcpath' => "&cpath=$cpath", ! 'cpath' => $cpath, 'calendar_name' => $cal_displayname, 'display_date' => $display_date, *************** *** 70,74 **** 'rss_available' => '', 'rss_valid' => '', ! 'show_search' => $show_search, 'next_day' => $next_day, 'next_week' => $next_week, --- 70,74 ---- 'rss_available' => '', 'rss_valid' => '', ! 'show_search' => $show_search, 'next_day' => $next_day, 'next_week' => $next_week, *************** *** 109,113 **** )); ! if ($allow_preferences != 'yes') { $page->replace_tags(array( 'allow_preferences' => '' --- 109,113 ---- )); ! if ($phpiCal_config->allow_preferences != 'yes') { $page->replace_tags(array( 'allow_preferences' => '' *************** *** 115,119 **** } ! if ($allow_login == 'yes') { $page->replace_tags(array( 'l_invalid_login' => $lang['l_invalid_login'], --- 115,119 ---- } ! if ($phpiCal_config->allow_login == 'yes') { $page->replace_tags(array( 'l_invalid_login' => $lang['l_invalid_login'], *************** *** 125,129 **** } ! if ($show_search != 'yes') { $page->nosearch($page); } --- 125,129 ---- } ! if ($phpiCal_config->show_search != 'yes') { $page->nosearch($page); } Index: year.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/year.php,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** year.php 11 Dec 2008 21:54:52 -0000 1.47 --- year.php 12 Dec 2008 06:22:58 -0000 1.48 *************** *** 113,117 **** )); ! if ($allow_preferences != 'yes') { $page->replace_tags(array( 'allow_preferences' => '' --- 113,117 ---- )); ! if ($phpiCal_config->allow_preferences != 'yes') { $page->replace_tags(array( 'allow_preferences' => '' *************** *** 119,123 **** } ! if ($allow_login == 'yes') { $page->replace_tags(array( 'l_invalid_login' => $lang['l_invalid_login'], --- 119,123 ---- } ! if ($phpiCal_config->allow_login == 'yes') { $page->replace_tags(array( 'l_invalid_login' => $lang['l_invalid_login'], |