source: extensions/WiredForSound/admin/admin.php @ 20852

Last change on this file since 20852 was 3609, checked in by patdenice, 15 years ago

Convert all php and tpl files in Unix format for my plugins.

File size: 1.9 KB
Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4load_language('plugin.lang', WFS_PATH);
5
6global $conf, $template, $lang;
7
8$wfs_conf = explode ("," , $conf['wired_for_sound']);
9// Enregistrement de la configuration
10if (isset($_POST['submit']))
11{
12  if (strrpos($_POST['default_path'] , '/') != (strlen($_POST['default_path']) - 1))
13  {
14    $_POST['default_path'] .= '/';
15  }
16  if (!is_dir('./' . $_POST['default_path']))
17  {
18    $wfs_conf[0] = $_POST['default_path'];
19    array_push($page['errors'], l10n('wfs_no_path'));
20  }
21  else
22  {
23    $wfs_conf = array($_POST['default_path'],
24      $_POST['default_volume'],
25      $_POST['width_player'],
26      $_POST['autostart'],
27      $_POST['autoreplay']);
28    $new_wfs_conf = implode ("," , $wfs_conf);
29    $query = '
30UPDATE ' . CONFIG_TABLE . '
31    SET value="' . $new_wfs_conf . '"
32    WHERE param="wired_for_sound"
33    LIMIT 1';
34      pwg_query($query);
35      array_push($page['infos'], l10n('wfs_conf_saved'));
36  }
37}
38// Parametrage du template
39$template->assign(array(
40  'DEFAULT_PATH' => $wfs_conf[0],
41  'DEFAULT_VOLUME' => $wfs_conf[1]));
42if ($wfs_conf[2] == '44') $template->assign(array('SMALL_PLAYER' => 'checked="checked"'));
43if ($wfs_conf[2] == '64') $template->assign(array('MEDIUM_PLAYER' => 'checked="checked"'));
44if ($wfs_conf[2] == '202') $template->assign(array('BIG_PLAYER' => 'checked="checked"'));
45if ($wfs_conf[3] == '1')
46{
47  $template->assign(array('AUTOSTART_ON' => 'checked="checked"'));
48}
49else
50{
51  $template->assign(array('AUTOSTART_OFF' => 'checked="checked"'));
52}
53if ($wfs_conf[4] == '1')
54{
55  $template->assign(array('AUTOREPLAY_ON' => 'checked="checked"'));
56}
57else
58{
59  $template->assign(array('AUTOREPLAY_OFF' => 'checked="checked"'));
60}
61
62$template->set_filenames(array('plugin_admin_content' => realpath(WFS_PATH . 'template/admin.tpl')));
63$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
64
65?>
Note: See TracBrowser for help on using the repository browser.