From d397bbe93587f015cd8db0dbf16ef6d1c1aef78b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sun, 10 Jun 2001 15:01:20 +0000 Subject: This a rather large commit that needs a lot of fine-tuning. If you update, you'll break your site as you need switching from structure to index.module: so this can be considered an intermediate commit. If you upgrade, and you are welcome to, just create a collection called "section" (for now) and assign your nodes some attributes in the described format. Feedback and bugreports are welcomed. Questions will be answered. CHANGES: - comment system: + when replying to a node (rather then to a comment), that node is displayed above the reply form. + when replying to a comment (rather then to a node), that comment is displayd above the reply form. - removed structure.inc, removed structure.module. - node.inc: + added 2 new node functions called 'node_attribute_edit()' and 'node_attribute_save()' used to 'hook in' any indexing system including your home-brewed stuff if you'd want to. Currently, index.module is the facto default index system. See story.module for usage. - book.module, story.module, poll.module, page.module, forum.module: + added preview functionality to administration section (via node module). + removed all references to structure.inc (category, topic). - moderate.module: + removed all references to structure.inc (category, topic). - book.module, story.module, page.module, forum.module: + increased the sizes of some textareas. - submit.php: + removed all references to structure.inc (category, topic). - marvin.theme: + removed dead code: function story() was depricated. - unconed.theme: + removed hardcoded references to drop.org. - marvin.theme, unconed.theme, jeroen.theme, yaroon.theme, example.theme: + removed all references to structure.inc (category, topic). TODO: - file.module, trip_link.module: + update preview functionality: see story.module for example. + remove references to 'cid' and 'tid', use 'attribute' instead: see story.module for example. - extend and build upon index.module as well as making it configurable --- modules/structure.module | 157 ----------------------------------------------- 1 file changed, 157 deletions(-) delete mode 100644 modules/structure.module (limited to 'modules/structure.module') diff --git a/modules/structure.module b/modules/structure.module deleted file mode 100644 index 823da5254..000000000 --- a/modules/structure.module +++ /dev/null @@ -1,157 +0,0 @@ - 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15, 20 => 20, 25 => 25, 30 => 30, 35 => 35, 40 => 40, 45 => 45, 50 => 50, 60 => 60, 70 => 70, 80 => 80, 90 => 90, 100 => 100); - $threshold_dump = array(-1 => -1, -2 => -2, -3 => -3, -4 => -4, -5 => -5, -6 => -6, -7 => -7, -8 => -8, -9 => -9, -10 => -10, -11 => -11, -12 => -12, -13 => -13, -14 => -14, -15 => -15, -20 => -20, -25 => -25, -30 => -30); - $threshold_expire = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15, 20 => 20, 25 => 25, 30 => 30, 35 => 35, 40 => 40, 45 => 45, 50 => 50, 60 => 60, 70 => 70, 80 => 80, 90 => 90, 100 => 100); - - module_iterate("content_types"); - - $form .= form_textfield(t("Name"), "name", $edit[name], 30, 55, t("A unique name for this category like 'announcement', 'article', 'column', 'review', etc.")); - $form .= form_select(t("Content type"), "type", $edit[type], $types, t("The content type to bind or associate this category with.")); - $form .= form_select(t("Comment"), "comment", $edit[comment], node_comment_status(), t("By default, allow or dissallow users to post comments in this category.")); - $form .= form_select(t("Promote"), "promote", $edit[promote], node_promote_status(), t("By default, promote new submissions in this category to the front page.")); - - $form .= form_select(t("Submission"), "submission", $edit[submission], node_submission_status(), t("What to do with new submissions in this category?")); - $form .= form_select(t("Post threshold"), "post", $edit[post], $threshold_post, t("If new submissions are subject to moderation, select a post threshold.")); - $form .= form_select(t("Dump threshold"), "dump", $edit[dump], $threshold_dump, t("If new submissions are subject to moderation, select a dump threshold.")); - $form .= form_select(t("Expiration threshold"), "expire", $edit[expire], $threshold_expire, t("If new submissions are subject to moderation, select a expiration threshold.")); - - if ($edit[cid]) { - $form .= form_hidden("cid", $edit[cid]); - $form .= form_submit(t("Save category")); - $form .= form_submit(t("Delete category")); - } - else { - $form .= form_submit(t("Save category")); - } - - return form("admin.php?mod=structure&type=category", $form); -} - -function category_overview() { - $result = db_query("SELECT * FROM category ORDER BY name"); - - $output .= "\n"; - $output .= " \n"; - while ($category = db_fetch_object($result)) { - $output .= " \n"; - } - $output .= "
nametypecommentpromotesubmissionsoperations
". check_output($category->name) ."". check_output($category->type) ."". node_comment_status($category->comment) ."". node_promote_status($category->promote) ."". node_submission_status($category->submission) ."". ($category->submission ? "
post: $category->post, dump: $category->dump, expire: $category->expire" : "") ."
cid\">edit category
\n"; - return $output; -} - -// ---- topic ---- - -function topic_form($edit = array()) { - - $result = db_query("SELECT * FROM topic WHERE name != '$edit[name]' ORDER BY name DESC"); - while ($topic = db_fetch_object($result)) { - $topics[$topic->tid] = $topic->name; - } - $topics[0] = " "; - - $form .= form_textfield(t("Name"), "name", $edit[name], 30, 55, t("A unique name for this topic like 'science', 'internet', 'culture', etc.")); - $form .= form_select(t("Parent"), "pid", $edit[pid], $topics, t("The parent topic this topic belongs in.")); - $form .= form_textfield("Moderate", "moderate", $edit[moderate], 35, 255, t("Provide a comma-seperated list of the moderators' usernames.")); - - if ($edit[tid]) { - $form .= form_hidden("tid", $edit[tid]); - $form .= form_submit(t("Save topic")); - $form .= form_submit(t("Delete topic")); - } - else { - $form .= form_submit(t("Save topic")); - } - - return form("admin.php?mod=structure&type=topic", $form); -} - -function topic_overview() { - $tree = topic_tree(); - - $output .= "\n"; - $output .= " \n"; - foreach ($tree as $id=>$name) { - $topic = topic_get_object("tid", $id); - $output .= " \n"; - } - $output .= "
namemoderatorsoperations
". check_output($name) ."". check_output($topic->moderate) ."tid\">edit topic
\n"; - return $output; -} - -// ----- structure ----- - -function structure_overview() { - $output .= "

Categories

\n"; - $output .= category_overview(); - $output .= "

Topics

\n"; - $output .= topic_overview(); - return $output; -} - -function structure_admin() { - global $id, $op, $type, $edit; - - print "add new category | add new topic | overview
\n"; - - switch ($type) { - case "category": - switch ($op) { - case "add": - print category_form(); - break; - case "edit": - print category_form(category_get_array("cid", $id)); - break; - case "view": - print category_view($id); - break; - case "Delete category": - print status(category_del($edit[cid])); - print structure_overview(); - break; - case "Save category": - print status(category_save($edit)); - print structure_overview(); - break; - default: - print structure_overview(); - } - break; - case "topic": - switch ($op) { - case "add": - print topic_form(); - break; - case "edit": - print topic_form(topic_get_array("tid", $id)); - break; - case "view": - print topic_view($id); - break; - case "Delete topic": - print status(topic_del($edit[tid])); - print structure_overview(); - break; - case "Save topic": - print status(topic_save($edit)); - print structure_overview(); - break; - default: - print structure_overview(); - } - break; - default: - print structure_overview(); - } -} - -?> \ No newline at end of file -- cgit v1.2.3