function itoggle_views_handler_field::init in iToggle 7
Same name and namespace in other branches
- 7.2 modules/views/itoggle_views_handler_field.inc \itoggle_views_handler_field::init()
Init the handler with necessary data.
Parameters
view $view: The $view object this handler is attached to.
array $options: The item from the database; the actual contents of this will vary based upon the type of handler.
Overrides views_handler_field::init
File
- modules/
views/ itoggle_views_handler.inc, line 22 - View handler for iToggle Views
Class
- itoggle_views_handler_field
- A handler to provide a custom field
Code
function init(&$view, &$options) {
// find out the field name (ie what entity type and what property)
$field_name = str_replace('itoggle_', '', $options['id']);
list($type, $property) = explode('_', $field_name);
// store info in instance variable
$this->_itoggle = array(
'info' => itoggle_get_entity_info(),
'type' => $type,
'property' => $property,
);
if (self::$_itoggle_init === FALSE) {
self::$_itoggle_init = TRUE;
itoggle_include_itoggle();
itoggle_include_settings();
drupal_add_js(drupal_get_path('module', 'itoggle') . '/js/itoggle.js');
}
parent::init($view, $options);
}