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