summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2001-09-28 16:20:55 +0000
committerDries Buytaert <dries@buytaert.net>2001-09-28 16:20:55 +0000
commit0cce47f15f21f59ec77de41c76cf13eb2b2f4f74 (patch)
tree73dacf3105fb598058714ccad769e3b86b8b558f /modules
parent17c921259f61daac6cc0d10ea145d6882ea89514 (diff)
downloadbrdo-0cce47f15f21f59ec77de41c76cf13eb2b2f4f74.tar.gz
brdo-0cce47f15f21f59ec77de41c76cf13eb2b2f4f74.tar.bz2
- fixed small glitch in node_del()
- fixed small glitch in comment_del() - changed the API of the form() function. The first parameter, the "action"-attribute in the <form>-tag has been made optional. By default, it will be set to "$REQUEST_URI". Why? Because in 98% of the cases we would do: global $REQUEST_URI; $form = form($REQUEST_URI, $form_content); while we can do: $form = form($form_content); now. Update your modules (and sorry for the inconvenience)!
Diffstat (limited to 'modules')
-rw-r--r--modules/aggregator.module20
-rw-r--r--modules/aggregator/aggregator.module20
-rw-r--r--modules/blog.module4
-rw-r--r--modules/blog/blog.module4
-rw-r--r--modules/book.module4
-rw-r--r--modules/book/book.module4
-rw-r--r--modules/box.module3
-rw-r--r--modules/cloud.module3
-rw-r--r--modules/comment.module4
-rw-r--r--modules/comment/comment.module4
-rw-r--r--modules/forum.module3
-rw-r--r--modules/forum/forum.module3
-rw-r--r--modules/import.module20
-rw-r--r--modules/locale.module8
-rw-r--r--modules/locale/locale.module8
-rw-r--r--modules/meta.module8
-rw-r--r--modules/node.module18
-rw-r--r--modules/node/node.module18
-rw-r--r--modules/page.module4
-rw-r--r--modules/page/page.module4
-rw-r--r--modules/poll.module8
-rw-r--r--modules/poll/poll.module8
-rw-r--r--modules/search.module5
-rw-r--r--modules/search/search.module5
-rw-r--r--modules/story.module4
-rw-r--r--modules/story/story.module4
-rw-r--r--modules/system.module3
-rw-r--r--modules/system/system.module3
-rw-r--r--modules/user.module48
-rw-r--r--modules/user/user.module48
30 files changed, 120 insertions, 180 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module
index 55f321f9e..d3d1af4ce 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -232,7 +232,6 @@ function import_save_item($edit) {
}
function import_form_bundle($edit = array()) {
- global $REQUEST_URI;
$form .= form_textfield("Title", "title", $edit[title], 50, 64, "The name of the bundle.");
$form .= form_textfield("Attributes", "attributes", $edit[attributes], 50, 128, "A comma-seperated list of keywords describing the bundle.");
@@ -244,7 +243,7 @@ function import_form_bundle($edit = array()) {
$form .= form_hidden("bid", $edit[bid]);
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function import_save_bundle($edit) {
@@ -262,7 +261,6 @@ function import_save_bundle($edit) {
}
function import_form_feed($edit = array()) {
- global $REQUEST_URI;
$period = array(900 => format_interval(900), 1800 => format_interval(1800), 3600 => format_interval(3600), 7200 => format_interval(7200), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 64800 => format_interval(64800), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200));
@@ -282,7 +280,7 @@ function import_form_feed($edit = array()) {
$form .= form_hidden("fid", $edit[fid]);
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function import_save_feed($edit) {
@@ -339,16 +337,14 @@ function import_view() {
}
function import_fd_form() {
- global $REQUEST_URI;
$form .= form_textfield("Feed directory file", "url", "http://", 64, 128, "The fully-qualified URL of the feed directory file.");
$form .= form_submit("Collect feeds");
- return form($REQUEST_URI, $form);
+ return form($form);
}
function import_fd_collect($edit) {
- global $REQUEST_URI;
set_time_limit(180);
@@ -365,8 +361,6 @@ function import_fd_collect($edit) {
$items = explode("</channel>", $data);
- $output .= "<form action=\"$REQUEST_URI\" method=\"POST\">\n";
-
foreach ($items as $item) {
unset ($link, $title);
@@ -385,9 +379,8 @@ function import_fd_collect($edit) {
}
$output .= "<input type=\"submit\" name=\"op\" value=\"Import feeds\" />\n";
- $output .= "</form>";
- return $output;
+ return form($output);
}
else {
print status("failed to open '$edit[url]': $errstr.");
@@ -403,11 +396,9 @@ function import_fd_import($edit) {
}
function import_tag() {
- global $REQUEST_URI;
$result = db_query("SELECT i.*, f.title AS feed FROM item i LEFT JOIN feed f ON i.fid = f.fid ORDER BY i.iid DESC LIMIT 50");
- $output .= "<form action=\"$REQUEST_URI\" method=\"post\">\n";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><th>time</th><th>feed</th><th>item</th></tr>\n";
while ($item = db_fetch_object($result)) {
@@ -415,9 +406,8 @@ function import_tag() {
}
$output .= "</table>\n";
$output .= "<input type=\"submit\" name=\"op\" value=\"Save attributes\" />\n";
- $output .= "</form>\n";
- return $output;
+ return form($output);
}
function import_admin() {
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 55f321f9e..d3d1af4ce 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -232,7 +232,6 @@ function import_save_item($edit) {
}
function import_form_bundle($edit = array()) {
- global $REQUEST_URI;
$form .= form_textfield("Title", "title", $edit[title], 50, 64, "The name of the bundle.");
$form .= form_textfield("Attributes", "attributes", $edit[attributes], 50, 128, "A comma-seperated list of keywords describing the bundle.");
@@ -244,7 +243,7 @@ function import_form_bundle($edit = array()) {
$form .= form_hidden("bid", $edit[bid]);
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function import_save_bundle($edit) {
@@ -262,7 +261,6 @@ function import_save_bundle($edit) {
}
function import_form_feed($edit = array()) {
- global $REQUEST_URI;
$period = array(900 => format_interval(900), 1800 => format_interval(1800), 3600 => format_interval(3600), 7200 => format_interval(7200), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 64800 => format_interval(64800), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200));
@@ -282,7 +280,7 @@ function import_form_feed($edit = array()) {
$form .= form_hidden("fid", $edit[fid]);
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function import_save_feed($edit) {
@@ -339,16 +337,14 @@ function import_view() {
}
function import_fd_form() {
- global $REQUEST_URI;
$form .= form_textfield("Feed directory file", "url", "http://", 64, 128, "The fully-qualified URL of the feed directory file.");
$form .= form_submit("Collect feeds");
- return form($REQUEST_URI, $form);
+ return form($form);
}
function import_fd_collect($edit) {
- global $REQUEST_URI;
set_time_limit(180);
@@ -365,8 +361,6 @@ function import_fd_collect($edit) {
$items = explode("</channel>", $data);
- $output .= "<form action=\"$REQUEST_URI\" method=\"POST\">\n";
-
foreach ($items as $item) {
unset ($link, $title);
@@ -385,9 +379,8 @@ function import_fd_collect($edit) {
}
$output .= "<input type=\"submit\" name=\"op\" value=\"Import feeds\" />\n";
- $output .= "</form>";
- return $output;
+ return form($output);
}
else {
print status("failed to open '$edit[url]': $errstr.");
@@ -403,11 +396,9 @@ function import_fd_import($edit) {
}
function import_tag() {
- global $REQUEST_URI;
$result = db_query("SELECT i.*, f.title AS feed FROM item i LEFT JOIN feed f ON i.fid = f.fid ORDER BY i.iid DESC LIMIT 50");
- $output .= "<form action=\"$REQUEST_URI\" method=\"post\">\n";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><th>time</th><th>feed</th><th>item</th></tr>\n";
while ($item = db_fetch_object($result)) {
@@ -415,9 +406,8 @@ function import_tag() {
}
$output .= "</table>\n";
$output .= "<input type=\"submit\" name=\"op\" value=\"Save attributes\" />\n";
- $output .= "</form>\n";
- return $output;
+ return form($output);
}
function import_admin() {
diff --git a/modules/blog.module b/modules/blog.module
index b95088c57..58c5d9e03 100644
--- a/modules/blog.module
+++ b/modules/blog.module
@@ -187,7 +187,7 @@ function blog_view($node, $main = 0) {
}
function blog_form($edit = array()) {
- global $REQUEST_URI, $id, $mod, $type, $user, $theme;
+ global $id, $mod, $type, $user, $theme;
if ($user->uid && (user_access("administer blogs") || user_access("post blogs"))) {
if ($mod == "node" || $edit[type] == "blog") {
@@ -233,7 +233,7 @@ function blog_form($edit = array()) {
$form .= form_submit(t("Submit"));
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
else {
return message_access();
diff --git a/modules/blog/blog.module b/modules/blog/blog.module
index b95088c57..58c5d9e03 100644
--- a/modules/blog/blog.module
+++ b/modules/blog/blog.module
@@ -187,7 +187,7 @@ function blog_view($node, $main = 0) {
}
function blog_form($edit = array()) {
- global $REQUEST_URI, $id, $mod, $type, $user, $theme;
+ global $id, $mod, $type, $user, $theme;
if ($user->uid && (user_access("administer blogs") || user_access("post blogs"))) {
if ($mod == "node" || $edit[type] == "blog") {
@@ -233,7 +233,7 @@ function blog_form($edit = array()) {
$form .= form_submit(t("Submit"));
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
else {
return message_access();
diff --git a/modules/book.module b/modules/book.module
index bbfde7677..f1a174ffd 100644
--- a/modules/book.module
+++ b/modules/book.module
@@ -122,7 +122,7 @@ function book_toc($parent = "", $indent = "", $toc = array()) {
}
function book_form($edit = array()) {
- global $REQUEST_URI, $user;
+ global $user;
if ($edit[title]) {
$form .= book_view(new Book(node_preview($edit)));
@@ -161,7 +161,7 @@ function book_form($edit = array()) {
$form .= form_submit(t("Submit"));
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function book_save($edit) {
diff --git a/modules/book/book.module b/modules/book/book.module
index bbfde7677..f1a174ffd 100644
--- a/modules/book/book.module
+++ b/modules/book/book.module
@@ -122,7 +122,7 @@ function book_toc($parent = "", $indent = "", $toc = array()) {
}
function book_form($edit = array()) {
- global $REQUEST_URI, $user;
+ global $user;
if ($edit[title]) {
$form .= book_view(new Book(node_preview($edit)));
@@ -161,7 +161,7 @@ function book_form($edit = array()) {
$form .= form_submit(t("Submit"));
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function book_save($edit) {
diff --git a/modules/box.module b/modules/box.module
index 8c0ba63a5..283a56c8a 100644
--- a/modules/box.module
+++ b/modules/box.module
@@ -85,7 +85,6 @@ function box_save($edit) {
}
function box_form($edit = array()) {
- global $REQUEST_URI;
$type = array(0 => "ASCII", 1 => "HTML", 2 => "PHP");
@@ -101,7 +100,7 @@ function box_form($edit = array()) {
$form .= form_submit("Submit");
- return form($REQUEST_URI, $form);
+ return form($form);
}
diff --git a/modules/cloud.module b/modules/cloud.module
index 381319e1a..511087a32 100644
--- a/modules/cloud.module
+++ b/modules/cloud.module
@@ -68,7 +68,6 @@ function cloud_update($site) {
function cloud_form($edit = array()) {
- global $REQUEST_URI;
$form .= form_textfield("Site name", "name", $edit["name"], 50, 128, "The name of the website you want to monitor for updates.");
$form .= form_textfield("Site URL", "link", $edit["link"], 50, 255, "The URL of the website you want to monitor for updates.");
@@ -81,7 +80,7 @@ function cloud_form($edit = array()) {
$form .= form_hidden("sid", $edit["sid"]);
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function cloud_get_site($sid) {
diff --git a/modules/comment.module b/modules/comment.module
index d420e5b69..d436009ae 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -22,7 +22,6 @@ function comment_link($type) {
}
function comment_edit($id) {
- global $REQUEST_URI;
$result = db_query("SELECT c.*, u.name, u.uid FROM comments c LEFT JOIN user u ON c.author = u.uid WHERE c.cid = '$id'");
$comment = db_fetch_object($result);
@@ -32,7 +31,7 @@ function comment_edit($id) {
$form .= form_textarea(t("Comment"), "comment", $comment->comment, 50, 10);
$form .= form_submit(t("Submit"));
- return form($REQUEST_URI, $form);
+ return form($form);
}
function comment_save($id, $edit) {
@@ -55,6 +54,7 @@ function comment_overview() {
function comment_delete($id) {
db_query("DELETE FROM comments WHERE cid = '$id'");
+ db_query("DELETE FROM moderate WHERE cid = '$id'");
watchdog("special", "comment: deleted '$id'");
}
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index d420e5b69..d436009ae 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -22,7 +22,6 @@ function comment_link($type) {
}
function comment_edit($id) {
- global $REQUEST_URI;
$result = db_query("SELECT c.*, u.name, u.uid FROM comments c LEFT JOIN user u ON c.author = u.uid WHERE c.cid = '$id'");
$comment = db_fetch_object($result);
@@ -32,7 +31,7 @@ function comment_edit($id) {
$form .= form_textarea(t("Comment"), "comment", $comment->comment, 50, 10);
$form .= form_submit(t("Submit"));
- return form($REQUEST_URI, $form);
+ return form($form);
}
function comment_save($id, $edit) {
@@ -55,6 +54,7 @@ function comment_overview() {
function comment_delete($id) {
db_query("DELETE FROM comments WHERE cid = '$id'");
+ db_query("DELETE FROM moderate WHERE cid = '$id'");
watchdog("special", "comment: deleted '$id'");
}
diff --git a/modules/forum.module b/modules/forum.module
index f369b9344..984832c9f 100644
--- a/modules/forum.module
+++ b/modules/forum.module
@@ -19,14 +19,13 @@ function forum_view($node) {
}
function forum_form($edit = array()) {
- global $REQUEST_URI;
$form .= form_textfield("Subject", "title", $edit[title], 50, 64);
$form .= form_textarea("Body", "body", $edit[body], 70, 10);
$form .= form_hidden("nid", $edit[nid]);
$form .= form_submit(t("Submit"));
- return form($REQUEST_URI, $form);
+ return form($form);
}
function forum_save($edit) {
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index f369b9344..984832c9f 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -19,14 +19,13 @@ function forum_view($node) {
}
function forum_form($edit = array()) {
- global $REQUEST_URI;
$form .= form_textfield("Subject", "title", $edit[title], 50, 64);
$form .= form_textarea("Body", "body", $edit[body], 70, 10);
$form .= form_hidden("nid", $edit[nid]);
$form .= form_submit(t("Submit"));
- return form($REQUEST_URI, $form);
+ return form($form);
}
function forum_save($edit) {
diff --git a/modules/import.module b/modules/import.module
index 55f321f9e..d3d1af4ce 100644
--- a/modules/import.module
+++ b/modules/import.module
@@ -232,7 +232,6 @@ function import_save_item($edit) {
}
function import_form_bundle($edit = array()) {
- global $REQUEST_URI;
$form .= form_textfield("Title", "title", $edit[title], 50, 64, "The name of the bundle.");
$form .= form_textfield("Attributes", "attributes", $edit[attributes], 50, 128, "A comma-seperated list of keywords describing the bundle.");
@@ -244,7 +243,7 @@ function import_form_bundle($edit = array()) {
$form .= form_hidden("bid", $edit[bid]);
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function import_save_bundle($edit) {
@@ -262,7 +261,6 @@ function import_save_bundle($edit) {
}
function import_form_feed($edit = array()) {
- global $REQUEST_URI;
$period = array(900 => format_interval(900), 1800 => format_interval(1800), 3600 => format_interval(3600), 7200 => format_interval(7200), 10800 => format_interval(10800), 21600 => format_interval(21600), 32400 => format_interval(32400), 43200 => format_interval(43200), 64800 => format_interval(64800), 86400 => format_interval(86400), 172800 => format_interval(172800), 259200 => format_interval(259200), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200));
@@ -282,7 +280,7 @@ function import_form_feed($edit = array()) {
$form .= form_hidden("fid", $edit[fid]);
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function import_save_feed($edit) {
@@ -339,16 +337,14 @@ function import_view() {
}
function import_fd_form() {
- global $REQUEST_URI;
$form .= form_textfield("Feed directory file", "url", "http://", 64, 128, "The fully-qualified URL of the feed directory file.");
$form .= form_submit("Collect feeds");
- return form($REQUEST_URI, $form);
+ return form($form);
}
function import_fd_collect($edit) {
- global $REQUEST_URI;
set_time_limit(180);
@@ -365,8 +361,6 @@ function import_fd_collect($edit) {
$items = explode("</channel>", $data);
- $output .= "<form action=\"$REQUEST_URI\" method=\"POST\">\n";
-
foreach ($items as $item) {
unset ($link, $title);
@@ -385,9 +379,8 @@ function import_fd_collect($edit) {
}
$output .= "<input type=\"submit\" name=\"op\" value=\"Import feeds\" />\n";
- $output .= "</form>";
- return $output;
+ return form($output);
}
else {
print status("failed to open '$edit[url]': $errstr.");
@@ -403,11 +396,9 @@ function import_fd_import($edit) {
}
function import_tag() {
- global $REQUEST_URI;
$result = db_query("SELECT i.*, f.title AS feed FROM item i LEFT JOIN feed f ON i.fid = f.fid ORDER BY i.iid DESC LIMIT 50");
- $output .= "<form action=\"$REQUEST_URI\" method=\"post\">\n";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">\n";
$output .= " <tr><th>time</th><th>feed</th><th>item</th></tr>\n";
while ($item = db_fetch_object($result)) {
@@ -415,9 +406,8 @@ function import_tag() {
}
$output .= "</table>\n";
$output .= "<input type=\"submit\" name=\"op\" value=\"Save attributes\" />\n";
- $output .= "</form>\n";
- return $output;
+ return form($output);
}
function import_admin() {
diff --git a/modules/locale.module b/modules/locale.module
index 6999b200f..abfea68d4 100644
--- a/modules/locale.module
+++ b/modules/locale.module
@@ -61,7 +61,7 @@ function locale_save($id, $edit) {
}
function locale_edit($id) {
- global $languages, $REQUEST_URI;
+ global $languages;
$result = db_query("SELECT * FROM locales WHERE id = '$id'");
if ($translation = db_fetch_object($result)) {
$form .= form_item(t("Original text"), "<PRE>". wordwrap(check_output($translation->string)) ."</PRE>");
@@ -69,7 +69,7 @@ function locale_edit($id) {
$form .= form_hidden("id", $id);
$form .= form_submit("Save translations");
- return form($REQUEST_URI, $form);
+ return form($form);
}
}
@@ -138,7 +138,7 @@ function locale_untranslated($language) {
}
function locale_seek() {
- global $edit, $languages, $REQUEST_URI, $op, $locale_settings;
+ global $edit, $languages, $op, $locale_settings;
if ($edit[id] && session_is_registered("locale_settings")) {
$edit = $locale_settings;
@@ -184,7 +184,7 @@ function locale_seek() {
$form .= form_textfield("String", "string", $edit[string], 30, 30, "Leave blank to show all strings. This is treated as a regular expression.");
$form .= form_submit("Search");
- $output .= form($REQUEST_URI, $form);
+ $output .= form($form);
return $output;
}
diff --git a/modules/locale/locale.module b/modules/locale/locale.module
index 6999b200f..abfea68d4 100644
--- a/modules/locale/locale.module
+++ b/modules/locale/locale.module
@@ -61,7 +61,7 @@ function locale_save($id, $edit) {
}
function locale_edit($id) {
- global $languages, $REQUEST_URI;
+ global $languages;
$result = db_query("SELECT * FROM locales WHERE id = '$id'");
if ($translation = db_fetch_object($result)) {
$form .= form_item(t("Original text"), "<PRE>". wordwrap(check_output($translation->string)) ."</PRE>");
@@ -69,7 +69,7 @@ function locale_edit($id) {
$form .= form_hidden("id", $id);
$form .= form_submit("Save translations");
- return form($REQUEST_URI, $form);
+ return form($form);
}
}
@@ -138,7 +138,7 @@ function locale_untranslated($language) {
}
function locale_seek() {
- global $edit, $languages, $REQUEST_URI, $op, $locale_settings;
+ global $edit, $languages, $op, $locale_settings;
if ($edit[id] && session_is_registered("locale_settings")) {
$edit = $locale_settings;
@@ -184,7 +184,7 @@ function locale_seek() {
$form .= form_textfield("String", "string", $edit[string], 30, 30, "Leave blank to show all strings. This is treated as a regular expression.");
$form .= form_submit("Search");
- $output .= form($REQUEST_URI, $form);
+ $output .= form($form);
return $output;
}
diff --git a/modules/meta.module b/modules/meta.module
index c80c1e462..682069f9f 100644
--- a/modules/meta.module
+++ b/modules/meta.module
@@ -60,7 +60,6 @@ function meta_get_tag($tid) {
}
function meta_form_collection($edit = array()) {
- global $REQUEST_URI;
$form .= form_textfield("Collection name", "name", $edit[name], 50, 64, "Required. The name for this group or collection of meta-tags. Example: 'Software'.");
$form .= form_textfield("Types", "types", $edit[types], 50, 64, "Required. A comma-seperated list of node types you want to associate this collection with. Example: 'story, book'.");
@@ -71,11 +70,10 @@ function meta_form_collection($edit = array()) {
$form .= form_hidden("cid", $edit[cid]);
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function meta_form_tag($edit = array()) {
- global $REQUEST_URI;
$form .= form_textfield("Meta-tag name", "name", $edit[name], 50, 64, "Required. The name for this meta-tag. Example: 'Apache'.");
$form .= form_textfield("Attributes", "attributes", $edit[attributes], 50, 64, "Required. A comma-seperated list of keywords you want to associate this meta-tag with. Example: 'Computers, Software, Webservers'.");
@@ -87,7 +85,7 @@ function meta_form_tag($edit = array()) {
$form .= form_hidden("tid", $edit[tid]);
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function meta_save_collection($edit) {
@@ -121,7 +119,7 @@ function meta_preview() {
$output .= meta_form($name) ."<HR>";
}
}
- return form("", $output);
+ return form($output);
}
function meta_overview() {
diff --git a/modules/node.module b/modules/node.module
index e856a17ec..1b0c9f123 100644
--- a/modules/node.module
+++ b/modules/node.module
@@ -142,7 +142,7 @@ function node_edit_option($id) {
$form .= form_hidden("nid", $node->nid);
$form .= form_submit("Save node");
- return form("admin.php?mod=node&id=$node->nid", $form);
+ return form($form, "post", "admin.php?mod=node&id=$node->nid");
}
function node_edit_attribute($id) {
@@ -155,12 +155,10 @@ function node_edit_attribute($id) {
$form .= form_hidden("nid", $node->nid);
$form .= form_submit("Save node");
- return form("admin.php?mod=node&id=$node->nid", $form);
+ return form($form, "post", "admin.php?mod=node&id=$node->nid");
}
function node_edit_status($id) {
- global $REQUEST_URI;
-
$node = node_get_object(array("nid" => $id));
$form .= form_item("Title", check_output($node->title));
@@ -172,7 +170,7 @@ function node_edit_status($id) {
$form .= form_hidden("nid", $node->nid);
$form .= form_submit("Save node");
- return form($REQUEST_URI, $form);
+ return form($form);
}
function node_edit_content($edit, $type) {
@@ -198,7 +196,7 @@ function node_delete_confirmation($id) {
$form .= form_submit("Delete node");
$form .= form_submit("Keep node");
- return form("admin.php?mod=node&id=$node->nid", $form);
+ return form($form, "post", "admin.php?mod=node&id=$node->nid");
}
@@ -238,7 +236,6 @@ function node_listing($queries) {
}
function node_setting() {
- global $REQUEST_URI;
$threshold_post = 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);
$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);
@@ -259,7 +256,7 @@ function node_setting() {
$form .= form_submit("Save settings");
$form .= form_submit("Reset to defaults");
- return form($REQUEST_URI, $form);
+ return form($form);
}
function node_admin_save($edit) {
@@ -278,7 +275,6 @@ function node_admin_save($edit) {
}
function node_module_find() {
- global $REQUEST_URI;
foreach (module_list() as $name) {
if (module_hook($name, "user")) {
@@ -286,13 +282,11 @@ function node_module_find() {
}
}
- $output .= "<form action=\"$REQUEST_URI\" method=\"POST\">\n";
$output .= " <input size=\"50\" value=\"". check_form($keys) ."\" name=\"keys\" type=\"text\">\n";
$output .= " <select name=\"type\">$options</select>\n";
$output .= " <input type=\"submit\" value=\"Search\">\n";
- $output .= "</form>\n";
- return $output;
+ return form($output);
}
function node_edit($node) {
diff --git a/modules/node/node.module b/modules/node/node.module
index e856a17ec..1b0c9f123 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -142,7 +142,7 @@ function node_edit_option($id) {
$form .= form_hidden("nid", $node->nid);
$form .= form_submit("Save node");
- return form("admin.php?mod=node&id=$node->nid", $form);
+ return form($form, "post", "admin.php?mod=node&id=$node->nid");
}
function node_edit_attribute($id) {
@@ -155,12 +155,10 @@ function node_edit_attribute($id) {
$form .= form_hidden("nid", $node->nid);
$form .= form_submit("Save node");
- return form("admin.php?mod=node&id=$node->nid", $form);
+ return form($form, "post", "admin.php?mod=node&id=$node->nid");
}
function node_edit_status($id) {
- global $REQUEST_URI;
-
$node = node_get_object(array("nid" => $id));
$form .= form_item("Title", check_output($node->title));
@@ -172,7 +170,7 @@ function node_edit_status($id) {
$form .= form_hidden("nid", $node->nid);
$form .= form_submit("Save node");
- return form($REQUEST_URI, $form);
+ return form($form);
}
function node_edit_content($edit, $type) {
@@ -198,7 +196,7 @@ function node_delete_confirmation($id) {
$form .= form_submit("Delete node");
$form .= form_submit("Keep node");
- return form("admin.php?mod=node&id=$node->nid", $form);
+ return form($form, "post", "admin.php?mod=node&id=$node->nid");
}
@@ -238,7 +236,6 @@ function node_listing($queries) {
}
function node_setting() {
- global $REQUEST_URI;
$threshold_post = 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);
$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);
@@ -259,7 +256,7 @@ function node_setting() {
$form .= form_submit("Save settings");
$form .= form_submit("Reset to defaults");
- return form($REQUEST_URI, $form);
+ return form($form);
}
function node_admin_save($edit) {
@@ -278,7 +275,6 @@ function node_admin_save($edit) {
}
function node_module_find() {
- global $REQUEST_URI;
foreach (module_list() as $name) {
if (module_hook($name, "user")) {
@@ -286,13 +282,11 @@ function node_module_find() {
}
}
- $output .= "<form action=\"$REQUEST_URI\" method=\"POST\">\n";
$output .= " <input size=\"50\" value=\"". check_form($keys) ."\" name=\"keys\" type=\"text\">\n";
$output .= " <select name=\"type\">$options</select>\n";
$output .= " <input type=\"submit\" value=\"Search\">\n";
- $output .= "</form>\n";
- return $output;
+ return form($output);
}
function node_edit($node) {
diff --git a/modules/page.module b/modules/page.module
index e931cbe7b..0fceb12ce 100644
--- a/modules/page.module
+++ b/modules/page.module
@@ -42,7 +42,7 @@ function page_status() {
}
function page_form($edit = array()) {
- global $REQUEST_URI, $format, $op;
+ global $format, $op;
if ($op != t("Preview") && $format[$edit[format]] == "PHP") {
$edit[body] = addslashes($edit[body]);
@@ -67,7 +67,7 @@ function page_form($edit = array()) {
$form .= form_submit(t("Preview"));
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function page_save($edit) {
diff --git a/modules/page/page.module b/modules/page/page.module
index e931cbe7b..0fceb12ce 100644
--- a/modules/page/page.module
+++ b/modules/page/page.module
@@ -42,7 +42,7 @@ function page_status() {
}
function page_form($edit = array()) {
- global $REQUEST_URI, $format, $op;
+ global $format, $op;
if ($op != t("Preview") && $format[$edit[format]] == "PHP") {
$edit[body] = addslashes($edit[body]);
@@ -67,7 +67,7 @@ function page_form($edit = array()) {
$form .= form_submit(t("Preview"));
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function page_save($edit) {
diff --git a/modules/poll.module b/modules/poll.module
index bd7d58f5a..6fedf8e5e 100644
--- a/modules/poll.module
+++ b/modules/poll.module
@@ -100,7 +100,7 @@ function poll_graph($val) {
}
function poll_view($node, $main = 0, $block = 0) {
- global $theme, $op, $user, $chid, $REQUEST_URI;
+ global $theme, $op, $user, $chid;
$pollop = $op;
@@ -158,7 +158,7 @@ function poll_view($node, $main = 0, $block = 0) {
} else {
$output .= "</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td align=\"center\"><br><div align=\"center\">" . form_submit("Vote") . "<br>" . $footer . "</div></td></tr></table>";
}
- $output = form($REQUEST_URI, $output);
+ $output = form($output);
}
@@ -170,7 +170,7 @@ function poll_view($node, $main = 0, $block = 0) {
}
function poll_form($edit = array(), $nocheck = 0) {
- global $REQUEST_URI, $user;
+ global $user;
$duration = array(0 => t("Unlimited"), 86400 => format_interval(86400), 172800 => format_interval(172800), 345600 => format_interval(345600), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200), 4838400 => format_interval(4838400), 9676800 => format_interval(9676800), 31536000 => format_interval(31536000));
$active = array(0 => "Closed", 1 => "Active");
@@ -220,7 +220,7 @@ function poll_form($edit = array(), $nocheck = 0) {
$form .= form_submit(t("Submit"));
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function poll_save($edit) {
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index bd7d58f5a..6fedf8e5e 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -100,7 +100,7 @@ function poll_graph($val) {
}
function poll_view($node, $main = 0, $block = 0) {
- global $theme, $op, $user, $chid, $REQUEST_URI;
+ global $theme, $op, $user, $chid;
$pollop = $op;
@@ -158,7 +158,7 @@ function poll_view($node, $main = 0, $block = 0) {
} else {
$output .= "</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td align=\"center\"><br><div align=\"center\">" . form_submit("Vote") . "<br>" . $footer . "</div></td></tr></table>";
}
- $output = form($REQUEST_URI, $output);
+ $output = form($output);
}
@@ -170,7 +170,7 @@ function poll_view($node, $main = 0, $block = 0) {
}
function poll_form($edit = array(), $nocheck = 0) {
- global $REQUEST_URI, $user;
+ global $user;
$duration = array(0 => t("Unlimited"), 86400 => format_interval(86400), 172800 => format_interval(172800), 345600 => format_interval(345600), 604800 => format_interval(604800), 1209600 => format_interval(1209600), 2419200 => format_interval(2419200), 4838400 => format_interval(4838400), 9676800 => format_interval(9676800), 31536000 => format_interval(31536000));
$active = array(0 => "Closed", 1 => "Active");
@@ -220,7 +220,7 @@ function poll_form($edit = array(), $nocheck = 0) {
$form .= form_submit(t("Submit"));
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function poll_save($edit) {
diff --git a/modules/search.module b/modules/search.module
index beb30565e..559c4bf51 100644
--- a/modules/search.module
+++ b/modules/search.module
@@ -22,7 +22,7 @@ function search_item($item, $type) {
}
function search_page() {
- global $theme, $edit, $type, $keys, $REQUEST_URI;
+ global $theme, $edit, $type, $keys;
if (user_access("search content")) {
@@ -37,7 +37,6 @@ function search_page() {
** Construct the search form:
*/
- $form .= "<form action=\"$REQUEST_URI\" method=\"POST\">";
$form .= " <input size=\"50\" value=\"". check_form($keys) ."\" name=\"keys\" type=\"text\">";
$form .= " <input type=\"submit\" value=\"". t("Search") ."\"><br />";
$form .= t("Restrict search to") .": ";
@@ -48,7 +47,7 @@ function search_page() {
}
}
- $form .= "</form>\n";
+ $form = form($form);
/*
** Collect the search results:
diff --git a/modules/search/search.module b/modules/search/search.module
index beb30565e..559c4bf51 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -22,7 +22,7 @@ function search_item($item, $type) {
}
function search_page() {
- global $theme, $edit, $type, $keys, $REQUEST_URI;
+ global $theme, $edit, $type, $keys;
if (user_access("search content")) {
@@ -37,7 +37,6 @@ function search_page() {
** Construct the search form:
*/
- $form .= "<form action=\"$REQUEST_URI\" method=\"POST\">";
$form .= " <input size=\"50\" value=\"". check_form($keys) ."\" name=\"keys\" type=\"text\">";
$form .= " <input type=\"submit\" value=\"". t("Search") ."\"><br />";
$form .= t("Restrict search to") .": ";
@@ -48,7 +47,7 @@ function search_page() {
}
}
- $form .= "</form>\n";
+ $form = form($form);
/*
** Collect the search results:
diff --git a/modules/story.module b/modules/story.module
index 8a7497a65..c068f05ce 100644
--- a/modules/story.module
+++ b/modules/story.module
@@ -40,7 +40,7 @@ function story_view($node, $main = 0) {
}
function story_form($edit = array()) {
- global $REQUEST_URI, $user;
+ global $user;
if ($edit[title]) {
story_view(new Story(node_preview($edit)));
@@ -73,7 +73,7 @@ function story_form($edit = array()) {
$form .= form_submit(t("Submit"));
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function story_save($edit) {
diff --git a/modules/story/story.module b/modules/story/story.module
index 8a7497a65..c068f05ce 100644
--- a/modules/story/story.module
+++ b/modules/story/story.module
@@ -40,7 +40,7 @@ function story_view($node, $main = 0) {
}
function story_form($edit = array()) {
- global $REQUEST_URI, $user;
+ global $user;
if ($edit[title]) {
story_view(new Story(node_preview($edit)));
@@ -73,7 +73,7 @@ function story_form($edit = array()) {
$form .= form_submit(t("Submit"));
}
- return form($REQUEST_URI, $form);
+ return form($form);
}
function story_save($edit) {
diff --git a/modules/system.module b/modules/system.module
index 16f3b3672..67a2c9e0c 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -102,7 +102,6 @@ function system_default($edit = array()) {
}
function system_view($type) {
- global $REQUEST_URI;
switch ($type) {
case "filter":
@@ -115,7 +114,7 @@ function system_view($type) {
$form .= form_submit("Save configuration");
$form .= form_submit("Reset to defaults");
- return form($REQUEST_URI, $form);
+ return form($form);
}
function system_modules() {
diff --git a/modules/system/system.module b/modules/system/system.module
index 16f3b3672..67a2c9e0c 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -102,7 +102,6 @@ function system_default($edit = array()) {
}
function system_view($type) {
- global $REQUEST_URI;
switch ($type) {
case "filter":
@@ -115,7 +114,7 @@ function system_view($type) {
$form .= form_submit("Save configuration");
$form .= form_submit("Reset to defaults");
- return form($REQUEST_URI, $form);
+ return form($form);
}
function system_modules() {
diff --git a/modules/user.module b/modules/user.module
index ee5754b7b..1ee6599b0 100644
--- a/modules/user.module
+++ b/modules/user.module
@@ -411,7 +411,7 @@ function drupal_auth($username, $password, $server) {
/*** User features *********************************************************/
function user_login($edit = array()) {
- global $user, $REQUEST_URI, $HTTP_REFERER;
+ global $user, $HTTP_REFERER;
if (user_deny("user", $edit["name"])) {
$error = sprintf(t("The name '%s' has been denied access."), $edit["name"]);
@@ -508,7 +508,7 @@ function user_login($edit = array()) {
$output .= form_password(t("Password"), "pass", $pass, 20, 64, t("Enter the password that accompanies your username."));
$output .= form_submit(t("Log in"));
- return form($REQUEST_URI, $output);
+ return form($output);
}
@@ -534,7 +534,6 @@ function user_logout() {
}
function user_pass($edit = array()) {
- global $REQUEST_URI;
if ($edit["name"] && $edit["mail"]) {
if ($account = db_fetch_object(db_query("SELECT uid FROM user WHERE name = '". check_input($edit["name"]) ."' AND mail = '". check_input($edit["mail"]) ."'"))) {
@@ -574,12 +573,11 @@ function user_pass($edit = array()) {
$output .= form_textfield(t("E-mail address"), "mail", $edit["mail"], 30, 64);
$output .= form_submit(t("E-mail new password"));
- return form($REQUEST_URI, $output);
+ return form($output);
}
}
function user_register($edit = array()) {
- global $REQUEST_URI;
if ($edit["name"] && $edit["mail"]) {
if ($error = user_validate_name($edit["name"])) {
@@ -646,12 +644,12 @@ function user_register($edit = array()) {
$output .= form_textfield(t("E-mail address"), "mail", $edit["mail"], 30, 64, t("Your e-mail address: a password and instructions will be sent to this e-mail address so make sure it is accurate."));
$output .= form_submit(t("Create new account"));
- return form($REQUEST_URI, $output);
+ return form($output);
}
}
function user_edit($edit = array()) {
- global $REQUEST_URI, $HTTP_HOST, $themes, $user, $languages;
+ global $HTTP_HOST, $themes, $user, $languages;
if ($user->uid) {
if ($edit["name"]) {
@@ -710,9 +708,11 @@ function user_edit($edit = array()) {
$output .= form_textarea(t("Signature"), "signature", $user->signature, 70, 3, t("Your signature will be publicly displayed at the end of your comments.") ."<br />". t("Allowed HTML tags") .": ". htmlspecialchars(variable_get("allowed_html", "")));
$output .= form_item(t("Password"), "<input type=\"password\" name=\"edit[pass1]\" size=\"12\" maxlength=\"24\"> <input type=\"password\" name=\"edit[pass2]\" size=\"12\" maxlength=\"24\">", t("Enter your new password twice if you want to change your current password or leave it blank if you are happy with your current password."));
$output .= form_submit(t("Save user information"));
+
+ $output = form($output);
}
- return form($REQUEST_URI, $output);
+ return $output;
}
function user_menu() {
@@ -816,7 +816,7 @@ function user_conf_options() {
}
function user_admin_settings($edit = array()) {
- global $op, $REQUEST_URI;
+ global $op;
if ($op == "Save configuration") {
/*
@@ -838,12 +838,11 @@ function user_admin_settings($edit = array()) {
$output .= form_submit("Save configuration");
$output .= form_submit("Reset to defaults");
- return form($REQUEST_URI, $output);
+ return form($output);
}
function user_admin_create($edit = array()) {
- global $REQUEST_URI;
if ($edit["name"] || $edit["mail"]) {
if ($error = user_validate_name($edit["name"])) {
@@ -882,12 +881,12 @@ function user_admin_create($edit = array()) {
$output .= form_textfield("Password", "pass", $edit["pass"], 30, 55);
$output .= form_submit("Create account");
- return form($REQUEST_URI, $output);
+ return form($output);
}
}
function user_admin_access($edit = array()) {
- global $op, $id, $type, $REQUEST_URI;
+ global $op, $id, $type;
$output .= "<small><a href=\"admin.php?mod=user&op=access&type=mail\">e-mail rules</a> :: <a href=\"admin.php?mod=user&op=access&type=user\">username rules</a></small><hr />";
@@ -914,7 +913,6 @@ function user_admin_access($edit = array()) {
db_query("DELETE FROM access WHERE aid = '$id'");
}
- $output .= "<form action=\"$REQUEST_URI\" method=\"post\">";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
$output .= " <tr><th>type</th><th>mask</th><th>operations</th></tr>";
@@ -943,9 +941,7 @@ function user_admin_access($edit = array()) {
$output .= "$message<input size=\"32\" maxlength=\"64\" name=\"edit[test]\" value=\"". $edit["test"] ."\" /><input type=\"submit\" name=\"op\" value=\"Check\" />";
- $output .= "</form>";
-
- return $output;
+ return form($output);
}
@@ -958,7 +954,6 @@ function user_roles() {
}
function user_admin_perm($edit = array()) {
- global $REQUEST_URI;
if ($edit) {
@@ -1010,12 +1005,12 @@ function user_admin_perm($edit = array()) {
$output .= "</table>";
$output .= form_submit("Save permissions");
- return form($REQUEST_URI, $output);
+ return form($output);
}
function user_admin_role($edit = array()) {
- global $op, $id, $REQUEST_URI;
+ global $op, $id;
if ($op == "Save role") {
db_query("UPDATE role SET name = '". $edit["name"] ."' WHERE rid = '$id'");
@@ -1038,7 +1033,7 @@ function user_admin_role($edit = array()) {
$output .= form_submit("Save role");
$output .= form_submit("Delete role");
- $output = form($REQUEST_URI, $output);
+ $output = form($output);
}
if (!$output) {
@@ -1048,22 +1043,22 @@ function user_admin_role($edit = array()) {
$result = db_query("SELECT * FROM role ORDER BY name");
- $output .= "<form action=\"$REQUEST_URI\" method=\"post\">";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
$output .= " <tr><th>name</th><th>operations</th></tr>";
while ($role = db_fetch_object($result)) {
$output .= "<tr><td>". check_output($role->name) ."</td><td><a href=\"admin.php?mod=user&op=role&id=$role->rid\">edit role</a></td></tr>";
}
$output .= " <tr><td><input size=\"32\" maxlength=\"64\" name=\"edit[name]\" /></td><td><input type=\"submit\" name=\"op\" value=\"Add role\" /></td></tr>";
- $output .= "</form>";
$output .= "</table>";
+
+ $output = form($output);
}
return $output;
}
function user_admin_edit($edit = array()) {
- global $op, $id, $REQUEST_URI, $HTTP_HOST;
+ global $op, $id, $HTTP_HOST;
if ($account = user_load(array("uid" => $id))) {
if ($op == "Save account") {
@@ -1090,13 +1085,14 @@ function user_admin_edit($edit = array()) {
$output .= form_item(t("E-mail address"), format_email($account->mail));
$output .= form_item(t("Drupal ID"), strtolower(urlencode($account->name) ."@$HTTP_HOST"));
$output .= form_item(t("Jabber ID"), check_output($account->jabber));
+ $output .= form_item(t("Theme"), check_output("$account->theme"));
$output .= form_select("Status", "status", $account->status, array("blocked", "active"));
$output .= form_select("Role", "role", $account->role, user_roles());
$output .= form_submit("Save account");
$output .= form_submit("Delete account");
- $output = form($REQUEST_URI, $output);
+ $output = form($output);
}
}
else {
@@ -1208,4 +1204,4 @@ function user_admin() {
}
}
-?> \ No newline at end of file
+?>
diff --git a/modules/user/user.module b/modules/user/user.module
index ee5754b7b..1ee6599b0 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -411,7 +411,7 @@ function drupal_auth($username, $password, $server) {
/*** User features *********************************************************/
function user_login($edit = array()) {
- global $user, $REQUEST_URI, $HTTP_REFERER;
+ global $user, $HTTP_REFERER;
if (user_deny("user", $edit["name"])) {
$error = sprintf(t("The name '%s' has been denied access."), $edit["name"]);
@@ -508,7 +508,7 @@ function user_login($edit = array()) {
$output .= form_password(t("Password"), "pass", $pass, 20, 64, t("Enter the password that accompanies your username."));
$output .= form_submit(t("Log in"));
- return form($REQUEST_URI, $output);
+ return form($output);
}
@@ -534,7 +534,6 @@ function user_logout() {
}
function user_pass($edit = array()) {
- global $REQUEST_URI;
if ($edit["name"] && $edit["mail"]) {
if ($account = db_fetch_object(db_query("SELECT uid FROM user WHERE name = '". check_input($edit["name"]) ."' AND mail = '". check_input($edit["mail"]) ."'"))) {
@@ -574,12 +573,11 @@ function user_pass($edit = array()) {
$output .= form_textfield(t("E-mail address"), "mail", $edit["mail"], 30, 64);
$output .= form_submit(t("E-mail new password"));
- return form($REQUEST_URI, $output);
+ return form($output);
}
}
function user_register($edit = array()) {
- global $REQUEST_URI;
if ($edit["name"] && $edit["mail"]) {
if ($error = user_validate_name($edit["name"])) {
@@ -646,12 +644,12 @@ function user_register($edit = array()) {
$output .= form_textfield(t("E-mail address"), "mail", $edit["mail"], 30, 64, t("Your e-mail address: a password and instructions will be sent to this e-mail address so make sure it is accurate."));
$output .= form_submit(t("Create new account"));
- return form($REQUEST_URI, $output);
+ return form($output);
}
}
function user_edit($edit = array()) {
- global $REQUEST_URI, $HTTP_HOST, $themes, $user, $languages;
+ global $HTTP_HOST, $themes, $user, $languages;
if ($user->uid) {
if ($edit["name"]) {
@@ -710,9 +708,11 @@ function user_edit($edit = array()) {
$output .= form_textarea(t("Signature"), "signature", $user->signature, 70, 3, t("Your signature will be publicly displayed at the end of your comments.") ."<br />". t("Allowed HTML tags") .": ". htmlspecialchars(variable_get("allowed_html", "")));
$output .= form_item(t("Password"), "<input type=\"password\" name=\"edit[pass1]\" size=\"12\" maxlength=\"24\"> <input type=\"password\" name=\"edit[pass2]\" size=\"12\" maxlength=\"24\">", t("Enter your new password twice if you want to change your current password or leave it blank if you are happy with your current password."));
$output .= form_submit(t("Save user information"));
+
+ $output = form($output);
}
- return form($REQUEST_URI, $output);
+ return $output;
}
function user_menu() {
@@ -816,7 +816,7 @@ function user_conf_options() {
}
function user_admin_settings($edit = array()) {
- global $op, $REQUEST_URI;
+ global $op;
if ($op == "Save configuration") {
/*
@@ -838,12 +838,11 @@ function user_admin_settings($edit = array()) {
$output .= form_submit("Save configuration");
$output .= form_submit("Reset to defaults");
- return form($REQUEST_URI, $output);
+ return form($output);
}
function user_admin_create($edit = array()) {
- global $REQUEST_URI;
if ($edit["name"] || $edit["mail"]) {
if ($error = user_validate_name($edit["name"])) {
@@ -882,12 +881,12 @@ function user_admin_create($edit = array()) {
$output .= form_textfield("Password", "pass", $edit["pass"], 30, 55);
$output .= form_submit("Create account");
- return form($REQUEST_URI, $output);
+ return form($output);
}
}
function user_admin_access($edit = array()) {
- global $op, $id, $type, $REQUEST_URI;
+ global $op, $id, $type;
$output .= "<small><a href=\"admin.php?mod=user&op=access&type=mail\">e-mail rules</a> :: <a href=\"admin.php?mod=user&op=access&type=user\">username rules</a></small><hr />";
@@ -914,7 +913,6 @@ function user_admin_access($edit = array()) {
db_query("DELETE FROM access WHERE aid = '$id'");
}
- $output .= "<form action=\"$REQUEST_URI\" method=\"post\">";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
$output .= " <tr><th>type</th><th>mask</th><th>operations</th></tr>";
@@ -943,9 +941,7 @@ function user_admin_access($edit = array()) {
$output .= "$message<input size=\"32\" maxlength=\"64\" name=\"edit[test]\" value=\"". $edit["test"] ."\" /><input type=\"submit\" name=\"op\" value=\"Check\" />";
- $output .= "</form>";
-
- return $output;
+ return form($output);
}
@@ -958,7 +954,6 @@ function user_roles() {
}
function user_admin_perm($edit = array()) {
- global $REQUEST_URI;
if ($edit) {
@@ -1010,12 +1005,12 @@ function user_admin_perm($edit = array()) {
$output .= "</table>";
$output .= form_submit("Save permissions");
- return form($REQUEST_URI, $output);
+ return form($output);
}
function user_admin_role($edit = array()) {
- global $op, $id, $REQUEST_URI;
+ global $op, $id;
if ($op == "Save role") {
db_query("UPDATE role SET name = '". $edit["name"] ."' WHERE rid = '$id'");
@@ -1038,7 +1033,7 @@ function user_admin_role($edit = array()) {
$output .= form_submit("Save role");
$output .= form_submit("Delete role");
- $output = form($REQUEST_URI, $output);
+ $output = form($output);
}
if (!$output) {
@@ -1048,22 +1043,22 @@ function user_admin_role($edit = array()) {
$result = db_query("SELECT * FROM role ORDER BY name");
- $output .= "<form action=\"$REQUEST_URI\" method=\"post\">";
$output .= "<table border=\"1\" cellpadding=\"2\" cellspacing=\"2\">";
$output .= " <tr><th>name</th><th>operations</th></tr>";
while ($role = db_fetch_object($result)) {
$output .= "<tr><td>". check_output($role->name) ."</td><td><a href=\"admin.php?mod=user&op=role&id=$role->rid\">edit role</a></td></tr>";
}
$output .= " <tr><td><input size=\"32\" maxlength=\"64\" name=\"edit[name]\" /></td><td><input type=\"submit\" name=\"op\" value=\"Add role\" /></td></tr>";
- $output .= "</form>";
$output .= "</table>";
+
+ $output = form($output);
}
return $output;
}
function user_admin_edit($edit = array()) {
- global $op, $id, $REQUEST_URI, $HTTP_HOST;
+ global $op, $id, $HTTP_HOST;
if ($account = user_load(array("uid" => $id))) {
if ($op == "Save account") {
@@ -1090,13 +1085,14 @@ function user_admin_edit($edit = array()) {
$output .= form_item(t("E-mail address"), format_email($account->mail));
$output .= form_item(t("Drupal ID"), strtolower(urlencode($account->name) ."@$HTTP_HOST"));
$output .= form_item(t("Jabber ID"), check_output($account->jabber));
+ $output .= form_item(t("Theme"), check_output("$account->theme"));
$output .= form_select("Status", "status", $account->status, array("blocked", "active"));
$output .= form_select("Role", "role", $account->role, user_roles());
$output .= form_submit("Save account");
$output .= form_submit("Delete account");
- $output = form($REQUEST_URI, $output);
+ $output = form($output);
}
}
else {
@@ -1208,4 +1204,4 @@ function user_admin() {
}
}
-?> \ No newline at end of file
+?>