You are here

function freelinking_settings in Freelinking 6.2

Same name and namespace in other branches
  1. 5 freelinking.module \freelinking_settings()
  2. 6.3 freelinking.forms.inc \freelinking_settings()
  3. 6 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 241

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',
    '#multiple' => 'true',
    '#options' => array_merge(array(
      'none' => t('No restrictions'),
    ), node_get_types('names')),
    '#default_value' => variable_get("freelinking_restriction", array(
      'none',
    )),
    '#description' => t('If desired, you can restrict the freelinking title search to just content of these types. Note that if this does not include 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", 0),
    '#description' => t('If desired, you can enable CamelCase linking'),
  );
  $form["freelinking_onceonly"] = array(
    '#title' => t('Only link first occurance'),
    '#type' => 'checkbox',
    '#default_value' => variable_get("freelinking_onceonly", 0) == 1 ? TRUE : FALSE,
    '#description' => t('If desired you can only turn the first occurance 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);
}