You are here

function disqus_migrate_admin_import_settings in Disqus 6

Menu callback for import settings

1 string reference to 'disqus_migrate_admin_import_settings'
disqus_migrate_menu in ./disqus_migrate.module
Implementation of hook_menu().

File

include/disqus_migrate.import.inc, line 6

Code

function disqus_migrate_admin_import_settings() {
  $form = array();
  $form['settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('Import Settings'),
  );
  $form['settings']['disqus_migrate_import_stop_on_errors'] = array(
    '#type' => 'checkbox',
    '#title' => t('Stop on errors'),
    '#description' => t('Leave checked to stop importing when encountering an error. Uncheck to skip over comments that produce errors. Either way, errors will be logged, but once a comment is skipped over, it becomes difficult to re-import it.'),
    '#default_value' => variable_get('disqus_migrate_import_stop_on_errors', 1),
  );
  $form['sync'] = array(
    '#type' => 'fieldset',
    '#title' => t('Automatic Import Settings'),
  );
  $form['sync']['disqus_migrate_import_sync_enabled'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enabled'),
    '#default_value' => variable_get('disqus_migrate_import_sync_enabled', 0),
    '#description' => t('Enable automatic comment imports on cron runs. New comments since the last import will be imported.'),
  );
  $form['sync']['disqus_migrate_import_sync_interval'] = array(
    '#type' => 'select',
    '#title' => t('Sync Interval'),
    '#default_value' => variable_get('disqus_migrate_import_sync_interval', 86400),
    '#description' => t('How often do you want to import new comments? Requires a properly configured cron.'),
    '#options' => array(
      0 => t('every cron run'),
      600 => t('every 10 minutes'),
      3600 => t('every hour'),
      43200 => t('every 12 hours'),
      86400 => t('once a day'),
    ),
  );
  $form['#validate'][] = 'disqus_migrate_admin_import_settings_validate';
  return system_settings_form($form);
}