Commit bacfc30b authored by Kjartan's avatar Kjartan

- Settings will no longer be lost of including a file fails.

parent 756639bc
......@@ -176,9 +176,6 @@ function system_listing($type, $directory, $required = array()) {
ksort($files);
// Clean up database.
db_query("DELETE FROM system WHERE type = '%s'", $type);
$output = "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= "<tr><th>name</th><th>description</th><th>enabled</th></tr>\n";
......@@ -200,6 +197,8 @@ function system_listing($type, $directory, $required = array()) {
}
}
// Clean up database.
db_query("DELETE FROM system WHERE filename = '%s' AND type = '%s'", $filename, $type);
db_query("INSERT INTO system (name, description, type, filename, status) VALUES ('%s', '%s', '%s', '%s', %d)", $info->name, $info->description, $type, $filename, $file->status);
$output .= "<tr>";
......
......@@ -176,9 +176,6 @@ function system_listing($type, $directory, $required = array()) {
ksort($files);
// Clean up database.
db_query("DELETE FROM system WHERE type = '%s'", $type);
$output = "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= "<tr><th>name</th><th>description</th><th>enabled</th></tr>\n";
......@@ -200,6 +197,8 @@ function system_listing($type, $directory, $required = array()) {
}
}
// Clean up database.
db_query("DELETE FROM system WHERE filename = '%s' AND type = '%s'", $filename, $type);
db_query("INSERT INTO system (name, description, type, filename, status) VALUES ('%s', '%s', '%s', '%s', %d)", $info->name, $info->description, $type, $filename, $file->status);
$output .= "<tr>";
......
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