You are here

function wysiwyg_profile_load_all in Wysiwyg 7.2

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

Loads all profiles.

Return value

An array of profiles keyed by format name.

6 calls to wysiwyg_profile_load_all()
wysiwyg_admin_menu_map in ./wysiwyg.module
Implements hook_admin_menu_map().
wysiwyg_features_export_options in ./wysiwyg.features.inc
Implements hook_features_export_options().
wysiwyg_form_user_profile_form_alter in ./wysiwyg.module
Implements hook_form_FORM_ID_alter().
wysiwyg_profile_load in ./wysiwyg.module
Loads a profile for a given text format.
wysiwyg_profile_overview in ./wysiwyg.admin.inc
Display overview of setup Wysiwyg Editor profiles; menu callback.

... See full list

1 string reference to 'wysiwyg_profile_load_all'
wysiwyg_profile_cache_clear in ./wysiwyg.module
Clear all Wysiwyg profile caches.

File

./wysiwyg.module, line 847

Code

function wysiwyg_profile_load_all() {

  // entity_load(..., FALSE) does not re-use its own static cache upon
  // repetitive calls, so a custom static cache is required.
  // @see wysiwyg_entity_info()
  $profiles =& drupal_static(__FUNCTION__);
  if (!isset($profiles)) {

    // Additional database cache to support alternative caches like memcache.
    if ($cached = cache_get('wysiwyg_profiles')) {
      $profiles = $cached->data;
    }
    else {
      $profiles = entity_load('wysiwyg_profile', FALSE);
      $formats = filter_formats();
      foreach ($profiles as $key => $profile) {
        if (empty($profile->editor) || !isset($formats[$profile->format])) {
          unset($profiles[$key]);
        }
      }
      cache_set('wysiwyg_profiles', $profiles);
    }
  }
  return $profiles;
}