abstract class field_timer_formatter_js_base in Field Timer 7.2
Base class for formatters using js library.
Hierarchy
- class \field_timer_formatter_base implements field_timer_formatter_interface
Expanded class hierarchy of field_timer_formatter_js_base
File
- includes/
field_timer_base.inc, line 101 - Contains base help classes to perform field formatter related actions.
View source
abstract class field_timer_formatter_js_base extends field_timer_formatter_base {
protected $library_loaded = FALSE;
/**
* Get jQuery plugin name.
*
* @return string Plugin name.
*/
public abstract function getPluginName();
/**
* Load library files.
*
* @return bool Indicate if library files loaded successfully.
*/
protected abstract function loadLibrary();
/**
* Load custom JS and CSS files and JS settings.
*
* @param @see hook_field_formatter_view().
*/
protected function loadJSandCSS($entity_type, $entity, $field, $instance, $langcode, $items, $display) {
$js_settings = $this
->generateJSSettings($entity_type, $entity, $field, $instance, $langcode, $items, $display);
drupal_add_js(array(
'field_timer' => $js_settings,
), 'setting');
drupal_add_js(drupal_get_path('module', 'field_timer') . '/js/field_timer.js');
}
/**
* Generate JS settings.
*
* @param @see hook_field_formatter_view().
*
* @return array Drupal JS settings array.
*/
protected abstract function generateJSSettings($entity_type, $entity, $field, $instance, $langcode, $items, $display);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
field_timer_formatter_base:: |
abstract protected | function | Convert field item value to timestamp. | 16 |
field_timer_formatter_interface:: |
public | function | Check if it is possible to enable current formatter. | 3 |
field_timer_formatter_interface:: |
public | function | Get default formatter settings. All settings for each field type will be combined into one array. | 4 |
field_timer_formatter_interface:: |
public | function | Get field type. | 16 |
field_timer_formatter_interface:: |
public | function | Get formatter definition. | 4 |
field_timer_formatter_interface:: |
public | function | Get formatter name. | 4 |
field_timer_formatter_interface:: |
public | function | Get formatter settings form. | 4 |
field_timer_formatter_interface:: |
public | function | Get formatter settings summary. | 4 |
field_timer_formatter_interface:: |
public | function | Render field items. | 4 |
field_timer_formatter_js_base:: |
protected | property | ||
field_timer_formatter_js_base:: |
abstract protected | function | Generate JS settings. | 2 |
field_timer_formatter_js_base:: |
abstract public | function | Get jQuery plugin name. | 3 |
field_timer_formatter_js_base:: |
protected | function | Load custom JS and CSS files and JS settings. | 1 |
field_timer_formatter_js_base:: |
abstract protected | function | Load library files. | 2 |