at_core.submit.inc

  1. cis7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/forms/at_core.submit.inc
  2. cle7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/forms/at_core.submit.inc
  3. ecd7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/forms/at_core.submit.inc
  4. elmsmedia7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/forms/at_core.submit.inc
  5. harmony7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/forms/at_core.submit.inc
  6. icor7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/forms/at_core.submit.inc
  7. meedjum_blog7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/forms/at_core.submit.inc
  8. mooc7 sites/all/themes/ulmus/adaptivetheme/at_core/inc/forms/at_core.submit.inc

Process all form values. Uses multiple other include files and helper functions to handle various operations.

Functions

Namesort descending Description
at_core_settings_submit Custom submit function - this mostly builds and saves stylesheets for various features such as the responsive layout and font styles.

Globals

Namesort descending Description
$path_to_at_core @file Process all form values. Uses multiple other include files and helper functions to handle various operations.

File

sites/all/themes/ulmus/adaptivetheme/at_core/inc/forms/at_core.submit.inc
View source
  1. <?php
  2. /**
  3. * @file
  4. * Process all form values. Uses multiple other include files and helper
  5. * functions to handle various operations.
  6. */
  7. global $path_to_at_core;
  8. $path_to_at_core = drupal_get_path('theme', 'adaptivetheme');
  9. // Helper functions for processing the page layout and font families.
  10. include($path_to_at_core . '/inc/forms/at_core.submit.builders.inc');
  11. /**
  12. * Custom submit function - this mostly builds and saves stylesheets for
  13. * various features such as the responsive layout and font styles.
  14. *
  15. * @param $form
  16. * @param $form_state
  17. */
  18. function at_core_settings_submit($form, &$form_state) {
  19. global $path_to_at_core;
  20. // Set form_state values into one variable
  21. $values = $form_state['values'];
  22. // Get the active theme name, $theme_key will return the admin theme
  23. $theme_name = $form_state['build_info']['args'][0];
  24. // Set values for our three possible paths to the generated files
  25. $public_files = 'public://adaptivetheme/' . $theme_name . '_files';
  26. $theme_directory = drupal_get_path('theme', $theme_name) . '/generated_files';
  27. $custom_path = $values['custom_files_path'];
  28. // Set the path variable to the right path
  29. if ($values['global_files_path'] === 'public_files') {
  30. $path = $public_files;
  31. }
  32. elseif ($values['global_files_path'] === 'theme_directory') {
  33. $path = $theme_directory;
  34. }
  35. elseif ($values['global_files_path'] === 'custom_path') {
  36. $path = $custom_path;
  37. }
  38. $values['path'] = $path;
  39. // Set up the files directory for the generated files
  40. file_prepare_directory($path, FILE_CREATE_DIRECTORY);
  41. variable_set('theme_' . $theme_name . '_files_directory', $path);
  42. // Include processing for automagical info builder
  43. require_once($path_to_at_core . '/inc/forms/at_core.submit.info.inc');
  44. at_core_submit_info($values, $theme_name, $path);
  45. // Include processing for page & panels layouts, and responsive styles
  46. require_once($path_to_at_core . '/inc/forms/at_core.submit.responsive.inc');
  47. at_core_submit_reponsive($values, $theme_name, $path);
  48. if ($values['enable_extensions'] === 1) {
  49. // Include processing for fonts
  50. if (isset($values['enable_font_settings']) && $values['enable_font_settings'] === 1) {
  51. require_once($path_to_at_core . '/inc/fonts.inc');
  52. require_once($path_to_at_core . '/inc/forms/at_core.submit.fonts.inc');
  53. at_core_submit_fonts($values, $theme_name, $path);
  54. }
  55. // Include processing for Custom CSS
  56. if (isset($values['enable_custom_css']) && $values['enable_custom_css'] === 1) {
  57. require_once($path_to_at_core . '/inc/forms/at_core.submit.customcss.inc');
  58. at_core_submit_custom_css($values, $theme_name, $path);
  59. }
  60. // Include processing for the Menu Toggle
  61. if (isset($values['enable_menu_toggle']) && $values['enable_menu_toggle'] === 1) {
  62. require_once($path_to_at_core . '/inc/forms/at_core.submit.menutoggle.inc');
  63. at_core_submit_menu_toggle($values, $theme_name, $path);
  64. }
  65. // Set variables for device detection environment
  66. variable_set('at_detection', isset($values['detection']) ? $values['detection'] : FALSE);
  67. variable_set('at_browscap_detect', isset($values['browscap_detect']) ? $values['browscap_detect'] : FALSE);
  68. variable_set('at_mobile_detect', isset($values['mobile_detect']) ? $values['mobile_detect'] : FALSE);
  69. }
  70. // Color inc save
  71. if (module_exists('color')) {
  72. if (isset($values['at-color']) && $values['at-color'] == TRUE) {
  73. require_once($path_to_at_core . '/inc/forms/at_core.submit.color.inc');
  74. at_core_submit_color($values, $theme_name, $path);
  75. }
  76. }
  77. // Change query-strings on css/js files to enforce reload for all users.
  78. _drupal_flush_css_js();
  79. // Clear the aggregated file caches to update changes
  80. if (variable_get('preprocess_css', '') == 1) {
  81. drupal_clear_css_cache();
  82. }
  83. if (variable_get('preprocess_js', '') == 1) {
  84. drupal_clear_js_cache();
  85. }
  86. }