########################################################################################################
###############################      Plans config file    ##############################################
########################################################################################################
# This file stores installation-specific settings for the plans calendar.  You may need to change them 
# to match how your server or site is set up.
#
# Each time plans runs, it looks for this file in the same directory 
# plans.cgi is in.  If found, this file is compiled with the rest of 
# plans.  The following statements are actual perl code. 

########################################################################################################
###############################          Language         ##############################################
########################################################################################################
# All user-facing text is stored in a table.  When Plans runs, it sources $language_file, which 
# fills the table with the appropriate stuff.
$language_file="us_english.pl";


########################################################################################################
###############################        Data storage        #############################################
########################################################################################################
# You can store calendar data in flat files or a database (like mySQL).
# The default storage mode is plain text files.
# you can switch modes at any time--plans will convert your existing data.
$data_storage_mode = 0;

################################   Flat-file mode  (mode 0)   ##########################################
########################################################################################################

# unless you specify the absolute path, these files are assumed 
# to be in the same directory as plans.cgi

$calendars_file = "calendars.xml";           # custom settings for the calendar(s) generated by plans.
$events_file = "events.xml";                 # event data for all calendars.
$new_calendars_file = "new_calendars.xml";   # stores new (not yet approved) calendars.

#################################    SQL DBI mode (mode 1)     #########################################
# Perl's database abstraction layer (DBI) can talk to most SQL database types.
########################################################################################################
if ($data_storage_mode==1) {
  $dbh;                                       # define global database handle
  use DBD::mysql;                             # Here, you specify what database type you'll be using.
  $db_name="plans_demo1";                     # And the name of the database (you have to create it on your own first)
  $db_hostname="mysql-plans-demo1.planscalendar.com";         # And the database hostname
  $db_username="plans_demo1";                 # And the username you'll use to connect
  $db_password_file="plans_mysql.pwd";        # Put the DB password in this file.
                                              # Make sure this file is *not* publically
                                              # readable (chmod 400 on unix)
                                          
                                           
                                              # You don't have to create these tables.
                                              # Plans will do it for you.
  $calendars_table="calendars";               # Table for storing calendar settings.
  $events_table="events";                     # Table for storing event data.
  $new_calendars_table="new_calendars";       # Table for storing event data.
  
  
  
  # open the password file
  open (FH, "$db_password_file") || {$debug_info.= "unable to open file $db_password_file\n"};
  flock FH,2;
  $mysql_password=<FH>;
  close FH;
  chomp $mysql_password;
  
  # connect to the db host
  if (!($dbh = DBI->connect("DBI:mysql:database=$db_name;host=$db_hostname","$db_username","$mysql_password"))) 
  {
    $fatal_error=1;
    $error_info.= "DB connect error! $DBI::errstr";
    return;
  }
  
  
}


########################################################################################################
###############################      File Locations        #############################################
########################################################################################################
# This is the default file structure for plans:
#
# plans/
#       plans.cgi
#       plans.config
#       plans.dat
#       theme/
#             plans.template
#             event_details.template
#             calendar_details.template
#             plans.css
#             icons/
#             graphics/
#
# If you move the theme directory to a different location for some reason 
# (for instance, if your server does't allow static files be served from 
# the same directory (or subdirectories) as scripts, uncomment the variable 
# below and set it accordingly.
# $theme_path  = "http://your.domain.com/calendar_theme";      # note there is no end slash!
#
# you probably won't ever need to change these two variables:
$graphics_path ="$theme_path/graphics";                      # where misc. graphics are 
$icons_path = "$theme_path/icons";                           # where icons are

########################################################################################################
###############################    Default Template    #################################################
########################################################################################################
# All calendars use the same default template file, specified below.
#
# Each calendar can specify a custom template file, which overrides the default file.
# this custom template file must be an URL (plans will fetch it across the network, even 
# if it resides on the same server).  This increases security and allows template files to 
# come from other websites.
#
# If plans is unable to fetch the custom template file, it will revert back to the default 
# template file instead.  A warning will be displayed at the bottom of the calendar.
                                                              
$default_template_file = "theme/plans.template";     # On windows, the you might have to change this to something:
                                                           # like: "C:/path/to/plans/theme/plans.template"
                                                           # IMPORTANT -- this is not an URL.  It's a filesystem path.

########################################################################################################
###############################            Tabs            #############################################
########################################################################################################
# You can customize the text shown on the tabs.
# If you set a tab's text to an empty string (""),
# that tab will disappear entirely.

# If you want to remove all the tabs, an easier 
# way is to remove the ###tab menu stuff### 
# tag from the plans.template file.

@tab_text = ("Calendars", 
             "Add / Edit Events", 
             "Calendar Settings");
             
########################################################################################################
#############################     Event Background Colors    ###########################################
########################################################################################################
# You can change these or add more.
# Only the #color matters.  Everything after the first space is ignored.

$event_background_colors = <<p1;
#ffffff   White        
#eeeeee   Off-white    
#ffffcc   Yellow       
#ccffcc   Green        
#ccffff   Blue         
#99ccff   Darker blue  
#ffcc99   Orange       
#ffccff   Pink         
#fffbba   Light orange 
#efe7de   Tan          
p1

# Make sure there are no spaces or tab characters 
# after the "p1", on the same line.  This is a 
# source of errors for those who aren't familiar with perl :)

########################################################################################################
#############################         Default Details        ###########################################
#############################       (for new calendars)      ###########################################
########################################################################################################
# You may want some boilerplate text in the "details" section of a 
# new calendar.

$new_calendar_default_details = "You must include a contact email address for the calendar to be approved.";


########################################################################################################
################################        Event Icons        #############################################
########################################################################################################
# If you want to add your own icons, 
# you'll need:
# -  three copies of your icon in the $theme_path/icons/ directory
#    - a 50 x 50 version, named my_icon_50x50.gif
#    - a 32 x 32 version, named my_icon_32x32.gif
#    - a 16 x 16 version, named my_icon_16x16.gif
# - a new entry in the menu structure below 
#
# The icon menu structure looks like HTML, but it's not really.  It's an XML
# format that is translated by plans into html.  Most browsers display nested submenus 
# in "flattened" groups, which looks ok.  Someday, browsers will support real 
# nested menus.  It's possible to use javascript to fake this, but it's flaky 
# and has problems with browser form elements.
# see http://www.brainjar.com/css/positioning/default5.asp for technical details.


$event_icons_menu =<<p1;
<menuitem value="blank">Blank (no icon)</menuitem>
<menu name="General Icons">
 <menuitem value="clipboard">Clipboard & pencil</menuitem>
 <menuitem value="bullet_point">Bullet point</menuitem>
 <menuitem value="exclamation">Exclamation point</menuitem>
 <menuitem value="clock">Clock</menuitem>
 <menuitem value="church">Church</menuitem>
 <menuitem value="us_flag">Stars & Stripes</menuitem>
 <menuitem value="news">News</menuitem>
 <menuitem value="1st_aid">First Aid</menuitem>
</menu>
<menu name="Outdoor Icons">
 <menuitem value="bike">Bike</menuitem>
 <menuitem value="fire">Campfire</menuitem>
 <menuitem value="axe">Axe</menuitem>
 <menuitem value="canoe">Canoe</menuitem>
 <menuitem value="compass">Compass</menuitem>
 <menuitem value="fish">Fish</menuitem>
 <menuitem value="e_frame_pack">Pack (ext. frame)</menuitem>
 <menuitem value="i_frame_pack">Pack (int. frame)</menuitem>
 <menuitem value="snowflake">Snowflake</menuitem>
 <menuitem value="tent">Tent</menuitem>
</menu>
<menu name="Cub Scouting Icons">
 <menuitem value="cs_logo">Cub Scout Logo</menuitem>
 <menuitem value="bob_wolf_bear">Bobcat, Wolf, & Bear</menuitem>
 <menuitem value="wolftracks">Wolf Tracks</menuitem>
 <menuitem value="beartracks">Bear Tracks</menuitem>
 <menuitem value="webelos_patch">Webelos Patch</menuitem>
</menu>
<menu name="Other Scouting Icons">
 <menuitem value="fleur_logo">BSA fleur</menuitem>
 <menuitem value="bsa_rwb">Red White & Blue BSA logo</menuitem>
 <menuitem value="B-P">Baden-Powell</menuitem>
 <menuitem value="firstclass">First Class</menuitem>
 <menuitem value="scout_sign">Scout Sign</menuitem>
 <menuitem value="old_scout">Old Scout (saluting)</menuitem>
 <menuitem value="eagle_medal">Eagle Medal</menuitem>
 <menuitem value="knife">Knife</menuitem>
 <menuitem value="square_knot">Square Knot</menuitem>
 <menuitem value="figure_8_knot">Figure 8 Knot</menuitem>
 <menuitem value="venture_logo">Venturing logo</menuitem>
 <menuitem value="exploring_logo">Exploring logo</menuitem>
 <menuitem value="oa_logo">OA logo</menuitem>
 <menuitem value="woodbadge">WoodBadge</menuitem>
 <menuitem value="powderhorn">Powderhorn</menuitem>
 <menuitem value="gsusa_logo">GSUSA logo</menuitem>
</menu>
p1
# Again, be careful to avoid putting any characters 
# (normal or whitespace) after the "p1", on the same line.  This is a 
# source of errors for those who aren't familiar with perl :)

########################################################################################################
################################     Unit Number Icons     #############################################
########################################################################################################
# Plans was originally devloped as a calendar for a scout troop.  This 
# feature is a holdover from those days.  For it to work correctly, 
# the graphics for unit number icons must be present in the $graphics_path.

$unit_number_icons=0;

return 1;
