From 0f567be0ed1de29ecf213a19c96ebdc6611d196b Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Tue, 10 Apr 2001 20:07:27 +0000 Subject: - improved administrator interface of account, node, story and book by (1) adding a few extra features to "easify" navigation and (b) to start using "status messages" as once suggested on the mailing list by Jeroen --- modules/story.module | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'modules/story.module') diff --git a/modules/story.module b/modules/story.module index 1ab6f6da5..0a90490b6 100644 --- a/modules/story.module +++ b/modules/story.module @@ -199,14 +199,30 @@ function story_block() { */ } -function story_overview() { - return node_overview("type = 'story'"); +function story_query($type = "") { + global $status; + $queries = array(0 => array("active stories", "WHERE n.type = 'story' ORDER BY n.timestamp DESC"), 1 => array("posted stories", "WHERE n.type = 'story' AND n.status = '$status[posted]' ORDER BY n.timestamp DESC"), 2 => array("queued stories", "WHERE n.type = 'story' AND n.status = '$status[queued]' ORDER BY n.timestamp DESC"), 3 => array("dumped stories", "WHERE n.type = 'story' AND n.status = '$status[dumped]' ORDER BY n.timestamp DESC")); + return ($queries[$type] ? $queries[$type] : $queries); +} + +function story_listing() { + foreach (story_query() as $key=>$array) { + $output .= "
  • $array[0]
  • \n"; + } + return "
      $output
    \n"; +} + + +function story_overview($query = array()) { + return node_overview($query); } function story_admin() { - global $id, $edit, $mod, $keys, $op, $theme, $user; + global $id, $edit, $mod, $keys, $op, $theme, $type, $user; + + print "add new story | story listing | search story | overview | help
    \n"; - print "add new story | overview | search story | help
    \n"; + $type = ($type ? $type : 0); switch ($op) { case "add": @@ -214,7 +230,7 @@ function story_admin() { break; case "delete": print story_delete($id); - print story_overview(); + print story_overview(story_query($type)); break; case "edit": print story_form(node_get_array("nid", check_input($id))); @@ -222,6 +238,9 @@ function story_admin() { case "help": story_help(); break; + case "listing": + print story_listing(); + break; case "search": print search_form($keys); print search_data($keys, $mod); @@ -232,10 +251,9 @@ function story_admin() { break; case t("Submit"): story_save($edit); - print story_overview(); - break; + // fall through: default: - print story_overview(); + print story_overview(story_query($type)); } } -- cgit v1.2.3