1 | <?php |
---|
2 | |
---|
3 | /**************************************************************************\ |
---|
4 | * Expresso Livre - Voip - administration * |
---|
5 | * * |
---|
6 | * -------------------------------------------- * |
---|
7 | * This program is free software; you can redistribute it and/or modify it * |
---|
8 | * under the terms of the GNU General Public License as published by the * |
---|
9 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
10 | * option) any later version. * |
---|
11 | \**************************************************************************/ |
---|
12 | |
---|
13 | class uicalendar |
---|
14 | { |
---|
15 | var $public_functions = array( |
---|
16 | 'edit_conf' => True |
---|
17 | ); |
---|
18 | |
---|
19 | final function __construct(){} |
---|
20 | |
---|
21 | final function edit_conf() |
---|
22 | { |
---|
23 | if($GLOBALS['phpgw']->acl->check('applications_access',1,'admin')) |
---|
24 | { |
---|
25 | $GLOBALS['phpgw']->redirect_link('/index.php'); |
---|
26 | } |
---|
27 | |
---|
28 | $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin') .' - ' . lang('Configuration Calendars'); |
---|
29 | |
---|
30 | if(!@is_object($GLOBALS['phpgw']->js)) |
---|
31 | { |
---|
32 | $GLOBALS['phpgw']->js = CreateObject('phpgwapi.javascript'); |
---|
33 | } |
---|
34 | |
---|
35 | $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url']; |
---|
36 | $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/'; |
---|
37 | |
---|
38 | if(strrpos($webserver_url,'/') === false || strrpos($webserver_url,'/') != (strlen($webserver_url)-1)) |
---|
39 | $webserver_url .= '/'; |
---|
40 | |
---|
41 | $js = array('connector','xtools','functions'); |
---|
42 | |
---|
43 | foreach( $js as $tmp ) |
---|
44 | $GLOBALS['phpgw']->js->validate_file('calendar',$tmp,'admin'); |
---|
45 | |
---|
46 | $GLOBALS['phpgw']->common->phpgw_header(); |
---|
47 | echo parse_navbar(); |
---|
48 | echo '<script type="text/javascript">var path_adm="'.$webserver_url .'"</script>'; |
---|
49 | |
---|
50 | $c = CreateObject('phpgwapi.config','phpgwapi'); |
---|
51 | $c->read_repository(); |
---|
52 | $current_config = $c->config_data; |
---|
53 | |
---|
54 | if(isset($current_config['defaultCalendar'])){ |
---|
55 | $selected = $current_config['defaultCalendar'] == 'calendar' ? 'calendar' : 'expressoCalendar'; |
---|
56 | $option = $selected == 'calendar' ? 'expressoCalendar' : 'calendar'; |
---|
57 | }else{ |
---|
58 | $selected = 'calendar'; |
---|
59 | $option = 'expressoCalendar'; |
---|
60 | } |
---|
61 | |
---|
62 | $t = CreateObject('phpgwapi.Template', $GLOBALS['phpgw']->common->get_tpl_dir('admin')); |
---|
63 | $t->set_unknowns('keep'); |
---|
64 | $t->set_file(array('calendar' => 'calendar.tpl')); |
---|
65 | $t->set_block('calendar','calendar_page','calendar_page'); |
---|
66 | $t->set_var(array( |
---|
67 | 'action_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname=admin'), |
---|
68 | 'lang_Calendar_default_for_current_installation' => lang('Calendar default for current installation'), |
---|
69 | 'lang_Calendar_settings' => 'Configuração do Calendar', |
---|
70 | 'lang_save' => lang('Save'), |
---|
71 | 'lang_cancel' => lang('Cancel'), |
---|
72 | 'selected' => $selected, |
---|
73 | 'option' => $option |
---|
74 | )); |
---|
75 | $t->pparse('out','calendar'); |
---|
76 | } |
---|
77 | |
---|
78 | function display_row($label, $value) |
---|
79 | { |
---|
80 | $GLOBALS['phpgw']->template->set_var('tr_color',$this->nextmatchs->alternate_row_color()); |
---|
81 | $GLOBALS['phpgw']->template->set_var('label',$label); |
---|
82 | $GLOBALS['phpgw']->template->set_var('value',$value); |
---|
83 | $GLOBALS['phpgw']->template->parse('rows','row',True); |
---|
84 | } |
---|
85 | } |
---|
86 | ?> |
---|