'. t('Enable parallel downloads on the Performance settings page.', array('@performance' => url('admin/settings/performance'))) .'
'; return $output; } } /** * Implementation of hook_form_alter(). * * @param &$form * Nested array of form elements that comprise the form. * @param $form_state * A keyed array containing the current state of the form. * @param $form_id * String representing the name of the form itself. Typically this is the name of the function that generated the form. */ function parallel_form_alter(&$form, $form_state, $form_id) { if ($form_id == 'system_performance_settings') { $form['bandwidth_optimizations']['parallel_enabled'] = array( '#type' => 'checkbox', '#title' => t('Enable Parallel'), '#default_value' => variable_get('parallel_enabled', TRUE), ); $form['bandwidth_optimizations']['parallel_domain'] = array( '#type' => 'textfield', '#title' => t('Enter domain'), '#default_value' => variable_get('parallel_domain', ''), ); } } /** * Implementation of hook_preprocess_page() or template_preprocess_page(). * * @param &$variables * Array containing various page elements. */ function parallel_preprocess_page(&$variables) { $base = variable_get('parallel_domain', ''); if (variable_get('parallel_enabled', TRUE)) { $variables['styles'] = str_replace(' href="', ' href="' . $base, $variables['styles']); watchdog('parallel', $base . '' . $variables['styles'] . ''); $variables['scripts'] = str_replace(' src="/', ' src="/' . $base, $variables['scripts']); watchdog('parallel', $base . '
' . $variables['scripts'] . ''); } }