/** * Implements QuickEditEditorSelectorInterface::getEditorAttachments(). */ public function getEditorAttachments(array $editor_ids) { $attachments = array(); $editor_ids = array_unique($editor_ids); // Editor plugins' attachments. foreach ($editor_ids as $editor_id) { $editor_plugin = _quickedit_get_editor_plugin($editor_id); $attachments[$editor_id] = $editor_plugin->getAttachments(); // Allows contrib to declare additional dependencies for the editor. drupal_alter('quickedit_editor_attachments', $attachments[$editor_id], $editor_id); } return drupal_array_merge_deep_array($attachments); }
/** * Implements EditEditorSelectorInterface::getEditorAttachments(). */ public function getEditorAttachments(array $editor_ids, array $metadata) { $attachments = array(); // Editor plugins' attachments. foreach (array_unique($editor_ids) as $editor_id) { $editor = edit_editor_get($editor_id); if (!empty($editor['attachments callback'])) { if ($editor['file']) { require_once $editor['file path'] . '/' . $editor['file']; } if (function_exists($editor['attachments callback'])) { $attachments[$editor_id] = $editor['attachments callback']($metadata); // Allows contrib to declare additional dependencies for the editor. drupal_alter('edit_editor_attachments', $attachments[$editor_id], $editor_id, $metadata); } } } // JavaScript settings for Edit. foreach (array_unique($editor_ids) as $editor_id) { $editor = edit_editor_get($editor_id); $attachments[] = array('js' => array(array('type' => 'setting', 'data' => array('edit' => array('editors' => array($editor_id => array('widget' => $editor['widget']))))))); } return drupal_array_merge_deep_array($attachments); }