Révision 74f6bef0
Ajouté par Assos Assos il y a plus de 10 ans
drupal7/sites/all/themes/adaptivetheme/at_core/inc/forms/at_core.submit.inc | ||
---|---|---|
5 | 5 |
* Process all form values. Uses multiple other include files and helper |
6 | 6 |
* functions to handle various operations. |
7 | 7 |
*/ |
8 |
|
|
9 | 8 |
global $path_to_at_core; |
10 | 9 |
$path_to_at_core = drupal_get_path('theme', 'adaptivetheme'); |
11 | 10 |
|
12 | 11 |
// Helper functions for processing the page layout and font families. |
13 |
require_once($path_to_at_core . '/inc/forms/at_core.submit.builders.inc');
|
|
12 |
include($path_to_at_core . '/inc/forms/at_core.submit.builders.inc');
|
|
14 | 13 |
|
15 | 14 |
/** |
16 | 15 |
* Custom submit function - this mostly builds and saves stylesheets for |
... | ... | |
28 | 27 |
// Get the active theme name, $theme_key will return the admin theme |
29 | 28 |
$theme_name = $form_state['build_info']['args'][0]; |
30 | 29 |
|
31 |
// Set up some paths we use to get and save files |
|
32 |
$path_to_panels_css = $path_to_at_core . '/layouts/css/'; |
|
33 |
$path_to_responsive_css = drupal_get_path('theme', $theme_name) . '/css/'; |
|
34 |
|
|
35 | 30 |
// Set values for our three possible paths to the generated files |
36 | 31 |
$public_files = 'public://adaptivetheme/' . $theme_name . '_files'; |
37 | 32 |
$theme_directory = drupal_get_path('theme', $theme_name) . '/generated_files'; |
... | ... | |
47 | 42 |
elseif ($values['global_files_path'] === 'custom_path') { |
48 | 43 |
$path = $custom_path; |
49 | 44 |
} |
45 |
$values['path'] = $path; |
|
50 | 46 |
|
51 | 47 |
// Set up the files directory for the generated files |
52 | 48 |
file_prepare_directory($path, FILE_CREATE_DIRECTORY); |
... | ... | |
54 | 50 |
|
55 | 51 |
// Include processing for automagical info builder |
56 | 52 |
require_once($path_to_at_core . '/inc/forms/at_core.submit.info.inc'); |
53 |
at_core_submit_info($values, $theme_name, $path); |
|
57 | 54 |
|
58 | 55 |
// Include processing for page & panels layouts, and responsive styles |
59 | 56 |
require_once($path_to_at_core . '/inc/forms/at_core.submit.responsive.inc'); |
57 |
at_core_submit_reponsive($values, $theme_name, $path); |
|
60 | 58 |
|
61 | 59 |
if ($values['enable_extensions'] === 1) { |
62 | 60 |
// Include processing for fonts |
63 | 61 |
if (isset($values['enable_font_settings']) && $values['enable_font_settings'] === 1) { |
64 | 62 |
require_once($path_to_at_core . '/inc/fonts.inc'); |
65 | 63 |
require_once($path_to_at_core . '/inc/forms/at_core.submit.fonts.inc'); |
64 |
at_core_submit_fonts($values, $theme_name, $path); |
|
66 | 65 |
} |
67 | 66 |
// Include processing for Custom CSS |
68 | 67 |
if (isset($values['enable_custom_css']) && $values['enable_custom_css'] === 1) { |
69 | 68 |
require_once($path_to_at_core . '/inc/forms/at_core.submit.customcss.inc'); |
69 |
at_core_submit_custom_css($values, $theme_name, $path); |
|
70 | 70 |
} |
71 |
// Include processing for the Menu Toggle |
|
72 |
if (isset($values['enable_menu_toggle']) && $values['enable_menu_toggle'] === 1) { |
|
73 |
require_once($path_to_at_core . '/inc/forms/at_core.submit.menutoggle.inc'); |
|
74 |
at_core_submit_menu_toggle($values, $theme_name, $path); |
|
75 |
} |
|
76 |
// Set variables for device detection environment |
|
77 |
variable_set('at_detection', isset($values['detection']) ? $values['detection'] : FALSE); |
|
78 |
variable_set('at_browscap_detect', isset($values['browscap_detect']) ? $values['browscap_detect'] : FALSE); |
|
79 |
variable_set('at_mobile_detect', isset($values['mobile_detect']) ? $values['mobile_detect'] : FALSE); |
|
71 | 80 |
} |
72 | 81 |
|
73 | 82 |
// Color inc save |
74 | 83 |
if (module_exists('color')) { |
75 | 84 |
if (isset($values['at-color']) && $values['at-color'] == TRUE) { |
76 | 85 |
require_once($path_to_at_core . '/inc/forms/at_core.submit.color.inc'); |
86 |
at_core_submit_color($values, $theme_name, $path); |
|
77 | 87 |
} |
78 | 88 |
} |
89 |
|
|
90 |
// Change query-strings on css/js files to enforce reload for all users. |
|
91 |
_drupal_flush_css_js(); |
|
92 |
|
|
93 |
// Clear the aggregated file caches to update changes |
|
94 |
if (variable_get('preprocess_css', '') == 1) { |
|
95 |
drupal_clear_css_cache(); |
|
96 |
} |
|
97 |
if (variable_get('preprocess_js', '') == 1) { |
|
98 |
drupal_clear_js_cache(); |
|
99 |
} |
|
79 | 100 |
} |
Formats disponibles : Unified diff
Weekly update of contrib modules