function wysiwyg_ui_profile_cache_get in Wysiwyg 6.2
Same name and namespace in other branches
- 7.2 wysiwyg.module \wysiwyg_ui_profile_cache_get()
Specialized cache function to load a profile from the editing cache.
Parameters
$name: The name of a profile to load. Currently the format id prefixed by 'format'.
Return value
The profile object, with a "locked" property indicating whether or not someone else is already editing the profile, or FALSE if not cached.
1 call to wysiwyg_ui_profile_cache_get()
- wysiwyg_ui_profile_cache_load in ./
wysiwyg.module - Specialized menu callback to load a profile and check its locked status.
File
- ./
wysiwyg.module, line 810 - Integrates client-side editors with Drupal.
Code
function wysiwyg_ui_profile_cache_get($name) {
$profile = FALSE;
if (module_exists('ctools')) {
ctools_include('object-cache');
$profile = ctools_object_cache_get('wysiwyg_profile', $name);
if ($profile) {
$profile->locked = ctools_object_cache_test('wysiwyg_profile', $name);
}
}
else {
// Fall back on simple caching in its own bin without locking.
$cached = cache_get('wysiwyg_profile:' . $name);
if ($cached) {
$profile = $cached->data;
$profile->locked = FALSE;
}
}
return $profile;
}