You are here

function clone_settings in Node clone 5.2

Same name and namespace in other branches
  1. 5 clone.module \clone_settings()
  2. 6 clone.pages.inc \clone_settings()
  3. 7 clone.pages.inc \clone_settings()

menu callback to configure module settings.

1 string reference to 'clone_settings'
clone_menu in ./clone.module
Implementation of hook_menu().

File

./clone.module, line 81

Code

function clone_settings() {
  $form['heading'] = array(
    '#value' => '<b>' . t('Configuration options for the clone module:') . '</b>',
  );
  $form['publishing'] = array(
    '#type' => 'fieldset',
    '#title' => t('Should the publishing options ( e.g. published, promoted, etc) be reset to the defaults?'),
  );
  $types = node_get_types('names');
  foreach ($types as $type => $name) {
    $form['publishing']['clone_reset_' . $type] = array(
      '#type' => 'checkbox',
      '#title' => t('@s: reset publishing options when cloned', array(
        '@s' => $name,
      )),
      '#default_value' => variable_get('clone_reset_' . $type, FALSE),
    );
  }

  // Need the variable default key to be something that's never a valid node type.
  $types = array_merge(array(
    '!' => "<" . t("none") . ">",
  ), $types);
  $form['clone_omitted'] = array(
    '#type' => 'select',
    '#title' => t('Omitted content types'),
    '#default_value' => variable_get('clone_omitted', array(
      '!',
    )),
    '#options' => $types,
    '#description' => t('Select any node types which should <em>never</em> be cloned. Typically you should will want to select here all node types for which cloning fails (e.g. image nodes).'),
    '#multiple' => TRUE,
  );
  $form['clone_method'] = array(
    '#type' => 'value',
    '#value' => 'prepopulate',
  );
  return system_settings_form($form);
}