summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2004-01-26 19:05:21 +0000
committerDries Buytaert <dries@buytaert.net>2004-01-26 19:05:21 +0000
commit667022830ee203a5779ca44d82e2a9d93a1b21f8 (patch)
tree25e32f751a772e033f68b6be0c563169339c60fb
parenta2055ae9d9b28b011d4c8253eee7eaa4240b2f2a (diff)
downloadbrdo-667022830ee203a5779ca44d82e2a9d93a1b21f8.tar.gz
brdo-667022830ee203a5779ca44d82e2a9d93a1b21f8.tar.bz2
- Patch 5140 by Moshe: removed the theme("header") and theme("footer") functions.
-rw-r--r--includes/bootstrap.inc9
-rw-r--r--includes/theme.inc68
-rw-r--r--themes/chameleon/chameleon.theme40
-rw-r--r--themes/marvin/marvin.theme52
-rw-r--r--themes/xtemplate/xtemplate.theme52
5 files changed, 105 insertions, 116 deletions
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index ed274055d..2cfbdacb7 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -144,13 +144,8 @@ function drupal_page_header() {
** call all init() and exit() hooks without including all modules
** only use those hooks for critical operations
*/
- foreach (module_list(0, 1) as $module) {
- if (is_array($module) && $module['bootstrap']) {
- include_once $module['filename'];
- foreach (bootstrap_hooks() as $hook) {
- module_invoke($module['name'], $hook);
- }
- }
+ foreach (bootstrap_hooks() as $hook) {
+ module_invoke_all($hook);
}
exit();
}
diff --git a/includes/theme.inc b/includes/theme.inc
index 0bd2416bf..25c504883 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -117,22 +117,26 @@ function path_to_theme() {
return dirname($themes[$theme]->filename);
}
+
/**
- * @defgroup themeable Themeable functions
- * @{
+ * Returns an entire Drupal page displaying the supplied content.
*
- * Themeable functions - functions that can be styled differently in themes.
+ * @param $content a string containing the content to display
+ * @param $title (optional) page title (\<head>\<title>)
+ * @param $breadcrumb (optional) page breadcrumb
*
- * @see theme
- * @see theme.inc
- */
-
-/**
- * Returns the theme header.
+ * @see drupal_breadcrumb
*
- * @return a string containing the @a header output.
+ * @return a string containing the @a page output.
*/
-function theme_header() {
+function theme_page($content, $title = NULL, $breadcrumb = NULL) {
+ if (isset($title)) {
+ drupal_set_title($title);
+ }
+ if (isset($breadcrumb)) {
+ drupal_set_breadcrumb($breadcrumb);
+ }
+
$output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
$output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
$output .= "<head>";
@@ -156,31 +160,13 @@ function theme_header() {
$output .= "<small>$help</small><hr />";
}
- return $output;
-}
-
-/**
- * Returns an entire Drupal page displaying the supplied content.
- *
- * @param $content a string containing the content to display
- * @param $title (optional) page title (\<head>\<title>)
- * @param $breadcrumb (optional) page breadcrumb
- *
- * @see drupal_breadcrumb
- *
- * @return a string containing the @a page output.
- */
-function theme_page($content, $title = NULL, $breadcrumb = NULL) {
- if (isset($title)) {
- drupal_set_title($title);
- }
- if (isset($breadcrumb)) {
- drupal_set_breadcrumb($breadcrumb);
- }
-
- $output = theme("header");
+ $output .= "\n<!-- begin content -->\n";
$output .= $content;
- $output .= theme("footer");
+ $output .= "\n<!-- end content -->\n";
+
+ $output .= "</td></tr></table>";
+ $output .= theme_closure();
+ $output .= "</body></html>";
return $output;
}
@@ -395,18 +381,6 @@ function theme_block($block) {
}
/**
- * Returns themed page footer.
- *
- * @return a string containing the @a footer output.
- */
-function theme_footer() {
- $output = "</td></tr></table>";
- $output .= theme_closure();
- $output .= "</body></html>";
- return $output;
-}
-
-/**
* Returns themed marker, useful for marking new comments or required form
* elements.
*
diff --git a/themes/chameleon/chameleon.theme b/themes/chameleon/chameleon.theme
index 0bb52adb0..c9f2ada39 100644
--- a/themes/chameleon/chameleon.theme
+++ b/themes/chameleon/chameleon.theme
@@ -32,7 +32,13 @@ function chameleon_settings() {
return $output;
}
-function chameleon_header($title = "") {
+function chameleon_page($content, $title = NULL, $breadcrumb = NULL) {
+ if (isset($title)) {
+ drupal_set_title($title);
+ }
+ if (isset($breadcrumb)) {
+ drupal_set_breadcrumb($breadcrumb);
+ }
$output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
$output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\">\n";
@@ -70,6 +76,22 @@ function chameleon_header($title = "") {
$output .= "<strong>". t("Status") ."</strong>: $message<hr />";
}
+ $output .= "\n<!-- begin content -->\n";
+ $output .= $content;
+ $output .= "\n<!-- end content -->\n";
+
+ $output .= " </td>\n";
+
+ if ($blocks = theme_blocks("right")) {
+ $output .= " <td id=\"sidebar-right\">$blocks</td>\n";
+ }
+
+ $output .= " </tr>\n";
+ $output .= " </table>\n";
+ $output .= theme_closure();
+ $output .= " </body>\n";
+ $output .= "</html>\n";
+
return $output;
}
@@ -121,20 +143,4 @@ function chameleon_comment($comment, $link = "") {
return $output;
}
-function chameleon_footer() {
-
- $output = " </td>\n";
-
- if ($blocks = theme_blocks("right")) {
- $output .= " <td id=\"sidebar-right\">$blocks</td>\n";
- }
-
- $output .= " </tr>\n";
- $output .= " </table>\n";
- $output .= theme_closure();
- $output .= " </body>\n";
- $output .= "</html>\n";
-
- return $output;
-}
?>
diff --git a/themes/marvin/marvin.theme b/themes/marvin/marvin.theme
index 0c090370a..ca7857222 100644
--- a/themes/marvin/marvin.theme
+++ b/themes/marvin/marvin.theme
@@ -14,7 +14,13 @@ function marvin_help($section) {
return $output;
}
-function marvin_header() {
+function marvin_page($content, $title = NULL, $breadcrumb = NULL) {
+ if (isset($title)) {
+ drupal_set_title($title);
+ }
+ if (isset($breadcrumb)) {
+ drupal_set_breadcrumb($breadcrumb);
+ }
$output = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
$output .= "<html>\n";
@@ -70,6 +76,28 @@ function marvin_header() {
$output .= "<strong>". t("Status") ."</strong>: $message<hr />";
}
+ $output .= "\n<!-- begin content -->\n";
+ $output .= $content;
+ $output .= "\n<!-- end content -->\n";
+
+ $output .= " </td>\n";
+ $blocks = theme("blocks", "right");
+ if ($blocks) {
+ $output .= " <td style=\"width: 200px; vertical-align: top;\">\n";
+ $output .= $blocks;
+ $output .= " </td>\n";
+ }
+ $output .= " </tr>\n</table>";
+ $output .= "<table border=\"0\" style=\"width: 100%\" cellpadding=\"8\" cellspacing=\"0\">\n";
+ $output .= " <tr>\n";
+ $output .= " <td colspan=\"2\" style=\"text-align: center;\">";
+ $output .= "<p>". theme("links", link_page()) ."</p><p>". variable_get("site_footer", "") ."</p>\n";
+ $output .= " </td>\n";
+ $output .= " </tr>\n";
+ $output .= "</table>\n";
+ $output .= theme_closure();
+ $output .= "</body>\n</html>\n";
+
return $output;
}
@@ -157,26 +185,4 @@ function marvin_comment($comment, $link = "") {
function marvin_links($links, $delimiter = " &middot; ") {
return implode($delimiter, $links);
}
-
-function marvin_footer() {
- $output = " </td>\n";
- $blocks = theme("blocks", "right");
- if ($blocks) {
- $output .= " <td style=\"width: 200px; vertical-align: top;\">\n";
- $output .= $blocks;
- $output .= " </td>\n";
- }
- $output .= " </tr>\n</table>";
- $output .= "<table border=\"0\" style=\"width: 100%\" cellpadding=\"8\" cellspacing=\"0\">\n";
- $output .= " <tr>\n";
- $output .= " <td colspan=\"2\" style=\"text-align: center;\">";
- $output .= "<p>". theme("links", link_page()) ."</p><p>". variable_get("site_footer", "") ."</p>\n";
- $output .= " </td>\n";
- $output .= " </tr>\n";
- $output .= "</table>\n";
- $output .= theme_closure();
- $output .= "</body>\n</html>\n";
-
- return $output;
-}
?>
diff --git a/themes/xtemplate/xtemplate.theme b/themes/xtemplate/xtemplate.theme
index bac833398..a0a56fa30 100644
--- a/themes/xtemplate/xtemplate.theme
+++ b/themes/xtemplate/xtemplate.theme
@@ -86,7 +86,14 @@ function xtemplate_comment($comment, $links = 0) {
return $output;
}
-function xtemplate_header() {
+function xtemplate_page($content, $title = NULL, $breadcrumb = NULL) {
+ if (isset($title)) {
+ drupal_set_title($title);
+ }
+ if (isset($breadcrumb)) {
+ drupal_set_breadcrumb($breadcrumb);
+ }
+
global $xtemplate;
$xtemplate->template->assign(array(
@@ -140,8 +147,29 @@ function xtemplate_header() {
}
$xtemplate->template->parse("header");
- return $xtemplate->template->text("header");
+ $output = $xtemplate->template->text("header");
+
+ $output .= "\n<!-- begin content -->\n";
+ $output .= $content;
+ $output .= "\n<!-- end content -->\n";
+
+ if ($blocks = theme("blocks", "right")) {
+ $xtemplate->template->assign("blocks", $blocks);
+ $xtemplate->template->parse("footer.blocks");
+ }
+
+ // only parse the footer block if site_footer is set
+ if ($footer_message = variable_get("site_footer", FALSE)) {
+ $xtemplate->template->assign("footer_message", $footer_message);
+ $xtemplate->template->parse("footer.message");
+ }
+
+ $xtemplate->template->assign("footer", theme_closure());
+ $xtemplate->template->parse("footer");
+
+ $output .= $xtemplate->template->text("footer");
+ return $output;
}
function xtemplate_block(&$block) {
@@ -170,24 +198,4 @@ function xtemplate_box($title, $content, $region = "main") {
return $output;
}
-function xtemplate_footer() {
- global $xtemplate;
-
- if ($blocks = theme("blocks", "right")) {
- $xtemplate->template->assign("blocks", $blocks);
- $xtemplate->template->parse("footer.blocks");
- }
-
- // only parse the footer block if site_footer is set
- if ($footer_message = variable_get("site_footer", FALSE)) {
- $xtemplate->template->assign("footer_message", $footer_message);
- $xtemplate->template->parse("footer.message");
- }
-
- $xtemplate->template->assign("footer", theme_closure());
- $xtemplate->template->parse("footer");
-
- return $xtemplate->template->text("footer");
-}
-
?>