Commit baaa21e1 authored by Dries's avatar Dries

- Tidied up some inconsistencies in the code: scripts/code-style.sh is your friend.

parent 5c0cd3c0
......@@ -253,7 +253,7 @@ function archive_page() {
function archive_settings() {
$output .= form_select( t("First day of week"), "default_firstday", variable_get("default_firstday", 0), array(0 => t("Sunday"), 1 => t("Monday"), 2 => t("Tuesday"), 3 => t("Wednesday"), 4 => t("Thursday"), 5 => t("Friday"), 6 => t("Saturday")), t("The first day of the week. By changing this value you choose how the calendar block is rendered."));
$output .= form_select(t("First day of week"), "default_firstday", variable_get("default_firstday", 0), array(0 => t("Sunday"), 1 => t("Monday"), 2 => t("Tuesday"), 3 => t("Wednesday"), 4 => t("Thursday"), 5 => t("Friday"), 6 => t("Saturday")), t("The first day of the week. By changing this value you choose how the calendar block is rendered."));
return $output;
}
......
......@@ -253,7 +253,7 @@ function archive_page() {
function archive_settings() {
$output .= form_select( t("First day of week"), "default_firstday", variable_get("default_firstday", 0), array(0 => t("Sunday"), 1 => t("Monday"), 2 => t("Tuesday"), 3 => t("Wednesday"), 4 => t("Thursday"), 5 => t("Friday"), 6 => t("Saturday")), t("The first day of the week. By changing this value you choose how the calendar block is rendered."));
$output .= form_select(t("First day of week"), "default_firstday", variable_get("default_firstday", 0), array(0 => t("Sunday"), 1 => t("Monday"), 2 => t("Tuesday"), 3 => t("Wednesday"), 4 => t("Thursday"), 5 => t("Friday"), 6 => t("Saturday")), t("The first day of the week. By changing this value you choose how the calendar block is rendered."));
return $output;
}
......
......@@ -168,7 +168,7 @@ function block_admin_display() {
$delete = "";
}
$rows[] = array($block["info"], array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][status", 1, $block["status"]), "align" => "center"), array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][custom", 1, $block["custom"]), "align" => "center"), array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][throttle", 1, $block["throttle"], NULL, variable_get("throttle_enable", 0) ? NULL : array("disabled" => "disabled")), "align" => "center"), form_weight(NULL, $block["module"]."][".$block["delta"]."][weight", $block["weight"]), form_radios(NULL, $block["module"]."][".$block["delta"]."][region", $block["region"], array(t("left"), t("right"))), form_textfield(NULL, $block["module"]."][".$block["delta"]."][path", $block["path"], 10, 255),
$rows[] = array($block["info"], array("data" => form_checkbox(NULL, $block["module"] ."][". $block["delta"] ."][status", 1, $block["status"]), "align" => "center"), array("data" => form_checkbox(NULL, $block["module"] ."][". $block["delta"] ."][custom", 1, $block["custom"]), "align" => "center"), array("data" => form_checkbox(NULL, $block["module"] ."][". $block["delta"] ."][throttle", 1, $block["throttle"], NULL, variable_get("throttle_enable", 0) ? NULL : array("disabled" => "disabled")), "align" => "center"), form_weight(NULL, $block["module"] ."][". $block["delta"] ."][weight", $block["weight"]), form_radios(NULL, $block["module"] ."][". $block["delta"] ."][region", $block["region"], array(t("left"), t("right"))), form_textfield(NULL, $block["module"] ."][". $block["delta"] ."][path", $block["path"], 10, 255),
$edit, $delete);
}
......@@ -376,8 +376,7 @@ function block_list($region) {
$result = db_query("SELECT * FROM {blocks} WHERE (status = '1' OR custom = '1') ". ($region != "all" ? "AND region = %d " : "") ."ORDER BY weight, module", $region == "left" ? 0 : 1);
while ($result && ($block = db_fetch_array($result))) {
if ((($block['status'] && (!$user->uid || !$block['custom'])) || ($block['custom'] && $user->block[$block['module']][$block['delta']])) &&
(!$block['path'] || preg_match($block['path'], str_replace("?q=", "", request_uri())))) {
if ((($block['status'] && (!$user->uid || !$block['custom'])) || ($block['custom'] && $user->block[$block['module']][$block['delta']])) && (!$block['path'] || preg_match($block['path'], str_replace("?q=", "", request_uri())))) {
/*
** Check the current throttle status and see if block should be displayed
......
......@@ -168,7 +168,7 @@ function block_admin_display() {
$delete = "";
}
$rows[] = array($block["info"], array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][status", 1, $block["status"]), "align" => "center"), array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][custom", 1, $block["custom"]), "align" => "center"), array("data" => form_checkbox(NULL, $block["module"]."][".$block["delta"]."][throttle", 1, $block["throttle"], NULL, variable_get("throttle_enable", 0) ? NULL : array("disabled" => "disabled")), "align" => "center"), form_weight(NULL, $block["module"]."][".$block["delta"]."][weight", $block["weight"]), form_radios(NULL, $block["module"]."][".$block["delta"]."][region", $block["region"], array(t("left"), t("right"))), form_textfield(NULL, $block["module"]."][".$block["delta"]."][path", $block["path"], 10, 255),
$rows[] = array($block["info"], array("data" => form_checkbox(NULL, $block["module"] ."][". $block["delta"] ."][status", 1, $block["status"]), "align" => "center"), array("data" => form_checkbox(NULL, $block["module"] ."][". $block["delta"] ."][custom", 1, $block["custom"]), "align" => "center"), array("data" => form_checkbox(NULL, $block["module"] ."][". $block["delta"] ."][throttle", 1, $block["throttle"], NULL, variable_get("throttle_enable", 0) ? NULL : array("disabled" => "disabled")), "align" => "center"), form_weight(NULL, $block["module"] ."][". $block["delta"] ."][weight", $block["weight"]), form_radios(NULL, $block["module"] ."][". $block["delta"] ."][region", $block["region"], array(t("left"), t("right"))), form_textfield(NULL, $block["module"] ."][". $block["delta"] ."][path", $block["path"], 10, 255),
$edit, $delete);
}
......@@ -376,8 +376,7 @@ function block_list($region) {
$result = db_query("SELECT * FROM {blocks} WHERE (status = '1' OR custom = '1') ". ($region != "all" ? "AND region = %d " : "") ."ORDER BY weight, module", $region == "left" ? 0 : 1);
while ($result && ($block = db_fetch_array($result))) {
if ((($block['status'] && (!$user->uid || !$block['custom'])) || ($block['custom'] && $user->block[$block['module']][$block['delta']])) &&
(!$block['path'] || preg_match($block['path'], str_replace("?q=", "", request_uri())))) {
if ((($block['status'] && (!$user->uid || !$block['custom'])) || ($block['custom'] && $user->block[$block['module']][$block['delta']])) && (!$block['path'] || preg_match($block['path'], str_replace("?q=", "", request_uri())))) {
/*
** Check the current throttle status and see if block should be displayed
......
......@@ -74,13 +74,13 @@ function blog_help($section) {
$output .= "<p>Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen and/or agree/disagree with. A typical example of a long term blog can be seen at %scripting-com.</p>";
$output .= "<p>The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.</p>";
$output .= "<p>If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link <b>(b)</b> next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.</p>";
$output = t($output, array("%scripting-com" => "<a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>" ));
$output = t($output, array("%scripting-com" => "<a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>"));
break;
case 'admin/system/modules#description':
$output .= t("Enables keeping a blog or easily and regularly updated web page.");
break;
case 'admin/system/modules/blog':
$output .= t("A weBLOG is a running journal of a users ideas. Enter the minimum word count for a single entry, and the text displayed on the entry submission form");
$output .= t("A weblog is a running journal of a users ideas. Enter the minimum word count for a single entry, and the text displayed on the entry submission form");
break;
}
......@@ -123,7 +123,7 @@ function blog_page_user($uid) {
$output .= node_view(node_load(array("nid" => $node->nid)), 1);
}
$output .= theme("pager", NULL, variable_get("default_nodes_main", 10));
$output .= "<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>";
$output .= "<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>";
print theme("page", $output, $title);
}
......@@ -250,7 +250,7 @@ function blog_link($type, $node = 0, $main) {
menu("node/add/blog", t("blog entry"), "node_page", 0);
}
if (user_access("maintain personal blog")) {
menu("blog/" . $user->uid, t("my blog"), "blog_page", 1);
menu("blog/". $user->uid, t("my blog"), "blog_page", 1);
}
if (user_access("access content")) {
menu("blog", t("blogs"), "blog_page", 0, MENU_HIDE);
......
......@@ -74,13 +74,13 @@ function blog_help($section) {
$output .= "<p>Blogs are made up of individual entries (nodes) that are timestamped and are typically viewed by day as you would a diary. Blogs often contain links to things you've seen and/or agree/disagree with. A typical example of a long term blog can be seen at %scripting-com.</p>";
$output .= "<p>The blog module adds a \"user blogs\" navigation link to the site, which takes any visitor to a page that displays the most recent blog entries from all the users on the site. Personal user menus gain a \"create a blog entry\" link (which takes you to a submission form) and a \"view personal blog\" link (which displays your blog entries as other people will see them). On the bottom of each of your own blog entries, there is an \"edit this blog entry\" link that lets you edit or delete that entry.</p>";
$output .= "<p>If a user has the ability to post blogs, then the import module (news aggregator) will display a blog-it link <b>(b)</b> next to each news item in its lists. Click on this and you will be taken to the blog submission form, with the title, a link to the item, and a link to the source into the body text already in the text box, ready for you to add your explanation. This actively encourages people to add blog entries about things they see and hear elsewhere in the Drupal site and from your syndicated partner sites.</p>";
$output = t($output, array("%scripting-com" => "<a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>" ));
$output = t($output, array("%scripting-com" => "<a href=\"http://www.scripting.com/\">http://www.scripting.com/</a>"));
break;
case 'admin/system/modules#description':
$output .= t("Enables keeping a blog or easily and regularly updated web page.");
break;
case 'admin/system/modules/blog':
$output .= t("A weBLOG is a running journal of a users ideas. Enter the minimum word count for a single entry, and the text displayed on the entry submission form");
$output .= t("A weblog is a running journal of a users ideas. Enter the minimum word count for a single entry, and the text displayed on the entry submission form");
break;
}
......@@ -123,7 +123,7 @@ function blog_page_user($uid) {
$output .= node_view(node_load(array("nid" => $node->nid)), 1);
}
$output .= theme("pager", NULL, variable_get("default_nodes_main", 10));
$output .= "<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>";
$output .= "<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>";
print theme("page", $output, $title);
}
......@@ -250,7 +250,7 @@ function blog_link($type, $node = 0, $main) {
menu("node/add/blog", t("blog entry"), "node_page", 0);
}
if (user_access("maintain personal blog")) {
menu("blog/" . $user->uid, t("my blog"), "blog_page", 1);
menu("blog/". $user->uid, t("my blog"), "blog_page", 1);
}
if (user_access("access content")) {
menu("blog", t("blogs"), "blog_page", 0, MENU_HIDE);
......
......@@ -598,7 +598,7 @@ function comment_render($node, $cid = 0) {
$result = db_query("SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0 GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users", $cid);
if ($comment = db_fetch_object($result)) {
$output .= theme("comment_view",$comment, comment_links($comment));
$output .= theme("comment_view", $comment, comment_links($comment));
}
if ((comment_user_can_moderate($node)) && $user->uid != $comment->uid && !(comment_already_moderated($user->uid, $comment->users))) {
......
......@@ -598,7 +598,7 @@ function comment_render($node, $cid = 0) {
$result = db_query("SELECT c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0 GROUP BY c.cid, c.pid, c.nid, c.subject, c.comment, c.timestamp, u.uid, u.name, u.data, c.score, c.users", $cid);
if ($comment = db_fetch_object($result)) {
$output .= theme("comment_view",$comment, comment_links($comment));
$output .= theme("comment_view", $comment, comment_links($comment));
}
if ((comment_user_can_moderate($node)) && $user->uid != $comment->uid && !(comment_already_moderated($user->uid, $comment->users))) {
......
......@@ -334,7 +334,7 @@ function forum_get_topics($tid, $sortby, $forum_per_page) {
$term = taxonomy_get_term($tid);
$voc = taxonomy_get_vocabulary($term->vid);
$check_tid = $tid ? "'". check_query($tid). "'" : "NULL";
$check_tid = $tid ? "'". check_query($tid) ."'" : "NULL";
// show topics with the correct tid, or in the forum but with shadow = 1
// @TODO: this is not ANSI SQL! ("user error: 'n.created' isn't in GROUP BY")
......@@ -557,7 +557,7 @@ function theme_forum_list($forums, $parents, $tid) {
$rows[] = array(
array("data" => $description, "class" => "description"),
array("data" => $forum->num_topics . ($new_topics ? "<br />(".t("%a new", array("%a" => $new_topics)).")" : ""), "class" => "topics"),
array("data" => $forum->num_topics . ($new_topics ? "<br />(". t("%a new", array("%a" => $new_topics)) .")" : ""), "class" => "topics"),
array("data" => $forum->num_posts, "class" => "posts"),
array("data" => ($forum->container ? "" : _forum_format($forum->last_post)), "class" => "last-reply")
......@@ -598,7 +598,7 @@ function theme_forum_topic_list($tid, $topics, $sortby, $forum_per_page, $offset
$rows[] = array(
array("data" => _forum_icon($topic->new, $topic->num_comments, $topic->comment_mode), "class" => "icon"),
array("data" => l($topic->title, "node/view/$topic->nid"), "class" => "topic"),
array("data" => $topic->num_comments . ($topic->new_replies ? "<br />(".t("%a new", array("%a" => $topic->new_replies)).")" : ""), "class" => "replies"),
array("data" => $topic->num_comments . ($topic->new_replies ? "<br />(". t("%a new", array("%a" => $topic->new_replies)) .")" : ""), "class" => "replies"),
array("data" => _forum_format($topic), "class" => "created"),
array("data" => _forum_format($topic->last_reply), "class" => "last-reply")
);
......
......@@ -334,7 +334,7 @@ function forum_get_topics($tid, $sortby, $forum_per_page) {
$term = taxonomy_get_term($tid);
$voc = taxonomy_get_vocabulary($term->vid);
$check_tid = $tid ? "'". check_query($tid). "'" : "NULL";
$check_tid = $tid ? "'". check_query($tid) ."'" : "NULL";
// show topics with the correct tid, or in the forum but with shadow = 1
// @TODO: this is not ANSI SQL! ("user error: 'n.created' isn't in GROUP BY")
......@@ -557,7 +557,7 @@ function theme_forum_list($forums, $parents, $tid) {
$rows[] = array(
array("data" => $description, "class" => "description"),
array("data" => $forum->num_topics . ($new_topics ? "<br />(".t("%a new", array("%a" => $new_topics)).")" : ""), "class" => "topics"),
array("data" => $forum->num_topics . ($new_topics ? "<br />(". t("%a new", array("%a" => $new_topics)) .")" : ""), "class" => "topics"),
array("data" => $forum->num_posts, "class" => "posts"),
array("data" => ($forum->container ? "" : _forum_format($forum->last_post)), "class" => "last-reply")
......@@ -598,7 +598,7 @@ function theme_forum_topic_list($tid, $topics, $sortby, $forum_per_page, $offset
$rows[] = array(
array("data" => _forum_icon($topic->new, $topic->num_comments, $topic->comment_mode), "class" => "icon"),
array("data" => l($topic->title, "node/view/$topic->nid"), "class" => "topic"),
array("data" => $topic->num_comments . ($topic->new_replies ? "<br />(".t("%a new", array("%a" => $topic->new_replies)).")" : ""), "class" => "replies"),
array("data" => $topic->num_comments . ($topic->new_replies ? "<br />(". t("%a new", array("%a" => $topic->new_replies)) .")" : ""), "class" => "replies"),
array("data" => _forum_format($topic), "class" => "created"),
array("data" => _forum_format($topic->last_reply), "class" => "last-reply")
);
......
......@@ -190,9 +190,9 @@ function path_perm() {
function path_overview() {
$sql = "SELECT * FROM {url_alias}";
$header = array(
array ("data" => t("alias"), "field" => "dst", "sort" => "asc"),
array ("data" => t("normal"), "field" => "src"),
array ("data" => t("operations"), "colspan" => 2)
array("data" => t("alias"), "field" => "dst", "sort" => "asc"),
array("data" => t("normal"), "field" => "src"),
array("data" => t("operations"), "colspan" => 2)
);
$sql .= tablesort_sql($header);
$result = pager_query($sql, 50);
......
......@@ -190,9 +190,9 @@ function path_perm() {
function path_overview() {
$sql = "SELECT * FROM {url_alias}";
$header = array(
array ("data" => t("alias"), "field" => "dst", "sort" => "asc"),
array ("data" => t("normal"), "field" => "src"),
array ("data" => t("operations"), "colspan" => 2)
array("data" => t("alias"), "field" => "dst", "sort" => "asc"),
array("data" => t("normal"), "field" => "src"),
array("data" => t("operations"), "colspan" => 2)
);
$sql .= tablesort_sql($header);
$result = pager_query($sql, 50);
......
......@@ -4,7 +4,7 @@
function ping_help($section = "admin/help#ping") {
$output = "";
switch($section) {
switch ($section) {
case 'admin/help#ping':
$output .= "<p>Drupal can pings sites automatically to notify them that your site has changed. It can ping the following sites:</p>";
$output .= "<p>%weblogs, a web site that tracks and displays links to changed weblogs and news-oriented web sites. To get your Drupal site listed, weblogs.com must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %weblogs system. The ping module automatically notifies weblogs.com when your site is updated. To do so, Drupal implements the %weblogs-XML.</p>";
......
......@@ -4,7 +4,7 @@
function ping_help($section = "admin/help#ping") {
$output = "";
switch($section) {
switch ($section) {
case 'admin/help#ping':
$output .= "<p>Drupal can pings sites automatically to notify them that your site has changed. It can ping the following sites:</p>";
$output .= "<p>%weblogs, a web site that tracks and displays links to changed weblogs and news-oriented web sites. To get your Drupal site listed, weblogs.com must be informed about your site's updates. This is the job of the ping module and when installed, the administrator doesn't have to do anything to participate in the %weblogs system. The ping module automatically notifies weblogs.com when your site is updated. To do so, Drupal implements the %weblogs-XML.</p>";
......
......@@ -66,8 +66,8 @@ function profile_settings() {
$profile_required_fields = variable_get("profile_required_fields", array());
$profile_register_fields = variable_get("profile_register_fields", array());
$header = array (t("field"), t("enable"), t("public"), t("required"), t("show in registration form"));
$i=0;
$header = array(t("field"), t("enable"), t("public"), t("required"), t("show in registration form"));
$i = 0;
foreach ($profile_fields as $key => $field) {
$row[$i][] = $field[1];
$row[$i][] = form_checkbox("", "profile_private_fields][", $key, in_array($key, $profile_private_fields));
......
......@@ -66,8 +66,8 @@ function profile_settings() {
$profile_required_fields = variable_get("profile_required_fields", array());
$profile_register_fields = variable_get("profile_register_fields", array());
$header = array (t("field"), t("enable"), t("public"), t("required"), t("show in registration form"));
$i=0;
$header = array(t("field"), t("enable"), t("public"), t("required"), t("show in registration form"));
$i = 0;
foreach ($profile_fields as $key => $field) {
$row[$i][] = $field[1];
$row[$i][] = form_checkbox("", "profile_private_fields][", $key, in_array($key, $profile_private_fields));
......
......@@ -327,7 +327,7 @@ function system_listing($type, $directory, $required = array()) {
$row[] = array("data" => (in_array($filename, $throttle_required) ? form_hidden("throttle][$filename", 0) . t("required") : form_checkbox(NULL, "throttle][$filename", 1, $file->throttle, NULL, variable_get("throttle_enable", 0) ? NULL : array("disabled" => "disabled"))), "align" => "center");
}
else if ($type == "theme") {
$row[] = array("data" => form_radio("","theme_default",$info->name,(variable_get("theme_default",0) == $info->name) ? 1 : 0), "align" => "center");
$row[] = array("data" => form_radio("", "theme_default", $info->name, (variable_get("theme_default",0) == $info->name) ? 1 : 0), "align" => "center");
}
$rows[] = $row;
}
......
......@@ -327,7 +327,7 @@ function system_listing($type, $directory, $required = array()) {
$row[] = array("data" => (in_array($filename, $throttle_required) ? form_hidden("throttle][$filename", 0) . t("required") : form_checkbox(NULL, "throttle][$filename", 1, $file->throttle, NULL, variable_get("throttle_enable", 0) ? NULL : array("disabled" => "disabled"))), "align" => "center");
}
else if ($type == "theme") {
$row[] = array("data" => form_radio("","theme_default",$info->name,(variable_get("theme_default",0) == $info->name) ? 1 : 0), "align" => "center");
$row[] = array("data" => form_radio("", "theme_default", $info->name, (variable_get("theme_default",0) == $info->name) ? 1 : 0), "align" => "center");
}
$rows[] = $row;
}
......
......@@ -772,16 +772,20 @@ function taxonomy_admin() {
switch ($op) {
case "add":
if (arg(3) == "vocabulary")
if (arg(3) == "vocabulary") {
$output .= taxonomy_form_vocabulary();
else if (arg(3) == "term")
}
else if (arg(3) == "term") {
$output .= taxonomy_form_term();
}
break;
case "edit":
if (arg(3) == "vocabulary")
if (arg(3) == "vocabulary") {
$output .= taxonomy_form_vocabulary(object2array(taxonomy_get_vocabulary(arg(4))));
else if (arg(3) == "term")
}
else if (arg(3) == "term") {
$output .= taxonomy_form_term(object2array(taxonomy_get_term(arg(4))));
}
break;
case "preview":
$output .= taxonomy_form(arg(4));
......
......@@ -772,16 +772,20 @@ function taxonomy_admin() {
switch ($op) {
case "add":
if (arg(3) == "vocabulary")
if (arg(3) == "vocabulary") {
$output .= taxonomy_form_vocabulary();
else if (arg(3) == "term")
}
else if (arg(3) == "term") {
$output .= taxonomy_form_term();
}
break;
case "edit":
if (arg(3) == "vocabulary")
if (arg(3) == "vocabulary") {
$output .= taxonomy_form_vocabulary(object2array(taxonomy_get_vocabulary(arg(4))));
else if (arg(3) == "term")
}
else if (arg(3) == "term") {
$output .= taxonomy_form_term(object2array(taxonomy_get_term(arg(4))));
}
break;
case "preview":
$output .= taxonomy_form(arg(4));
......
......@@ -1201,10 +1201,10 @@ function user_admin_access($edit = array()) {
}
else if ($op == t("Check")) {
if (user_deny($type, $edit["test"])) {
drupal_set_message(t("<i>%test</i> is not allowed.", array ("%test" => $edit["test"])));
drupal_set_message(t("<i>%test</i> is not allowed.", array("%test" => $edit["test"])));
}
else {
drupal_set_message(t("<i>%test</i> is allowed.", array ("%test" => $edit["test"])));
drupal_set_message(t("<i>%test</i> is allowed.", array("%test" => $edit["test"])));
}
}
else if ($id) {
......@@ -1223,7 +1223,7 @@ function user_admin_access($edit = array()) {
$rows[] = array(t("Deny"), $rule->mask, l(t("delete rule"), "admin/user/access/$type/$rule->aid"));
}
$options = array ("1" => t("Allow"), "0" => t("Deny"));
$options = array("1" => t("Allow"), "0" => t("Deny"));
$rows[] = array(form_radios(NUll, "status", $edit["status"], $options), form_textfield(NULL, "mask", $edit["mask"], 32, 64), form_submit(t("Add rule")));
$output .= theme("table", $header, $rows);
......@@ -1477,18 +1477,18 @@ function user_admin_edit($edit = array()) {
function user_admin_account() {
$header = array(
array ("data" => t("ID"), "field" => "u.uid"),
array ("data" => t("username"), "field" => "u.name"),
array ("data" => t("status"), "field" => "u.status"),
array ("data" => t("role"), "field" => "u.rid"),
array ("data" => t("last access"), "field" => "u.timestamp", "sort" => "desc"),
array("data" => t("ID"), "field" => "u.uid"),
array("data" => t("username"), "field" => "u.name"),
array("data" => t("status"), "field" => "u.status"),
array("data" => t("role"), "field" => "u.rid"),
array("data" => t("last access"), "field" => "u.timestamp", "sort" => "desc"),
t("operations")
);
$sql = "SELECT u.uid, u.name, u.status, u.timestamp, r.name AS rolename FROM {role} r INNER JOIN {users} u ON r.rid = u.rid WHERE uid != 0";
$sql .= tablesort_sql($header);
$result = pager_query($sql, 50);
$status = array (t("blocked"), t("active"));
$status = array(t("blocked"), t("active"));
while ($account = db_fetch_object($result)) {
$rows[] = array($account->uid, format_name($account), $status[$account->status], $account->rolename, format_date($account->timestamp, "small"), l(t("edit account"), "admin/user/edit/$account->uid"));
}
......
......@@ -1201,10 +1201,10 @@ function user_admin_access($edit = array()) {
}
else if ($op == t("Check")) {
if (user_deny($type, $edit["test"])) {
drupal_set_message(t("<i>%test</i> is not allowed.", array ("%test" => $edit["test"])));
drupal_set_message(t("<i>%test</i> is not allowed.", array("%test" => $edit["test"])));
}
else {
drupal_set_message(t("<i>%test</i> is allowed.", array ("%test" => $edit["test"])));
drupal_set_message(t("<i>%test</i> is allowed.", array("%test" => $edit["test"])));
}
}
else if ($id) {
......@@ -1223,7 +1223,7 @@ function user_admin_access($edit = array()) {
$rows[] = array(t("Deny"), $rule->mask, l(t("delete rule"), "admin/user/access/$type/$rule->aid"));
}
$options = array ("1" => t("Allow"), "0" => t("Deny"));
$options = array("1" => t("Allow"), "0" => t("Deny"));
$rows[] = array(form_radios(NUll, "status", $edit["status"], $options), form_textfield(NULL, "mask", $edit["mask"], 32, 64), form_submit(t("Add rule")));
$output .= theme("table", $header, $rows);
......@@ -1477,18 +1477,18 @@ function user_admin_edit($edit = array()) {
function user_admin_account() {
$header = array(
array ("data" => t("ID"), "field" => "u.uid"),
array ("data" => t("username"), "field" => "u.name"),
array ("data" => t("status"), "field" => "u.status"),
array ("data" => t("role"), "field" => "u.rid"),
array ("data" => t("last access"), "field" => "u.timestamp", "sort" => "desc"),
array("data" => t("ID"), "field" => "u.uid"),
array("data" => t("username"), "field" => "u.name"),
array("data" => t("status"), "field" => "u.status"),
array("data" => t("role"), "field" => "u.rid"),
array("data" => t("last access"), "field" => "u.timestamp", "sort" => "desc"),
t("operations")
);
$sql = "SELECT u.uid, u.name, u.status, u.timestamp, r.name AS rolename FROM {role} r INNER JOIN {users} u ON r.rid = u.rid WHERE uid != 0";
$sql .= tablesort_sql($header);
$result = pager_query($sql, 50);
$status = array (t("blocked"), t("active"));
$status = array(t("blocked"), t("active"));
while ($account = db_fetch_object($result)) {
$rows[] = array($account->uid, format_name($account), $status[$account->status], $account->rolename, format_date($account->timestamp, "small"), l(t("edit account"), "admin/user/edit/$account->uid"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment