diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-11-01 17:04:20 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-11-01 17:04:20 +0000 |
commit | 23ca7a2d8832aa16107cf7002c35170ae2b87a1c (patch) | |
tree | 7878082b9e4bd2b0d20380d11c6404b72cd44d32 /modules/story/story.module | |
parent | 3d47ad359ded4cb947b7ada9b3418640cfb3c642 (diff) | |
download | brdo-23ca7a2d8832aa16107cf7002c35170ae2b87a1c.tar.gz brdo-23ca7a2d8832aa16107cf7002c35170ae2b87a1c.tar.bz2 |
- Another batch of updates/improvements:
+ introduced basic node permissions ("create", "delete", "update" and
"view") at the node level: it's up to the "<$node->type>_module" to
hide gory details (if any).
+ made the "blog it"-feature in the blog and import module work with
the new node system, in specific with the new centralized forms.
+ made it possible to update blogs.
+ made the page module work with the new node system.
+ various smaller improvements.
Diffstat (limited to 'modules/story/story.module')
-rw-r--r-- | modules/story/story.module | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/modules/story/story.module b/modules/story/story.module index 91bb9ef81..66870c076 100644 --- a/modules/story/story.module +++ b/modules/story/story.module @@ -1,11 +1,41 @@ <?php // $Id$ +function story_node($field) { + $info = array("name" => "story"); + + return $info[$field]; +} + +function story_access($op, $node) { + + if ($op == "view") { + return $node->nid && $node->status && !$node->moderate; + } + + if ($op == "create") { + return 1; + } + + if ($op == "update") { + return user_access("administer nodes"); + } + + if ($op == "delete") { + return user_access("adminster nodes"); + } + +} + function story_help() { ?> - <P>Queued stories: user-contributed stories are automatically whisked away to a submission queue for moderators (i.e. registered user) to frown at. Moderators vote whether or not a story should be posted to the front page for discussion.</P> - <P>Posted stories: published stories accessible to all visitors.</P> - <P>Dumped stories: rejected stories that are no longer available to visitors.</P> +/* + // TODO: update documentation, outdated + + <p>Queued stories: user-contributed stories are automatically whisked away to a submission queue for moderators (i.e. registered user) to frown at. Moderators vote whether or not a story should be posted to the front page for discussion.</p> + <p>Posted stories: published stories accessible to all visitors.</p> + <p>Dumped stories: rejected stories that are no longer available to visitors.</p> +*/ <?php } @@ -17,21 +47,14 @@ function story_form($node) { } function story_save($node) { + if ($node->nid) { - if (user_access("administer nodes")) { - return array(); - } - else { - return 0; - } + return array(); } else { - /* - ** By default, stories get promoted to the front page and they are - ** subject to moderation. - */ return array("promote" => 1, "moderate" => 1); } + } ?> |