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 | <background>yourimage.png</background> <!-- image url --> |
---|
49 | <scale9>14 14 14 14</scale9> <!-- [0,1000] pixels --> |
---|
50 | <padding>8 12 8 12</padding> <!-- [-1000,1000] pixels --> |
---|
51 | </titles> |
---|
52 | </options> |
---|
53 | |
---|
54 | */ |
---|
55 | |
---|
56 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
57 | |
---|
58 | $rotation = array( l10n('Carousel_auto'), l10n('Carousel_mouse'), l10n('Carousel_keyboard')); |
---|
59 | $view_point = array( l10n('Carousel_none'), l10n('Carousel_mouse'), l10n('Carousel_keyboard')); |
---|
60 | $blur_quality = array(l10n('Carousel_low'),l10n('Carousel_med'),l10n('Carousel_high')); |
---|
61 | $position1 = array(l10n('Carousel_above'), l10n('Carousel_below')); |
---|
62 | $position2 = array(l10n('Carousel_left'), l10n('Carousel_center') ,l10n('Carousel_right')); |
---|
63 | |
---|
64 | // default values |
---|
65 | if (!isset($ext_datas)) $ext_datas = array( |
---|
66 | 'background' => "#000000", |
---|
67 | 'friction' => "20", |
---|
68 | 'fullscreen' => true, |
---|
69 | //<margins> |
---|
70 | 'top' => "0", |
---|
71 | 'left' => "0", |
---|
72 | 'bottom' => "0", |
---|
73 | 'right' => "0", |
---|
74 | 'horizontal_ratio' => "33", |
---|
75 | 'vertical_ratio' => "50", |
---|
76 | //</margins> |
---|
77 | |
---|
78 | //<interaction> |
---|
79 | 'rotation' => 2, //mouse |
---|
80 | 'view_point' => 2, // mouse |
---|
81 | 'speed' => "15", |
---|
82 | 'default_speed' => "15", |
---|
83 | 'default_view_point' => "20", |
---|
84 | 'reset_delay' => "30", |
---|
85 | //</interaction> |
---|
86 | |
---|
87 | //<far_photos> |
---|
88 | 'size' => "50", |
---|
89 | 'amount' => "50", |
---|
90 | 'blur' => "10", |
---|
91 | 'blur_quality' => 3, |
---|
92 | //</far_photos> |
---|
93 | |
---|
94 | //<reflection> |
---|
95 | 'amountRef' => "100", |
---|
96 | 'blurRef' => "2", |
---|
97 | 'distance' => "0", |
---|
98 | 'alpha' => "50", |
---|
99 | //</reflection> |
---|
100 | |
---|
101 | //<titles> |
---|
102 | //<style> |
---|
103 | 'font_size' => "12", |
---|
104 | 'font_family' => "Verdana", |
---|
105 | 'font_color' => "#FFCC66", |
---|
106 | //</style> |
---|
107 | 'position1' => 1, //"above", |
---|
108 | 'position2' => 3, //"right" |
---|
109 | |
---|
110 | 'backgroundURL' => "", |
---|
111 | 'scale9top' => "10", |
---|
112 | 'scale9right' => "10", |
---|
113 | 'scale9bottom' => "10", |
---|
114 | 'scale9left' => "10", |
---|
115 | 'paddingtop' => "5", |
---|
116 | 'paddingright' => "5", |
---|
117 | 'paddingbottom' => "5", |
---|
118 | 'paddingleft' => "5", |
---|
119 | |
---|
120 | ); |
---|
121 | |
---|
122 | // Enregistrement de la configuration |
---|
123 | if (isset($_POST['submit']) and !is_adviser()) |
---|
124 | { |
---|
125 | |
---|
126 | foreach ($ext_datas as $key =>$value) |
---|
127 | { |
---|
128 | |
---|
129 | if ($key == "fullscreen") |
---|
130 | $ext_datas[$key] = isset($_POST['Carousel_'.$key]); |
---|
131 | else |
---|
132 | $ext_datas[$key] = $_POST['Carousel_'.$key]; |
---|
133 | } |
---|
134 | } |
---|
135 | |
---|
136 | foreach ($ext_datas as $key => $value) |
---|
137 | { |
---|
138 | |
---|
139 | if ($key == "fullscreen") |
---|
140 | $template->assign(array( 'Carousel_'.$key => (($ext_datas[$key]) ? 'checked="checked"': ''))); |
---|
141 | |
---|
142 | elseif ($key == "rotation") |
---|
143 | { |
---|
144 | $i=1; |
---|
145 | foreach ( $rotation as $order ) //on parcours le tableau |
---|
146 | { |
---|
147 | $template->append('Carousel_rotation',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['rotation'] == $i ? 'selected' : ''))); |
---|
148 | $i++; |
---|
149 | } |
---|
150 | } |
---|
151 | elseif ($key == "view_point") |
---|
152 | { |
---|
153 | $i=1; |
---|
154 | foreach ( $view_point as $order ) //on parcours le tableau |
---|
155 | { |
---|
156 | $template->append('Carousel_view_point',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['view_point'] == $i ? 'selected' : ''))); |
---|
157 | $i++; |
---|
158 | } |
---|
159 | } |
---|
160 | elseif ($key == "blur_quality") |
---|
161 | { |
---|
162 | $i=1; |
---|
163 | foreach ( $blur_quality as $order ) //on parcours le tableau |
---|
164 | { |
---|
165 | $template->append('Carousel_blur_quality',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['blur_quality'] == $i ? 'selected' : ''))); |
---|
166 | $i++; |
---|
167 | } |
---|
168 | } |
---|
169 | elseif ($key == "position1") |
---|
170 | { |
---|
171 | $i=1; |
---|
172 | foreach ( $position1 as $order ) //on parcours le tableau |
---|
173 | { |
---|
174 | $template->append('Carousel_position1',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['position1'] == $i ? 'selected' : ''))); |
---|
175 | $i++; |
---|
176 | } |
---|
177 | } |
---|
178 | elseif ($key == "position2") |
---|
179 | { |
---|
180 | $i=1; |
---|
181 | foreach ( $position2 as $order ) //on parcours le tableau |
---|
182 | { |
---|
183 | $template->append('Carousel_position2',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['position2'] == $i ? 'selected' : ''))); |
---|
184 | $i++; |
---|
185 | } |
---|
186 | } |
---|
187 | else |
---|
188 | $template->assign(array( 'Carousel_'.$key => $ext_datas[$key])); |
---|
189 | |
---|
190 | } |
---|
191 | |
---|
192 | $template->assign(array('OTHERS_SCRIPT' => |
---|
193 | '<script type="text/javascript" src="'.FLASHGAL_PATH.'farbtastic/farbtastic.js"></script> |
---|
194 | <link href="'.FLASHGAL_PATH.'farbtastic/farbtastic.css" rel="stylesheet" type="text/css" />')); |
---|
195 | |
---|
196 | |
---|
197 | |
---|
198 | $template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl')); |
---|
199 | $template->assign_var_from_handle('MODULE_OPTIONS', 'module_options'); |
---|
200 | |
---|
201 | ?> |
---|