Browse Source

Move sync settings to separate page

tags/v2.0
Skylar Ittner 1 year ago
parent
commit
87c01fe2ce
4 changed files with 60 additions and 31 deletions
  1. 2
    2
      database_upgrade/1.0.1_1.1.sql
  2. 46
    25
      home.php
  3. 1
    0
      lang/en_us.php
  4. 11
    4
      pages.php

+ 2
- 2
database_upgrade/1.0.1_1.1.sql View File

@@ -14,9 +14,9 @@ ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;

SET FOREIGN_KEY_CHECKS = 0;
ALTER TABLE `groups`
ALTER TABLE `groups`
CHANGE COLUMN `groupid` `groupid` INT(11) NOT NULL AUTO_INCREMENT;
SET FOREIGN_KEY_CHECKS = 1;

ALTER TABLE `accounthub`.`accounts`
ALTER TABLE `accounts`
ADD COLUMN `pin` VARCHAR(10) NULL DEFAULT NULL AFTER `authsecret`;

+ 46
- 25
home.php View File

@@ -1,5 +1,4 @@
<?php

/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@@ -88,33 +87,55 @@ if (!is_empty($_GET['page'])) {
<div class="collapse navbar-collapse" id="navbar-collapse">
<ul class="nav navbar-nav">
<?php
$counter = 0;
$more = "";
$curpagefound = false;
foreach (PAGES as $id => $pg) {
if ($pg['navbar'] === TRUE) {
if ($pageid == $id) {
?>
<li class="active">
<?php
} else {
$counter++;
if ($counter > ($curpagefound ? 4 : 3) && $pageid != $id) {
$item = '<a href="home.php?page=' . $id . '">';
if (isset($pg['icon'])) {
$item .= '<i class="fa fa-' . $pg['icon'] . ' fa-fw"></i>';
}
$item .= lang($pg['title'], false) . '</a>';
echo '<li class="hidden-sm hidden-md">' . $item . "</li>";
$more .= '<li>' . $item . "</li>";
} else {
if ($pageid == $id) {
$curpagefound = true;
?>
<li>
<?php } ?>
<a href="home.php?page=<?php echo $id; ?>">
<?php
if (isset($pg['icon'])) {
<li class="active">
<?php
} else {
?>
<i class="fa fa-<?php echo $pg['icon']; ?> fa-fw"></i>
<li>
<?php } ?>
<?php lang($pg['title']) ?>
</a>
</li>
<?php
<a href="home.php?page=<?php echo $id; ?>">
<?php
if (isset($pg['icon'])) {
?>
<i class="fa fa-<?php echo $pg['icon']; ?> fa-fw"></i>
<?php } ?>
<?php lang($pg['title']) ?>
</a>
</li>
<?php
}
}
}
?>

if ($counter > 4) {
?>
<li class="dropdown hidden-lg hidden-xs">
<a href="" class="dropdown-toggle" data-toggle="dropdown"><i class="fa fa-ellipsis-v fa-fw"></i> <?php lang("more"); ?></a>
<ul class="dropdown-menu"><?php echo $more; ?></ul>
</li>
<?php } ?>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="home.php"><i class="fa fa-user fa-fw"></i> <?php echo $_SESSION['realname'] ?></a></li>
<li><a href="action.php?action=signout"><i class="fa fa-sign-out fa-fw"></i> <?php lang("sign out") ?></a></li>
<li><a href="home.php"><i class="fa fa-user fa-fw"></i> <span class=""><?php echo $_SESSION['realname'] ?></span></a></li>
<li><a href="action.php?action=signout"><i class="fa fa-sign-out fa-fw"></i> <span class=""><?php lang("sign out") ?></span></a></li>
</ul>
</div>
</nav>
@@ -135,12 +156,12 @@ if (!is_empty($_GET['page'])) {
<p>
<a href="<?php echo $a['url']; ?>">
<img class="img-responsive app-icon" src="<?php
if (strpos($a['icon'], "http") !== 0) {
echo $a['url'] . $a['icon'];
} else {
echo $a['icon'];
}
?>"/>
if (strpos($a['icon'], "http") !== 0) {
echo $a['url'] . $a['icon'];
} else {
echo $a['icon'];
}
?>"/>
<span><?php echo $a['title']; ?></span>
</a>
</p>

+ 1
- 0
lang/en_us.php View File

@@ -29,6 +29,7 @@ $STRINGS = [
"account security" => "Account security",
"security options" => "Security options",
"account options" => "Account options",
"sync" => "Sync settings",
"options" => "Options",
"sign out" => "Sign out",
"settings" => "Settings",

+ 11
- 4
pages.php View File

@@ -12,9 +12,14 @@ define("PAGES", [
"icon" => "home"
],
"security" => [
"title" => "account options",
"title" => "account security",
"navbar" => true,
"icon" => "cogs"
"icon" => "lock"
],
"sync" => [
"title" => "sync",
"navbar" => true,
"icon" => "mobile"
],
"404" => [
"title" => "404 error",
@@ -33,10 +38,12 @@ define("APPS", [
"account_security"
],
"security" => [
"sync_mobile",
"change_password",
"change_pin",
"setup_2fa",
"change_pin"
],
"sync" => [
"sync_mobile",
],
"404" => [
"404_error"

Loading…
Cancel
Save