diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/aggregator.module | 2 | ||||
-rw-r--r-- | modules/aggregator/aggregator.module | 2 | ||||
-rw-r--r-- | modules/blog.module | 4 | ||||
-rw-r--r-- | modules/blog/blog.module | 4 | ||||
-rw-r--r-- | modules/comment.module | 6 | ||||
-rw-r--r-- | modules/comment/comment.module | 6 | ||||
-rw-r--r-- | modules/forum.module | 3 | ||||
-rw-r--r-- | modules/forum/forum.module | 3 | ||||
-rw-r--r-- | modules/import.module | 2 | ||||
-rw-r--r-- | modules/node.module | 2 | ||||
-rw-r--r-- | modules/node/node.module | 2 | ||||
-rw-r--r-- | modules/user.module | 55 | ||||
-rw-r--r-- | modules/user/user.module | 55 |
13 files changed, 33 insertions, 113 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module index f5ec428c4..fd932f3cb 100644 --- a/modules/aggregator.module +++ b/modules/aggregator.module @@ -748,7 +748,7 @@ function import_page_sources() { $output .= "<div style=\"margin-left: 20px;\">$feed->description</div><br />"; } - $output .= "<div style=\"text-align: right\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."</div><br />"; + $output .= "<div style=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."</div><br />"; theme("header"); theme("box", t("News feeds"), import_page_info()); diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index f5ec428c4..fd932f3cb 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -748,7 +748,7 @@ function import_page_sources() { $output .= "<div style=\"margin-left: 20px;\">$feed->description</div><br />"; } - $output .= "<div style=\"text-align: right\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."</div><br />"; + $output .= "<div style=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."</div><br />"; theme("header"); theme("box", t("News feeds"), import_page_info()); diff --git a/modules/blog.module b/modules/blog.module index b72bb7719..a8a54c4b3 100644 --- a/modules/blog.module +++ b/modules/blog.module @@ -126,7 +126,7 @@ function blog_page_user($uid) { node_view(node_load(array("nid" => $node->nid)), 1); } print pager_display(NULL, variable_get("default_nodes_main", 10)); - print "<div style=\"text-align: right\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array("%username" => $account->name)))) . "</div>"; + print "<div class=\"xml-icon\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array("%username" => $account->name)))) . "</div>"; } function blog_page_last() { @@ -143,7 +143,7 @@ function blog_page_last() { node_view(node_load(array("nid" => $node->nid)), 1); } print pager_display(NULL, variable_get("default_nodes_main", 10)); - print "<div style=\"text-align: right;\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed", array("title" => t("Read the XML version of all blogs."))) ."</div>"; + print "<div class=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed", array("title" => t("Read the XML version of all blogs."))) ."</div>"; } function blog_validate(&$node) { diff --git a/modules/blog/blog.module b/modules/blog/blog.module index b72bb7719..a8a54c4b3 100644 --- a/modules/blog/blog.module +++ b/modules/blog/blog.module @@ -126,7 +126,7 @@ function blog_page_user($uid) { node_view(node_load(array("nid" => $node->nid)), 1); } print pager_display(NULL, variable_get("default_nodes_main", 10)); - print "<div style=\"text-align: right\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array("%username" => $account->name)))) . "</div>"; + print "<div class=\"xml-icon\">" . l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed/$account->uid", array("title" => t("View the XML version of %username's blog", array("%username" => $account->name)))) . "</div>"; } function blog_page_last() { @@ -143,7 +143,7 @@ function blog_page_last() { node_view(node_load(array("nid" => $node->nid)), 1); } print pager_display(NULL, variable_get("default_nodes_main", 10)); - print "<div style=\"text-align: right;\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed", array("title" => t("Read the XML version of all blogs."))) ."</div>"; + print "<div class=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"\" title=\"\" />", "blog/feed", array("title" => t("Read the XML version of all blogs."))) ."</div>"; } function blog_validate(&$node) { diff --git a/modules/comment.module b/modules/comment.module index d5513965a..4f81d029f 100644 --- a/modules/comment.module +++ b/modules/comment.module @@ -123,8 +123,8 @@ function comment_settings() { $output .= form_select(t("Default threshold"), "comment_default_threshold", variable_get("comment_default_threshold", 0), $thresholds, t("Thresholds are values below which comments are hidden. These thresholds are useful for busy sites which want to hide poor comments from most users.")); $output .= form_select(t("Preview comment"), "comment_preview", variable_get("comment_preview", 1), array(t("Optional"), t("Required")), t("Must users preview comments before submitting?")); - $output .= form_select(t("New comment form"), "comment_new_form", variable_get("comment_new_form", 0), array(t("Disabled"), t("Enabled")), t("New comment form in the node page?")); - $output .= form_select(t("Comment controls"), "comment_controls", variable_get("comment_controls", 0), array(t("Above comments"), t("Below comments"), t("Above and below")), t("Position of the comment controls box.")); + $output .= form_select(t("Location of comment submission form"), "comment_form_location", variable_get("comment_form_location", 0), array(t("Display below post or comments"), t("Display on separate page")), t("The location of the comment submission form.")); + $output .= form_select(t("Comment controls"), "comment_controls", variable_get("comment_controls", 0), array(t("Display above the comments"), t("Display below the comments"), t("Display above and below the comments"), t("Do not display")), t("Position of the comment controls box.")); return $output; } @@ -773,7 +773,7 @@ function comment_render($node, $cid = 0) { ** If enabled, show new comment form */ - if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_new_form", 0)) { + if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_form_location", 0)) { theme("box", t("Post new comment"), comment_form(array("nid" => $nid))); } diff --git a/modules/comment/comment.module b/modules/comment/comment.module index d5513965a..4f81d029f 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -123,8 +123,8 @@ function comment_settings() { $output .= form_select(t("Default threshold"), "comment_default_threshold", variable_get("comment_default_threshold", 0), $thresholds, t("Thresholds are values below which comments are hidden. These thresholds are useful for busy sites which want to hide poor comments from most users.")); $output .= form_select(t("Preview comment"), "comment_preview", variable_get("comment_preview", 1), array(t("Optional"), t("Required")), t("Must users preview comments before submitting?")); - $output .= form_select(t("New comment form"), "comment_new_form", variable_get("comment_new_form", 0), array(t("Disabled"), t("Enabled")), t("New comment form in the node page?")); - $output .= form_select(t("Comment controls"), "comment_controls", variable_get("comment_controls", 0), array(t("Above comments"), t("Below comments"), t("Above and below")), t("Position of the comment controls box.")); + $output .= form_select(t("Location of comment submission form"), "comment_form_location", variable_get("comment_form_location", 0), array(t("Display below post or comments"), t("Display on separate page")), t("The location of the comment submission form.")); + $output .= form_select(t("Comment controls"), "comment_controls", variable_get("comment_controls", 0), array(t("Display above the comments"), t("Display below the comments"), t("Display above and below the comments"), t("Do not display")), t("Position of the comment controls box.")); return $output; } @@ -773,7 +773,7 @@ function comment_render($node, $cid = 0) { ** If enabled, show new comment form */ - if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_new_form", 0)) { + if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_form_location", 0)) { theme("box", t("Post new comment"), comment_form(array("nid" => $nid))); } diff --git a/modules/forum.module b/modules/forum.module index 60691455f..032a6cc73 100644 --- a/modules/forum.module +++ b/modules/forum.module @@ -415,9 +415,6 @@ function forum_page() { if (user_access("access content")) { if (module_exist("taxonomy")) { $tid = arg(1); - if ($op == t("Update settings") && $user->uid) { - $user = user_save($user, array("sortby" => $sortby, "forum_per_page" => $forum_per_page)); - } if (arg(2) == "new") { if ($nid = _forum_new($tid)) { diff --git a/modules/forum/forum.module b/modules/forum/forum.module index 60691455f..032a6cc73 100644 --- a/modules/forum/forum.module +++ b/modules/forum/forum.module @@ -415,9 +415,6 @@ function forum_page() { if (user_access("access content")) { if (module_exist("taxonomy")) { $tid = arg(1); - if ($op == t("Update settings") && $user->uid) { - $user = user_save($user, array("sortby" => $sortby, "forum_per_page" => $forum_per_page)); - } if (arg(2) == "new") { if ($nid = _forum_new($tid)) { diff --git a/modules/import.module b/modules/import.module index f5ec428c4..fd932f3cb 100644 --- a/modules/import.module +++ b/modules/import.module @@ -748,7 +748,7 @@ function import_page_sources() { $output .= "<div style=\"margin-left: 20px;\">$feed->description</div><br />"; } - $output .= "<div style=\"text-align: right\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."</div><br />"; + $output .= "<div style=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."</div><br />"; theme("header"); theme("box", t("News feeds"), import_page_info()); diff --git a/modules/node.module b/modules/node.module index 3049a7514..e611697ea 100644 --- a/modules/node.module +++ b/modules/node.module @@ -927,7 +927,7 @@ function node_block($op = "list", $delta = 0) { } else { $block["subject"] = t("Syndicate"); - $block["content"] = "<div style=\"text-align: center;\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"XML\" title=\"XML\" />", "node/feed", array("title" => t("Read the XML version of this page."))) ."</div>"; + $block["content"] = "<div class=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"XML\" title=\"XML\" />", "node/feed", array("title" => t("Read the XML version of this page."))) ."</div>"; return $block; } diff --git a/modules/node/node.module b/modules/node/node.module index 3049a7514..e611697ea 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -927,7 +927,7 @@ function node_block($op = "list", $delta = 0) { } else { $block["subject"] = t("Syndicate"); - $block["content"] = "<div style=\"text-align: center;\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"XML\" title=\"XML\" />", "node/feed", array("title" => t("Read the XML version of this page."))) ."</div>"; + $block["content"] = "<div class=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" alt=\"XML\" title=\"XML\" />", "node/feed", array("title" => t("Read the XML version of this page."))) ."</div>"; return $block; } diff --git a/modules/user.module b/modules/user.module index 15efff2fe..56a2326f4 100644 --- a/modules/user.module +++ b/modules/user.module @@ -496,9 +496,11 @@ function user_link($type) { if ($type == "system") { global $user; if ($user->uid) { - menu("user/edit", t("my account"), "user_page", 8); + menu("user", t("my account"), "user_page", 8); + menu("user/edit", t("edit account"), "user_page", 0); menu("user/logout", t("log out"), "user_page", 10); } + if (user_access("administer users")) { menu("admin/user", t("accounts"), "user_admin", 2); menu("admin/user/create", t("new user"), "user_admin", 1); @@ -951,26 +953,6 @@ function user_register($edit = array()) { return form($output); } - -function user_delete() { - global $user; - - $edit = $_POST["edit"]; - - if ($edit["confirm"]) { - watchdog("user", "$user->name deactivated her own account."); - db_query("UPDATE {users} SET mail = 'deleted', status = '0' WHERE uid = %d", $user->uid); - $output .= t("Your account has been deactivated."); - } - else { - $output .= form_item(t("Confirm Deletion"), t("You are about to deactivate your own user account. In addition, your e-mail address will be removed from the database.")); - $output .= form_hidden("confirm", 1); - $output .= form_submit(t("Delete account")); - $output = form($output); - } - return $output; -} - function user_edit($edit = array()) { global $user; @@ -1075,16 +1057,6 @@ function user_edit($edit = array()) { return $output; } -function user_menu() { - global $theme; - - $links[] = l(t("view user information"), "user/view"); - $links[] = l(t("edit user information"), "user/edit"); - $links[] = l(t("delete account"), "user/delete"); - - return "<div class=\"user-page-menu\">". theme("links", $links) ."</div>"; -} - function user_view($uid = 0) { global $user; @@ -1099,7 +1071,6 @@ function user_view($uid = 0) { $output .= implode("\n", module_invoke_all("user", "view_private", "", $user)); theme("header", $user->name); - theme("box", t("User account"), user_menu()); theme("box", $user->name, $output); theme("footer"); } @@ -1163,20 +1134,11 @@ function user_page() { theme("box", t("Log in"), $output); theme("footer"); break; - case t("Delete account"): - case "delete": - $output = user_delete(); - theme("header", t("Delete account")); - theme("box", t("User account"), user_menu()); - theme("box", t("Delete account"), $output); - theme("footer"); - break; case t("Save user information"): case "edit": $output = user_edit($edit); $GLOBALS["theme"] = theme_init(); theme("header", t("Edit user information")); - theme("box", t("User account"), user_menu()); theme("box", t("Edit user information"), $output); theme("footer"); break; @@ -1493,9 +1455,6 @@ function user_admin_edit($edit = array()) { } // TODO: this display/edit/validate should be moved to a new profile module implementing the _user hooks - if ($error) { - // do nothing - } if ($error = user_validate_name($edit["name"])) { // do nothing } @@ -1526,7 +1485,7 @@ function user_admin_edit($edit = array()) { unset($edit["pass1"], $edit["pass2"]); if (!$error) { $account = user_save($account, array_merge($edit, $data)); - $output .= status(t("your user information changes have been saved.")); + $output .= status(t("user information changes have been saved.")); } else { $output .= theme("theme_error", $error); @@ -1544,6 +1503,10 @@ function user_admin_edit($edit = array()) { } } + if (!$edit) { + $edit = object2array($account); + } + /* ** Display user form: */ @@ -1692,7 +1655,7 @@ function user_help($section = "admin/help#user") { $output .= t("In this area you will define the <b>permissions</b> for each user role (role names are defined on the %role). Each permission describes a fine-grained logical operation, such as being able to access the administration pages, or adding/modifying a user account. You could say a permission represents access granted to a user to perform a set of operations.", array("%role" => l(t("user roles page"), "admin/user/role"))); break; case 'admin/user/role': - $output .= "Roles allow you to fine tune the security and administration of drupal. A role defines a group of users that have certain privileges as defined in %permission. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <b>names</b> of the various roles. To delete a role choose \"edit role\"<br />By default, Drupal comes with two user roles:"; + $output .= "Roles allow you to fine tune the security and administration of drupal. A role defines a group of users that have certain privileges as defined in %permission. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <b>names</b> of the various roles. To delete a role choose \"edit role\".<br />By default, Drupal comes with two user roles:"; $output .= "<ul>"; $output .= "<li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li>"; $output .= "<li>Authenticated user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li>"; diff --git a/modules/user/user.module b/modules/user/user.module index 15efff2fe..56a2326f4 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -496,9 +496,11 @@ function user_link($type) { if ($type == "system") { global $user; if ($user->uid) { - menu("user/edit", t("my account"), "user_page", 8); + menu("user", t("my account"), "user_page", 8); + menu("user/edit", t("edit account"), "user_page", 0); menu("user/logout", t("log out"), "user_page", 10); } + if (user_access("administer users")) { menu("admin/user", t("accounts"), "user_admin", 2); menu("admin/user/create", t("new user"), "user_admin", 1); @@ -951,26 +953,6 @@ function user_register($edit = array()) { return form($output); } - -function user_delete() { - global $user; - - $edit = $_POST["edit"]; - - if ($edit["confirm"]) { - watchdog("user", "$user->name deactivated her own account."); - db_query("UPDATE {users} SET mail = 'deleted', status = '0' WHERE uid = %d", $user->uid); - $output .= t("Your account has been deactivated."); - } - else { - $output .= form_item(t("Confirm Deletion"), t("You are about to deactivate your own user account. In addition, your e-mail address will be removed from the database.")); - $output .= form_hidden("confirm", 1); - $output .= form_submit(t("Delete account")); - $output = form($output); - } - return $output; -} - function user_edit($edit = array()) { global $user; @@ -1075,16 +1057,6 @@ function user_edit($edit = array()) { return $output; } -function user_menu() { - global $theme; - - $links[] = l(t("view user information"), "user/view"); - $links[] = l(t("edit user information"), "user/edit"); - $links[] = l(t("delete account"), "user/delete"); - - return "<div class=\"user-page-menu\">". theme("links", $links) ."</div>"; -} - function user_view($uid = 0) { global $user; @@ -1099,7 +1071,6 @@ function user_view($uid = 0) { $output .= implode("\n", module_invoke_all("user", "view_private", "", $user)); theme("header", $user->name); - theme("box", t("User account"), user_menu()); theme("box", $user->name, $output); theme("footer"); } @@ -1163,20 +1134,11 @@ function user_page() { theme("box", t("Log in"), $output); theme("footer"); break; - case t("Delete account"): - case "delete": - $output = user_delete(); - theme("header", t("Delete account")); - theme("box", t("User account"), user_menu()); - theme("box", t("Delete account"), $output); - theme("footer"); - break; case t("Save user information"): case "edit": $output = user_edit($edit); $GLOBALS["theme"] = theme_init(); theme("header", t("Edit user information")); - theme("box", t("User account"), user_menu()); theme("box", t("Edit user information"), $output); theme("footer"); break; @@ -1493,9 +1455,6 @@ function user_admin_edit($edit = array()) { } // TODO: this display/edit/validate should be moved to a new profile module implementing the _user hooks - if ($error) { - // do nothing - } if ($error = user_validate_name($edit["name"])) { // do nothing } @@ -1526,7 +1485,7 @@ function user_admin_edit($edit = array()) { unset($edit["pass1"], $edit["pass2"]); if (!$error) { $account = user_save($account, array_merge($edit, $data)); - $output .= status(t("your user information changes have been saved.")); + $output .= status(t("user information changes have been saved.")); } else { $output .= theme("theme_error", $error); @@ -1544,6 +1503,10 @@ function user_admin_edit($edit = array()) { } } + if (!$edit) { + $edit = object2array($account); + } + /* ** Display user form: */ @@ -1692,7 +1655,7 @@ function user_help($section = "admin/help#user") { $output .= t("In this area you will define the <b>permissions</b> for each user role (role names are defined on the %role). Each permission describes a fine-grained logical operation, such as being able to access the administration pages, or adding/modifying a user account. You could say a permission represents access granted to a user to perform a set of operations.", array("%role" => l(t("user roles page"), "admin/user/role"))); break; case 'admin/user/role': - $output .= "Roles allow you to fine tune the security and administration of drupal. A role defines a group of users that have certain privileges as defined in %permission. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <b>names</b> of the various roles. To delete a role choose \"edit role\"<br />By default, Drupal comes with two user roles:"; + $output .= "Roles allow you to fine tune the security and administration of drupal. A role defines a group of users that have certain privileges as defined in %permission. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <b>names</b> of the various roles. To delete a role choose \"edit role\".<br />By default, Drupal comes with two user roles:"; $output .= "<ul>"; $output .= "<li>Anonymous user: this role is used for users that don't have a user account or that are not authenticated.</li>"; $output .= "<li>Authenticated user: this role is assigned automatically to authenticated users. Most registered users will belong to this user role unless specified otherwise.</li>"; |