You are here

function _linkit_add_settings in Linkit 6

Same name and namespace in other branches
  1. 7 linkit.module \_linkit_add_settings()
  2. 7.2 linkit.module \_linkit_add_settings()
3 calls to _linkit_add_settings()
linkit_form_alter in ./linkit.module
Implementation of hook_form_alter().
linkit_textarea in ./linkit.module
linkit_wysiwyg_plugin in ./linkit.module

File

./linkit.module, line 418
Main file for linkit module.

Code

function _linkit_add_settings($editor) {
  static $editor_settings_added = array();
  static $global_settings_added = FALSE;
  if (!isset($editor_settings_added[$editor])) {
    $editor_settings_added[$editor] = TRUE;

    // Add popup url
    $settings = array(
      'linkit' => array(
        'url' => array(
          $editor => url('admin/linkit/dashboard/' . $editor),
        ),
      ),
    );
    drupal_add_js($settings, 'setting');
  }
  if (!$global_settings_added) {
    $global_settings_added = TRUE;

    // Add global settings for Linkit
    $settings = array(
      'linkit' => array(
        'modulepath' => drupal_get_path('module', 'linkit'),
      ),
    );
    drupal_add_js($settings, 'setting');
  }
}