You are here

scs.admin.inc in Simplenews Content Selection 6

Same filename and directory in other branches
  1. 8 scs.admin.inc
  2. 6.2 scs.admin.inc
  3. 7.2 scs.admin.inc
  4. 7 scs.admin.inc

File

scs.admin.inc
View source
<?php

/*
 * @file
 * Select Drupal content to create a newsletter
 */

/*
 * Admin settings form
 */
function scs_admin_settings_form() {
  $form = array();
  $form['scs_content_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Content types'),
    '#description' => t('Select the content types that must be avaiable for node selection'),
    '#options' => _scs_get_node_types(),
    '#default_value' => variable_get('scs_content_types', array()),
  );
  $form['scs_format'] = array(
    '#type' => 'radios',
    '#title' => t('Newsletter format'),
    '#description' => t('Select the format of the newsletters you want to send'),
    '#options' => array(
      'plain' => t('Plain'),
      'html' => t('HTML'),
    ),
    '#default_value' => variable_get('scs_format', 'plain'),
  );
  return system_settings_form($form);
}

/*
 * Return avaiable node types in option list
 */
function _scs_get_node_types() {
  $options = array();
  foreach (node_get_types() as $name => $type) {
    $options[$name] = $type->name;
  }
  return $options;
}