diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-08-22 17:03:42 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2004-08-22 17:03:42 +0000 |
commit | 51cf18e53176244f264c56cab1c4ff0d1767ac59 (patch) | |
tree | 833a665ab48dd0d3a54676d78aa9152b0699f21e /modules/node.module | |
parent | 95cb7f32229e229a39e70a76b2b0f6a14cdc5953 (diff) | |
download | brdo-51cf18e53176244f264c56cab1c4ff0d1767ac59.tar.gz brdo-51cf18e53176244f264c56cab1c4ff0d1767ac59.tar.bz2 |
- #9292: Make Drupal (somewhat) PHP5 compatible. xtemplate is still horribly broken.
Diffstat (limited to 'modules/node.module')
-rw-r--r-- | modules/node.module | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/node.module b/modules/node.module index 62a9e5426..6deaa6763 100644 --- a/modules/node.module +++ b/modules/node.module @@ -347,9 +347,12 @@ function node_invoke_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { $function = $name .'_nodeapi'; if (function_exists($function)) { $result = $function($node, $op, $a3, $a4); - if (isset($result)) { + if (is_array($result)) { $return = array_merge($return, $result); } + else { + $return[] = $result; + } } } return $return; @@ -397,7 +400,7 @@ function node_load($conditions, $revision = -1) { } // Return the desired revision. - if ($revision != -1 && isset($node->revisions[$revision])) { + if ($revision != -1 && is_array($node->revisions[$revision])) { $node = $node->revisions[$revision]['node']; } @@ -814,6 +817,7 @@ function node_default_settings() { $header = array_merge(array(t('type')), array_keys(node_invoke_nodeapi($node, 'settings'))); foreach (node_list() as $type) { + $node = new StdClass(); $node->type = $type; $cols = array(); foreach (node_invoke_nodeapi($node, 'settings') as $setting) { @@ -1221,7 +1225,11 @@ function node_form($edit) { } } - return form($output, ($param['method'] ? $param['method'] : 'post'), $param['action'], array_merge($param['options'], array('id' => 'node-form'))); + $attributes = array('id' => 'node-form'); + if (is_array($param['options'])) { + $attributes = array_merge($param['options'], $attributes); + } + return form($output, ($param['method'] ? $param['method'] : 'post'), $param['action'], $attributes); } /** |