public static function SuggestionHelper::types in Autocomplete Search Suggestions 7
Build an array of content types used in auto-complete.
Return value
array An array of enabled content types.
3 calls to SuggestionHelper::types()
- SuggestionStorage::getScore in src/
SuggestionStorage.php - Calculate a suggestion's score.
- SuggestionStorage::getTitles in src/
SuggestionStorage.php - Fetch an array of node titles.
- suggestion_node_insert in ./
suggestion.module - Implements hook_node_insert().
File
- src/
SuggestionHelper.php, line 291 - Helper methods for the suggestion module.
Class
- SuggestionHelper
- Provides helper methods for suggestions.
Code
public static function types() {
$types =& drupal_static(__CLASS__ . '_' . __FUNCTION__, NULL);
if (is_array($types)) {
return $types;
}
foreach (variable_get('suggestion_types', array()) as $type => $status) {
if ($status) {
$types[] = $type;
}
}
return $types ? $types : array();
}