1 | <?php |
---|
2 | |
---|
3 | // extended parameters for |
---|
4 | // simpleviewer module |
---|
5 | |
---|
6 | |
---|
7 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
8 | |
---|
9 | // ATTENTION, pour ce plugin, il est necessaire que les fichiers suivants soient presents : |
---|
10 | // /piwigo/swf/Pages.swf |
---|
11 | // /piwigo/txt/lang.txt |
---|
12 | |
---|
13 | // copie du fichier /swf/Pages.swf |
---|
14 | $dirpath = PHPWG_ROOT_PATH; |
---|
15 | $dirpathorigin = FLASHGAL_PATH.'modules/FlashPageFlip/'; |
---|
16 | $filename = 'Pages.swf'; |
---|
17 | if (!is_dir($dirpath.'swf')) |
---|
18 | @mkdir($dirpath.'swf'); |
---|
19 | if (!file_exists($dirpath. 'swf/'. $filename)) |
---|
20 | { |
---|
21 | copy($dirpathorigin.'swf/' . $filename, $dirpath.'swf/' .$filename); |
---|
22 | array_push($page['infos'], sprintf(l10n('PageFlip_File_saved'), $filename,$dirpath.'swf/' )); |
---|
23 | } |
---|
24 | |
---|
25 | // copie du fichier Lang.txt |
---|
26 | $filename = 'Lang.txt'; |
---|
27 | if (!is_dir($dirpath.'txt')) |
---|
28 | @mkdir($dirpath.'txt'); |
---|
29 | if (!file_exists($dirpath. 'txt/'. $filename)) |
---|
30 | { |
---|
31 | copy($dirpathorigin.'txt/' . $filename, $dirpath.'txt/' .$filename); |
---|
32 | array_push($page['infos'], sprintf(l10n('PageFlip_File_saved'), $filename, $dirpath.'txt/')); |
---|
33 | } |
---|
34 | |
---|
35 | |
---|
36 | // Verifier si ils sont présents et sinon, les copier (depuis le répertoire du module) |
---|
37 | |
---|
38 | // default values |
---|
39 | if (!isset($ext_datas)) $ext_datas = array( |
---|
40 | 'width' => "368", |
---|
41 | 'height' => "450" , |
---|
42 | 'bgcolor' => "#CCCCCC" , |
---|
43 | 'loadercolor' => "#FFFFFF" , |
---|
44 | 'panelcolor' => "#5d5d61" , |
---|
45 | 'buttoncolor' => "#5d5d61" , |
---|
46 | 'textcolor' => "#ffffff" , |
---|
47 | ); |
---|
48 | |
---|
49 | if (isset($_POST['submit']) and !is_adviser()) |
---|
50 | { |
---|
51 | foreach ($ext_datas as $key =>$value) |
---|
52 | { |
---|
53 | $ext_datas[$key] = $_POST['PageFlip_'.$key]; |
---|
54 | } |
---|
55 | } |
---|
56 | |
---|
57 | foreach ($ext_datas as $key => $value) |
---|
58 | { |
---|
59 | $template->assign(array( 'PageFlip_'.$key => $ext_datas[$key])); |
---|
60 | } |
---|
61 | |
---|
62 | $template->assign(array('OTHERS_SCRIPT' => |
---|
63 | '<script type="text/javascript" src="'.FLASHGAL_PATH.'farbtastic/farbtastic.js"></script> |
---|
64 | <link href="'.FLASHGAL_PATH.'farbtastic/farbtastic.css" rel="stylesheet" type="text/css" />')); |
---|
65 | |
---|
66 | $template->set_filenames(array('module_options' => dirname(__FILE__) . '/config.tpl')); |
---|
67 | $template->assign_var_from_handle('MODULE_OPTIONS', 'module_options'); |
---|
68 | |
---|
69 | ?> |
---|