summaryrefslogtreecommitdiff
path: root/modules/node.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-05-19 18:36:58 +0000
committerDries Buytaert <dries@buytaert.net>2003-05-19 18:36:58 +0000
commitb5e644d6b09351434167d87879e81029f36cf60d (patch)
treea11918f1b967d4df51324af9dbba7c7df2bbe567 /modules/node.module
parent65293a819b4b6ffcc883dd30fd8b5a9cdccfb085 (diff)
downloadbrdo-b5e644d6b09351434167d87879e81029f36cf60d.tar.gz
brdo-b5e644d6b09351434167d87879e81029f36cf60d.tar.bz2
- Some fields can be passed through the $_GET array (eg. to make the "blog
it" modules work). Patch by Ax.
Diffstat (limited to 'modules/node.module')
-rw-r--r--modules/node.module12
1 files changed, 8 insertions, 4 deletions
diff --git a/modules/node.module b/modules/node.module
index 7ec69b207..b8471124c 100644
--- a/modules/node.module
+++ b/modules/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);