You are here

function services_client_get_plugins in Services Client 7.2

Same name and namespace in other branches
  1. 7 services_client.module \services_client_get_plugins()

Get list of all plugins

Parameters

string $type: Type of required plugins

bool $select_box: Whether should be returned back as options for select box in format PluginName => Human Readable

callable $filter: Function that can be used in array_filter

Return value

array List of plugins.

4 calls to services_client_get_plugins()
ServicesClientMappingPlugin::configForm in include/mapping.inc
Configuration form options
services_client_ctools_export_ui_form in ./services_client.forms.inc
Define the preset add/edit form.
services_client_plugin_add in ./services_client.forms.inc
Form; Add new plugin.
services_client_wizard_form_details in ./services_client.admin.inc
Form step 1; Initial event details.

File

./services_client.plugins.inc, line 65
Ctools plugin related functions

Code

function services_client_get_plugins($type, $select_box = FALSE, $filter = NULL) {
  ctools_include('plugins');
  $plugins = ctools_get_plugins('services_client', $type);

  // Let other modules alter list of plugins
  drupal_alter('services_client_plugins', $plugins, $type);
  if (is_callable($filter)) {
    $plugins = array_filter($plugins, $filter);
  }
  if ($select_box) {
    $plugins = array_map(function ($item) {
      return $item['name'];
    }, $plugins);
  }
  return $plugins;
}