From b5e644d6b09351434167d87879e81029f36cf60d Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 19 May 2003 18:36:58 +0000 Subject: - Some fields can be passed through the $_GET array (eg. to make the "blog it" modules work). Patch by Ax. --- modules/node/node.module | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'modules/node/node.module') diff --git a/modules/node/node.module b/modules/node/node.module index 7ec69b207..b8471124c 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -1104,12 +1104,16 @@ function node_add($type) { */ if ($type && node_access("create", $type)) { - // Initialize settings - // TODO : clean up this code. + // Initialize settings: $node = array("uid" => $user->uid, "name" => $user->name, "type" => $type); + + /* + ** Allow the following fields to be initialized via $_GET (eg. for use + ** with a "blog it" bookmarklet): + */ foreach (array("title", "teaser", "body") as $field) { - if ($edit[$field]) { - $node[$field] = check_input($edit[$field]); + if ($_GET["edit"][$field]) { + $node[$field] = check_input($_GET["edit"][$field]); } } $output = node_form($node); -- cgit v1.2.3