/[drupal]/contributions/themes/adc/adc.theme
ViewVC logotype

Diff of /contributions/themes/adc/adc.theme

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.20, Thu Aug 25 21:00:27 2005 UTC revision 1.21, Sun Mar 5 09:13:56 2006 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /** $Id: adc.theme,v 1.19 2005/04/30 18:42:47 tdobes Exp $  /** $Id: adc.theme,v 1.20 2005/08/25 21:00:27 dries Exp $
3   *  Theme for cuadc.org   *  Theme for cuadc.org
4   *   *
5   *  @author Alastair Maw (me@almaw.com)   *  @author Alastair Maw (me@almaw.com)
# Line 7  Line 7 
7   */   */
8    
9  function adc_features() {  function adc_features() {
10    return array('toggle_name', 'toggle_slogan', 'toggle_primary_links');    return array('toggle_name', 'toggle_slogan', 'toggle_favicon');
11    }
12    
13    function adc_regions() {
14      return array(
15           'left' => t('left sidebar'),
16           'right' => t('right sidebar')
17      );
18  }  }
19    
20  function adc_page($content) {  function adc_page($content) {
21      if (theme_get_setting('toggle_favicon')) {
22        drupal_set_html_head('<link rel="shortcut icon" href="'. check_url(theme_get_setting('favicon')) .'" type="image/x-icon" />');
23      }
24    $output  = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";    $output  = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
25    $output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n";    $output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">\n";
26    $output .= "<head>\n";    $output .= "<head>\n";
# Line 26  function adc_page($content) { Line 36  function adc_page($content) {
36    }    }
37    
38    $output .= "</title>\n";    $output .= "</title>\n";
39    $output .= "<link rel=\"stylesheet\" type=\"text/css\" media=\"print\" href=\"" . path_to_theme() . "/print.css\" />\n";    $output .= "<link rel=\"stylesheet\" type=\"text/css\" media=\"print\" href=\"". base_path() . path_to_theme() ."/print.css\" />\n";
40    $output .= theme_get_styles();    $output .= theme_get_styles();
   $output .= "<script type=\"text/javascript\" language=\"javascript\" src=\"" . path_to_theme() . "/rollup.js\"></script>\n";  
41    $output .= "</head>\n";    $output .= "</head>\n";
42    $output .= "<body ". theme_onload_attribute("preloadImages()") .">\n";    $output .= "<body>\n";
43    
44    $output .= "<div id=\"Header\">\n";    $output .= "<div id=\"Header\">\n";
45    $output .= "<div class=\"headTitle\">";    $output .= "<div class=\"headTitle\">";
46    if (theme_get_setting('toggle_name')) {    if (theme_get_setting('toggle_name')) {
47      $output .= l(variable_get("site_name", "drupal"), "", array("title" => t("Return to the main page.")));      $output .= l(variable_get("site_name", "drupal"), "", array('title' => t('Home')));
48    }    }
49    if (theme_get_setting('toggle_slogan')) {    if (theme_get_setting('toggle_slogan')) {
50      $output .= (theme_get_setting('toggle_name') && variable_get("site_name", "drupal") && variable_get("site_slogan", "")) ? " | " : "";      $output .= (theme_get_setting('toggle_name') && variable_get("site_name", "drupal") && variable_get("site_slogan", "")) ? " | " : "";
51      $output .= variable_get("site_slogan", "");      $output .= variable_get("site_slogan", "");
52    }    }
53    $output .= "</div>\n";    $output .= "</div>\n";
54    $output .= "<div class=\"headLinks\">". theme_get_setting('primary_links') ."</div>\n";  
55      $primary_links = theme('links', menu_primary_links());
56      $secondary_links = theme('links', menu_secondary_links());
57      if (isset($primary_links) || isset($secondary_links)) {
58        $output .= ' <div class="headLinks">';
59        if (isset($primary_links)) {
60          $output .= '<span class="primary">'. $primary_links .'</span>';
61        }
62        if (isset($secondary_links)) {
63          $output .= '<span class="secondary">'. $secondary_links .'</span>';
64        }
65        $output .= " </div>\n";
66      }
67    
68    $output .= "</div>\n";    $output .= "</div>\n";
69    
70    $leftblocks = theme("blocks", "left");    $leftblocks = theme("blocks", "left");
# Line 92  function adc_page($content) { Line 114  function adc_page($content) {
114    return $output;    return $output;
115  }  }
116    
117  function adc_node($node, $main = 0, $page = 0) {  function adc_node($node, $teaser = 0, $page = 0) {
118    $output = "<div class=\"node\">\n";    $output = "<div class=\"node\">\n";
119    $output .= "<div class=\"nodeTitleBar\">\n";    $output .= "<div class=\"nodeTitleBar\">\n";
120    if (theme_get_setting("toggle_node_info_$node->type")) {    if (theme_get_setting("toggle_node_info_$node->type")) {
121      $output .= "<div class=\"nodeCredits\">" . theme('username', $node) . ' | ' . format_date($node->created, "small") . "</div>\n";      $output .= "<div class=\"nodeCredits\">" . theme('username', $node) . ' | ' . format_date($node->created, "small") . "</div>\n";
122    }    }
123    if (!$page) {    if (!$page) {
124      $output .= "<div class=\"nodeTitle\">" . l($node->title, "node/$node->nid") . "</div>\n";      $output .= "<div class=\"nodeTitle\">" . ($teaser ? l($node->title, "node/$node->nid") : check_plain($node->title)) . "</div>\n";
125    }    }
126    $output .= "</div>\n";    $output .= "</div>\n";
127    $output .= "<div class=\"nodeContents\">\n";    $output .= "<div class=\"nodeContents\">\n";
128    if (module_exist("taxonomy") && ($taxonomy = taxonomy_link("taxonomy terms", $node))) {    if (module_exist("taxonomy") && ($taxonomy = taxonomy_link("taxonomy terms", $node))) {
129      $output .= "<div class=\"nodeTaxonomy\">". theme("links", $taxonomy) ."</div>";      $output .= "<div class=\"nodeTaxonomy\">". theme("links", $taxonomy) ."</div>";
130    }    }
131    if ($main && $node->teaser) {    if ($teaser && $node->teaser) {
132      $output .= $node->teaser;      $output .= $node->teaser;
133    }    }
134    else {    else {
# Line 122  function adc_node($node, $main = 0, $pag Line 144  function adc_node($node, $main = 0, $pag
144    return $output;    return $output;
145  }  }
146    
147  function adc_comment($comment, $link = "") {  function adc_comment($comment, $links = array()) {
148    $output = "<hr size=\"1\" />\n";    $output = "<hr size=\"1\" />\n";
149    $output .= theme("links", array(theme('username', $comment), format_date($comment->timestamp, "small"), "&nbsp;"));    $output .= theme("links", array(theme('username', $comment), format_date($comment->timestamp, "small"), "&nbsp;"));
150    $output .= "<strong>$comment->subject</strong>\n";    $output .= "<strong>$comment->subject</strong>\n";
151    $output .= "<br /><br />";    $output .= "<br /><br />";
152    $output .= $comment->comment;    $output .= $comment->comment;
153    $output .= "<br /><br />$link<br />";    $output .= "<br /><br />". theme('links', $links) ."<br />";
154    
155    return $output;    return $output;
156  }  }
157    
158  function adc_block($block) {  function adc_block($block) {
159    global $boxcounter;    $output = '<div class="block block-'.$block->module.'"  id="block-'.$block->module.'-'.$block->delta.'"><div class="nodeTitleBar">';
   $boxcounter++;  
   $output = '<div class="block block-'.$block->module.'"  id="block-'.$block->module.'-'.$block->delta.'"><div class="nodeTitleBar"><div class="nodeRollup">';  
   $output .= "<a href=\"JavaScript:toggle('$boxcounter');\" ";  
   $output .= "onmouseover=\"swapImage($boxcounter, true); return true;\" ";  
   $output .= "onmouseout=\"swapImage($boxcounter, false); return true;\">";  
   $output .= '<img id="link' . $boxcounter . '" src="' . path_to_theme() . '/minus.gif" width="16" height="16" alt="" /></a></div>';  
160    $output .= '<div class="nodeTitle">';    $output .= '<div class="nodeTitle">';
161    $output .= ucfirst($block->subject) . "</div></div><div id=\"box$boxcounter\" class=\"nodeContents\">$block->content</div></div>\n";    $output .= $block->subject ."</div></div><div class=\"nodeContents\">$block->content</div></div>\n";
162    $output .= "<br />\n";    $output .= "<br />\n";
163    
164    return $output;    return $output;
# Line 153  function adc_help() { Line 169  function adc_help() {
169      return '<div class="help">'. $help .'</div><hr />';      return '<div class="help">'. $help .'</div><hr />';
170    }    }
171  }  }
   
 ?>  

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.2