- Committed stage 2 of the theme system improvements! Patch by CodeMonkeyX.

4.4.x
Dries Buytaert 2003-11-09 23:27:22 +00:00
parent 00ee7f747b
commit 951b553a98
48 changed files with 1245 additions and 990 deletions

View File

@ -1186,6 +1186,5 @@ module_init();
$locale = locale_init();
// initialize theme:
$theme = theme_init();
$theme = init_theme();
?>

View File

@ -28,7 +28,7 @@ function pager_display($tags = "", $limit = 10, $element = 0, $type = "default",
*
* @see pager_display
*/
function pager_display_default($tags = "", $limit = 10, $element = 0, $attributes = array()) {
function theme_pager_display_default($tags = "", $limit = 10, $element = 0, $attributes = array()) {
global $pager_total;
if ($pager_total[$element] > $limit) {
$output .= "<div id=\"pager\" class=\"container-inline\">";
@ -51,13 +51,13 @@ function pager_display_default($tags = "", $limit = 10, $element = 0, $attribute
*
* @see pager_display
*/
function pager_display_simple($tags = "", $limit = 10, $element = 0, $attributes = array()) {
function theme_pager_display_simple($tags = "", $limit = 10, $element = 0, $attributes = array()) {
/*
** It's left as an exercise to theme writers to create an alternative
** pager for pager_display_simple(). if your theme does not offer a
** replacement, the theme.inc pager_display_default() is used.
*/
return pager_display_default($tags, $limit, $element, $attributes);
return theme_pager_display_default($tags, $limit, $element, $attributes);
}
/**
@ -68,13 +68,13 @@ function pager_display_simple($tags = "", $limit = 10, $element = 0, $attributes
*
* @see pager_display
*/
function pager_display_admin($tags = "", $limit = 10, $element = 0, $attributes = array()) {
function theme_pager_display_admin($tags = "", $limit = 10, $element = 0, $attributes = array()) {
/*
** It's left as an exercise to theme writers to create an alternative
** pager for pager_display_admin(). if your theme does not offer a
** replacement, the pager.inc pager_display_default() is used.
*/
return pager_display_default($tags, $limit, $element, $attributes);
return theme_pager_display_default($tags, $limit, $element, $attributes);
}
/* *******************************************************************

View File

@ -1,29 +1,25 @@
<?php
// $Id$
/**
Theme System - controls the output of Drupal.
The theme system allows for nearly all output of the Drupal system to be
customized by user themes.
@package theme_system
@defgroup theme_system
@{
**/
/* $Id$ */
/**
* Basic theme
*
* @package theme system
*/
Returns the theme header.
@param $title (optional) override the page title.
function theme_help($section) {
$ouptout = "";
switch ($section) {
case 'admin/system/themes#description':
$output = t("The base theme");
break;
}
return $output;
}
class BaseTheme {
}
@return a string contraining the \a header output.
**/
function theme_header($title = "") {
global $base_url;
@ -31,27 +27,69 @@ function theme_header($title = "") {
$output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\">";
$output .= "<head><title>". $title ? $title : variable_get(site_name, "drupal") ."</title>";
$output .= theme_head($main);
$output .= "</head><body style=\"background-color: #fff; color: #000;\"". theme_onload_attribute(). "\">";
$output .= "</head><body style=\"background-color: #fff; color: #000;\"". theme("onload_attribute"). "\">";
$output .= "<table border=\"0\" cellspacing=\"4\" cellpadding=\"4\"><tr><td style=\"vertical-align: top; width: 170px;\">";
print $output;
theme("box", t("Navigation"), @implode("<br />", link_page()));
theme_blocks("all", $this);
print "</td><td style=\"vertical-align: top;\">";
$output .= theme("box", t("Navigation"), @implode("<br />", link_page()));
$output .= render_blocks("all");
$output .= "</td><td style=\"vertical-align: top;\">";
return $output;
}
/**
Returns themed set of links.
@param $links an array of \a links to be themed.
@param $delimiter (optional) \a delimiter used to seperate the links.
@return a string contraining the \a links output.
**/
function theme_links($links, $delimiter = " | ") {
return implode($delimiter, $links);
}
/**
Returns themed image.
@param $name the \a name of the image file.
@return a string contraining the \a image output.
**/
function theme_image($name) {
return "misc/$name";
}
/**
Returns a themed breadcrumb menu.
@param $breadcrumb an array containing the breadcrumb links.
@return a string contraining the \a breadcrumb output.
**/
function theme_breadcrumb($breadcrumb) {
print "<div class=\"breadcrumb\">". implode($breadcrumb, " &raquo; ") ."</div>";
return "<div class=\"breadcrumb\">". implode($breadcrumb, " &raquo; ") ."</div>";
}
/**
Returns themed node.
The passed $node object provides a all relevant information for displaying a node:
\li \c $node->nid
\li \c $node->type i.e. story, blog, forum.
\li \c $node->title
\li \c $node->created a unix timestamp.
\li \c $node->teaser
\li \c $node->body
\li \c $node->changed a unix timestamp.
\li \c $node->uid the id of the poster.
\li \c $node->username the username of the poster.
@param $node the \a node to be themed.
@param $main
@return a string contraining the \a node output.
**/
function theme_node($node, $main) {
if (module_exist("taxonomy")) {
$terms = taxonomy_link("taxonomy terms", $node);
@ -60,7 +98,7 @@ function theme_node($node, $main) {
$output = "<h2>$node->title</h2> by ". format_name($node);
if (count($terms)) {
$output .= " <small>(". theme("links", $terms) .")</small><br />";
$output .= " <small>(". print theme("links", $terms) .")</small><br />";
}
if ($main && $node->teaser) {
@ -71,58 +109,77 @@ function theme_node($node, $main) {
}
if ($links = link_node($node, $main)) {
$output .= "<br />[ ". theme("links", $links) ." ]";
$output .= "<br />[ ". print theme("links", $links) ." ]";
}
$output .= "<hr />";
print $output;
}
function theme_box($subject, $content, $region = "main") {
$output = "<h2>$subject</h2><p>$content</p>";
print $output;
return $output;
}
/**
* Render a block.
*
* You can style your blocks by defining .block (all blocks),
* .block-<i>module</i> (all blocks of module <i>module</i>),
* and \#block-<i>module</i>-<i>delta</i> (specific block of
* module <i>module</i> with delta <i>delta</i>) in your
* theme's CSS.
*
* @param $block object "indexed with" fields from database
* table 'blocks' ($block->module, $block->delta, $block->region,
* ...) and fields returned by <i>module</i>_block("view")
* ($block->subject, $block->content, ...).
*/
Returns themed box.
@param $subject the \a subject of the box.
@param $content the \a content of the box.
@param $requion the \a region of the box.
@return a string contraining the \a box output.
**/
function theme_box($subject, $content, $region = "main") {
$output = "<h2>$subject</h2><p>$content</p>";
return $output;
}
/**
Returns a themed block.
You can style your blocks by defining .block (all blocks),
.block-<i>module</i> (all blocks of module <i>module</i>),
and \#block-<i>module</i>-<i>delta</i> (specific block of
module <i>module</i> with delta <i>delta</i>) in your
theme's CSS.
@param $block object "indexed with" fields from database table 'blocks' ($block->module, $block->delta, $block->region, ...) and fields returned by <i>module</i>_block("view") ($block->subject, $block->content, ...).
@return a string contraining the \a box output.
**/
function theme_block($block) {
$output = "<div class=\"block block-$block->module\" id=\"block-$block->module-$block->delta\">";
$output .= " <h3>$block->subject</h3>";
$output .= " <div class=\"content\">$block->content</div>";
$output .= "</div>";
print $output;
return $output;
}
/**
Returns themed page footer.
@return a string contraining the \a footer output.
**/
function theme_footer() {
$output = "</td></tr></table>";
$output .= theme_closure();
$output .= "</body></html>";
print $output;
return $output;
}
/**
* Return a marker. Used to indicate new comments or required form
* fields.
*/
Returns themed marker, useful for marking new comments or required form elements.
@return a string contraining the \a mark output.
**/
function theme_mark() {
return "<span class=\"marker\">*</span>";
}
/**
* Return a formatted array of items.
*/
Returns themed list of items.
@param $items (optional) an array of the items to be displayed in a list.
@param $title (optional) the title of the list.
@return a string contraining the \a list output.
**/
function theme_item_list($items = array(), $title = NULL) {
$output .= "<div class=\"item-list\">";
if (isset($title)) {
@ -141,13 +198,119 @@ function theme_item_list($items = array(), $title = NULL) {
}
/**
* Return an error message.
*/
Returns themed error message.
@param $message the error message to be themed.
@return a string contraining the \a error output.
**/
function theme_error($message) {
return "<div class=\"error\">$message</div>";
}
function theme_list($refresh = 0) {
/**
Execute hook _head which is run at the start of the page, and output should be in the head tags.
@param $main (optional)
@return a string contraining the \a error output.
**/
function theme_head($main = 0) {
global $base_url;
$output .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";
$output .= "<base href=\"$base_url/\" />\n";
$output .= "<style type=\"text/css\">\n";
$output .= "@import url(misc/drupal.css);\n";
$output .= "</style>\n";
$head = module_invoke_all("head", $main);
$output .= implode($head, "\n");
return $output;
}
/**
Execute hook _footer() which is run at the end of the page right
before the </body> tag.
@param $main (optional)
@return a string contraining the \a cloasure output.
**/
function theme_closure($main = 0) {
$footer = module_invoke_all("footer", $main);
return implode($footer, "\n");
}
/**
Call _onload hook in all modules to enable modules to insert javascript
that will get run once the page has been loaded by the browser.
@param $theme_onloads (optional) addition onload directives.
@return a string contraining the \a onload output.
**/
function theme_onload_attribute($theme_onloads = array()) {
if (!is_array($theme_onloads)) {
$theme_onloads = array($theme_onloads);
}
// Merge theme onloads (javascript rollovers, image preloads, etc.)
// with module onloads (htmlarea, etc.)
$onloads = array_merge(module_invoke_all("onload"), $theme_onloads);
if (count($onloads)) {
return " onload=\"" . implode("; ", $onloads) . "\"";
}
return "";
}
/**
Render blocks available for (global) $user and $region calling $theme->block($block).
@param $region main|left|right
@return a string contraining the \a blocks output.
**/
function render_blocks($region) {
global $user;
$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);
$output = "";
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())))) {
$block = array_merge($block, module_invoke($block['module'], 'block', 'view', $block['delta']));
if ($block['content']) {
$output .= theme('block', (object)$block);
}
}
}
return $output;
}
/**
Hook Help - returns theme specific help and information.
@param section defines the \a section of the help to be returned.
@return a string contraining the help output.
**/
function theme_help($section) {
$ouptout = "";
switch ($section) {
case 'admin/system/themes#description':
$output = t("The base theme");
break;
}
return $output;
}
/**
Provides a list of currently avalible themes.
@param $refresh
@return an array of the currently avalible themes.
**/
function list_themes($refresh = 0) {
static $list;
if ($refresh) {
@ -167,108 +330,63 @@ function theme_list($refresh = 0) {
return $list;
}
function theme_head($main = 0) {
global $base_url;
$output .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />";
$output .= "<base href=\"$base_url/\" />\n";
$output .= "<style type=\"text/css\">\n";
$output .= "@import url(misc/drupal.css);\n";
$output .= "</style>\n";
$head = module_invoke_all("head", $main);
$output .= implode($head, "\n");
return $output;
}
/**
* Execute hook _footer() which is run at the end of the page right
* before the </body> tag
*/
function theme_closure($main = 0) {
$footer = module_invoke_all("footer", $main);
return implode($footer, "\n");
}
Initialized the theme system.
function theme_init() {
@return the name of the currently selected theme.
**/
function init_theme() {
global $user;
$themes = theme_list();
$themes = list_themes();
$name = $user->theme ? $user->theme : variable_get("theme_default", 0);
$theme->path = "";
$theme->name = "";
if (is_object($themes[$name])) {
include_once($themes[$name]->filename);
$class = "Theme_$name";
$instance =& new $class();
$instance->path = dirname($themes[$name]->filename);
}
else {
$instance =& new BaseTheme;
$theme->path = dirname($themes[$name]->filename);
$theme->name = $name;
}
$instance->theme = $name;
return $instance;
return $theme;
}
/**
* Render blocks available for (global) $user and $region calling $theme->block($block).
*
* @param $region main|left|right
*/
function theme_blocks($region) {
global $user;
Returns the path to the currently selected theme.
$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())))) {
$block = array_merge($block, module_invoke($block['module'], 'block', 'view', $block['delta']));
if ($block['content']) {
theme('block', (object) $block);
}
}
}
@return the path to the the currently selected theme.
**/
function path_to_theme() {
global $theme;
return $theme->path;
}
/**
External interface of the theme system to all other modules, and core files.
All requests for themed functions must go through this function. It examines
the request and routes it to the appropriate theme function. If the current
theme does not implement the requested function, then the base theme function
is called.
Example: \verbatim $header_text = theme("header"); \endverbatim
@return the path to the the currently selected theme.
**/
function theme() {
global $theme;
$args = func_get_args();
$function = array_shift($args);
$name = $theme->theme;
if (function_exists($name ."_". $function)) {
return call_user_func_array($name ."_". $function, $args);
}
else if (method_exists($theme, $function)) {
return call_user_method_array($function, $theme, $args);
// temporary fall-back; can be removed as soon the $theme-object is no more
if (($theme->name != "") && (function_exists($theme->name ."_". $function))) {
return call_user_func_array($theme->name ."_". $function, $args);
}
elseif (function_exists("theme_". $function)){
return call_user_func_array("theme_". $function, $args);
}
else {
return call_user_func_array($function, $args);
// temporary fall-back; can be removed as soon the $theme-object is no more
}
}
/**
* Call _onload hook in all modules to enable modules to insert javascript
* that will get run once the page has been loaded by the browser
*/
function theme_onload_attribute($theme_onloads = array()) {
if (!is_array($theme_onloads)) {
$theme_onloads = array($theme_onloads);
}
// Merge theme onloads (javascript rollovers, image preloads, etc.)
// with module onloads (htmlarea, etc.)
$onloads = array_merge(module_invoke_all("onload"), $theme_onloads);
if (count($onloads)) {
return " onload=\"" . implode("; ", $onloads) . "\"";
}
return;
}
/** @} End of defgroup theme_system **/
?>

View File

@ -124,7 +124,7 @@ function import_update() {
}
}
function import_theme_format_item($item, $feed = 0) {
function theme_import_format_item($item, $feed = 0) {
global $user;
if ($user->uid && module_exist("blog") && user_access("maintain personal blog")) {
@ -148,7 +148,7 @@ function import_bundle_block($attributes) {
$items = array();
while ($item = db_fetch_object($result)) {
$items[] = theme("import_theme_format_item", $item);
$items[] = theme("import_format_item", $item);
}
$output = "<div class=\"import-block\"><div class=\"bundle\">";
@ -163,11 +163,11 @@ function import_feed_block($feed) {
$items = array();
while ($item = db_fetch_object($result)) {
$items[] = theme("import_theme_format_item", $item);
$items[] = theme("import_format_item", $item);
}
$output = "<div class=\"import-block\"><div class=\"feed\">";
$output .= theme("theme_item_list", $items);
$output .= theme("item_list", $items);
$output .= "</div></div>";
return $output;
@ -656,10 +656,10 @@ function import_page_last() {
}
$output .= "</table>\n";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", t("Latest news"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", t("Latest news"), $output);
print theme("footer");
}
function import_page_feed($fid) {
@ -691,11 +691,11 @@ function import_page_feed($fid) {
}
$output .= "</table>\n";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", $feed->title, $header);
theme("box", t("Latest news"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", $feed->title, $header);
print theme("box", t("Latest news"), $output);
print theme("footer");
}
function import_page_bundle($bid) {
@ -730,11 +730,11 @@ function import_page_bundle($bid) {
}
$output .= "</table>\n";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", $bundle->title, $header);
theme("box", t("Latest news"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", $bundle->title, $header);
print theme("box", t("Latest news"), $output);
print theme("footer");
}
@ -750,10 +750,10 @@ function import_page_sources() {
$output .= "<div style=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."</div><br />";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", t("News sources"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", t("News sources"), $output);
print theme("footer");
}
function import_page_fd() {
@ -788,8 +788,8 @@ function import_page_feeds() {
function import_page_blocks($blocks) {
theme("header");
theme("box", t("News feeds"), import_page_info());
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print "<table cellpadding=\"0\" cellspacing=\"5\" border=\"0\" style=\"width: 100%;\">\n";
print " <tr>\n";
@ -797,7 +797,7 @@ function import_page_blocks($blocks) {
$i = 1;
print " <td style=\"vertical-align: top; width: 33%;\">\n";
while ($block = each($blocks)) {
theme("box", $block["value"]["subject"], $block["value"]["content"]);
print theme("box", $block["value"]["subject"], $block["value"]["content"]);
if ($i == ceil(count($blocks) / 3)) {
break;
}
@ -808,7 +808,7 @@ function import_page_blocks($blocks) {
print " </tr>\n";
print "</table>\n";
theme("footer");
print theme("footer");
}
function import_page() {

View File

@ -124,7 +124,7 @@ function import_update() {
}
}
function import_theme_format_item($item, $feed = 0) {
function theme_import_format_item($item, $feed = 0) {
global $user;
if ($user->uid && module_exist("blog") && user_access("maintain personal blog")) {
@ -148,7 +148,7 @@ function import_bundle_block($attributes) {
$items = array();
while ($item = db_fetch_object($result)) {
$items[] = theme("import_theme_format_item", $item);
$items[] = theme("import_format_item", $item);
}
$output = "<div class=\"import-block\"><div class=\"bundle\">";
@ -163,11 +163,11 @@ function import_feed_block($feed) {
$items = array();
while ($item = db_fetch_object($result)) {
$items[] = theme("import_theme_format_item", $item);
$items[] = theme("import_format_item", $item);
}
$output = "<div class=\"import-block\"><div class=\"feed\">";
$output .= theme("theme_item_list", $items);
$output .= theme("item_list", $items);
$output .= "</div></div>";
return $output;
@ -656,10 +656,10 @@ function import_page_last() {
}
$output .= "</table>\n";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", t("Latest news"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", t("Latest news"), $output);
print theme("footer");
}
function import_page_feed($fid) {
@ -691,11 +691,11 @@ function import_page_feed($fid) {
}
$output .= "</table>\n";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", $feed->title, $header);
theme("box", t("Latest news"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", $feed->title, $header);
print theme("box", t("Latest news"), $output);
print theme("footer");
}
function import_page_bundle($bid) {
@ -730,11 +730,11 @@ function import_page_bundle($bid) {
}
$output .= "</table>\n";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", $bundle->title, $header);
theme("box", t("Latest news"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", $bundle->title, $header);
print theme("box", t("Latest news"), $output);
print theme("footer");
}
@ -750,10 +750,10 @@ function import_page_sources() {
$output .= "<div style=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."</div><br />";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", t("News sources"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", t("News sources"), $output);
print theme("footer");
}
function import_page_fd() {
@ -788,8 +788,8 @@ function import_page_feeds() {
function import_page_blocks($blocks) {
theme("header");
theme("box", t("News feeds"), import_page_info());
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print "<table cellpadding=\"0\" cellspacing=\"5\" border=\"0\" style=\"width: 100%;\">\n";
print " <tr>\n";
@ -797,7 +797,7 @@ function import_page_blocks($blocks) {
$i = 1;
print " <td style=\"vertical-align: top; width: 33%;\">\n";
while ($block = each($blocks)) {
theme("box", $block["value"]["subject"], $block["value"]["content"]);
print theme("box", $block["value"]["subject"], $block["value"]["content"]);
if ($i == ceil(count($blocks) / 3)) {
break;
}
@ -808,7 +808,7 @@ function import_page_blocks($blocks) {
print " </tr>\n";
print "</table>\n";
theme("footer");
print theme("footer");
}
function import_page() {

View File

@ -197,7 +197,7 @@ function archive_page() {
$op = $_POST["op"];
$edit = $_POST["edit"];
theme("header");
print theme("header");
if (user_access("access content")) {
if ($op == t("Show")) {
@ -224,7 +224,7 @@ function archive_page() {
$start = "<div class=\"container-inline\">";
$start .= form_select("", "year", ($year ? $year : date("Y")), $years). form_select("", "month", ($month ? $month : date("m")), $months) . form_select("", "day", ($day ? $day : date("d")), $days) . form_submit(t("Show"));
$start .= "</div>";
theme("box", t("Archives"), form($start));
print theme("box", t("Archives"), form($start));
/*
** Fetch nodes for the selected date, or current date if none
@ -243,7 +243,7 @@ function archive_page() {
message_access();
}
theme("footer");
print theme("footer");
}
function archive_settings() {

View File

@ -197,7 +197,7 @@ function archive_page() {
$op = $_POST["op"];
$edit = $_POST["edit"];
theme("header");
print theme("header");
if (user_access("access content")) {
if ($op == t("Show")) {
@ -224,7 +224,7 @@ function archive_page() {
$start = "<div class=\"container-inline\">";
$start .= form_select("", "year", ($year ? $year : date("Y")), $years). form_select("", "month", ($month ? $month : date("m")), $months) . form_select("", "day", ($day ? $day : date("d")), $days) . form_submit(t("Show"));
$start .= "</div>";
theme("box", t("Archives"), form($start));
print theme("box", t("Archives"), form($start));
/*
** Fetch nodes for the selected date, or current date if none
@ -243,7 +243,7 @@ function archive_page() {
message_access();
}
theme("footer");
print theme("footer");
}
function archive_settings() {

View File

@ -119,7 +119,7 @@ function blog_page_user($uid) {
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = l(t("Blogs"), "blog");
$breadcrumb[] = t("%name's blog", array("%name" => $account->name));
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
$result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND uid = '$account->uid' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10));
while ($node = db_fetch_object($result)) {
@ -135,7 +135,7 @@ function blog_page_last() {
// Breadcrumb navigation:
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = t("Blogs");
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
$result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10));
@ -153,7 +153,7 @@ function blog_validate(&$node) {
*/
if (isset($node->body) && count(explode(" ", $node->body)) < variable_get("minimum_blog_size", 0)) {
$error["body"] = theme("theme_error", t("The body of your blog is too short."));
$error["body"] = theme("error", t("The body of your blog is too short."));
}
return $error;
@ -207,20 +207,20 @@ function blog_page() {
}
break;
default:
theme("header");
print theme("header");
if (arg(1)) {
blog_page_user(arg(1));
}
else {
blog_page_last();
}
theme("footer");
print theme("footer");
}
}
else {
theme("header");
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}
@ -237,12 +237,12 @@ function blog_view($node, $main = 0) {
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = l(t("%name's blog", array("%name" => $node->name)), "blog/$node->uid");
// print the breadcrumb
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
}
// prepair the node content
$node = blog_content($node);
// print the node
theme("node", $node, $main);
print theme("node", $node, $main);
}
function blog_link($type, $node = 0, $main) {

View File

@ -119,7 +119,7 @@ function blog_page_user($uid) {
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = l(t("Blogs"), "blog");
$breadcrumb[] = t("%name's blog", array("%name" => $account->name));
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
$result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND uid = '$account->uid' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10));
while ($node = db_fetch_object($result)) {
@ -135,7 +135,7 @@ function blog_page_last() {
// Breadcrumb navigation:
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = t("Blogs");
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
$result = pager_query("SELECT nid FROM {node} WHERE type = 'blog' AND status = 1 ORDER BY nid DESC", variable_get("default_nodes_main", 10));
@ -153,7 +153,7 @@ function blog_validate(&$node) {
*/
if (isset($node->body) && count(explode(" ", $node->body)) < variable_get("minimum_blog_size", 0)) {
$error["body"] = theme("theme_error", t("The body of your blog is too short."));
$error["body"] = theme("error", t("The body of your blog is too short."));
}
return $error;
@ -207,20 +207,20 @@ function blog_page() {
}
break;
default:
theme("header");
print theme("header");
if (arg(1)) {
blog_page_user(arg(1));
}
else {
blog_page_last();
}
theme("footer");
print theme("footer");
}
}
else {
theme("header");
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}
@ -237,12 +237,12 @@ function blog_view($node, $main = 0) {
$breadcrumb[] = l(t("Home"), NULL);
$breadcrumb[] = l(t("%name's blog", array("%name" => $node->name)), "blog/$node->uid");
// print the breadcrumb
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
}
// prepair the node content
$node = blog_content($node);
// print the node
theme("node", $node, $main);
print theme("node", $node, $main);
}
function blog_link($type, $node = 0, $main) {

View File

@ -390,7 +390,7 @@ function book_view($node, $main = 0) {
*/
if ($main) {
theme("node", $node, $main);
print theme("node", $node, $main);
}
else {
if ($node->moderate) {
@ -400,10 +400,10 @@ function book_view($node, $main = 0) {
if (arg(1) == "view") {
$node = book_navigation($node);
// Print the breadcrumb
theme("breadcrumb", $node->breadcrumb);
print theme("breadcrumb", $node->breadcrumb);
}
// Print the node
theme("node", $node, $main);
print theme("node", $node, $main);
}
}
@ -441,8 +441,8 @@ function book_show($node, $cid) {
/*
** View the node
*/
theme("breadcrumb", $node->breadcrumb);
theme("node", $node, 0);
print theme("breadcrumb", $node->breadcrumb);
print theme("node", $node, 0);
}
else {
@ -621,9 +621,9 @@ function book_render() {
}
}
theme("header");
theme("box", t("Books"), "$output");
theme("footer");
print theme("header");
print theme("box", t("Books"), "$output");
print theme("footer");
}
function book_page() {
@ -632,9 +632,9 @@ function book_page() {
switch (arg(1)) {
case "view":
$node = node_load(array("nid" => arg(2)));
theme("header");
print theme("header");
book_show($node, arg(3));
theme("footer");
print theme("footer");
break;
case "print":
print book_print(arg(2), $depth = 1);
@ -644,9 +644,9 @@ function book_page() {
}
}
else {
theme("header");
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}

View File

@ -390,7 +390,7 @@ function book_view($node, $main = 0) {
*/
if ($main) {
theme("node", $node, $main);
print theme("node", $node, $main);
}
else {
if ($node->moderate) {
@ -400,10 +400,10 @@ function book_view($node, $main = 0) {
if (arg(1) == "view") {
$node = book_navigation($node);
// Print the breadcrumb
theme("breadcrumb", $node->breadcrumb);
print theme("breadcrumb", $node->breadcrumb);
}
// Print the node
theme("node", $node, $main);
print theme("node", $node, $main);
}
}
@ -441,8 +441,8 @@ function book_show($node, $cid) {
/*
** View the node
*/
theme("breadcrumb", $node->breadcrumb);
theme("node", $node, 0);
print theme("breadcrumb", $node->breadcrumb);
print theme("node", $node, 0);
}
else {
@ -621,9 +621,9 @@ function book_render() {
}
}
theme("header");
theme("box", t("Books"), "$output");
theme("footer");
print theme("header");
print theme("box", t("Books"), "$output");
print theme("footer");
}
function book_page() {
@ -632,9 +632,9 @@ function book_page() {
switch (arg(1)) {
case "view":
$node = node_load(array("nid" => arg(2)));
theme("header");
print theme("header");
book_show($node, arg(3));
theme("footer");
print theme("footer");
break;
case "print":
print book_print(arg(2), $depth = 1);
@ -644,9 +644,9 @@ function book_page() {
}
}
else {
theme("header");
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}

View File

@ -192,9 +192,9 @@ function cloud_page() {
if (user_access("access site cloud")) {
theme("header");
theme("box", t("Site cloud"), cloud_help("cloud") . cloud_list(100));
theme("footer");
print theme("header");
print theme("box", t("Site cloud"), cloud_help("cloud") . cloud_list(100));
print theme("footer");
}
}

View File

@ -242,17 +242,17 @@ function comment_reply($pid, $nid) {
*/
if (node_comment_mode($nid) != 2) {
theme("box", t("Reply"), t("This discussion is closed: you can't post new comments."));
print theme("box", t("Reply"), t("This discussion is closed: you can't post new comments."));
}
else if (user_access("post comments")) {
theme("box", t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid)));
print theme("box", t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid)));
}
else {
theme("box", t("Reply"), t("You are not authorized to post comments."));
print theme("box", t("Reply"), t("You are not authorized to post comments."));
}
}
else {
theme("box", t("Reply"), t("You are not authorized to view comments."));
print theme("box", t("Reply"), t("You are not authorized to view comments."));
}
}
@ -277,7 +277,7 @@ function comment_preview($edit) {
comment_view($comment, t("reply to this comment"));
theme("box", t("Reply"), comment_form($edit));
print theme("box", t("Reply"), comment_form($edit));
if ($edit["pid"]) {
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $edit["pid"]));
@ -528,7 +528,7 @@ function comment_links($comment, $return = 1) {
}
}
if ($moderation = comment_moderation_form($comment)) {
if ($moderation = theme("comment_moderation_form", $comment)) {
$links[] = $moderation;
}
@ -550,10 +550,10 @@ function comment_view($comment, $links = "", $visible = 1) {
if ($visible) {
$comment->comment = check_output($comment->comment);
theme("comment", $comment, $links);
print theme("comment", $comment, $links);
}
else {
theme("comment_folded", $comment);
print theme("comment_folded", $comment);
}
}
@ -722,7 +722,7 @@ function comment_render($node, $cid = 0) {
if (db_num_rows($result) && (variable_get("comment_controls", 0) == 0 || variable_get("comment_controls", 0) == 2)) {
print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
print theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
print form_hidden("nid", $nid);
print "</div></form>";
}
@ -734,16 +734,16 @@ function comment_render($node, $cid = 0) {
$comment->depth = count(explode(".", $comment->thread)) - 1;
if ($mode == 1) {
theme("comment_flat_collapsed", $comment, $threshold_min);
print theme("comment_flat_collapsed", $comment, $threshold_min);
}
else if ($mode == 2) {
theme("comment_flat_expanded", $comment, $threshold_min);
print theme("comment_flat_expanded", $comment, $threshold_min);
}
else if ($mode == 3) {
theme("comment_thread_min", $comment, $threshold_min);
print theme("comment_thread_min", $comment, $threshold_min);
}
else if ($mode == 4) {
theme("comment_thread_max", $comment, $threshold_min);
print theme("comment_thread_max", $comment, $threshold_min);
}
}
@ -763,7 +763,7 @@ function comment_render($node, $cid = 0) {
if (db_num_rows($result) && (variable_get("comment_controls", 0) == 1 || variable_get("comment_controls", 0) == 2)) {
print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
print theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
print form_hidden("nid", $nid);
print "</div></form>";
}
@ -774,7 +774,7 @@ function comment_render($node, $cid = 0) {
*/
if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_form_location", 0)) {
theme("box", t("Post new comment"), comment_form(array("nid" => $nid)));
print theme("box", t("Post new comment"), comment_form(array("nid" => $nid)));
}
/*
@ -874,9 +874,9 @@ function comment_page() {
switch ($op) {
case "edit":
theme("header");
print theme("header");
comment_edit(check_query(arg(2)));
theme("footer");
print theme("footer");
break;
case t("Moderate comments"):
case t("Moderate comment"):
@ -884,21 +884,21 @@ function comment_page() {
drupal_goto(url(comment_referer_load()));
break;
case "reply":
theme("header");
print theme("header");
comment_reply(check_query(arg(3)), check_query(arg(2)));
theme("footer");
print theme("footer");
break;
case t("Preview comment"):
theme("header");
print theme("header");
comment_preview($edit);
theme("footer");
print theme("footer");
break;
case t("Post comment"):
list($error_title, $error_body) = comment_post($edit);
if ($error_body) {
theme("header");
theme("box", $error_title, $error_body);
theme("footer");
print theme("header");
print theme("box", $error_title, $error_body);
print theme("footer");
}
else {
drupal_goto(url(comment_referer_load()));
@ -1005,7 +1005,7 @@ function comment_admin_overview($status = 0) {
$result = pager_query($sql, 50);
while ($comment = db_fetch_object($result)) {
$rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
$rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
}
if ($pager = pager_display(NULL, 50, 0, "admin", tablesort_pager())) {
@ -1264,7 +1264,7 @@ function comment_admin() {
** overridden by themes.
*/
function comment_mode_form($mode) {
function theme_comment_mode_form($mode) {
$modes = _comment_get_modes();
foreach ($modes as $key => $value) {
@ -1274,7 +1274,7 @@ function comment_mode_form($mode) {
return "<select name=\"mode\">$options</select>\n";
}
function comment_order_form($order) {
function theme_comment_order_form($order) {
$orders = _comment_get_orders();
foreach ($orders as $key=>$value) {
@ -1284,14 +1284,14 @@ function comment_order_form($order) {
return "<select name=\"order\">$options</select>\n";
}
function comment_per_page_form($comments_per_page) {
function theme_comment_per_page_form($comments_per_page) {
for ($i = 10; $i < 100; $i = $i + 20) {
$options .= " <option value=\"$i\"". ($comments_per_page == $i ? " selected=\"selected\"" : "") .">". t("%a comments per page", array("%a" => $i)) ."</option>";
}
return "<select name=\"comments_per_page\">$options</select>\n";
}
function comment_threshold($threshold) {
function theme_comment_threshold($threshold) {
$result = db_query("SELECT fid, filter FROM {moderation_filters} ");
$options .= " <option value=\"0\">". t("-- threshold --") ."</option>";
while ($filter = db_fetch_object($result)) {
@ -1302,14 +1302,14 @@ function comment_threshold($threshold) {
}
}
function comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_page = 50) {
function theme_comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_page = 50) {
static $output;
if (!$output) {
$output .= comment_mode_form($mode);
$output .= comment_order_form($order);
$output .= comment_per_page_form($comments_per_page);
$output .= comment_threshold($threshold);
$output .= theme("comment_mode_form", $mode);
$output .= theme("comment_order_form", $order);
$output .= theme("comment_per_page_form", $comments_per_page);
$output .= theme("comment_threshold", $threshold);
$output .= " ". form_submit(t("Save settings"));
@ -1319,7 +1319,7 @@ function comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_p
return theme("box", t("Comment viewing options"), $output);
}
function comment_moderation_form($comment) {
function theme_comment_moderation_form($comment) {
global $comment_votes, $user, $node;
static $votes;
@ -1360,9 +1360,9 @@ function comment_moderation_form($comment) {
return $output;
}
function comment($comment, $links = 0) {
function theme_comment($comment, $links = 0) {
$output .= "<div class=\"comment\">";
$output .= "<div class=\"subject\">$comment->subject". ($comment->new ? " ". theme("theme_mark") : "") ."</div>";
$output .= "<div class=\"subject\">$comment->subject". ($comment->new ? " ". theme("mark") : "") ."</div>";
$output .= "<div class=\"moderation\">". $comment->moderation ."</div>";
$output .= "<div class=\"credit\">". t("by %a on %b", array("%a" => format_name($comment), "%b" => format_date($comment->timestamp))) ."</div>";
$output .= "<div class=\"body\">". check_output($comment->comment) ."</div>";
@ -1371,21 +1371,21 @@ function comment($comment, $links = 0) {
print $output;
}
function comment_folded($comment) {
function theme_comment_folded($comment) {
print "<div class=\"comment-folded\"><span class=\"subject\">". l($comment->subject, comment_referer_load() ."/$comment->cid#$comment->cid") ."</span> <span class=\"credit\">". t("by") ." ". format_name($comment) ."</span></div>";
}
function comment_flat_collapsed($comment, $threshold) {
function theme_comment_flat_collapsed($comment, $threshold) {
if (comment_visible($comment, $threshold)) {
print comment_view($comment, "", 0);
}
}
function comment_flat_expanded($comment, $threshold) {
function theme_comment_flat_expanded($comment, $threshold) {
comment_view($comment, comment_links($comment, 0), comment_visible($comment, $threshold));
}
function comment_thread_min($comment, $threshold, $pid = 0) {
function theme_comment_thread_min($comment, $threshold, $pid = 0) {
if (comment_visible($comment, $threshold)) {
print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td width=\"". ($comment->depth * 25) ."\"><br /></td><td>\n";
print comment_view($comment, "", 0);
@ -1394,7 +1394,7 @@ function comment_thread_min($comment, $threshold, $pid = 0) {
}
}
function comment_thread_max($comment, $threshold, $level = 0) {
function theme_comment_thread_max($comment, $threshold, $level = 0) {
/*
** We had quite a few browser specific issues: expanded comments below
** the top level got truncated on the right hand side. A range of
@ -1415,7 +1415,7 @@ function comment_thread_max($comment, $threshold, $level = 0) {
}
}
function comment_post_forbidden() {
function theme_comment_post_forbidden() {
global $user;
if ($user->uid) {
return t("You can't post comments.");

View File

@ -242,17 +242,17 @@ function comment_reply($pid, $nid) {
*/
if (node_comment_mode($nid) != 2) {
theme("box", t("Reply"), t("This discussion is closed: you can't post new comments."));
print theme("box", t("Reply"), t("This discussion is closed: you can't post new comments."));
}
else if (user_access("post comments")) {
theme("box", t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid)));
print theme("box", t("Reply"), comment_form(array("pid" => $pid, "nid" => $nid)));
}
else {
theme("box", t("Reply"), t("You are not authorized to post comments."));
print theme("box", t("Reply"), t("You are not authorized to post comments."));
}
}
else {
theme("box", t("Reply"), t("You are not authorized to view comments."));
print theme("box", t("Reply"), t("You are not authorized to view comments."));
}
}
@ -277,7 +277,7 @@ function comment_preview($edit) {
comment_view($comment, t("reply to this comment"));
theme("box", t("Reply"), comment_form($edit));
print theme("box", t("Reply"), comment_form($edit));
if ($edit["pid"]) {
$comment = db_fetch_object(db_query("SELECT c.*, u.uid, u.name, u.data FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.cid = %d AND c.status = 0", $edit["pid"]));
@ -528,7 +528,7 @@ function comment_links($comment, $return = 1) {
}
}
if ($moderation = comment_moderation_form($comment)) {
if ($moderation = theme("comment_moderation_form", $comment)) {
$links[] = $moderation;
}
@ -550,10 +550,10 @@ function comment_view($comment, $links = "", $visible = 1) {
if ($visible) {
$comment->comment = check_output($comment->comment);
theme("comment", $comment, $links);
print theme("comment", $comment, $links);
}
else {
theme("comment_folded", $comment);
print theme("comment_folded", $comment);
}
}
@ -722,7 +722,7 @@ function comment_render($node, $cid = 0) {
if (db_num_rows($result) && (variable_get("comment_controls", 0) == 0 || variable_get("comment_controls", 0) == 2)) {
print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
print theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
print form_hidden("nid", $nid);
print "</div></form>";
}
@ -734,16 +734,16 @@ function comment_render($node, $cid = 0) {
$comment->depth = count(explode(".", $comment->thread)) - 1;
if ($mode == 1) {
theme("comment_flat_collapsed", $comment, $threshold_min);
print theme("comment_flat_collapsed", $comment, $threshold_min);
}
else if ($mode == 2) {
theme("comment_flat_expanded", $comment, $threshold_min);
print theme("comment_flat_expanded", $comment, $threshold_min);
}
else if ($mode == 3) {
theme("comment_thread_min", $comment, $threshold_min);
print theme("comment_thread_min", $comment, $threshold_min);
}
else if ($mode == 4) {
theme("comment_thread_max", $comment, $threshold_min);
print theme("comment_thread_max", $comment, $threshold_min);
}
}
@ -763,7 +763,7 @@ function comment_render($node, $cid = 0) {
if (db_num_rows($result) && (variable_get("comment_controls", 0) == 1 || variable_get("comment_controls", 0) == 2)) {
print "<form method=\"post\" action=\"". url("comment") ."\"><div>\n";
theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
print theme("comment_controls", $threshold, $mode, $order, $comments_per_page);
print form_hidden("nid", $nid);
print "</div></form>";
}
@ -774,7 +774,7 @@ function comment_render($node, $cid = 0) {
*/
if (user_access("post comments") && node_comment_mode($nid) == 2 && variable_get("comment_form_location", 0)) {
theme("box", t("Post new comment"), comment_form(array("nid" => $nid)));
print theme("box", t("Post new comment"), comment_form(array("nid" => $nid)));
}
/*
@ -874,9 +874,9 @@ function comment_page() {
switch ($op) {
case "edit":
theme("header");
print theme("header");
comment_edit(check_query(arg(2)));
theme("footer");
print theme("footer");
break;
case t("Moderate comments"):
case t("Moderate comment"):
@ -884,21 +884,21 @@ function comment_page() {
drupal_goto(url(comment_referer_load()));
break;
case "reply":
theme("header");
print theme("header");
comment_reply(check_query(arg(3)), check_query(arg(2)));
theme("footer");
print theme("footer");
break;
case t("Preview comment"):
theme("header");
print theme("header");
comment_preview($edit);
theme("footer");
print theme("footer");
break;
case t("Post comment"):
list($error_title, $error_body) = comment_post($edit);
if ($error_body) {
theme("header");
theme("box", $error_title, $error_body);
theme("footer");
print theme("header");
print theme("box", $error_title, $error_body);
print theme("footer");
}
else {
drupal_goto(url(comment_referer_load()));
@ -1005,7 +1005,7 @@ function comment_admin_overview($status = 0) {
$result = pager_query($sql, 50);
while ($comment = db_fetch_object($result)) {
$rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme_mark() : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
$rows[] = array(l($comment->subject, "node/view/$comment->nid/$comment->cid#$comment->cid", array("title" => htmlspecialchars(substr($comment->comment, 0, 128)))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : ""), format_name($comment), ($comment->status == 0 ? t("published") : t("not published")) ."</td><td>". format_date($comment->timestamp, "small") ."</td><td>". l(t("edit comment"), "admin/comment/edit/$comment->cid"), l(t("delete comment"), "admin/comment/delete/$comment->cid"));
}
if ($pager = pager_display(NULL, 50, 0, "admin", tablesort_pager())) {
@ -1264,7 +1264,7 @@ function comment_admin() {
** overridden by themes.
*/
function comment_mode_form($mode) {
function theme_comment_mode_form($mode) {
$modes = _comment_get_modes();
foreach ($modes as $key => $value) {
@ -1274,7 +1274,7 @@ function comment_mode_form($mode) {
return "<select name=\"mode\">$options</select>\n";
}
function comment_order_form($order) {
function theme_comment_order_form($order) {
$orders = _comment_get_orders();
foreach ($orders as $key=>$value) {
@ -1284,14 +1284,14 @@ function comment_order_form($order) {
return "<select name=\"order\">$options</select>\n";
}
function comment_per_page_form($comments_per_page) {
function theme_comment_per_page_form($comments_per_page) {
for ($i = 10; $i < 100; $i = $i + 20) {
$options .= " <option value=\"$i\"". ($comments_per_page == $i ? " selected=\"selected\"" : "") .">". t("%a comments per page", array("%a" => $i)) ."</option>";
}
return "<select name=\"comments_per_page\">$options</select>\n";
}
function comment_threshold($threshold) {
function theme_comment_threshold($threshold) {
$result = db_query("SELECT fid, filter FROM {moderation_filters} ");
$options .= " <option value=\"0\">". t("-- threshold --") ."</option>";
while ($filter = db_fetch_object($result)) {
@ -1302,14 +1302,14 @@ function comment_threshold($threshold) {
}
}
function comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_page = 50) {
function theme_comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_page = 50) {
static $output;
if (!$output) {
$output .= comment_mode_form($mode);
$output .= comment_order_form($order);
$output .= comment_per_page_form($comments_per_page);
$output .= comment_threshold($threshold);
$output .= theme("comment_mode_form", $mode);
$output .= theme("comment_order_form", $order);
$output .= theme("comment_per_page_form", $comments_per_page);
$output .= theme("comment_threshold", $threshold);
$output .= " ". form_submit(t("Save settings"));
@ -1319,7 +1319,7 @@ function comment_controls($threshold = 1, $mode = 3, $order = 1, $comments_per_p
return theme("box", t("Comment viewing options"), $output);
}
function comment_moderation_form($comment) {
function theme_comment_moderation_form($comment) {
global $comment_votes, $user, $node;
static $votes;
@ -1360,9 +1360,9 @@ function comment_moderation_form($comment) {
return $output;
}
function comment($comment, $links = 0) {
function theme_comment($comment, $links = 0) {
$output .= "<div class=\"comment\">";
$output .= "<div class=\"subject\">$comment->subject". ($comment->new ? " ". theme("theme_mark") : "") ."</div>";
$output .= "<div class=\"subject\">$comment->subject". ($comment->new ? " ". theme("mark") : "") ."</div>";
$output .= "<div class=\"moderation\">". $comment->moderation ."</div>";
$output .= "<div class=\"credit\">". t("by %a on %b", array("%a" => format_name($comment), "%b" => format_date($comment->timestamp))) ."</div>";
$output .= "<div class=\"body\">". check_output($comment->comment) ."</div>";
@ -1371,21 +1371,21 @@ function comment($comment, $links = 0) {
print $output;
}
function comment_folded($comment) {
function theme_comment_folded($comment) {
print "<div class=\"comment-folded\"><span class=\"subject\">". l($comment->subject, comment_referer_load() ."/$comment->cid#$comment->cid") ."</span> <span class=\"credit\">". t("by") ." ". format_name($comment) ."</span></div>";
}
function comment_flat_collapsed($comment, $threshold) {
function theme_comment_flat_collapsed($comment, $threshold) {
if (comment_visible($comment, $threshold)) {
print comment_view($comment, "", 0);
}
}
function comment_flat_expanded($comment, $threshold) {
function theme_comment_flat_expanded($comment, $threshold) {
comment_view($comment, comment_links($comment, 0), comment_visible($comment, $threshold));
}
function comment_thread_min($comment, $threshold, $pid = 0) {
function theme_comment_thread_min($comment, $threshold, $pid = 0) {
if (comment_visible($comment, $threshold)) {
print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\"><tr><td width=\"". ($comment->depth * 25) ."\"><br /></td><td>\n";
print comment_view($comment, "", 0);
@ -1394,7 +1394,7 @@ function comment_thread_min($comment, $threshold, $pid = 0) {
}
}
function comment_thread_max($comment, $threshold, $level = 0) {
function theme_comment_thread_max($comment, $threshold, $level = 0) {
/*
** We had quite a few browser specific issues: expanded comments below
** the top level got truncated on the right hand side. A range of
@ -1415,7 +1415,7 @@ function comment_thread_max($comment, $threshold, $level = 0) {
}
}
function comment_post_forbidden() {
function theme_comment_post_forbidden() {
global $user;
if ($user->uid) {
return t("You can't post comments.");

View File

@ -157,9 +157,9 @@ function drupal_auth($username, $password, $server) {
function drupal_page() {
theme("header");
theme("box", "Drupal", drupal_help("user/help#drupal"));
theme("footer");
print theme("header");
print theme("box", "Drupal", drupal_help("user/help#drupal"));
print theme("footer");
}
function drupal_login($arguments) {

View File

@ -157,9 +157,9 @@ function drupal_auth($username, $password, $server) {
function drupal_page() {
theme("header");
theme("box", "Drupal", drupal_help("user/help#drupal"));
theme("footer");
print theme("header");
print theme("box", "Drupal", drupal_help("user/help#drupal"));
print theme("footer");
}
function drupal_login($arguments) {

View File

@ -149,12 +149,12 @@ function forum_view($node, $main = 0) {
$breadcrumb[] = l(t("Forums"), "forum");
$breadcrumb[] = l($term_data->name, "forum/$term_data->tid");
// print the breadcrumb
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
}
// prepair the node content
$node = forum_content($node);
// print the node
theme("node", $node, $main);
print theme("node", $node, $main);
}
function forum_validate(&$node) {
@ -434,28 +434,44 @@ function forum_page() {
$topics = forum_get_topics($tid, $sortby, $forum_per_page);
}
theme("forum_theme_display", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset);
print theme("forum_display", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset);
}
else {
$message = t("Warning");
theme("header", $message);
theme("box", $message, _forum_message_taxonomy());
theme("footer");
print theme("header", $message);
print theme("box", $message, _forum_message_taxonomy());
print theme("footer");
}
}
else {
$message = t("Access denied");
theme("header", $message);
theme("box", $message, message_access());
theme("footer");
print theme("header", $message);
print theme("box", $message, message_access());
print theme("footer");
}
}
/*
** Theme functions
*/
/**
@addtogroup theme_system
function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset) {
Forum module specific theme functions.
@{
**/
/**
Controls the output of the forum body.
@param forums
@param topics
@param parents
@param tid
@param sortby
@param forum_per_page
@param offset
@return string the output for the forum body.
**/
function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset) {
// forum list, topics list, topic browser and "add new topic" link
$title = t("Forums");
@ -480,10 +496,10 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p
if (count($forums) || count($parents)) {
$output = "<div id=\"forum\">";
$output .= theme("forum_theme_list", $forums, $parents, $tid);
$output .= theme("forum_list", $forums, $parents, $tid);
if ($tid && !in_array($tid, variable_get("forum_containers", array()))) {
$output .= theme("forum_theme_topic_list", $tid, $topics, $sortby, $forum_per_page, $offset);
$output .= theme("forum_topic_list", $tid, $topics, $sortby, $forum_per_page, $offset);
}
$output .= "</div>";
}
@ -492,13 +508,22 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p
$output = '';
}
theme("header", $title);
theme("breadcrumb", $breadcrumb);
theme("box", $title, $output);
theme("footer");
print theme("header", $title);
print theme("breadcrumb", $breadcrumb);
print theme("box", $title, $output);
print theme("footer");
}
function forum_theme_list($forums, $parents, $tid) {
/**
Outputs the forum listing.
@param forums
@param parents
@param tid
@return string the output for the forum listing.
**/
function theme_forum_list($forums, $parents, $tid) {
global $user;
if ($forums) {
@ -552,8 +577,18 @@ function forum_theme_list($forums, $parents, $tid) {
return table($header, $rows);
}
/**
Outputs the topic listing.
function forum_theme_topic_list($tid, $topics, $sortby, $forum_per_page, $offset) {
@param tid
@param topics
@param sortby
@param forum_per_page
@param offset
@return string the output for the topic list.
**/
function theme_forum_topic_list($tid, $topics, $sortby, $forum_per_page, $offset) {
global $id, $status, $user, $pager_total, $forum_topic_list_header;
if ($topics) {
@ -593,6 +628,8 @@ function forum_theme_topic_list($tid, $topics, $sortby, $forum_per_page, $offset
return $output;
}
/** @} End of addtogroup theme_system **/
function _forum_icon($new_posts, $num_posts = 0, $comment_mode = 0) {
$base_path = variable_get("forum_icon_path", "");

View File

@ -149,12 +149,12 @@ function forum_view($node, $main = 0) {
$breadcrumb[] = l(t("Forums"), "forum");
$breadcrumb[] = l($term_data->name, "forum/$term_data->tid");
// print the breadcrumb
theme("breadcrumb", $breadcrumb);
print theme("breadcrumb", $breadcrumb);
}
// prepair the node content
$node = forum_content($node);
// print the node
theme("node", $node, $main);
print theme("node", $node, $main);
}
function forum_validate(&$node) {
@ -434,28 +434,44 @@ function forum_page() {
$topics = forum_get_topics($tid, $sortby, $forum_per_page);
}
theme("forum_theme_display", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset);
print theme("forum_display", $forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset);
}
else {
$message = t("Warning");
theme("header", $message);
theme("box", $message, _forum_message_taxonomy());
theme("footer");
print theme("header", $message);
print theme("box", $message, _forum_message_taxonomy());
print theme("footer");
}
}
else {
$message = t("Access denied");
theme("header", $message);
theme("box", $message, message_access());
theme("footer");
print theme("header", $message);
print theme("box", $message, message_access());
print theme("footer");
}
}
/*
** Theme functions
*/
/**
@addtogroup theme_system
function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset) {
Forum module specific theme functions.
@{
**/
/**
Controls the output of the forum body.
@param forums
@param topics
@param parents
@param tid
@param sortby
@param forum_per_page
@param offset
@return string the output for the forum body.
**/
function theme_forum_display($forums, $topics, $parents, $tid, $sortby, $forum_per_page, $offset) {
// forum list, topics list, topic browser and "add new topic" link
$title = t("Forums");
@ -480,10 +496,10 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p
if (count($forums) || count($parents)) {
$output = "<div id=\"forum\">";
$output .= theme("forum_theme_list", $forums, $parents, $tid);
$output .= theme("forum_list", $forums, $parents, $tid);
if ($tid && !in_array($tid, variable_get("forum_containers", array()))) {
$output .= theme("forum_theme_topic_list", $tid, $topics, $sortby, $forum_per_page, $offset);
$output .= theme("forum_topic_list", $tid, $topics, $sortby, $forum_per_page, $offset);
}
$output .= "</div>";
}
@ -492,13 +508,22 @@ function forum_theme_display($forums, $topics, $parents, $tid, $sortby, $forum_p
$output = '';
}
theme("header", $title);
theme("breadcrumb", $breadcrumb);
theme("box", $title, $output);
theme("footer");
print theme("header", $title);
print theme("breadcrumb", $breadcrumb);
print theme("box", $title, $output);
print theme("footer");
}
function forum_theme_list($forums, $parents, $tid) {
/**
Outputs the forum listing.
@param forums
@param parents
@param tid
@return string the output for the forum listing.
**/
function theme_forum_list($forums, $parents, $tid) {
global $user;
if ($forums) {
@ -552,8 +577,18 @@ function forum_theme_list($forums, $parents, $tid) {
return table($header, $rows);
}
/**
Outputs the topic listing.
function forum_theme_topic_list($tid, $topics, $sortby, $forum_per_page, $offset) {
@param tid
@param topics
@param sortby
@param forum_per_page
@param offset
@return string the output for the topic list.
**/
function theme_forum_topic_list($tid, $topics, $sortby, $forum_per_page, $offset) {
global $id, $status, $user, $pager_total, $forum_topic_list_header;
if ($topics) {
@ -593,6 +628,8 @@ function forum_theme_topic_list($tid, $topics, $sortby, $forum_per_page, $offset
return $output;
}
/** @} End of addtogroup theme_system **/
function _forum_icon($new_posts, $num_posts = 0, $comment_mode = 0) {
$base_path = variable_get("forum_icon_path", "");

View File

@ -124,7 +124,7 @@ function import_update() {
}
}
function import_theme_format_item($item, $feed = 0) {
function theme_import_format_item($item, $feed = 0) {
global $user;
if ($user->uid && module_exist("blog") && user_access("maintain personal blog")) {
@ -148,7 +148,7 @@ function import_bundle_block($attributes) {
$items = array();
while ($item = db_fetch_object($result)) {
$items[] = theme("import_theme_format_item", $item);
$items[] = theme("import_format_item", $item);
}
$output = "<div class=\"import-block\"><div class=\"bundle\">";
@ -163,11 +163,11 @@ function import_feed_block($feed) {
$items = array();
while ($item = db_fetch_object($result)) {
$items[] = theme("import_theme_format_item", $item);
$items[] = theme("import_format_item", $item);
}
$output = "<div class=\"import-block\"><div class=\"feed\">";
$output .= theme("theme_item_list", $items);
$output .= theme("item_list", $items);
$output .= "</div></div>";
return $output;
@ -656,10 +656,10 @@ function import_page_last() {
}
$output .= "</table>\n";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", t("Latest news"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", t("Latest news"), $output);
print theme("footer");
}
function import_page_feed($fid) {
@ -691,11 +691,11 @@ function import_page_feed($fid) {
}
$output .= "</table>\n";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", $feed->title, $header);
theme("box", t("Latest news"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", $feed->title, $header);
print theme("box", t("Latest news"), $output);
print theme("footer");
}
function import_page_bundle($bid) {
@ -730,11 +730,11 @@ function import_page_bundle($bid) {
}
$output .= "</table>\n";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", $bundle->title, $header);
theme("box", t("Latest news"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", $bundle->title, $header);
print theme("box", t("Latest news"), $output);
print theme("footer");
}
@ -750,10 +750,10 @@ function import_page_sources() {
$output .= "<div style=\"xml-icon\">". l("<img src=\"". theme("image", "xml.gif") ."\" width=\"36\" height=\"14\" style=\"border: 0px;\" />", "import/fd", array("title" => t("View the list of syndicated web sites in XML format."))) ."</div><br />";
theme("header");
theme("box", t("News feeds"), import_page_info());
theme("box", t("News sources"), $output);
theme("footer");
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print theme("box", t("News sources"), $output);
print theme("footer");
}
function import_page_fd() {
@ -788,8 +788,8 @@ function import_page_feeds() {
function import_page_blocks($blocks) {
theme("header");
theme("box", t("News feeds"), import_page_info());
print theme("header");
print theme("box", t("News feeds"), import_page_info());
print "<table cellpadding=\"0\" cellspacing=\"5\" border=\"0\" style=\"width: 100%;\">\n";
print " <tr>\n";
@ -797,7 +797,7 @@ function import_page_blocks($blocks) {
$i = 1;
print " <td style=\"vertical-align: top; width: 33%;\">\n";
while ($block = each($blocks)) {
theme("box", $block["value"]["subject"], $block["value"]["content"]);
print theme("box", $block["value"]["subject"], $block["value"]["content"]);
if ($i == ceil(count($blocks) / 3)) {
break;
}
@ -808,7 +808,7 @@ function import_page_blocks($blocks) {
print " </tr>\n";
print "</table>\n";
theme("footer");
print theme("footer");
}
function import_page() {

View File

@ -162,9 +162,9 @@ function jabber_auth($username, $password, $server) {
function jabber_page() {
theme("header");
theme("box", "Jabber", jabber_help("user/help#jabber"));
theme("footer");
print theme("header");
print theme("box", "Jabber", jabber_help("user/help#jabber"));
print theme("footer");
}
function jabber_user($type, $edit, $user) {

View File

@ -73,11 +73,11 @@ function node_title_list($result, $title = NULL) {
$items[] = l($node->title, "node/view/$node->nid", array("title" => format_plural($number, "%count comment", "%count comments")));
}
return theme("theme_node_list", $items, $title);
return theme("node_list", $items, $title);
}
function theme_node_list($items, $title = NULL) {
return theme("theme_item_list", $items, $title);
return theme("item_list", $items, $title);
}
// Update the 'last viewed' timestamp of the specified node for current user.
@ -407,7 +407,7 @@ function node_view($node, $main = 0) {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
theme("node", $node, $main);
print theme("node", $node, $main);
}
}
@ -991,7 +991,7 @@ function node_validate($node, &$error) {
if (isset($node->title)) {
$node->title = strip_tags($node->title);
if (!$node->title) {
$error["title"] = theme("theme_error", t("You have to specify a valid title."));
$error["title"] = theme("error", t("You have to specify a valid title."));
}
}
@ -1041,7 +1041,7 @@ function node_validate($node, &$error) {
$node->uid = $account->uid;
}
else {
$error["name"] = theme("theme_error", t("The name '%u' does not exist.", array ("%u" => $node->name)));
$error["name"] = theme("error", t("The name '%u' does not exist.", array ("%u" => $node->name)));
}
/*
@ -1052,7 +1052,7 @@ function node_validate($node, &$error) {
$node->created = strtotime($node->date);
}
else {
$error["date"] = theme("theme_error", t("You have to specifiy a valid date."));
$error["date"] = theme("error", t("You have to specifiy a valid date."));
}
}
else {
@ -1482,29 +1482,29 @@ function node_page() {
$node = node_load(array("nid" => arg(2), "status" => 1), $_GET["revision"]);
}
theme("header", $node->title);
print theme("header", $node->title);
$name = module_invoke(arg(2), "node", "name");
switch ($op) {
case "add":
theme("box", t("Submit %name", array("%name" => $name)), node_add(arg(2)));
print theme("box", t("Submit %name", array("%name" => $name)), node_add(arg(2)));
break;
case "edit":
theme("box", t("Edit %name", array("%name" => $name)), node_edit(arg(2)));
print theme("box", t("Edit %name", array("%name" => $name)), node_edit(arg(2)));
break;
case "view":
print node_show($node, arg(3));
break;
case t("Preview"):
$edit = node_validate($edit, $error);
theme("box", t("Preview %name", array("%name" => $name)), node_preview($edit, $error));
print theme("box", t("Preview %name", array("%name" => $name)), node_preview($edit, $error));
break;
case t("Submit"):
theme("box", t("Submit %name", array("%name" => $name)), node_submit($edit));
print theme("box", t("Submit %name", array("%name" => $name)), node_submit($edit));
break;
case t("Delete"):
theme("box", t("Delete %name", array("%name" => $name)), node_delete($edit));
print theme("box", t("Delete %name", array("%name" => $name)), node_delete($edit));
break;
default:
$result = pager_query("SELECT nid, type FROM {node} WHERE promote = '1' AND status = '1' ORDER BY static DESC, created DESC", variable_get("default_nodes_main", 10));
@ -1515,12 +1515,12 @@ function node_page() {
print pager_display(NULL, variable_get("default_nodes_main", 10));
}
theme("footer");
print theme("footer");
}
else {
theme("header");
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}

View File

@ -73,11 +73,11 @@ function node_title_list($result, $title = NULL) {
$items[] = l($node->title, "node/view/$node->nid", array("title" => format_plural($number, "%count comment", "%count comments")));
}
return theme("theme_node_list", $items, $title);
return theme("node_list", $items, $title);
}
function theme_node_list($items, $title = NULL) {
return theme("theme_item_list", $items, $title);
return theme("item_list", $items, $title);
}
// Update the 'last viewed' timestamp of the specified node for current user.
@ -407,7 +407,7 @@ function node_view($node, $main = 0) {
$node->teaser = check_output($node->teaser);
$node->body = check_output($node->body);
theme("node", $node, $main);
print theme("node", $node, $main);
}
}
@ -991,7 +991,7 @@ function node_validate($node, &$error) {
if (isset($node->title)) {
$node->title = strip_tags($node->title);
if (!$node->title) {
$error["title"] = theme("theme_error", t("You have to specify a valid title."));
$error["title"] = theme("error", t("You have to specify a valid title."));
}
}
@ -1041,7 +1041,7 @@ function node_validate($node, &$error) {
$node->uid = $account->uid;
}
else {
$error["name"] = theme("theme_error", t("The name '%u' does not exist.", array ("%u" => $node->name)));
$error["name"] = theme("error", t("The name '%u' does not exist.", array ("%u" => $node->name)));
}
/*
@ -1052,7 +1052,7 @@ function node_validate($node, &$error) {
$node->created = strtotime($node->date);
}
else {
$error["date"] = theme("theme_error", t("You have to specifiy a valid date."));
$error["date"] = theme("error", t("You have to specifiy a valid date."));
}
}
else {
@ -1482,29 +1482,29 @@ function node_page() {
$node = node_load(array("nid" => arg(2), "status" => 1), $_GET["revision"]);
}
theme("header", $node->title);
print theme("header", $node->title);
$name = module_invoke(arg(2), "node", "name");
switch ($op) {
case "add":
theme("box", t("Submit %name", array("%name" => $name)), node_add(arg(2)));
print theme("box", t("Submit %name", array("%name" => $name)), node_add(arg(2)));
break;
case "edit":
theme("box", t("Edit %name", array("%name" => $name)), node_edit(arg(2)));
print theme("box", t("Edit %name", array("%name" => $name)), node_edit(arg(2)));
break;
case "view":
print node_show($node, arg(3));
break;
case t("Preview"):
$edit = node_validate($edit, $error);
theme("box", t("Preview %name", array("%name" => $name)), node_preview($edit, $error));
print theme("box", t("Preview %name", array("%name" => $name)), node_preview($edit, $error));
break;
case t("Submit"):
theme("box", t("Submit %name", array("%name" => $name)), node_submit($edit));
print theme("box", t("Submit %name", array("%name" => $name)), node_submit($edit));
break;
case t("Delete"):
theme("box", t("Delete %name", array("%name" => $name)), node_delete($edit));
print theme("box", t("Delete %name", array("%name" => $name)), node_delete($edit));
break;
default:
$result = pager_query("SELECT nid, type FROM {node} WHERE promote = '1' AND status = '1' ORDER BY static DESC, created DESC", variable_get("default_nodes_main", 10));
@ -1515,12 +1515,12 @@ function node_page() {
print pager_display(NULL, variable_get("default_nodes_main", 10));
}
theme("footer");
print theme("footer");
}
else {
theme("header");
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}

View File

@ -121,7 +121,7 @@ function page_view($node, $main) {
// prepair the node content
$node = page_content($node);
// print the node
theme("node", $node, $main);
print theme("node", $node, $main);
}
function page_form(&$node, &$help, &$error) {

View File

@ -121,7 +121,7 @@ function page_view($node, $main) {
// prepair the node content
$node = page_content($node);
// print the node
theme("node", $node, $main);
print theme("node", $node, $main);
}
function page_form(&$node, &$help, &$error) {

View File

@ -84,7 +84,7 @@ function path_form($edit = "", $error = "") {
if ($error) {
foreach ($error as $message) {
$form .= theme("theme_error", $message);
$form .= theme("error", $message);
}
}

View File

@ -84,7 +84,7 @@ function path_form($edit = "", $error = "") {
if ($error) {
foreach ($error as $message) {
$form .= theme("theme_error", $message);
$form .= theme("error", $message);
}
}

View File

@ -87,12 +87,12 @@ function poll_validate(&$node) {
}
if ($node->chvotes[$i] < 0) {
$error["chvotes][$i"] = theme("theme_error", t("Negative values are not allowed."));
$error["chvotes][$i"] = theme("error", t("Negative values are not allowed."));
}
}
if ($actualchoices < 2) {
$error["choice][0"] = theme("theme_error", t("You must fill in at least two choices."));
$error["choice][0"] = theme("error", t("You must fill in at least two choices."));
}
}
@ -247,15 +247,15 @@ function poll_node($field) {
function poll_page() {
theme("header");
print theme("header");
$result = db_query("SELECT n.nid, n.title, p.active, SUM(c.chvotes) AS votes FROM {node} n INNER JOIN {poll} p ON n.nid=p.nid INNER JOIN {poll_choices} c ON n.nid=c.nid WHERE type = 'poll' AND status = '1' AND moderate = '0' GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC");
$output = "<ul>";
while ($node = db_fetch_object($result)) {
$output .= "<li>".l($node->title, "node/view/$node->nid") ." - ". format_plural($node->votes, "1 vote", "%count votes") ." - ". ($node->active ? t("open") : t("closed")) ."</li>";
}
$output .= "</ul>";
theme("box", t("Polls"), $output);
theme("footer");
print theme("box", t("Polls"), $output);
print theme("footer");
}
function poll_perm() {
@ -383,7 +383,7 @@ function poll_view(&$node, $main = 0, $block = 0) {
// We also use poll_view() for the side-block
if (!$block) {
theme("node", $node, $main);
print theme("node", $node, $main);
}
}

View File

@ -87,12 +87,12 @@ function poll_validate(&$node) {
}
if ($node->chvotes[$i] < 0) {
$error["chvotes][$i"] = theme("theme_error", t("Negative values are not allowed."));
$error["chvotes][$i"] = theme("error", t("Negative values are not allowed."));
}
}
if ($actualchoices < 2) {
$error["choice][0"] = theme("theme_error", t("You must fill in at least two choices."));
$error["choice][0"] = theme("error", t("You must fill in at least two choices."));
}
}
@ -247,15 +247,15 @@ function poll_node($field) {
function poll_page() {
theme("header");
print theme("header");
$result = db_query("SELECT n.nid, n.title, p.active, SUM(c.chvotes) AS votes FROM {node} n INNER JOIN {poll} p ON n.nid=p.nid INNER JOIN {poll_choices} c ON n.nid=c.nid WHERE type = 'poll' AND status = '1' AND moderate = '0' GROUP BY n.nid, n.title, p.active, n.created ORDER BY n.created DESC");
$output = "<ul>";
while ($node = db_fetch_object($result)) {
$output .= "<li>".l($node->title, "node/view/$node->nid") ." - ". format_plural($node->votes, "1 vote", "%count votes") ." - ". ($node->active ? t("open") : t("closed")) ."</li>";
}
$output .= "</ul>";
theme("box", t("Polls"), $output);
theme("footer");
print theme("box", t("Polls"), $output);
print theme("footer");
}
function poll_perm() {
@ -383,7 +383,7 @@ function poll_view(&$node, $main = 0, $block = 0) {
// We also use poll_view() for the side-block
if (!$block) {
theme("node", $node, $main);
print theme("node", $node, $main);
}
}

View File

@ -111,7 +111,7 @@ function profile_user($type, $edit, &$user) {
function profile_required($title) {
// this pleads "theme, theme" ;)
return $title ." ". theme("theme_mark");
return $title ." ". theme("mark");
}
function _profile_form($edit, $mode) {

View File

@ -111,7 +111,7 @@ function profile_user($type, $edit, &$user) {
function profile_required($title) {
// this pleads "theme, theme" ;)
return $title ." ". theme("theme_mark");
return $title ." ". theme("mark");
}
function _profile_form($edit, $mode) {

View File

@ -116,9 +116,9 @@ function queue_overview() {
}
$output .= "</table>";
theme("header");
theme("box", t("Moderation queue"), $output);
theme("footer");
print theme("header");
print theme("box", t("Moderation queue"), $output);
print theme("footer");
}
function queue_view($nid) {
@ -168,15 +168,15 @@ function queue_view($nid) {
}
}
theme("header");
print theme("header");
node_view($node);
if ($output) {
theme("box", t("Moderate"), $output);
print theme("box", t("Moderate"), $output);
}
if ($node->comment && variable_get("queue_show_comments", 1)) {
module_invoke("comment", "render", $node);
}
theme("footer");
print theme("footer");
}
function queue_page() {
@ -191,9 +191,9 @@ function queue_page() {
}
}
else {
theme("header");
theme("box", t("Moderation queue"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Moderation queue"), message_access());
print theme("footer");
}
}

View File

@ -362,27 +362,27 @@ function search_view($keys) {
$form .= "<br />". $help_link;
}
theme("header", t("Search"));
print theme("header", t("Search"));
if ($form) {
theme("box", t("Search"), $form);
print theme("box", t("Search"), $form);
}
if ($keys) {
if ($output) {
theme("box", t("Search Results"), $output);
print theme("box", t("Search Results"), $output);
}
else {
theme("box", t("Search Results"), t("Your search yielded no results."));
print theme("box", t("Search Results"), t("Your search yielded no results."));
}
}
theme("footer");
print theme("footer");
}
else {
theme("header", t("Access denied"));
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header", t("Access denied"));
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}
@ -392,9 +392,9 @@ function search_page() {
switch (arg(1)) {
case "help":
theme("header");
theme("box", t("Search Help"), search_help());
theme("footer");
print theme("header");
print theme("box", t("Search Help"), search_help());
print theme("footer");
break;
default:
search_view($keys);

View File

@ -362,27 +362,27 @@ function search_view($keys) {
$form .= "<br />". $help_link;
}
theme("header", t("Search"));
print theme("header", t("Search"));
if ($form) {
theme("box", t("Search"), $form);
print theme("box", t("Search"), $form);
}
if ($keys) {
if ($output) {
theme("box", t("Search Results"), $output);
print theme("box", t("Search Results"), $output);
}
else {
theme("box", t("Search Results"), t("Your search yielded no results."));
print theme("box", t("Search Results"), t("Your search yielded no results."));
}
}
theme("footer");
print theme("footer");
}
else {
theme("header", t("Access denied"));
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header", t("Access denied"));
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}
@ -392,9 +392,9 @@ function search_page() {
switch (arg(1)) {
case "help":
theme("header");
theme("box", t("Search Help"), search_help());
theme("footer");
print theme("header");
print theme("box", t("Search Help"), search_help());
print theme("footer");
break;
default:
search_view($keys);

View File

@ -692,7 +692,7 @@ function statistics_display_online_block() {
if ($items) {
$output .= "<br /><br />";
$output .= theme("theme_item_list", $items, variable_get("statistics_block_online_subtitle", "Online users:"));
$output .= theme("item_list", $items, variable_get("statistics_block_online_subtitle", "Online users:"));
}
}
}
@ -758,14 +758,14 @@ function statistics_page() {
if (user_access("access content")) {
theme("header");
print theme("header");
statistics_page_user();
theme("footer");
print theme("footer");
}
else {
theme("header");
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}
@ -782,7 +782,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) {
$output .= statistics_summary("daycount", $displaycount);
$output .= "</table>";
theme("box", t(variable_get("statistics_userpage_day_head", "")), $output, "main");
print theme("box", t(variable_get("statistics_userpage_day_head", "")), $output, "main");
}
@ -791,7 +791,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) {
$output .= statistics_summary("totalcount", $displaycount);
$output .= "</table>";
theme("box", t(variable_get("statistics_userpage_all_head", "")), $output, "main");
print theme("box", t(variable_get("statistics_userpage_all_head", "")), $output, "main");
}
if ($displaycount = variable_get("statistics_userpage_last_cnt", "10")) {
@ -799,7 +799,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) {
$output .= statistics_summary("timestamp", $displaycount);
$output .= "</table>";
theme("box", t(variable_get("statistics_userpage_last_head", "")), $output, "main");
print theme("box", t(variable_get("statistics_userpage_last_head", "")), $output, "main");
}
}

View File

@ -692,7 +692,7 @@ function statistics_display_online_block() {
if ($items) {
$output .= "<br /><br />";
$output .= theme("theme_item_list", $items, variable_get("statistics_block_online_subtitle", "Online users:"));
$output .= theme("item_list", $items, variable_get("statistics_block_online_subtitle", "Online users:"));
}
}
}
@ -758,14 +758,14 @@ function statistics_page() {
if (user_access("access content")) {
theme("header");
print theme("header");
statistics_page_user();
theme("footer");
print theme("footer");
}
else {
theme("header");
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}
@ -782,7 +782,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) {
$output .= statistics_summary("daycount", $displaycount);
$output .= "</table>";
theme("box", t(variable_get("statistics_userpage_day_head", "")), $output, "main");
print theme("box", t(variable_get("statistics_userpage_day_head", "")), $output, "main");
}
@ -791,7 +791,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) {
$output .= statistics_summary("totalcount", $displaycount);
$output .= "</table>";
theme("box", t(variable_get("statistics_userpage_all_head", "")), $output, "main");
print theme("box", t(variable_get("statistics_userpage_all_head", "")), $output, "main");
}
if ($displaycount = variable_get("statistics_userpage_last_cnt", "10")) {
@ -799,7 +799,7 @@ function statistics_page_user($uid = 0, $date = 0, $all = 0) {
$output .= statistics_summary("timestamp", $displaycount);
$output .= "</table>";
theme("box", t(variable_get("statistics_userpage_last_head", "")), $output, "main");
print theme("box", t(variable_get("statistics_userpage_last_head", "")), $output, "main");
}
}

View File

@ -57,7 +57,7 @@ function system_link($type) {
menu("admin/system", t("configuration"), "system_admin", 3);
menu("admin/system/themes", t("themes"), "system_admin", 2);
foreach (theme_list(1) as $theme) {
foreach (list_themes(1) as $theme) {
// NOTE: refresh the list because some themes might have been enabled/disabled.
include_once "$theme->filename";
$function = $theme->name ."_settings";
@ -81,7 +81,7 @@ function system_link($type) {
function system_user($type, &$edit, $user) {
$options = "<option value=\"\"". (("" == $key) ? " selected=\"selected\"" : "") .">". t("Default theme") ."</option>\n";
if ($type == "edit_form" && count($themes = theme_list()) > 1) {
if ($type == "edit_form" && count($themes = list_themes()) > 1) {
foreach ($themes as $key => $value) {
$options .= "<option value=\"$key\"". (($edit["theme"] == $key) ? " selected=\"selected\"" : "") .">$key - $value->description</option>\n";
}
@ -168,7 +168,7 @@ function system_view_module($name) {
}
function system_view_theme($name) {
$themes = theme_list();
$themes = list_themes();
$theme = $themes[$name];
if ($theme) {
include_once "$theme->filename";
@ -301,17 +301,10 @@ function system_listing($type, $directory, $required = array()) {
$info->description = module_invoke($file->name, "help", "admin/system/modules#description") ? module_invoke($file->name, "help", "admin/system/modules#description") : module_invoke($file->name, "system", "description");
}
elseif ($type == "theme") {
$class = "Theme_$file->name";
if (class_exists($class)) {
$theme =& new $class;
$info->name = $theme->system("name") ? $theme->system("name") : $file->name;
$info->description = $theme->system("description");
$info->name = $file->name;
$info->description = module_invoke($file->name, "help", "admin/system/themes#description");
$themes[] = $info->name;
}
else {
unset($files[$filename]);
}
}
// Update the contents of the system table:
db_query("DELETE FROM {system} WHERE filename = '%s' AND type = '%s'", $filename, $type);

View File

@ -57,7 +57,7 @@ function system_link($type) {
menu("admin/system", t("configuration"), "system_admin", 3);
menu("admin/system/themes", t("themes"), "system_admin", 2);
foreach (theme_list(1) as $theme) {
foreach (list_themes(1) as $theme) {
// NOTE: refresh the list because some themes might have been enabled/disabled.
include_once "$theme->filename";
$function = $theme->name ."_settings";
@ -81,7 +81,7 @@ function system_link($type) {
function system_user($type, &$edit, $user) {
$options = "<option value=\"\"". (("" == $key) ? " selected=\"selected\"" : "") .">". t("Default theme") ."</option>\n";
if ($type == "edit_form" && count($themes = theme_list()) > 1) {
if ($type == "edit_form" && count($themes = list_themes()) > 1) {
foreach ($themes as $key => $value) {
$options .= "<option value=\"$key\"". (($edit["theme"] == $key) ? " selected=\"selected\"" : "") .">$key - $value->description</option>\n";
}
@ -168,7 +168,7 @@ function system_view_module($name) {
}
function system_view_theme($name) {
$themes = theme_list();
$themes = list_themes();
$theme = $themes[$name];
if ($theme) {
include_once "$theme->filename";
@ -301,17 +301,10 @@ function system_listing($type, $directory, $required = array()) {
$info->description = module_invoke($file->name, "help", "admin/system/modules#description") ? module_invoke($file->name, "help", "admin/system/modules#description") : module_invoke($file->name, "system", "description");
}
elseif ($type == "theme") {
$class = "Theme_$file->name";
if (class_exists($class)) {
$theme =& new $class;
$info->name = $theme->system("name") ? $theme->system("name") : $file->name;
$info->description = $theme->system("description");
$info->name = $file->name;
$info->description = module_invoke($file->name, "help", "admin/system/themes#description");
$themes[] = $info->name;
}
else {
unset($files[$filename]);
}
}
// Update the contents of the system table:
db_query("DELETE FROM {system} WHERE filename = '%s' AND type = '%s'", $filename, $type);

View File

@ -717,9 +717,9 @@ function taxonomy_page() {
taxonomy_feed($taxonomy);
break;
default:
theme("header");
print theme("header");
taxonomy_render_nodes(taxonomy_select_nodes($taxonomy));
theme("footer");
print theme("footer");
break;
}
}

View File

@ -717,9 +717,9 @@ function taxonomy_page() {
taxonomy_feed($taxonomy);
break;
default:
theme("header");
print theme("header");
taxonomy_render_nodes(taxonomy_select_nodes($taxonomy));
theme("footer");
print theme("footer");
break;
}
}

View File

@ -32,9 +32,9 @@ function title_page() {
else if (db_num_rows($result) == 1) {
$node = db_fetch_object($result);
$node = node_load(array("nid" => $node->nid));
theme("header");
print theme("header");
print node_show($node, NULL);
theme("footer");
print theme("footer");
}
else {
$header = array(t("Type"), t("Title"), t("Author"));
@ -49,15 +49,15 @@ function title_page() {
$output .= table($header, $rows);
$output .= "</div>";
theme("header");
theme("box", t("Matching Posts"), $output);
theme("footer");
print theme("header");
print theme("box", t("Matching Posts"), $output);
print theme("footer");
}
}
else {
theme("header");
theme("box", t("Access denied"), message_access());
theme("footer");
print theme("header");
print theme("box", t("Access denied"), message_access());
print theme("footer");
}
}

View File

@ -61,12 +61,12 @@ function tracker_posts($id = 0) {
}
$type = ucfirst(module_invoke($node->type, "node", "name"));
$title = l($node->title, "node/view/$node->nid") ." ". (node_is_new($node->nid, $node->changed) ? theme("theme_mark") : "");
$title = l($node->title, "node/view/$node->nid") ." ". (node_is_new($node->nid, $node->changed) ? theme("mark") : "");
$author = format_name($node);
$comments = array();
while ($comment = db_fetch_object($cresult)) {
$comments[] = "<li>". t("%subject by %author", array("%subject" => l($comment->subject, "node/view/$node->nid#$comment->cid"), "%author" => format_name($comment))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("theme_mark") : "") ."</li>\n";
$comments[] = "<li>". t("%subject by %author", array("%subject" => l($comment->subject, "node/view/$node->nid#$comment->cid"), "%author" => format_name($comment))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : "") ."</li>\n";
}
if ($comments) {
@ -104,9 +104,9 @@ function tracker_page() {
global $user;
if (user_access("access content")) {
theme("header", t("Recent posts"));
theme("box", t("Recent posts"), tracker_posts(arg(1)));
theme("footer");
print theme("header", t("Recent posts"));
print theme("box", t("Recent posts"), tracker_posts(arg(1)));
print theme("footer");
}
}

View File

@ -61,12 +61,12 @@ function tracker_posts($id = 0) {
}
$type = ucfirst(module_invoke($node->type, "node", "name"));
$title = l($node->title, "node/view/$node->nid") ." ". (node_is_new($node->nid, $node->changed) ? theme("theme_mark") : "");
$title = l($node->title, "node/view/$node->nid") ." ". (node_is_new($node->nid, $node->changed) ? theme("mark") : "");
$author = format_name($node);
$comments = array();
while ($comment = db_fetch_object($cresult)) {
$comments[] = "<li>". t("%subject by %author", array("%subject" => l($comment->subject, "node/view/$node->nid#$comment->cid"), "%author" => format_name($comment))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("theme_mark") : "") ."</li>\n";
$comments[] = "<li>". t("%subject by %author", array("%subject" => l($comment->subject, "node/view/$node->nid#$comment->cid"), "%author" => format_name($comment))) ." ". (node_is_new($comment->nid, $comment->timestamp) ? theme("mark") : "") ."</li>\n";
}
if ($comments) {
@ -104,9 +104,9 @@ function tracker_page() {
global $user;
if (user_access("access content")) {
theme("header", t("Recent posts"));
theme("box", t("Recent posts"), tracker_posts(arg(1)));
theme("footer");
print theme("header", t("Recent posts"));
print theme("box", t("Recent posts"), tracker_posts(arg(1)));
print theme("footer");
}
}

View File

@ -447,7 +447,7 @@ function user_block($op = "list", $delta = 0) {
}
$items[] = l(t("Request new password"), "user/password", array("title" => t("Request new password via e-mail.")));
$output .= theme("theme_item_list", $items);
$output .= theme("item_list", $items);
$block["subject"] = t("User login");
$block["content"] = "<div class=\"user-login-link\">$output</div>";
@ -467,7 +467,7 @@ function user_block($op = "list", $delta = 0) {
$items[] = l((strlen($account->name) > 15 ? substr($account->name, 0, 15) . '...' : $account->name), "user/view/$account->uid");
}
$output = theme("theme_user_list", $items);
$output = theme("user_list", $items);
$block["subject"] = t("Who's new");
$block["content"] = $output;
@ -478,11 +478,11 @@ function user_block($op = "list", $delta = 0) {
}
function theme_user_list($items, $title = NULL) {
return theme("theme_item_list", $items, $title);
return theme("item_list", $items, $title);
}
function theme_menu_list($items, $title = NULL) {
return theme("theme_item_list", $items, $title);
return theme("item_list", $items, $title);
}
function user_link($type) {
@ -693,7 +693,7 @@ function user_login($edit = array(), $msg = "") {
*/
if ($error) {
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
/*
@ -726,7 +726,7 @@ function user_login($edit = array(), $msg = "") {
if (variable_get("user_register", 1)) {
$items[] = l(t("Create new account"), "user/register");
}
$output .= theme("theme_item_list", $items);
$output .= theme("item_list", $items);
return form($output, "post", url("user"));
}
@ -803,7 +803,7 @@ function user_pass($edit = array()) {
// Display error message if necessary.
if ($error) {
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
/*
@ -818,7 +818,7 @@ function user_pass($edit = array()) {
if (variable_get("user_register", 1)) {
$items[] = l(t("Create new account"), "user/register");
}
$output .= theme("theme_item_list", $items);
$output .= theme("item_list", $items);
return form($output, "post", url("user"));
}
@ -927,7 +927,7 @@ function user_register($edit = array()) {
}
else {
if ($error) {
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
}
@ -948,7 +948,7 @@ function user_register($edit = array()) {
$output .= form_submit(t("Create new account"));
$items[] = l(t("Request new password"), "user/password");
$items[] = l(t("Log in"), "user/login");
$output .= theme("theme_item_list", $items);
$output .= theme("item_list", $items);
return form($output);
}
@ -1032,7 +1032,7 @@ function user_edit($edit = array()) {
}
if ($error) {
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
if (!$edit) {
@ -1070,9 +1070,9 @@ function user_view($uid = 0) {
$output .= implode("\n", module_invoke_all("user", "view_private", "", $user));
theme("header", $user->name);
theme("box", $user->name, $output);
theme("footer");
print theme("header", $user->name);
print theme("box", $user->name, $output);
print theme("footer");
}
else if ($uid && $account = user_load(array("uid" => $uid, "status" => 1))) {
$output = form_item(t("Name"), $account->name);
@ -1083,19 +1083,19 @@ function user_view($uid = 0) {
$output .= form_item(t("Administration"), l(t("edit account"), "admin/user/edit/$account->uid"));
}
theme("header", $account->name);
theme("box", $account->name, $output);
theme("footer");
print theme("header", $account->name);
print theme("box", $account->name, $output);
print theme("footer");
}
else {
$output = user_login();
theme("header", t("User login"));
theme("box", t("User login"), $output);
print theme("header", t("User login"));
print theme("box", t("User login"), $output);
if (variable_get("user_register", 1)) {
theme("box", t("Create new user account"), user_register());
print theme("box", t("Create new user account"), user_register());
}
theme("box", t("Request new password"), user_pass());
theme("footer");
print theme("box", t("Request new password"), user_pass());
print theme("footer");
}
}
@ -1111,36 +1111,36 @@ function user_page() {
switch ($op) {
case t("E-mail new password"):
case "password":
theme("header", t("E-mail new password"));
theme("box", t("E-mail new password"), user_pass($edit));
theme("footer");
print theme("header", t("E-mail new password"));
print theme("box", t("E-mail new password"), user_pass($edit));
print theme("footer");
break;
case t("Create new account"):
case "register":
$output = user_register($edit);
theme("header", t("Create new account"));
print theme("header", t("Create new account"));
if (variable_get("user_register", 1)) {
theme("box", t("Create new account"), $output);
print theme("box", t("Create new account"), $output);
}
else {
print message_access();
}
theme("footer");
print theme("footer");
break;
case t("Log in"):
case "login":
$output = user_login($edit);
theme("header", t("Log in"));
theme("box", t("Log in"), $output);
theme("footer");
print theme("header", t("Log in"));
print theme("box", t("Log in"), $output);
print theme("footer");
break;
case t("Save user information"):
case "edit":
$output = user_edit($edit);
$GLOBALS["theme"] = theme_init();
theme("header", t("Edit user information"));
theme("box", t("Edit user information"), $output);
theme("footer");
print theme("header", t("Edit user information"));
print theme("box", t("Edit user information"), $output);
print theme("footer");
break;
case "view":
user_view(arg(2));
@ -1150,9 +1150,9 @@ function user_page() {
print user_logout();
break;
case "help":
theme("header");
theme("box", t("Distributed authentication"), user_help("user/help#user"));
theme("footer");
print theme("header");
print theme("box", t("Distributed authentication"), user_help("user/help#user"));
print theme("footer");
break;
default:
print user_view();
@ -1236,7 +1236,7 @@ function user_admin_create($edit = array()) {
else {
if ($error) {
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
$output .= form_textfield(t("Username"), "name", $edit["name"], 30, 55, t("Provide the username of the new account."));
@ -1488,7 +1488,7 @@ function user_admin_edit($edit = array()) {
$output .= status(t("user information changes have been saved."));
}
else {
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
}
else if ($op == t("Delete account")) {
@ -1499,7 +1499,7 @@ function user_admin_edit($edit = array()) {
}
else {
$error = t("Failed to delete account: the account has to be blocked first.");
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
}
@ -1761,9 +1761,9 @@ function user_help($section = "admin/help#user") {
$output .= "<p>This second half of the <i>_auth</i> function examines the <i>\$response</i> from plant.blogger.com and returns a TRUE (1) or FALSE (0) as appropriate. This is a critical decision, so be sure that you have good logic here, and perform sufficient testing for all cases. In the case of Blogger, we search for the string 'fault' in the response. If that string is present, or there is no repsonse, our function returns FALSE. Otherwise, Blogger has returned valid data to our method request and we return TRUE. Note: Everything starting with \"//\" is a comment and is not executed.</p>";
$output .= "<pre>function blogger_page() {
theme(&quot;header&quot;);
theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_help(\"user/help\"));
theme(&quot;footer&quot;);
print theme(&quot;header&quot;);
print theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_help(\"user/help\"));
print theme(&quot;footer&quot;);
}</pre>";
$output .= "<p>The _page function is not currently used, but it might be in the future. For now, just copy what you see here, substituting your module name for <i>blogger</i>.</p>";
$output .= "<pre><code>function blogger_help(\$section) {

View File

@ -447,7 +447,7 @@ function user_block($op = "list", $delta = 0) {
}
$items[] = l(t("Request new password"), "user/password", array("title" => t("Request new password via e-mail.")));
$output .= theme("theme_item_list", $items);
$output .= theme("item_list", $items);
$block["subject"] = t("User login");
$block["content"] = "<div class=\"user-login-link\">$output</div>";
@ -467,7 +467,7 @@ function user_block($op = "list", $delta = 0) {
$items[] = l((strlen($account->name) > 15 ? substr($account->name, 0, 15) . '...' : $account->name), "user/view/$account->uid");
}
$output = theme("theme_user_list", $items);
$output = theme("user_list", $items);
$block["subject"] = t("Who's new");
$block["content"] = $output;
@ -478,11 +478,11 @@ function user_block($op = "list", $delta = 0) {
}
function theme_user_list($items, $title = NULL) {
return theme("theme_item_list", $items, $title);
return theme("item_list", $items, $title);
}
function theme_menu_list($items, $title = NULL) {
return theme("theme_item_list", $items, $title);
return theme("item_list", $items, $title);
}
function user_link($type) {
@ -693,7 +693,7 @@ function user_login($edit = array(), $msg = "") {
*/
if ($error) {
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
/*
@ -726,7 +726,7 @@ function user_login($edit = array(), $msg = "") {
if (variable_get("user_register", 1)) {
$items[] = l(t("Create new account"), "user/register");
}
$output .= theme("theme_item_list", $items);
$output .= theme("item_list", $items);
return form($output, "post", url("user"));
}
@ -803,7 +803,7 @@ function user_pass($edit = array()) {
// Display error message if necessary.
if ($error) {
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
/*
@ -818,7 +818,7 @@ function user_pass($edit = array()) {
if (variable_get("user_register", 1)) {
$items[] = l(t("Create new account"), "user/register");
}
$output .= theme("theme_item_list", $items);
$output .= theme("item_list", $items);
return form($output, "post", url("user"));
}
@ -927,7 +927,7 @@ function user_register($edit = array()) {
}
else {
if ($error) {
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
}
@ -948,7 +948,7 @@ function user_register($edit = array()) {
$output .= form_submit(t("Create new account"));
$items[] = l(t("Request new password"), "user/password");
$items[] = l(t("Log in"), "user/login");
$output .= theme("theme_item_list", $items);
$output .= theme("item_list", $items);
return form($output);
}
@ -1032,7 +1032,7 @@ function user_edit($edit = array()) {
}
if ($error) {
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
if (!$edit) {
@ -1070,9 +1070,9 @@ function user_view($uid = 0) {
$output .= implode("\n", module_invoke_all("user", "view_private", "", $user));
theme("header", $user->name);
theme("box", $user->name, $output);
theme("footer");
print theme("header", $user->name);
print theme("box", $user->name, $output);
print theme("footer");
}
else if ($uid && $account = user_load(array("uid" => $uid, "status" => 1))) {
$output = form_item(t("Name"), $account->name);
@ -1083,19 +1083,19 @@ function user_view($uid = 0) {
$output .= form_item(t("Administration"), l(t("edit account"), "admin/user/edit/$account->uid"));
}
theme("header", $account->name);
theme("box", $account->name, $output);
theme("footer");
print theme("header", $account->name);
print theme("box", $account->name, $output);
print theme("footer");
}
else {
$output = user_login();
theme("header", t("User login"));
theme("box", t("User login"), $output);
print theme("header", t("User login"));
print theme("box", t("User login"), $output);
if (variable_get("user_register", 1)) {
theme("box", t("Create new user account"), user_register());
print theme("box", t("Create new user account"), user_register());
}
theme("box", t("Request new password"), user_pass());
theme("footer");
print theme("box", t("Request new password"), user_pass());
print theme("footer");
}
}
@ -1111,36 +1111,36 @@ function user_page() {
switch ($op) {
case t("E-mail new password"):
case "password":
theme("header", t("E-mail new password"));
theme("box", t("E-mail new password"), user_pass($edit));
theme("footer");
print theme("header", t("E-mail new password"));
print theme("box", t("E-mail new password"), user_pass($edit));
print theme("footer");
break;
case t("Create new account"):
case "register":
$output = user_register($edit);
theme("header", t("Create new account"));
print theme("header", t("Create new account"));
if (variable_get("user_register", 1)) {
theme("box", t("Create new account"), $output);
print theme("box", t("Create new account"), $output);
}
else {
print message_access();
}
theme("footer");
print theme("footer");
break;
case t("Log in"):
case "login":
$output = user_login($edit);
theme("header", t("Log in"));
theme("box", t("Log in"), $output);
theme("footer");
print theme("header", t("Log in"));
print theme("box", t("Log in"), $output);
print theme("footer");
break;
case t("Save user information"):
case "edit":
$output = user_edit($edit);
$GLOBALS["theme"] = theme_init();
theme("header", t("Edit user information"));
theme("box", t("Edit user information"), $output);
theme("footer");
print theme("header", t("Edit user information"));
print theme("box", t("Edit user information"), $output);
print theme("footer");
break;
case "view":
user_view(arg(2));
@ -1150,9 +1150,9 @@ function user_page() {
print user_logout();
break;
case "help":
theme("header");
theme("box", t("Distributed authentication"), user_help("user/help#user"));
theme("footer");
print theme("header");
print theme("box", t("Distributed authentication"), user_help("user/help#user"));
print theme("footer");
break;
default:
print user_view();
@ -1236,7 +1236,7 @@ function user_admin_create($edit = array()) {
else {
if ($error) {
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
$output .= form_textfield(t("Username"), "name", $edit["name"], 30, 55, t("Provide the username of the new account."));
@ -1488,7 +1488,7 @@ function user_admin_edit($edit = array()) {
$output .= status(t("user information changes have been saved."));
}
else {
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
}
else if ($op == t("Delete account")) {
@ -1499,7 +1499,7 @@ function user_admin_edit($edit = array()) {
}
else {
$error = t("Failed to delete account: the account has to be blocked first.");
$output .= theme("theme_error", $error);
$output .= theme("error", $error);
}
}
@ -1761,9 +1761,9 @@ function user_help($section = "admin/help#user") {
$output .= "<p>This second half of the <i>_auth</i> function examines the <i>\$response</i> from plant.blogger.com and returns a TRUE (1) or FALSE (0) as appropriate. This is a critical decision, so be sure that you have good logic here, and perform sufficient testing for all cases. In the case of Blogger, we search for the string 'fault' in the response. If that string is present, or there is no repsonse, our function returns FALSE. Otherwise, Blogger has returned valid data to our method request and we return TRUE. Note: Everything starting with \"//\" is a comment and is not executed.</p>";
$output .= "<pre>function blogger_page() {
theme(&quot;header&quot;);
theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_help(\"user/help\"));
theme(&quot;footer&quot;);
print theme(&quot;header&quot;);
print theme(&quot;box&quot;, &quot;Blogger&quot;, blogger_help(\"user/help\"));
print theme(&quot;footer&quot;);
}</pre>";
$output .= "<p>The _page function is not currently used, but it might be in the future. For now, just copy what you see here, substituting your module name for <i>blogger</i>.</p>";
$output .= "<pre><code>function blogger_help(\$section) {

View File

@ -1,15 +1,18 @@
<?php
// $Id$
class Theme_example extends BaseTheme {
function example_help($section) {
function system($field) {
$system["name"] = "example";
$system["author"] = "Dries";
$system["description"] = "Internet explorer, Netscape, Opera, Lynx";
$output = "";
return $system[$field];
switch ($section) {
case 'admin/system/themes#description':
$output = t("Internet explorer, Netscape, Opera, Lynx");
break;
}
return $output;
}
?>

View File

@ -14,9 +14,7 @@ function marvin_help($section) {
return $output;
}
class Theme_marvin extends BaseTheme {
function header($title = "") {
function marvin_header($title = "") {
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
@ -39,13 +37,13 @@ class Theme_marvin extends BaseTheme {
<body<?php print theme_onload_attribute(); ?>>
<table border="0" cellpadding="8" cellspacing="0">
<tr>
<td><a href="<?php print url(); ?>"><img src="<?php print $this->path; ?>/images/logo.png" style="border: 0px;" alt="" title="" /></a></td>
<td><a href="<?php print url(); ?>"><img src="<?php print path_to_theme(); ?>/images/logo.png" style="border: 0px;" alt="" title="" /></a></td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="2" style="text-align: right;">
<?php
print $this->links(link_page());
print theme("links", link_page());
?>
</td>
</tr>
@ -54,7 +52,7 @@ class Theme_marvin extends BaseTheme {
<?php
}
function node($node, $main = 0) {
function marvin_node($node, $main = 0) {
if (module_exist("taxonomy")) {
$terms = taxonomy_link("taxonomy terms", $node);
@ -63,13 +61,14 @@ class Theme_marvin extends BaseTheme {
$colspan = " colspan=\"2\"";
}
$path = path_to_theme();
print "\n<!-- node: \"$node->title\" -->\n";
print "<table cellpadding=\"0\" cellspacing=\"0\" style=\"border 0px; width: 100%;\">\n";
print " <tr><td$colspan><img src=\"$this->path/images/drop.gif\" alt=\"\" title=\"\" /> &nbsp; <b>$node->title</b></td></tr>\n";
print " <tr style=\"vertical-align: bottom;\"><td colspan=\"2\" style=\"background-color: #000000; width: 100%;\"><img src=\"$this->path/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" title=\"\" /></td></tr>\n";
print " <tr><td$colspan><img src=\"$path/images/drop.gif\" alt=\"\" title=\"\" /> &nbsp; <b>$node->title</b></td></tr>\n";
print " <tr style=\"vertical-align: bottom;\"><td colspan=\"2\" style=\"background-color: #000000; width: 100%;\"><img src=\"$path/images/pixel.gif\" width=\"1\" height=\"1\" alt=\"\" title=\"\" /></td></tr>\n";
print " <tr><td><div style=\"color: #7c7c7c;\"><small>". t("Submitted by %a on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))) ."</small></div></td>";
if ($colspan) {
print "<td style=\"text-align: right; vertical-align: top;\"><small>". $this->links($terms) ."</small></td>";
print "<td style=\"text-align: right; vertical-align: top;\"><small>". theme("links", $terms) ."</small></td>";
}
print " </tr>\n";
print " <tr><td$colspan>&nbsp;</td></tr>\n";
@ -84,14 +83,14 @@ class Theme_marvin extends BaseTheme {
print " <tr><td$colspan>&nbsp;</td></tr>\n";
if ($links = link_node($node, $main)) {
print " <tr><td$colspan>". $this->links($links) ."</td></tr>\n";
print " <tr><td$colspan>". theme("links", $links) ."</td></tr>\n";
}
print "</table>\n";
print "<br /><br />\n\n";
}
function comment($comment, $link = "") {
function marvin_comment($comment, $link = "") {
// Create comment header:
print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color: #000000; width: 100%;\">\n";
print " <tr style=\"background-color: #000000;\">\n";
@ -136,7 +135,7 @@ class Theme_marvin extends BaseTheme {
print "<br />\n\n";
}
function box($subject, $content, $region = "main") {
function marvin_box($subject, $content, $region = "main") {
print "\n<!-- box: \"$subject\" -->\n";
print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color: #000000; width: 100%;\">\n";
print " <tr>\n";
@ -151,23 +150,23 @@ class Theme_marvin extends BaseTheme {
print "<br />\n\n";
}
function links($links, $delimiter = " &middot; ") {
function marvin_links($links, $delimiter = " &middot; ") {
return implode($delimiter, $links);
}
function footer() {
function marvin_footer() {
?>
</td>
<td style="width: 200px; vertical-align: top;">
<?php
theme_blocks("all", $this);
print render_blocks("all");
?>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<?php
print "<p>". $this->links(link_page()) ."</p><p>". variable_get("site_footer", "") ."</p>\n";
print "<p>". theme("links", link_page()) ."</p><p>". variable_get("site_footer", "") ."</p>\n";
?>
</td>
</tr>
@ -177,6 +176,4 @@ class Theme_marvin extends BaseTheme {
</html>
<?php
}
}
?>

View File

@ -7,48 +7,38 @@ function unconed_help($section) {
switch ($section) {
case 'admin/system/themes#description':
$output = t("A PHP theme");
$output = t("Internet Explorer, Mozilla, Opera");
break;
}
return $output;
}
class Theme_unconed extends BaseTheme {
var $foreground = "#000000";
var $background = "#ffffff";
function unconed_header($title = "") {
global $base_url;
$foreground = "#000000";
$background = "#ffffff";
var $link = "#000000";
$link = "#000000";
var $cl80 = "#8f9399";
var $clc0 = "#c8c8d0";
var $cl00 = "#000000";
$cl80 = "#8f9399";
$clc0 = "#c8c8d0";
$cl00 = "#000000";
// color set #1:
var $brcolor1 = "#000000"; // border color
var $bgcolor1 = "#b5bece";
var $fgcolor1 = "#000000"; // table body color
var $hlcolor1 = "#000000"; // high-light color
var $sectioncolor = "#202020";
$brcolor1 = "#000000"; // border color
$bgcolor1 = "#b5bece";
$fgcolor1 = "#000000"; // table body color
$hlcolor1 = "#000000"; // high-light color
$sectioncolor = "#202020";
// color set #2:
var $bgcolor2 = "#eeeeee";
var $fgcolor2 = "#000000";
$bgcolor2 = "#eeeeee";
$fgcolor2 = "#000000";
// color set #3:
var $bgcolor3 = "#d7d7d7";
var $fgcolor3 = "#000000";
function system($field) {
$system["name"] = "UnConeD";
$system["author"] = "Steven Wittens";
$system["description"] = "Internet Explorer, Mozilla, Opera";
return $system[$field];
}
function header($title = "") {
global $base_url;
$bgcolor3 = "#d7d7d7";
$fgcolor3 = "#000000";
srand((double)microtime()*1000000);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -60,24 +50,24 @@ function unconed_help($section) {
</head>
<body<?php print theme_onload_attribute(); ?>>
<table border="0" cellpadding="0" cellspacing="0" style="margin: auto; width: 100%;">
<tr><td style="background-color: <?php print $this->cl00; ?>;"><img src="<?php print $this->path; ?>/images/null.gif" width="10" alt="" title="" /></td><td style="background-color: <?php print $this->clc0; ?>;"><img src="<?php print $this->path; ?>/images/null.gif" width="4" alt="" title="" /></td>
<td style="background-color: <?php print $this->cl80; ?>;">
<table border="0" cellpadding="0" cellspacing="9" style="background-color: <?php print $this->cl80; ?>;">
<tr><td style="background-color: <?php print $cl00; ?>;"><img src="<?php print path_to_theme(); ?>/images/null.gif" width="10" alt="" title="" /></td><td style="background-color: <?php print $clc0; ?>;"><img src="<?php print path_to_theme(); ?>/images/null.gif" width="4" alt="" title="" /></td>
<td style="background-color: <?php print $cl80; ?>;">
<table border="0" cellpadding="0" cellspacing="9" style="background-color: <?php print $cl80; ?>; width: 100%">
<tr>
<td colspan="2">
<table border="0" cellspacing="0" cellpadding="0" style="background-color: <?php echo $this->brcolor1; ?>; width: 100%;"><tr><td style="text-align: center;"><table border="0" cellspacing="1" cellpadding="4" style="width: 100%;"><tr><td style="background-color: <?php echo $this->bgcolor2; ?>; text-align: center;"><a href="<?php print $base_url; ?>/"><img src="<?php print $this->path; ?>/images/logo.png" alt="logo" title="logo" /></a></td></tr></table></td></tr></table>
<table border="0" cellspacing="0" cellpadding="0" style="background-color: <?php echo $brcolor1; ?>; width: 100%;"><tr><td style="text-align: center;"><table border="0" cellspacing="1" cellpadding="4" style="width: 100%;"><tr><td style="background-color: <?php echo $bgcolor2; ?>; text-align: center;"><a href="<?php print $base_url; ?>/"><img src="<?php print path_to_theme(); ?>/images/logo.png" alt="logo" title="logo" /></a></td></tr></table></td></tr></table>
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<table border="0" cellspacing="0" cellpadding="0" style="background-color: <?php echo $this->brcolor1; ?>; width: 100%;"><tr><td style="text-align: center;"><table border="0" cellspacing="1" cellpadding="4" style="width: 100%;"><tr><td style="background-color: <?php echo $this->bgcolor2; ?>; text-align: center;"><?php print theme_links(link_page()); ?></td></tr></table></td></tr></table>
<table border="0" cellspacing="0" cellpadding="0" style="background-color: <?php echo $brcolor1; ?>; width: 100%;"><tr><td style="text-align: center;"><table border="0" cellspacing="1" cellpadding="4" style="width: 100%;"><tr><td style="background-color: <?php echo $bgcolor2; ?>; text-align: center;"><?php print theme("links", link_page()); ?></td></tr></table></td></tr></table>
</td>
</tr>
<tr><td colspan="2"><?php
print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color: $this->brcolor1; width: 100%;\">";
print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color: $brcolor1; width: 100%;\">";
print "<tr><td>";
print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" style=\"width: 100%;\">";
print "<tr><td style=\"background-color: $this->bgcolor2; text-align: center;\"><div style=\"color: $this->fgcolor1;\"><img src=\"" . $this->path . "/images/null.gif\" width=\"2\" height=\"2\" alt=\"\" title=\"\"/></div></td></tr>";
print "<tr><td style=\"background-color: $bgcolor2; text-align: center;\"><div style=\"color: $fgcolor1;\"><img src=\"" . path_to_theme() . "/images/null.gif\" width=\"2\" height=\"2\" alt=\"\" title=\"\"/></div></td></tr>";
print "</table>";
print "</td></tr></table>";
?></td></tr>
@ -86,26 +76,48 @@ function unconed_help($section) {
<?php
}
function node($node, $main = 0) {
function unconed_node($node, $main = 0) {
$foreground = "#000000";
$background = "#ffffff";
$link = "#000000";
$cl80 = "#8f9399";
$clc0 = "#c8c8d0";
$cl00 = "#000000";
// color set #1:
$brcolor1 = "#000000"; // border color
$bgcolor1 = "#b5bece";
$fgcolor1 = "#000000"; // table body color
$hlcolor1 = "#000000"; // high-light color
$sectioncolor = "#202020";
// color set #2:
$bgcolor2 = "#eeeeee";
$fgcolor2 = "#000000";
// color set #3:
$bgcolor3 = "#d7d7d7";
$fgcolor3 = "#000000";
print "\n<!-- node: \"$node->title\" -->\n";
?>
<table border="0" cellpadding="0" cellspacing="0" style="background-color: <?php echo $this->brcolor1; ?>; width: 100%;">
<table border="0" cellpadding="0" cellspacing="0" style="background-color: <?php echo $brcolor1; ?>; width: 100%;">
<tr><td>
<table border="0" cellpadding="4" cellspacing="1" style="width: 100%;">
<tr><td colspan="2" style="background-color: <?php echo $this->bgcolor1; ?>; width: 100%;"><table cellpadding="0" cellspacing="0" style="width: 100%;"><tr><td style="width: 100%;"><div style="color: <?php echo $this->fgcolor1; ?>;"><b><?php echo "$node->title"; ?></b></div></td><td style="vertical-align: middle; text-align: center;"><img src="<?php print $this->path; ?>/images/icon.gif" alt="" title="" /></td></tr></table></td></tr>
<tr style="background-color: <?php echo $this->bgcolor2; ?>;">
<tr><td colspan="2" style="background-color: <?php echo $bgcolor1; ?>; width: 100%;"><table cellpadding="0" cellspacing="0" style="width: 100%;"><tr><td style="width: 100%;"><div style="color: <?php echo $fgcolor1; ?>;"><b><?php echo "$node->title"; ?></b></div></td><td style="vertical-align: middle; text-align: center;"><img src="<?php print path_to_theme(); ?>/images/icon.gif" alt="" title="" /></td></tr></table></td></tr>
<tr style="background-color: <?php echo $bgcolor2; ?>;">
<?php
if (module_exist("taxonomy")) {
$terms = taxonomy_link("taxonomy terms", $node);
}
$taxo = theme_links($terms);
print "<td style=\"background-color: $this->bgcolor2; width: 70%;\"><small>" . t("Submitted by %a on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))) . "</small></td><td style=\"background-color: $this->bgcolor2; width: 30%; text-align: center;\"><b>". $taxo ."</b>";
$taxo = theme("links", $terms);
print "<td style=\"background-color: $bgcolor2; width: 70%;\"><small>" . t("Submitted by %a on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))) . "</small></td><td style=\"background-color: $bgcolor2; width: 30%; text-align: center;\"><b>". $taxo ."</b>";
?>
</td>
</tr>
<tr style="background-color: <?php echo $this->bgcolor2; ?>;">
<td colspan="2" style="background-color: <?php echo $this->bgcolor2 ?>;">
<tr style="background-color: <?php echo $bgcolor2; ?>;">
<td colspan="2" style="background-color: <?php echo $bgcolor2 ?>;">
<?php
if ($main && $node->teaser) {
echo "<p>$node->teaser</p>";
@ -118,31 +130,53 @@ function unconed_help($section) {
</tr>
<?php
if ($links = link_node($node, $main)) {
echo "<tr style=\"background-color: ". $this->bgcolor3 .";\"><td style=\"background-color: ". $this->bgcolor3 ."; text-align: right;\" colspan=\"2\">[ ". theme_links($links) ." ]</td></tr>";
echo "<tr style=\"background-color: ". $bgcolor3 .";\"><td style=\"background-color: ". $bgcolor3 ."; text-align: right;\" colspan=\"2\">[ ". theme("links", $links) ." ]</td></tr>";
}
?>
</table></td></tr></table><br />
<?php
}
function comment($comment, $link) {
function unconed_comment($comment, $link) {
$foreground = "#000000";
$background = "#ffffff";
$cl80 = "#8f9399";
$clc0 = "#c8c8d0";
$cl00 = "#000000";
// color set #1:
$brcolor1 = "#000000"; // border color
$bgcolor1 = "#b5bece";
$fgcolor1 = "#000000"; // table body color
$hlcolor1 = "#000000"; // high-light color
$sectioncolor = "#202020";
// color set #2:
$bgcolor2 = "#eeeeee";
$fgcolor2 = "#000000";
// color set #3:
$bgcolor3 = "#d7d7d7";
$fgcolor3 = "#000000";
print "\n<!-- comment: \"$comment->subject\" by $comment->name -->\n";
?>
<table border="0" cellpadding="0" cellspacing="0" style="background-color: <?php echo $this->brcolor1; ?>; width: 100%;">
<table border="0" cellpadding="0" cellspacing="0" style="background-color: <?php echo $brcolor1; ?>; width: 100%;">
<tr><td>
<?php
// create comment header:
echo "<table border=\"0\" cellpadding=\"4\" cellspacing=\"1\" style=\"width: 100%;\">";
echo " <tr style=\"background-color: $this->bgcolor1;\">";
echo " <td style=\"background-color: $this->bgcolor1;\">";
echo " <tr style=\"background-color: $bgcolor1;\">";
echo " <td style=\"background-color: $bgcolor1;\">";
echo " <table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" style=\"width: 100%;\">";
// subject:
echo " <tr>";
echo " <td style=\"text-align: right; width: 5%; vertical-align: top;\"><div style=\"color: $this->hlcolor1;\"><b>" . t("subject") . ":</b></div></td><td style=\"width: 80%;\">";
echo " <b><div style=\"color: $this->fgcolor1;\">$comment->subject</div></b>";
echo " <td style=\"text-align: right; width: 5%; vertical-align: top;\"><div style=\"color: $hlcolor1;\"><b>" . t("subject") . ":</b></div></td><td style=\"width: 80%;\">";
echo " <b><div style=\"color: $fgcolor1;\">$comment->subject</div></b>";
echo " </td>";
echo " </tr>";
@ -160,23 +194,49 @@ function unconed_help($section) {
echo " </tr>";
// print body of comment:
if ($comment) echo " <tr><td style=\"background-color: $this->bgcolor2;\">$comment->comment</td></tr>";
if ($comment) echo " <tr><td style=\"background-color: $bgcolor2;\">$comment->comment</td></tr>";
// print bottom link(s):
echo " <tr><td style=\"background-color: $this->bgcolor3; text-align: right;\">[ $link ]</td></tr>";
echo " <tr><td style=\"background-color: $bgcolor3; text-align: right;\">[ $link ]</td></tr>";
echo " </table>";
?></td></tr></table><br /><?php
}
function unconed_block($block) {
return unconed_box($block->subject, $block->content);
}
function box($subject, $content, $region = "main") {
function unconed_box($subject, $content, $region = "main") {
$foreground = "#000000";
$background = "#ffffff";
$link = "#000000";
$cl80 = "#8f9399";
$clc0 = "#c8c8d0";
$cl00 = "#000000";
// color set #1:
$brcolor1 = "#000000"; // border color
$bgcolor1 = "#b5bece";
$fgcolor1 = "#000000"; // table body color
$hlcolor1 = "#000000"; // high-light color
$sectioncolor = "#202020";
// color set #2:
$bgcolor2 = "#eeeeee";
$fgcolor2 = "#000000";
// color set #3:
$bgcolor3 = "#d7d7d7";
$fgcolor3 = "#000000";
?>
<table border="0" cellpadding="0" cellspacing="0" style="background-color: <?php echo $this->brcolor1; ?>; width: 100%;">
<table border="0" cellpadding="0" cellspacing="0" style="background-color: <?php echo $brcolor1; ?>; width: 100%;">
<tr><td>
<?php
print "<table border=\"0\" cellpadding=\"3\" cellspacing=\"1\" style=\"width: 100%;\">";
print " <tr><td style=\"background-color: $this->bgcolor1; text-align: center;\"><div style=\"color: $this->fgcolor1;\"><b>$subject</b></div></td></tr>";
print " <tr><td style=\"background-color: $this->bgcolor2;\">$content</td></tr>";
print " <tr><td style=\"background-color: $bgcolor1; text-align: center;\"><div style=\"color: $fgcolor1;\"><b>$subject</b></div></td></tr>";
print " <tr><td style=\"background-color: $bgcolor2;\">$content</td></tr>";
print "</table>";
?>
@ -186,36 +246,57 @@ function unconed_help($section) {
}
function footer() {
function unconed_footer() {
$foreground = "#000000";
$background = "#ffffff";
$link = "#000000";
$cl80 = "#8f9399";
$clc0 = "#c8c8d0";
$cl00 = "#000000";
// color set #1:
$brcolor1 = "#000000"; // border color
$bgcolor1 = "#b5bece";
$fgcolor1 = "#000000"; // table body color
$hlcolor1 = "#000000"; // high-light color
$sectioncolor = "#202020";
// color set #2:
$bgcolor2 = "#eeeeee";
$fgcolor2 = "#000000";
// color set #3:
$bgcolor3 = "#d7d7d7";
$fgcolor3 = "#000000";
?>
</td>
<td valign="top" width="20%">
<?php
theme_blocks("all", $this);
print render_blocks("all", $this);
?>
</td>
</tr>
<tr><td colspan="2"><?php
print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color: $this->brcolor1; width: 100%;\">";
print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color: $brcolor1; width: 100%;\">";
print "<tr><td>";
print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" style=\"width: 100%;\">";
print "<tr><td style=\"background-color: $this->bgcolor2; text-align: center;\"><div style=\"color: $this->fgcolor1;\"><img src=\"" . $this->path . "/images/null.gif\" width=\"2\" height=\"2\" alt=\"\" title=\"\" /></div></td></tr>";
print "<tr><td style=\"background-color: $bgcolor2; text-align: center;\"><div style=\"color: $fgcolor1;\"><img src=\"" . path_to_theme() . "/images/null.gif\" width=\"2\" height=\"2\" alt=\"\" title=\"\" /></div></td></tr>";
print "</table>";
print "</td></tr></table>";
?></td></tr>
<tr>
<td colspan="2">
<table border="0" cellspacing="0" cellpadding="0" style="background-color: <?php echo $this->brcolor1; ?>; width: 100%;"><tr><td style="text-align: center;"><table border="0" cellspacing="1" cellpadding="4" style="width: 100%;"><tr><td style="background-color: <?php echo $this->bgcolor2; ?>; text-align: center;"><?php print theme_links(link_page()); ?></td></tr></table></td></tr></table>
<table border="0" cellspacing="0" cellpadding="0" style="background-color: <?php echo $brcolor1; ?>; width: 100%;"><tr><td style="text-align: center;"><table border="0" cellspacing="1" cellpadding="4" style="width: 100%;"><tr><td style="background-color: <?php echo $bgcolor2; ?>; text-align: center;"><?php print theme("links", link_page()); ?></td></tr></table></td></tr></table>
</td>
</tr>
</table>
</td><td style="background-color: <?php print $this->clc0; ?>;"><img src="<?php print $this->path; ?>/images/null.gif" width="4" alt="" title="" /></td><td style="background-color: <?php print $this->cl00; ?>;"><img src="<?php print $this->path; ?>/images/null.gif" width="10" alt="" title="" /></td></tr>
</td><td style="background-color: <?php print $clc0; ?>;"><img src="<?php print path_to_theme(); ?>/images/null.gif" width="4" alt="" title="" /></td><td style="background-color: <?php print $cl00; ?>;"><img src="<?php print path_to_theme(); ?>/images/null.gif" width="10" alt="" title="" /></td></tr>
</table>
<?php print theme_closure(); ?>
</body>
</html>
<?php
}
}
?>

View File

@ -1,9 +1,6 @@
<?php
// $Id$
class Theme_xtemplate extends BaseTheme {
}
if (!class_exists("XTemplate")) {
include_once("themes/xtemplate/xtemplate.inc");
}
@ -121,10 +118,10 @@ function xtemplate_header($title = "") {
ob_start();
if ($xtemplate->sidebar == "left") {
theme_blocks("all");
print render_blocks("all");
}
else if ($xtemplate->sidebar == "both") {
theme_blocks("left");
print render_blocks("left");
}
if ($blocks = ob_get_contents()) {
@ -171,10 +168,10 @@ function xtemplate_footer() {
ob_start();
if ($xtemplate->sidebar == "right") {
theme_blocks("all");
print render_blocks("all");
}
else if ($xtemplate->sidebar == "both") {
theme_blocks("right");
print render_blocks("right");
}
if ($blocks = ob_get_contents()) {