Commit 31d67e34 authored by nextime's avatar nextime

Let's users know where they are in the gui!

parent 42c87512
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -379,6 +379,14 @@ input::-webkit-input-speech-button { ...@@ -379,6 +379,14 @@ input::-webkit-input-speech-button {
bottom: -2px; bottom: -2px;
} }
.shadow-dmwhite {
box-shadow: 0px 0px 25px 6px #969696 inset;
}
.shadow-dmblack {
box-shadow: 0px 0px 25px 6px #7e79ff inset;
}
.notifypanel { .notifypanel {
position:absolute; position:absolute;
right: 5px; right: 5px;
......
...@@ -2,18 +2,66 @@ ...@@ -2,18 +2,66 @@
$GUIDEBUG=FALSE; $GUIDEBUG=FALSE;
//$GUIDEBUG=TRUE; //$GUIDEBUG=TRUE;
$BASEGUIPATH=str_replace("/index.php","",$_SERVER['PHP_SELF']);
$FSPATH=realpath(dirname(__FILE__)."/.."); function getBaseGuiPath()
$GUIPATH=str_replace($BASEGUIPATH,'',explode('?',$_SERVER['REQUEST_URI'])[0]); {
$sectar=explode("/", $GUIPATH); return str_replace("/index.php","",$_SERVER['PHP_SELF']);
$GUISECTION="index"; }
$GUISUBSECTION="";
if(count($sectar)>1 and $sectar[1]!="") function getFSPath()
$GUISECTION=$sectar[1]; {
if(count($sectar)>2) return realpath(dirname(__FILE__)."/..");
$GUISUBSECTION=$sectar[2]; }
if(count($sectar)>3)
$GUISUBSECTIONOPT=$sectar[3];
function getGuiPath()
{
return str_replace(getBaseGuiPath(),'',explode('?',$_SERVER['REQUEST_URI'])[0]);
}
function getSection($path=false)
{
if($path)
$sectar=explode("/", $path);
else
$sectar=explode("/", getGuiPath());
$GUISECTION="index";
if(count($sectar)>1 and $sectar[1]!="")
$GUISECTION=$sectar[1];
return $GUISECTION;
}
function getSubsection($path=false)
{
if($path)
$sectar=explode("/", $path);
else
$sectar=explode("/", getGuiPath());
$GUISUBSECTION="";
if(count($sectar)>2)
$GUISUBSECTION=$sectar[2];
return $GUISUBSECTION;
}
function getSubsectionOpt($path=false)
{
if($path)
$sectar=explode("/", $path);
else
$sectar=explode("/", getGuiPath());
$GUISUBSECTIONOPT="";
if(count($sectar)>3)
$GUISUBSECTIONOPT=$sectar[3];
return $GUISUBSECTIONOPT;
}
$BASEGUIPATH=getBaseGuiPath();
$FSPATH=getFSPath();
$GUIPATH=getGuiPath();
$GUISECTION=getSection();
$GUISUBSECTION=getSubsection();
$GUISUBSECTIONOPT=getSubsectionOpt();
$left=FALSE; $left=FALSE;
$right=FALSE; $right=FALSE;
......
...@@ -87,6 +87,21 @@ window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.document ...@@ -87,6 +87,21 @@ window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.document
//document.documentElement.requestFullscreen(); //document.documentElement.requestFullscreen();
//window.screen.mozLockOrientation('portrait'); //window.screen.mozLockOrientation('portrait');
<?
$baseg=str_replace("/js/domotika.js","",$BASEGUIPATH);
$baseg=str_replace("/js/combined.min.js", "", $baseg);
?>
var BASEGUIPATH='<?=$baseg?>';
var sectar=window.location.pathname.replace(BASEGUIPATH, "").split("/");
var GUISECTION="index";
if(sectar.length>1 && sectar[1].length>0 && sectar[1]!='actuations')
GUISECTION=sectar[1];
var GUISUBSECTION="";
if(sectar.length>2)
GUISUBSECTION=sectar[2];
console.debug(sectar);
console.debug(GUISECTION);
var windowWidth = window.screen.width < window.outerWidth ? var windowWidth = window.screen.width < window.outerWidth ?
window.screen.width : window.outerWidth; window.screen.width : window.outerWidth;
...@@ -346,8 +361,21 @@ window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.document ...@@ -346,8 +361,21 @@ window.matchMedia=window.matchMedia||function(a){"use strict";var c,d=a.document
$(document).ready(function() { $(document).ready(function() {
mval = calcSnapSize(); mval = calcSnapSize();
$(".left-drawer").css("width", mval); $(".left-drawer").each(function(){ $(this).css("width", mval)});
$(".right-drawer").css("width", mval) $(".right-drawer").each(function(){ $(this).css("width", mval)});
$(".right-drawer a").each(function(){
if($(this).attr('data-guisection')==GUISECTION){
//$(this).css('border', '2px solid azure');
$(this).addClass('shadow-<?=$_DOMOTIKA["gui_theme"]?>');
}
});
$(".left-drawer a").each(function(){
if($(this).attr('data-guisubsection')==GUISUBSECTION){
//$(this).css('border', '2px solid azure');
$(this).addClass('shadow-<?=$_DOMOTIKA["gui_theme"]?>');
}
});
}); });
var snapper = new Snap({ var snapper = new Snap({
......
...@@ -2,6 +2,21 @@ ...@@ -2,6 +2,21 @@
//document.documentElement.requestFullscreen(); //document.documentElement.requestFullscreen();
//window.screen.mozLockOrientation('portrait'); //window.screen.mozLockOrientation('portrait');
<?
$baseg=str_replace("/js/domotika.js","",$BASEGUIPATH);
$baseg=str_replace("/js/combined.min.js", "", $baseg);
?>
var BASEGUIPATH='<?=$baseg?>';
var sectar=window.location.pathname.replace(BASEGUIPATH, "").split("/");
var GUISECTION="index";
if(sectar.length>1 && sectar[1].length>0 && sectar[1]!='actuations')
GUISECTION=sectar[1];
var GUISUBSECTION="";
if(sectar.length>2)
GUISUBSECTION=sectar[2];
console.debug(sectar);
console.debug(GUISECTION);
var windowWidth = window.screen.width < window.outerWidth ? var windowWidth = window.screen.width < window.outerWidth ?
window.screen.width : window.outerWidth; window.screen.width : window.outerWidth;
...@@ -261,8 +276,21 @@ ...@@ -261,8 +276,21 @@
$(document).ready(function() { $(document).ready(function() {
mval = calcSnapSize(); mval = calcSnapSize();
$(".left-drawer").css("width", mval); $(".left-drawer").each(function(){ $(this).css("width", mval)});
$(".right-drawer").css("width", mval) $(".right-drawer").each(function(){ $(this).css("width", mval)});
$(".right-drawer a").each(function(){
if($(this).attr('data-guisection')==GUISECTION){
//$(this).css('border', '2px solid azure');
$(this).addClass('shadow-<?=$_DOMOTIKA["gui_theme"]?>');
}
});
$(".left-drawer a").each(function(){
if($(this).attr('data-guisubsection')==GUISUBSECTION){
//$(this).css('border', '2px solid azure');
$(this).addClass('shadow-<?=$_DOMOTIKA["gui_theme"]?>');
}
});
}); });
var snapper = new Snap({ var snapper = new Snap({
......
<? @include_once("../includes/common.php"); ?> <? @include_once("../includes/common.php"); ?>
<div class="left-drawer"> <div class="left-drawer">
<div id="websectionlist" class="panel drawer-container scrollable"> <div id="websectionlist" class="panel drawer-container scrollable">
<a href="<?=$BASEGUIPATH?>" class="btn btn-block btn-default leftbtn" <? /* style="background-image: url(/resources/icons/home_white_alpha_32x32.png)" */?>>home</a> <a href="<?=$BASEGUIPATH?>/" data-guisubsection='' class="btn btn-block btn-default leftbtn" <? /* style="background-image: url(/resources/icons/home_white_alpha_32x32.png)" */?>>home</a>
<? <?
$links=array(); $links=array();
foreach(getWebSections(array('home'), array(), 'devsection') as $ws) foreach(getWebSections(array('home'), array(), 'devsection') as $ws)
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
{ {
if(!startsWith($v, '_')) { if(!startsWith($v, '_')) {
?> ?>
<a href="<?=$BASEGUIPATH."/actuations/".$v?>" class="btn btn-block btn-default leftbtn"><?=$k?></a> <a href="<?=$BASEGUIPATH."/actuations/".$v?>" data-guisubsection='<?=$v?>' class="btn btn-block btn-default leftbtn"><?=$k?></a>
<? <?
} }
} }
......
<? @include_once("../includes/common.php"); ?> <? @include_once("../includes/common.php"); ?>
<div class="left-drawer"> <div class="left-drawer">
<div id="websectionlist" class="panel drawer-container scrollable"> <div id="websectionlist" class="panel drawer-container scrollable">
<a href="<?=$BASEGUIPATH."/cameras"?>" class="btn btn-block btn-default">Telecamere Home</a> <a href="<?=$BASEGUIPATH."/cameras"?>" data-guisubsection='' class="btn btn-block btn-default">Telecamere Home</a>
<? <?
$v=DB::query("SELECT id,button_name,position FROM mediasources WHERE websection='camera' AND active=1 ORDER BY position,id"); $v=DB::query("SELECT id,button_name,position FROM mediasources WHERE websection='camera' AND active=1 ORDER BY position,id");
$links=array(); $links=array();
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
foreach($links as $k => $v) foreach($links as $k => $v)
{ {
?> ?>
<a href="<?=$BASEGUIPATH."/cameras/".$v?>" class="btn btn-block btn-default"><?=$k?></a> <a href="<?=$BASEGUIPATH."/cameras/".$v?>" data-guisubsection='<?=$v?>' class="btn btn-block btn-default"><?=$k?></a>
<? <?
} }
?> ?>
......
<? @include_once("../includes/common.php"); ?> <? @include_once("../includes/common.php"); ?>
<div class="left-drawer"> <div class="left-drawer">
<div id="websectionlist" class="panel drawer-container scrollable"> <div id="websectionlist" class="panel drawer-container scrollable">
<a href="<?=$BASEGUIPATH."/stats"?>" class="btn btn-block btn-default">Stats Home</a> <a href="<?=$BASEGUIPATH."/stats"?>" data-guisubsection='' class="btn btn-block btn-default">Stats Home</a>
<? <?
$l=DB::query("SELECT websection FROM stats_charts WHERE websection!='home' group by websection order by websection"); $l=DB::query("SELECT websection FROM stats_charts WHERE websection!='home' group by websection order by websection");
foreach($l as $k => $v) foreach($l as $k => $v)
{ {
?> ?>
<a href="<?=$BASEGUIPATH."/stats/".$v['websection']?>" class="btn btn-block btn-default"><?=$v['websection']?></a> <a href="<?=$BASEGUIPATH."/stats/".$v['websection']?>" data-guisubsection='<?=$v?>' class="btn btn-block btn-default"><?=$v['websection']?></a>
<? <?
} }
?> ?>
......
<? @include_once("../includes/common.php"); ?> <? @include_once("../includes/common.php"); ?>
<div class="left-drawer"> <div class="left-drawer">
<div id="websectionlist" class="panel drawer-container scrollable"> <div id="websectionlist" class="panel drawer-container scrollable">
<a href="<?=$BASEGUIPATH."/video"?>" class="btn btn-block btn-default">Video Home</a> <a href="<?=$BASEGUIPATH."/video"?>" data-guisubsection='' class="btn btn-block btn-default">Video Home</a>
<? <?
$v=DB::query("SELECT id,button_name,position FROM mediasources WHERE websection='video' AND active=1 ORDER BY position,id"); $v=DB::query("SELECT id,button_name,position FROM mediasources WHERE websection='video' AND active=1 ORDER BY position,id");
$links=array(); $links=array();
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
foreach($links as $k => $v) foreach($links as $k => $v)
{ {
?> ?>
<a href="<?=$BASEGUIPATH."/video/".$v?>" class="btn btn-block btn-default"><?=$k?></a> <a href="<?=$BASEGUIPATH."/video/".$v?>" data-guisubsection='<?=$v?>' class="btn btn-block btn-default"><?=$k?></a>
<? <?
} }
?> ?>
......
...@@ -5,6 +5,9 @@ ...@@ -5,6 +5,9 @@
$paneldimensions=array('dimensions' => array(4 => '50%')); $paneldimensions=array('dimensions' => array(4 => '50%'));
$SHOW_EMPTY_PANELS=FALSE; $SHOW_EMPTY_PANELS=FALSE;
if($GUISUBSECTION=="")
header("Location: $BASEGUIPATH");
$panels = array(); $panels = array();
$panels[]=array('panel_title'=>$tr->Get($GUISUBSECTION)." - ".$tr->Get("Actions"),'panel_sections'=>'actions','panel_websections'=>$GUISUBSECTION,'panel_cols'=>4, 'panel_height'=>'100%')+$PANELDEFAULTS; $panels[]=array('panel_title'=>$tr->Get($GUISUBSECTION)." - ".$tr->Get("Actions"),'panel_sections'=>'actions','panel_websections'=>$GUISUBSECTION,'panel_cols'=>4, 'panel_height'=>'100%')+$PANELDEFAULTS;
$panels[]=array('panel_title'=>$tr->Get($GUISUBSECTION)." - ".$tr->Get("Outputs"),'panel_sections'=>'output','panel_websections'=>$GUISUBSECTION,'panel_cols'=>4, 'panel_height'=>'100%')+$PANELDEFAULTS; $panels[]=array('panel_title'=>$tr->Get($GUISUBSECTION)." - ".$tr->Get("Outputs"),'panel_sections'=>'output','panel_websections'=>$GUISUBSECTION,'panel_cols'=>4, 'panel_height'=>'100%')+$PANELDEFAULTS;
......
...@@ -2,15 +2,15 @@ ...@@ -2,15 +2,15 @@
<div class="right-drawer"> <div class="right-drawer">
<div id="websectionlist" class="panel drawer-container scrollable"> <div id="websectionlist" class="panel drawer-container scrollable">
<div class="panel-heading"><h2 class="panel-title">Menu</h2></div> <div class="panel-heading"><h2 class="panel-title">Menu</h2></div>
<a href="<?=$BASEGUIPATH."/"?>" class="btn btn-block btn-default rightbtn rightbtn-attuazioni">Attuazioni</a> <a href="<?=$BASEGUIPATH."/"?>" data-guisection='index' class="btn btn-block btn-default rightbtn rightbtn-attuazioni">Attuazioni</a>
<a href="<?=$BASEGUIPATH."/clima"?>" class="btn btn-block btn-default rightbtn rightbtn-clima">Clima</a> <a href="<?=$BASEGUIPATH."/clima"?>" data-guisection='clima' class="btn btn-block btn-default rightbtn rightbtn-clima">Clima</a>
<a href="<?=$BASEGUIPATH."/video"?>" class="btn btn-block btn-default rightbtn rightbtn-tv">Video & TV</a> <a href="<?=$BASEGUIPATH."/video"?>" data-guisection='video' class="btn btn-block btn-default rightbtn rightbtn-tv">Video & TV</a>
<a href="<?=$BASEGUIPATH."/cameras"?>" class="btn btn-block btn-default rightbtn rightbtn-video">Telecamere</a> <a href="<?=$BASEGUIPATH."/cameras"?>" data-guisection='cameras' class="btn btn-block btn-default rightbtn rightbtn-video">Telecamere</a>
<a href="<?=$BASEGUIPATH."/stats"?>" class="btn btn-block btn-default rightbtn rightbtn-stats">Stats</a> <a href="<?=$BASEGUIPATH."/stats"?>" data-guisection='stats' class="btn btn-block btn-default rightbtn rightbtn-stats">Stats</a>
<!-- <!--
<a href="<?=$BASEGUIPATH."/alarm"?>" class="btn btn-block btn-default rightbtn rightbtn-alarm">Antifurto</a> <a href="<?=$BASEGUIPATH."/alarm"?>" data-guisection='alarm' class="btn btn-block btn-default rightbtn rightbtn-alarm">Antifurto</a>
<a href="<?=$BASEGUIPATH."/audio"?>" class="btn btn-block btn-default rightbtn rightbtn-audio">Audio</a> <a href="<?=$BASEGUIPATH."/audio"?>" data-guisection='audio' class="btn btn-block btn-default rightbtn rightbtn-audio">Audio</a>
<a href="<?=$BASEGUIPATH."/irrigation"?>" class="btn btn-block btn-default rightbtn rightbtn-irr">Irrigazione</a> <a href="<?=$BASEGUIPATH."/irrigation"?>" data-guisection='irrigation' class="btn btn-block btn-default rightbtn rightbtn-irr">Irrigazione</a>
--> -->
</div> </div>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment