[3531] | 1 | <?php |
---|
| 2 | |
---|
| 3 | // extended parameters for |
---|
| 4 | // simpleviewer module |
---|
| 5 | |
---|
| 6 | /* |
---|
| 7 | captionColor Color of image captions. Format: 0xRRGGBB. Default: 0x000000. |
---|
| 8 | frameColor Frame color. Format: 0xRRGGBB. Default: 0xFFFFFF. |
---|
| 9 | imageScaleMode Image scaling type. Possible values: Crop, Fit, NoScale. Default: Crop. |
---|
| 10 | visibleImages Number of visible images. Default: 5. |
---|
| 11 | usePhotoNumbers Determines whether or not to display page numbers. Possible values: Boolean(true/false). Default: true. |
---|
| 12 | backButtonLabel The "back" button text.Possible values: String. Default: BACK. |
---|
| 13 | soundEffect Image transition sound. You need to specify a path to your sound file.Possible values: String. Default: . |
---|
| 14 | bgImage Background image settings. |
---|
| 15 | alpha <bgImage alpha="100"
/> RGB |
---|
| 16 | source <bgImage source="images/bg.jpg"
/> URL |
---|
| 17 | Example |
---|
| 18 | <bgImage alpha="100" source="images/bg.jpg"/> |
---|
| 19 | */ |
---|
| 20 | |
---|
| 21 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
| 22 | |
---|
| 23 | $imageScaleMode = array( l10n('StackG_Crop'), l10n('StackG_Fit'), l10n('StackG_NoScale')); |
---|
| 24 | |
---|
| 25 | // default values |
---|
| 26 | if (!isset($ext_datas)) $ext_datas = array( |
---|
| 27 | 'captionColor' => '#000000', |
---|
| 28 | 'frameColor' => '#FFFFFF', |
---|
| 29 | 'imageScaleMode' => 1, //Crop. |
---|
| 30 | 'visibleImages' => 5, |
---|
| 31 | 'usePhotoNumbers' => true, |
---|
| 32 | 'backButtonLabel' => "BACK", |
---|
| 33 | 'slideshow' => false, |
---|
| 34 | 'width' => "300", |
---|
| 35 | 'height' => "200" |
---|
| 36 | ); |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | // Enregistrement de la configuration |
---|
| 40 | if (isset($_POST['submit']) and !is_adviser()) |
---|
| 41 | { |
---|
| 42 | |
---|
| 43 | foreach ($ext_datas as $key =>$value) |
---|
| 44 | { |
---|
| 45 | if ($key == "usePhotoNumbers" or $key == "slideshow") |
---|
| 46 | $ext_datas[$key] = isset($_POST['StackG_'.$key]); |
---|
| 47 | else |
---|
| 48 | $ext_datas[$key] = $_POST['StackG_'.$key]; |
---|
| 49 | } |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | foreach ($ext_datas as $key => $value) |
---|
| 53 | { |
---|
| 54 | |
---|
| 55 | if ($key == "usePhotoNumbers" or $key == "slideshow") |
---|
| 56 | $template->assign(array( 'StackG_'.$key => (($ext_datas[$key]) ? 'checked="checked"': ''))); |
---|
| 57 | elseif ($key == "imageScaleMode") |
---|
| 58 | { |
---|
| 59 | $i=1; |
---|
| 60 | foreach ( $imageScaleMode as $order ) //on parcours le tableau |
---|
| 61 | { |
---|
| 62 | $template->append('StackG_imageScaleMode',array('ID' => $i,'NAME' => $order,'SELECTED' => ($ext_datas['imageScaleMode'] == $i ? 'selected' : ''))); |
---|
| 63 | $i++; |
---|
| 64 | } |
---|
| 65 | } |
---|
| 66 | else |
---|
| 67 | $template->assign(array( 'StackG_'.$key => $ext_datas[$key])); |
---|
| 68 | |
---|
| 69 | } |
---|
| 70 | |
---|
| 71 | $template->assign(array('OTHERS_SCRIPT' => |
---|
| 72 | '<script type="text/javascript" src="'.FLASHGAL_PATH.'farbtastic/farbtastic.js"></script> |
---|
| 73 | <link href="'.FLASHGAL_PATH.'farbtastic/farbtastic.css" rel="stylesheet" type="text/css" />')); |
---|
| 74 | |
---|
| 75 | $template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl')); |
---|
| 76 | $template->assign_var_from_handle('MODULE_OPTIONS', 'module_options'); |
---|
| 77 | |
---|
| 78 | ?> |
---|