1 | <?php |
---|
2 | /* |
---|
3 | Plugin : Shadogo |
---|
4 | Plugin URI: http://binaryworld.hd.free.fr/ |
---|
5 | */ |
---|
6 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
7 | load_language('plugin.lang', SHADOGO_PATH); |
---|
8 | |
---|
9 | |
---|
10 | $plugin = get_plugin_data($plugin_id); |
---|
11 | |
---|
12 | if (!empty($_POST['save'])) |
---|
13 | { |
---|
14 | // Modal overlay libraries |
---|
15 | $c = $plugin->getConfig(); |
---|
16 | $c->set('modalOverlayLib', $_POST['modalOverlayLib']); |
---|
17 | $c->set('modalOverlayTheme', $_POST['modalOverlayTheme']); |
---|
18 | |
---|
19 | // Overlay configuration |
---|
20 | $c->set('favoritePicture', isset( $_POST['favoritePicture'] )); |
---|
21 | $c->set('hdPicture', isset( $_POST['hdPicture'] )); |
---|
22 | $c->set('downloadPicture', isset( $_POST['downloadPicture'] )); |
---|
23 | $c->set('addToBasket', isset( $_POST['addToBasket'] )); |
---|
24 | |
---|
25 | // Mediaplayer configuration |
---|
26 | $plugin->getConfig()->set('mediaFilePattern', stripslashes( $_POST['mediaFilePattern'] )); |
---|
27 | $c->set('displayMediaPlayer', isset( $_POST['displayMediaPlayer'] )); |
---|
28 | |
---|
29 | // HD configuration |
---|
30 | $c->set('hdPictureInOverlay', isset( $_POST['hdPictureInOverlay'] )); |
---|
31 | $c->set('hdPicturePrefilterPattern', stripslashes( $_POST['hdPicturePrefilterPattern'] )); |
---|
32 | $c->set('hdPicturePrefilterReplacement', stripslashes( $_POST['hdPicturePrefilterReplacement'] )); |
---|
33 | |
---|
34 | // Slideshow configuration |
---|
35 | $c->set('slideshowInOverlay', isset($_POST['slideshowInOverlay'])); |
---|
36 | $c->set('slideshowPrefilterPattern', stripslashes( $_POST['slideshowPrefilterPattern'] )); |
---|
37 | $c->set('slideshowPrefilterReplacement', stripslashes( $_POST['slideshowPrefilterReplacement'] )); |
---|
38 | |
---|
39 | // Thumbnail configuration |
---|
40 | $c->set('thumbInOverlay', isset($_POST['thumbInOverlay'] )); |
---|
41 | $c->set('thumbMediaPlayerIcon', isset($_POST['thumbMediaPlayerIcon'] )); |
---|
42 | $c->set('thumbContentLabel', isset($_POST['thumbContentLabel'] )); |
---|
43 | $c->set('thumbContentIcon', isset($_POST['thumbContentIcon'] )); |
---|
44 | $c->set('thumbContentPageInOverlay', isset($_POST['thumbContentPageInOverlay'] )); |
---|
45 | $c->set('thumbButtonsTemplateSearch', stripslashes( $_POST['thumbButtonsTemplateSearch'] )); |
---|
46 | $c->set('thumbHrefContentSearch', stripslashes( $_POST['thumbHrefContentSearch'] )); |
---|
47 | |
---|
48 | $c->commit(); |
---|
49 | unset($_POST['save']); |
---|
50 | } |
---|
51 | |
---|
52 | global $template; |
---|
53 | $template->set_filenames( array('plugin_admin_content' => dirname(__FILE__).'/template/shadogo_admin.tpl') ); |
---|
54 | |
---|
55 | $config = (!empty($_POST['restore'])) ? $plugin->getDefaultConfig() : $plugin->getConfig(); |
---|
56 | |
---|
57 | $libs = $plugin->getInstalledOverlayLibs(); |
---|
58 | $themes = array(); |
---|
59 | foreach ($libs as $lib) { |
---|
60 | $themes[$lib] = array(); |
---|
61 | foreach ($plugin->getOverlayLib($lib)->getThemes() as $value) { |
---|
62 | $themes[$lib][$value] = $value; |
---|
63 | }; |
---|
64 | } |
---|
65 | |
---|
66 | $template_vars = array ( |
---|
67 | 'modalOverlayLibs' => $libs, |
---|
68 | 'modalOverlayLibsSelected' => $config->get('modalOverlayLib'), |
---|
69 | 'modalOverlayThemes' => $themes, |
---|
70 | 'modalOverlayThemesSelected' => array( |
---|
71 | $config->get('modalOverlayLib') => $config->get('modalOverlayTheme') |
---|
72 | ), |
---|
73 | 'U_SHADOGO' => $plugin->getPluginURL() |
---|
74 | ); |
---|
75 | |
---|
76 | $template->assign($template_vars); |
---|
77 | $config->assign($template); |
---|
78 | |
---|
79 | unset($_POST['restore']); |
---|
80 | unset($_POST['cancel']); |
---|
81 | |
---|
82 | $template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content'); |
---|
83 | |
---|
84 | |
---|
85 | ?> |
---|