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 | |
---|
13 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
14 | |
---|
15 | include_once(PICLENS_ADMIN_PATH . 'functions.inc.php'); |
---|
16 | |
---|
17 | global $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éatoire', 'Caté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 | |
---|
38 | if (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->save_config(); |
---|
62 | array_push($page['infos'], l10n('piclens_admin_saveOK')); |
---|
63 | |
---|
64 | } |
---|
65 | // Affichage des coix miniature possibles pour Piclens |
---|
66 | $i=1; |
---|
67 | foreach ( $thumb_list as $order ) //on parcours le tableau |
---|
68 | { |
---|
69 | $template->append('PlThumb',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_thumb'] == $i ? 'selected' : ''))); |
---|
70 | $i++; |
---|
71 | } |
---|
72 | //$template->assign('PICLENS_THUMB', $me->my_config['piclens_thumb']); |
---|
73 | |
---|
74 | // Affichage des choix normal possibles pour Piclens |
---|
75 | $i=1; |
---|
76 | foreach ( $normal_list as $order ) //on parcours le tableau |
---|
77 | { |
---|
78 | $template->append('PlNormal',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_normal'] == $i ? 'selected' : ''))); |
---|
79 | $i++; |
---|
80 | } |
---|
81 | //$template->assign('PICLENS_NORMAL', $me->my_config['piclens_normal']); |
---|
82 | |
---|
83 | |
---|
84 | // Affichage des tri possibles pour Piclens - HOME (Accueil) |
---|
85 | $i=1; |
---|
86 | foreach ( $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 | //$template->assign('PICLENS_ORDER', $me->my_config['piclens_order']); |
---|
92 | |
---|
93 | // Affichage des tri possibles pour Piclens - CATEGORIES |
---|
94 | $i=1; |
---|
95 | foreach ( $order_list as $order ) //on parcours le tableau |
---|
96 | { |
---|
97 | $template->append('PlOrderC',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_order_cat'] == $i ? 'selected' : ''))); |
---|
98 | $i++; |
---|
99 | } |
---|
100 | //$template->assign('PICLENS_ORDER_CAT', $me->my_config['piclens_order_cat']); |
---|
101 | |
---|
102 | // Affichage de l'ordre possibles pour Piclens |
---|
103 | $i=1; |
---|
104 | foreach ( $sort_list as $order ) //on parcours le tableau |
---|
105 | { |
---|
106 | $template->append('PlSort',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_sort'] == $i ? 'selected' : ''))); |
---|
107 | $i++; |
---|
108 | } |
---|
109 | //$template->assign('PICLENS_SORT', $me->my_config['piclens_sort']); |
---|
110 | |
---|
111 | // Affichage de l'ordre possibles pour Piclens - CATEGORIES |
---|
112 | $i=1; |
---|
113 | foreach ( $sort_list as $order ) //on parcours le tableau |
---|
114 | { |
---|
115 | $template->append('PlSortC',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_sort_cat'] == $i ? 'selected' : ''))); |
---|
116 | $i++; |
---|
117 | } |
---|
118 | //$template->assign('PICLENS_SORT_CAT', $me->my_config['piclens_sort_cat']); |
---|
119 | |
---|
120 | /*ù |
---|
121 | // Selection type de fichier autorise |
---|
122 | $query = ' |
---|
123 | SELECT DISTINCT(tn_ext) |
---|
124 | FROM '.IMAGES_TABLE.';'; |
---|
125 | |
---|
126 | $result = pwg_query($query); |
---|
127 | if (!empty($result)) { |
---|
128 | |
---|
129 | while ($row = mysql_fetch_assoc($result)) { |
---|
130 | if (empty($row['tn_ext'])) |
---|
131 | $row['tn_ext']='!NULL!'; |
---|
132 | $template->append( |
---|
133 | 'file_types', |
---|
134 | array('SELECTED' => (!empty($me->my_config['included_file_types']) && in_array($row['tn_ext'], $me->my_config['included_file_types'] )) ? 'selected' : '', |
---|
135 | 'VALUE' => $row['tn_ext'], |
---|
136 | 'OPTION' => $row['tn_ext'] |
---|
137 | ) |
---|
138 | ); |
---|
139 | } |
---|
140 | } |
---|
141 | */ |
---|
142 | |
---|
143 | // Selection des groupes |
---|
144 | $exts = get_all_exts(); |
---|
145 | if (!empty($exts)) |
---|
146 | { |
---|
147 | $template->assign('file_types', get_html_exts_selection($exts, 'file_types', $me->my_config['included_file_types'])); |
---|
148 | } |
---|
149 | |
---|
150 | |
---|
151 | // Affichage des types d'affichage de nom image dans piclens |
---|
152 | $i=1; |
---|
153 | foreach ( $nameformat_list as $order ) //on parcours le tableau |
---|
154 | { |
---|
155 | $template->append('PlName',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_name_image'] == $i ? 'selected' : ''))); |
---|
156 | $i++; |
---|
157 | } |
---|
158 | //$template->assign('PICLENS_NAME_IMAGE', $me->my_config['piclens_name_image']); |
---|
159 | |
---|
160 | // Affichage des types d'affichage de description image dans piclens |
---|
161 | $i=1; |
---|
162 | foreach ( $descformat_list as $order ) //on parcours le tableau |
---|
163 | { |
---|
164 | $template->append('PlDesc',array('ID' => $i,'NAME' => $order,'SELECTED' => ($me->my_config['piclens_name_desc'] == $i ? 'selected' : ''))); |
---|
165 | $i++; |
---|
166 | } |
---|
167 | //$template->assign('PICLENS_NAME_DESC', $me->my_config['piclens_name_desc']); |
---|
168 | |
---|
169 | $template->assign('PICLENS_VIDEO', $me->my_config['piclens_video'] ? 'checked="checked"' : '' ); |
---|
170 | $template->assign('PICLENS_CAT_VIEW', $me->my_config['piclens_cat_view'] ? 'checked="checked"' : '' ); |
---|
171 | |
---|
172 | $template->assign_var_from_handle( 'ADMIN_CONTENT', 'plugin_admin_content'); |
---|
173 | |
---|
174 | ?> |
---|