1 | <?php |
---|
2 | |
---|
3 | // extended parameters for |
---|
4 | // simpleviewer module |
---|
5 | |
---|
6 | /* |
---|
7 | Option Name Default Value Description |
---|
8 | maxImageWidth 480 Width of the widest image in the gallery. Used to determine the best layout for your gallery (pixels). |
---|
9 | maxImageHeight 480 Height of tallest image in the gallery. Used to determine the best layout for your gallery (pixels). |
---|
10 | textColor 0xFFFFFF Color of title and caption text (hexidecimal color value). |
---|
11 | frameColor 0xFFFFFF Color of image frame, navigation buttons and thumbnail frame (hexidecimal color value). |
---|
12 | frameWidth 20 Width of image frame (pixels). |
---|
13 | stagePadding 40 Width of padding around gallery edge (pixels). To have the image flush to the edge of the swf, set this to 0. |
---|
14 | navPadding 40 Distance between image and thumbnails (pixels). |
---|
15 | thumbnailColumns 3 Number of thumbnail columns. To disable thumbnails completely set this value to 0 |
---|
16 | thumbnailRows 3 Number of thumbnail rows. To disable thumbnails completely set this value to 0. |
---|
17 | navPosition left Position of thumbnails relative to image. Can be "top", "bottom","left" or "right". |
---|
18 | vAlign center Vertical placment of the image and thumbnails within the SWF. Can be "center", "top" or "bottom". |
---|
19 | For large format galleries this is best set to "center". For small format galleries setting this to "top" or "bottom" can help get the image flush to the edge of the swf. |
---|
20 | hAlign center Horizontal placement of the image and thumbnails within the SWF. Can be "center", "left" or "right". |
---|
21 | For large format galleries this is best set to "center". For small format galleries setting this to "left" or "right" can help get the image flush to the edge of the swf. |
---|
22 | title SimpleViewer Gallery Text to display as gallery Title |
---|
23 | enableRightClickOpen true Whether to display a 'Open In new Window...' dialog when right-clicking on an image. Can be "true" or "false" |
---|
24 | backgroundImagePath Relative or absolute path to a JPG or SWF to load as the gallery background. |
---|
25 | Relative paths are relative to the HTML document that contains SimpleViewer. For example: "images/bkgnd.jpg". |
---|
26 | */ |
---|
27 | |
---|
28 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
29 | |
---|
30 | $navPosition = array( l10n('SV_top'), l10n('SV_bottom'), l10n('SV_left'), l10n('SV_rigt')); |
---|
31 | $vAlign = array( l10n('SV_top'), l10n('SV_center'), l10n('SV_bottom')); |
---|
32 | $hAlign = array( l10n('SV_left'), l10n('SV_center'), l10n('SV_rigt')); |
---|
33 | |
---|
34 | // default values |
---|
35 | if (!isset($ext_datas)) $ext_datas = array( |
---|
36 | 'maxImageWidth' => "480", |
---|
37 | 'maxImageHeight' => "480" , |
---|
38 | 'textColor' => "0xFFFFFF" , |
---|
39 | 'frameColor' => "0xFFFFFF" , |
---|
40 | 'frameWidth' => "20" , |
---|
41 | 'stagePadding' => "40" , |
---|
42 | 'navPadding' => "40" , |
---|
43 | 'thumbnailColumns' => "3" , |
---|
44 | 'thumbnailRows' => "3" , |
---|
45 | 'navPosition' => 3, //"left" , |
---|
46 | 'vAlign' => 2, //"center" , |
---|
47 | 'hAlign' => 2, //"center" , |
---|
48 | 'title' => "SimpleViewer Gallery" , |
---|
49 | 'enableRightClickOpen' => true , |
---|
50 | 'backgroundImagePath' => "" ); |
---|
51 | |
---|
52 | |
---|
53 | // Enregistrement de la configuration |
---|
54 | if (isset($_POST['submit']) and !is_adviser()) |
---|
55 | { |
---|
56 | |
---|
57 | foreach ($ext_datas as $key =>$value) |
---|
58 | { |
---|
59 | if ($key == "enableRightClickOpen") |
---|
60 | $ext_datas[$key] = isset($_POST['SV_'.$key]); |
---|
61 | else |
---|
62 | $ext_datas[$key] = $_POST['SV_'.$key]; |
---|
63 | } |
---|
64 | } |
---|
65 | |
---|
66 | foreach ($ext_datas as $key => $value) |
---|
67 | { |
---|
68 | |
---|
69 | if ($key == "enableRightClickOpen") |
---|
70 | $template->assign(array( 'SV_'.$key => (isset($ext_datas[$key]) ? 'checked="checked"': ''))); |
---|
71 | elseif ($key == "navPosition") |
---|
72 | { |
---|
73 | $i=1; |
---|
74 | foreach ( $navPosition as $order ) //on parcours le tableau |
---|
75 | { |
---|
76 | $template->append('SV_NavPosition',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['navPosition'] == $i ? 'selected' : ''))); |
---|
77 | $i++; |
---|
78 | } |
---|
79 | } |
---|
80 | elseif ($key == "vAlign") |
---|
81 | { |
---|
82 | $i=1; |
---|
83 | foreach ( $vAlign as $order ) //on parcours le tableau |
---|
84 | { |
---|
85 | $template->append('SV_vAlign',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['vAlign'] == $i ? 'selected' : ''))); |
---|
86 | $i++; |
---|
87 | } |
---|
88 | } |
---|
89 | elseif ($key == "hAlign") |
---|
90 | { |
---|
91 | $i=1; |
---|
92 | foreach ( $hAlign as $order ) //on parcours le tableau |
---|
93 | { |
---|
94 | $template->append('SV_hAlign',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['hAlign'] == $i ? 'selected' : ''))); |
---|
95 | $i++; |
---|
96 | } |
---|
97 | } |
---|
98 | else |
---|
99 | $template->assign(array( 'SV_'.$key => $ext_datas[$key])); |
---|
100 | |
---|
101 | } |
---|
102 | /* |
---|
103 | $template->append('head_elements',' |
---|
104 | <script type="text/javascript" src="'.PHPWG_PLUGINS_PATH.'AddThis/farbtastic/farbtastic.js"></script> |
---|
105 | <link href="'.PHPWG_PLUGINS_PATH.'AddThis/farbtastic/farbtastic.css" rel="stylesheet" type="text/css" />'); |
---|
106 | */ |
---|
107 | $template->assign(array('OTHERS_SCRIPT' => |
---|
108 | '<script type="text/javascript" src="'.FLASHGAL_PATH.'farbtastic/farbtastic.js"></script> |
---|
109 | <link href="'.FLASHGAL_PATH.'farbtastic/farbtastic.css" rel="stylesheet" type="text/css" />')); |
---|
110 | |
---|
111 | $template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl')); |
---|
112 | $template->assign_var_from_handle('MODULE_OPTIONS', 'module_options'); |
---|
113 | |
---|
114 | ?> |
---|