Skip to content
This repository has been archived by the owner on Feb 26, 2025. It is now read-only.

Commit

Permalink
Merge pull request coral-erm#647 from coral-erm/development
Browse files Browse the repository at this point in the history
2020.02 Release
  • Loading branch information
poacherone authored Apr 7, 2020
2 parents 528fa17 + 0cf9e2f commit cc5f05c
Show file tree
Hide file tree
Showing 307 changed files with 31,130 additions and 11,977 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ tests/_support/_generated/

# Workspace directory for IDE
/.idea

# Custom terms tool branding
licensing/css/custom.css
635 changes: 635 additions & 0 deletions LICENSE.md

Large diffs are not rendered by default.

61 changes: 51 additions & 10 deletions LangCodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,72 @@
class LangCodes{
public function getLanguage($code){
$all_lang=array(
'fr_FR'=>'fr_FR',
'de_DE'=>'de_DE',
'en_GB'=>'en_GB',
'en_US'=>'en_US',
'es_ES'=> 'es_ES',
'fr_FR'=>'fr_FR',
'tr_TR'=>'tr_TR',
'zh_CN'=>'zh_CN',
'zh_TW'=>'zh_TW',
'de_DE'=>'de_DE',
'tr_TR'=>'tr_TR'
'zh_TW'=>'zh_TW'
);
return array_key_exists($code, $all_lang) ? $all_lang[$code] : "en_US";
return array_key_exists($code, $all_lang) ? $all_lang[$code] : null;
}
public function getNameLang($code_lang){
$name_lang=array(
'fr_FR'=>'Français',
'de_DE'=>'Deutsch',
'en_GB'=>'English (GB)',
'en_US'=>'English (US)',
'es_ES'=> 'Español',
'fr_FR'=>'Français',
'tr_TR'=>'Türkçe',
'zh_CN'=>'中文 (简体)',
'zh_TW'=>'中文 (正體)',
'de_DE'=>'Deutsch',
'tr_TR'=>'Türkçe'
'zh_TW'=>'中文 (正體)'
);
return array_key_exists($code_lang, $name_lang) ? $name_lang[$code_lang] : "English";
return array_key_exists($code_lang, $name_lang) ? $name_lang[$code_lang] : null;
}

public function getBrowserLanguage() {
return str_replace('-', '_', substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,5));
}

public function getLanguageSelector() {
echo '<span id="setLanguage"><select name="lang" id="lang" class="dropDownLang">';
$route='locale';
$lang[]="en_US"; // add default language
if (is_dir($route)) {
if ($dh = opendir($route)) {
while (($file = readdir($dh)) !== false) {
if (is_dir("$route/$file") && $file!="." && $file!=".." && $this->getLanguage($file) != null){
$lang[]=$file;
}
}
closedir($dh);
}
}else {
echo "<br>"._("Invalid translation route!");
}
// Get language of navigator
$defLang = $this->getBrowserLanguage();

// Show an ordered list
sort($lang);
for($i=0; $i<count($lang); $i++){
if(isset($_COOKIE["lang"])){
if($_COOKIE["lang"]==$lang[$i]){
echo "<option value='".$lang[$i]."' selected='selected'>".$this->getNameLang($lang[$i])."</option>";
}else{
echo "<option value='".$lang[$i]."'>".$this->getNameLang($lang[$i])."</option>";
}
}else{
if($defLang==substr($lang[$i],0,5)){
echo "<option value='".$lang[$i]."' selected='selected'>".$this->getNameLang($lang[$i])."</option>";
}else{
echo "<option value='".$lang[$i]."'>".$this->getNameLang($lang[$i])."</option>";
}
}
}
echo '</select></span>';
}
}
?>
42 changes: 2 additions & 40 deletions auth/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<link rel="SHORTCUT ICON" href="images/favicon.ico" />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:100,400,300,600,700' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="../js/plugins/jquery-1.4.4.js"></script>
<script type="text/javascript" src="../js/plugins/jquery-1.8.0.js"></script>
<script type="text/javascript" src="js/plugins/thickbox.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="../js/plugins/Gettext.js"></script>
Expand Down Expand Up @@ -91,45 +91,7 @@
</div>
<div class='boxRight'>
<p class="fontText"><?php echo _("Change language:");?></p>
<select name="lang" id="lang" class="dropDownLang">
<?php
// Get all translations on the 'locale' folder
$route='locale';
$lang[]="en_US"; // add default language
if (is_dir($route)) {
if ($dh = opendir($route)) {
while (($file = readdir($dh)) !== false) {
if (is_dir("$route/$file") && $file!="." && $file!=".."){
$lang[]=$file;
}
}
closedir($dh);
}
}else {
echo "<br>"._("Invalid translation route!");
}
// Get language of navigator
$defLang = $lang_name->getBrowserLanguage();

// Show an ordered list
sort($lang);
for($i=0; $i<count($lang); $i++){
if(isset($_COOKIE["lang"])){
if($_COOKIE["lang"]==$lang[$i]){
echo "<option value='".$lang[$i]."' selected='selected'>".$lang_name->getNameLang(substr($lang[$i],0,5))."</option>";
}else{
echo "<option value='".$lang[$i]."'>".$lang_name->getNameLang(substr($lang[$i],0,5))."</option>";
}
}else{
if($defLang==substr($lang[$i],0,5)){
echo "<option value='".$lang[$i]."' selected='selected'>".$lang_name->getNameLang(substr($lang[$i],0,5))."</option>";
}else{
echo "<option value='".$lang[$i]."'>".$lang_name->getNameLang(substr($lang[$i],0,5))."</option>";
}
}
}
?>
</select>
<?php $lang_name->getLanguageSelector(); ?>
</div>
<div class='smallerText' style='text-align:center; margin-top:13px;'><a href='index.php' id='login-link'><?php echo _("Login page")?></a></div>
<?php include '../templates/footer.php'; ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/


class Object {
class Base_Object {

public function __construct(NamedArguments $arguments = NULL) {
if (method_exists($this, 'init')) {
Expand Down
2 changes: 1 addition & 1 deletion auth/admin/classes/common/DBService.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/


class DBService extends Object {
class DBService extends Base_Object {

protected $db;
protected $config;
Expand Down
2 changes: 1 addition & 1 deletion auth/admin/classes/common/DynamicObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/


class DynamicObject extends Object {
class DynamicObject extends Base_Object {

protected $properties = array();

Expand Down
2 changes: 1 addition & 1 deletion auth/admin/classes/common/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function text() {
}


class Email extends Object {
class Email extends Base_Object {

protected $to;
protected $subject;
Expand Down
42 changes: 2 additions & 40 deletions auth/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
<link rel="SHORTCUT ICON" href="images/favicon.ico" />
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<link href='https://fonts.googleapis.com/css?family=Open+Sans:100,400,300,600,700' rel='stylesheet' type='text/css'>
<script type="text/javascript" src="../js/plugins/jquery-1.4.4.js"></script>
<script type="text/javascript" src="../js/plugins/jquery-1.8.0.js"></script>
<script type="text/javascript" src="js/plugins/thickbox.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="../js/plugins/Gettext.js"></script>
Expand Down Expand Up @@ -224,45 +224,7 @@
</div>
<div class='boxRight'>
<p class="fontText"><?php echo _("Change language:");?></p>
<select name="lang" id="lang" class="dropDownLang">
<?php
// Get all translations on the 'locale' folder
$route='locale';
$lang[]="en_US"; // add default language
if (is_dir($route)) {
if ($dh = opendir($route)) {
while (($file = readdir($dh)) !== false) {
if (is_dir("$route/$file") && $file!="." && $file!=".."){
$lang[]=$file;
}
}
closedir($dh);
}
}else {
echo "<br>"._("Invalid translation route!");
}
// Get language of navigator
$defLang = $lang_name->getBrowserLanguage();

// Show an ordered list
sort($lang);
for($i=0; $i<count($lang); $i++){
if(isset($_COOKIE["lang"])){
if($_COOKIE["lang"]==$lang[$i]){
echo "<option value='".$lang[$i]."' selected='selected'>".$lang_name->getNameLang($lang[$i])."</option>";
}else{
echo "<option value='".$lang[$i]."'>".$lang_name->getNameLang($lang[$i])."</option>";
}
}else{
if($defLang==substr($lang[$i],0,5)){
echo "<option value='".$lang[$i]."' selected='selected'>".$lang_name->getNameLang($lang[$i])."</option>";
}else{
echo "<option value='".$lang[$i]."'>".$lang_name->getNameLang($lang[$i])."</option>";
}
}
}
?>
</select>
<?php $lang_name->getLanguageSelector(); ?>
</div>
<div class='smallerText' style='text-align:center; margin-top:13px;'><a href='admin.php' title="<?php echo _("Admin page")?>"><?php echo _("Admin page")?></a></div>

Expand Down
10 changes: 10 additions & 0 deletions auth/install/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,16 @@ function register_auth_provider()
}
];

case "2020.02":
return [
"function" => function($shared_module_info) {
$return = new stdClass();
$return->yield = new stdClass();
$return->success = true;
$return->yield->title = _("Auth Module");
return $return;
}
];


/**
Expand Down
Binary file added auth/locale/es_ES/LC_MESSAGES/messages.mo
Binary file not shown.
Loading

0 comments on commit cc5f05c

Please sign in to comment.