You are here

function hook_views_flag_refresh_widgets in Views Flag Refresh 7

Same name and namespace in other branches
  1. 6 views_flag_refresh.api.php \hook_views_flag_refresh_widgets()

Defines refresh widgets that are displayed when a view is being refreshed.

Return value

array An array of widget definitions.

1 function implements hook_views_flag_refresh_widgets()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

views_flag_refresh_views_flag_refresh_widgets in ./views_flag_refresh.module
Implements hook_views_flag_refresh_widgets().
1 invocation of hook_views_flag_refresh_widgets()
views_flag_refresh_widgets_get in ./views_flag_refresh.module
Returns widget definitions from hook_views_flag_refresh_widgets() implementations.

File

./views_flag_refresh.api.php, line 14
Hooks defined by the Views Flag Refresh module.

Code

function hook_views_flag_refresh_widgets() {
  $widgets = array();

  // Array keys are the machine readable name of the widget.
  $widgets['throbber'] = array(
    // The human-readable name of the widget.
    'title' => t('Throbber image'),
    // The name of the method in the ViewsFlagRefresh.theme javascript class
    // that is called after the flag action has been completed and before the
    // Views AJAX request is executed.
    // (OPTIONAL)
    'theme hook' => 'throbber',
    // The name of the method in the ViewsFlagRefresh.theme javascript class
    // that is called after the data has been returned by the Views AJAX
    // request. This is normally implemented to clean up any elements added to
    // the the DOM by the method defined in the "theme hook" key above.
    // (OPTIONAL)
    'theme hook post' => 'throbberPost',
    // A brief description of what the widget does.
    // (OPTIONAL)
    'description' => t('Display a throbber image in place of the view content while it is being refreshed.'),
    // Specifies a javascript file that must be loaded to render the widget.
    // Usually the file contains the methods defined in the "theme hook" and
    // "theme hook post" keys above.
    // (OPTIONAL)
    'js file' => drupal_get_path('module', 'views_flag_refresh') . '/views_flag_refresh.js',
    // Specifies a CSS file that must be loaded to render the widget properly.
    // (OPTIONAL)
    'css file' => drupal_get_path('module', 'views_flag_refresh') . '/views_flag_refresh.css',
  );
  return $widgets;
}