Projet

Général

Profil

Paste
Télécharger (1,29 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / mayo / inc / forms / mayo.submit.inc @ d7f58da2

1
<?php
2

    
3
/**
4
 * @file
5
 * Process all form values. Uses multiple other include files and helper
6
 * functions to handle various operations.
7
 */
8
global $_path_to_mayo;
9
$_path_to_mayo = drupal_get_path('theme', 'mayo');
10

    
11
// Helper functions for processing the page layout.
12
include($_path_to_mayo . '/inc/forms/mayo.submit.builders.inc');
13

    
14
/**
15
 * Custom submit function - this mostly builds and saves stylesheets for
16
 * various features such as the responsive layout and font styles.
17
 *
18
 * @param $form
19
 * @param $form_state
20
 */
21
function mayo_settings_submit($form, &$form_state) {
22
  global $_path_to_mayo;
23

    
24
  // Set form_state values into one variable
25
  $values = $form_state['values'];
26

    
27
  // Get the active theme name, $theme_key will return the admin theme
28
  $theme_name = $form_state['build_info']['args'][0];
29

    
30
  // Set the path variable to the right path
31
  $path = 'public://mayo/' . $theme_name . '_files';
32
  $values['path'] = $path;
33

    
34
  // Set up the files directory for the generated files
35
  file_prepare_directory($path, FILE_CREATE_DIRECTORY);
36
  variable_set('theme_' . $theme_name . '_files_directory', $path);
37

    
38
  // Include processing for page & panels layouts, and responsive styles
39
  require_once($_path_to_mayo . '/inc/forms/mayo.submit.responsive.inc');
40
  mayo_submit_reponsive($values, $theme_name, $path);
41
}