source: extensions/piclens/admin/rssfeed.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.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 rssfeed.php  *********/
11
12
13if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
14
15include_once(PICLENS_ADMIN_PATH . 'functions.inc.php');
16
17global $template, $page;
18 
19$me = get_plugin_data($plugin_id);
20
21$order_list = array(l10n('piclens_label_orderPiwigo'), l10n('piclens_label_orderCreDate'), l10n('piclens_label_orderAddDate'), l10n('piclens_label_orderRank'), l10n('piclens_label_orderBest'), l10n('piclens_label_orderName'), l10n('piclens_label_orderID'), l10n('piclens_label_orderRand'), l10n('piclens_label_orderCat'));
22$sort_list = array(l10n('piclens_label_sortPiwigo'), l10n('piclens_label_sortUp'), l10n('piclens_label_sortDown'));
23
24$thumb_list = array(l10n('piclens_label_TypeTN'), l10n('piclens_label_TypeNorm'));
25$normal_list = array(l10n('piclens_label_TypeTN'), l10n('piclens_label_TypeNorm'), l10n('piclens_label_TypeHigh'));
26
27//$nameformat_list = array(l10n('piclens_label_Name1'), l10n('piclens_label_Name2'), l10n('piclens_label_Name3'));
28//$descformat_list = array(l10n('piclens_label_Desc1'), l10n('piclens_label_Desc2'), l10n('piclens_label_Desc3'));
29 
30 
31$template->set_filenames( array('plugin_admin_content' => PICLENS_ROOT.'/admin/rssfeed.tpl') );
32
33if (isset($_POST['submit'])) { 
34  $me->my_config['piclens_thumb'] = $_POST['piclens_thumb'];
35  $me->my_config['piclens_normal'] = $_POST['piclens_normal'];
36  $me->my_config['piclens_order'] = $_POST['piclens_order'];
37  $me->my_config['piclens_order_cat'] = $_POST['piclens_order_cat'];
38  $me->my_config['piclens_sort'] = $_POST['piclens_sort'];
39  $me->my_config['piclens_sort_cat'] = $_POST['piclens_sort_cat'];
40 
41  $included_file_types = isset($_POST['file_types']) ? 
42                          array_map("mysql_escape_string", $_POST['file_types']) :
43                          array(); 
44  $me->my_config['included_file_types'] = $included_file_types;
45//  $me->my_config['piclens_name_image'] = $_POST['piclens_name_image'];
46//  $me->my_config['piclens_name_desc'] = $_POST['piclens_name_desc'];
47  $me->my_config['piclens_video'] = isset($_POST['piclens_video']);
48  $me->my_config['piclens_cat_view'] = isset($_POST['piclens_cat_view']);
49
50 
51  if ($me->my_config['piclens_order'] == 1)     // defaut PIWIGO
52        $me->my_config['piclens_sort'] = 1;             // defaut PIWIGO
53  if ($me->my_config['piclens_order_cat'] == 1) // defaut PIWIGO
54        $me->my_config['piclens_sort_cat'] = 1;         // defaut PIWIGO
55
56  $me->my_config['piclens_rss_name'] = $_POST['piclens_rss_name'];
57  $me->my_config['piclens_rss_desc'] = $_POST['piclens_rss_desc'];
58  $me->my_config['piclens_exclude_double'] = isset($_POST['piclens_exclude_double']);
59   
60
61
62   
63  $me->save_config();
64  array_push($page['infos'], l10n('piclens_admin_saveOK'));
65       
66}
67// Affichage des coix miniature possibles pour Piclens
68$i=1;
69foreach ( $thumb_list as $order ) //on parcours le tableau
70{
71        $template->append('PlThumb',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_thumb'] == $i ? 'selected' : '')));
72        $i++;   
73}
74
75// Affichage des choix normal possibles pour Piclens
76$i=1;
77foreach ( $normal_list as $order ) //on parcours le tableau
78{
79        $template->append('PlNormal',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_normal'] == $i ? 'selected' : '')));
80        $i++;   
81}
82
83
84// Affichage des tri possibles pour Piclens - HOME (Accueil)
85$i=1;
86foreach ( $order_list as $order ) //on parcours le tableau
87{
88        $template->append('PlOrder',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_order'] == $i ? 'selected' : '')));
89        $i++;   
90}
91
92// Affichage des tri possibles pour Piclens - CATEGORIES
93$i=1;
94foreach ( $order_list as $order ) //on parcours le tableau
95{
96        $template->append('PlOrderC',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_order_cat'] == $i ? 'selected' : '')));
97        $i++;   
98}
99
100// Affichage de l'ordre possibles pour Piclens
101$i=1;
102foreach ( $sort_list as $order ) //on parcours le tableau
103{
104        $template->append('PlSort',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_sort'] == $i ? 'selected' : '')));
105        $i++;   
106}
107//$template->assign('PICLENS_SORT', $me->my_config['piclens_sort']);
108
109// Affichage de l'ordre possibles pour Piclens - CATEGORIES
110$i=1;
111foreach ( $sort_list as $order ) //on parcours le tableau
112{
113        $template->append('PlSortC',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_sort_cat'] == $i ? 'selected' : '')));
114        $i++;   
115}
116
117// Selection des groupes
118$exts = get_all_exts();
119if (!empty($exts))
120{
121  $template->assign('file_types',  get_html_exts_selection($exts, 'file_types', $me->my_config['included_file_types']));
122}
123
124/*
125// Affichage des types d'affichage de nom image dans piclens
126$i=1;
127foreach ( $nameformat_list as $order ) //on parcours le tableau
128{
129        $template->append('PlName',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_name_image'] == $i ? 'selected' : '')));
130        $i++;   
131}
132
133// Affichage des types d'affichage de description image dans piclens
134$i=1;
135foreach ( $descformat_list as $order ) //on parcours le tableau
136{
137        $template->append('PlDesc',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_name_desc'] == $i ? 'selected' : '')));
138        $i++;   
139}
140*/
141$template->assign('PICLENS_VIDEO', $me->my_config['piclens_video'] ? 'checked="checked"' : '' );
142$template->assign('PICLENS_CAT_VIEW', $me->my_config['piclens_cat_view'] ? 'checked="checked"' : '' );
143$template->assign('PICLENS_RSS_NAME', $me->my_config['piclens_rss_name']);
144$template->assign('PICLENS_RSS_DESC', $me->my_config['piclens_rss_desc']);
145$template->assign('PICLENS_EXCLUDE_DOUBLE', $me->my_config['piclens_exclude_double'] ? 'checked="checked"' : '' );
146
147
148$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
149
150?>
Note: See TracBrowser for help on using the repository browser.