function ga_push_browser_event_form in GA Push 7
GA Push browser event create/edit form.
Parameters
object $gapb_event: GA Push browser event.
Return value
array Form.
2 string references to 'ga_push_browser_event_form'
- ga_push_browser_event_add in modules/
browser/ ga_push_browser.forms.inc - Add new GA PUsh Browser Event page callback.
- ga_push_browser_menu in modules/
browser/ ga_push_browser.module - Implements hook_menu().
File
- modules/
browser/ ga_push_browser.forms.inc, line 30 - Forms for the ga_push_browser module.
Code
function ga_push_browser_event_form($form, &$form_state, $gapb_event) {
$form_state['gapb_event'] = $gapb_event;
$form = array();
$form['name'] = array(
'#type' => 'textfield',
'#title' => t('Name'),
'#description' => t('Administration name'),
'#required' => TRUE,
'#default_value' => isset($gapb_event->name) ? $gapb_event->name : NULL,
);
$form['status'] = array(
'#type' => 'checkbox',
'#title' => t('Active'),
'#default_value' => isset($gapb_event->status) ? $gapb_event->status : TRUE,
);
$form['selector'] = array(
'#type' => 'textarea',
'#title' => t('jQuery selector'),
'#rows' => 1,
'#description' => t('jQuery selector'),
'#required' => TRUE,
'#default_value' => isset($gapb_event->selector) ? $gapb_event->selector : NULL,
);
$form['bind'] = array(
'#type' => 'textfield',
'#title' => t('jQuery bind'),
'#description' => t('jQuery bind trigger handler: click, mouseenter, mouseleave... See documentation on !link', array(
'!link' => l('http://api.jquery.com/bind/', 'http://api.jquery.com/bind/'),
)),
'#default_value' => 'click',
'#required' => TRUE,
'#default_value' => isset($gapb_event->bind) ? $gapb_event->bind : NULL,
);
$form['ga_category'] = array(
'#type' => 'textfield',
'#title' => t('GA Category'),
'#description' => t('Google analytics category event'),
'#required' => TRUE,
'#default_value' => isset($gapb_event->ga_category) ? $gapb_event->ga_category : NULL,
);
$form['ga_action'] = array(
'#type' => 'textfield',
'#title' => t('GA Action'),
'#description' => t('Google analytics action event'),
'#required' => TRUE,
'#default_value' => isset($gapb_event->ga_action) ? $gapb_event->ga_action : NULL,
);
$form['ga_label'] = array(
'#type' => 'textfield',
'#title' => t('GA Label'),
'#description' => t('Google analytics label event'),
'#default_value' => isset($gapb_event->ga_label) ? $gapb_event->ga_label : NULL,
);
$form['ga_value'] = array(
'#type' => 'textfield',
'#title' => t('GA Value'),
'#description' => t('Google analytics value event'),
'#default_value' => isset($gapb_event->ga_value) ? $gapb_event->ga_value : NULL,
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Submit'),
);
$form['#redirect'] = array();
return $form;
}