Browse Source

Add external app "dock", fix #3

tags/v1.0
Skylar Ittner 2 years ago
parent
commit
d54d066870
6 changed files with 120 additions and 8 deletions
  1. 10
    1
      apps/sync_mobile.php
  2. 27
    3
      home.php
  3. 4
    2
      lang/en_us.php
  4. 1
    1
      pages.php
  5. 30
    1
      settings.template.php
  6. 48
    0
      static/css/app.css

+ 10
- 1
apps/sync_mobile.php View File

@@ -53,11 +53,20 @@ END;
$content .= "<div class='list-group'>";
if (count($activecodes) > 0) {
foreach ($activecodes as $c) {
$content .= "<div class='list-group-item'><span style='font-family: Ubuntu Mono,monospace;'>" . trim(chunk_split($c['code'], 5, ' ')) . "</span> <span class='pull-right'><a class='btn btn-primary btn-sm' href='home.php?page=security&mobilecode=generate&showsynccode=" . $c['codeid'] . "'><i class='fa fa-qrcode'></i></a> <a class='btn btn-danger btn-sm' href='home.php?page=security&delsynccode=" . $c['codeid'] . "'><i class='fa fa-trash'></i></a></span></div>";
$content .= "<div class='list-group-item mobilekey'><span style='font-family: Ubuntu Mono,monospace; flex-shrink: 0'>" . trim(chunk_split($c['code'], 5, ' ')) . "</span> <span class='tinybuttons'><a class='btn btn-primary btn-sm' href='home.php?page=security&mobilecode=generate&showsynccode=" . $c['codeid'] . "'><i class='fa fa-qrcode'></i></a> <a class='btn btn-danger btn-sm' href='home.php?page=security&delsynccode=" . $c['codeid'] . "'><i class='fa fa-trash'></i></a></span></div>";
}
} else {
$content .= "<div class='list-group-item'>" . lang("no active codes", false) . "</div>";
}
$content .= "</div>";
$content .= <<<END
<style>
.mobilekey {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
</style>
END;
$APPS["sync_mobile"]["content"] = $content;
}

+ 27
- 3
home.php View File

@@ -38,7 +38,7 @@ if (!is_empty($_GET['page'])) {
<div class="container">
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-4 col-lg-4 col-sm-offset-3 col-md-offset-4 col-lg-offset-4">
<img class="img-responsive banner-image" src="static/img/logo.svg" />
<a href="home.php"><img class="img-responsive banner-image" src="static/img/logo.svg" /></a>
</div>
</div>
<nav class="navbar navbar-inverse">
@@ -79,9 +79,9 @@ if (!is_empty($_GET['page'])) {
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-gears fa-fw"></i> <?php lang("options") ?> <span class="caret"></span></a>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-user fa-fw"></i> <?php lang("account") ?> <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="home.php?page=security"><i class="fa fa-lock fa-fw"></i> <?php lang("account security") ?></a></li>
<li><a href="home.php?page=security"><i class="fa fa-gears fa-fw"></i> <?php lang("options") ?></a></li>
<li class="divider"></li>
<li><a href="action.php?action=signout"><i class="fa fa-sign-out fa-fw"></i> <?php lang("sign out") ?></a></li>
</ul>
@@ -90,6 +90,30 @@ if (!is_empty($_GET['page'])) {
</div>
</div>
</nav>

<div class="app-dock">
<?php
foreach (EXTERNAL_APPS as $a) {
?>
<div class="app-dock-item">
<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'];
}
?>"/>
<span><?php echo $a['title']; ?></span>
</a>
</p>
</div>
<?php
}
?>
</div>

<?php
// Alert messages
if (!is_empty($_GET['msg']) && array_key_exists($_GET['msg'], MESSAGES)) {

+ 4
- 2
lang/en_us.php View File

@@ -22,11 +22,13 @@ $STRINGS = [
. "of the 500 most common passwords. Try a different one.",
"welcome user" => "Welcome, {user}!",
"change password" => "Change password",
"security options" => "Security options",
"account security" => "Account security",
"security options" => "Security options",
"account options" => "Account options",
"options" => "Options",
"sign out" => "Sign out",
"settings" => "Settings",
"options" => "Options",
"account" => "Account",
"404 error" => "404 Error",
"page not found" => "Page not found.",
"current password incorrect" => "The current password is incorrect. "

+ 1
- 1
pages.php View File

@@ -6,7 +6,7 @@ define("PAGES", [
"title" => "{DEFAULT}"
],
"security" => [
"title" => "security options"
"title" => "account options"
],
"404" => [
"title" => "404 error"

+ 30
- 1
settings.template.php View File

@@ -68,6 +68,35 @@ define('QWIKCLOCK_HOME', '/qwikclock/app.php');
// See lang folder for language options
define('LANGUAGE', "en_us");

// List of available applications, icons, and other info.
// Used in the mobile app and in the "dock" in Portal.
define('EXTERNAL_APPS', [
"portal" => [
"url" => "http://localhost/portal",
"mobileapi" => "/mobile",
"icon" => "/static/img/logo.svg",
"title" => SITE_TITLE
],
"taskfloor" => [
"url" => "http://localhost/taskfloor",
"mobileapi" => "/mobile",
"icon" => "/static/img/logo.svg",
"title" => "TaskFloor"
],
"qwikclock" => [
"url" => "http://localhost/qwikclock",
"mobileapi" => "/mobile",
"icon" => "/static/img/logo.svg",
"title" => "QwikClock"
],
"inventory" => [
"url" => "http://localhost/inventory",
"mobileapi" => "/mobile",
"icon" => "/static/img/logo.svg",
"title" => "Inventory"
]
]);

// Email settings for receiving admin alerts.
define("USE_SMTP", TRUE); // if FALSE, will use PHP's mail() instead
define("ADMIN_EMAIL", "");
@@ -100,6 +129,6 @@ define("QUERY_LIMIT", 1000);
// /!\ Warning: Changing these values may /!\ //
// /!\ violate the terms of your license agreement! /!\ //
//////////////////////////////////////////////////////////////
define("LICENSE_TEXT", "<b>Unlicensed Demo: For Trial Use Only</b>");
define("LICENSE_TEXT", "<b>Personal, Non-commercial Use Only</b>");
define("COPYRIGHT_NAME", "Netsyms Technologies");
//////////////////////////////////////////////////////////////

+ 48
- 0
static/css/app.css View File

@@ -45,11 +45,55 @@
min-height: 250px;
}

.app-dock {
margin: 0 auto 10px auto;
display: flex;
justify-content: space-around;
flex-wrap: wrap;
}

.app-icon {
border: 1px solid grey;
border-radius: 20%;
}

.app-dock-item {
padding: 0px 5px 2px 5px;
}

.app-dock-item p {
margin-bottom: 0px;
}

.app-dock-item p a {
font-size: 95%;
color: #555;
}

.app-dock-item p a:hover {
text-decoration: none;
}

.app-dock-item p a img {
width: 50px;
display: block;
margin: 0 auto;
}

.app-dock-item p a span {
display: block;
text-align: center;
}

/* Small Devices, Tablets */
@media only screen and (min-width: 768px) and (max-width: 991px) {
.row.widget-box > .col-sm-6:nth-child(2n+3) {
clear: both;
}
.app-dock {
max-width: 50%;
}
}

/* Medium Devices, Desktops */
@@ -57,4 +101,8 @@
.row.widget-box > .col-md-4:nth-child(3n+4) {
clear: both;
}
.app-dock {
max-width: 50%;
}
}

Loading…
Cancel
Save