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

Diff of /contributions/themes/sunflower/sunflower.theme

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

revision 1.24, Sat Apr 30 18:42:48 2005 UTC revision 1.25, Sun Mar 5 09:13:56 2006 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: sunflower.theme,v 1.23 2005/03/31 19:53:49 tdobes Exp $  // $Id: sunflower.theme,v 1.24 2005/04/30 18:42:48 tdobes Exp $
3    
4  function sunflower_features() {  function sunflower_features() {
5    return array('toggle_name', 'toggle_primary_links');    return array('toggle_name', 'toggle_favicon');
6    }
7    
8    function sunflower_regions() {
9      return array(
10           'left' => t('left sidebar'),
11           'right' => t('right sidebar')
12      );
13  }  }
14    
15    /**    /**
# Line 12  function sunflower_features() { Line 19  function sunflower_features() {
19     *            sitewide navigation in the footer.     *            sitewide navigation in the footer.
20     */     */
21  function sunflower_page($content) {  function sunflower_page($content) {
22      if (theme_get_setting('toggle_favicon')) {
23        drupal_set_html_head('<link rel="shortcut icon" href="'. check_url(theme_get_setting('favicon')) .'" type="image/x-icon" />');
24      }
25    
26    $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";
27    $output .= "<html>\n";    $output .= "<html>\n";
28    $output .= "<head>\n";    $output .= "<head>\n";
# Line 27  function sunflower_page($content) { Line 38  function sunflower_page($content) {
38    }    }
39    
40    $output .= "</title>\n";    $output .= "</title>\n";
41    $output .= "<style type=\"text/css\" media=\"screen, projection\">\n  @import \"" . path_to_theme() . "/sunflower.css\";\n</style>\n";    $output .= "<style type=\"text/css\" media=\"screen, projection\">\n  @import \"". base_path() . path_to_theme() ."/sunflower.css\";\n</style>\n";
42      $output .= theme_get_styles();
43    $output .= "</head>\n";    $output .= "</head>\n";
44    $output .= "<body bgcolor=\"#ffffff\" link=\"#2080d0\" vlink=\"#0060b0\" alink=\"#000000\" ". theme_onload_attribute() .">\n";    $output .= "<body bgcolor=\"#ffffff\" link=\"#2080d0\" vlink=\"#0060b0\" alink=\"#000000\">\n";
45    $output .= '<!-- The topmost row with site name and colored blocks -->    $output .= '<!-- The topmost row with site name and colored blocks -->
46          <table align="center" border="0" width="95%" cellspacing="0" cellpadding="10">          <table align="center" border="0" width="95%" cellspacing="0" cellpadding="10">
47            <tr>            <tr>
48              <td style="vertical-align: bottom;">              <td style="vertical-align: bottom;">
49                <div class="colorblock" style="background-color: #ffe880;">';                <div class="colorblock" style="background-color: #ffe880;">';
50    if (theme_get_setting('toggle_name')) {    if (theme_get_setting('toggle_name')) {
51      $output .= "  <a href=\"./\" title=\"Home\">". l(variable_get('site_name', 'drupal'), ""). "</a>";      $output .= l(variable_get('site_name', 'drupal'), '', array('title' => t('Home')));
52    }    }
53    else {    else {
54      $output .= '&nbsp;';      $output .= '&nbsp;';
# Line 85  function sunflower_page($content) { Line 97  function sunflower_page($content) {
97            </td>            </td>
98            <td style="width: 100%; vertical-align: top;">            <td style="width: 100%; vertical-align: top;">
99              <!-- site nav -->              <!-- site nav -->
100              &nbsp;' . theme_get_setting('primary_links') .'<br /><br />              &nbsp;'. theme('links', menu_primary_links()) .'<br /><br />
101              <!-- /site nav -->              <!-- /site nav -->
102              <table border="0" width="100%" cellspacing="0" cellpadding="10">              <table border="0" width="100%" cellspacing="0" cellpadding="10">
103                  <tr>';                  <tr>';
# Line 130  function sunflower_page($content) { Line 142  function sunflower_page($content) {
142  </table>  </table>
143    
144  <center>  <center>
145  ' . theme_get_setting('primary_links') . ' <br />  '. theme('links', menu_primary_links()) .' <br />
146  ' . variable_get(site_footer, "") . '  ' . variable_get(site_footer, "") . '
147  </center>  </center>
148  ' . theme_closure() . '  ' . theme_closure() . '
# Line 157  function sunflower_block($block) { Line 169  function sunflower_block($block) {
169     * NODE:    I haven't got a good understanding of what the node function displays.     * NODE:    I haven't got a good understanding of what the node function displays.
170     *          It definitely includes book chapters.     *          It definitely includes book chapters.
171     */     */
172  function sunflower_node($node, $main = 0, $page = 0) {  function sunflower_node($node, $teaser = 0, $page = 0) {
173    $output = '          <!-- colors tried: pink - #F4b3FF, light green - #B3FFF4 -->';    $output = '          <!-- colors tried: pink - #F4b3FF, light green - #B3FFF4 -->';
174    if (!$page) {    if (!$page) {
175      $output .= '      $output .= '
176                    <div class="mysubject" style="background-color: #b3fff4;">                    <div class="mysubject" style="background-color: #b3fff4;">
177                    ' . l($node->title, "node/$node->nid") . '                    '. ($teaser ? l($node->title, "node/$node->nid") : check_plain($node->title)) .'
178                    </div>';                    </div>';
179    }    }
180    $output .= '    $output .= '
181                    <div class="mybody">                    <div class="mybody">
182                    <!-- insert the submitted by line. -->                    <!-- insert the submitted by line. -->
183                    <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td>'. (theme_get_setting("toggle_node_info_$node->type") ?                    <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td>'. (theme_get_setting("toggle_node_info_$node->type") ?
184                    t("Submitted by <i>%a</i> on %b", array("%a" => format_name($node), "%b" => format_date($node->created, "large"))) : '') .'</td>';                    t("Submitted by <i>%a</i> on %b", array("%a" => theme('username', $node), "%b" => format_date($node->created, "large"))) : '') .'</td>';
185    
186    if (module_exist("taxonomy") && ($taxonomy = taxonomy_link("taxonomy terms", $node))) {    if (module_exist("taxonomy") && ($taxonomy = taxonomy_link("taxonomy terms", $node))) {
187      $output .= '<td style="text-align: right;">' . theme("links", $taxonomy) . '</td>';      $output .= '<td style="text-align: right;">' . theme("links", $taxonomy) . '</td>';
# Line 178  function sunflower_node($node, $main = 0 Line 190  function sunflower_node($node, $main = 0
190                    <!-- insert the node body -->                    <!-- insert the node body -->
191                    ';                    ';
192    
193    if ($main && $node->teaser) {    if ($teaser && $node->teaser) {
194      $output .= $node->teaser;      $output .= $node->teaser;
195    }    }
196    else {    else {
# Line 203  function sunflower_node($node, $main = 0 Line 215  function sunflower_node($node, $main = 0
215     * COMMENT:    The comment function specifies the formatting and appearance of     * COMMENT:    The comment function specifies the formatting and appearance of
216     *             user comments.     *             user comments.
217     */     */
218  function sunflower_comment($comment, $link = "") {  function sunflower_comment($comment, $links = array()) {
219    // Create comment header:    // Create comment header:
220    $output = "<div class=\"mysubject\">";    $output = "<div class=\"mysubject\">";
221    $output .= $comment->subject;    $output .= $comment->subject;
222    $output .= "</div><div class=\"mybody\">";    $output .= "</div><div class=\"mybody\">";
223    // Author and date:    // Author and date:
224    $output .= t("Submitted by <i>%a</i> on %b", array("%a" => format_name($comment), "%b" => format_date($comment->timestamp, "large")));    $output .= t("Submitted by <i>%a</i> on %b", array("%a" => theme('username', $comment), "%b" => format_date($comment->timestamp, "large")));
225    // Moderation:    // Moderation:
226    $output .= $comment->moderation;    $output .= $comment->moderation;
227    $output .= "<hr />";    $output .= "<hr />";
228    // Body of comment:    // Body of comment:
229    $output .= $comment->comment;    $output .= $comment->comment;
230    // Print navigation / control links:    // Print navigation / control links:
231    $output .= "<p align=\"right\">$link</p>";    $output .= "<p align=\"right\">". theme('links', $links) ."</p>";
232    $output .= "</div><br />";    $output .= "</div><br />";
233    return $output;    return $output;
234  } // close comment function  } // close comment function
# Line 226  function sunflower_help() { Line 238  function sunflower_help() {
238      return '<div class="help">'. $help .'</div><hr />';      return '<div class="help">'. $help .'</div><hr />';
239    }    }
240  } // close help function  } // close help function
   
 ?>  

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

  ViewVC Help
Powered by ViewVC 1.1.2