source: extensions/piclens/piclens/admin/piclenswallconfig.php @ 3636

Last change on this file since 3636 was 3636, checked in by tiico, 15 years ago

Correct name and description of pictures with extendedDescriotion plugin

File size: 8.4 KB
Line 
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
12if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
13
14global $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
22if (isset($_POST['submit'])) { 
23  $me->my_config['piclens_wall'] = isset($_POST['piclens_wall']);
24  $me->my_config['piclens_wall_color'] =   $_POST['background_color'];
25  $me->my_config['piclens_wall_height'] =   $_POST['piclens_wall_height'];
26  $me->my_config['piclens_wall_categories'] = isset($_POST['categories']) ? 
27                          array_map("mysql_escape_string", $_POST['categories']) :
28                          array(); 
29  $me->my_config['piclens_wall_nav'] = isset($_POST['piclens_wall_nav']);
30  $me->my_config['piclens_wall_cat_nav_replace'] = isset($_POST['categories_nav']) ? 
31                          array_map("mysql_escape_string", $_POST['categories_nav']) :
32                          array(); 
33  $me->my_config['piclens_wall_specif'] =   $_POST['piclens_wall_specif'];
34  $me->my_config['piclens_wall_ontop'] = isset($_POST['piclens_wall_ontop']); 
35  $me->my_config['piclens_wall_oncat'] = isset($_POST['piclens_wall_oncat']); 
36  $me->my_config['piclens_wall_showembed'] = isset($_POST['piclens_wall_embed']);
37  $me->my_config['piclens_wall_showfullscreen'] = isset($_POST['piclens_wall_fullscreen']);
38  $me->my_config['piclens_wall_showsearch'] = isset($_POST['piclens_wall_search']);
39  $me->my_config['piclens_wall_showsearch'] = isset($_POST['piclens_wall_search']);
40  $me->my_config['piclens_wall_transparent'] =   isset($_POST['piclens_wall_transparent']);
41
42  $me->my_config['piclens_wall_spec'] = isset($_POST['piclens_wall_spec']);
43  $me->my_config['piclens_wall_spec_recentpics'] = isset($_POST['piclens_wall_spec_recentpics']);
44  $me->my_config['piclens_wall_spec_recentcats'] = isset($_POST['piclens_wall_spec_recentcats']);
45  $me->my_config['piclens_wall_spec_mostvisited'] = isset($_POST['piclens_wall_spec_mostvisited']);
46  $me->my_config['piclens_wall_spec_bestrated'] = isset($_POST['piclens_wall_spec_bestrated']);
47  $me->my_config['piclens_wall_spec_favorites'] = isset($_POST['piclens_wall_spec_favorites']);
48
49  $me->my_config['piclens_wall_swflocal'] = isset($_POST['piclens_wall_swflocal']);
50 
51  if ($pwgstuff_ok && $me->my_config['piclens_wall'])
52  {
53        array_push($page['errors'], l10n('piclens_admin_saveERR4'));
54        $me->my_config['piclens_wall'] = false;
55  }
56
57  $me->save_config();
58  array_push($page['infos'], l10n('piclens_admin_saveOK'));
59       
60}
61
62
63// Copie fichier crossdomain a la racine
64$filename = $_SERVER['DOCUMENT_ROOT'].'/crossdomain.xml';
65// copie du fichier crossdomain.xml
66if (isset($_POST['crossdomain_copy']))
67{
68        include_once(PICLENS_ADMIN_PATH . '/piclens_copy.php');
69}
70
71//$template->assign('PICLENS_COPY_CROSSDOMAIN', file_exists($filename) ? l10n('piclens_label_crossdomain1') : '<input type="checkbox" name="crossdomain_copy" /> '.l10n('piclens_label_crossdomain2'));
72
73//$template->assign('PICLENS_COPY_CROSSDOMAIN', file_exists($filename));
74
75//$template->assign('PICLENS_PWGSTUFF', $pwgstuff_ok ? 'disabled="disabled"' : '');
76//$template->assign('PICLENS_PWGSTUFF1', $pwgstuff_ok ? l10n('piclens_label_pwgstuff1'): l10n('piclens_label_pwgstuff2'));
77
78//$template->assign('PICLENS_WALL_ACTIVATED', $me->my_config['piclens_wall'] ? 'checked="checked"' : '' );
79
80//$template->assign(array($me->my_config['piclens_wall_color'].'_CHECKED' => 'checked="checked"'));
81//$template->assign(array($me->my_config['piclens_wall_specif'].'_CHECKED' => 'checked="checked"'));
82//$template->assign(array('PICLENS_WALL_HEIGHT' => $me->my_config['piclens_wall_height']));
83
84//$template->assign('CROSSDOMAIN_LNK', PICLENS_PATH.'crossdomain.xml');
85
86$query = '
87  SELECT id,name,uppercats,global_rank
88  FROM '.CATEGORIES_TABLE.';';
89
90display_select_cat_wrapper($query,
91    $me->my_config['piclens_wall_categories'],
92    'categories',
93    true);
94
95display_select_cat_wrapper($query,
96    $me->my_config['piclens_wall_cat_nav_replace'],
97    'categories_nav',
98    true);
99       
100//$template->assign('PICLENS_WALL_ONTOP', $me->my_config['piclens_wall_ontop'] ? 'checked="checked"' : '' );
101//$template->assign('PICLENS_WALL_ONCAT', $me->my_config['piclens_wall_oncat'] ? 'checked="checked"' : '' );
102
103//$template->assign('PICLENS_WALL_EMBED', $me->my_config['piclens_wall_showembed'] ? 'checked="checked"' : '' );
104//$template->assign('PICLENS_WALL_FULLSCREEN', $me->my_config['piclens_wall_showfullscreen'] ? 'checked="checked"' : '' );
105//$template->assign('PICLENS_WALL_SEARCH', $me->my_config['piclens_wall_showsearch'] ? 'checked="checked"' : '' );
106
107//$template->assign('PICLENS_WALL_NAV', $me->my_config['piclens_wall_nav'] ? 'checked="checked"' : '' );
108//$template->assign('PICLENS_WALL_TITLE', $me->my_config['piclens_wall_title']);
109
110//$template->assign('PICLENS_WALL_SPEC', $me->my_config['piclens_wall_spec'] ? 'checked="checked"' : '' );
111
112//$template->assign('PICLENS_WALL_SPEC', $me->my_config['piclens_wall_spec'] ? 'checked="checked"' : '' );
113//$template->assign('PICLENS_WALL_SPEC_RECENTPICS', $me->my_config['piclens_wall_spec_recentpics'] ? 'checked="checked"' : '' );
114//$template->assign('PICLENS_WALL_SPEC_RECENTCATS', $me->my_config['piclens_wall_spec_recentcats'] ? 'checked="checked"' : '' );
115//$template->assign('PICLENS_WALL_SPEC_MOSTVISITED', $me->my_config['piclens_wall_spec_mostvisited'] ? 'checked="checked"' : '' );
116//$template->assign('PICLENS_WALL_SPEC_BESTRATED', $me->my_config['piclens_wall_spec_bestrated'] ? 'checked="checked"' : '' );
117//$template->assign('PICLENS_WALL_SPEC_FAVORITES', $me->my_config['piclens_wall_spec_favorites'] ? 'checked="checked"' : '' );
118
119$template->assign(array(
120        'PICLENS_COPY_CROSSDOMAIN'                                                      => file_exists($filename),
121        'PICLENS_PWGSTUFF'                                                                      => ($pwgstuff_ok ? 'disabled="disabled"' : ''),
122        'PICLENS_PWGSTUFF1'                                                                     => ($pwgstuff_ok ? l10n('piclens_label_pwgstuff1'): l10n('piclens_label_pwgstuff2')),
123        'PICLENS_WALL_ACTIVATED'                                                        => ($me->my_config['piclens_wall'] ? 'checked="checked"' : '' ),
124        $me->my_config['piclens_wall_color'].'_CHECKED'         => 'checked="checked"',
125        $me->my_config['piclens_wall_specif'].'_CHECKED'        => 'checked="checked"',
126        'PICLENS_WALL_HEIGHT'                                                           => $me->my_config['piclens_wall_height'],
127        'CROSSDOMAIN_LNK'                                                                       => PICLENS_PATH.'crossdomain.xml',
128        'PICLENS_WALL_ONTOP'                                                            => ($me->my_config['piclens_wall_ontop'] ? 'checked="checked"' : '' ),
129        'PICLENS_WALL_ONCAT'                                                            => ($me->my_config['piclens_wall_oncat'] ? 'checked="checked"' : '' ),
130        'PICLENS_WALL_EMBED'                                                            => ($me->my_config['piclens_wall_showembed'] ? 'checked="checked"' : '' ),
131        'PICLENS_WALL_FULLSCREEN'                                                       => ($me->my_config['piclens_wall_showfullscreen'] ? 'checked="checked"' : '' ),
132        'PICLENS_WALL_SEARCH'                                                           => ($me->my_config['piclens_wall_showsearch'] ? 'checked="checked"' : '' ),
133        'PICLENS_WALL_TRANSPARENT'                                                      => ($me->my_config['piclens_wall_transparent'] ? 'checked="checked"' : '' ),
134        'PICLENS_WALL_NAV'                                                                      => ($me->my_config['piclens_wall_nav'] ? 'checked="checked"' : '' ),
135        'PICLENS_WALL_TITLE'                                                            => $me->my_config['piclens_wall_title'],
136        'PICLENS_WALL_SPEC'                                                                     => ($me->my_config['piclens_wall_spec'] ? 'checked="checked"' : '' ),
137        'PICLENS_WALL_SPEC'                                                                     => ($me->my_config['piclens_wall_spec'] ? 'checked="checked"' : '' ),
138        'PICLENS_WALL_SPEC_RECENTPICS'                                          => ($me->my_config['piclens_wall_spec_recentpics'] ? 'checked="checked"' : '' ),
139        'PICLENS_WALL_SPEC_RECENTCATS'                                          => ($me->my_config['piclens_wall_spec_recentcats'] ? 'checked="checked"' : '' ),
140        'PICLENS_WALL_SPEC_MOSTVISITED'                                         => ($me->my_config['piclens_wall_spec_mostvisited'] ? 'checked="checked"' : '' ),
141        'PICLENS_WALL_SPEC_BESTRATED'                                           => ($me->my_config['piclens_wall_spec_bestrated'] ? 'checked="checked"' : '' ),
142        'PICLENS_WALL_SPEC_FAVORITES'                                           => ($me->my_config['piclens_wall_spec_favorites'] ? 'checked="checked"' : '' ),
143        'PICLENS_WALL_SWFLOCAL'                                                         => ($me->my_config['piclens_wall_swflocal'] ? 'checked="checked"' : '' )
144        ));
145
146
147$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
148
149?>
Note: See TracBrowser for help on using the repository browser.