Skip to content

Commit

Permalink
fix bug when loading graph widget
Browse files Browse the repository at this point in the history
  • Loading branch information
TrystanLea committed Dec 11, 2017
1 parent 85ddc62 commit 818ae94
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions widget/graph_widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

global $session, $mysqli;

if (group_module_installed()) {
// Check if group module is installed
$group = false;
$result = $mysqli->query("SHOW TABLES LIKE 'groups'");
if ($result->num_rows > 0) {
require_once "Modules/group/group_model.php";
$group = new Group($mysqli, null, null, null, null);
}
else
$group = null;

require_once "Modules/graph/graph_model.php";
$graph = new Graph($mysqli, $group);
Expand All @@ -24,13 +25,5 @@
}
}

function group_module_installed() {
global $mysqli;
$result = $mysqli->query("SHOW TABLES LIKE 'groups'");
if ($result->num_rows > 0)
return true;
else
false;
}
?>
<script>var savedgraphsnamelist = <?php echo json_encode($savedgraphsnamelist); ?>;</script>

0 comments on commit 818ae94

Please sign in to comment.