function tripal_example_admin
2.x tripal_example.admin.inc | tripal_example_admin() |
Administrative settings form
1 string reference to 'tripal_example_admin'
- tripal_example_menu in tripal_example/
tripal_example.module - Implements hook_menu()
File
- tripal_example/
includes/ tripal_example.admin.inc, line 50 - This file contains the functions used for administration of the module
Code
function tripal_example_admin() {
$form = array();
$form['nothing'] = array(
'#markup' => t('There are currently no settings to configure.')
);
// If your module is using the Chado Node: Title & Path API to allow custom
// titles for your node type then you need to add the configuration form for
// this functionality. To do so, we first have to preapre a $details array
// the describe our node type. Then we call the function to create the form
// elements.
$details = array(
// the name of the MODULE implementing the content type
'module' => 'tripal_example',
'content_type' => 'chado_example',
// An array of options to use under "Page Titles"
// the key should be the token and the value should be the human-readable
// option
'options' => array(
'[example.name]' => 'Germplasm Name Only',
'[example.uniquename]' => 'Germplasm Unique Name Only',
// there should always be one options matching the unique constraint.
// If you have a more human-readable constraint, then that is
// preferable.
// See the tripal feature module for a good example of this.
'[example.example_id]' => 'Unique Constraint: The Chado ID for Examples'
),
// the token indicating the unique constraint in the options array
'unique_option' => '[example.example_id]'
);
// This call adds the configuration form to your current form
// This sub-form handles it's own validation & submit
chado_add_admin_form_set_title($form, $form_state, $details);
return system_settings_form($form);
}