You are here

function _feedapi_format_settings in FeedAPI 5

Same name and namespace in other branches
  1. 6 feedapi.module \_feedapi_format_settings()

Returns per content type settings ordered by weight and only those that are turned on.

Parameters

$node_type_settings: Content type settings retrieved with feedapi_get_settings().

$stage_type: 'parsers' or 'processors'

2 calls to _feedapi_format_settings()
feedapi_nodeapi in ./feedapi.module
Implementation of hook_nodeapi().
_feedapi_build_feed_object in ./feedapi.module
Builds feed object ready to be sticked onto node.

File

./feedapi.module, line 1264
Handle the submodules (for feed and item processing) Provide a basic management of feeds

Code

function _feedapi_format_settings($node_type_settings, $stage_type) {
  $result = array();
  $settings = $node_type_settings[$stage_type];
  if (is_array($settings)) {
    foreach ($settings as $name => $properties) {
      if (isset($properties['enabled'])) {
        if ($properties['enabled'] == TRUE) {
          $result[$settings[$name]['weight']] = $name;
        }
      }
    }
    ksort($result);
  }
  return $result;
}