summaryrefslogtreecommitdiff
path: root/modules/forum.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-11-01 17:04:20 +0000
committerDries Buytaert <dries@buytaert.net>2001-11-01 17:04:20 +0000
commit23ca7a2d8832aa16107cf7002c35170ae2b87a1c (patch)
tree7878082b9e4bd2b0d20380d11c6404b72cd44d32 /modules/forum.module
parent3d47ad359ded4cb947b7ada9b3418640cfb3c642 (diff)
downloadbrdo-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/forum.module')
-rw-r--r--modules/forum.module27
1 files changed, 18 insertions, 9 deletions
diff --git a/modules/forum.module b/modules/forum.module
index 5364b7e34..f33ad51f5 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -1,6 +1,21 @@
<?php
// $Id$
+function forum_node($field) {
+ $info = array("name" => "discussion forum");
+
+ return $info[$field];
+}
+
+function forum_access($op, $node) {
+
+ if ($op == "view") {
+ return $node->nid && $node->status && !$node->moderate;
+ }
+
+ return user_access("adminster nodes");
+}
+
function forum_link($type) {
if ($type == "page" && user_access("access content")) {
$links[] = "<a href=\"module.php?mod=forum\">". t("forum") ."</a>";
@@ -24,18 +39,12 @@ function forum_form($node) {
function forum_save() {
- if (user_access("administer nodes")) {
- if ($node->nid) {
- return array();
- }
- else {
- return array("promote" => 0, "moderate" => 0, "status" => 1);
- }
+ if ($node->nid) {
+ return array();
}
else {
- return 0;
+ return array("promote" => 0, "moderate" => 0, "status" => 1);
}
-
}
function forum_num_comments($nid) {