You are here

function scs_views_selection_form in Simplenews Content Selection 6.2

Views selection form

1 string reference to 'scs_views_selection_form'
scs_views_menu in simplenews_content_selection_views/scs_views.module
Implementation of hook_menu().

File

simplenews_content_selection_views/scs_views.pages.inc, line 12
Integrate Simplenews Content Selection with views and views bulk operations

Code

function scs_views_selection_form() {
  $form = array();

  //General
  $form['newsletter_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Title'),
    '#description' => t('Enter the title of this newsletter'),
    '#required' => TRUE,
  );

  //Newsletter type
  $content_types = variable_get('simplenews_content_types', array());
  if (count($content_types) != 1) {
    $form['newsletter_content_type'] = array(
      '#type' => 'select',
      '#title' => t('Content type'),
      '#description' => t('Select the content type of the newsletter you are creating. Only the content types selected ' . l('here', 'admin/settings/simplenews/general') . ' are displayed.'),
      '#options' => $content_types,
    );
  }

  //Views
  $views = views_get_all_views();
  foreach ($views as $name => $view) {
    $form['view_' . $name] = array(
      '#type' => 'checkbox',
      '#title' => $name,
    );
  }
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Create newsletter'),
  );
  return $form;
}