You are here

function wysiwyg_ui_profile_cache_load in Wysiwyg 6.2

Same name and namespace in other branches
  1. 7.2 wysiwyg.module \wysiwyg_ui_profile_cache_load()

Specialized menu callback to load a profile and check its locked status.

Parameters

$name: The machine id of the profile.

Return value

The profile object, with a "locked" property indicating whether or not someone else is already editing the profile.

File

./wysiwyg.module, line 785
Integrates client-side editors with Drupal.

Code

function wysiwyg_ui_profile_cache_load($format) {
  $original_profile = wysiwyg_profile_load($format);
  $profile = FALSE;
  $name = $original_profile ? $original_profile->name : 'format' . $format;
  $profile = wysiwyg_ui_profile_cache_get($name);
  if (empty($profile)) {
    $profile = $original_profile;
  }
  if (!empty($profile)) {
    $profile->editing = TRUE;
    return $profile;
  }
  return FALSE;
}