You are here

function emfield_settings_jobqueue in Embedded Media Field 6

Same name and namespace in other branches
  1. 6.3 emfield.admin.inc \emfield_settings_jobqueue()
  2. 6.3 deprecated/emfield-deprecated.admin.inc \emfield_settings_jobqueue()
  3. 6.2 emfield.admin.inc \emfield_settings_jobqueue()

Menu callback settings form. If job_queue module is installed, admins can reload embedded media data in bulk

1 string reference to 'emfield_settings_jobqueue'
emfield_menu in ./emfield.module
Implementation of hook_menu().

File

./emfield.admin.inc, line 174
The administrative settings page.

Code

function emfield_settings_jobqueue() {
  $form = array();
  $form['job_queue'] = array(
    '#type' => 'fieldset',
    '#title' => t('Reload Embedded Media Data'),
    '#description' => t('You can reload the embedded media data on all nodes on your site if necessary.  This action will be queued to run on cron via the job queue module.'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $types = content_types();
  $options = array();
  foreach ($types as $type) {
    foreach ($type['fields'] as $field) {
      if (module_hook($field['type'], 'emfield_info')) {
        $options[$type['type']] = $type['name'];
      }
    }
  }
  if (count($options)) {
    $form['job_queue']['types'] = array(
      '#type' => 'checkboxes',
      '#title' => t('Types to reload'),
      '#options' => $options,
      '#description' => t('Choose the content types to reload'),
    );
    $form['job_queue']['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Submit'),
    );
  }
  return $form;
}