name . '-' . ($vars['action'] == 'flag' ? 'off' : 'on') . '.png'; // Uncomment the following line when debugging. //drupal_set_message("Flag is looking for '$image_file'..."); if (file_exists($image_file)) { $vars['link_text'] = ''; } } /** * Themeing function to render a selection (of items) according to a given * Hierarchical Select configuration as one or more lineages. * */ function danland_hierarchical_select_selection_as_lineages($selection, $config) { $output = ''; $selection = (!is_array($selection)) ? array($selection) : $selection; // Generate a dropbox out of the selection. This will automatically // calculate all lineages for us. $selection = array_keys($selection); $dropbox = _hierarchical_select_dropbox_generate($config, $selection); // Actual formatting. foreach ($dropbox->lineages as $id => $lineage) { if ($id > 0) { $output .= '
'; } $items = array(); foreach ($lineage as $level => $item) { $items[] = $item['label']; } $output .= implode('>', $items); } // Add the CSS. drupal_add_css(drupal_get_path('module', 'hierarchical_select') .'/hierarchical_select.css'); return $output; }