diff --git a/modules/node.module b/modules/node.module index e24dbc5e455..2d013f3954e 100644 --- a/modules/node.module +++ b/modules/node.module @@ -1369,7 +1369,6 @@ function node_page() { $op = $_POST["op"]; $edit = $_POST["edit"]; - theme("header"); if (user_access("access content")) { if (empty($op)) { $op = arg(1); @@ -1380,7 +1379,10 @@ function node_page() { return; } + theme("header"); + $name = module_invoke(arg(2), "node", "name"); + switch ($op) { case "add": theme("box", t("Create new $name"), node_add(arg(2))); @@ -1409,12 +1411,15 @@ function node_page() { } print pager_display(NULL, variable_get("default_nodes_main", 10)); } + + theme("footer"); } else { + theme("header"); theme("box", t("Access denied"), message_access()); + theme("footer"); } - theme("footer"); } function node_update_index() { diff --git a/modules/node/node.module b/modules/node/node.module index e24dbc5e455..2d013f3954e 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1369,7 +1369,6 @@ function node_page() { $op = $_POST["op"]; $edit = $_POST["edit"]; - theme("header"); if (user_access("access content")) { if (empty($op)) { $op = arg(1); @@ -1380,7 +1379,10 @@ function node_page() { return; } + theme("header"); + $name = module_invoke(arg(2), "node", "name"); + switch ($op) { case "add": theme("box", t("Create new $name"), node_add(arg(2))); @@ -1409,12 +1411,15 @@ function node_page() { } print pager_display(NULL, variable_get("default_nodes_main", 10)); } + + theme("footer"); } else { + theme("header"); theme("box", t("Access denied"), message_access()); + theme("footer"); } - theme("footer"); } function node_update_index() {