Skip to content

Commit 41122ee

Browse files
danieldaniel
daniel
authored and
daniel
committed
Fixing flars issue
put an option on the configuration $global['dont_show_us_flag'] = false;
1 parent 24ccb72 commit 41122ee

File tree

5 files changed

+15
-5
lines changed

5 files changed

+15
-5
lines changed

locale/function.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ function getAllFlags() {
3838
function getEnabledLangs() {
3939
global $global;
4040
$dir = "{$global['systemRootPath']}locale";
41-
$flags = array('us');
41+
$flags = array();
42+
if(empty($global['dont_show_us_flag'])){
43+
$flags[] = 'us';
44+
}
4245
if ($handle = opendir($dir)) {
4346
while (false !== ($entry = readdir($handle))) {
4447
if ($entry != "." && $entry != ".." && $entry != "index.php" && $entry != "function.php" && $entry != "save.php") {

objects/configuration.php

+3
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ function getWebSiteTitle() {
131131
}
132132

133133
function getLanguage() {
134+
if($this->language == "en"){
135+
return "us";
136+
}
134137
return $this->language;
135138
}
136139

objects/include_config.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
<?php
2-
ini_set('error_log', $global['systemRootPath'].'videos/youphptube.log');
2+
ini_set('error_log', $global['systemRootPath'].'videos/youphptube.log');
3+
global $global;
4+
$global['dont_show_us_flag'] = false;

view/include/navbar.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
require_once $global['systemRootPath'] . 'objects/user.php';
33
require_once $global['systemRootPath'] . 'objects/category.php';
44
$categories = Category::getAllCategories();
5-
65
if (empty($_SESSION['language'])) {
7-
$lang = 'en';
6+
$lang = 'us';
87
} else {
98
$lang = $_SESSION['language'];
109
}
@@ -59,6 +58,9 @@
5958
$flags = getEnabledLangs();
6059
foreach ($flags as $value) {
6160
$selected = "";
61+
if($value == 'en'){
62+
$value = 'us';
63+
}
6264
if ($lang == $value) {
6365
$selected = 'selected="selected"';
6466
}

view/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
if (!file_exists('../videos/configuration.php')) {
2+
if (!file_exists('../videos/configuration.php')) {
33
if (!file_exists('../install/index.php')) {
44
die("No Configuration and no Installation");
55
}

0 commit comments

Comments
 (0)