Changeset 104


Ignore:
Timestamp:
03/05/07 03:56:52 (5 years ago)
Author:
nigel
Message:
  • Converted to 5.x
File:
1 edited

Legend:

Unmodified
Added
Removed
  • themes/yd/yd.theme

    r79 r104  
    2222} 
    2323 
    24 function yd_page($content) { 
     24function yd_page($content, $show_blocks = TRUE) { 
    2525  $language = $GLOBALS['locale']; 
    2626 
     
    2828    drupal_set_html_head('<link rel="shortcut icon" href="'. check_url(theme_get_setting('favicon')) .'" type="image/x-icon" />'); 
    2929  } 
     30   
     31  drupal_add_css(path_to_theme() .'/common.css', 'theme'); 
    3032 
    3133  $title = drupal_get_title(); 
     34 
     35  // Get blocks before so that they can alter the header (JavaScript, Stylesheets etc.) 
     36  $blocks_left = theme_blocks('left'); 
     37  $blocks_right = theme_blocks('right'); 
    3238 
    3339  $output  = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n"; 
    3440  $output .= "<html xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"$language\" xml:lang=\"$language\">\n"; 
    3541  $output .= "<head>\n"; 
    36   $output .= " <title>". ($title ? strip_tags($title) ." | ". variable_get("site_name", "drupal") : variable_get("site_name", "drupal") ." | ". variable_get("site_slogan", "")) ."</title>\n"; 
     42  $output .= " <title>". ($title ? strip_tags($title) ." | ". variable_get("site_name", "Drupal") : variable_get("site_name", "Drupal") ." | ". variable_get("site_slogan", "")) ."</title>\n"; 
    3743  $output .= drupal_get_html_head(); 
    38   $output .= theme('stylesheet_import', base_path() . path_to_theme() ."/common.css"); 
    39   $output .= theme_get_styles(); 
     44  $output .= drupal_get_css(); 
     45  $output .= drupal_get_js(); 
    4046  $output .= "</head>"; 
    4147  $output .= "<body>\n"; 
     
    5763  $output .= "</div>\n"; 
    5864 
    59   $primary_links = false; //theme('links', menu_primary_links()); 
    60   $secondary_links = false; //theme('links', menu_secondary_links()); 
     65  $primary_links = theme('links', menu_primary_links(), array('class' => 'links', 'id' => 'navlist')); 
     66  $secondary_links = theme('links', menu_secondary_links(), array('class' => 'links', 'id' => 'subnavlist')); 
    6167  if (isset($primary_links) || isset($secondary_links)) { 
    6268    $output .= ' <div class="navlinks">'; 
    6369    if (isset($primary_links)) { 
    64       $output .= '<div class="primary">'. $primary_links .'</div>'; 
     70//      $output .= '<div class="primary">'. $primary_links .'</div>'; 
    6571    } 
    6672    if (isset($secondary_links)) { 
    67       $output .= '<div class="secondary">'. $secondary_links .'</div>'; 
     73//      $output .= '<div class="secondary">'. $secondary_links .'</div>'; 
    6874    } 
    6975    $output .= " </div>\n"; 
     
    7480  $output .= "  <tr>\n"; 
    7581 
    76   if ($blocks = theme_blocks("left")) { 
    77     $output .= "   <td id=\"sidebar-left\">$blocks</td>\n"; 
     82  if ($show_blocks && !empty($blocks_left)) { 
     83    $output .= "   <td id=\"sidebar-left\">$blocks_left</td>\n"; 
    7884  } 
    7985 
     
    95101  $output .= "\n<!-- begin content -->\n"; 
    96102  $output .= $content; 
     103  $output .= drupal_get_feeds(); 
    97104  $output .= "\n<!-- end content -->\n"; 
    98105 
     
    103110  $output  .= "   </td>\n"; 
    104111 
    105   if ($blocks = theme_blocks("right")) { 
    106     $output .= "   <td id=\"sidebar-right\">$blocks</td>\n"; 
     112  if ($show_blocks && !empty($blocks_right)) { 
     113    $output .= "   <td id=\"sidebar-right\">$blocks_right</td>\n"; 
    107114  } 
    108115 
     
    137144  $output .= " </div>\n"; 
    138145 
    139   $submitted = theme_get_setting("toggle_node_info_$node->type") ? array(t("By %author at %date", array('%author' => theme('username', $node), '%date' => format_date($node->created, 'small')))) : array(); 
    140  
    141  
    142   $digg = array("<a href='http://digg.com/submit?phase=2&url=".urlencode(url("node/".$node->nid, NULL, NULL, TRUE))."&title=".urlencode($node->title)."'>Digg this</a>"); 
     146  $submitted['node_submitted'] = theme_get_setting("toggle_node_info_$node->type") ? array( 
     147    'title' => t("By !author at @date", array('!author' => theme('username', $node), '@date' => format_date($node->created, 'small'))), 
     148    'html' => TRUE) : array(); 
    143149 
    144150  $terms = array(); 
    145   if (module_exist('taxonomy')) { 
     151  if (module_exists('taxonomy')) { 
    146152    $terms = taxonomy_link("taxonomy terms", $node); 
    147153  } 
    148154 
    149   $links = array_merge($submitted, $digg, $terms); 
     155  $links = array_merge($submitted, $terms); 
    150156  if ($node->links) { 
    151157    $links = array_merge($links, $node->links); 
    152158  } 
    153159  if (count($links)) { 
    154     $output .= " <div class=\"links\">". theme('links', $links) ."</div>\n"; 
     160    $output .= '<div class="links">'. theme('links', $links, array('class' => 'links inline')) ."</div>\n"; 
    155161  } 
    156162 
     
    161167 
    162168function yd_comment($comment, $links = "") { 
    163   $submitted = array(t('By %author at %date', array('%author' => theme('username', $comment), '%date' => format_date($comment->timestamp. 'small')))); 
    164  
     169  $submitted['comment_submitted'] = array( 
     170    'title' => t('By !author at @date', array('!author' => theme('username', $comment), '@date' => format_date($comment->timestamp, 'small'))), 
     171    'html' => TRUE); 
    165172  $output  = "<div class=\"comment". ($comment->status == COMMENT_NOT_PUBLISHED ? ' comment-unpublished' : '') ."\">\n"; 
    166173  $output .= " <h3 class=\"title\">". l($comment->subject, $_GET['q'], NULL, NULL, "comment-$comment->cid") ."</h3>\n"; 
Note: See TracChangeset for help on using the changeset viewer.