summaryrefslogtreecommitdiff
path: root/includes/gui
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-05-22 18:16:34 +0200
committerMinteck <contact@minteck.org>2022-05-22 18:16:34 +0200
commitbc4d21ddbc50a4295ad1be0f4797b09895a65fea (patch)
treef915c08fba577daf766628657558ce480790b06f /includes/gui
downloadmultisocial-bc4d21ddbc50a4295ad1be0f4797b09895a65fea.tar.gz
multisocial-bc4d21ddbc50a4295ad1be0f4797b09895a65fea.tar.bz2
multisocial-bc4d21ddbc50a4295ad1be0f4797b09895a65fea.zip
Initial commitHEADmane
Diffstat (limited to 'includes/gui')
-rw-r--r--includes/gui/head.php27
-rw-r--r--includes/gui/header.app.php49
-rw-r--r--includes/gui/header.initial.php16
-rw-r--r--includes/gui/language.php8
-rw-r--r--includes/gui/menu.json26
5 files changed, 126 insertions, 0 deletions
diff --git a/includes/gui/head.php b/includes/gui/head.php
new file mode 100644
index 0000000..2bb3709
--- /dev/null
+++ b/includes/gui/head.php
@@ -0,0 +1,27 @@
+<meta charset="UTF-8">
+<title><?php
+
+ if (isset($titlec)) {
+ echo $titlec . " | ";
+ } else if (isset($title)) {
+ echo $lang["titles"][$title] . " | ";
+ }
+
+ ?>Multisocial</title>
+<meta name="description" content="Multisocial, the social network for everyone">
+<meta name="version" content="<?= version() ?> (#<?= build() ?>)">
+<link rel="stylesheet" href="/assets/bootstrap/main.css">
+<link rel="stylesheet" href="/assets/css/responsive.css">
+<link rel="stylesheet" href="/assets/css/complementary.css">
+<script src="/assets/bootstrap/main.js"></script>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<!-- <link rel="apple-touch-icon" sizes="180x180" href="/assets/favicon/apple-touch-icon.png">-->
+<!-- <link rel="shortcut icon" type="image/x-icon" href="/assets/favicon/favicon.ico">-->
+<!-- <link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon/favicon-32x32.png">-->
+<!-- <link rel="icon" type="image/png" sizes="48x48" href="/assets/favicon/favicon-48x48.png">-->
+<!-- <link rel="icon" type="image/png" sizes="64x64" href="/assets/favicon/favicon-64x64.png">-->
+<!-- <link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon/favicon-16x16.png">-->
+<!-- <link rel="manifest" href="/assets/favicon/manifest.json">-->
+<!-- <link rel="mask-icon" href="/assets/favicon/safari-pinned-tab.svg" color="#a56510">-->
+<!-- <meta name="msapplication-TileColor" content="#a56510">-->
+<!-- <meta name="theme-color" content="#a56510">--> \ No newline at end of file
diff --git a/includes/gui/header.app.php b/includes/gui/header.app.php
new file mode 100644
index 0000000..6ff97a1
--- /dev/null
+++ b/includes/gui/header.app.php
@@ -0,0 +1,49 @@
+<?php
+
+global $_AUTH;
+if (!isset($_AUTH)) {
+ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.locked.php";
+}
+
+global $title;
+global $lang;
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/gui/language.php";
+
+?>
+<!DOCTYPE html>
+<html lang="en">
+<head data-multisocial-version="<?= version() ?>" data-multisocial-build="#<?= build() ?>">
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/gui/head.php"; ?>
+</head>
+<body>
+ <nav class="navbar navbar-expand-sm bg-light navbar-light">
+ <div class="container-fluid">
+ <a class="navbar-brand" href="/home">Multisocial</a>
+ <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#collapsibleNavbar">
+ <span class="navbar-toggler-icon"></span>
+ </button>
+ <div class="collapse navbar-collapse" id="collapsibleNavbar">
+ <ul class="navbar-nav">
+ <?php if (!isset($_AUTH) || $_AUTH): ?>
+ <?php foreach (json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/gui/menu.json"), true) as $item): ?>
+ <li class="nav-item">
+ <a title="<?= $lang["menu"][$item["name"]] ?>" class="nav-link" href="<?= $item["link"] ?>">
+ <img class="nav-link-icon" src="/assets/icons/menu/<?= $item["name"] ?>.off.svg" alt="">
+ <span class="nav-link-text"><?= $lang["menu"][$item["name"]] ?></span>
+ </a>
+ </li>
+ <?php endforeach; ?>
+ <?php else: ?>
+ <li class="nav-item">
+ <a title="<?= $lang["menu"]["login"] ?>" class="nav-link" href="/session/login">
+ <img class="nav-link-icon" src="/assets/icons/menu/login.svg" alt="">
+ <span class="nav-link-text"><?= $lang["menu"]["login"] ?></span>
+ </a>
+ </li>
+ <?php endif; ?>
+ </ul>
+ </div>
+ </div>
+ </nav> \ No newline at end of file
diff --git a/includes/gui/header.initial.php b/includes/gui/header.initial.php
new file mode 100644
index 0000000..6aed28a
--- /dev/null
+++ b/includes/gui/header.initial.php
@@ -0,0 +1,16 @@
+<?php
+
+global $title;
+global $lang;
+
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/session.locked.initial.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.php";
+require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/gui/language.php";
+
+?>
+<!DOCTYPE html>
+<html lang="en">
+<head data-multisocial-version="<?= version() ?>" data-multisocial-build="#<?= build() ?>">
+ <?php require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/gui/head.php"; ?>
+</head>
+<body> \ No newline at end of file
diff --git a/includes/gui/language.php b/includes/gui/language.php
new file mode 100644
index 0000000..d64dc00
--- /dev/null
+++ b/includes/gui/language.php
@@ -0,0 +1,8 @@
+<?php
+
+// TODO: Proper language loader
+global $lang;
+$lang = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/i18n/en.json"), true);
+
+global $langp;
+$langp = "en"; \ No newline at end of file
diff --git a/includes/gui/menu.json b/includes/gui/menu.json
new file mode 100644
index 0000000..7d003f4
--- /dev/null
+++ b/includes/gui/menu.json
@@ -0,0 +1,26 @@
+[
+ {
+ "name": "home",
+ "link": "/"
+ },
+ {
+ "name": "follows",
+ "link": "/follows"
+ },
+ {
+ "name": "notifications",
+ "link": "/notifications"
+ },
+ {
+ "name": "favorites",
+ "link": "/favorites"
+ },
+ {
+ "name": "profile",
+ "link": "/profile"
+ },
+ {
+ "name": "prefs",
+ "link": "/preferences"
+ }
+] \ No newline at end of file