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( |
---|
20 | array('plugin_admin_content' => PICLENS_ROOT.'/admin/piclenswallconfig.tpl' |
---|
21 | ) ); |
---|
22 | |
---|
23 | |
---|
24 | |
---|
25 | if (isset($_POST['submit'])) { |
---|
26 | $me->my_config['piclens_wall'] = isset($_POST['piclens_wall']); |
---|
27 | $me->my_config['piclens_wall_title'] = $_POST['piclens_wall_title']; |
---|
28 | $me->my_config['piclens_wall_height'] = $_POST['piclens_wall_height']; |
---|
29 | $me->my_config['piclens_wall_categories'] = isset($_POST['categories']) ? |
---|
30 | array_map("mysql_escape_string", $_POST['categories']) : |
---|
31 | array(); |
---|
32 | |
---|
33 | $me->my_config['piclens_wall_nav'] = isset($_POST['piclens_wall_nav']); |
---|
34 | $me->my_config['piclens_wall_cat_nav_replace'] = isset($_POST['categories_nav']) ? |
---|
35 | array_map("mysql_escape_string", $_POST['categories_nav']) : |
---|
36 | array(); |
---|
37 | $me->my_config['piclens_wall_specif'] = $_POST['piclens_wall_specif']; |
---|
38 | $me->my_config['piclens_wall_ontop'] = isset($_POST['piclens_wall_ontop']); |
---|
39 | $me->my_config['piclens_wall_oncat'] = isset($_POST['piclens_wall_oncat']); |
---|
40 | |
---|
41 | $me->my_config['piclens_wall_spec'] = isset($_POST['piclens_wall_spec']); |
---|
42 | $me->my_config['piclens_wall_spec_recentpics'] = isset($_POST['piclens_wall_spec_recentpics']); |
---|
43 | $me->my_config['piclens_wall_spec_recentcats'] = isset($_POST['piclens_wall_spec_recentcats']); |
---|
44 | $me->my_config['piclens_wall_spec_mostvisited'] = isset($_POST['piclens_wall_spec_mostvisited']); |
---|
45 | $me->my_config['piclens_wall_spec_bestrated'] = isset($_POST['piclens_wall_spec_bestrated']); |
---|
46 | $me->my_config['piclens_wall_spec_favorites'] = isset($_POST['piclens_wall_spec_favorites']); |
---|
47 | |
---|
48 | $me->my_config['piclens_wall_swflocal'] = isset($_POST['piclens_wall_swflocal']); |
---|
49 | |
---|
50 | if ($pwgstuff_ok && $me->my_config['piclens_wall']) |
---|
51 | { |
---|
52 | array_push($page['errors'], l10n('piclens_admin_saveERR4')); |
---|
53 | $me->my_config['piclens_wall'] = false; |
---|
54 | } |
---|
55 | |
---|
56 | $me->save_config(); |
---|
57 | array_push($page['infos'], l10n('piclens_admin_saveOK')); |
---|
58 | |
---|
59 | } |
---|
60 | |
---|
61 | |
---|
62 | // Copie fichier crossdomain a la racine |
---|
63 | $filename = $_SERVER['DOCUMENT_ROOT'].'/crossdomain.xml'; |
---|
64 | // copie du fichier crossdomain.xml |
---|
65 | if (isset($_POST['crossdomain_copy'])) |
---|
66 | { |
---|
67 | include_once(PICLENS_ADMIN_PATH . '/piclens_copy.php'); |
---|
68 | } |
---|
69 | |
---|
70 | $query = ' |
---|
71 | SELECT id,name,uppercats,global_rank |
---|
72 | FROM '.CATEGORIES_TABLE.';'; |
---|
73 | |
---|
74 | display_select_cat_wrapper($query, |
---|
75 | $me->my_config['piclens_wall_categories'], |
---|
76 | 'categories', |
---|
77 | true); |
---|
78 | |
---|
79 | display_select_cat_wrapper($query, |
---|
80 | $me->my_config['piclens_wall_cat_nav_replace'], |
---|
81 | 'categories_nav', |
---|
82 | true); |
---|
83 | |
---|
84 | |
---|
85 | |
---|
86 | |
---|
87 | $template->assign(array( |
---|
88 | 'PICLENS_COPY_CROSSDOMAIN' => file_exists($filename), |
---|
89 | 'PICLENS_PWGSTUFF' => ($pwgstuff_ok ? 'disabled="disabled"' : ''), |
---|
90 | 'PICLENS_PWGSTUFF1' => ($pwgstuff_ok ? l10n('piclens_label_pwgstuff1'): l10n('piclens_label_pwgstuff2')), |
---|
91 | 'PICLENS_WALL_ACTIVATED' => ($me->my_config['piclens_wall'] ? 'checked="checked"' : '' ), |
---|
92 | $me->my_config['piclens_wall_specif'].'_CHECKED' => 'checked="checked"', |
---|
93 | 'PICLENS_WALL_HEIGHT' => $me->my_config['piclens_wall_height'], |
---|
94 | 'CROSSDOMAIN_LNK' => PICLENS_PATH.'crossdomain.xml', |
---|
95 | 'PICLENS_WALL_ONTOP' => ($me->my_config['piclens_wall_ontop'] ? 'checked="checked"' : '' ), |
---|
96 | 'PICLENS_WALL_ONCAT' => ($me->my_config['piclens_wall_oncat'] ? 'checked="checked"' : '' ), |
---|
97 | 'PICLENS_WALL_NAV' => ($me->my_config['piclens_wall_nav'] ? 'checked="checked"' : '' ), |
---|
98 | 'PICLENS_WALL_TITLE' => $me->my_config['piclens_wall_title'], |
---|
99 | 'PICLENS_WALL_SPEC' => ($me->my_config['piclens_wall_spec'] ? 'checked="checked"' : '' ), |
---|
100 | 'PICLENS_WALL_SPEC' => ($me->my_config['piclens_wall_spec'] ? 'checked="checked"' : '' ), |
---|
101 | 'PICLENS_WALL_SPEC_RECENTPICS' => ($me->my_config['piclens_wall_spec_recentpics'] ? 'checked="checked"' : '' ), |
---|
102 | 'PICLENS_WALL_SPEC_RECENTCATS' => ($me->my_config['piclens_wall_spec_recentcats'] ? 'checked="checked"' : '' ), |
---|
103 | 'PICLENS_WALL_SPEC_MOSTVISITED' => ($me->my_config['piclens_wall_spec_mostvisited'] ? 'checked="checked"' : '' ), |
---|
104 | 'PICLENS_WALL_SPEC_BESTRATED' => ($me->my_config['piclens_wall_spec_bestrated'] ? 'checked="checked"' : '' ), |
---|
105 | 'PICLENS_WALL_SPEC_FAVORITES' => ($me->my_config['piclens_wall_spec_favorites'] ? 'checked="checked"' : '' ), |
---|
106 | 'PICLENS_WALL_SWFLOCAL' => ($me->my_config['piclens_wall_swflocal'] ? 'checked="checked"' : '' ) |
---|
107 | )); |
---|
108 | |
---|
109 | $template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content'); |
---|
110 | |
---|
111 | ?> |
---|