1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | $m_p = get_plugin_data('music_player'); |
---|
5 | |
---|
6 | global $conf, $template, $lang, $page; |
---|
7 | global $prefixeTable; |
---|
8 | load_language('plugin.lang', $m_p->plugin_path); |
---|
9 | //$mp_msgs = array(); |
---|
10 | $template->assign( array( |
---|
11 | 'MP_PATH' => MP_PATH |
---|
12 | )); |
---|
13 | |
---|
14 | // +----------------------------------------+ |
---|
15 | // | Edit texte | |
---|
16 | // +----------------------------------------+ |
---|
17 | if (isset($_POST['envoi']) and $_POST['envoi']=='edit_txt' ) |
---|
18 | { |
---|
19 | |
---|
20 | $txt = addslashes($_POST['texte']); |
---|
21 | $query = ' |
---|
22 | UPDATE '.MP_PLAYLIST.' |
---|
23 | SET texte=\''.$txt.'\' |
---|
24 | WHERE id IN (\''.$_POST['id'].'\') |
---|
25 | ;'; |
---|
26 | pwg_query($query); |
---|
27 | $page['infos'][]=l10n('mp_msg_edit1'); |
---|
28 | |
---|
29 | } |
---|
30 | if (isset($_GET['id'])) |
---|
31 | { |
---|
32 | $query = 'SELECT texte FROM '.MP_PLAYLIST.' WHERE id IN (\''.$_GET['id'].'\') ;'; |
---|
33 | $result = pwg_query($query); |
---|
34 | $data = pwg_db_fetch_assoc($result); |
---|
35 | $txt = stripslashes($data['texte']); |
---|
36 | $template->append('edit_txt', |
---|
37 | array('TXT'=>$txt, 'ID'=>$_GET['id']) ); |
---|
38 | $template->assign( array( |
---|
39 | 'PLAYLIST' => $txt |
---|
40 | )); |
---|
41 | |
---|
42 | } |
---|
43 | // +----------------------------------------+ |
---|
44 | // | Edit externe | |
---|
45 | // +----------------------------------------+ |
---|
46 | if (isset($_POST['envoi']) and $_POST['envoi']=='edit_ex' ) |
---|
47 | { |
---|
48 | |
---|
49 | $txt = addslashes($_POST['texte']); |
---|
50 | $url = addslashes($_POST['url']); |
---|
51 | $query = ' |
---|
52 | UPDATE '.MP_PLAYLIST.' |
---|
53 | SET texte=\''.$txt.'\', url=\''.$url.'\' |
---|
54 | WHERE id IN (\''.$_POST['id'].'\') |
---|
55 | ;'; |
---|
56 | pwg_query($query); |
---|
57 | |
---|
58 | $filename="./plugins/music_player/music/externe/".$_POST['id'].".php"; |
---|
59 | $rep="./plugins/music_player/music/externe"; |
---|
60 | if ( !is_dir($rep) ) { // le répertoire existe t-il ? |
---|
61 | mkdir ($rep); |
---|
62 | } |
---|
63 | $_php ='<?php '; |
---|
64 | $_php .='header("content-type:text/xml;charset=utf-8"); '; |
---|
65 | $_php .='readfile(\''.$url.'\'); '; |
---|
66 | $_php .='exit(); '; |
---|
67 | $_php .='?>'; |
---|
68 | $file= fopen($filename, "w"); |
---|
69 | if (!is_writable($filename) ) { |
---|
70 | die("Le fichier est inaccessible en écriture"); |
---|
71 | } |
---|
72 | fwrite($file, $_php); |
---|
73 | |
---|
74 | // $mp_msgs[] = $lang['mp_msg_edit1']; |
---|
75 | $page['infos'][]=l10n('mp_msg_edit1'); |
---|
76 | |
---|
77 | } |
---|
78 | if (isset($_GET['ex_id'])) |
---|
79 | { |
---|
80 | $query = 'SELECT url, texte FROM '.MP_PLAYLIST.' WHERE id IN (\''.$_GET['ex_id'].'\') ;'; |
---|
81 | $result = pwg_query($query); |
---|
82 | $data = pwg_db_fetch_assoc($result); |
---|
83 | $txt = stripslashes($data['texte']); |
---|
84 | $url = stripslashes($data['url']); |
---|
85 | $template->append('edit_ex', |
---|
86 | array('TXT'=>$txt, 'URL'=>$url, 'ID'=>$_GET['ex_id']) ); |
---|
87 | $template->assign( array( |
---|
88 | 'PLAYLIST' => $txt |
---|
89 | )); |
---|
90 | |
---|
91 | } |
---|
92 | // +-----------------------------------------+ |
---|
93 | // | Edit Musique | |
---|
94 | // +-----------------------------------------+ |
---|
95 | if (isset($_POST['envoi']) and $_POST['envoi']=="edit_music") |
---|
96 | { |
---|
97 | $nom = addslashes($_POST['nom']); |
---|
98 | $url = addslashes($_POST['url']); |
---|
99 | $query = ' |
---|
100 | UPDATE '.MP_MUSIC.' |
---|
101 | SET nom=\''.$nom.'\', url=\''.$url.'\' |
---|
102 | WHERE id IN (\''.$_POST['id'].'\') |
---|
103 | ;'; |
---|
104 | pwg_query($query); |
---|
105 | //$mp_msgs[] = $lang['mp_msg_edit1']; |
---|
106 | $page['infos'][]=l10n('mp_msg_edit1'); |
---|
107 | |
---|
108 | } |
---|
109 | if (isset($_GET['music_id'])) |
---|
110 | { |
---|
111 | $query = 'SELECT pl_id, nom, url FROM '.MP_MUSIC.' WHERE id IN (\''.$_GET['music_id'].'\') ;'; |
---|
112 | $result = pwg_query($query); |
---|
113 | $data = pwg_db_fetch_assoc($result); |
---|
114 | $nom = stripslashes($data['nom']); |
---|
115 | $url = stripslashes($data['url']); |
---|
116 | $template->append('edit_music', |
---|
117 | array('NOM'=>$nom, |
---|
118 | 'URL'=>$url, |
---|
119 | 'ID'=>$_GET['music_id'], |
---|
120 | 'PL'=>$data['pl_id'] |
---|
121 | ) ); |
---|
122 | $template->assign( array( |
---|
123 | 'PLAYLIST' => $nom |
---|
124 | )); |
---|
125 | } |
---|
126 | // +-----------------------------------------+ |
---|
127 | // | Suppression Musique | |
---|
128 | // +-----------------------------------------+ |
---|
129 | if (isset($_POST['envoi']) and $_POST['envoi']=="suppr") |
---|
130 | { |
---|
131 | $query = 'SELECT pl_id, url, rang FROM '.MP_MUSIC.' WHERE id IN (\''.$_POST['id'].'\') ;'; |
---|
132 | $result = pwg_query($query); |
---|
133 | $suppr = pwg_db_fetch_assoc($result); |
---|
134 | $url = stripslashes($suppr['url']); |
---|
135 | |
---|
136 | if(preg_match('`^music`',$url)) |
---|
137 | { |
---|
138 | $filename="./plugins/music_player/".$url; |
---|
139 | unlink($filename); |
---|
140 | $page['infos'][]=l10n('mp_msg_edit5').$url; |
---|
141 | } |
---|
142 | |
---|
143 | $rep = pwg_query('SELECT MAX(rang) AS max FROM '.MP_MUSIC.' WHERE pl_id='.$suppr['pl_id'].';'); |
---|
144 | $rang = pwg_db_fetch_assoc($rep); |
---|
145 | |
---|
146 | $i = $suppr['rang'] + 1; |
---|
147 | while ($i<=$rang['max']) { |
---|
148 | $rep = pwg_query('SELECT COUNT(*) AS result FROM '.MP_MUSIC.' WHERE rang IN (\''.$i.'\') AND pl_id IN (\''.$suppr['pl_id'].'\') ;'); |
---|
149 | $res = pwg_db_fetch_array($rep); |
---|
150 | if ($res['result'] != 0) |
---|
151 | { |
---|
152 | $query = 'SELECT id FROM '.MP_MUSIC.' WHERE rang IN (\''.$i.'\') AND pl_id IN (\''.$suppr['pl_id'].'\') ;'; |
---|
153 | $result = pwg_query($query); |
---|
154 | $meme = pwg_db_fetch_assoc($result); |
---|
155 | $i_inf = $i - 1 ; |
---|
156 | $query = 'UPDATE '.MP_MUSIC.' SET rang=\''.$i_inf.'\' WHERE id IN (\''.$meme['id'].'\') ;'; |
---|
157 | pwg_query($query); |
---|
158 | } |
---|
159 | $i++; |
---|
160 | }//while |
---|
161 | pwg_query('DELETE FROM '.MP_MUSIC.' WHERE id IN (\''.$_POST['id'].'\')'); |
---|
162 | $page['infos'][]=l10n('mp_msg_edit4').$url; |
---|
163 | } |
---|
164 | if (isset($_GET['suppr'])) |
---|
165 | { |
---|
166 | $query = 'SELECT pl_id, nom FROM '.MP_MUSIC.' WHERE id IN (\''.$_GET['suppr'].'\') ;'; |
---|
167 | $result = pwg_query($query); |
---|
168 | $data = pwg_db_fetch_assoc($result); |
---|
169 | $template->append('suppr', |
---|
170 | array('ID'=>$_GET['suppr'], |
---|
171 | 'PL'=>$data['pl_id'] |
---|
172 | ) ); |
---|
173 | $nom = stripslashes($data['nom']); |
---|
174 | $template->assign( array( |
---|
175 | 'PLAYLIST' => $nom |
---|
176 | )); |
---|
177 | |
---|
178 | } |
---|
179 | |
---|
180 | |
---|
181 | // +-----------------------------------------------------------------------+ |
---|
182 | // | envoi monter/descendre | |
---|
183 | // +-----------------------------------------------------------------------+ |
---|
184 | if (isset($_POST['envoi']) and $_POST['envoi']=="rang" ) |
---|
185 | { |
---|
186 | $query = ' |
---|
187 | UPDATE '.MP_MUSIC.' |
---|
188 | SET rang=\'-1\' |
---|
189 | WHERE rang IN (\''.$_POST['rang'].'\') AND pl_id IN (\''.$_GET['music'].'\') |
---|
190 | ;'; |
---|
191 | pwg_query($query); |
---|
192 | |
---|
193 | $query = ' |
---|
194 | UPDATE '.MP_MUSIC.' |
---|
195 | SET rang=\'-2\' |
---|
196 | WHERE rang IN (\''.$_POST['nouv_rang'].'\') AND pl_id IN (\''.$_GET['music'].'\') |
---|
197 | ;'; |
---|
198 | pwg_query($query); |
---|
199 | |
---|
200 | $query = ' |
---|
201 | UPDATE '.MP_MUSIC.' |
---|
202 | SET rang=\''.$_POST['nouv_rang'].'\' |
---|
203 | WHERE rang IN (\'-1\') AND pl_id IN (\''.$_GET['music'].'\') |
---|
204 | ;'; |
---|
205 | pwg_query($query); |
---|
206 | |
---|
207 | $query = ' |
---|
208 | UPDATE '.MP_MUSIC.' |
---|
209 | SET rang=\''.$_POST['rang'].'\' |
---|
210 | WHERE rang IN (\'-2\') AND pl_id IN (\''.$_GET['music'].'\') |
---|
211 | ;'; |
---|
212 | pwg_query($query); |
---|
213 | |
---|
214 | $page['infos'][]=l10n('mp_msg_edit3'); |
---|
215 | } |
---|
216 | // +-----------------------------------------------------------------------+ |
---|
217 | // | AJOUT | |
---|
218 | // +-----------------------------------------------------------------------+ |
---|
219 | if ( !isset($_POST['nbr_ajout']) and !isset($_GET['suppr'])) |
---|
220 | { |
---|
221 | $n=1; |
---|
222 | } |
---|
223 | elseif ( isset($_POST['nbr_ajout']) ) |
---|
224 | { |
---|
225 | $n=$_POST['nbr_ajout']; |
---|
226 | } |
---|
227 | // | EXtra | |
---|
228 | if (isset($_GET['music']))//affichage du contenu de la playlist |
---|
229 | { $template->assign(array('etape_ID' => $_GET['music'], 'etape_I' => $n ) ); |
---|
230 | |
---|
231 | for($i=1; $i <= $n ; $i++) |
---|
232 | { |
---|
233 | $template->append('ajout', array('I' => $i ) ); |
---|
234 | } |
---|
235 | }// +-----------------------------------------------------------------------+ |
---|
236 | if (isset($_POST['envoi']) and $_POST['envoi']=='ajout') |
---|
237 | { |
---|
238 | $rep = pwg_query('SELECT MAX(rang) AS max FROM '.MP_MUSIC.' WHERE pl_id='.$_GET['music'].';'); |
---|
239 | $rg = pwg_db_fetch_assoc($rep); |
---|
240 | for($i=1; $i <= $_POST['nbr'] ; $i++) |
---|
241 | { |
---|
242 | if ( $_POST['url_'.$i.'']=="" ) { $mp_msgs[] = $lang['mp_msg_err_aj1']; continue;} |
---|
243 | if ( $_POST['nom_'.$i.'']=="" ) { $mp_msgs[] = $lang['mp_msg_err_aj2']; continue;} |
---|
244 | |
---|
245 | $url = addslashes($_POST['url_'.$i.'']); |
---|
246 | $nom = addslashes($_POST['nom_'.$i.'']); |
---|
247 | |
---|
248 | if ( $_POST['rang_'.$i.'']>$rg['max'] or $_POST['rang_'.$i.'']==NULL) { $rang=$rg['max']+1; } |
---|
249 | else { |
---|
250 | $rang=$_POST['rang_'.$i.'']; |
---|
251 | //[ on doit décaler les autres pour insérer le nouveau |
---|
252 | $query = 'SELECT id, rang FROM '.MP_MUSIC.' WHERE pl_id='.$_GET['music'].' AND rang>='.$rang.' ORDER BY rang ;'; |
---|
253 | $result = pwg_query($query); |
---|
254 | while ($sup = pwg_db_fetch_assoc($result)){ |
---|
255 | |
---|
256 | $n_rang = $sup['rang'] + 1 ; |
---|
257 | $query = ' |
---|
258 | UPDATE '.MP_MUSIC.' |
---|
259 | SET rang=\''.$n_rang.'\' |
---|
260 | WHERE id IN (\''.$sup['id'].'\') |
---|
261 | ;'; |
---|
262 | pwg_query($query); |
---|
263 | |
---|
264 | }//while |
---|
265 | } |
---|
266 | $query = ' |
---|
267 | INSERT INTO '.MP_MUSIC.' |
---|
268 | (pl_id, rang, url, nom) |
---|
269 | VALUES |
---|
270 | (\''.$_GET['music'].'\', \''.$rang.'\', \''.$url.'\', \''.$nom.'\' ) |
---|
271 | ;'; |
---|
272 | pwg_query($query); |
---|
273 | $page['infos'][]=l10n('mp_msg_admin_4').$url; |
---|
274 | } |
---|
275 | } |
---|
276 | |
---|
277 | |
---|
278 | // +-----------------------------------------------------------------------+ |
---|
279 | // | Synchro bdd/fichier | |
---|
280 | // +-----------------------------------------------------------------------+ |
---|
281 | if (isset($_POST['envoi']) and $_POST['envoi']=='synchro_bdd') |
---|
282 | { |
---|
283 | |
---|
284 | $query = 'SELECT url FROM '.MP_PLAYLIST.' WHERE id IN (\''.$_POST['id_playlist'].'\') ;'; |
---|
285 | $result = pwg_query($query); |
---|
286 | $dt = pwg_db_fetch_assoc($result); |
---|
287 | |
---|
288 | /////[ recup music |
---|
289 | $fichier = array(); |
---|
290 | $dir_2 = opendir('./plugins/music_player/music/'.$dt['url']); |
---|
291 | while(false!==($file = readdir($dir_2))){ //on lit tout et on récupere tout les dossiers dans $folder |
---|
292 | |
---|
293 | if(!in_array($file, array('.','..'))){ //on eleve le parent et le courant '. et ..' |
---|
294 | if(is_file($file)) { continue; } |
---|
295 | $page = $file; //sort l'extension du fichier |
---|
296 | $page = explode('.', $page); |
---|
297 | $nb = count($page); |
---|
298 | $nom_fichier = $page[0]; |
---|
299 | for ($i = 1; $i < $nb-1; $i++){ |
---|
300 | $nom_fichier .= '.'.$page[$i]; |
---|
301 | } |
---|
302 | if(isset($page[1])){ |
---|
303 | $ext_fichier = $page[$nb-1]; |
---|
304 | } |
---|
305 | else { |
---|
306 | $ext_fichier = ''; |
---|
307 | } |
---|
308 | |
---|
309 | if($ext_fichier == 'mp3') { //On ne prend que les mp3 -- A tester : mid, wav... |
---|
310 | |
---|
311 | ///////[ Ajout ? |
---|
312 | $nom_fichier = addslashes($nom_fichier); |
---|
313 | //$rep = pwg_query('SELECT COUNT(*) AS result FROM '.MP_MUSIC.' WHERE pl_id='.$_POST['id_playlist'].' AND url REGEXP \''.$nom_fichier.'\' ;');like '%".$recherche."%'" |
---|
314 | $rep = pwg_query('SELECT COUNT(*) AS result FROM '.MP_MUSIC.' WHERE pl_id='.$_POST['id_playlist'].' AND url LIKE \'%'.$nom_fichier.'%\' ;'); |
---|
315 | $res = pwg_db_fetch_array($rep); |
---|
316 | if ($res['result']==0) |
---|
317 | { |
---|
318 | array_push($fichier, $file); |
---|
319 | } |
---|
320 | |
---|
321 | } |
---|
322 | }//fin if in array |
---|
323 | }//while |
---|
324 | |
---|
325 | $rep = pwg_query('SELECT MAX(rang) AS max FROM '.MP_MUSIC.' WHERE pl_id='.$_POST['id_playlist'].';'); |
---|
326 | $rang = pwg_db_fetch_assoc($rep); |
---|
327 | $n=$rang['max']+1; |
---|
328 | |
---|
329 | ///////[ Ajout ds bdd |
---|
330 | foreach($fichier as $file) { |
---|
331 | $page = $file; //sort le nom fichier |
---|
332 | $page = explode('.', $page); |
---|
333 | $nb = count($page); |
---|
334 | $nom_fichier = $page[0]; |
---|
335 | $file = utf8_encode(addslashes($file)); |
---|
336 | $nom_fichier = utf8_encode(addslashes($nom_fichier)); |
---|
337 | $query = ' |
---|
338 | INSERT INTO '.MP_MUSIC.' |
---|
339 | (pl_id, rang, url, nom) |
---|
340 | VALUES |
---|
341 | (\''.$_POST['id_playlist'].'\', \''.$n.'\', \'music/'.$dt['url'].'/'.$file.'\', \''.$nom_fichier.'\' ) |
---|
342 | ;'; |
---|
343 | pwg_query($query); |
---|
344 | //$mp_msgs[] = $lang['mp_msg_admin_4'].$file; |
---|
345 | $page['infos'][]=l10n('mp_msg_admin_4').$file; |
---|
346 | $n++; |
---|
347 | } |
---|
348 | |
---|
349 | //////[ Fichiers supprimés ? |
---|
350 | $query = 'SELECT * FROM '.MP_MUSIC.' WHERE pl_id='.$_GET['music'].' ORDER BY rang ;'; |
---|
351 | $result = pwg_query($query); |
---|
352 | while ($music = pwg_db_fetch_assoc($result)){ |
---|
353 | $url = stripslashes($music['url']); |
---|
354 | |
---|
355 | if(preg_match('`^music`', $music['url'])) { |
---|
356 | $filename="./plugins/music_player/".$url; |
---|
357 | $filename=utf8_decode($filename); |
---|
358 | if (!file_exists($filename)) { |
---|
359 | $music['url']=addslashes($music['url']); |
---|
360 | pwg_query('DELETE FROM '.MP_MUSIC.' WHERE url IN (\''.$music['url'].'\')'); |
---|
361 | $page['infos'][]=l10n('mp_msg_edit4').$url; |
---|
362 | } |
---|
363 | } |
---|
364 | } |
---|
365 | } |
---|
366 | // +-----------------------------------------------------------------------+ |
---|
367 | // | Génération XML | |
---|
368 | // +-----------------------------------------------------------------------+ |
---|
369 | if (isset($_POST['envoi']) and $_POST['envoi']=='synchro_xml') |
---|
370 | { |
---|
371 | $query = 'SELECT url FROM '.MP_PLAYLIST.' WHERE id IN (\''.$_POST['id_playlist'].'\') ;'; |
---|
372 | $result = pwg_query($query); |
---|
373 | $dt = pwg_db_fetch_assoc($result); |
---|
374 | |
---|
375 | $query = 'SELECT * FROM '.MP_MUSIC.' WHERE pl_id='.$_GET['music'].' ORDER BY rang ;'; |
---|
376 | $result = pwg_query($query); |
---|
377 | |
---|
378 | $filename="./plugins/music_player/music/".$dt['url']."/".$dt['url'].".xml"; |
---|
379 | |
---|
380 | //////////////////////Création XML |
---|
381 | $_xml ="<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n"; |
---|
382 | $_xml .="<playlist version=\"1\" xmlns=\"http://xspf.org/ns/0/\">\r\n"; |
---|
383 | $_xml .="\t<trackList>\r\n"; |
---|
384 | |
---|
385 | while ($music = pwg_db_fetch_assoc($result)){ |
---|
386 | $nom_fichier=stripslashes($music['nom']); |
---|
387 | $url=stripslashes($music['url']); |
---|
388 | $_xml .="\t\t<track>\r\n"; |
---|
389 | $_xml .="\t\t\t<title>".$nom_fichier."</title>\r\n"; |
---|
390 | $_xml .="\t\t\t<location>".$url."</location>\r\n"; |
---|
391 | $_xml .="\t\t\t<image>music/".$dt['url']."/".$dt['url'].".jpg</image>\r\n"; |
---|
392 | $_xml .="\t\t</track>\r\n"; |
---|
393 | } |
---|
394 | |
---|
395 | $_xml .="\t</trackList>\r\n"; |
---|
396 | $_xml .="</playlist>"; |
---|
397 | $file= fopen($filename, "w"); |
---|
398 | if (!is_writable($filename) ) { |
---|
399 | die("Le fichier est inaccessible en écriture"); |
---|
400 | } |
---|
401 | fwrite($file, $_xml); |
---|
402 | $page['infos'][]=l10n('mp_msg_edit2'); |
---|
403 | } |
---|
404 | // +-----------------------------------------------------------------------+ |
---|
405 | if (isset($_GET['music']))//affichage du contenu de la playlist |
---|
406 | // +-----------------------------------------------------------------------+ |
---|
407 | { |
---|
408 | $query = 'SELECT texte FROM '.MP_PLAYLIST.' WHERE id='.$_GET['music'].' ;'; |
---|
409 | $result = pwg_query($query); |
---|
410 | $playlist = pwg_db_fetch_assoc($result); |
---|
411 | |
---|
412 | $txt = stripslashes($playlist['texte']); |
---|
413 | $template->assign( array( |
---|
414 | 'PLAYLIST' => $txt |
---|
415 | )); |
---|
416 | |
---|
417 | $template->assign(array('playlist_TEXTE'=>$txt, 'playlist_ID'=>$_GET['music'])); |
---|
418 | |
---|
419 | $rep = pwg_query('SELECT MAX(rang) AS max FROM '.MP_MUSIC.' WHERE pl_id='.$_GET['music'].';'); |
---|
420 | $rang = pwg_db_fetch_assoc($rep); |
---|
421 | |
---|
422 | $query = 'SELECT * FROM '.MP_MUSIC.' WHERE pl_id='.$_GET['music'].' ORDER BY rang ;'; |
---|
423 | $result = pwg_query($query); |
---|
424 | $num=0; |
---|
425 | while ($music = pwg_db_fetch_assoc($result)){ |
---|
426 | $music_url = stripslashes($music['url']); |
---|
427 | $music_nom = stripslashes($music['nom']); |
---|
428 | |
---|
429 | if ($music['rang']==$rang['max'] and $music['rang']=='1') |
---|
430 | { |
---|
431 | $template->append('music', |
---|
432 | array('NOM' => $music_nom, |
---|
433 | 'FILE' => $music_url, |
---|
434 | 'ID' => $music['id'], |
---|
435 | 'CLASS' => ($num++ % 2 == 1) ? 'row2' : 'row1')); |
---|
436 | } |
---|
437 | elseif ($music['rang']==$rang['max']) |
---|
438 | { |
---|
439 | $template->append('music', |
---|
440 | array('NOM' => $music_nom, |
---|
441 | 'FILE' => $music_url, |
---|
442 | 'ID' => $music['id'], |
---|
443 | 'CLASS' => ($num++ % 2 == 1) ? 'row2' : 'row1', |
---|
444 | 'UP_RANG' => $music['rang'], |
---|
445 | 'UP_RANG_NEW' => ($music['rang']-1) )); |
---|
446 | } |
---|
447 | elseif ($music['rang']=='1') |
---|
448 | { |
---|
449 | $template->append('music', |
---|
450 | array('NOM' => $music_nom, |
---|
451 | 'FILE' => $music_url, |
---|
452 | 'ID' => $music['id'], |
---|
453 | 'CLASS' => ($num++ % 2 == 1) ? 'row2' : 'row1', |
---|
454 | 'D_RANG' => $music['rang'], |
---|
455 | 'D_RANG_NEW' => ($music['rang']+1) )); |
---|
456 | } |
---|
457 | else |
---|
458 | { |
---|
459 | $template->append('music', |
---|
460 | array('NOM' => $music_nom, |
---|
461 | 'FILE' => $music_url, |
---|
462 | 'ID' => $music['id'], |
---|
463 | 'CLASS' => ($num++ % 2 == 1) ? 'row2' : 'row1', |
---|
464 | 'D_RANG' => $music['rang'], |
---|
465 | 'D_RANG_NEW' => ($music['rang']+1), |
---|
466 | 'UP_RANG' => $music['rang'], |
---|
467 | 'UP_RANG_NEW' => ($music['rang']-1) )); |
---|
468 | } |
---|
469 | } |
---|
470 | } |
---|
471 | |
---|
472 | // +-----------------------------------------------------------------------+ |
---|
473 | // | affichage | |
---|
474 | // +-----------------------------------------------------------------------+ |
---|
475 | $template->set_filename('plugin_admin_content', $m_p->plugin_path.'template/admin_edit.tpl'); |
---|
476 | $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); |
---|
477 | |
---|
478 | |
---|
479 | ?> |
---|