| 4 |
* @author Ryan Hughes <ryan@linuxbox.com> |
* @author Ryan Hughes <ryan@linuxbox.com> |
| 5 |
*/ |
*/ |
| 6 |
|
|
| 7 |
function theme_taxonomygroup_taxonomygroup_teaser($view, $nodes, $type) { |
function theme_taxonomygroup_group_teaser($view, $nodes, $type) { |
| 8 |
return theme("taxonomygroup_taxonomygroup", $view, $nodes, $type, true); |
return theme("taxonomygroup_group", $view, $nodes, $type, true); |
| 9 |
} // funciton theme_taxonomygroup_taxonomygroup_teaser |
} // funciton theme_taxonomygroup_taxonomygroup_teaser |
| 10 |
|
|
| 11 |
|
|
| 12 |
function theme_taxonomygroup_taxonomygroup($view, $nodes, $type, $teaser=false) { |
function theme_taxonomygroup_group($view, $nodes, $type, $teaser=false) { |
|
$output = ""; |
|
|
|
|
| 13 |
drupal_add_css(drupal_get_path('module', 'views_group_pack').'/taxonomygroup.css'); |
drupal_add_css(drupal_get_path('module', 'views_group_pack').'/taxonomygroup.css'); |
| 14 |
|
|
| 15 |
if (isset($view->sort[0]['field'])) { |
if (isset($view->sort[0]['field'])) { |
| 29 |
$by_taxonomy[$term][] = $node; |
$by_taxonomy[$term][] = $node; |
| 30 |
} // foreach node |
} // foreach node |
| 31 |
|
|
| 32 |
$output .= "<div id=\"taxonomygroup\" class=\"taxonomygroup\">"; |
return theme("taxonomygroup_taxonomygroup", $view, $by_taxonomy, $type, $teaser); |
| 33 |
|
} // function theme_taxonomygroup_taxonomygroup |
| 34 |
|
|
| 35 |
|
|
| 36 |
|
/** |
| 37 |
|
* Theme all the groups. |
| 38 |
|
* @param object $view The view that's showing these nodes. |
| 39 |
|
* @param array $by_taxonomy array('term' => array(node1, node2, ...), ...) |
| 40 |
|
* @param mixed $type ... |
| 41 |
|
* @param boolean $teaser Are we printing full nodes (t) or teasers (f)? |
| 42 |
|
*/ |
| 43 |
|
function theme_taxonomygroup_taxonomygroup($view, $by_taxonomy, $type, $teaser) { |
| 44 |
|
$output = "<div id=\"taxonomygroup\" class=\"taxonomygroup\">"; |
| 45 |
foreach ($by_taxonomy as $term => $termlist) { |
foreach ($by_taxonomy as $term => $termlist) { |
| 46 |
$output .= theme('taxonomygroup_term', $termlist, $term, $teaser); |
$output .= theme('taxonomygroup_term', $termlist, $term, $teaser); |
| 47 |
} // foreach term |
} // foreach term |
| 48 |
$output .= "</div><!-- taxonomygroup -->"; |
$output .= "</div><!-- taxonomygroup -->"; |
| 49 |
|
|
| 50 |
return $output; |
return $output; |
| 51 |
} // function theme_taxonomygroup_taxonomygroup |
} |
| 52 |
|
|
| 53 |
|
|
| 54 |
|
/** |
| 55 |
|
* Theme a list of nodes associated with a term. |
| 56 |
|
* @param array $termlist array(node1, node2, ...) |
| 57 |
|
* @param string $term The name of the taxonomy term. |
| 58 |
|
* @param boolean $teaser Are we printing full nodes (t) or teasers (f)? |
| 59 |
|
*/ |
| 60 |
function theme_taxonomygroup_term($termlist, $term, $teaser=false) { |
function theme_taxonomygroup_term($termlist, $term, $teaser=false) { |
| 61 |
$output = ""; |
$output = ""; |
| 62 |
$output .= "<div id=\"taxonomygroup-{$term}-header\" class=\"taxonomygroup-header taxonomygroup-{$term}-header\">{$term}</div>"; |
$output .= "<div id=\"taxonomygroup-{$term}-header\" class=\"taxonomygroup-header taxonomygroup-{$term}-header\">{$term}</div>"; |