You are here

scs_views.pages.inc in Simplenews Content Selection 6.2

Integrate Simplenews Content Selection with views and views bulk operations

File

simplenews_content_selection_views/scs_views.pages.inc
View source
<?php

/**
 * @file
 * Integrate Simplenews Content Selection with views and views bulk operations
 */

/**
 * Views selection form
 */
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;
}

/**
 * Submit function for the selection form
 */
function scs_views_selection_form_submit($form, &$form_state) {
}

Functions

Namesort descending Description
scs_views_selection_form Views selection form
scs_views_selection_form_submit Submit function for the selection form