1<?php 2class Configs{ 3 private static $instance; 4 private function __construct(){ 5 $this->phpicalendar_version = '2.4'; 6 // Configuration file for PHP iCalendar 2.4 7 // 8 // To set values, change the text between the single quotes 9 // Follow instructions to the right for detailed information 10#=================Initialize global variables================================= 11// Define some magic strings. 12 $this->ALL_CALENDARS_COMBINED = 'all_calendars_combined971'; 13 $this->template = 'default'; // Template support 14 $this->default_view = 'day'; // Default view for calendars = 'day', 'week', 'month', 'year' 15 $this->minical_view = 'current'; // Where do the mini-calendars go when clicked? = 'day', 'week', 'month', 'current' 16 $this->default_cal = $this->ALL_CALENDARS_COMBINED; // Exact filename of calendar without .ics. Or set to $this->ALL_CALENDARS_COMBINED to open all calenders combined into one. 17 $this->language = 'English'; // Language support - 'English', 'Polish', 'German', 'French', 'Dutch', 'Danish', 'Italian', 'Japanese', 'Norwegian', 'Spanish', 'Swedish', 'Portuguese', 'Catalan', 'Traditional_Chinese', 'Esperanto', 'Korean' 18 $this->week_start_day = 'Sunday'; // Day of the week your week starts on 19 $this->week_length = '7'; // Number of days to display in the week view 20 $this->day_start = '0600'; // Start time for day grid 21 $this->day_end = '2000'; // End time for day grid 22 $this->gridLength = '15'; // Grid distance in minutes for day view, multiples of 15 preferred 23 $this->num_years = '1'; // Number of years (up and back) to display in 'Jump to' 24 $this->month_event_lines = '0'; // Number of lines to wrap each event title in month view, 0 means display all lines. 25 $this->tomorrows_events_lines = '1'; // Number of lines to wrap each event title in the 'Tommorrow's events' box, 0 means display all lines. 26 $this->allday_week_lines = '1'; // Number of lines to wrap each event title in all-day events in week view, 0 means display all lines. 27 $this->week_events_lines = '1'; // Number of lines to wrap each event title in the 'Tommorrow's events' box, 0 means display all lines. 28 $this->timezone = ''; // Set timezone. Read TIMEZONES file for more information 29 $this->calendar_path = ''; // Leave this blank on most installs, place your full FILE SYSTEM PATH to calendars if they are outside the phpicalendar folder. 30 $this->second_offset = ''; // The time in seconds between your time and your server's time. 31 $this->bleed_time = '-1'; // This allows events past midnight to just be displayed on the starting date, only good up to 24 hours. Range from '0000' to '2359', or '-1' for no bleed time. 32 $this->cookie_uri = ''; // The HTTP URL to the PHP iCalendar directory, ie. http://www.example.com/phpicalendar -- AUTO SETTING -- Only set if you are having cookie issues. 33 $this->download_uri = ''; // The HTTP URL to your calendars directory, ie. http://www.example.com/phpicalendar/calendars -- AUTO SETTING -- Only set if you are having subscribe issues. 34 $this->default_path = ''; // The HTTP URL to the PHP iCalendar directory, ie. http://www.example.com/phpicalendar 35 $this->cpath = ''; // optional subdirectory 36 $this->charset = 'UTF-8'; // Character set your calendar is in, suggested UTF-8, or iso-8859-1 for most languages. 37 38 // Yes/No questions --- 'yes' means Yes, anything else means no. 'yes' must be lowercase. 39 $this->allow_webcals = 'no'; // Allow http:// and webcal:// prefixed URLs to be used as the $this->cal for remote viewing of "subscribe-able" calendars. This does not have to be enabled to allow specific ones below. 40 $this->month_locations = 'yes'; // Display location in the month view. 41 $this->this_months_events = 'yes'; // Display "This month's events" at the bottom off the month page. 42 $this->enable_rss = 'yes'; // Enable RSS access to your calendars (good thing). 43 $this->rss_link_to_event = ''; // Set to yes to have links in the feed popup an event window. Default is to link to day.php 44 $this->show_search = 'no'; // Show the search box in the sidebar. 45 $this->allow_preferences = 'yes'; // Allow visitors to change various preferences via cookies. 46 $this->printview_default = 'no'; // Set print view as the default view. day, week, and month only supported views for $this->default_view (listed well above). 47 $this->show_todos = 'yes'; // Show your todo list on the side of day and week view. 48 $this->show_completed = 'yes'; // Show completed todos on your todo list. 49 $this->event_download = 'no'; // Show completed todos on your todo list. 50 $this->allow_login = 'no'; // Set to yes to prompt for login to unlock calendars. 51 $this->login_cookies = 'no'; // Set to yes to store authentication information via (unencrypted) cookies. Set to no to use sessions. 52 $this->support_ical = 'no'; // Set to yes to support the Apple iCal calendar database structure. 53 $this->recursive_path = 'no'; // Set to yes to recurse into subdirectories of the calendar path. 54 55 // Calendar Caching (decreases page load times) 56 $this->save_parsed_cals = 'no'; // Saves a copy of the cal in /tmp after it's been parsed. Improves performance. 57 $this->tmp_dir = '/tmp'; // The temporary directory on your system (/tmp is fine for UNIXes including Mac OS X). Any php-writable folder works. 58 $this->webcal_hours = '24'; // Number of hours to cache webcals. Setting to '0' will always re-parse webcals if they've been modified. 59 60 // Webdav style publishing 61 $this->phpicalendar_publishing = '0'; // Set to '1' to enable remote webdav style publish. See 'calendars/publish.php' for complete information; 62 63 // Administration settings (/admin/) 64 $this->allow_admin = 'no'; // Set to yes to allow the admin page - remember to change the default password if using 'internal' as the $this->auth_method 65 $this->auth_method = 'internal'; // Valid values are: 'ftp', 'internal', or 'none'. 'ftp' uses the ftp server's username and password as well as ftp commands to delete and copy files. 'internal' uses $this->auth_internal_username and $this->auth_internal_password defined below - CHANGE the password. 'none' uses NO authentication - meant to be used with another form of authentication such as http basic. 66 $this->auth_internal_username = 'admin'; // Only used if $this->auth_method='internal'. The username for the administrator. 67 $this->auth_internal_password = 'admin'; // Only used if $this->auth_method='internal'. The password for the administrator. 68 $this->ftp_server = 'localhost'; // Only used if $this->auth_method='ftp'. The ftp server name. 'localhost' will work for most servers. 69 $this->ftp_port = '21'; // Only used if $this->auth_method='ftp'. The ftp port. '21' is the default for ftp servers. 70 $this->ftp_calendar_path = ''; // Only used if $this->auth_method='ftp'. The full path to the calendar directory on the ftp server. If = '', will attempt to deduce the path based on $this->calendar_path, but may not be accurate depending on ftp server config. 71 $this->salt = ''; 72 // Calendar colors 73 // 74 // You can increase the number of unique colors by adding additional images (monthdot_n.gif) 75 // and in the css file (default.css) classes .alldaybg_n, .eventbg_n and .eventbg2_n 76 // Colors will repeat from the beginning for calendars past $this->unique_colors (7 by default), with no limit. 77 $this->unique_colors = '7'; 78 79 return true; 80 } 81 82 public static function getInstance(){ 83 if (empty(self::$instance)){ 84 self::$instance = new Configs; 85 } 86 return self::$instance; 87 } 88 89 # val can be an array 90 public function setProperty($key,$val){ 91 $this->$key = $val; 92 return; 93 } 94 public function getProperty($key){ 95 return $this->$key; 96 } 97} 98 99$phpiCal_config = Configs::getInstance(); 100 101?> 102