Subversion Repositories Sites.obs-saisons.fr

Rev

Rev 93 | Rev 109 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 93 Rev 94
Line 23... Line 23...
23
    print ' class="'. $class .'"';
23
    print ' class="'. $class .'"';
24
  }
24
  }
25
}
25
}
Line 26... Line 26...
26
 
26
 
-
 
27
/**
-
 
28
 * Return a themed set of links.
-
 
29
 *
-
 
30
 * @param $links
-
 
31
 *   A keyed array of links to be themed.
-
 
32
 * @param $attributes
-
 
33
 *   A keyed array of attributes
-
 
34
 * @return
-
 
35
 *   A string containing an unordered list of links.
-
 
36
 */
-
 
37
function ods_links($links, $attributes = array('class' => 'links')) {
-
 
38
	
-
 
39
  global $language;
-
 
40
  $output = '';
-
 
41
 
-
 
42
  if (count($links) > 0) {
-
 
43
    $output = '<ul'. drupal_attributes($attributes) .'>';
-
 
44
 
-
 
45
    $num_links = count($links);
-
 
46
    $i = 1;
-
 
47
 
-
 
48
    foreach ($links as $key => $link) {
-
 
49
      $class = $key;
-
 
50
 
-
 
51
      // Add first, last and active classes to the list of links to help out themers.
-
 
52
      if ($i == 1) {
-
 
53
        $class .= ' first';
-
 
54
      }
-
 
55
      if ($i == $num_links) {
-
 
56
        $class .= ' last';
-
 
57
      }
-
 
58
      if (isset($link['href']) && ($link['href'] == $_GET['q'] || ($link['href'] == '<front>' && drupal_is_front_page()))
-
 
59
          && (empty($link['language']) || $link['language']->language == $language->language)) {
-
 
60
        $class .= ' active';
-
 
61
      }
-
 
62
            	
-
 
63
      $class .= ' lien_primaire_'.$i;
-
 
64
      
-
 
65
      $output .= '<li'. drupal_attributes(array('class' => $class)) .'>';
-
 
66
 
-
 
67
      if (isset($link['href'])) {
-
 
68
      	
-
 
69
      	if($i == 1) {
-
 
70
      		$link['html'] = true;
-
 
71
      		$link['title'] = '<img class="icone_acceuil" alt="'.$link['title'].'" src="'.base_path().path_to_theme().'/images/accueil.png" />';
-
 
72
      	}
-
 
73
      	
-
 
74
        // Pass in $link as $options, they share the same keys.
-
 
75
        $output .= l($link['title'], $link['href'], $link);
-
 
76
      }
-
 
77
      else if (!empty($link['title'])) {
-
 
78
        // Some links are actually not links, but we wrap these in <span> for adding title and class attributes
-
 
79
        if (empty($link['html'])) {
-
 
80
          $link['title'] = check_plain($link['title']);
-
 
81
        }
-
 
82
        $span_attributes = '';
-
 
83
        if (isset($link['attributes'])) {
-
 
84
          $span_attributes = drupal_attributes($link['attributes']);
-
 
85
        }
-
 
86
        $output .= '<span'. $span_attributes .'>'. $link['title'] .'</span>';
-
 
87
      }
-
 
88
 
-
 
89
      $i++;
-
 
90
      $output .= "</li>\n";
-
 
91
    }
-
 
92
 
-
 
93
    $output .= '</ul>';
-
 
94
  }
-
 
95
 
-
 
96
  return $output;
-
 
97
}
-
 
98
 
27
/**
99
/**
28
 * Return a themed breadcrumb trail.
100
 * Return a themed breadcrumb trail.
29
 *
101
 *
30
 * @param $breadcrumb
102
 * @param $breadcrumb
31
 *   An array containing the breadcrumb links.
103
 *   An array containing the breadcrumb links.
Line 50... Line 122...
50
}
122
}
Line 51... Line 123...
51
 
123
 
52
/**
124
/**
53
 * Add a "Comments" heading above comments except on forum pages.
125
 * Add a "Comments" heading above comments except on forum pages.
54
 */
126
 */
55
function garland_preprocess_comment_wrapper(&$vars) {
127
function ods_preprocess_comment_wrapper(&$vars) {
56
  if ($vars['content'] && $vars['node']->type != 'forum') {
128
  if ($vars['content'] && $vars['node']->type != 'forum') {
57
    $vars['content'] = '<h2 class="comments">'. t('Comments') .'</h2>'.  $vars['content'];
129
    $vars['content'] = '<h2 class="comments">'. t('Comments') .'</h2>'.  $vars['content'];
58
  }
130
  }