You are here

function wysiwyg_ui_profile_cache_load in Wysiwyg 7.2

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

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

Parameters

$name: The machine name 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 900

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;
}