1 | <?php |
---|
2 | /* |
---|
3 | * Plugin Name: CoolIris-Piclens |
---|
4 | * Version: 0.3.4 |
---|
5 | * Description: Cooliris/Piclens activation |
---|
6 | * Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=234 |
---|
7 | * Author: Tiico |
---|
8 | * Author URI: |
---|
9 | * */ |
---|
10 | /********* Fichier piclenswallconfig.php *********/ |
---|
11 | |
---|
12 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
13 | |
---|
14 | global $template, $page; |
---|
15 | |
---|
16 | $pwgstuff_ok = get_db_plugins('active','PWG_Stuffs'); |
---|
17 | $me = get_plugin_data($plugin_id); |
---|
18 | |
---|
19 | $template->set_filenames( array('plugin_admin_content' => PICLENS_ROOT.'/admin/piclenswallconfig.tpl') ); |
---|
20 | |
---|
21 | |
---|
22 | if (isset($_POST['submit'])) { |
---|
23 | $me->my_config['piclens_wall'] = isset($_POST['piclens_wall']); |
---|
24 | $me->my_config['piclens_wall_title'] = $_POST['piclens_wall_title']; |
---|
25 | $me->my_config['piclens_wall_color'] = $_POST['background_color']; |
---|
26 | $me->my_config['piclens_wall_height'] = $_POST['piclens_wall_height']; |
---|
27 | $me->my_config['piclens_wall_categories'] = isset($_POST['categories']) ? |
---|
28 | array_map("mysql_escape_string", $_POST['categories']) : |
---|
29 | array(); |
---|
30 | $me->my_config['piclens_wall_nav'] = isset($_POST['piclens_wall_nav']); |
---|
31 | $me->my_config['piclens_wall_cat_nav_replace'] = isset($_POST['categories_nav']) ? |
---|
32 | array_map("mysql_escape_string", $_POST['categories_nav']) : |
---|
33 | array(); |
---|
34 | $me->my_config['piclens_wall_specif'] = $_POST['piclens_wall_specif']; |
---|
35 | $me->my_config['piclens_wall_ontop'] = isset($_POST['piclens_wall_ontop']); |
---|
36 | $me->my_config['piclens_wall_oncat'] = isset($_POST['piclens_wall_oncat']); |
---|
37 | $me->my_config['piclens_wall_showembed'] = isset($_POST['piclens_wall_embed']); |
---|
38 | $me->my_config['piclens_wall_showfullscreen'] = isset($_POST['piclens_wall_fullscreen']); |
---|
39 | $me->my_config['piclens_wall_showsearch'] = isset($_POST['piclens_wall_search']); |
---|
40 | $me->my_config['piclens_wall_showsearch'] = isset($_POST['piclens_wall_search']); |
---|
41 | $me->my_config['piclens_wall_transparent'] = isset($_POST['piclens_wall_transparent']); |
---|
42 | |
---|
43 | $me->my_config['piclens_wall_spec'] = isset($_POST['piclens_wall_spec']); |
---|
44 | $me->my_config['piclens_wall_spec_recentpics'] = isset($_POST['piclens_wall_spec_recentpics']); |
---|
45 | $me->my_config['piclens_wall_spec_recentcats'] = isset($_POST['piclens_wall_spec_recentcats']); |
---|
46 | $me->my_config['piclens_wall_spec_mostvisited'] = isset($_POST['piclens_wall_spec_mostvisited']); |
---|
47 | $me->my_config['piclens_wall_spec_bestrated'] = isset($_POST['piclens_wall_spec_bestrated']); |
---|
48 | $me->my_config['piclens_wall_spec_favorites'] = isset($_POST['piclens_wall_spec_favorites']); |
---|
49 | |
---|
50 | $me->my_config['piclens_wall_swflocal'] = isset($_POST['piclens_wall_swflocal']); |
---|
51 | $me->my_config['piclens_wall_nb_ligne'] = $_POST['piclens_wall_nb_ligne']; |
---|
52 | |
---|
53 | if ($pwgstuff_ok && $me->my_config['piclens_wall']) |
---|
54 | { |
---|
55 | array_push($page['errors'], l10n('piclens_admin_saveERR4')); |
---|
56 | $me->my_config['piclens_wall'] = false; |
---|
57 | } |
---|
58 | |
---|
59 | $me->save_config(); |
---|
60 | array_push($page['infos'], l10n('piclens_admin_saveOK')); |
---|
61 | |
---|
62 | } |
---|
63 | |
---|
64 | |
---|
65 | // Copie fichier crossdomain a la racine |
---|
66 | $filename = $_SERVER['DOCUMENT_ROOT'].'/crossdomain.xml'; |
---|
67 | // copie du fichier crossdomain.xml |
---|
68 | if (isset($_POST['crossdomain_copy'])) |
---|
69 | { |
---|
70 | include_once(PICLENS_ADMIN_PATH . '/piclens_copy.php'); |
---|
71 | } |
---|
72 | |
---|
73 | //$template->assign('PICLENS_COPY_CROSSDOMAIN', file_exists($filename) ? l10n('piclens_label_crossdomain1') : '<input type="checkbox" name="crossdomain_copy" /> '.l10n('piclens_label_crossdomain2')); |
---|
74 | |
---|
75 | //$template->assign('PICLENS_COPY_CROSSDOMAIN', file_exists($filename)); |
---|
76 | |
---|
77 | //$template->assign('PICLENS_PWGSTUFF', $pwgstuff_ok ? 'disabled="disabled"' : ''); |
---|
78 | //$template->assign('PICLENS_PWGSTUFF1', $pwgstuff_ok ? l10n('piclens_label_pwgstuff1'): l10n('piclens_label_pwgstuff2')); |
---|
79 | |
---|
80 | //$template->assign('PICLENS_WALL_ACTIVATED', $me->my_config['piclens_wall'] ? 'checked="checked"' : '' ); |
---|
81 | |
---|
82 | //$template->assign(array($me->my_config['piclens_wall_color'].'_CHECKED' => 'checked="checked"')); |
---|
83 | //$template->assign(array($me->my_config['piclens_wall_specif'].'_CHECKED' => 'checked="checked"')); |
---|
84 | //$template->assign(array('PICLENS_WALL_HEIGHT' => $me->my_config['piclens_wall_height'])); |
---|
85 | |
---|
86 | //$template->assign('CROSSDOMAIN_LNK', PICLENS_PATH.'crossdomain.xml'); |
---|
87 | |
---|
88 | $query = ' |
---|
89 | SELECT id,name,uppercats,global_rank |
---|
90 | FROM '.CATEGORIES_TABLE.';'; |
---|
91 | |
---|
92 | display_select_cat_wrapper($query, |
---|
93 | $me->my_config['piclens_wall_categories'], |
---|
94 | 'categories', |
---|
95 | true); |
---|
96 | |
---|
97 | display_select_cat_wrapper($query, |
---|
98 | $me->my_config['piclens_wall_cat_nav_replace'], |
---|
99 | 'categories_nav', |
---|
100 | true); |
---|
101 | |
---|
102 | //$template->assign('PICLENS_WALL_ONTOP', $me->my_config['piclens_wall_ontop'] ? 'checked="checked"' : '' ); |
---|
103 | //$template->assign('PICLENS_WALL_ONCAT', $me->my_config['piclens_wall_oncat'] ? 'checked="checked"' : '' ); |
---|
104 | |
---|
105 | //$template->assign('PICLENS_WALL_EMBED', $me->my_config['piclens_wall_showembed'] ? 'checked="checked"' : '' ); |
---|
106 | //$template->assign('PICLENS_WALL_FULLSCREEN', $me->my_config['piclens_wall_showfullscreen'] ? 'checked="checked"' : '' ); |
---|
107 | //$template->assign('PICLENS_WALL_SEARCH', $me->my_config['piclens_wall_showsearch'] ? 'checked="checked"' : '' ); |
---|
108 | |
---|
109 | //$template->assign('PICLENS_WALL_NAV', $me->my_config['piclens_wall_nav'] ? 'checked="checked"' : '' ); |
---|
110 | //$template->assign('PICLENS_WALL_TITLE', $me->my_config['piclens_wall_title']); |
---|
111 | |
---|
112 | //$template->assign('PICLENS_WALL_SPEC', $me->my_config['piclens_wall_spec'] ? 'checked="checked"' : '' ); |
---|
113 | |
---|
114 | //$template->assign('PICLENS_WALL_SPEC', $me->my_config['piclens_wall_spec'] ? 'checked="checked"' : '' ); |
---|
115 | //$template->assign('PICLENS_WALL_SPEC_RECENTPICS', $me->my_config['piclens_wall_spec_recentpics'] ? 'checked="checked"' : '' ); |
---|
116 | //$template->assign('PICLENS_WALL_SPEC_RECENTCATS', $me->my_config['piclens_wall_spec_recentcats'] ? 'checked="checked"' : '' ); |
---|
117 | //$template->assign('PICLENS_WALL_SPEC_MOSTVISITED', $me->my_config['piclens_wall_spec_mostvisited'] ? 'checked="checked"' : '' ); |
---|
118 | //$template->assign('PICLENS_WALL_SPEC_BESTRATED', $me->my_config['piclens_wall_spec_bestrated'] ? 'checked="checked"' : '' ); |
---|
119 | //$template->assign('PICLENS_WALL_SPEC_FAVORITES', $me->my_config['piclens_wall_spec_favorites'] ? 'checked="checked"' : '' ); |
---|
120 | |
---|
121 | $template->assign(array( |
---|
122 | 'PICLENS_COPY_CROSSDOMAIN' => file_exists($filename), |
---|
123 | 'PICLENS_PWGSTUFF' => ($pwgstuff_ok ? 'disabled="disabled"' : ''), |
---|
124 | 'PICLENS_PWGSTUFF1' => ($pwgstuff_ok ? l10n('piclens_label_pwgstuff1'): l10n('piclens_label_pwgstuff2')), |
---|
125 | 'PICLENS_WALL_ACTIVATED' => ($me->my_config['piclens_wall'] ? 'checked="checked"' : '' ), |
---|
126 | $me->my_config['piclens_wall_color'].'_CHECKED' => 'checked="checked"', |
---|
127 | $me->my_config['piclens_wall_specif'].'_CHECKED' => 'checked="checked"', |
---|
128 | 'PICLENS_WALL_HEIGHT' => $me->my_config['piclens_wall_height'], |
---|
129 | 'CROSSDOMAIN_LNK' => PICLENS_PATH.'crossdomain.xml', |
---|
130 | 'PICLENS_WALL_ONTOP' => ($me->my_config['piclens_wall_ontop'] ? 'checked="checked"' : '' ), |
---|
131 | 'PICLENS_WALL_ONCAT' => ($me->my_config['piclens_wall_oncat'] ? 'checked="checked"' : '' ), |
---|
132 | 'PICLENS_WALL_EMBED' => ($me->my_config['piclens_wall_showembed'] ? 'checked="checked"' : '' ), |
---|
133 | 'PICLENS_WALL_FULLSCREEN' => ($me->my_config['piclens_wall_showfullscreen'] ? 'checked="checked"' : '' ), |
---|
134 | 'PICLENS_WALL_SEARCH' => ($me->my_config['piclens_wall_showsearch'] ? 'checked="checked"' : '' ), |
---|
135 | 'PICLENS_WALL_TRANSPARENT' => ($me->my_config['piclens_wall_transparent'] ? 'checked="checked"' : '' ), |
---|
136 | 'PICLENS_WALL_NAV' => ($me->my_config['piclens_wall_nav'] ? 'checked="checked"' : '' ), |
---|
137 | 'PICLENS_WALL_TITLE' => $me->my_config['piclens_wall_title'], |
---|
138 | 'PICLENS_WALL_SPEC' => ($me->my_config['piclens_wall_spec'] ? 'checked="checked"' : '' ), |
---|
139 | 'PICLENS_WALL_SPEC' => ($me->my_config['piclens_wall_spec'] ? 'checked="checked"' : '' ), |
---|
140 | 'PICLENS_WALL_SPEC_RECENTPICS' => ($me->my_config['piclens_wall_spec_recentpics'] ? 'checked="checked"' : '' ), |
---|
141 | 'PICLENS_WALL_SPEC_RECENTCATS' => ($me->my_config['piclens_wall_spec_recentcats'] ? 'checked="checked"' : '' ), |
---|
142 | 'PICLENS_WALL_SPEC_MOSTVISITED' => ($me->my_config['piclens_wall_spec_mostvisited'] ? 'checked="checked"' : '' ), |
---|
143 | 'PICLENS_WALL_SPEC_BESTRATED' => ($me->my_config['piclens_wall_spec_bestrated'] ? 'checked="checked"' : '' ), |
---|
144 | 'PICLENS_WALL_SPEC_FAVORITES' => ($me->my_config['piclens_wall_spec_favorites'] ? 'checked="checked"' : '' ), |
---|
145 | 'PICLENS_WALL_SWFLOCAL' => ($me->my_config['piclens_wall_swflocal'] ? 'checked="checked"' : '' ), |
---|
146 | 'PICLENS_WALL_NB_LIGNE' => $me->my_config['piclens_wall_nb_ligne'] |
---|
147 | )); |
---|
148 | |
---|
149 | |
---|
150 | $template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content'); |
---|
151 | |
---|
152 | ?> |
---|