23 January 2012

First you need to create a filter to your views. Add "Feeds log: Importer id" filter to All entries display / tab. Then this code snippet alters the form so there won't be textfield, but selection.

Source code viewer
  1. function HOOK_form_alter(&$form, &$form_state, $form_id) { // replace HOOK with your module name
  2. // filter feeds log by Importer
  3. if ($form_id == 'views_exposed_form') {
  4. $options = array('' => t('- Any -'));
  5. $result = db_query('SELECT * FROM {feeds_importer}');
  6. if ($result -> rowCount() > 0)
  7. foreach ($result as $row) {
  8. $importer = unserialize($row -> config);
  9. $options[$importer['name']] = $importer['name'];
  10. }
  11. $form['id'] = array('#type' => 'select', '#options' => $options, );
  12. }
  13. }
Programming Language: PHP