You are here

function feedapi_aggregator_feedapi_settings_form in FeedAPI 5

Implementation of hook_feedapi_settings_form(). If a module provides parsers and processors it MUST evaluate the $type variable to return different forms for parsers and processors. There might be a better term for parsers and processors than $type.

File

feedapi_aggregator/feedapi_aggregator.module, line 186

Code

function feedapi_aggregator_feedapi_settings_form($type) {
  switch ($type) {
    case 'processors':
      $form = array();
      $form['block'] = array(
        '#type' => 'select',
        '#title' => t('Number of news items in block'),
        '#default_value' => 3,
        '#options' => drupal_map_assoc(array(
          2,
          3,
          4,
          5,
          6,
          7,
          8,
          9,
          10,
          11,
          12,
          13,
          14,
          15,
          16,
          17,
          18,
          19,
          20,
        )),
      );
      $categories_result = db_query('SELECT cid, title FROM {feedapi_aggregator_category}');
      $categories = array();
      while ($category = db_fetch_object($categories_result)) {
        $categories[$category->cid] = check_plain($category->title);
      }
      $form['categories'] = array(
        '#title' => t('Categories'),
        '#type' => variable_get('aggregator_category_selector', 'checkboxes'),
        '#options' => $categories,
        '#size' => 10,
        '#multiple' => TRUE,
        '#default_value' => array(),
      );
      return $form;
  }
}