function get_tripal_feature_admin_form_url_set

1.x tripal_feature.admin.inc get_tripal_feature_admin_form_url_set(&$form)

Parameters

$form:

1 call to get_tripal_feature_admin_form_url_set()
tripal_feature_admin in tripal_feature/includes/tripal_feature.admin.inc

File

tripal_feature/includes/tripal_feature.admin.inc, line 347
@todo Add file header description

Code

function get_tripal_feature_admin_form_url_set(&$form) {


  $form['url'] = array(
    '#type' => 'fieldset',
    '#title' => t('Feature URL Path'),
    '#collapsible' => TRUE,
    '#collapsed' => TRUE,
  );

  $options = array(
    'SID[id]' => '[id]:' . t('The Chado feature_id'),
    'feature' => 'feature:' . t('Chado table name'),
    '[genus]' => '[genus]:' . t('Genus to which the feature belongs'),
    '[species]' => '[species]:' . t('Species to which the feature belongs'),
    '[type]' => '[type]:' . t('The type of feature'),
    '[uniquename]' => '[uniquename]:' . t('The feature unique name'),
    '[name]' => '[name]:' . t('The feature name'),
    'reset' => t('Reset'),
  );


  $form['url']['chado_feature_url_string'] = array(
    '#title' => 'URL Syntax',
    '#type' => 'textfield',
    '#description' => t('You may rearrange elements in this text box to
      customize the URLs.  The available tags include: [id],
      [uniquename]. [name], [species], [genus], [type]. You can separate or
      include any text between the tags. Click the "Set Feature URLs" button to 
      reset the URLs for all feature pages.  Click the "Save Configuration" button to
      simply save this setup. <b>Important</b>: be sure that whatever you choose will always be unique even considering
      future data that may be added.  If you include the Chado table name, genus, species, type 
      and uniquename you are guaranteed to have a unique URL. For example feature/[genus]/[species]/[type]/[uniquename]'),
    '#size' => 150,
    '#default_value' => variable_get('chado_feature_url_string', '/feature/[genus]/[species]/[type]/[uniquename]'),
  );

  $form['url']['chado_feature_url'] = array(
    '#title' => t('URL components'),
    '#type' => 'checkboxes',
    '#required' => FALSE,
    '#options' => $options,
    '#description' => t('Click the item above to make it appear in the URL Syntax box'),
    '#attributes' => array(
      'onclick' => '
        box = $(\'#edit-chado-feature-url-string\');
        if (this.value == \'reset\') {
          box.val(\'\');
        }
        else {        
          box.val(box.val() + "/" + this.value);          
        }
        this.checked = false;
      ',
    ),
  );

  $form['url']['button'] = array(
    '#type' => 'submit',
    '#value' => t('Set Feature URLs'),
  );
}