function swftools_get_html in SWF Tools 6.3
Serves just the swf content from the cache via the path swftools/page/nnnn
This feature is experimental - the only access control at the moment is whether the user is generally allowed to view content. Complex permissions will come later.
Parameters
string $cid: The cid of the item to retrieve.
Return value
nothing Output an html page, including headers
1 string reference to 'swftools_get_html'
- swftools_menu in ./
swftools.module - Implementation of hook_menu().
File
- ./
swftools.module, line 1723 - The primary component of SWF Tools that enables comprehensive media handling.
Code
function swftools_get_html($cid) {
// Access global user object
global $user;
// User 1 can always access cached content directly, others only if direct serving is enabled
if (!($user->uid == 1) && !variable_get('swftools_grant_access_to_cache', 0)) {
print drupal_access_denied();
}
elseif (!($content = cache_get($cid, 'cache_swftools'))) {
print drupal_not_found();
}
else {
print theme('swftools_page', $content->data['html']);
}
}