source: extensions/Flash_Gallery/modules/Carousel/admin/config.inc.php @ 3531

Last change on this file since 3531 was 3531, checked in by tiico, 15 years ago

First revision (for testing)
Only in French (translation to be done)

File size: 6.2 KB
Line 
1<?php
2
3// extended parameters for
4// Caroussel module
5
6/*
7        <background>#000000</background>    <!-- #RRGGBB, transparent -->
8        <friction>20</friction>              <!-- [1,100] -->
9        <fullscreen>true</fullscreen>      <!-- true, false -->
10 
11        <margins>
12            <top>0</top>                                <!-- [-1000,1000] pixels -->
13            <left>0</left>                              <!-- [-1000,1000] pixels -->
14            <bottom>0</bottom>                          <!-- [-1000,1000] pixels -->
15            <right>0</right>                            <!-- [-1000,1000] pixels -->
16            <horizontal_ratio>33%</horizontal_ratio>    <!-- [1,50] a photo may occupy at most horizontalRatio percent of the Carousel width -->
17            <vertical_ratio>50%</vertical_ratio>        <!-- [1,100] a photo may occupy at most verticalRatio percent of the Carousel height -->
18        </margins>
19 
20        <interaction>
21            <rotation>keyboard</rotation>            <!-- auto, mouse, keyboard -->
22            <view_point>keyboard</view_point>        <!-- none, mouse, keyboard -->
23            <speed>15</speed>                     <!-- [-360,360] degrees per second -->
24 
25            <default_speed>15</default_speed>             <!-- [-360,360] degrees per second -->
26            <default_view_point>20%</default_view_point>  <!-- [0,100] percentage -->
27            <reset_delay>30</reset_delay>                 <!-- [0,600] seconds, 0 means never reset -->
28        </interaction>
29 
30        <far_photos>
31            <size>50%</size>                  <!-- [0,100] percentage -->
32            <amount>50%</amount>              <!-- [0,100] percentage -->
33            <blur>10</blur>                   <!-- [0,100] amount -->
34            <blur_quality>3</blur_quality>    <!-- [1,3] 1=low - 3=high -->
35        </far_photos>
36 
37        <reflection>
38            <amount>100</amount>      <!-- [0,1000] pixels -->
39            <blur>2</blur>            <!-- [0,100] blur amount -->
40            <distance>0</distance>    <!-- [-1000,1000] pixels -->
41            <alpha>50%</alpha>        <!-- [0,100] percentage -->
42        </reflection>
43 
44        <titles>
45            <style>font_size: 12px; font-family: Verdana, _serif; color: #FFCC66;</style>
46            <position>above right</position>           <!-- [above, below] [left,center,right]-->
47 
48        <scale9>14 14 14 14</scale9>                    <!-- [0,1000] pixels -->
49        <padding>8 12 8 12</padding>                    <!-- [-1000,1000] pixels -->
50        </titles>
51    </options>
52
53*/
54
55if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
56
57$rotation = array(  l10n('Carousel_auto'), l10n('Carousel_mouse'), l10n('Carousel_keyboard'));
58$view_point = array(  l10n('Carousel_none'), l10n('Carousel_mouse'), l10n('Carousel_keyboard'));
59$blur_quality = array(l10n('Carousel_low'),l10n('Carousel_med'),l10n('Carousel_high'));
60$position1 = array(l10n('Carousel_above'), l10n('Carousel_below'));
61$position2 = array(l10n('Carousel_left'), l10n('Carousel_center') ,l10n('Carousel_right'));
62
63// default values
64if (!isset($ext_datas)) $ext_datas = array(
65'background'    => "#000000",
66'friction'              => "20",
67'fullscreen'    => true,
68//<margins>
69'top'           => "0",
70'left'          => "0",
71'bottom'        => "0",
72'right'         => "0",
73'horizontal_ratio'      => "33",
74'vertical_ratio'        => "50",
75//</margins>
76
77//<interaction>
78'rotation'              => 2, //mouse
79'view_point'    => 2, // mouse
80'speed'                 => "15",
81'default_speed' => "15",
82'default_view_point'    => "20",
83'reset_delay'                   => "30",
84//</interaction>
85
86//<far_photos>
87'size'          => "50",
88'amount'        => "50",
89'blur'          => "10",
90'blur_quality'  => 3,
91//</far_photos>
92
93//<reflection>
94'amountRef'     => "100",
95'blurRef'               => "2",
96'distance'      => "0",
97'alpha'         => "50",
98//</reflection>
99
100//<titles>
101//<style>
102'font_size'             => "12",
103'font_family'   => "Verdana",
104'font_color'    => "#FFCC66",
105//</style>
106'position1'             => 1, //"above",
107'position2'             => 3, //"right"
108
109);
110
111// Enregistrement de la configuration
112if (isset($_POST['submit']) and !is_adviser())
113{
114
115        foreach ($ext_datas as $key =>$value)
116        {
117       
118                if ($key == "fullscreen")
119                        $ext_datas[$key] = isset($_POST['Carousel_'.$key]);
120                else
121                        $ext_datas[$key] = $_POST['Carousel_'.$key];
122        }
123}
124
125foreach ($ext_datas as $key => $value)
126{
127
128        if ($key == "fullscreen")
129                $template->assign(array( 'Carousel_'.$key => (($ext_datas[$key]) ? 'checked="checked"': '')));
130               
131        elseif ($key == "rotation")
132        {
133                $i=1;
134                foreach ( $rotation as $order ) //on parcours le tableau
135                {
136                        $template->append('Carousel_rotation',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['rotation'] == $i ? 'selected' : '')));
137                        $i++;   
138                }
139        }
140        elseif ($key == "view_point")
141        {
142                $i=1;
143                foreach ( $view_point as $order ) //on parcours le tableau
144                {
145                        $template->append('Carousel_view_point',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['view_point'] == $i ? 'selected' : '')));
146                        $i++;   
147                }
148        }
149        elseif ($key == "blur_quality")
150        {
151                $i=1;
152                foreach ( $blur_quality as $order ) //on parcours le tableau
153                {
154                        $template->append('Carousel_blur_quality',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['blur_quality'] == $i ? 'selected' : '')));
155                        $i++;   
156                }
157        }
158        elseif ($key == "position1")
159        {
160                $i=1;
161                foreach ( $position1 as $order ) //on parcours le tableau
162                {
163                        $template->append('Carousel_position1',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['position1'] == $i ? 'selected' : '')));
164                        $i++;   
165                }
166        }
167        elseif ($key == "position2")
168        {
169                $i=1;
170                foreach ( $position2 as $order ) //on parcours le tableau
171                {
172                        $template->append('Carousel_position2',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['position2'] == $i ? 'selected' : '')));
173                        $i++;   
174                }
175        }
176        else
177                $template->assign(array( 'Carousel_'.$key => $ext_datas[$key]));
178
179}
180
181$template->assign(array('OTHERS_SCRIPT' =>
182                        '<script type="text/javascript" src="'.FLASHGAL_PATH.'farbtastic/farbtastic.js"></script>
183                        <link href="'.FLASHGAL_PATH.'farbtastic/farbtastic.css" rel="stylesheet" type="text/css"  />'));
184
185
186
187$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
188$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
189
190?>
Note: See TracBrowser for help on using the repository browser.