You are here

function _tmgmt_plugin_info in Translation Management Tool 7

Discovers all available source and/or translator plugins.

Parameters

$type: The type of the plugin. Can be 'translator' or 'source'.

$plugin: (Optional) The machine-readable name of a source plugin.

Return value

array An array of source and/or translator plugins.

5 calls to _tmgmt_plugin_info()
TMGMTPluginBase::__construct in plugin/tmgmt.plugin.base.inc
Constructor.
tmgmt_file_format_plugin_info in translators/file/tmgmt_file.module
Returns information about file format plugins.
tmgmt_source_plugin_info in ./tmgmt.module
Determines all available source object plugins.
tmgmt_translator_plugin_info in ./tmgmt.module
Determines all available service plugins.
_tmgmt_plugin_controller in ./tmgmt.module
Determines the controller class for a given plugin type.
2 string references to '_tmgmt_plugin_info'
TMGMTI18nStringSourceTestCase::testI18nStringSourceMenu in sources/i18n_string/tmgmt_i18n_string.test
TMGMTPluginsTestCase::testRemoteLanguagesMappings in tests/tmgmt.plugin.test
Tests remote languages mappings support in the tmgmt core.

File

./tmgmt.module, line 1232
Main module file for the Translation Management module.

Code

function _tmgmt_plugin_info($type, $plugin = NULL) {
  $info =& drupal_static(__FUNCTION__);
  if (!isset($info[$type])) {
    $info[$type] = array();
    foreach (module_implements('tmgmt_' . $type . '_plugin_info') as $module) {
      foreach (module_invoke($module, 'tmgmt_' . $type . '_plugin_info') as $key => $item) {
        $info[$type][$key] = $item;
        $info[$type][$key]['module'] = $module;
        $info[$type][$key]['plugin'] = $key;
      }
    }
    drupal_alter('tmgmt_' . $type . '_plugin_info', $info[$type]);
  }
  if (isset($plugin) && isset($info[$type][$plugin])) {
    return $info[$type][$plugin];
  }
  elseif (!isset($plugin)) {
    return $info[$type];
  }
}