summaryrefslogtreecommitdiff
path: root/includes/node.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-04-29 12:39:55 +0000
committerDries Buytaert <dries@buytaert.net>2001-04-29 12:39:55 +0000
commitef7d5e1201df1aff7b536f798d0a53d616722be3 (patch)
tree186a328d8f1a044f554895292f77d2b310536577 /includes/node.inc
parent828f36cdf1ebbf2580eb00fdfbf55701e4f86156 (diff)
downloadbrdo-ef7d5e1201df1aff7b536f798d0a53d616722be3.tar.gz
brdo-ef7d5e1201df1aff7b536f798d0a53d616722be3.tar.bz2
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.
Diffstat (limited to 'includes/node.inc')
-rw-r--r--includes/node.inc5
1 files changed, 3 insertions, 2 deletions
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) {