You are here

function editor_invoke_profiles in Editor 5

Same name and namespace in other branches
  1. 6 editor.module \editor_invoke_profiles()

Invokes hook_editor_profiles().

This hook provides modules with access to provide their own editor profiles.

@returns array Profiles

See also

editor_profile_create()

2 calls to editor_invoke_profiles()
editor_profile_get in ./editor.module
Get a plugin profile object.
editor_settings_profiles in ./editor.module
Profile settings form.

File

./editor.module, line 521
Extendable WYSIWYG editor @author Tj Holowaychuk <tj@vision-media.ca> @link http://vision-media.ca @package Editor

Code

function editor_invoke_profiles() {
  static $profiles;
  if (!isset($profiles)) {
    $path = drupal_get_path('module', 'editor');
    require_once $path . '/editor.profiles.inc';
    $profiles = module_invoke_all('editor_profiles');
    if (count($profiles)) {
      foreach ($profiles as &$profile) {

        // Check if any setting is overriding our profile string
        if ($profile_string = variable_get($profile->prid . '_profile_string', FALSE)) {
          $profile->profile_string = $profile_string;
        }
        $profile->profile_array = editor_profile_parse_string($profile->profile_string);
      }
    }
  }
  return $profiles;
}