| | |
| | | |
| | | //* Check permissions for module |
| | | $app->auth->check_module_permissions('admin'); |
| | | if($conf['demo_mode'] == true) $app->error('This function is disabled in demo mode.'); |
| | | |
| | | //* This is only allowed for administrators |
| | | if(!$app->auth->is_admin()) die('only allowed for administrators.'); |
| | |
| | | merge_langfile(ISPC_WEB_PATH.'/'.$file.'/lib/lang/'.$target_lang_file,ISPC_WEB_PATH.'/'.$file.'/lib/lang/'.$lang_file); |
| | | } |
| | | } |
| | | $handle2 = opendir(ISPC_WEB_PATH.'/'.$file.'/lib/lang'); |
| | | while ($lang_file = @readdir ($handle2)) { |
| | | if ($lang_file != '.' && $lang_file != '..' && substr($lang_file,0,2) == $selected_language) { |
| | | $master_lang_file=ISPC_WEB_PATH.'/'.$file.'/lib/lang/en'.substr($lang_file,2); |
| | | $target_lang_file=ISPC_WEB_PATH.'/'.$file.'/lib/lang/'.$lang_file; |
| | | if(!file_exists($master_lang_file)){ |
| | | unlink($target_lang_file); |
| | | $msg.="File $target_lang_file removed because does not exist in master language<br />"; |
| | | } |
| | | } |
| | | }//Finish of remove the files how not exists in master language |
| | | } |
| | | } |
| | | } |
| | | if($msg=='') |
| | | $msg="No files created, removed or modified<br />"; |
| | | } |
| | | |
| | | function merge_langfile($langfile,$masterfile) { |
| | |
| | | |
| | | $file_content = "<?php\n"; |
| | | foreach($wb as $key => $val) { |
| | | $val = str_replace("'",'',$val); |
| | | $val = str_replace('"','',$val); |
| | | $val = str_replace("'","\\'",$val); |
| | | $val = str_replace('"','\"',$val); |
| | | $file_content .= '$wb['."'$key'".'] = '."'$val';\n"; |
| | | } |
| | | $file_content .= "?>\n"; |
| | |
| | | copy($masterfile,$langfile); |
| | | } |
| | | } |
| | | |
| | | |
| | | if($msg=='') |
| | | $msg="No files created or modified<br />"; |
| | | |
| | | $app->tpl->setVar('msg',$msg); |
| | | |