[ Index ] |
|
Code source de eGroupWare 1.2.106-2 |
1 <?php 2 /**************************************************************************\ 3 * eGroupWare - Setup * 4 * http://www.egroupware.org * 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 12 /* $Id: lang.php 20295 2006-02-15 12:31:25Z $ */ 13 14 $GLOBALS['egw_info'] = array( 15 'flags' => array( 16 'noheader' => True, 17 'nonavbar' => True, 18 'currentapp' => 'home', 19 'noapi' => True 20 )); 21 include ('./inc/functions.inc.php'); 22 // Authorize the user to use setup app and load the database 23 // Does not return unless user is authorized 24 if (!$GLOBALS['egw_setup']->auth('Config') || @$_POST['cancel']) 25 { 26 Header('Location: index.php'); 27 exit; 28 } 29 $GLOBALS['egw_setup']->loaddb(); 30 31 if (@$_POST['submit']) 32 { 33 $GLOBALS['egw_setup']->translation->setup_translation_sql(); 34 $GLOBALS['egw_setup']->translation->sql->install_langs(@$_POST['lang_selected'],@$_POST['upgrademethod']); 35 36 37 if( !$GLOBALS['egw_setup']->translation->sql->line_rejected ) 38 { 39 Header('Location: index.php'); 40 exit; 41 } 42 } 43 44 $tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup'); 45 $setup_tpl = CreateObject('phpgwapi.Template',$tpl_root); 46 $setup_tpl->set_file(array( 47 'T_head' => 'head.tpl', 48 'T_footer' => 'footer.tpl', 49 'T_alert_msg' => 'msg_alert_msg.tpl', 50 'T_lang_main' => 'lang_main.tpl' 51 )); 52 53 $setup_tpl->set_block('T_lang_main','B_choose_method','V_choose_method'); 54 55 $stage_title = lang('Multi-Language support setup'); 56 $stage_desc = lang('This program will help you upgrade or install different languages for eGroupWare'); 57 $tbl_width = @$newinstall ? '60%' : '80%'; 58 $td_colspan = @$newinstall ? '1' : '2'; 59 $td_align = @$newinstall ? ' align="center"' : ''; 60 $hidden_var1 = @$newinstall ? '<input type="hidden" name="newinstall" value="True" />' : ''; 61 62 if (!@$newinstall && !isset($GLOBALS['egw_info']['setup']['installed_langs'])) 63 { 64 $GLOBALS['egw_setup']->detection->check_lang(false); // get installed langs 65 } 66 $select_box_desc = lang('Select which languages you would like to use'); 67 $select_box = ''; 68 $languages = get_langs(); 69 uasort($languages,create_function('$a,$b','return strcmp(@$a[\'descr\'],@$b[\'descr\']);')); 70 foreach($languages as $id => $data) 71 { 72 $select_box_langs = 73 @$select_box_langs 74 .'<option value="' . $id . '"' 75 .(@$GLOBALS['egw_info']['setup']['installed_langs'][$id]?' selected="selected"':'').'>' 76 . $data['descr'] . '</option>' 77 ."\n"; 78 } 79 80 if (!@$newinstall) 81 { 82 $meth_desc = lang('Select which method of upgrade you would like to do'); 83 $blurb_addonlynew = lang('Only add languages that are not in the database already'); 84 $blurb_addmissing = lang('Only add new phrases'); 85 $blurb_dumpold = lang('Delete all old languages and install new ones'); 86 87 $setup_tpl->set_var('meth_desc',$meth_desc); 88 $setup_tpl->set_var('blurb_addonlynew',$blurb_addonlynew); 89 $setup_tpl->set_var('blurb_addmissing',$blurb_addmissing); 90 $setup_tpl->set_var('blurb_dumpold',$blurb_dumpold); 91 $setup_tpl->set_var('lang_debug',lang('enable for extra debug-messages')); 92 $setup_tpl->parse('V_choose_method','B_choose_method'); 93 } 94 else 95 { 96 $setup_tpl->set_var('V_choose_method',''); 97 } 98 99 // Rejected Lines 100 if($_POST['debug'] && count($GLOBALS['egw_setup']->translation->sql->line_rejected)) 101 { 102 $str = ''; 103 foreach($GLOBALS['egw_setup']->translation->sql->line_rejected as $badline) 104 { 105 $_f_buffer = split("[/\\]", $badline['appfile']); 106 $str .= lang('Application: %1, File: %2, Line: "%3"','<b>'.$_f_buffer[count($_f_buffer)-3].'</b>', 107 '<b>'.$_f_buffer[count($_f_buffer)-1].'</b>',$badline['line'])."<br />\n"; 108 } 109 $setup_tpl->set_var('V_alert_word', lang('Rejected lines')); 110 $setup_tpl->set_var('V_alert_msg', $str); 111 $alert = TRUE; 112 } 113 114 $setup_tpl->set_var('stage_title',$stage_title); 115 $setup_tpl->set_var('stage_desc',$stage_desc); 116 $setup_tpl->set_var('tbl_width',$tbl_width); 117 $setup_tpl->set_var('td_colspan',$td_colspan); 118 $setup_tpl->set_var('td_align',$td_align); 119 $setup_tpl->set_var('hidden_var1',$hidden_var1); 120 $setup_tpl->set_var('select_box_desc',$select_box_desc); 121 $setup_tpl->set_var('select_box_langs',$select_box_langs); 122 123 $setup_tpl->set_var('lang_install',lang('install')); 124 $setup_tpl->set_var('lang_cancel',lang('cancel')); 125 126 $GLOBALS['egw_setup']->html->show_header("$stage_title",False,'config',$GLOBALS['egw_setup']->ConfigDomain . '(' . $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain]['db_type'] . ')'); 127 $setup_tpl->pparse('out','T_lang_main'); 128 129 if($alert) 130 $setup_tpl->pparse('out','T_alert_msg'); 131 132 $GLOBALS['egw_setup']->html->show_footer(); 133 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Feb 25 17:20:01 2007 | par Balluche grâce à PHPXref 0.7 |