assign('delete', true); } // Dossier mp3 if (isset($result['sound']) and !isset($_POST['change_path']) and !isset($wfs_param[2])) { $mp3_path = substr($result['sound'] , 0 , strrpos($result['sound'] , '/') + 1); } // Volume if (isset($result['volume'])) { $volume = $result['volume']; } // Liste des mp3 du dossier spécifié if (is_dir('./' . $mp3_path) and $contents = opendir($mp3_path)) { $options[] = '----------------'; $selected = 0; while (($node = readdir($contents)) !== false) { if (is_file('./' . $mp3_path . $node)) { $extension = strtolower(get_extension($node)); if ($extension == 'mp3') { $value = $mp3_path . $node; if (isset($result['sound']) and $result['sound'] == $value) { $selected = $value; } $options[$value] = $node; } } } closedir($contents); // Erreur si pas de mp3 if (count($options) == 1) { array_push($page['errors'], l10n('wfs_no_mp3')); } else { $template->assign('mp3_select', array( 'OPTIONS' => $options, 'SELECTED' => $selected)); } } else { array_push($page['errors'], l10n('wfs_no_path')); } // Affichage du fichier associé if (isset($result['sound'])) { if (isset($result['cat_id'])) { $assign_all = l10n('wfs_only_this_cat'); } else { $assign_all = l10n('wfs_all_cat'); } $template->assign(array( 'ACTUAL_FILE' => $result['sound'], 'ASSIGN_ALL' => $assign_all)); } $template->assign(array( 'MP3_PATH' => $mp3_path, 'BACK' => $back_url, 'VOLUME' => $volume)); $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/../template/add_page_on_picture.tpl'); $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); ?>