/** * Helper function to inject the override CSS into the current page, if it exists. */ function _platon_inject_css_override() { if ($file = _platon_get_css_override_file()) { $realpath = drupal_realpath($file->uri); $path = str_replace($_SERVER['DOCUMENT_ROOT'] . '/', '', $realpath); drupal_add_css($path, array('group' => CSS_THEME)); } }
/** * Submission callback for platon_form_system_theme_settings_alter(). */ function platon_form_system_theme_settings_alter_submit($form, &$form_state) { if (isset($form_state['storage']['header_file'])) { $form_state['values']['platon_header_image_path'] = str_replace('public://', '', $form_state['storage']['header_file']->uri); } if (isset($form_state['storage']['home_file'])) { $form_state['values']['platon_home_page_image_path'] = str_replace('public://', '', $form_state['storage']['home_file']->uri); } if (!empty($form_state['values']['platon_css_override_content'])) { if (!empty($form_state['storage']['css_fid'])) { $form_state['values']['platon_css_override_fid'] = $form_state['storage']['css_fid']; } } else { // If there is a file existing already, we must get rid of it. if ($file = _platon_get_css_override_file()) { // "Store" an empty string. This will not create a file, but set the old one as a temporary one. _platon_store_css_override_file(''); // Set the setting to 0 to not use any file. $form_state['values']['platon_css_override_fid'] = 0; } } variable_set('platon_group_style', $form_state['values']['platon_group_style']); }
/** * Helper function to inject the override CSS into the current page, if it exists. */ function _platon_inject_css_override() { if ($file = _platon_get_css_override_file()) { drupal_add_css($file->uri, array('group' => CSS_THEME)); } }