You are here

function purr_messages_settings in Purr Messages 7

Same name and namespace in other branches
  1. 8.2 purr_messages.admin.inc \purr_messages_settings()
  2. 6.2 purr_messages.admin.inc \purr_messages_settings()
  3. 6 purr_messages.module \purr_messages_settings()
  4. 7.2 purr_messages.admin.inc \purr_messages_settings()

Implements hook_settings(). Configuration settings page.

Return value

Array of the system settings form.

1 string reference to 'purr_messages_settings'
purr_messages_menu in ./purr_messages.module
Implements hook_menu().

File

./purr_messages.module, line 69
Purr Messages A jQuery based override of Drupal's core message system

Code

function purr_messages_settings() {
  $module_path = drupal_get_path('module', 'purr_messages');
  $form['purr_messages_code_status'] = array(
    '#type' => 'fieldset',
    '#title' => t('Purr Messages settings'),
    '#weight' => -10,
    '#description' => purr_messages_status() !== FALSE ? t('You have a custom css file in: <br/>/%path/purrcss/') : t('You are using the default purr style. To use custom css and images simply
      copy the <em>\'purrcss\'</em> folder from: <br/>%modulepath<br/> and place
      it in your theme folder: <br/>%path<br/>Then make the alterations you want
      to the copied version in your theme folder. This module will automatically
      pick up the changes and this message will change if you\'ve done it
      correctly.<br/>', array(
      '%path' => path_to_theme(),
      '%modulepath' => $module_path,
    )),
  );
  $form['purr_messages_code_status']['purr_messages_code'] = array(
    '#type' => 'textarea',
    '#title' => t('The settings code'),
    '#rows' => 10,
    '#weight' => -10,
    '#default_value' => variable_get('purr_messages_code', _purr_messages_defaults()),
    '#description' => t('Add the purr messages options here. Example option code is
      already provided, simply adjust the values to suit. More information about the
      options can be found here: !netperspective', array(
      '!netperspective' => l('http://kitchen.net-perspective.com/open-source/purr', 'http://kitchen.net-perspective.com/open-source/purr'),
    )),
  );
  $form['purr_messages_admin_path'] = array(
    '#type' => 'checkbox',
    '#title' => t('Disable purr messages on admin paths'),
    '#description' => t('Checking this box will disable purr messages on admin paths,
      as determined by the path_is_admin() function.'),
    '#default_value' => variable_get('purr_messages_admin_path', FALSE),
  );
  $form['purr_messages_explicit'] = array(
    '#type' => 'checkbox',
    '#title' => t('Only show purr message style if explicitly called'),
    '#description' => t('This option will only display a purr style message
      if called explicitly with the \'purr\' parameter as the type in
      <code>drupal_set_message()</code>.<br/> For example:
      <code>drupal_set_message(\'my message\'), \'purr\');</code>'),
    '#default_value' => variable_get('purr_messages_explicit', FALSE),
  );
  return system_settings_form($form);
}