summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-05-03 18:48:42 +0000
committerDries Buytaert <dries@buytaert.net>2001-05-03 18:48:42 +0000
commit16818777616eadeb8a4670324e099b95c8d53e3b (patch)
treecba5c6389300c695f2be81097b5b3f8210f0fcc2 /modules
parent97ec8e0c10743d9ec2c7d8d09c79a5db64533035 (diff)
downloadbrdo-16818777616eadeb8a4670324e099b95c8d53e3b.tar.gz
brdo-16818777616eadeb8a4670324e099b95c8d53e3b.tar.bz2
CHANGES:
- Added moderator information to forum.module. - Simplified story.module, page.module, forum.module and book.module by removing redundant code, and by doing other small house-keeping tasks.
Diffstat (limited to 'modules')
-rw-r--r--modules/book.module5
-rw-r--r--modules/book/book.module5
-rw-r--r--modules/comment.module4
-rw-r--r--modules/comment/comment.module4
-rw-r--r--modules/forum.module21
-rw-r--r--modules/forum/forum.module21
-rw-r--r--modules/moderate.module4
-rw-r--r--modules/page.module11
-rw-r--r--modules/page/page.module11
-rw-r--r--modules/story.module5
-rw-r--r--modules/story/story.module5
11 files changed, 26 insertions, 70 deletions
diff --git a/modules/book.module b/modules/book.module
index 61a3f5946..f0e9d4c44 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -1,7 +1,6 @@
<?php
$module = array("find" => "book_find",
- "type" => "book_type",
"page" => "book_page",
"user" => "book_user",
"admin" => "book_admin",
@@ -32,10 +31,6 @@ function book_location($node, $nodes = array()) {
return $nodes;
}
-function book_type() {
- return array("book", t("book page"));
-}
-
function book_view($node, $main = 0) {
global $theme;
diff --git a/modules/book/book.module b/modules/book/book.module
index 61a3f5946..f0e9d4c44 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -1,7 +1,6 @@
<?php
$module = array("find" => "book_find",
- "type" => "book_type",
"page" => "book_page",
"user" => "book_user",
"admin" => "book_admin",
@@ -32,10 +31,6 @@ function book_location($node, $nodes = array()) {
return $nodes;
}
-function book_type() {
- return array("book", t("book page"));
-}
-
function book_view($node, $main = 0) {
global $theme;
diff --git a/modules/comment.module b/modules/comment.module
index e87e6d2c9..c8f14006f 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -22,7 +22,7 @@ function comment_edit($id) {
$form .= form_item(t("Author"), format_username($comment->userid));
$form .= form_textfield(t("Subject"), "subject", $comment->subject, 50, 128);
$form .= form_textarea(t("Comment"), "comment", $comment->comment, 50, 10);
- $form .= form_submit("Submit");
+ $form .= form_submit(t("Submit"));
return form($REQUEST_URI, $form);
}
@@ -58,7 +58,7 @@ function comment_admin() {
print search_form($keys);
print search_data($keys, $mod);
break;
- case "Submit":
+ case t("Submit"):
print status(comment_save(check_input($id), $edit));
print comment_overview();
break;
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index e87e6d2c9..c8f14006f 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -22,7 +22,7 @@ function comment_edit($id) {
$form .= form_item(t("Author"), format_username($comment->userid));
$form .= form_textfield(t("Subject"), "subject", $comment->subject, 50, 128);
$form .= form_textarea(t("Comment"), "comment", $comment->comment, 50, 10);
- $form .= form_submit("Submit");
+ $form .= form_submit(t("Submit"));
return form($REQUEST_URI, $form);
}
@@ -58,7 +58,7 @@ function comment_admin() {
print search_form($keys);
print search_data($keys, $mod);
break;
- case "Submit":
+ case t("Submit"):
print status(comment_save(check_input($id), $edit));
print comment_overview();
break;
diff --git a/modules/forum.module b/modules/forum.module
index 755e5947a..0e7c6cce7 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -1,22 +1,17 @@
<?php
-$module = array("type" => "forum_type",
- "page" => "forum_page",
+$module = array("page" => "forum_page",
"admin" => "forum_admin");
$format = array(0 => HTML, 1 => PHP, 2 => text);
-function forum_type() {
- return array("forum", "forum");
-}
-
function forum_status() {
return array(dumped, posted);
}
function forum_view($node) {
global $theme;
- $output .= "<P><A HREF=\"module.php?mod=forum\">Forum</A> / <B><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></B>:</P><P>". check_output($node->body) ."</P>";
+ $output .= "<P><A HREF=\"module.php?mod=forum\">". t("Forum") ."</A> / <B><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></B>:</P><P>". check_output($node->body) ."</P>";
$theme->box(t("Discussion forum"), $output);
}
@@ -27,7 +22,7 @@ function forum_form($edit = array()) {
$form .= structure_form("forum", $edit);
$form .= form_textarea(t("Body"), "body", $edit[body], 50, 10);
$form .= form_hidden("nid", $edit[nid]);
- $form .= form_submit("Submit");
+ $form .= form_submit(t("Submit"));
return form($REQUEST_URI, $form);
}
@@ -53,10 +48,10 @@ function forum_page() {
$result = db_query("SELECT nid FROM node WHERE type = 'forum' ORDER BY title");
$output .= "<TABLE BORDER=\"0\" CELLSPACING=\"4\" CELLPADDING=\"4\">\n";
- $output .= " <TR><TH>". t("Forum") ."</TH><TH>". t("Comments") ."</TH><TH>". t("Last comment") ."</TH></TR>";
+ $output .= " <TR><TH>". t("Forum") ."</TH><TH>". t("Comments") ."</TH><TH>". t("Last comment") ."</TH><TH>". t("Moderators") ."</TH></TR>";
while ($node = db_fetch_object($result)) {
$node = node_get_object("nid", $node->nid);
- $output .= " <TR><TD><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A><BR><SMALL>". check_output($node->body, 1) ."</SMALL></TD><TD ALIGN=\"center\">". forum_num_comments($node->nid) ."</TD><TD ALIGN=\"center\">". forum_last_comment($node->nid) ."</TD></TR>";
+ $output .= " <TR><TD><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A><BR><SMALL>". check_output($node->body, 1) ."</SMALL></TD><TD ALIGN=\"center\">". forum_num_comments($node->nid) ."</TD><TD ALIGN=\"center\">". forum_last_comment($node->nid) ."</TD><TD ALIGN=\"center\"><SMALL>". check_output($node->moderate) ."</SMALL></TD></TR>";
}
$output .= "</TABLE>\n";
@@ -70,12 +65,10 @@ function forum_overview() {
}
function forum_admin() {
- global $id, $op, $edit, $type;
+ global $id, $op, $edit;
print "<SMALL><A HREF=\"admin.php?mod=forum&op=add\">add new forum</A> | <A HREF=\"admin.php?mod=forum\">overview</A></SMALL><HR>\n";
- $type = ($type ? $type : 0);
-
switch ($op) {
case "add":
print forum_form();
@@ -83,7 +76,7 @@ function forum_admin() {
case "edit":
print forum_form(node_get_array(nid, $id));
break;
- case "Submit":
+ case t("Submit"):
print status(forum_save($edit));
// fall through:
default:
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index 755e5947a..0e7c6cce7 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -1,22 +1,17 @@
<?php
-$module = array("type" => "forum_type",
- "page" => "forum_page",
+$module = array("page" => "forum_page",
"admin" => "forum_admin");
$format = array(0 => HTML, 1 => PHP, 2 => text);
-function forum_type() {
- return array("forum", "forum");
-}
-
function forum_status() {
return array(dumped, posted);
}
function forum_view($node) {
global $theme;
- $output .= "<P><A HREF=\"module.php?mod=forum\">Forum</A> / <B><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></B>:</P><P>". check_output($node->body) ."</P>";
+ $output .= "<P><A HREF=\"module.php?mod=forum\">". t("Forum") ."</A> / <B><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A></B>:</P><P>". check_output($node->body) ."</P>";
$theme->box(t("Discussion forum"), $output);
}
@@ -27,7 +22,7 @@ function forum_form($edit = array()) {
$form .= structure_form("forum", $edit);
$form .= form_textarea(t("Body"), "body", $edit[body], 50, 10);
$form .= form_hidden("nid", $edit[nid]);
- $form .= form_submit("Submit");
+ $form .= form_submit(t("Submit"));
return form($REQUEST_URI, $form);
}
@@ -53,10 +48,10 @@ function forum_page() {
$result = db_query("SELECT nid FROM node WHERE type = 'forum' ORDER BY title");
$output .= "<TABLE BORDER=\"0\" CELLSPACING=\"4\" CELLPADDING=\"4\">\n";
- $output .= " <TR><TH>". t("Forum") ."</TH><TH>". t("Comments") ."</TH><TH>". t("Last comment") ."</TH></TR>";
+ $output .= " <TR><TH>". t("Forum") ."</TH><TH>". t("Comments") ."</TH><TH>". t("Last comment") ."</TH><TH>". t("Moderators") ."</TH></TR>";
while ($node = db_fetch_object($result)) {
$node = node_get_object("nid", $node->nid);
- $output .= " <TR><TD><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A><BR><SMALL>". check_output($node->body, 1) ."</SMALL></TD><TD ALIGN=\"center\">". forum_num_comments($node->nid) ."</TD><TD ALIGN=\"center\">". forum_last_comment($node->nid) ."</TD></TR>";
+ $output .= " <TR><TD><A HREF=\"node.php?id=$node->nid\">". check_output($node->title) ."</A><BR><SMALL>". check_output($node->body, 1) ."</SMALL></TD><TD ALIGN=\"center\">". forum_num_comments($node->nid) ."</TD><TD ALIGN=\"center\">". forum_last_comment($node->nid) ."</TD><TD ALIGN=\"center\"><SMALL>". check_output($node->moderate) ."</SMALL></TD></TR>";
}
$output .= "</TABLE>\n";
@@ -70,12 +65,10 @@ function forum_overview() {
}
function forum_admin() {
- global $id, $op, $edit, $type;
+ global $id, $op, $edit;
print "<SMALL><A HREF=\"admin.php?mod=forum&op=add\">add new forum</A> | <A HREF=\"admin.php?mod=forum\">overview</A></SMALL><HR>\n";
- $type = ($type ? $type : 0);
-
switch ($op) {
case "add":
print forum_form();
@@ -83,7 +76,7 @@ function forum_admin() {
case "edit":
print forum_form(node_get_array(nid, $id));
break;
- case "Submit":
+ case t("Submit"):
print status(forum_save($edit));
// fall through:
default:
diff --git a/modules/moderate.module b/modules/moderate.module
index 02f4974b5..5ce6d6d3a 100644
--- a/modules/moderate.module
+++ b/modules/moderate.module
@@ -82,7 +82,7 @@ function moderate_admin() {
case "edit":
print moderate_comment_edit($id);
break;
- case "Submit":
+ case t("Submit"):
print status(moderate_comment_save($id, $edit));
// fall through:
default:
@@ -94,7 +94,7 @@ function moderate_admin() {
case "edit":
print moderate_node_edit($id);
break;
- case "Submit":
+ case t("Submit"):
print status(moderate_node_save($edit));
// fall through:
default:
diff --git a/modules/page.module b/modules/page.module
index f29d529dd..65379b729 100644
--- a/modules/page.module
+++ b/modules/page.module
@@ -1,14 +1,9 @@
<?php
-$module = array("type" => "page_type",
- "admin" => "page_admin");
+$module = array("admin" => "page_admin");
$format = array(0 => HTML, 1 => PHP, 2 => text);
-function page_type() {
- return array("page", "static page");
-}
-
function page_view($node, $main = 0) {
global $format, $theme;
@@ -38,7 +33,7 @@ function page_form($edit = array()) {
$form .= form_textarea(t("Body"), "body", $edit[body], 50, 10);
$form .= form_select(t("Type"), "format", $edit[format], $format);
$form .= form_hidden("nid", $edit[nid]);
- $form .= form_submit("Submit");
+ $form .= form_submit(t("Submit"));
return form($REQUEST_URI, $form);
}
@@ -75,7 +70,7 @@ function page_admin() {
case "listing":
print node_listing(page_query());
break;
- case "Submit":
+ case t("Submit"):
print status(page_save($edit));
// fall through:
default:
diff --git a/modules/page/page.module b/modules/page/page.module
index f29d529dd..65379b729 100644
--- a/modules/page/page.module
+++ b/modules/page/page.module
@@ -1,14 +1,9 @@
<?php
-$module = array("type" => "page_type",
- "admin" => "page_admin");
+$module = array("admin" => "page_admin");
$format = array(0 => HTML, 1 => PHP, 2 => text);
-function page_type() {
- return array("page", "static page");
-}
-
function page_view($node, $main = 0) {
global $format, $theme;
@@ -38,7 +33,7 @@ function page_form($edit = array()) {
$form .= form_textarea(t("Body"), "body", $edit[body], 50, 10);
$form .= form_select(t("Type"), "format", $edit[format], $format);
$form .= form_hidden("nid", $edit[nid]);
- $form .= form_submit("Submit");
+ $form .= form_submit(t("Submit"));
return form($REQUEST_URI, $form);
}
@@ -75,7 +70,7 @@ function page_admin() {
case "listing":
print node_listing(page_query());
break;
- case "Submit":
+ case t("Submit"):
print status(page_save($edit));
// fall through:
default:
diff --git a/modules/story.module b/modules/story.module
index 30482f50e..c2dff4709 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -2,7 +2,6 @@
$module = array("help" => "story_help",
"find" => "story_find",
- "type" => "story_type",
"user" => "story_user",
"queue" => "story_queue",
"admin" => "story_admin",
@@ -43,10 +42,6 @@ function story_help() {
<?php
}
-function story_type() {
- return array("story", t("story"));
-}
-
function story_view($node, $main = 0) {
global $theme;
$theme->story($node, $main);
diff --git a/modules/story/story.module b/modules/story/story.module
index 30482f50e..c2dff4709 100644
--- a/modules/story/story.module
+++ b/modules/story/story.module
@@ -2,7 +2,6 @@
$module = array("help" => "story_help",
"find" => "story_find",
- "type" => "story_type",
"user" => "story_user",
"queue" => "story_queue",
"admin" => "story_admin",
@@ -43,10 +42,6 @@ function story_help() {
<?php
}
-function story_type() {
- return array("story", t("story"));
-}
-
function story_view($node, $main = 0) {
global $theme;
$theme->story($node, $main);