summaryrefslogtreecommitdiff
path: root/themes
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2003-12-01 13:45:33 +0000
committerDries Buytaert <dries@buytaert.net>2003-12-01 13:45:33 +0000
commit4e2c0b250e4f080d0bc3c4b587c6b2c53a0db7ac (patch)
treef057d6143f516349ba72ca67b4e2f4fc736cc95e /themes
parent4a5dc7e43acac8f2c9f3844035055c609da40370 (diff)
downloadbrdo-4e2c0b250e4f080d0bc3c4b587c6b2c53a0db7ac.tar.gz
brdo-4e2c0b250e4f080d0bc3c4b587c6b2c53a0db7ac.tar.bz2
- Introduced a drupal_set_message() and drupal_get_message() function.
Contributed themes and modules need to be updated: - modules: status() is no more; use drupal_set_message() instead. - themes: use drupal_get_message() to check for status messages and visualize them.
Diffstat (limited to 'themes')
-rw-r--r--themes/marvin/marvin.theme4
-rw-r--r--themes/unconed/unconed.theme5
-rw-r--r--themes/xtemplate/xtemplate.css24
-rw-r--r--themes/xtemplate/xtemplate.theme20
-rw-r--r--themes/xtemplate/xtemplate.xtmpl11
5 files changed, 49 insertions, 15 deletions
diff --git a/themes/marvin/marvin.theme b/themes/marvin/marvin.theme
index 5c92a6970..c0c969e8f 100644
--- a/themes/marvin/marvin.theme
+++ b/themes/marvin/marvin.theme
@@ -62,6 +62,10 @@ function marvin_header() {
$output .= "<small>$help</small><hr />";
}
+ if ($message = drupal_get_message()) {
+ $output .= "<b>". t("Status") ."</b>: ". $message->message ."<hr />";
+ }
+
return $output;
}
diff --git a/themes/unconed/unconed.theme b/themes/unconed/unconed.theme
index cee33d4db..386d9507d 100644
--- a/themes/unconed/unconed.theme
+++ b/themes/unconed/unconed.theme
@@ -77,9 +77,14 @@ function unconed_header() {
<?php
print theme("breadcrumb", drupal_get_breadcrumb());
print "<h1>" . drupal_get_title() . "</h1>";
+
if ($help = menu_get_active_help()) {
print "<small>$help</small><hr />";
}
+
+ if ($message = drupal_get_message()) {
+ $output .= "<b>". t("Status") ."</b>: ". $message->message ."<hr />";
+ }
}
function unconed_node($node, $main = 0, $page = 0) {
diff --git a/themes/xtemplate/xtemplate.css b/themes/xtemplate/xtemplate.css
index 4e1c937f0..128f8c952 100644
--- a/themes/xtemplate/xtemplate.css
+++ b/themes/xtemplate/xtemplate.css
@@ -96,12 +96,12 @@ img {
#search .form-submit {
height: 1.5em;
}
-#message {
+#mission {
background-color: #369;
padding: 1.5em 2em;
color: #fff;
}
-#message a, #message a:visited {
+#mission a, #mission a:visited {
color: #9cf;
font-weight: bold;
}
@@ -109,9 +109,25 @@ img {
/* padding in px not ex because IE messes up 100% width tables otherwise */
padding: 10px;
}
-#message, #main .node .content, .comment .content {
+#mission, #main .node .content, .comment .content {
line-height: 1.4;
}
+#help {
+ font-size: 0.9em;
+ margin-bottom: 1em;
+}
+.error-message {
+ background-color: #eee;
+ border: 1px solid red;
+ padding: 0.3em;
+ margin-bottom: 1em;
+}
+.status-message {
+ background-color: #eee;
+ border: 1px solid #ccc;
+ padding: 0.3em;
+ margin-bottom: 1em;
+}
#sidebar-left, #sidebar-right {
background-color: #ddd;
width: 16em;
@@ -153,7 +169,7 @@ table {
color: #777;
}
.static-node {
- background: #eee;
+ background-color: #eee;
border: solid 1px #ddd;
padding: 1em;
}
diff --git a/themes/xtemplate/xtemplate.theme b/themes/xtemplate/xtemplate.theme
index 2bc36e7af..99ae8b29b 100644
--- a/themes/xtemplate/xtemplate.theme
+++ b/themes/xtemplate/xtemplate.theme
@@ -9,7 +9,7 @@ $GLOBALS["xtemplate"]->template = new XTemplate("themes/xtemplate/xtemplate.xtmp
$GLOBALS["xtemplate"]->template->SetNullBlock(" "); // "" doesnt work!
function xtemplate_settings() {
- $output .= form_textarea(t("Message on front page"), "xtemplate_message", variable_get("xtemplate_message", "edit message"), 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.."));
+ $output .= 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.."));
$output .= form_textfield(t("Stylesheet URL"), "xtemplate_stylesheet", variable_get("xtemplate_stylesheet", "themes/xtemplate/xtemplate.css"), 70, 300, t("The URL for your theme's cascading stylesheet."));
$output .= form_textarea(t("Logo"), "xtemplate_logo", variable_get("xtemplate_logo", "<img src=\"themes/xtemplate/images/druplicon.gif\" alt=\"Druplicon\" />"), 70, 4, t("The HTML code for displaying the logo."));
$output .= 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."));
@@ -105,11 +105,17 @@ function xtemplate_header() {
"breadcrumb" => theme("breadcrumb", drupal_get_breadcrumb())
));
- if (menu_get_active_help()) {
- $xtemplate->template->assign("help", menu_get_active_help());
+ if ($help = menu_get_active_help()) {
+ $xtemplate->template->assign("help", $help);
$xtemplate->template->parse("header.help");
}
+ if ($message = drupal_get_message()) {
+ $xtemplate->template->assign("class", $message->type ."-message");
+ $xtemplate->template->assign("message", ucfirst($message->message));
+ $xtemplate->template->parse("header.message");
+ }
+
if (variable_get("xtemplate_search_box", 1)) {
$xtemplate->template->assign(array(
//"search" => search_form(),
@@ -119,10 +125,10 @@ function xtemplate_header() {
$xtemplate->template->parse("header.search_box");
}
- // only parse the message block if we are on the frontpage ...
- if ($_GET["q"] == variable_get("site_frontpage", "node") && ($message = variable_get("xtemplate_message", "edit message"))) {
- $xtemplate->template->assign("header_message", $message);
- $xtemplate->template->parse("header.message");
+ // only parse the mission block if we are on the frontpage ...
+ if ($_GET["q"] == variable_get("site_frontpage", "node") && ($mission = variable_get("xtemplate_mission", "edit mission"))) {
+ $xtemplate->template->assign("header_mission", $mission);
+ $xtemplate->template->parse("header.mission");
}
if ($blocks = theme("blocks", "left")) {
diff --git a/themes/xtemplate/xtemplate.xtmpl b/themes/xtemplate/xtemplate.xtmpl
index 8db5d2959..93c051456 100644
--- a/themes/xtemplate/xtemplate.xtmpl
+++ b/themes/xtemplate/xtemplate.xtmpl
@@ -39,15 +39,18 @@
</td>
<!-- END: blocks -->
<td valign="top">
- <!-- BEGIN: message -->
- <div id="message">{header_message}</div>
- <!-- END: message -->
+ <!-- BEGIN: mission -->
+ <div id="mission">{mission}</div>
+ <!-- END: mission -->
<div id="main">
{breadcrumb}
<h1>{body_title}</h1>
<!-- BEGIN: help -->
- <small>{help}</small><hr />
+ <div id="help">{help}</div>
<!-- END: help -->
+ <!-- BEGIN: message -->
+ <div class="{class}">{message}</div>
+ <!-- END: message -->
<!-- END: header -->
<!-- BEGIN: node -->