You are here

function wysiwyg_profile_load in Wysiwyg 5.2

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

Load profile for a given input format.

2 calls to wysiwyg_profile_load()
wysiwyg_get_profile in ./wysiwyg.module
Determine the profile to use for a given input format id.
wysiwyg_menu in ./wysiwyg.module
Implementation of hook_menu().

File

./wysiwyg.module, line 573
Integrate client-side editors with Drupal.

Code

function wysiwyg_profile_load($format) {
  static $profiles;
  if (!isset($profiles) || !array_key_exists($format, $profiles)) {
    $result = db_query('SELECT format, editor, settings FROM {wysiwyg} WHERE format = %d', $format);
    while ($profile = db_fetch_object($result)) {
      $profile->settings = unserialize($profile->settings);
      $profiles[$profile->format] = $profile;
    }
  }
  return isset($profiles[$format]) ? $profiles[$format] : FALSE;
}