You are here

function wysiwyg_wrap_js_callback in Wysiwyg 7.2

Same name and namespace in other branches
  1. 5.2 wysiwyg.module \wysiwyg_wrap_js_callback()
  2. 6.2 wysiwyg.module \wysiwyg_wrap_js_callback()

Create a placeholder structure for JavaScript callbacks.

Parameters

$name: A string with the name of the callback, use 'object.subobject.method' syntax for methods in nested objects.

$context: An optional string with the name of an object for overriding 'this' inside the function. Use 'object.subobject' syntax for nested objects. Defaults to the window object.

Return value

An array with placeholder information for creating a JavaScript function reference on the client.

Related topics

2 calls to wysiwyg_wrap_js_callback()
hook_wysiwyg_editor_settings_alter in ./wysiwyg.api.php
Act on editor profile settings.
wysiwyg_tinymce_settings in editors/tinymce.inc
Return runtime editor settings for a given wysiwyg profile.

File

./wysiwyg.module, line 1383

Code

function wysiwyg_wrap_js_callback($name, $context = NULL) {
  $obj = array(
    'drupalWysiwygType' => 'callback',
    'name' => $name,
  );
  if ($context) {
    $obj['context'] = $context;
  }
  return $obj;
}