function tracking_code_add_form in Tracking Code 7
Form for adding codeblocks (admin/structure/tracking_code/add).
Return value
array a renderable Form API array
1 string reference to 'tracking_code_add_form'
- tracking_code_menu in ./
tracking_code.module - Implements hook_menu().
File
- ./
tracking_code.admin.inc, line 163 - admin page callbacks and form handlers for the tracking code module
Code
function tracking_code_add_form() {
$form['tracking_code_name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
'#description' => t('Enter a name to describe this tracking code snippet'),
);
$form['tracking_code_code'] = array(
'#type' => 'textarea',
'#title' => t('Code'),
'#description' => t('Paste your tracking code here'),
);
if (module_exists('token')) {
$form['tokens'] = array(
'#theme' => 'token_tree',
'#token_types' => array(
'node',
),
'#global_types' => TRUE,
'#click_insert' => TRUE,
);
}
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save Snippet'),
);
return $form;
}