<?php
/*
This file is part of Thomas Bley's moregroupware webmail2/calendar2/admin2 module. (tb-mgw)

More information:
-----------------

Simple Groupware Solutions Thomas Bley
Fichtenstr. 23
Germany, 85640 Putzbrunn

Contact:
--------

info@simple-groupware.de

http://www.simple-groupware.de


Copyright 2002-2003 Thomas Bley
tb-mgw is distributed under the terms of the GNU General Public License 

tb-mgw is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

tb-mgw is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with tb-mgw; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

// Settings-inc
// Moregroupware.org

$font_size = array();
$font_size[] = array("8pt","8 pt");
$font_size[] = array("10pt","10 pt");
$font_size[] = array("12pt","12 pt");
$font_size[] = array("14pt","14 pt");
$font_size[] = array("18pt","18 pt");
$font_size[] = array("24pt","24 pt");
$font_size[] = array("36pt","36 pt");

$font = array();
$font[] = array("arial,helvetica,sans-serif","Arial");
$font[] = array("courier new,courier,monospace","Courier New");
$font[] = array("georgia,times new roman,times,serif","Georgia");
$font[] = array("tahoma,arial,helvetica,sans-serif","Tahoma");
$font[] = array("times new roman,times,serif","Times New Roman");
$font[] = array("verdana,arial,helvetica,sans-serif","Verdana");
$font[] = array("impact","Impact");
$font[] = array("wingdings","WingDings");

/* settings array */
$start_week = array(array('Monday','Monday'), array('Tuesday','Tuesday'), array('Wednesday','Wednesday'), array('Thursday','Thursday'), array('Friday','Friday'), array('Saturday','Saturday'), array('Sunday','Sunday') );

include_once ROOTPATH."/modules/calendar2/inc/timezones.php";

$auto_timezone = array();
$zone = date("O");
$index = date('I');
if (isset($tz_array)) {
  foreach ($tz_array as $key=>$key2) {
    if ($zone == $key2[$index]) {
      $auto_timezone[] = $key;
    }
  } 
}

$timezone = array(
  array("Same as Server","Same as Server")
);

// $zones = file("../calendar2/TIMEZONES2");

if (isset($tz_array)) {
  foreach ($tz_array as $key=>$key2) {
    // $zone = str_replace(array("\r","\n","\t"),"",$zone);
    $timezone[] = array($key,$key);
  }
}

$mytime = array( array('0000','00:00'), array('0100','01:00'),array('0200','02:00'),array('0300','03:00'),array('0400','04:00'),array('0500','05:00'),
    array('0600','06:00'),array('0700','07:00'),array('0800','08:00'),array('0900','09:00'),array('1000','10:00'),array('1100','11:00'),array('1200','12:00'),
    array('1300','13:00'),array('1400','14:00'),array('1500','15:00'),array('1600','16:00'),array('1700','17:00'),array('1800','18:00'),array('1900','19:00'),
    array('2000','20:00'),array('2100','21:00'),array('2200','22:00'),array('2300','23:00'),array('2400','24:00')
);

$gridlength = array( array('5','5'), array('10','10'), array('15','15'), array('20','20'), array('30','30'), array('60','60'));

$settings["calendar2"] = array(
	"settings" => array(
    	"cal2_start_week" => array(
        	"method" => "select",
            "choices" => array(
            	array("name" => "", "value" => $start_week)),
            "translate" => false,
            "name" => "cal2_start_week",
            "type" => "str",
			"default" => "Monday"
        ),
    	"cal2_start_time" => array(
        	"method" => "select",
            "choices" => array(
            	array("name" => "", "value" => $mytime)),
            "translate" => false,
            "name" => "cal2_start_time",
            "type" => "str",
			"default" => "0900"
        ),
    	"cal2_end_time" => array(
        	"method" => "select",
            "choices" => array(
            	array("name" => "", "value" => $mytime)),
            "translate" => false,
            "name" => "cal2_end_time",
            "type" => "str",
			"default" => "1800"
        ),
    	"cal2_grid_length" => array(
        	"method" => "select",
            "choices" => array(
            	array("name" => "", "value" => $gridlength)),
            "translate" => false,
            "name" => "cal2_grid_length",
            "type" => "str",
			"default" => "30"
        ),
        "cal2_num_years" => array(
        	"method" => "text",
            "translate" => false,
            "name" => "cal2_num_years",
            "type" => "str",
			"default" => "3"
        ),	
    	"cal2_timezone" => array(
        	"method" => "select",
            "choices" => array(
            	array("name" => "", "value" => $timezone)),
            "translate" => false,
            "name" => "cal2_timezone",
            "note" => "(".implode(", ",$auto_timezone).")",
            "type" => "str",
			"default" => ""
        ),
    	"cal2_compose_font_size" => array(
        	"method" => "select",
            "choices" => array(
            	array("name" => "", "value" => $font_size)),
            "translate" => false,
            "name" => "calendar2_settings_compose_font_size",
            "type" => "str",
			"default" => "10 pt"
        ),
    	"cal2_compose_font" => array(
        	"method" => "select",
            "choices" => array(
            	array("name" => "", "value" => $font)),
            "translate" => false,
            "name" => "calendar2_settings_compose_font",
            "type" => "str",
			"default" => "Verdana"
        ),
			
        "title" => "cal2_settings_general_settings"
    )
);

if (is_array($settings["calendar2"])) foreach ($settings["calendar2"] as $my_module_settings) {
  if (is_array($my_module_settings)) foreach ($my_module_settings as $key=>$key2) {
    if (!isset($_SESSION["MGW"]->settings[$key]) and isset($key2["default"])) {
	  $_SESSION["MGW"]->settings[$key] = $key2["default"];
	}
  }
}

?>
