function feedapi_enabled_type in FeedAPI 6
Same name and namespace in other branches
- 5 feedapi.module \feedapi_enabled_type()
Determines wether feedapi is enabled for given node type. If parser or processor is passed in, this function determines wether given parser or processor is enabled for given node type.
Parameters
$node_type: A Drupal node type.
$parser_or_processor: A parser or processor - pass in by module name.
Return value
TRUE if enabled, FALSE if not.
14 calls to feedapi_enabled_type()
- feedapi_create_node in ./
feedapi.module - Create a feedapi node programatically.
- feedapi_form_alter in ./
feedapi.module - Implementation of hook_form_alter().
- feedapi_get_types in ./
feedapi.module - Return a list of FeedAPI-enabled content-types list, ready-to-use for #options at FormsAPI
- feedapi_handler_filter_feed_content_type::query in views/
handlers/ feedapi_handler_filter_feed_content_type.inc - feedapi_inherit_nodeapi in feedapi_inherit/
feedapi_inherit.module - Implementation of hook_nodeapi().
File
- ./
feedapi.module, line 1138 - Handle the submodules (for feed and item processing) Provide a basic management of feeds
Code
function feedapi_enabled_type($node_type, $parser_or_processor = '') {
$settings = feedapi_get_settings($node_type);
if (empty($parser_or_processor)) {
if (isset($settings['enabled'])) {
return $settings['enabled'] ? TRUE : FALSE;
}
else {
return FALSE;
}
}
foreach (array(
'parsers',
'processors',
) as $stage) {
if (isset($settings[$stage][$parser_or_processor]['enabled'])) {
if ($settings[$stage][$parser_or_processor]['enabled'] == TRUE) {
return TRUE;
}
}
}
return FALSE;
}