summaryrefslogtreecommitdiff
path: root/modules/node.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-11-07 18:14:46 +0000
committerDries Buytaert <dries@buytaert.net>2001-11-07 18:14:46 +0000
commit234b40b25321e6ddde6815f8fff6dc33fd3317bc (patch)
tree5bde9e359979247fb2008e27f09de48f1b9a9e4e /modules/node.module
parent74a1fe5718ff4cec0f04c32a8cb0cd356aa8d6d7 (diff)
downloadbrdo-234b40b25321e6ddde6815f8fff6dc33fd3317bc.tar.gz
brdo-234b40b25321e6ddde6815f8fff6dc33fd3317bc.tar.bz2
- node system:
+ Added the "delete node"-link: apparently it got lost during the last commit. Odd. + Changed "Edit node" to "Edit <node_name>" on the 'edit node'-page of the admin section. (There a 4 "Node"s that still need to be removed though.) + Updated the initial submission page (the old submit.php) to include some descriptions.
Diffstat (limited to 'modules/node.module')
-rw-r--r--modules/node.module22
1 files changed, 15 insertions, 7 deletions
diff --git a/modules/node.module b/modules/node.module
index 2c1b6d3b1..aa9fdb942 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -67,7 +67,7 @@ function node_conf_options() {
function node_conf_filters() {
$output .= form_select(t("Enable HTML tags"), "filter_html", variable_get("filter_html", 0), array("Disabled", "Enabled"), t("Allow HTML and PHP tags in user-contributed content."));
- $output .= form_textfield(t("Allowed HTML tags"), "allowed_html", variable_get("allowed_html", "<A><B><BLOCKQUOTE><DD><DL><DT><I><LI><OL><U><UL>"), 64, 128, t("If enabled, optionally specify tags which should not be stripped. 'STYLE' attributes, 'ON' attributes and unclosed tags are always stripped."));
+ $output .= form_textfield(t("Allowed HTML tags"), "allowed_html", variable_get("allowed_html", "<a><b><blockquote><dd><dl><dt><i><li><ol><u><ul>"), 64, 128, t("If enabled, optionally specify tags which should not be stripped. 'STYLE' attributes, 'ON' attributes and unclosed tags are always stripped."));
$output .= "<hr />";
$output .= form_select(t("Enable link tags"), "filter_link", variable_get("filter_link", 0), array("Disabled", "Enabled"), t("Substitute special [[nodesubject|text]] tags. Your browser will display 'text', and when you click on it your browser will open the node with the subject 'nodesubject'. Please be aware that you'll need to copy the subject of the target node exactly in order to use this feature."));
$output .= "<hr />";
@@ -153,7 +153,7 @@ function node_admin_settings($edit = array()) {
foreach (module_list() as $name) {
if (module_hook($name, "conf_options") && module_hook($name, "node")) {
- $output .= "<h3>". t(ucfirst(module_invoke($name, "node", "name")) ." settings") ."</h3>";
+ $output .= "<h3>". ucfirst(module_invoke($name, "node", "name") ." settings") ."</h3>";
$output .= module_invoke($name, "conf_options");
}
}
@@ -174,7 +174,7 @@ function node_admin_edit($node) {
** Edit node:
*/
- $output .= "<h3>". t("Edit node") ."</h3>";
+ $output .= "<h3>". t("Edit") ." ". module_invoke($node->type, "node", "name") ."</h3>";
$output .= node_form($node);
@@ -227,7 +227,7 @@ function node_admin_nodes() {
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><th>title</th><th>type</th><th>author</th><th>status</th><th colspan=\"2\">operations</th></tr>\n";
while ($node = db_fetch_object($result)) {
- $output .= "<tr><td><a href=\"node.php?id=$node->nid\">". check_output($node->title) ."</a></td><td>$node->type</td><td nowrap=\"nowrap\">". format_name($node) ."</td><td>". ($node->status ? t("published") : t("not published")) ."</td><td nowrap=\"nowrap\"><a href=\"node.php?id=$node->nid\">view node</a></td><td nowrap=\"nowrap\"><a href=\"admin.php?mod=node&op=edit&id=$node->nid\">edit node</a></td></tr>";
+ $output .= "<tr><td><a href=\"node.php?id=$node->nid\">". check_output($node->title) ."</a></td><td>$node->type</td><td nowrap=\"nowrap\">". format_name($node) ."</td><td>". ($node->status ? t("published") : t("not published")) ."</td><td nowrap=\"nowrap\"><a href=\"admin.php?mod=node&op=edit&id=$node->nid\">". t("edit node") ."</a></td><td nowrap=\"nowrap\"><a href=\"admin.php?mod=node&op=delete&id=$node->nid\">". t("delete node") ."</a></td></tr>";
}
$output .= "</table>";
@@ -365,6 +365,9 @@ function node_admin() {
case "edit":
print node_admin_edit($id);
break;
+ case "delete":
+ print node_delete(array("nid" => $id));
+ break;
case "rollback revision":
print node_revision_rollback(node_load(array("nid" => $id)), $revision);
print node_admin_edit($id);
@@ -613,13 +616,18 @@ function node_add($type) {
else {
$links = array();
+
foreach (module_list() as $name) {
- if (($info = module_invoke($name, "node", "name")) && node_access("create", array("type" => $name))) {
- $links[] = "<a href=\"module.php?mod=node&op=add&type=$name\">". t($info) ."</a>";
+ if (module_hook($name, "node") && node_access("create", array("type" => $name))) {
+ $output .= "<li>";
+ $output .= " <a href=\"module.php?mod=node&op=add&type=$name\">". module_invoke($name, "node", "name") ."</a>";
+ $output .= " <div style=\"margin-left: 20px;\">". module_invoke($name, "node", "description") ."</div>";
+ $output .= "</li>";
}
}
- $output .= sprintf(t("Submit a %s."), implode(", ", $links));
+ $output = t("Choose the appropriate item from the list:") ."<ul>$output</ul>";
+
}
return $output;