summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-06-18 15:04:37 +0000
committerDries Buytaert <dries@buytaert.net>2004-06-18 15:04:37 +0000
commit54b77d64354949428bc8bf48d47b587312a535f2 (patch)
tree8e29ff15063129388e14009f0de6fda996beb897 /themes
parent5ad73c8eb63c8c8db451e5586860f52be8dd8874 (diff)
downloadbrdo-54b77d64354949428bc8bf48d47b587312a535f2.tar.gz
brdo-54b77d64354949428bc8bf48d47b587312a535f2.tar.bz2
Tabs patch!
CHANGES ------- + Introduced tabs. First, we extended the menu system to support tabs. Next, a tab was added for every link that was (1) an administrative action other than the implicit 'view' (2) relevant to that particular page only. This is illustrated by the fact that all tabs are verbs and that clicking a page's tab leads you to a subpage of that page. + Flattened the administration menu. The tabs helped simplify the navigation menu as I could separate 'actions' from 'navigation'. In addition, I removed the 'administer > configuration'-menu, renamed 'blocks' to 'sidebars' which I hope is a bit more descriptive, and made a couple more changes. Earlier, we already renamed 'taxonomy' to 'categorization' and we move 'statistics' under 'logs'. + Grouped settings. All settings have been grouped under 'administer > settings'. TODO ---- + Update core themes: only Xtemplate default supports tabs and even those look ugly. Need help. + Update contributed modules. The menu() hook changed drastically. Updating your code adhere the new menu() function should be 90% of the work. Moreover, ensure that your modue's admin links are still valid and that URLs to node get updated to the new scheme ('node/view/x' -> 'node/x').
Diffstat (limited to 'themes')
-rw-r--r--themes/chameleon/chameleon.theme9
-rw-r--r--themes/chameleon/pure/chameleon.css2
-rw-r--r--themes/example/example.theme2
-rw-r--r--themes/xtemplate/default/xtemplate.css96
-rw-r--r--themes/xtemplate/default/xtemplate.xtmpl6
-rw-r--r--themes/xtemplate/xtemplate.theme17
6 files changed, 107 insertions, 25 deletions
diff --git a/themes/chameleon/chameleon.theme b/themes/chameleon/chameleon.theme
index 6906fbaa8..f3dcf1b6e 100644
--- a/themes/chameleon/chameleon.theme
+++ b/themes/chameleon/chameleon.theme
@@ -6,7 +6,7 @@ function chameleon_help($section) {
$output = '';
switch ($section) {
- case 'admin/system/themes#description':
+ case 'admin/themes#description':
$output = t('A fast PHP theme with different stylesheets.');
break;
}
@@ -37,6 +37,7 @@ function chameleon_page($content, $title = NULL, $breadcrumb = NULL) {
if (isset($title)) {
drupal_set_title($title);
}
+
if (isset($breadcrumb)) {
drupal_set_breadcrumb($breadcrumb);
}
@@ -68,6 +69,10 @@ function chameleon_page($content, $title = NULL, $breadcrumb = NULL) {
$output .= "<h2>$title</h2>";
}
+ if ($tabs = theme('menu_local_tasks')) {
+ $output .= $tabs;
+ }
+
if ($help = menu_get_active_help()) {
$output .= "<small>$help</small><hr />";
}
@@ -106,7 +111,7 @@ function chameleon_node($node, $main = 0, $page = 0) {
$output = "<div class=\"node\">\n";
if (!$page) {
- $output .= " <h2 class=\"title\">". ($main ? l($node->title, "node/view/$node->nid") : $node->title) ."</h2>\n";
+ $output .= " <h2 class=\"title\">". ($main ? l($node->title, "node/$node->nid") : $node->title) ."</h2>\n";
}
$output .= " <div class=\"content\">\n";
diff --git a/themes/chameleon/pure/chameleon.css b/themes/chameleon/pure/chameleon.css
index e555b68ac..a7ab2ac76 100644
--- a/themes/chameleon/pure/chameleon.css
+++ b/themes/chameleon/pure/chameleon.css
@@ -87,4 +87,4 @@ ul {
color: gray;
font-style: italic;
font-size: 0.9em;
-} \ No newline at end of file
+}
diff --git a/themes/example/example.theme b/themes/example/example.theme
index bf4b780ef..d9a040f3e 100644
--- a/themes/example/example.theme
+++ b/themes/example/example.theme
@@ -6,7 +6,7 @@ function example_help($section) {
$output = "";
switch ($section) {
- case 'admin/system/themes#description':
+ case 'admin/themes#description':
$output = t("Internet explorer, Netscape, Opera, Lynx");
break;
}
diff --git a/themes/xtemplate/default/xtemplate.css b/themes/xtemplate/default/xtemplate.css
index 67994520a..6b2ff09a3 100644
--- a/themes/xtemplate/default/xtemplate.css
+++ b/themes/xtemplate/default/xtemplate.css
@@ -188,21 +188,89 @@ table {
}
.tabs {
- color: #999;
- margin: 0.5em 0;
- padding: 0.5em 1em;
- border-bottom: 1px solid black;
+ width: 100%;
+ diplay: block;
+ margin: 0;
+ padding: 0;
+ white-space: nowrap;
}
-.tabs a {
- border: 1px solid black;
- background: #f0f0f0;
- font-weight: bold;
- margin-right: 1em;
- padding: 0.5em 1em;
+
+.tabs ul {
+ float: left;
+ diplay: block;
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
}
-.tabs a.active {
- border-bottom: 1px solid white;
- background: #fff;
+
+.tabs li {
+ float: left;
+ diplay: block;
+ width: auto;
+ margin: 0 0.2em 0 0.2em;
+ padding: 0;
+ list-style-type: none;
+}
+
+.tabs li a {
+ position: relative;
+ display: block;
+ margin: 0;
+ padding: 0 0.9em;
+ background-color: #eee;
+ border-top: 1px solid #888;
+ border-right: 1px solid #888;
+ border-bottom: 2px solid #fff;
+ border-left: 1px solid #888;
+ background-color: #fff;
+ text-align: center;
+ }
+
+.tabs li.active a, .tabs li.active {
+ background-color: #eee;
+ border-top: 1px solid #bbb;
+ border-right: 1px solid #bbb;
+ border-bottom: 2px solid #eee;
+ border-left: 1px solid #ccc;
+ z-index: 2;
+}
+
+.tabs li.active ul {
+ display: inline;
+ float: none;
+ position: absolute;
+ padding: 0;
+ margin: 0;
+ border-top: 2px solid #888;
+ border-left: 2px solid #bbb;
+ background-color: none;
+ white-space: nowrap;
+}
+
+.tabs li.active ul li {
+ width: auto;
+ display: inline;
+ list-style: none;
+ margin: 0;
+ border: 0;
+ z-index: 1;
+}
+
+.tabs li.active ul li a {
+ width: auto;
+ margin: 0;
+ padding: 0;
+ background-color: #eee;
+ border-top: none;
+ border-right: 1px solid #bbb;
+ border-bottom: none;
+ border-left: none;
+ z-index: 2;
+}
+
+.clear-tabs {
+ clear: both;
}
.block, .box {
@@ -222,7 +290,7 @@ table {
.node {
margin: .5em 0 1em 0;
}
-.static {
+.sticky {
padding: .5em;
background-color: #eee;
border: solid 1px #ddd;
diff --git a/themes/xtemplate/default/xtemplate.xtmpl b/themes/xtemplate/default/xtemplate.xtmpl
index a1e0e72ac..2c8db0eef 100644
--- a/themes/xtemplate/default/xtemplate.xtmpl
+++ b/themes/xtemplate/default/xtemplate.xtmpl
@@ -45,6 +45,10 @@
<!-- BEGIN: title -->
{breadcrumb}
<h1 class="title">{title}</h1>
+ <!-- BEGIN: tabs -->
+ <div class="tabs">{tabs}</div>
+ <div class="clear-tabs"></div>
+ <!-- END: tabs -->
<!-- END: title -->
<!-- BEGIN: help -->
<div id="help">{help}</div>
@@ -55,7 +59,7 @@
<!-- END: header -->
<!-- BEGIN: node -->
- <div class="node {static}">
+ <div class="node {sticky}">
<!-- BEGIN: picture -->
{picture}
<!-- END: picture -->
diff --git a/themes/xtemplate/xtemplate.theme b/themes/xtemplate/xtemplate.theme
index 3a63e03ee..9d72d6a96 100644
--- a/themes/xtemplate/xtemplate.theme
+++ b/themes/xtemplate/xtemplate.theme
@@ -26,8 +26,8 @@ function xtemplate_settings() {
$output = form_group(t('Template selection'), $group);
$group = form_textarea(t('Logo'), 'xtemplate_logo', variable_get('xtemplate_logo', "<img src=\"themes/xtemplate/$template_directory/logo.gif\" alt=\"Logo\" />"), 70, 4, t('The HTML code for displaying the logo.'));
- $group .= form_textarea(t('Primary links'), 'xtemplate_primary_links', variable_get('xtemplate_primary_links', l('edit primary links', 'admin/system/themes/xtemplate')), 70, 8, t('The HTML code for the primary links.'));
- $group .= form_textarea(t('Secondary links'), 'xtemplate_secondary_links', variable_get('xtemplate_secondary_links', l('edit secondary links', 'admin/system/themes/xtemplate')), 70, 8, t('The HTML code for the secondary links.'));
+ $group .= form_textarea(t('Primary links'), 'xtemplate_primary_links', variable_get('xtemplate_primary_links', l('edit primary links', 'admin/themes/xtemplate')), 70, 8, t('The HTML code for the primary links.'));
+ $group .= form_textarea(t('Secondary links'), 'xtemplate_secondary_links', variable_get('xtemplate_secondary_links', l('edit secondary links', 'admin/themes/xtemplate')), 70, 8, t('The HTML code for the secondary links.'));
$group .= form_textarea(t('Message on front page'), 'xtemplate_mission', variable_get('xtemplate_mission', 'edit mission'), 70, 6, t('This text will be displayed on the front page. It can be used to display a mission statement, announcement or site description..'));
$group .= form_radios(t('Search box'), 'xtemplate_search_box', variable_get('xtemplate_search_box', 0), array(t('Disabled'), t('Enabled')), t('Show a search box in the upper right corner.'));
$output .= form_group(t('Header settings'), $group);
@@ -44,7 +44,7 @@ function xtemplate_help($section) {
$output = '';
switch ($section) {
- case 'admin/system/themes#description':
+ case 'admin/themes#description':
$output = t('A template driven theme');
break;
}
@@ -59,7 +59,7 @@ function xtemplate_node($node, $main = 0, $page = 0) {
"submitted" => t("Submitted by %a on %b.",
array("%a" => format_name($node),
"%b" => format_date($node->created))),
- "link" => url("node/view/$node->nid"),
+ "link" => url("node/$node->nid"),
"title" => $node->title,
"author" => format_name($node),
"date" => format_date($node->created),
@@ -144,10 +144,15 @@ function xtemplate_page($content, $title = NULL, $breadcrumb = NULL) {
"directory" => "themes/xtemplate/$template_directory",
"onload_attributes" => theme_onload_attribute(),
"logo" => variable_get('xtemplate_logo', "<img src=\"themes/xtemplate/$template_directory/logo.gif\" alt=\"Logo\" />"),
- "primary_links" => variable_get("xtemplate_primary_links", l("edit primary links", "admin/system/themes/xtemplate")),
- "secondary_links" => variable_get("xtemplate_secondary_links", l("edit secondary links", "admin/system/themes/xtemplate"))
+ "primary_links" => variable_get("xtemplate_primary_links", l("edit primary links", "admin/themes/xtemplate")),
+ "secondary_links" => variable_get("xtemplate_secondary_links", l("edit secondary links", "admin/themes/xtemplate"))
));
+ if ($tabs = theme('menu_local_tasks')) {
+ $xtemplate->template->assign("tabs", $tabs);
+ $xtemplate->template->parse("header.title.tabs");
+ }
+
if ($title = drupal_get_title()) {
$xtemplate->template->assign("title", $title);
$xtemplate->template->assign("breadcrumb", theme("breadcrumb", drupal_get_breadcrumb()));