source: companies/celepar/jabberit_messenger/inc/class.uiexternals.inc.php @ 763

Revision 763, 4.4 KB checked in by niltonneto, 15 years ago (diff)

Importação inicial do Expresso da Celepar

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       
16        public $public_functions = array(
17                'backPage' => True,
18                'editParticipantsExternals' => True,
19        );
20       
21        final function __construct()
22        {
23               
24        }
25       
26        public final function editParticipantsExternals()
27        {
28                if($GLOBALS['phpgw']->acl->check('applications_access',1,'admin'))
29                {
30                        $GLOBALS['phpgw']->redirect_link('/index.php');
31                }               
32
33                $GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin') . ' - ' . lang('Config External Participants');
34               
35                $_SESSION['phpgwinfo']['db_host'] = $GLOBALS['phpgw_info']['server']['db_host'];
36        $_SESSION['phpgwinfo']['db_port'] = $GLOBALS['phpgw_info']['server']['db_port'];
37        $_SESSION['phpgwinfo']['db_name'] = $GLOBALS['phpgw_info']['server']['db_name'];
38        $_SESSION['phpgwinfo']['db_user'] = $GLOBALS['phpgw_info']['server']['db_user'];
39        $_SESSION['phpgwinfo']['db_pass'] = $GLOBALS['phpgw_info']['server']['db_pass'];
40        $_SESSION['phpgwinfo']['db_type'] = $GLOBALS['phpgw_info']['server']['db_type'];                       
41
42
43                $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url'];
44                $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/';
45
46
47                $GLOBALS['phpgw']->common->phpgw_header();
48                echo parse_navbar();
49
50                $organizations = explode(",",$GLOBALS['phpgw_info']['server']['conf_organization_jabberit']);
51                natcasesort($organizations);
52               
53                foreach($organizations as $tmp)
54                {
55                        if( $tmp != "" )
56                        {
57                                $orgs .= "<tr id='".$tmp."' style='width:40%' class='row_off'>";
58                                $orgs .= "<td>".$tmp."</td>";
59                                $orgs .= "<td><a href=\"javascript:constructScript.removePartExternal('".$tmp."');\">Excluir</a>";
60                                $orgs .= "</td></tr>";
61                        }
62                }
63               
64                $pExternal = $GLOBALS['phpgw_info']['server']['use_external_participants_jabberit'];
65
66                if( $GLOBALS['phpgw_info']['server']['use_external_participants_jabberit'] === "true")
67                {
68                        $optionExternal = "<option value='false'>".lang('No')."</option>".
69                                                          "<option value='true' selected>".lang('Yes')."</option>";
70                        $flagInputs = "selected=\"false\"";
71                }
72                else
73                {
74                        $optionExternal = "<option value='false' selected>".lang('No')."</option>".
75                                                          "<option value='true'>".lang('Yes')."</option>";
76                        $flagInputs = "selected=\"true\"";                                                       
77                }
78               
79                // Load Language;
80                require_once "load_lang.php";
81               
82                $GLOBALS['phpgw']->template->set_file(array('jabberit_messenger'=>'confExternals.tpl'));
83                $GLOBALS['phpgw']->template->set_block('jabberit_messenger','confOrg');
84                $teste = $GLOBALS['phpgw']->template->set_var(array(
85                                                                                'action_url' => $GLOBALS['phpgw']->link('/index.php','menuaction=jabberit_messenger.uiexternals.backPage'),
86                                                                                'attributes_list' => '',                       
87                                                                                'lang_add' => 'Adicionar',
88                                                                                'lang_Back' => 'Voltar',
89                                                                                'lang_cancel' => lang('Cancel'),
90                                                                                'lang_Informe_as_Organizacoes_Externas' => 'Informe as Organizações Externas',
91                                                                                'lang_Cadastrar_Organizacao' => 'Cadastrar Organização',
92                                                                                'lang_Habilitar_Participantes_Externos' => 'Habilitar Participantes Externos',
93                                                                                'lang_Delete' => lang('Delete'),                                                                               
94                                                                                'lang_save' => lang('Save'),
95                                                                                'lang_Organization' => lang('Organization'),
96                                                                                'lang_Organizacoes_Cadastradas' => 'Organizações Cadastradas',
97                                                                                'organizations_attributes' => $orgs,
98                                                                                'value_flag' => $flagInputs,
99                                                                                'value_use_external_participants_jabberit' => $optionExternal,
100                                                                                ));
101       
102                $GLOBALS['phpgw']->template->pparse('out','confOrg');
103        }       
104       
105        public final function backPage()
106        {
107                if($GLOBALS['phpgw']->acl->check('applications_access',1,'admin'))
108                {
109                        $GLOBALS['phpgw']->redirect_link('/index.php');
110                }               
111               
112                if ($_POST['cancel'])
113                {
114                        $GLOBALS['phpgw']->redirect_link('/admin/index.php');
115                }
116
117                $GLOBALS['phpgw']->redirect_link('/admin/index.php');
118        }
119}
120?>
Note: See TracBrowser for help on using the repository browser.