source: extensions/piclens/admin/rssfeed.php @ 3614

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

Modify parameters format for name and descriptions in rss feed (use preformated parameters like Flash_Gallery)
Increase length for config zone in tpl

File size: 6.3 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('Defaut Piwigo', 'Date de Creation', 'Date d\'ajout', 'Note Moyenne', 'Plus vues', 'Nom du fichier', 'Id', 'Al&eacute;atoire', 'Cat&eacute;gories');
22$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'));
23//$sort_list = array('Defaut Piwigo', 'Croissant', 'Decroissant');
24$sort_list = array(l10n('piclens_label_sortPiwigo'), l10n('piclens_label_sortUp'), l10n('piclens_label_sortDown'));
25
26//$thumb_list = array('Miniature', 'Normal');
27$thumb_list = array(l10n('piclens_label_TypeTN'), l10n('piclens_label_TypeNorm'));
28//$normal_list = array('Miniature', 'Normal', 'High');
29$normal_list = array(l10n('piclens_label_TypeTN'), l10n('piclens_label_TypeNorm'), l10n('piclens_label_TypeHigh'));
30//$nameformat_list = array('Nom vignette : taille', 'Nom vignette', 'Nom de l\'image');
31//$nameformat_list = array(l10n('piclens_label_Name1'), l10n('piclens_label_Name2'), l10n('piclens_label_Name3'));
32//$descformat_list = array('Rien', 'Nom de l\'image', 'Description de l\'image');
33//$descformat_list = array(l10n('piclens_label_Desc1'), l10n('piclens_label_Desc2'), l10n('piclens_label_Desc3'));
34 
35 
36$template->set_filenames( array('plugin_admin_content' => PICLENS_ROOT.'/admin/rssfeed.tpl') );
37
38if (isset($_POST['submit'])) { 
39  $me->my_config['piclens_thumb'] = $_POST['piclens_thumb'];
40  $me->my_config['piclens_normal'] = $_POST['piclens_normal'];
41  $me->my_config['piclens_order'] = $_POST['piclens_order'];
42  $me->my_config['piclens_order_cat'] = $_POST['piclens_order_cat'];
43  $me->my_config['piclens_sort'] = $_POST['piclens_sort'];
44  $me->my_config['piclens_sort_cat'] = $_POST['piclens_sort_cat'];
45 
46  $included_file_types = isset($_POST['file_types']) ? 
47                          array_map("mysql_escape_string", $_POST['file_types']) :
48                          array(); 
49  $me->my_config['included_file_types'] = $included_file_types;
50//  $me->my_config['piclens_name_image'] = $_POST['piclens_name_image'];
51//  $me->my_config['piclens_name_desc'] = $_POST['piclens_name_desc'];
52  $me->my_config['piclens_video'] = isset($_POST['piclens_video']);
53  $me->my_config['piclens_cat_view'] = isset($_POST['piclens_cat_view']);
54
55 
56  if ($me->my_config['piclens_order'] == 1)     // defaut PIWIGO
57        $me->my_config['piclens_sort'] = 1;             // defaut PIWIGO
58  if ($me->my_config['piclens_order_cat'] == 1) // defaut PIWIGO
59        $me->my_config['piclens_sort_cat'] = 1;         // defaut PIWIGO
60
61  $me->my_config['piclens_rss_name'] = $_POST['piclens_rss_name'];
62  $me->my_config['piclens_rss_desc'] = $_POST['piclens_rss_desc'];
63   
64
65
66   
67  $me->save_config();
68  array_push($page['infos'], l10n('piclens_admin_saveOK'));
69       
70}
71// Affichage des coix miniature possibles pour Piclens
72$i=1;
73foreach ( $thumb_list as $order ) //on parcours le tableau
74{
75        $template->append('PlThumb',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_thumb'] == $i ? 'selected' : '')));
76        $i++;   
77}
78
79// Affichage des choix normal possibles pour Piclens
80$i=1;
81foreach ( $normal_list as $order ) //on parcours le tableau
82{
83        $template->append('PlNormal',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_normal'] == $i ? 'selected' : '')));
84        $i++;   
85}
86
87
88// Affichage des tri possibles pour Piclens - HOME (Accueil)
89$i=1;
90foreach ( $order_list as $order ) //on parcours le tableau
91{
92        $template->append('PlOrder',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_order'] == $i ? 'selected' : '')));
93        $i++;   
94}
95
96// Affichage des tri possibles pour Piclens - CATEGORIES
97$i=1;
98foreach ( $order_list as $order ) //on parcours le tableau
99{
100        $template->append('PlOrderC',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_order_cat'] == $i ? 'selected' : '')));
101        $i++;   
102}
103
104// Affichage de l'ordre possibles pour Piclens
105$i=1;
106foreach ( $sort_list as $order ) //on parcours le tableau
107{
108        $template->append('PlSort',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_sort'] == $i ? 'selected' : '')));
109        $i++;   
110}
111//$template->assign('PICLENS_SORT', $me->my_config['piclens_sort']);
112
113// Affichage de l'ordre possibles pour Piclens - CATEGORIES
114$i=1;
115foreach ( $sort_list as $order ) //on parcours le tableau
116{
117        $template->append('PlSortC',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_sort_cat'] == $i ? 'selected' : '')));
118        $i++;   
119}
120
121// Selection des groupes
122$exts = get_all_exts();
123if (!empty($exts))
124{
125  $template->assign('file_types',  get_html_exts_selection($exts, 'file_types', $me->my_config['included_file_types']));
126}
127
128/*
129// Affichage des types d'affichage de nom image dans piclens
130$i=1;
131foreach ( $nameformat_list as $order ) //on parcours le tableau
132{
133        $template->append('PlName',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_name_image'] == $i ? 'selected' : '')));
134        $i++;   
135}
136
137// Affichage des types d'affichage de description image dans piclens
138$i=1;
139foreach ( $descformat_list as $order ) //on parcours le tableau
140{
141        $template->append('PlDesc',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_name_desc'] == $i ? 'selected' : '')));
142        $i++;   
143}
144*/
145$template->assign('PICLENS_VIDEO', $me->my_config['piclens_video'] ? 'checked="checked"' : '' );
146$template->assign('PICLENS_CAT_VIEW', $me->my_config['piclens_cat_view'] ? 'checked="checked"' : '' );
147$template->assign('PICLENS_RSS_NAME', $me->my_config['piclens_rss_name']);
148$template->assign('PICLENS_RSS_DESC', $me->my_config['piclens_rss_desc']);
149
150
151$template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content');
152
153?>
Note: See TracBrowser for help on using the repository browser.