You are here

function patterns_settings in Patterns 6.2

Same name and namespace in other branches
  1. 6 patterns.module \patterns_settings()

Display the pattern settings form

1 string reference to 'patterns_settings'
patterns_menu in ./patterns.module
Implementation of hook_menu().

File

./patterns.module, line 196
Enables extremely simple adding/removing features to your site with minimal to no configuration

Code

function patterns_settings(&$form_state) {
  $form['patterns_form_helper'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable Patterns Form Helper'),
    '#description' => t('When enabled, patterns form helper will dump $form_id and $form_state variables at the bottom of each page. Dump will always contain values from the latest form submission. This may be very helpful while writing your own patterns.'),
    '#default_value' => variable_get('patterns_form_helper', FALSE),
  );
  $form['patterns_allow_publish'] = array(
    '#type' => 'checkbox',
    '#title' => t('Share your patterns'),
    '#description' => t('When enabled, you will be able to "publish" selected patterns and make them available to other patterns users on the following URL: %url.', array(
      '%url' => url(NULL, array(
        'absolute' => TRUE,
      )) . (variable_get('clean_url', 0) ? '' : '?q=') . 'patterns.xml',
    )),
    '#default_value' => variable_get('patterns_allow_publish', FALSE),
  );

  // Reload patterns while we are here and ensure the lists are up to date
  patterns_get_patterns(TRUE);
  return system_settings_form($form);
}