diff options
author | Dries Buytaert <dries@buytaert.net> | 2001-04-16 11:38:12 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2001-04-16 11:38:12 +0000 |
commit | b9952f537d5f1a102e145b0529c78bc31a1509af (patch) | |
tree | 51f6a0ab5c46bd4643c5b2ac0579a4a411e45977 /modules/structure.module | |
parent | 49a7dccb64a239097d44e235b525708c6a39d29e (diff) | |
download | brdo-b9952f537d5f1a102e145b0529c78bc31a1509af.tar.gz brdo-b9952f537d5f1a102e145b0529c78bc31a1509af.tar.bz2 |
Large commit, read it carefully, and make the required changes to
your theme:
- corrected some missing translations in story.module. Oops!
- grealty simplified the "moderation threshold mechanism"(tm) so
that module writers don't have to worry about this. As a result
story.module and book.module became a bit smaller and easier to
grasp.
- greatly simplified new "category" and "topic" code which is soon
going to replace the "section" code. Needs more work though so
hang on thight.
- includes/section.inc and modules/section.module are replaced by
includes/structure.module and modules/structure.module.
- beautified example.theme a bit without adding HTML complexity:
it is a good example but still useful as a theme
- made theme example use "categories" and "topics"
--> TAKE A LOOK AT IT AND UPDATE YOUR THEME
- made theme marvin use "categories" and "topics"
--> TAKE A LOOK AT IT AND UPDATE YOUR THEME
- added 2 new "story listings" to administrator interface of
story.module to verify story integrity.
- optimized comment table a bit (work in progress)
Diffstat (limited to 'modules/structure.module')
-rw-r--r-- | modules/structure.module | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/modules/structure.module b/modules/structure.module index 7404e6b8a..db4e13ea2 100644 --- a/modules/structure.module +++ b/modules/structure.module @@ -3,7 +3,7 @@ $module = array("admin" => "structure_admin"); $cstatus = array("disabled", "enabled: incl. anonymous", "enabled: excl. anonymous"); -$mstatus = array("post new submissions", "queue new submissions"); +$mstatus = array("post new submissions", "moderate new submissions"); include "includes/structure.inc"; @@ -73,9 +73,9 @@ function category_overview() { $result = db_query("SELECT * FROM category ORDER BY name"); $output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n"; - $output .= " <TR><TH>name</TH><TH>type</TH><TH>comments</TH><TH>submissions</TH><TH>thresholds</TH><TH>operations</TH></TR>\n"; + $output .= " <TR><TH>name</TH><TH>type</TH><TH>comments</TH><TH>submissions</TH><TH>operations</TH></TR>\n"; while ($category = db_fetch_object($result)) { - $output .= " <TR><TD>". check_output($category->name) ."</TD><TD>". check_output($category->type) ."</TD><TD>". check_output($cstatus[$category->comment]) ."</TD><TD>". check_output($mstatus[$category->submission]) ."</TD><TD>post: $category->post, dump: $category->dump, expire: $category->expire</TD><TD><A HREF=\"admin.php?mod=structure&type=category&op=edit&id=$category->cid\">edit category</A></TD></TR>\n"; + $output .= " <TR><TD>". check_output($category->name) ."</TD><TD>". check_output($category->type) ."</TD><TD>". check_output($cstatus[$category->comment]) ."</TD><TD>". check_output($mstatus[$category->submission]) ."". ($category->submission ? "<BR><SMALL>post: $category->post, dump: $category->dump, expire: $category->expire</SMALL>" : "") ."</TD><TD><A HREF=\"admin.php?mod=structure&type=category&op=edit&id=$category->cid\">edit category</A></TD></TR>\n"; } $output .= "</TABLE>\n"; return $output; @@ -88,7 +88,7 @@ function topic_form($edit = array()) { $output .= "<FORM ACTION=\"admin.php?mod=structure&type=topic\" METHOD=\"post\">\n"; $output .= "<B>Name:</B><BR>\n"; - $output .= "<INPUT NAME=\"edit[name]\" SIZE=\"55\" VALUE=\"". check_textfield($edit[name]) ."\"><P>\n"; + $output .= "<INPUT NAME=\"edit[name]\" SIZE=\"55\" VALUE=\"". check_textfield($edit[name]) ."\"><BR>\n"; $output .= "<SMALL><I>A unique name for this topic like 'science', 'internet', 'culture', etc.</I></SMALL><P>\n"; $output .= "<B>Parent:</B><BR>\n"; @@ -112,9 +112,9 @@ function topic_overview() { $tree = topic_tree(); $output .= "<TABLE BORDER=\"1\" CELLPADDING=\"2\" CELLSPACING=\"2\">\n"; - $output .= " <TR><TH>name</TH><TH>operations</TH></TR>\n"; + $output .= " <TR><TH>name</TH><TH>read access</TH><TH>write access</TH><TH>operations</TH></TR>\n"; foreach ($tree as $id=>$name) { - $output .= " <TR><TD>". check_output($name) ."</TD><TD><A HREF=\"admin.php?mod=structure&type=topic&op=edit&id=$id\">edit topic</A></TD></TR>\n"; + $output .= " <TR><TD>". check_output($name) ."</TD><TD ALIGN=\"center\">all</TD><TD ALIGN=\"center\">all</TD><TD><A HREF=\"admin.php?mod=structure&type=topic&op=edit&id=$id\">edit topic</A></TD></TR>\n"; } $output .= "</TABLE>\n"; return $output; @@ -133,7 +133,7 @@ function structure_overview() { function structure_admin() { global $id, $op, $type, $edit; - print "<SMALL><A HREF=\"admin.php?mod=structure&type=category&op=add\">add new category</A> | <A HREF=\"admin.php?mod=structure&type=topic&op=add\">add new topic</A> | <A HREF=\"admin.php?mod=structure&type=category\">categories</A> | <A HREF=\"admin.php?mod=structure&type=topic\">topics</A> | <A HREF=\"admin.php?mod=structure\">overview</A></SMALL><HR>\n"; + print "<SMALL><A HREF=\"admin.php?mod=structure&type=category&op=add\">add new category</A> | <A HREF=\"admin.php?mod=structure&type=topic&op=add\">add new topic</A> | <A HREF=\"admin.php?mod=structure\">overview</A></SMALL><HR>\n"; switch ($type) { case "category": @@ -149,14 +149,14 @@ function structure_admin() { break; case "Delete category": print status(category_del($edit[cid])); - print category_overview(); + print structure_overview(); break; case "Save category": print status(category_save($edit)); - print category_overview(); + print structure_overview(); break; default: - print category_overview(); + print structure_overview(); } break; case "topic": @@ -172,14 +172,14 @@ function structure_admin() { break; case "Delete topic": print status(topic_del($edit[tid])); - print topic_overview(); + print structure_overview(); break; case "Save topic": print status(topic_save($edit)); - print topic_overview(); + print structure_overview(); break; default: - print topic_overview(); + print structure_overview(); } break; default: |