You are here

public function CurrentSearchItem::getTokenTree in Facet API 7.2

Same name and namespace in other branches
  1. 6.3 contrib/current_search/plugins/current_search/item.inc \CurrentSearchItem::getTokenTree()
  2. 7 contrib/current_search/plugins/current_search/item.inc \CurrentSearchItem::getTokenTree()

Returns the token tree element.

if the Token module is not installed, alerts the administrator that using Token module will allow them to view the replacement patterns.

Return value

array The token FAPI element.

3 calls to CurrentSearchItem::getTokenTree()
CurrentSearchGroup::settingsForm in contrib/current_search/plugins/current_search/item_group.inc
Implements CurrentSearchItem::settingsForm().
CurrentSearchItemActive::settingsForm in contrib/current_search/plugins/current_search/item_active.inc
Implements CurrentSearchItem::settingsForm().
CurrentSearchItemText::settingsForm in contrib/current_search/plugins/current_search/item_text.inc
Implements CurrentSearchItem::settingsForm().

File

contrib/current_search/plugins/current_search/item.inc, line 229
Base current search item plugin class.

Class

CurrentSearchItem
Abstract class extended by current search item plugins.

Code

public function getTokenTree(array $types = array()) {
  if (module_exists('token')) {
    return array(
      '#theme' => 'token_tree',
      '#token_types' => $types,
    );
  }
  else {
    return array(
      '#markup' => '<p>' . t('Install the <a href="http://drupal.org/project/token" target="_blank" title="Token module project page">Token</a> module to view available replacement patterns.') . '</p>',
    );
  }
}