Commit c485b545 authored by Dries's avatar Dries
Browse files

- Fixed a number of small user experience inconsistencies pointed out by
  Keith.
parent 60ce4e05
...@@ -412,7 +412,7 @@ function book_view($node, $main = 0) { ...@@ -412,7 +412,7 @@ function book_view($node, $main = 0) {
// build the tree from bottom to top to have the book index in $level for navigation later // build the tree from bottom to top to have the book index in $level for navigation later
$path = book_location($node); $path = book_location($node);
$trail[] = l(t("Home"), ""); $trail[] = l(t("Home"), "");
$trail[] = l(t("books"), "book"); $trail[] = l(t("Books"), "book");
foreach ($path as $level) { foreach ($path as $level) {
$trail[] = l($level->title, "node/view/$level->nid"); $trail[] = l($level->title, "node/view/$level->nid");
} }
......
...@@ -412,7 +412,7 @@ function book_view($node, $main = 0) { ...@@ -412,7 +412,7 @@ function book_view($node, $main = 0) {
// build the tree from bottom to top to have the book index in $level for navigation later // build the tree from bottom to top to have the book index in $level for navigation later
$path = book_location($node); $path = book_location($node);
$trail[] = l(t("Home"), ""); $trail[] = l(t("Home"), "");
$trail[] = l(t("books"), "book"); $trail[] = l(t("Books"), "book");
foreach ($path as $level) { foreach ($path as $level) {
$trail[] = l($level->title, "node/view/$level->nid"); $trail[] = l($level->title, "node/view/$level->nid");
} }
......
...@@ -685,7 +685,7 @@ function comment_render($node, $cid = 0) { ...@@ -685,7 +685,7 @@ function comment_render($node, $cid = 0) {
if ((variable_get("comment_controls", 0) == 0) || (variable_get("comment_controls", 0) == 2)) { if ((variable_get("comment_controls", 0) == 0) || (variable_get("comment_controls", 0) == 2)) {
print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n"; print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
theme("box", "", theme("comment_controls", $threshold, $mode, $order, $comments_per_page)); theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
print form_hidden("nid", $nid); print form_hidden("nid", $nid);
print "</div></form>"; print "</div></form>";
} }
...@@ -726,7 +726,7 @@ function comment_render($node, $cid = 0) { ...@@ -726,7 +726,7 @@ function comment_render($node, $cid = 0) {
if ((variable_get("comment_controls", 0) == 1) || (variable_get("comment_controls", 0) == 2)) { if ((variable_get("comment_controls", 0) == 1) || (variable_get("comment_controls", 0) == 2)) {
print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n"; print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
theme("box", "", theme("comment_controls", $threshold, $mode, $order, $comments_per_page)); theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
print form_hidden("nid", $nid); print form_hidden("nid", $nid);
print "</div></form>"; print "</div></form>";
} }
...@@ -1268,10 +1268,10 @@ function comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_p ...@@ -1268,10 +1268,10 @@ function comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_p
$output .= " ". form_submit(t("Save settings")); $output .= " ". form_submit(t("Save settings"));
$output = form_item(t("Comment viewing options"), $output, t("Select your preferred way to display the comments and click 'Save settings' to activate your changes.")); $output = form_item(NULL, $output, t("Select your preferred way to display the comments and click 'Save settings' to activate your changes."));
} }
return $output; return theme("box", t("Comment viewing options"), $output);
} }
function comment_moderation_form($comment) { function comment_moderation_form($comment) {
......
...@@ -685,7 +685,7 @@ function comment_render($node, $cid = 0) { ...@@ -685,7 +685,7 @@ function comment_render($node, $cid = 0) {
if ((variable_get("comment_controls", 0) == 0) || (variable_get("comment_controls", 0) == 2)) { if ((variable_get("comment_controls", 0) == 0) || (variable_get("comment_controls", 0) == 2)) {
print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n"; print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
theme("box", "", theme("comment_controls", $threshold, $mode, $order, $comments_per_page)); theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
print form_hidden("nid", $nid); print form_hidden("nid", $nid);
print "</div></form>"; print "</div></form>";
} }
...@@ -726,7 +726,7 @@ function comment_render($node, $cid = 0) { ...@@ -726,7 +726,7 @@ function comment_render($node, $cid = 0) {
if ((variable_get("comment_controls", 0) == 1) || (variable_get("comment_controls", 0) == 2)) { if ((variable_get("comment_controls", 0) == 1) || (variable_get("comment_controls", 0) == 2)) {
print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n"; print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
theme("box", "", theme("comment_controls", $threshold, $mode, $order, $comments_per_page)); theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
print form_hidden("nid", $nid); print form_hidden("nid", $nid);
print "</div></form>"; print "</div></form>";
} }
...@@ -1268,10 +1268,10 @@ function comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_p ...@@ -1268,10 +1268,10 @@ function comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_p
$output .= " ". form_submit(t("Save settings")); $output .= " ". form_submit(t("Save settings"));
$output = form_item(t("Comment viewing options"), $output, t("Select your preferred way to display the comments and click 'Save settings' to activate your changes.")); $output = form_item(NULL, $output, t("Select your preferred way to display the comments and click 'Save settings' to activate your changes."));
} }
return $output; return theme("box", t("Comment viewing options"), $output);
} }
function comment_moderation_form($comment) { function comment_moderation_form($comment) {
......
...@@ -145,15 +145,19 @@ function forum_link($type, $node = 0, $main = 0) { ...@@ -145,15 +145,19 @@ function forum_link($type, $node = 0, $main = 0) {
function forum_view($node, $main = 0) { function forum_view($node, $main = 0) {
$term_data = array_shift(taxonomy_node_get_terms($node->nid)); if ($main == 0) {
if (!$term_data) { $term_data = array_shift(taxonomy_node_get_terms($node->nid));
// we are previewing if (!$term_data) {
$term_data = taxonomy_get_term($node->taxonomy[0]); // we are previewing
} $term_data = taxonomy_get_term($node->taxonomy[0]);
$voc = taxonomy_get_vocabulary($term_data->vid); }
$voc = taxonomy_get_vocabulary($term_data->vid);
$trail[] = l(t("Home"), NULL);
$trail[] = l(t("Forums"), "forum");
$trail[] = l($term_data->name, "forum/$term_data->tid");
if (!$main) { print "<div class=\"path\">". implode($trail, " &raquo; ") ."</div>";
$node->title = l($voc->name, "forum") ." &raquo; ". l($term_data->name, "forum/$term_data->tid") ." &raquo; $node->title";
} }
$node->teaser = check_output($node->teaser); $node->teaser = check_output($node->teaser);
...@@ -462,7 +466,7 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p ...@@ -462,7 +466,7 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p
*/ */
$trail[] = l(t("Home"), ""); $trail[] = l(t("Home"), "");
$trail[] = l(t("forums"), "forum"); $trail[] = l(t("Forums"), "forum");
if ($parents) { if ($parents) {
$parents = array_reverse($parents); $parents = array_reverse($parents);
...@@ -471,14 +475,12 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p ...@@ -471,14 +475,12 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p
$title = $p->name; $title = $p->name;
} }
else { else {
$trail[] = l(strtolower($p->name), "forum/$p->tid"); $trail[] = l($p->name, "forum/$p->tid");
} }
} }
} }
$output = "<div id=\"forum\">"; $output = "<div id=\"forum\">";
$output .= "<div class=\"path\">". implode($trail, " &raquo; ") ."</div>";
$output .= "<div class=\"title\">$title</div>";
$output .= theme("forum_theme_list", $forums, $parents, $tid); $output .= theme("forum_theme_list", $forums, $parents, $tid);
if ($tid) { if ($tid) {
...@@ -488,7 +490,8 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p ...@@ -488,7 +490,8 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p
$output .= "</div>"; $output .= "</div>";
theme("header"); theme("header");
theme("box", NULL, $output); print "<div class=\"path\">". implode($trail, " &raquo; ") ."</div>";
theme("box", $title, $output);
theme("footer"); theme("footer");
} }
......
...@@ -145,15 +145,19 @@ function forum_link($type, $node = 0, $main = 0) { ...@@ -145,15 +145,19 @@ function forum_link($type, $node = 0, $main = 0) {
function forum_view($node, $main = 0) { function forum_view($node, $main = 0) {
$term_data = array_shift(taxonomy_node_get_terms($node->nid)); if ($main == 0) {
if (!$term_data) { $term_data = array_shift(taxonomy_node_get_terms($node->nid));
// we are previewing if (!$term_data) {
$term_data = taxonomy_get_term($node->taxonomy[0]); // we are previewing
} $term_data = taxonomy_get_term($node->taxonomy[0]);
$voc = taxonomy_get_vocabulary($term_data->vid); }
$voc = taxonomy_get_vocabulary($term_data->vid);
$trail[] = l(t("Home"), NULL);
$trail[] = l(t("Forums"), "forum");
$trail[] = l($term_data->name, "forum/$term_data->tid");
if (!$main) { print "<div class=\"path\">". implode($trail, " &raquo; ") ."</div>";
$node->title = l($voc->name, "forum") ." &raquo; ". l($term_data->name, "forum/$term_data->tid") ." &raquo; $node->title";
} }
$node->teaser = check_output($node->teaser); $node->teaser = check_output($node->teaser);
...@@ -462,7 +466,7 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p ...@@ -462,7 +466,7 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p
*/ */
$trail[] = l(t("Home"), ""); $trail[] = l(t("Home"), "");
$trail[] = l(t("forums"), "forum"); $trail[] = l(t("Forums"), "forum");
if ($parents) { if ($parents) {
$parents = array_reverse($parents); $parents = array_reverse($parents);
...@@ -471,14 +475,12 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p ...@@ -471,14 +475,12 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p
$title = $p->name; $title = $p->name;
} }
else { else {
$trail[] = l(strtolower($p->name), "forum/$p->tid"); $trail[] = l($p->name, "forum/$p->tid");
} }
} }
} }
$output = "<div id=\"forum\">"; $output = "<div id=\"forum\">";
$output .= "<div class=\"path\">". implode($trail, " &raquo; ") ."</div>";
$output .= "<div class=\"title\">$title</div>";
$output .= theme("forum_theme_list", $forums, $parents, $tid); $output .= theme("forum_theme_list", $forums, $parents, $tid);
if ($tid) { if ($tid) {
...@@ -488,7 +490,8 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p ...@@ -488,7 +490,8 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p
$output .= "</div>"; $output .= "</div>";
theme("header"); theme("header");
theme("box", NULL, $output); print "<div class=\"path\">". implode($trail, " &raquo; ") ."</div>";
theme("box", $title, $output);
theme("footer"); theme("footer");
} }
......
...@@ -46,6 +46,14 @@ table { ...@@ -46,6 +46,14 @@ table {
.calendar .row-week { .calendar .row-week {
color: #aaa; color: #aaa;
} }
.path, .path a, .path a:visited {
color: #888;
}
#forum .title {
font-weight: bold;
color: #404040;
padding-bottom: 1em;
}
a:link { a:link {
color: #656 color: #656
} }
......
...@@ -44,11 +44,9 @@ function header($title = "") { ...@@ -44,11 +44,9 @@ function header($title = "") {
</tr> </tr>
<tr> <tr>
<td colspan="2" style="text-align: right;"> <td colspan="2" style="text-align: right;">
<small>
<?php <?php
print $this->links(link_page()); print $this->links(link_page());
?> ?>
</small>
</td> </td>
</tr> </tr>
<tr> <tr>
...@@ -162,7 +160,7 @@ function footer() { ...@@ -162,7 +160,7 @@ function footer() {
<tr> <tr>
<td colspan="2" style="text-align: center;"> <td colspan="2" style="text-align: center;">
<?php <?php
print "<p><small>". $this->links(link_page()) ."</small></p><p>". variable_get("site_footer", "") ."</p>\n"; print "<p>". $this->links(link_page()) ."</p><p>". variable_get("site_footer", "") ."</p>\n";
?> ?>
</td> </td>
</tr> </tr>
......
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