~ddorda/ubuntu-drupal-theme/rtl-style

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
  function phptemplate_settings($saved_settings) {

    // Set default variables
    $defaults = array(
      'wrapper_width' => 874,
      'custom_footer_right' => 'Theme created by the <a href="https://launchpad.net/~ubuntu-drupal-themes">Ubuntu Drupal</a> team.',
      'banner_display' => 1,
      'banner_text' => 'We suggest downloading and installing <a href="http://www.mozilla.com/en-US/firefox/">Firefox</a> to secure your browsing experience and take full advantage of this site.',
      'masthead_enabled' => '0',
      'masthead_leftimg' => '0',
      'masthead_centerimg' => '0',
      'masthead_centertext' => null,
      'masthead_rightimg' => '0',
      'masthead_righttext' => null,
    );

    // Merge the saved variables and their default values
    $settings = array_merge($defaults, $saved_settings);

    // Create the form widgets using Forms API
    $form['page'] = array(
      '#type' => 'fieldset',
      '#title' => t('Page Options'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#tree' => FALSE,
    );
    $form['page']['wrapper_width'] = array(
      '#type' => 'textfield',
      '#title' => t('Page Width (default=874)'),
      '#default_value' => $settings['wrapper_width'],
    );
    $form['page']['custom_footer_right'] = array(
      '#type' => 'textarea',
      '#title' => t('Footer Text (Right)'),
      '#default_value' => $settings['custom_footer_right'],
    );
    $form['iebanner'] = array(
      '#type' => 'fieldset',
      '#title' => t('IE Banner Options'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#tree' => FALSE,
    );
    $form['iebanner']['banner_display'] = array(
      '#type' => 'checkbox',
      '#title' => t('Show IE Banner'),
      '#default_value' => $settings['banner_display'],
    );
    $form['iebanner']['banner_text'] = array(
      '#type' => 'textarea',
      '#title' => t('IE Banner Text'),
      '#default_value' => $settings['banner_text'],
    );
    $form['masthead'] = array(
      '#type' => 'fieldset',
      '#title' => t('Masthead Options'),
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
      '#tree' => FALSE,
    );
    $form['masthead']['masthead_enabled'] = array(
      '#type' => 'checkbox',
      '#title' => t('Use Alternate Masthead'),
      '#default_value' => $settings['masthead_enabled'],
      '#description' => t('If this is checked, the alternate masthead will be used. Otherwise the static image will be displayed. <br />NOTE: This disables secondary links!'),
      '#required' => TRUE,
    );
    $form['masthead']['masthead_leftimg'] = array(
      '#type' => 'radios',
      '#title' => t('Masthead Image (Left)'),
      '#default_value' => $settings['masthead_leftimg'],
      '#options' => array('0' => t('About'), '1' => t('CD Covers'), '2' => t('CDs'), '3' => t('Community'),
        '4' => t('Docs'), '5' => t('News'), '6' => t('Partners'), '7' => t('People'), '8' => t('Products'),
        '9' => t('Student'), '10' => t('Support'), '11' => t('[tall] Circle'), '12' => t('[tall] People')),
      '#description' => t('This is what will be displayed on the left side of the banner.'),
      '#required' => TRUE,
    );
    $form['masthead']['masthead_centerimg'] = array(
      '#type' => 'radios',
      '#title' => t('Masthead Image (Center)'),
      '#default_value' => $settings['masthead_centerimg'],
      '#options' => array('0' => t('Standard'), '1' => t('[tall] Standard')),
      '#description' => t('This is what will fill the center of the banner.'),
      '#required' => TRUE,
    );
    $form['masthead']['masthead_centertext'] = array(
      '#type' => 'textarea',
      '#title' => t('Text to be displayed in the center of the masthead'),
      '#default_value' => $settings['masthead_centertext'],
    );
    $form['masthead']['masthead_rightimg'] = array(
      '#type' => 'radios',
      '#title' => t('Masthead Image (Right)'),
      '#default_value' => $settings['masthead_rightimg'],
      '#options' => array('0' => t('Plain'), '1' => t('[tall] Transparent'), '2' => t('Red'),
        '3' => t('[tall] Red'), '4' => t('Red w/ Logo'), '5' => t('[tall] Red w/ Logo'),
        '6' => t('Orange'), '7' => t('Orange w/ Logo'), '8' => t('[tall] Orange w/ Logo'),
        '9' => t('Yellow'), '10' => t('Yellow w/ Logo'), '11' => t('[tall] Yellow w/ Logo')),
      '#description' => t('This is what will be displayed on the left side of the banner.'),
      '#required' => TRUE,
    );
    $form['masthead']['masthead_righttext'] = array(
      '#type' => 'textarea',
      '#title' => t('Text to be displayed in the right part of the masthead'),
      '#default_value' => $settings['masthead_righttext'],
    );

    // Return the additional form widgets
    return $form;
  }
?>