You are here

function forward_admin_settings in Forward 5

Same name and namespace in other branches
  1. 6 forward.module \forward_admin_settings()
  2. 7.3 forward.admin.inc \forward_admin_settings()
  3. 7 forward.module \forward_admin_settings()
  4. 7.2 forward.admin.inc \forward_admin_settings()

Administration Page

1 string reference to 'forward_admin_settings'
forward_menu in ./forward.module
Menu Hooks

File

./forward.module, line 78

Code

function forward_admin_settings() {
  global $base_url;
  $host = parse_url($base_url);

  // Administrative Options
  $form['forward_options'] = array(
    '#type' => 'fieldset',
    '#title' => t('Administrative Options'),
    '#collapsible' => true,
    '#collapsed' => false,
  );
  $form['forward_options']['forward_link_style'] = array(
    '#type' => 'radios',
    '#title' => t('Link style'),
    '#default_value' => variable_get('forward_link_style', 0),
    '#options' => array(
      0 => t('Text only'),
      1 => t('Icon only'),
      2 => t('Icon and text'),
    ),
    '#description' => t('Select the visual style of the link.'),
  );
  $form['forward_options']['forward_link_type'] = array(
    '#type' => 'checkbox',
    '#title' => t('Use Node Type in Link'),
    '#return_value' => 1,
    '#default_value' => variable_get('forward_link_type', false),
    '#description' => t('If checked, the link will read &quot;email this <em>nodetype</em>&quot;; if not, it will just read &quot;email this page&quot;'),
  );
  $form['forward_options']['forward_link_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Link title'),
    '#size' => 40,
    '#default_value' => variable_get('forward_link_title', 'Email this !type'),
    '#description' => t('Set the text of the link.  Use !type as a place holder for the node\'s content type or \'page\' depending on the setting above.'),
  );
  $form['forward_options']['forward_display_teasers'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show Forward on teasers'),
    '#return_value' => 1,
    '#default_value' => variable_get('forward_display_teasers', false),
    '#description' => t('If checked, the link/form will appear on teasers in lists of nodes'),
  );
  $form['forward_options']['forward_display_comments'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show Forward on comments'),
    '#return_value' => 1,
    '#default_value' => variable_get('forward_display_comments', false),
    '#description' => t('If checked, the link/form will appear on comments'),
  );
  $form['forward_options']['forward_display_nonnode'] = array(
    '#type' => 'checkbox',
    '#title' => t('Show Forward on non-node pages'),
    '#return_value' => 1,
    '#default_value' => variable_get('forward_display_nonnode', false),
    '#description' => t('If checked, the link/form will appear on non-node pages like views and other module pages'),
  );
  $form['forward_options']['forward_form_type'] = array(
    '#type' => 'select',
    '#title' => t('Form Type'),
    '#default_value' => variable_get('forward_form_type', 'link'),
    '#options' => array(
      'link' => 'link',
      'form' => 'form',
    ),
    '#description' => t('Select link for a forward this page link or form to use a collapsible forwarding form.'),
  );
  $form['forward_options']['forward_flood_control'] = array(
    '#type' => 'select',
    '#title' => t('Flood Control Limit'),
    '#default_value' => variable_get('forward_flood_control', 10),
    '#options' => array(
      '1' => '1',
      '5' => '5',
      '10' => '10',
      '15' => '15',
      '20' => '20',
      '25' => '25',
      '30' => '30',
      '35' => '35',
      '40' => '40',
      '50' => '50',
    ),
    '#description' => t('How many times a user can use the form in a one hour period. This will help prevent the forward module from being used for spamming.'),
  );
  $form['forward_options']['forward_flood_error'] = array(
    '#type' => 'textfield',
    '#title' => t('Flood Control Error'),
    '#default_value' => variable_get('forward_flood_error', t('You can\'t send more than !number messages per hour. Please try again later.')),
    '#size' => 80,
    '#maxlength' => 256,
    '#description' => t('This text appears if a user exceeds the flood control limit.  The value of the flood control limit setting will appear in place of !number in the message presented to users'),
  );
  $form['forward_options']['forward_filter_html'] = array(
    '#type' => 'checkbox',
    '#title' => t('Allow HTML Messages'),
    '#return_value' => 1,
    '#default_value' => variable_get('forward_filter_html', false),
    '#description' => t('If checked, will filter XSS and all tags not allowed below from the custom body field.  Otherwise, the body will converted to plain text with all HTML converted to character entities'),
  );
  $form['forward_options']['forward_filter_tags'] = array(
    '#type' => 'textfield',
    '#title' => t('Allowed HTML Tags'),
    '#size' => 40,
    '#default_value' => variable_get('forward_filter_tags', 'p,br,em,strong,cite,code,ul,ol,li,dl,dt,dd'),
    '#description' => t('List of allowed tags (separated by commas) that will be allowed by the XSS filter if enabled above.  The default tags allowed are: p,br,em,strong,cite,code,ul,ol,li,dl,dt,dd'),
  );
  $form['forward_options']['forward_sender_address'] = array(
    '#type' => 'textfield',
    '#title' => t('From Address'),
    '#default_value' => variable_get('forward_sender_address', ''),
    '#size' => 40,
    '#maxlength' => 40,
    '#description' => t('If left blank, the from address entered in the form will be used as the from address for the email.  Enter a valid email address here to override that.  The sender\'s email will still appear in the body of the message.'),
  );

  // Page Text Values
  $form['forward_text_values'] = array(
    '#type' => 'fieldset',
    '#title' => t('Page Text Values'),
    '#collapsible' => true,
    '#collapsed' => false,
  );
  $form['forward_text_values']['forward_instructions'] = array(
    '#type' => 'textarea',
    '#title' => t('Forward Instructions'),
    '#default_value' => variable_get('forward_instructions', '<p>Thank you for your interest in spreading the word about !site.</p><p>NOTE: We only request your email address so that the person you are recommending the page to knows that you wanted them to see it, and that it is not junk mail. We do not capture any email address.</p>'),
    '#cols' => 40,
    '#rows' => 10,
    '#description' => t('This message will be displayed above the form.  The token !site will be replaced with the site name.'),
  );
  $form['forward_text_values']['forward_thankyou'] = array(
    '#type' => 'textarea',
    '#title' => t('Thank You Message'),
    '#default_value' => variable_get('forward_thankyou', 'Thank you for your help in spreading the word about !site.  We appreciate your help.'),
    '#cols' => 40,
    '#rows' => 10,
    '#description' => t('This message will be displayed after the user successfully submits the form.  The token !site will be replaced with the site name.'),
  );

  // Forward Form Default Values
  $form['forward_page_defaults'] = array(
    '#type' => 'fieldset',
    '#title' => t('Default Values for Email This Page'),
    '#collapsible' => true,
    '#collapsed' => false,
    '#description' => t('These options will set the default values for the "email this page" form.'),
  );
  $form['forward_page_defaults']['forward_header_image'] = array(
    '#type' => 'textfield',
    '#title' => t('Header Image for Email'),
    '#default_value' => variable_get('forward_header_image', ''),
    '#size' => 40,
    '#maxlength' => 256,
    '#description' => t('Enter the URL of the image to as a logo at the top of forwarded pages.'),
    '#attributes' => false,
  );
  $form['forward_page_defaults']['forward_page_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Forward Page Title'),
    '#default_value' => variable_get('forward_page_title', t('Forward this page')),
    '#size' => 40,
    '#maxlength' => 256,
    '#description' => t('Title to display above the Forward page form'),
  );
  $form['forward_page_defaults']['forward_emailsubject'] = array(
    '#type' => 'textfield',
    '#title' => t('Forward Message Subject'),
    '#default_value' => variable_get('forward_emailsubject', t('!name has forwarded a page to you from !site')),
    '#size' => 40,
    '#maxlength' => 256,
    '#description' => t('Email subject line.  The sender\'s name will appear in place of !name in the subject.  The web site name will be inserted in place of !site.'),
  );
  $form['forward_page_defaults']['forward_emailmessage'] = array(
    '#type' => 'textarea',
    '#title' => t('Forward Message Body'),
    '#default_value' => variable_get('forward_emailmessage', t('!name thought you would like to see this page from the !site web site.')),
    '#cols' => 40,
    '#rows' => 10,
    '#description' => t('Email message body.  The sender\'s name will appear in place of !name in the message body.  The web site name will be inserted in place of !site.  The sender will be able to add their own message after this.'),
  );

  // Forward Form Default Values
  $form['forward_epostcard_defaults'] = array(
    '#type' => 'fieldset',
    '#title' => t('Default Values for e-Postcard'),
    '#collapsible' => true,
    '#collapsed' => false,
    '#description' => t('These options will set the default values for the "Send an e-Postcard" form.'),
  );
  $form['forward_epostcard_defaults']['forward_epostcard_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Forward e-Postcard Title'),
    '#default_value' => variable_get('forward_epostcard_title', t('Send an e-Postcard')),
    '#size' => 40,
    '#maxlength' => 256,
    '#description' => t('Title to display above the Forward page form'),
  );
  $form['forward_epostcard_defaults']['forward_postcardsubject'] = array(
    '#type' => 'textfield',
    '#title' => t('e-Postcard Message Subject'),
    '#default_value' => variable_get('forward_postcardsubject', t('!name has sent you an e-postcard from !site')),
    '#size' => 40,
    '#maxlength' => 256,
    '#description' => t('Postcard subject line.  The sender\'s name will appear in place of !name in the subject.  The web site name will be inserted in place of !site.'),
  );
  $form['forward_epostcard_defaults']['forward_postcardmessage'] = array(
    '#type' => 'textarea',
    '#title' => t('e-Postcard Message Body'),
    '#default_value' => variable_get('forward_postcardmessage', t('!name has sent you an e-postcard from the !site web site.  Please take a moment to visit our web site.')),
    '#cols' => 40,
    '#rows' => 10,
    '#description' => t('Postcard message body.  The sender\'s name will appear in place of !name in the message body.  The web site name will be inserted in place of !site.  The sender will be able to add their own message after this.  You can use HTML in this field to add a special postcard image to the email above the sender\'s message.'),
  );
  $form['forward_epostcard_defaults']['forward_ad_footer'] = array(
    '#type' => 'textarea',
    '#title' => t('Oranization Ad'),
    '#default_value' => variable_get('forward_ad_footer', " "),
    '#cols' => 40,
    '#rows' => 10,
    '#description' => t('This message will be just above the footer message in the email.'),
  );
  $form['forward_epostcard_defaults']['forward_footer'] = array(
    '#type' => 'textarea',
    '#title' => t('Footer Message'),
    '#default_value' => variable_get('forward_footer', " "),
    '#cols' => 40,
    '#rows' => 4,
    '#description' => t('This message will be appended as a footer message to the email.'),
  );
  $dyn_options = array(
    'node' => t('Latest Blog Articles'),
    'user' => t('Latest Users'),
    'comment' => t('Latest Comments'),
    'popular' => t('Most Popular Content'),
    'none' => t('None'),
  );
  $form['forward_epostcard_defaults']['forward_dynamic_block'] = array(
    '#type' => 'radios',
    '#title' => t('Dynamic Block'),
    '#default_value' => variable_get('forward_dynamic_block', 'none'),
    '#options' => $dyn_options,
    '#description' => t('Choose the dynamic block to send with these emails'),
    '#required' => true,
    '#attributes' => null,
  );
  $form['forward_epostcard_defaults']['forward_epostcard_return'] = array(
    '#type' => 'textfield',
    '#title' => t('e-Postcard Return URL'),
    '#default_value' => variable_get('forward_epostcard_return', ''),
    '#size' => 40,
    '#description' => t('URL of path to redirect users to after submitting the epostcard form.'),
  );
  return system_settings_form($form);
}