Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added "download" menu to dashboard #617

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions dashboard/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php
//Download links settings
$winDownloadLink = ""; //For Windows
$andrDownloadLink = ""; //For Android
$macosDownloadLink = ""; //For MacOS
?>
27 changes: 27 additions & 0 deletions dashboard/incl/dashboardLib.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function printNavbar($active){
$modActive = "";
$reuploadActive = "";
$statsActive = "";
$downloadActive = "";
switch($active){
case "home":
$homeActive = "active";
Expand All @@ -74,6 +75,9 @@ public function printNavbar($active){
case "stats":
$statsActive = "active";
break;
case "download":
$downloadActive = "active";
break;
}
echo '<nav class="navbar navbar-expand-lg navbar-dark menubar">
<a class="navbar-brand" href="index.php">CvoltonGDPS</a>
Expand Down Expand Up @@ -165,6 +169,29 @@ public function printNavbar($active){
<a class="dropdown-item" href="lang/switchLang.php?lang=TR">Türkçe</a>
<a class="dropdown-item" href="lang/switchLang.php?lang=test">translTest</a>
</div>';
require_once __DIR__."/../config.php";
$localizedDownloadSelection = $this->getLocalizedString("download");
$localizedForWindows = $this->getLocalizedString("forWindows");
$localizedForAndroid = $this->getLocalizedString("forAndroid");
$localizedForMacos = $this->getLocalizedString("forMacos");
$downloadCode = "<li class=\"nav-item dropdown $downloadActive\">
<a class=\"nav-link dropdown-toggle\" href=\"#\" id=\"navbarDropdownMenuLink\" data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">
<i class=\"fa fa-download\" aria-hidden=\"true\"></i> $localizedDownloadSelection
</a>
<div class=\"dropdown-menu\" aria-labelledby=\"navbarDropdownMenuLink\">";
if($winDownloadLink){
$downloadCode .= "<a class=\"dropdown-item\" href=$winDownloadLink> $localizedForWindows</a>";
}
if($andrDownloadLink){
$downloadCode .= "<a class=\"dropdown-item\" href=$andrDownloadLink> $localizedForAndroid</a>";
}
if($macosDownloadLink){
$downloadCode .= "<a class=\"dropdown-item\" href=$macosDownloadLink> $localizedForMacos</a>";
}
$downloadCode .= "</div></li>";
if($winDownloadLink || $andrDownloadLink || $macosDownloadLink){
echo $downloadCode;
}
if(isset($_SESSION["accountID"]) AND $_SESSION["accountID"] != 0){
$userName = $gs->getAccountName($_SESSION["accountID"]);
echo'<li class="nav-item dropdown">
Expand Down
5 changes: 5 additions & 0 deletions dashboard/incl/lang/localeEN.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@

$string["language"] = "Language";

$string["download"] = "Download";
$string["forWindows"] = "For Windows";
$string["forAndroid"] = "For Android";
$string["forMacos"] = "For MacOS";

$string["loginHeader"] = "Welcome, %s";
$string["logout"] = "Log Out";
$string["login"] = "Log In";
Expand Down