diff --git a/includes/module.inc b/includes/module.inc index 389593b81f1..2e8476572e1 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -1,98 +1,98 @@ - $block) { - foreach ($block as $item => $data) { - $block[$item] = addslashes($data); - } - if (!db_fetch_object(db_query("SELECT * FROM blocks WHERE module = '$name' AND name = '$block[info]'"))) { - db_query("INSERT INTO blocks (name, module, delta) VALUES ('$block[info]', '$name', '$delta')"); - } - else { - db_query("UPDATE blocks SET delta = '$delta', remove = '0' WHERE module = '$name' AND name = '$block[info]'"); - } - } - } - - db_query("DELETE FROM blocks WHERE module = '$name' AND remove = '1'"); -} - -// rehash a module: -function module_rehash($name) { - if (module_exist($name)) { - $result = db_query("SELECT * FROM modules WHERE name = '$name'"); - - if (!$object = db_fetch_object($result)) { - db_query("INSERT INTO modules (name) VALUES ('$name')"); - } - - // rehash module-exported blocks (if necessary): - module_rehash_blocks($name); - } - else { - // remove all reference to module: - db_query("DELETE FROM modules WHERE name = '$name'"); - db_query("DELETE FROM blocks WHERE module = '$name'"); - } -} - -?> + $block) { + foreach ($block as $item => $data) { + $block[$item] = addslashes($data); + } + if (!db_fetch_object(db_query("SELECT * FROM blocks WHERE module = '$name' AND name = '$block[info]'"))) { + db_query("INSERT INTO blocks (name, module, delta) VALUES ('$block[info]', '$name', '$delta')"); + } + else { + db_query("UPDATE blocks SET delta = '$delta', remove = '0' WHERE module = '$name' AND name = '$block[info]'"); + } + } + } + + db_query("DELETE FROM blocks WHERE module = '$name' AND remove = '1'"); +} + +// rehash a module: +function module_rehash($name) { + if (module_exist($name)) { + $result = db_query("SELECT * FROM modules WHERE name = '$name'"); + + if (!$object = db_fetch_object($result)) { + db_query("INSERT INTO modules (name) VALUES ('$name')"); + } + + // rehash module-exported blocks (if necessary): + module_rehash_blocks($name); + } + else { + // remove all reference to module: + db_query("DELETE FROM modules WHERE name = '$name'"); + db_query("DELETE FROM blocks WHERE module = '$name'"); + } +} + +?>