Projet

Général

Profil

Paste
Télécharger (3,84 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / adaptivetheme / at_core / inc / forms / settings.global.inc @ a08833bd

1
<?php
2

    
3
/**
4
 * @file
5
 * Generate form elments for the Global settings.
6
 */
7
function at_core_global_form(&$form, $theme_name) {
8
  // Set variable for mode, we want to show a message based on this
9
  $mode = variable_get('preprocess_css', '') == 1 ? TRUE : FALSE;
10
  $performance_settings_path = url('admin/config/development/performance');
11
  $file_settings_path = url('admin/config/media/file-system');
12

    
13
  // Global Settings
14
  $form['at-settings']['global-settings'] = array(
15
    '#type' => 'fieldset',
16
    '#title' => t('Global Settings'),
17
    '#description' => t('<h3>Global Settings</h3><p>These settings are primarly set during development - do not change these unless you are actively developing or modifying your theme.</p>'),
18
  );
19

    
20
  // Set default layout
21
  $form['at-settings']['global-settings']['default-layout'] = array(
22
    '#type' => 'fieldset',
23
    '#title' => t('Mobile first or Mobile last'),
24
    '#description' => t('<h3>Mobile first or Desktop first</h3>'),
25
    '#states' => array(
26
      'invisible' => array('input[name="disable_responsive_styles"]' => array('checked' => TRUE)),
27
    ),
28
  );
29
  $form['at-settings']['global-settings']['default-layout']['global_default_layout_toggle'] = array(
30
    '#type' => 'checkbox',
31
    '#title' => t('Change default layout method <small>(checking this will expose new settings)</small>'),
32
    '#description' => t('<strong>Use with caution!</strong> If you are using a pre-styled sub-theme such as Pixture Reloaded, Sky, Corolla, AT Commerce or any of the commerical sub-themes you should NOT change this!'),
33
    '#default_value' => at_get_setting('global_default_layout_toggle'),
34
  );
35
  $form['at-settings']['global-settings']['default-layout']['toggle'] = array(
36
    '#type' => 'fieldset',
37
    '#title' => t('Change default layout method'),
38
    '#states' => array(
39
      'visible' => array('input[name="global_default_layout_toggle"]' => array('checked' => TRUE)),
40
    ),
41
  );
42
  // Backwards compatibility with pre 7.x-3.x themes
43
  $global_default_layout_default_value = at_get_setting('global_default_layout') ? at_get_setting('global_default_layout') : 'standard-layout';
44
  if ($global_default_layout_default_value == 'smartphone-portrait') {
45
    $global_default_layout_default_value = 'smalltouch-portrait';
46
  }
47
  $form['at-settings']['global-settings']['default-layout']['toggle']['global_default_layout'] = array(
48
    '#type' => 'radios',
49
    '#description' => t('<p>Adaptivetheme supports both mobile first and desktop first design approaches. Please review the <a href="!docs_link" target="_blank">online documentation</a>.</p><p>This setting fundementally alters what CSS is loaded and how it is loaded. At the most basic level if you select Mobile first the Smalltouch portrait layout will load as the default, if you select Desktop first the Standard layout will load as the default. Many other changes take place regarding loading of CSS for Internet Explorer, Responsive Gpanels and Panels as well.</p> ', array('!docs_link' => 'http://adaptivethemes.com/documentation/mobile-first-design-with-adaptivetheme')),
50
    '#default_value' => $global_default_layout_default_value,
51
    '#options' => array(
52
      'smalltouch-portrait' => t('Mobile first'),
53
      'standard-layout' => t('Desktop first'),
54
    ),
55
  );
56

    
57
  // Disable responsive layout
58
  $form['at-settings']['global-settings']['disable-rs'] = array(
59
    '#type' => 'fieldset',
60
    '#title' => t('Disable Responsive Layout'),
61
    '#description' => t('<h3>Disable Responsive Layout</h3>'),
62
  );
63
  $form['at-settings']['global-settings']['disable-rs']['disable_responsive_styles'] = array(
64
    '#type' => 'checkbox',
65
    '#title' => t('Disable responsive layout and styles'),
66
    '#description' => t('By checking this setting the site will use only the Standard layout and the global styles. You can turn this back on at any time.'),
67
    '#default_value' => at_get_setting('disable_responsive_styles'),
68
  );
69
}