Skip to content

Commit

Permalink
Fixing flars issue
Browse files Browse the repository at this point in the history
put an option on the configuration $global['dont_show_us_flag'] = false;
  • Loading branch information
daniel authored and daniel committed Apr 28, 2017
1 parent 24ccb72 commit 41122ee
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion locale/function.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ function getAllFlags() {
function getEnabledLangs() {
global $global;
$dir = "{$global['systemRootPath']}locale";
$flags = array('us');
$flags = array();
if(empty($global['dont_show_us_flag'])){
$flags[] = 'us';
}
if ($handle = opendir($dir)) {
while (false !== ($entry = readdir($handle))) {
if ($entry != "." && $entry != ".." && $entry != "index.php" && $entry != "function.php" && $entry != "save.php") {
Expand Down
3 changes: 3 additions & 0 deletions objects/configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ function getWebSiteTitle() {
}

function getLanguage() {
if($this->language == "en"){
return "us";
}
return $this->language;
}

Expand Down
4 changes: 3 additions & 1 deletion objects/include_config.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
<?php
ini_set('error_log', $global['systemRootPath'].'videos/youphptube.log');
ini_set('error_log', $global['systemRootPath'].'videos/youphptube.log');
global $global;
$global['dont_show_us_flag'] = false;
6 changes: 4 additions & 2 deletions view/include/navbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@
require_once $global['systemRootPath'] . 'objects/user.php';
require_once $global['systemRootPath'] . 'objects/category.php';
$categories = Category::getAllCategories();

if (empty($_SESSION['language'])) {
$lang = 'en';
$lang = 'us';
} else {
$lang = $_SESSION['language'];
}
Expand Down Expand Up @@ -59,6 +58,9 @@
$flags = getEnabledLangs();
foreach ($flags as $value) {
$selected = "";
if($value == 'en'){
$value = 'us';
}
if ($lang == $value) {
$selected = 'selected="selected"';
}
Expand Down
2 changes: 1 addition & 1 deletion view/index.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
if (!file_exists('../videos/configuration.php')) {
if (!file_exists('../videos/configuration.php')) {
if (!file_exists('../install/index.php')) {
die("No Configuration and no Installation");
}
Expand Down

0 comments on commit 41122ee

Please sign in to comment.