Index: /extensions/WiredForSound/admin/add_page_on_index.php =================================================================== --- /extensions/WiredForSound/admin/add_page_on_index.php (revision 3302) +++ /extensions/WiredForSound/admin/add_page_on_index.php (revision 3302) @@ -0,0 +1,131 @@ +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'])) +{ + $template->assign('ACTUAL_FILE', $result['sound']); +} + +$template->assign(array( + 'MP3_PATH' => $mp3_path, + 'BACK' => $back_url, + 'VOLUME' => $volume)); + +$template->set_filename('plugin_admin_content', dirname(__FILE__) . '/../template/add_page_on_index.tpl'); +$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); + +?> Index: /extensions/WiredForSound/admin/add_page_on_picture.php =================================================================== --- /extensions/WiredForSound/admin/add_page_on_picture.php (revision 3302) +++ /extensions/WiredForSound/admin/add_page_on_picture.php (revision 3302) @@ -0,0 +1,178 @@ +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'); + +?> Index: /extensions/WiredForSound/admin/admin.php =================================================================== --- /extensions/WiredForSound/admin/admin.php (revision 3302) +++ /extensions/WiredForSound/admin/admin.php (revision 3302) @@ -0,0 +1,65 @@ +assign(array( + 'DEFAULT_PATH' => $wfs_conf[0], + 'DEFAULT_VOLUME' => $wfs_conf[1])); +if ($wfs_conf[2] == '44') $template->assign(array('SMALL_PLAYER' => 'checked="checked"')); +if ($wfs_conf[2] == '64') $template->assign(array('MEDIUM_PLAYER' => 'checked="checked"')); +if ($wfs_conf[2] == '202') $template->assign(array('BIG_PLAYER' => 'checked="checked"')); +if ($wfs_conf[3] == '1') +{ + $template->assign(array('AUTOSTART_ON' => 'checked="checked"')); +} +else +{ + $template->assign(array('AUTOSTART_OFF' => 'checked="checked"')); +} +if ($wfs_conf[4] == '1') +{ + $template->assign(array('AUTOREPLAY_ON' => 'checked="checked"')); +} +else +{ + $template->assign(array('AUTOREPLAY_OFF' => 'checked="checked"')); +} + +$template->set_filenames(array('plugin_admin_content' => realpath(WFS_PATH . 'template/admin.tpl'))); +$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); + +?> Index: /extensions/WiredForSound/admin/index.php =================================================================== --- /extensions/WiredForSound/admin/index.php (revision 3302) +++ /extensions/WiredForSound/admin/index.php (revision 3302) @@ -0,0 +1,33 @@ + Index: /extensions/WiredForSound/index.php =================================================================== --- /extensions/WiredForSound/index.php (revision 3302) +++ /extensions/WiredForSound/index.php (revision 3302) @@ -0,0 +1,33 @@ + Index: /extensions/WiredForSound/language/en_UK/index.php =================================================================== --- /extensions/WiredForSound/language/en_UK/index.php (revision 3302) +++ /extensions/WiredForSound/language/en_UK/index.php (revision 3302) @@ -0,0 +1,33 @@ + Index: /extensions/WiredForSound/language/en_UK/plugin.lang.php =================================================================== --- /extensions/WiredForSound/language/en_UK/plugin.lang.php (revision 3302) +++ /extensions/WiredForSound/language/en_UK/plugin.lang.php (revision 3302) @@ -0,0 +1,38 @@ + Index: /extensions/WiredForSound/language/fr_FR/index.php =================================================================== --- /extensions/WiredForSound/language/fr_FR/index.php (revision 3302) +++ /extensions/WiredForSound/language/fr_FR/index.php (revision 3302) @@ -0,0 +1,33 @@ + Index: /extensions/WiredForSound/language/fr_FR/plugin.lang.php =================================================================== --- /extensions/WiredForSound/language/fr_FR/plugin.lang.php (revision 3302) +++ /extensions/WiredForSound/language/fr_FR/plugin.lang.php (revision 3302) @@ -0,0 +1,38 @@ + Index: /extensions/WiredForSound/language/index.php =================================================================== --- /extensions/WiredForSound/language/index.php (revision 3302) +++ /extensions/WiredForSound/language/index.php (revision 3302) @@ -0,0 +1,33 @@ + Index: /extensions/WiredForSound/main.inc.php =================================================================== --- /extensions/WiredForSound/main.inc.php (revision 3302) +++ /extensions/WiredForSound/main.inc.php (revision 3302) @@ -0,0 +1,45 @@ + 'Wired For Sound', + 'URL' => get_admin_plugin_menu_link(WFS_PATH . 'admin/admin.php'))); + return $menu; +} + +function wired_for_sound_on_index() +{ + global $page, $template, $conf, $prefixeTable, $lang; + if (isset($page['category']) || isset($page['section']) and !isset($page['chronology_field']) and !isset($page['flat'])) + include(WFS_PATH . 'wfs_on_index.php'); +} + +function wired_for_sound_on_picture() +{ + global $page, $template, $conf, $prefixeTable, $lang; + include(WFS_PATH . 'wfs_on_picture.php'); +} + +add_event_handler('get_admin_plugin_menu_links', 'wfs_admin_menu'); +add_event_handler('loc_end_index' , 'wired_for_sound_on_index'); +add_event_handler('loc_end_picture' , 'wired_for_sound_on_picture'); + +?> Index: /extensions/WiredForSound/maintain.inc.php =================================================================== --- /extensions/WiredForSound/maintain.inc.php (revision 3302) +++ /extensions/WiredForSound/maintain.inc.php (revision 3302) @@ -0,0 +1,57 @@ + Index: /extensions/WiredForSound/mp3/index.php =================================================================== --- /extensions/WiredForSound/mp3/index.php (revision 3302) +++ /extensions/WiredForSound/mp3/index.php (revision 3302) @@ -0,0 +1,33 @@ + Index: /extensions/WiredForSound/template/add_page_on_index.tpl =================================================================== --- /extensions/WiredForSound/template/add_page_on_index.tpl (revision 3302) +++ /extensions/WiredForSound/template/add_page_on_index.tpl (revision 3302) @@ -0,0 +1,44 @@ +