taxonomy.inc in Power Menu 7.2
File
plugins/menu_handlers/taxonomy.inc
View source
<?php
if (module_exists('taxonomy')) {
$plugin = array(
'title' => t("Taxonomy plugin"),
'description' => t('Sets the active menu trail based on a taxonomy term linked to a menu link.'),
'has edit form' => TRUE,
'handler' => array(
'class' => 'PowerMenuTaxonomyHandler',
),
);
}
function power_menu_taxonomy_terms_post_render($content, $element) {
$terms = variable_get('power_menu_taxonomy_terms', array());
$mlid = arg(4);
foreach ($terms as $key => $value) {
if ($mlid != $value) {
$content = preg_replace('/( value="' . $key . '")/', '$1 disabled="disabled"', $content, 1);
}
}
return $content;
}