source: extensions/Flash_Gallery/modules/simpleviewer/admin/config.inc.php

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

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

File size: 4.6 KB
Line 
1<?php
2
3// extended parameters for
4// simpleviewer module
5
6/*
7Option Name     Default Value   Description
8maxImageWidth   480     Width of the widest image in the gallery. Used to determine the best layout for your gallery (pixels).
9maxImageHeight  480     Height of tallest image in the gallery. Used to determine the best layout for your gallery (pixels).
10textColor       0xFFFFFF        Color of title and caption text (hexidecimal color value).
11frameColor      0xFFFFFF        Color of image frame, navigation buttons and thumbnail frame (hexidecimal color value).
12frameWidth      20      Width of image frame (pixels).
13stagePadding    40      Width of padding around gallery edge (pixels). To have the image flush to the edge of the swf, set this to 0.
14navPadding      40      Distance between image and thumbnails (pixels).
15thumbnailColumns        3       Number of thumbnail columns. To disable thumbnails completely set this value to 0
16thumbnailRows   3       Number of thumbnail rows. To disable thumbnails completely set this value to 0.
17navPosition     left    Position of thumbnails relative to image. Can be "top", "bottom","left" or "right".
18vAlign  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.
20hAlign  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.
22title   SimpleViewer Gallery    Text to display as gallery Title
23enableRightClickOpen    true    Whether to display a 'Open In new Window...' dialog when right-clicking on an image. Can be "true" or "false"
24backgroundImagePath             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
28if (!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
35if (!isset($ext_datas)) 
36        $ext_datas = array(
37                'maxImageWidth'                 => "480", 
38                'maxImageHeight'                => "480" ,
39                'textColor'                             => "0xFFFFFF" ,
40                'frameColor'                    => "0xFFFFFF" ,
41                'frameWidth'                    => "20" ,
42                'stagePadding'                  => "40" ,
43                'navPadding'                    => "40" ,
44                'thumbnailColumns'              => "3" ,
45                'thumbnailRows'                 => "3" ,
46                'navPosition'                   => 3, //"left" ,
47                'vAlign'                                => 2, //"center" ,
48                'hAlign'                                => 2, //"center" ,
49                'title'                                 => "SimpleViewer Gallery" ,
50                'enableRightClickOpen'  => true ,
51                'backgroundImagePath'   => "" );
52
53
54               
55// Enregistrement de la configuration
56if (isset($_POST['submit']) and !is_adviser())
57{
58
59        foreach ($ext_datas as $key =>$value)
60        {
61                if ($key == "enableRightClickOpen")
62                        $ext_datas[$key] = isset($_POST['SV_'.$key]);
63                else
64                        $ext_datas[$key] = $_POST['SV_'.$key];
65        }
66}
67
68foreach ($ext_datas as $key => $value)
69{
70
71        if ($key == "enableRightClickOpen")
72                $template->assign(array( 'SV_'.$key => (($ext_datas[$key]) ? 'checked="checked"': '')));
73        elseif ($key == "navPosition")
74        {
75                $i=1;
76                foreach ( $navPosition as $order ) //on parcours le tableau
77                {
78                        $template->append('SV_navPosition',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['navPosition'] == $i ? 'selected' : '')));
79                        $i++;   
80                }
81        }
82        elseif ($key == "vAlign")
83        {
84                $i=1;
85                foreach ( $vAlign as $order ) //on parcours le tableau
86                {
87                        $template->append('SV_vAlign',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['vAlign'] == $i ? 'selected' : '')));
88                        $i++;   
89                }
90        }
91        elseif ($key == "hAlign")
92        {
93                $i=1;
94                foreach ( $hAlign as $order ) //on parcours le tableau
95                {
96                        $template->append('SV_hAlign',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['hAlign'] == $i ? 'selected' : '')));
97                        $i++;   
98                }
99        }
100        else
101                $template->assign(array( 'SV_'.$key => $ext_datas[$key]));
102
103}
104
105$template->assign(array('OTHERS_SCRIPT' =>
106                        '<script type="text/javascript" src="'.FLASHGAL_PATH.'farbtastic/farbtastic.js"></script>
107                        <link href="'.FLASHGAL_PATH.'farbtastic/farbtastic.css" rel="stylesheet" type="text/css"  />'));
108
109$template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl'));
110$template->assign_var_from_handle('MODULE_OPTIONS', 'module_options');
111
112?>
Note: See TracBrowser for help on using the repository browser.