You are here

function alinks_add_form in Alinks 7

Same name and namespace in other branches
  1. 6 alinks.module \alinks_add_form()

Generate the form used to add alinks to drupal

2 string references to 'alinks_add_form'
alinks_menu in ./alinks.module
Implementation of hook_menu().
alinks_page in ./alinks.module
Generate the page that will render the forms for adding and editing Alinks

File

./alinks.module, line 275
this module allows users to associates defined text to links

Code

function alinks_add_form() {
  $form['alinks_add_form'] = array(
    '#type' => 'fieldset',
    '#title' => t('Add alink'),
    '#description' => t('Use this form to add alinks'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
  );
  $form['alinks_add_form']['start_boundary'] = array(
    '#type' => 'checkbox',
    '#title' => t('Start Boundary'),
    '#description' => t('Enable if the string doesn\'t begin with an alphanumeric or underscore character.'),
  );
  $form['alinks_add_form']['word'] = array(
    '#type' => 'textfield',
    '#title' => t('Word/Phrase'),
    '#size' => 30,
    '#maxlength' => 255,
    '#description' => t('The word or phrase you wish to convert to a link. This field is case sensitive.'),
    '#required' => TRUE,
  );
  $form['alinks_add_form']['end_boundary'] = array(
    '#type' => 'checkbox',
    '#title' => t('End Boundary'),
    '#description' => t('Enable if the string doesn\'t end with an alphanumeric or underscore character.'),
  );
  $form['alinks_add_form']['case_insensitive'] = array(
    '#type' => 'checkbox',
    '#title' => t('Case Insensitivity'),
    '#description' => t('By default alinks are CaSe SeNsItIvE. Chech this checkbox if you want this particular ' . 'alink to be case insensitive.'),
  );
  $form['alinks_add_form']['url'] = array(
    '#type' => 'textfield',
    '#title' => t('URL'),
    '#size' => 30,
    '#maxlength' => 255,
    '#description' => t('The URL of the page to link to. Internal (Drupal) links take the form "my/page", from the ' . 'full URL of "example.com/my/page".'),
    '#required' => TRUE,
  );
  $form['alinks_add_form']['url_title'] = array(
    '#type' => 'textfield',
    '#title' => t('URL Title'),
    '#size' => 30,
    '#maxlength' => 255,
    '#description' => t('Title for the above URL. It will be embedded in the created link and appear as a tooltip ' . 'when hovering the mouse over the link.'),
  );
  $form['alinks_add_form']['external'] = array(
    '#type' => 'checkbox',
    '#title' => t('External Link'),
    '#description' => t('Check this if the link is to an external domain and be sure to include http:// in the link.'),
  );
  $form['alinks_add_form']['class'] = array(
    '#type' => 'textfield',
    '#title' => t('Class'),
    '#size' => 30,
    '#maxlength' => 255,
    '#default_value' => 'alinks-link',
    '#description' => t('Use this to add a class for the link. Default value is "alinks-link".'),
  );
  $form['alinks_add_form']['weight'] = array(
    '#type' => 'weight',
    '#title' => t('Weight'),
  );
  $form['alinks_add_form']['save'] = array(
    '#type' => 'submit',
    '#value' => t('Add alink'),
  );
  return $form;
}