function tripal_contact_admin
2.x tripal_contact.admin.inc | tripal_contact_admin() |
3.x tripal_contact.admin.inc | tripal_contact_admin() |
1.x tripal_contact.admin.inc | tripal_contact_admin() |
Administrative settings form
Related topics
1 string reference to 'tripal_contact_admin'
- tripal_contact_menu in tripal_contact/
tripal_contact.module - Implemets hook_menu(). Adds menu items for the tripal_contact module menu. This section gives the outline for the main menu of the Tripal-contact module
File
- tripal_contact/
includes/ tripal_contact.admin.inc, line 50 - Handle administration of contacts.
Code
function tripal_contact_admin() {
$form = array();
// 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.
$details = array(
'module' => 'tripal_contact', // the name of the MODULE implementing the content type
'content_type' => 'chado_contact', // the name of the content type
// 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(
'[contact.name]' => 'Contact Name Only',
// there should always be one options matching the unique constraint.
'[contact.name]' => 'Unique Contraint: The name of the contact'
),
// the token indicating the unique constraint in the options array
'unique_option' => '[contact.name]'
);
// 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);
// URL ALIAS
$details = array(
'module' => 'tripal_contact',
'content_type' => 'chado_contact',
'options' => array(
'/contact/[contact.contact_id]' => 'Contact ID',
'/contact/[contact.name]' => 'Unique Contraint: The name of the contact'
),
);
// This call adds the configuration form to your current form
// This sub-form handles it's own validation & submit
chado_add_admin_form_set_url($form, $form_state, $details);
return system_settings_form($form);
}