From ef7d5e1201df1aff7b536f798d0a53d616722be3 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 29 Apr 2001 12:39:55 +0000 Subject: CHANGES: - Added new form_* functions to common.inc, used for building forms: it should improve 'stability' (no form typos, every- thing properly escaped/unescaped) and should help providing a very consistent user interface (wrt forms). - Adjusted node.module to use the new form functions. (Can be used as an example.) - Adjusted book.module to use the new form functions. (Can be used as an example.) - Merged function.inc into common.inc! - Slowly removing all global $status and $rstatus variables: use node_status() instead. TODO: - Apart from implementing the permission system, I'll spend some time updating most modules today and tomorrow to use the new form functions. --- includes/node.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'includes/node.inc') diff --git a/includes/node.inc b/includes/node.inc index 8f43f411d..e594e8554 100644 --- a/includes/node.inc +++ b/includes/node.inc @@ -158,8 +158,9 @@ function node_form($node) { return node_invoke($node, "form"); } -function node_status($node) { - return node_invoke($node, "status"); +function node_status($node, $index = -1) { + $status = array_intersect(array(dumped, expired, queued, posted), node_invoke($node, "status")); + return $index < 0 ? $status : $status[$index]; } function node_control($node) { -- cgit v1.2.3