diff options
author | Dries Buytaert <dries@buytaert.net> | 2002-12-29 12:03:08 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2002-12-29 12:03:08 +0000 |
commit | 14158fbc6b511965f0b2031d11c01b4bc0411c14 (patch) | |
tree | 7685c533c2253a9db00512fbdaecbc4391128655 /modules/node.module | |
parent | be431bd983e531417fccc7d162d447543cd9c3f7 (diff) | |
download | brdo-14158fbc6b511965f0b2031d11c01b4bc0411c14.tar.gz brdo-14158fbc6b511965f0b2031d11c01b4bc0411c14.tar.bz2 |
- Added table rendering functions. As an example, I changed the node module
to take advantage of it.
Diffstat (limited to 'modules/node.module')
-rw-r--r-- | modules/node.module | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/node.module b/modules/node.module index c1a82d46e..9b234fc78 100644 --- a/modules/node.module +++ b/modules/node.module @@ -493,15 +493,14 @@ function node_admin_nodes() { $result = pager_query("SELECT n.*, u.name, u.uid FROM node n LEFT JOIN users u ON n.uid = u.uid ". $queries[$query ? $query : 0], 50); - $output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n"; - $output .= " <tr><th>". t("title") ."</th><th>". t("type") ."</th><th>". t("author") ."</th><th>". t("status") ."</th><th colspan=\"2\">". t("operations") ."</th></tr>\n"; + $header = array(t("title"), t("type"), t("author"), t("status"), array("data" => t("operations"), "colspan" => 2)); + while ($node = db_fetch_object($result)) { - $output .= "<tr><td>". l(check_output($node->title), array("id" => $node->nid)) ."</td><td>". module_invoke($node->type, "node", "name") ."</td><td nowrap=\"nowrap\">". format_name($node) ."</td><td>". ($node->status ? t("published") : t("not published")) ."</td><td nowrap=\"nowrap\">". la(t("edit node"), array("mod" => "node", "op" => "edit", "id" => $node->nid)) ."</td><td nowrap=\"nowrap\">". la(t("delete node"), array("mod" => "node", "op" => "delete", "id" => $node->nid)) ."</td></tr>"; + $rows[] = array(l(check_output($node->title), array("id" => $node->nid)), module_invoke($node->type, "node", "name"), format_name($node), ($node->status ? t("published") : t("not published")), la(t("edit node"), array("mod" => "node", "op" => "edit", "id" => $node->nid)), la(t("delete node"), array("mod" => "node", "op" => "delete", "id" => $node->nid))); } - $output .= "<tr><td colspan=\"6\">". pager_display(NULL, 50, 0, "admin") ."</td></tr></table>"; - +// $output .= "<tr><td colspan=\"6\">". pager_display(NULL, 50, 0, "admin") ."</td></tr></table>"; - return $output; + return table($header, $rows); } /* |