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

Fix security, menu and support large screens #137

Open
wants to merge 3 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
2 changes: 1 addition & 1 deletion graph.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.content-container { max-width:1150px; }
/* .content-container { max-width:1150px; } make usable on large devices*/

/* ------------------------------------------ */
/* REMOVE ONCE GROUP VIEW SIDEBAR REMOVED */
Expand Down
26 changes: 14 additions & 12 deletions graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,18 +227,20 @@ function graph_init_editor()
// ---------------------------------------------------------------
// Writting direct to the menu system here
// ---------------------------------------------------------------
// 1. Populate custom l3 menu from sidebar html placed in hidden element
$(".menu-l3").html($("#sidebar_html").html());
// 2. Clear original hidden element
$("#sidebar_html").html("");
// 3. Populate with feed list selector
$("#feeds").html(out);
// 4. Show l3 menu
if (menu.width>=576) menu.show_l3();
// 5. Enable l3 menu so that collapsing and re-expanding works
if (menu.obj.setup!=undefined) {
menu.obj.setup.l2.graph.l3 = []
menu.active_l3 = true;
if (menu.obj.setup.l2.graph != undefined) {
// 1. Populate custom l3 menu from sidebar html placed in hidden element
$(".menu-l3").html($("#sidebar_html").html());
// 2. Clear original hidden element
$("#sidebar_html").html("");
// 3. Populate with feed list selector
$("#feeds").html(out);
// 4. Enable l3 menu
menu.obj.setup.l2.graph.l3 = []
menu.active_l3 = true;
// 5. Show l3 menu now (next line or just the if may not be neede as menu class will use auto hide feature when needed)
if (menu.width>=576) menu.show_l3();
}
}
load_saved_graphs_menu();
// ---------------------------------------------------------------
Expand Down Expand Up @@ -1841,7 +1843,7 @@ function printdate(timestamp)
if (secs<10) secs = "0"+secs;

var datestr = "";
// date.getHours()+":"+minutes+" "+day+" "+month;
// date.getHours()+":"+minutes+" "+day+" "+month;
datestr += day+"/"+month;
if (thisyear!=year) datestr += "/"+year;
datestr += " " + date.getHours()+":"+minutes+":"+secs;
Expand Down
4 changes: 2 additions & 2 deletions graph_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function graph_controller()
require_once "Modules/graph/graph_model.php";
$graph = new Graph($mysqli, $group);

$result = "";
$result = false;

if ($route->action=="embed") {
global $embed; $embed = true;
Expand Down Expand Up @@ -70,7 +70,7 @@ function graph_controller()
else if ($group && $route->action=="groupgraph") {
$result = view("Modules/graph/group_view.php", array("session" => $session["write"], 'group_support' => 1));
}
else {
else if ($session['read'] || isset($_GET['userid'])){ // allow emoncms.org/graph?userid=1 to work
$result = view("Modules/graph/view.php", array("session" => $session["write"]));
}

Expand Down
16 changes: 8 additions & 8 deletions graph_menu.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
global $session;
if ($session["read"] || isset($_GET['userid'])) { // allow emoncms.org/graph?userid=1 to work
// Initial graph menu item placement
$menu["setup"]["l2"]['graph'] = array(
"name"=>_("Graphs"),
"href"=>"graph",
"order"=>3,
"icon"=>"show_chart"
);

$menu["setup"]["l2"]['graph'] = array(
"name"=>_("Graphs"),
"href"=>"graph",
"order"=>3,
"icon"=>"show_chart"
);
}
// Full level3 sidebar is added via javascript in graph.js