You are here

function feed_import_change_status in Feed Import 7

Same name and namespace in other branches
  1. 7.2 feed_import.module \feed_import_change_status()

Enable/disable feeds

Parameters

string $how: enable/disable options

int $id: Feed id to enable or disable

1 string reference to 'feed_import_change_status'
feed_import_menu in ./feed_import.module
Implements hook_menu().

File

./feed_import.module, line 720
User interface, cron functions for feed_import module

Code

function feed_import_change_status($how, $id = 0) {
  $id = (int) $id;
  if ($id) {
    $how = $how == 'enable' ? 1 : 0;
    db_update('feed_import_settings')
      ->fields(array(
      'enabled' => $how,
    ))
      ->condition('id', $id, '=')
      ->execute();
    drupal_set_message($how ? t('Feed enabled') : t('Feed disabled'));
  }
  drupal_goto(FEED_IMPORT_PATH);
}