taxonomy_facets.module in Taxonomy Facets 8
File
taxonomy_facets.module
View source
<?php
function taxonomy_facets_get_menu_tree($vocab_name) {
$menu = new \Drupal\taxonomy_facets\MenuTree($vocab_name);
$menu_tree = $menu
->getMenuTree();
$menu_items = null;
foreach ($menu_tree as $item) {
$menu_items .= render($item);
}
return $menu_items;
}
function taxonomy_facets_get_selected_filters($taxo_facets_path = null) {
$filters =& drupal_static(__FUNCTION__);
if (!isset($filters)) {
if ($taxo_facets_path) {
$taxo_facets_path = explode(':', $taxo_facets_path);
}
else {
$taxo_facets_path = \Drupal::request()
->getRequestUri();
$taxo_facets_path = explode('/', $taxo_facets_path);
if ($taxo_facets_path[1] === 'listings') {
array_splice($taxo_facets_path, 0, 2);
}
else {
$taxo_facets_path = null;
if ($taxo_facets_path = \Drupal::request()
->get('taxonomy_facets')) {
$taxo_facets_path = explode('/', $taxo_facets_path);
}
}
}
if ($taxo_facets_path) {
$filters = new \Drupal\taxonomy_facets\SelectedFilters($taxo_facets_path);
}
else {
$filters = null;
}
}
return $filters;
}
function taxonomy_facets_theme($existing, $type, $theme, $path) {
return array(
'taxonomy_facets_menu_leaf_template' => array(
'variables' => array(
'menuLeaf' => NULL,
),
'template' => 'taxonomy_facets_menu_leaf-template',
),
'taxonomy_facets_ul_wrapper_end_template' => array(
'variables' => array(),
'template' => 'taxonomy_facets_ul_wrapper_end-template',
),
'taxonomy_facets_ul_wrapper_begin_template' => array(
'variables' => array(
'menuClass' => NULL,
),
'template' => 'taxonomy_facets_ul_wrapper_begin-template',
),
'taxonomy_facets_remove_filter_template' => array(
'variables' => array(
'menuHed' => NULL,
),
'template' => 'taxonomy_facets_remove_filter-template',
),
);
}
function taxonomy_facets_node_presave($node) {
$nodeTerms = new \Drupal\taxonomy_facets\NodeTerms($node);
}