function zopim_footer in Zopim Live Chat 6
Same name and namespace in other branches
- 6.2 zopim.module \zopim_footer()
File
- ./
zopim.module, line 34
Code
function zopim_footer($main = 0) {
global $user;
$id = variable_get('zopim_account', '');
// 1. Check if the Zopim account number has a value.
// 2. Add JS based on visibility value.
// 3. Check if we should add the JS for the currently active user's role.
if (!empty($id) && _zopim_visibility_pages() && _zopim_visibility_user($user)) {
$script = <<<EOS
document.write(unescape("%3Cscript src='" + document.location.protocol + "//zopim.com/?{<span class="php-variable">$id</span>}' charset='utf-8' type='text/javascript'%3E%3C/script%3E"));
EOS;
drupal_add_js($script, 'inline', 'footer');
}
}