You are here

function admin_content_notification_settings_form in Admin Content Notification 7

Same name and namespace in other branches
  1. 7.2 includes/admin_content_notification.admin.inc \admin_content_notification_settings_form()

Implements hook_settings_form().

1 string reference to 'admin_content_notification_settings_form'
admin_content_notification_menu in ./admin_content_notification.module
Implements hook_menu().

File

includes/admin_content_notification.admin.inc, line 11
Admin setting form.

Code

function admin_content_notification_settings_form($form) {
  $form = array();
  $form['admin_content_notification_fieldset'] = array(
    '#type' => 'fieldset',
    '#title' => t('Select the content types'),
    '#description' => t('Choose the content type for which you want to send notification on content insert.'),
  );
  $form['admin_content_notification_fieldset']['admin_content_notification_node_types'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Content types'),
    '#default_value' => variable_get('admin_content_notification_node_types', array()),
    '#options' => node_type_get_names(),
  );
  $admin_mail = variable_get('site_mail', ini_get('sendmail_from'));
  $form['admin_content_notification_email'] = array(
    '#type' => 'textfield',
    '#title' => t('Email to whom the notification is to be sent'),
    '#default_value' => variable_get('admin_content_notification_email', $admin_mail),
  );
  $form['admin_content_notification_email_fieldset'] = array(
    '#type' => 'fieldset',
    '#title' => t('Email Settings'),
  );
  $form['admin_content_notification_email_fieldset']['admin_content_notification_email_subject'] = array(
    '#type' => 'textfield',
    '#title' => t('Configurable email subject'),
    '#default_value' => variable_get('admin_content_notification_email_subject', 'A New Content is Posted'),
    '#description' => t('Enter a default subject of the notification email.'),
  );
  $form['admin_content_notification_email_fieldset']['admin_content_notification_email_body'] = array(
    '#type' => 'textarea',
    '#title' => t('Configurable email body'),
    '#default_value' => variable_get('admin_content_notification_email_body', 'A new content has been submitted on your site. <br/> Submitted by : %posted_by <br/> New content link : %content_link'),
    '#description' => t('Enter the default email template to notify users about new content posted on the site. Use the following tokens: %posted_by, %content_link'),
  );
  return system_settings_form($form);
}