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

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

Pb with last commit (3636)
Convert all file into UTF8 and Unix format
Add TODO in chinese language file

File size: 5.0 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( 
20                array('plugin_admin_content' => PICLENS_ROOT.'/admin/piclenswallconfig.tpl'               
21                        ) );
22
23                       
24
25if (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  $me->my_config['piclens_wall_spec_tags'] = isset($_POST['piclens_wall_spec_tags']);
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$query = '
72  SELECT id,name,uppercats,global_rank
73  FROM '.CATEGORIES_TABLE.';';
74
75display_select_cat_wrapper($query,
76    $me->my_config['piclens_wall_categories'],
77    'categories',
78    true);
79
80display_select_cat_wrapper($query,
81    $me->my_config['piclens_wall_cat_nav_replace'],
82    'categories_nav',
83    true);
84       
85
86
87
88$template->assign(array(
89        'PICLENS_COPY_CROSSDOMAIN'                                                      => file_exists($filename),
90        'PICLENS_PWGSTUFF'                                                                      => ($pwgstuff_ok ? 'disabled="disabled"' : ''),
91        'PICLENS_PWGSTUFF1'                                                                     => ($pwgstuff_ok ? l10n('piclens_label_pwgstuff1'): l10n('piclens_label_pwgstuff2')),
92        'PICLENS_WALL_ACTIVATED'                                                        => ($me->my_config['piclens_wall'] ? 'checked="checked"' : '' ),
93        $me->my_config['piclens_wall_specif'].'_CHECKED'        => 'checked="checked"',
94        'PICLENS_WALL_HEIGHT'                                                           => $me->my_config['piclens_wall_height'],
95        'CROSSDOMAIN_LNK'                                                                       => PICLENS_PATH.'crossdomain.xml',
96        'PICLENS_WALL_ONTOP'                                                            => ($me->my_config['piclens_wall_ontop'] ? 'checked="checked"' : '' ),
97        'PICLENS_WALL_ONCAT'                                                            => ($me->my_config['piclens_wall_oncat'] ? 'checked="checked"' : '' ),
98        'PICLENS_WALL_NAV'                                                                      => ($me->my_config['piclens_wall_nav'] ? 'checked="checked"' : '' ),
99        'PICLENS_WALL_TITLE'                                                            => $me->my_config['piclens_wall_title'],
100        'PICLENS_WALL_SPEC'                                                                     => ($me->my_config['piclens_wall_spec'] ? 'checked="checked"' : '' ),
101        'PICLENS_WALL_SPEC'                                                                     => ($me->my_config['piclens_wall_spec'] ? 'checked="checked"' : '' ),
102        'PICLENS_WALL_SPEC_RECENTPICS'                                          => ($me->my_config['piclens_wall_spec_recentpics'] ? 'checked="checked"' : '' ),
103        'PICLENS_WALL_SPEC_RECENTCATS'                                          => ($me->my_config['piclens_wall_spec_recentcats'] ? 'checked="checked"' : '' ),
104        'PICLENS_WALL_SPEC_MOSTVISITED'                                         => ($me->my_config['piclens_wall_spec_mostvisited'] ? 'checked="checked"' : '' ),
105        'PICLENS_WALL_SPEC_BESTRATED'                                           => ($me->my_config['piclens_wall_spec_bestrated'] ? 'checked="checked"' : '' ),
106        'PICLENS_WALL_SPEC_FAVORITES'                                           => ($me->my_config['piclens_wall_spec_favorites'] ? 'checked="checked"' : '' ),
107        'PICLENS_WALL_SPEC_TAGS'                                                        => ($me->my_config['piclens_wall_spec_tags'] ? 'checked="checked"' : '' ),
108        'PICLENS_WALL_SWFLOCAL'                                                         => ($me->my_config['piclens_wall_swflocal'] ? 'checked="checked"' : '' )
109        ));
110
111$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
112
113?>
Note: See TracBrowser for help on using the repository browser.