You are here

function _quickedit_get_editor_plugin in Quick Edit 7

Helper to get a get an instance of an in-place editor plugin class.

Parameters

string $editor_id: ID of the in-place editor plugin.

bool $reset: Whether to reset the static cache of in-place editor plugin objects.

Return value

QuickEditInPlaceEditorInterface An in-place editor plugin object.

3 calls to _quickedit_get_editor_plugin()
QuickEditEditorSelector::getEditor in includes/QuickEditEditorSelector.php
Implements QuickEditEditorSelectorInterface::getEditor().
QuickEditEditorSelector::getEditorAttachments in includes/QuickEditEditorSelector.php
Implements QuickEditEditorSelectorInterface::getEditorAttachments().
QuickEditMetadataGenerator::generateFieldMetadata in includes/QuickEditMetadataGenerator.php
Implements QuickEditMetadataGeneratorInterface::generateFieldMetadata().

File

./quickedit.module, line 666
Provides in-place content editing functionality for fields.

Code

function _quickedit_get_editor_plugin($editor_id, $reset = FALSE) {
  $editors = quickedit_editor_list();
  $plugins =& drupal_static(__FUNCTION__, NULL);
  if (!$plugins || $reset) {
    foreach ($editors as $editor_plugin_id => $editor) {
      require_once $editor['file'];
      $plugins[$editor_plugin_id] = new $editor['class']();
    }
  }
  return $plugins[$editor_id];
}