source: extensions/piclens/admin/config.php @ 3619

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

Add compatiblity with tag page (piclens and wall)
Add parameter to avoid double image in the feed

File size: 4.8 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 config.php  *********/
11
12if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
13
14global $template, $page;
15 
16$me = get_plugin_data($plugin_id);
17
18$type_list = array(l10n('piclens_label_withoutrecursive'), l10n ('piclens_label_withrecursive') );
19 
20$template->set_filenames( array('plugin_admin_content' => PICLENS_ROOT.'/admin/config.tpl') );
21
22// recuperation des parametres depuis le  fichier de configuration
23if (isset($_POST['restore'])) 
24{ 
25       
26        if (file_exists(PICLENS_CFG_FILE))
27        {
28                // changement du nom du fichier de conf.
29                $me->load_config_file();
30                $me->save_config();
31                array_push($page['infos'], sprintf(l10n('piclens_admin_restoreOK'), PICLENS_CFG_FILE1));
32        }
33        else
34                array_push($page['errors'], sprintf(l10n('piclens_admin_restoreKO'), PICLENS_CFG_FILE1));
35}
36// Sauvegarde des parametres dans le  fichier de configuration (
37if (isset($_POST['savefile'])) 
38{ 
39        if (file_exists(PICLENS_CFG_FILE))
40                array_push($page['infos'], sprintf(l10n('piclens_admin_savefileWN'), PICLENS_CFG_FILE1));
41        // Sauvegarde dans le fichier
42        $me->save_config_file();
43        array_push($page['infos'], sprintf(l10n('piclens_admin_savefileOK'), PICLENS_CFG_FILE1));
44       
45}
46
47if (isset($_POST['submit'])) { 
48  $me->my_config['piclens_active'] = isset($_POST['piclens_active']);
49  $me->my_config['piclens_recursive'] = isset($_POST['piclens_recursive']);
50  $me->my_config['piclens_gallerie_active'] = isset($_POST['piclens_gallerie_active']);
51  $me->my_config['piclens_gallerie_type'] = $_POST['piclens_gallerie_type'];
52  $me->my_config['piclens_lite_active'] = isset($_POST['piclens_lite_active']);
53  $me->my_config['piclens_secureimage'] = isset($_POST['piclens_secureimage']);
54  $me->my_config['piclens_extendeddesc'] = isset($_POST['piclens_extendeddesc']);
55 
56  $me->my_config['piclens_recentpics_active'] = isset($_POST['piclens_recentpics_active']);
57  $me->my_config['piclens_recentcats_active'] = isset($_POST['piclens_recentcats_active']);
58  $me->my_config['piclens_mostvisited_active']  = isset($_POST['piclens_mostvisited_active']);
59  $me->my_config['piclens_bestrated_active'] = isset($_POST['piclens_bestrated_active']);
60  $me->my_config['piclens_favorites_active'] = isset($_POST['piclens_favorites_active']);
61  $me->my_config['piclens_tags_active'] = isset($_POST['piclens_tags_active']);
62
63  $me->my_config['piclens_recursive_mode'] = $_POST['recursive_mode'];
64 
65  $me->save_config();
66  array_push($page['infos'], l10n('piclens_admin_saveOK'));
67       
68}
69
70// Affichage des coix miniature possibles pour la recursivite de l'option 'Activer gallerie'
71$i=1;
72foreach ( $type_list as $order ) //on parcours le tableau
73{
74        $template->append('PlGallerie',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_gallerie_type'] == $i ? 'selected' : '')));
75        $i++;   
76}
77
78$template->assign(array(
79        'PICLENS_ACTIVATED'                     => ($me->my_config['piclens_active'] ? 'checked="checked"' : ''), 
80        'PICLENS_RECURSIVE_ACTIVATED'   => ($me->my_config['piclens_recursive'] ? 'checked="checked"' : '' ),
81        'PICLENS_GALLERIE_ACTIVATED'    => ($me->my_config['piclens_gallerie_active'] ? 'checked="checked"' : '' ),
82        'PICLENS_GALLERIE_TYPE'                 => $me->my_config['piclens_gallerie_type'],
83        'PICLENS_LITE_ACTIVATED'                => ($me->my_config['piclens_lite_active'] ? 'checked="checked"' : '' ),
84        'PICLENS_SECUREIMAGE'                   => get_db_plugins('active','secureImages'),
85        'PICLENS_SECUREIMAGE_ACTIVATED' => ($me->my_config['piclens_secureimage'] ? 'checked="checked"' : '' ),
86        'PICLENS_EXTENDEDDESC'                  => get_db_plugins('active','ExtendedDescription'), 
87        'PICLENS_EXTENDEDDESC_ACTIVATED'=> ($me->my_config['piclens_extendeddesc'] ? 'checked="checked"' : '' ),
88        'PICLENS_RECENTPICS_ACTIVATED'  => ($me->my_config['piclens_recentpics_active'] ? 'checked="checked"' : '' ),
89        'PICLENS_RECENTCATS_ACTIVATED'  => ($me->my_config['piclens_recentcats_active'] ? 'checked="checked"' : '' ),
90        'PICLENS_MOSTVISITED_ACTIVATED' => ($me->my_config['piclens_mostvisited_active'] ? 'checked="checked"' : '' ),
91        'PICLENS_BESTRATED_ACTIVATED'   => ($me->my_config['piclens_bestrated_active'] ? 'checked="checked"' : '' ),
92        'PICLENS_FAVORITES_ACTIVATED'   => ($me->my_config['piclens_favorites_active'] ? 'checked="checked"' : '' ),
93        'PICLENS_TAGS_ACTIVATED'                => ($me->my_config['piclens_tags_active'] ? 'checked="checked"' : '' ),
94        $me->my_config['piclens_recursive_mode'].'_CHECKED' => 'checked="checked"',
95        'ICON_INFO' => PICLENS_ADMIN_PATH . 'info.png',
96        'PICLENS_CFGFILE_PRESENT'               => file_exists(PICLENS_CFG_FILE),
97        ));
98
99//$template->assign('ICON_INFO' , PICLENS_ADMIN_PATH . 'info.png');
100 
101 
102$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
103 
104
105?>
Note: See TracBrowser for help on using the repository browser.