diff --git a/graph.css b/graph.css index 045cfa4..572a88f 100644 --- a/graph.css +++ b/graph.css @@ -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 */ diff --git a/graph.js b/graph.js index a3facd8..f58fe10 100644 --- a/graph.js +++ b/graph.js @@ -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(); // --------------------------------------------------------------- @@ -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; diff --git a/graph_controller.php b/graph_controller.php index 8291f69..881547a 100644 --- a/graph_controller.php +++ b/graph_controller.php @@ -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; @@ -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"])); } diff --git a/graph_menu.php b/graph_menu.php index fd9ecbb..463dc17 100644 --- a/graph_menu.php +++ b/graph_menu.php @@ -1,12 +1,12 @@ _("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 -