source: trunk/jabberit_messenger/inc/class.uiexternals.inc.php @ 891

Revision 891, 4.3 KB checked in by alexandrecorreia, 15 years ago (diff)
  • Property svn:executable set to *
Line 
1<?php
2  /***************************************************************************\
3  *  Expresso - Expresso Messenger                                            *
4  *     - Alexandre Correia / Rodrigo Souza                                                               *
5  * ------------------------------------------------------------------------- *
6  *  This program is free software; you can redistribute it and/or modify it  *
7  *  under the terms of the GNU General Public License as published by the    *
8  *  Free Software Foundation; either version 2 of the License, or (at your   *
9  *  option) any later version.                                               *
10  \***************************************************************************/
11
12class uiexternals
13{
14       
15        public $public_functions = array(
16                'backPage' => True,
17                'editParticipantsExternals' => True,
18        );
19       
20        public final function editParticipantsExternals()
21        {
22                if($GLOBALS['phpgw']->acl->check('applications_access',1,'admin'))
23                {
24                        $GLOBALS['phpgw']->redirect_link('/index.php');
25                }               
26
27                $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin') . ' - ' . lang('Config External Participants');
28               
29                $_SESSION['phpgwinfo']['db_host'] = $GLOBALS['phpgw_info']['server']['db_host'];
30        $_SESSION['phpgwinfo']['db_port'] = $GLOBALS['phpgw_info']['server']['db_port'];
31        $_SESSION['phpgwinfo']['db_name'] = $GLOBALS['phpgw_info']['server']['db_name'];
32        $_SESSION['phpgwinfo']['db_user'] = $GLOBALS['phpgw_info']['server']['db_user'];
33        $_SESSION['phpgwinfo']['db_pass'] = $GLOBALS['phpgw_info']['server']['db_pass'];
34        $_SESSION['phpgwinfo']['db_type'] = $GLOBALS['phpgw_info']['server']['db_type'];                       
35
36
37                $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url'];
38                $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/';
39
40
41                $GLOBALS['phpgw']->common->phpgw_header();
42                echo parse_navbar();
43
44                $organizations = explode(",",$GLOBALS['phpgw_info']['server']['conf_organization_jabberit']);
45                natcasesort($organizations);
46               
47                foreach($organizations as $tmp)
48                {
49                        if( $tmp != "" )
50                        {
51                                $orgs .= "<tr id='".$tmp."' style='width:40%' class='row_off'>";
52                                $orgs .= "<td>".$tmp."</td>";
53                                $orgs .= "<td><a href=\"javascript:constructScript.removePartExternal('".$tmp."');\">Excluir</a>";
54                                $orgs .= "</td></tr>";
55                        }
56                }
57               
58                $pExternal = $GLOBALS['phpgw_info']['server']['use_external_participants_jabberit'];
59
60                if( $GLOBALS['phpgw_info']['server']['use_external_participants_jabberit'] === "true")
61                {
62                        $optionExternal = "<option value='false'>".lang('No')."</option>".
63                                                          "<option value='true' selected>".lang('Yes')."</option>";
64                        $flagInputs = "selected=\"false\"";
65                }
66                else
67                {
68                        $optionExternal = "<option value='false' selected>".lang('No')."</option>".
69                                                          "<option value='true'>".lang('Yes')."</option>";
70                        $flagInputs = "selected=\"true\"";                                                       
71                }
72               
73                // Load Language;
74                require_once "load_lang.php";
75               
76                $GLOBALS['phpgw']->template->set_file(array('jabberit_messenger'=>'confExternals.tpl'));
77                $GLOBALS['phpgw']->template->set_block('jabberit_messenger','confOrg');
78                $teste = $GLOBALS['phpgw']->template->set_var(array(
79                                                                                'action_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=jabberit_messenger.uiexternals.backPage'),
80                                                                                'attributes_list' => '',                       
81                                                                                'lang_add' => 'Adicionar',
82                                                                                'lang_Back' => 'Voltar',
83                                                                                'lang_cancel' => lang('Cancel'),
84                                                                                'lang_Informe_as_Organizacoes_Externas' => 'Informe as Organizações Externas',
85                                                                                'lang_Cadastrar_Organizacao' => 'Cadastrar Organização',
86                                                                                'lang_Habilitar_Participantes_Externos' => 'Habilitar Participantes Externos',
87                                                                                'lang_Delete' => lang('Delete'),                                                                               
88                                                                                'lang_save' => lang('Save'),
89                                                                                'lang_Organization' => lang('Organization'),
90                                                                                'lang_Organizacoes_Cadastradas' => 'Organizações Cadastradas',
91                                                                                'organizations_attributes' => $orgs,
92                                                                                'value_flag' => $flagInputs,
93                                                                                'value_use_external_participants_jabberit' => $optionExternal,
94                                                                                ));
95       
96                $GLOBALS['phpgw']->template->pparse('out','confOrg');
97        }       
98       
99        public final function backPage()
100        {
101                if($GLOBALS['phpgw']->acl->check('applications_access',1,'admin'))
102                {
103                        $GLOBALS['phpgw']->redirect_link('/index.php');
104                }               
105               
106                if ($_POST['cancel'])
107                {
108                        $GLOBALS['phpgw']->redirect_link('/admin/index.php');
109                }
110
111                $GLOBALS['phpgw']->redirect_link('/admin/index.php');
112        }
113}
114?>
Note: See TracBrowser for help on using the repository browser.