function quicktabs_preprocess_page in Quick Tabs 6.3
Implementation of hook_preprocess_page().
File
- ./
quicktabs.module, line 906
Code
function quicktabs_preprocess_page(&$variables) {
// Check if any ajax tab has been rendered.
if (quicktabs_has_rendered_ajax_tab()) {
// Check if js or css preprocessing is on.
$ppjs = variable_get('preprocess_js', FALSE);
$ppcss = variable_get('preprocess_css', FALSE);
if ($ppjs || $ppcss) {
$files = quicktabs_ajax_js_css();
$js = '<script type="text/javascript">';
$js .= "\n<!--//--><![CDATA[//><!--";
$js .= "\nif (Drupal && Drupal.quicktabs) {";
// Populate scripts
if ($ppjs && !empty($files['js_files'])) {
$js .= "\n Drupal.quicktabs.scripts = " . drupal_to_js(drupal_map_assoc($files['js_files'])) . ';';
}
// Populate css
if ($ppcss && !empty($files['css_files'])) {
$css_paths = array();
foreach ($files['css_files'] as $entry) {
$css_paths[$entry['file']] = $entry['file'];
}
$js .= "\n Drupal.quicktabs.css = " . drupal_to_js($css_paths) . ';';
}
$js .= "\n}";
$js .= "\n//--><!]]>";
$js .= "\n</script>";
$variables['closure'] .= $js;
}
}
}