You are here

function freelinking_settings in Freelinking 5

Same name and namespace in other branches
  1. 6.3 freelinking.forms.inc \freelinking_settings()
  2. 6 freelinking.module \freelinking_settings()
  3. 6.2 freelinking.module \freelinking_settings()
  4. 7.3 freelinking.forms.inc \freelinking_settings()
1 string reference to 'freelinking_settings'
freelinking_menu in ./freelinking.module

File

./freelinking.module, line 263

Code

function freelinking_settings() {
  $notfoundoptions = array(
    'create only' => t('Only try to create content'),
    'no access search' => t('Search for content if user can\'t create'),
    'always search' => t('Always search for content'),
  );
  $form["freelinking_nodetype"] = array(
    '#title' => t('Default for new content'),
    '#type' => 'select',
    '#options' => node_get_types('names'),
    '#default_value' => variable_get("freelinking_nodetype", 'story'),
    '#description' => t('Type of content that the freelinking filter will create when clicking on a freelink without a target.'),
  );
  $form['freelinking_notfound'] = array(
    '#title' => t('What to do if content not found'),
    '#type' => 'select',
    '#options' => $notfoundoptions,
    '#default_value' => variable_get('freelinking_notfound', 'no access search'),
    '#description' => t('What to do when clicking on a freelink without a target. Choose to always attempt to create the content, search if the user doesn\'t have permission to create (the default), or to always search. NOTE: search functions require search.module to be activated.'),
  );
  $form["freelinking_restriction"] = array(
    '#title' => t('Restrict free links to this content type'),
    '#type' => 'select',
    '#options' => array_merge(array(
      'none' => t('No restrictions'),
    ), node_get_types('names')),
    '#default_value' => variable_get("freelinking_restriction", 'none'),
    '#description' => t('If desired, you can restrict the freelinking title search to just content of this type. Note that if it is not the same as the "Default for new content," above, new freelinked content cannot be found.'),
  );
  $form["freelinking_camelcase"] = array(
    '#title' => t('Allow CamelCase linking'),
    '#type' => 'checkbox',
    '#default_value' => variable_get("freelinking_camelcase", 1) == 1 ? TRUE : FALSE,
    '#description' => t('If desired, you can disable CamelCase linking'),
  );
  $form["freelinking_onceonly"] = array(
    '#title' => t('Only link first occurrence'),
    '#type' => 'checkbox',
    '#default_value' => variable_get("freelinking_onceonly", 0) == 1 ? TRUE : FALSE,
    '#description' => t('If desired you can only turn the first occurrence of a freelink into a link. This can improve the appearance of content that includes a lot of the same CamelCase words.'),
  );
  return system_settings_form($form);
}