[ Index ]

PHP Cross Reference of Drupal 6 (gatewave)

title

Body

[close]

/sites/all/modules/station/archive/ -> station_archive.admin.inc (source)

   1  <?php
   2  // $Id: station_archive.admin.inc,v 1.3 2009/11/28 22:06:44 drewish Exp $
   3  
   4  /**
   5   * Archive settings form.
   6   */
   7  function station_archive_admin_settings() {
   8    $times = array(86400, 172800, 259200, 345600, 432000, 518400, 604800, 1209600, 1814400, 2419200, 3024000, 3628800, 4233600, 4838400, 5443200, 6048000);
   9    $ageoptions = drupal_map_assoc($times, 'format_interval');
  10  
  11    $form['import'] = array(
  12      '#type' => 'fieldset',
  13      '#title' => t('Import'),
  14      '#collapsible' => FALSE,
  15    );
  16    $form['import']['station_archive_import_new'] = array(
  17      '#type' => 'checkbox',
  18      '#title' => t('Import new audio'),
  19      '#default_value' => variable_get('station_archive_import_new', 1),
  20      '#description' => t("If this is checked, audio files left in the import directory will be added to the archive. The only reason to uncheck this is if you're running into a bug and want to stop imports until it can be fixed."),
  21    );
  22    $form['import']['station_archive_import_dir'] = array(
  23      '#type' => 'textfield',
  24      '#title' => t('Import path'),
  25      '#default_value' => variable_get('station_archive_import_dir', drupal_get_path('module', 'station_archive') .'/import'),
  26      '#after_build' => array('system_check_directory'),
  27      '#required' => TRUE,
  28      '#description' => t('The directory where new MP3s are left by the stream ripper script. Drupal will need to have write access to this directory so we can move the file.'),
  29    );
  30    $form['import']['title_format']['station_archive_title_format'] = array(
  31      '#type' => 'textfield',
  32      '#title' => t('Title format'),
  33      '#default_value' => variable_get('station_archive_title_format', '[audio-tag-title-raw]'),
  34      '#required' => TRUE,
  35      '#description' => t('This will be used as the title format for the audio nodes. You can use the tokens listed below to insert information into the title. <strong>Note:</strong> it is safe to use the -raw tokens.'),
  36    );
  37    $form['import']['title_format']['token_help'] = array(
  38      '#title' => t('Token list'),
  39      '#type' => 'fieldset',
  40      '#collapsible' => TRUE,
  41      '#collapsed' => TRUE,
  42      '#description' => t('This is a list of the tokens that can be used in the title of audio nodes.'),
  43      'help' => array('#value' => theme('token_help', 'node')),
  44    );
  45    $form['import']['scheduled'] = array(
  46      '#type' => 'fieldset',
  47      '#title' => t('Scheduled'),
  48      '#collapsible' => FALSE,
  49      '#description' => t("These settings apply to audio recorded during a time when a program is scheduled. The program's information will be used to fill in the audio node's title, artist and genre tags."),
  50    );
  51    $form['import']['scheduled']['station_archive_promote_scheduled'] = array(
  52      '#type' => 'checkbox',
  53      '#title' => t('Promote scheduled audio'),
  54      '#default_value' => variable_get('station_archive_promote_scheduled', 1),
  55      '#description' => t("If this is checked, audio nodes recorded during scheduled programs will be promoted to the front page."),
  56    );
  57    $form['import']['unscheduled'] = array(
  58      '#type' => 'fieldset',
  59      '#title' => t('Uncheduled'),
  60      '#collapsible' => FALSE,
  61      '#description' => t("These settings apply to audio recorded during a time when no program is scheduled."),
  62    );
  63    $form['import']['unscheduled']['station_archive_delete_unscheduled'] = array(
  64      '#type' => 'checkbox',
  65      '#title' => t('Discard unscheduled audio'),
  66      '#default_value' => variable_get('station_archive_delete_unscheduled', 0),
  67      '#description' => t("If this is checked, any audio recorded during an unscheduled time will be deleted rather than imported."),
  68    );
  69    $form['import']['unscheduled']['station_archive_unscheduled_title'] = array(
  70      '#type' => 'textfield',
  71      '#title' => t('Unscheduled audio title'),
  72      '#default_value' => variable_get('station_archive_unscheduled_title', t('DJ Auto mix')),
  73      '#required' => TRUE,
  74      '#description' => t("This value will be used for the audio node's title tag field when importing audio recorded during an unscheduled time."),
  75    );
  76  
  77    $form['cleanup'] = array(
  78      '#type' => 'fieldset',
  79      '#title' => t('Clean up'),
  80      '#collapsible' => FALSE,
  81    );
  82    $form['cleanup']['station_archive_cleanup_old'] = array(
  83      '#type' => 'checkbox',
  84      '#title' => t('Remove old audio'),
  85      '#default_value' => variable_get('station_archive_cleanup_old', 1),
  86      '#description' => t("If this is checked, audio that's older than the maximum age will be removed."),
  87    );
  88    $form['cleanup']['station_archive_max_age'] = array(
  89      '#type' => 'select',
  90      '#title' => t('Maximum age'),
  91      '#default_value' => variable_get('station_archive_max_age', 604800),
  92      '#options' => $ageoptions,
  93      '#description' => t("Audio that's been in the archive longer than this will be removed."),
  94      '#required' => TRUE,
  95    );
  96  
  97    return system_settings_form($form);
  98  }


Generated: Thu Mar 24 11:18:33 2011 Cross-referenced by PHPXref 0.7