Removing translation directories
[project/panels.git] / plugins / style_bases / pane / pane_rounded_shadow / pane_rounded_shadow.inc
1 <?php
2
3 /**
4 * @file
5 * Definition of the style base for the rounded shadow box.
6 *
7 * This box is colorable, has rounded corners and a drop shadow.
8 */
9
10 $plugin = array(
11 'category' => t('Basic styles'),
12 'title' => t('Rounded shadow box'),
13 'module' => 'panels',
14 'type' => 'pane',
15 'css' => 'pane-rounded-shadow.css',
16 'icon' => 'icon.png',
17 'defaults' => array('header_font' => array(), 'text_font' => array(), 'padding' => array(), 'header_border' => array()),
18 'palette' => array(
19 'background' => array(
20 'label' => t('Background'),
21 'default_value' => '#FFFFFF',
22 ),
23 'text' => array(
24 'label' => t('Text'),
25 'default_value' => '#000000',
26 ),
27 'header-text' => array(
28 'label' => t('Header text'),
29 'default_value' => '#000000',
30 ),
31 'header-border' => array(
32 'label' => t('Header border'),
33 'default_value' => '#000000',
34 ),
35 ),
36 'actions' => array(
37 array('load', 'box', 'box-color.png'),
38 array('colorize', 'background'),
39 array('load', 'shadow', 'box-shadow.png'),
40 array('merge_from', 'box'),
41 array('slice', 'rounded-shadow-top-left-corner.png', 17, 49, 19, 19),
42 array('slice', 'rounded-shadow-top-right-corner.png', 473, 49, 19, 19),
43 array('slice', 'rounded-shadow-bottom-left-corner.png', 17, 442, 19, 19),
44 array('slice', 'rounded-shadow-bottom-right-corner.png', 473, 442, 19, 19),
45 array('slice', 'rounded-shadow-left-edge.png', 17, 60, 10, 10),
46 array('slice', 'rounded-shadow-right-edge.png', 474, 60, 18, 10),
47 array('slice', 'rounded-shadow-top-edge.png', 28, 49, 10, 10),
48 array('slice', 'rounded-shadow-bottom-edge.png', 28, 443, 10, 18),
49 array('slice', 'rounded-shadow-background.png', 150, 150, 1, 1),
50 ),
51
52 'theme' => 'pane_rounded_shadow',
53 'build' => 'panels_rounded_shadow_style_base_build',
54 // 'preview' => 'panels_stylizer_pane_preview',
55
56 'settings form' => 'panels_pane_rounded_shadow_style_settings',
57 'settings form submit' => 'panels_pane_rounded_shadow_style_settings_submit',
58 'build' => 'panels_pane_rounded_shadow_style_base_build',
59 );
60
61 function template_preprocess_pane_rounded_shadow(&$vars) {
62 $vars['classes_array'][] = $vars['content']->css_class;
63 $vars['content']->css_class = '';
64
65 $vars['output'] = theme('panels_pane', $vars);
66 }
67
68 function panels_pane_rounded_shadow_style_settings(&$form, &$form_state) {
69 $form['header_font'] = array();
70 ctools_stylizer_font_selector_form($form['header_font'], $form_state, t('Header font'), $form_state['settings']['header_font']);
71
72 $form['header_border'] = array();
73 ctools_stylizer_border_selector_form($form['header_border'], $form_state, t('Header border'), $form_state['settings']['header_border']);
74
75 $form['text_font'] = array();
76 ctools_stylizer_font_selector_form($form['text_font'], $form_state, t('Text font'), $form_state['settings']['text_font']);
77
78 $form['padding'] = array();
79 ctools_stylizer_padding_selector_form($form['padding'], $form_state, t('Padding'), $form_state['settings']['padding']);
80 }
81
82 function panels_pane_rounded_shadow_style_settings_submit(&$form, &$form_state) {
83 ctools_stylizer_font_selector_form_submit($form['header_font'], $form_state, $form_state['values']['header_font'], $form_state['settings']['header_font']);
84
85 ctools_stylizer_font_selector_form_submit($form['text_font'], $form_state, $form_state['values']['text_font'], $form_state['settings']['text_font']);
86
87 ctools_stylizer_padding_selector_form_submit($form['padding'], $form_state, $form_state['values']['padding'], $form_state['settings']['padding']);
88
89 ctools_stylizer_border_selector_form_submit($form['header_border'], $form_state, $form_state['values']['header_border'], $form_state['settings']['header_border']);
90
91 }
92
93 function panels_pane_rounded_shadow_style_base_build($plugin, $settings, &$css, $replacements) {
94 ctools_stylizer_font_apply_style($css, '%style .pane-title', $settings['header_font']);
95 ctools_stylizer_border_apply_style($css, '%style .pane-title', $settings['header_border'], '%header-border', 'bottom');
96 ctools_stylizer_font_apply_style($css, '%style .pane-content', $settings['text_font']);
97 ctools_stylizer_padding_apply_style($css, '%style', $settings['padding']);
98 }
99