You are here

function feedapi_enabled_type in FeedAPI 5

Same name and namespace in other branches
  1. 6 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.

9 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_inherit_nodeapi in feedapi_inherit/feedapi_inherit.module
Implementation of hook_nodeapi().
feedapi_nodeapi in ./feedapi.module
Implementation of hook_nodeapi().

... See full list

File

./feedapi.module, line 1030
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;
}