Skip to content

Commit

Permalink
Merge pull request #887 from NuCivic/886-facet-icon-function
Browse files Browse the repository at this point in the history
NuCivic#886 Move theme function from nuboot_radix theme into the facet_icon module
  • Loading branch information
MSolv committed Feb 3, 2016
2 parents d56ec1e + e0c144d commit 7531916
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ function dkan_sitewide_panels_preprocess_panels_style_collapsible(&$variables) {
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,20 @@ function facet_icons_facetapi_widgets() {
),
),
);
}
}

/**
* Implements hook_theme().
*
* @see https://github.com/NuCivic/nuboot_radix/blob/7.x-1.x/template.php
*/
function facet_icons_theme($existing, $type, $theme, $path) {
return array(
// You will need to implement theme_facet_icons() in your theme or module
// to make this work. For an example, see the nuboot_radix theme's
// implementation.
'facet_icons' => array(
'variables' => array('class' => array(), 'type' => NULL),
),
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class FacetapiContentTypeIcon extends FacetapiWidgetLinks {

$row = array('class' => array());
$type = (isset($item['#indexed_value'])) ? $item['#indexed_value'] : '';
$icon = nuboot_radix_icon( array('type'=> $type, 'class' => array('facet-icon')));
$icon = theme('facet_icons', array('type'=> $type, 'class' => array('facet-icon')));

// Initializes variables passed to theme hook.
$variables = array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ class FacetapiTermIcon extends FacetapiWidgetLinks {
foreach ($build as $value => $item) {
$row = array('class' => array());
$type = '';
$icon = nuboot_radix_icon( array('type'=> $type, 'class' => array('facet-icon')));
$icon = theme('facet_icons', array('type'=> $type, 'class' => array('facet-icon')));
if (isset($item['#indexed_value']) && $term = taxonomy_term_load($item['#indexed_value'])) {
$icon = nuboot_radix_icon( array('type'=> $term->machine_name, 'class' => array('facet-icon')));
$icon = theme('facet_icons', array('type'=> $term->machine_name, 'class' => array('facet-icon')));
}

// Initializes variables passed to theme hook.
Expand Down

0 comments on commit 7531916

Please sign in to comment.