You are here

function feedapi_block in FeedAPI 5

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

Implementation of hook_block().

File

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

Code

function feedapi_block($op = 'list', $delta = 0) {
  $blocks = array();
  $names = feedapi_get_types();
  switch ($op) {
    case 'list':
      foreach ($names as $type => $name) {
        $blocks[$type]['info'] = t('FeedAPI: Quick create !preset', array(
          '!preset' => $name,
        ));
      }
      break;
    case 'view':
      if (node_access('create', $delta)) {
        $blocks['subject'] = t('Create !preset', array(
          '!preset' => $names[$delta],
        ));
        $blocks['content'] = drupal_get_form('feedapi_simplified_form', $delta);
      }
      break;
  }
  return $blocks;
}