1 | <?php |
---|
2 | |
---|
3 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
4 | |
---|
5 | global $template, $conf, $user; |
---|
6 | |
---|
7 | load_language('plugin.lang', CONCOURS_PATH); |
---|
8 | include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php'); |
---|
9 | include_once(CONCOURS_PATH . 'admin/functions.inc.php'); |
---|
10 | add_event_handler('get_admin_plugin_menu_links', 'localfiles_admin_menu'); |
---|
11 | $my_base_url = get_root_url().'admin.php?page=plugin-'.CONCOURS_DIR; |
---|
12 | |
---|
13 | |
---|
14 | $concours_tabs = array('manage', 'add_concours', 'config', 'params', 'help'); |
---|
15 | |
---|
16 | |
---|
17 | // +-----------------------------------------------------------------------+ |
---|
18 | // | Tabsheet |
---|
19 | // +-----------------------------------------------------------------------+ |
---|
20 | if (!isset($_GET['tab'])) |
---|
21 | $page['tab'] = $concours_tabs[0]; |
---|
22 | else |
---|
23 | $page['tab'] = $_GET['tab']; |
---|
24 | |
---|
25 | $tabsheet = new tabsheet(); |
---|
26 | $tabsheet->add('manage', |
---|
27 | l10n('concours_management'), |
---|
28 | $my_base_url.'-manage'); |
---|
29 | |
---|
30 | $tabsheet->add('add_concours', |
---|
31 | l10n('concours_add'), |
---|
32 | $my_base_url.'-add_concours&action=new'); |
---|
33 | |
---|
34 | $tabsheet->add('config', |
---|
35 | l10n('concours_config'), |
---|
36 | $my_base_url.'-config'); |
---|
37 | |
---|
38 | $tabsheet->add('params', |
---|
39 | l10n('concours_params'), |
---|
40 | $my_base_url.'-params'); |
---|
41 | |
---|
42 | |
---|
43 | $tabsheet->add('help', |
---|
44 | l10n('concours_help'), |
---|
45 | $my_base_url.'-help'); |
---|
46 | |
---|
47 | $tabsheet->select($page['tab']); |
---|
48 | $tabsheet->assign(); |
---|
49 | |
---|
50 | if (isset($_GET['concours'])) |
---|
51 | { |
---|
52 | // Get informations from base for concours_id |
---|
53 | $concours = new Concours($_GET['concours']); |
---|
54 | } |
---|
55 | |
---|
56 | |
---|
57 | // Add informations from previous pages if present |
---|
58 | if (isset($_GET['infos']) && isset($concours)) |
---|
59 | { |
---|
60 | $infos = $_GET['infos']; |
---|
61 | switch($infos) |
---|
62 | { |
---|
63 | case "0" : |
---|
64 | // array_push($page['infos'], sprintf( l10n('concours_saved'), $concours->concours_id, $concours->concours_infos['name'])); |
---|
65 | array_push($page['infos'], l10n('concours_saved', $concours->concours_id, $concours->concours_infos['name'])); |
---|
66 | break; |
---|
67 | |
---|
68 | } |
---|
69 | } |
---|
70 | |
---|
71 | $template->assign( 'CONCOURS_VERSION', l10n('concoursphoto')." (<i>Version ".CONCOURS_VERSION.'</i>)'); |
---|
72 | |
---|
73 | |
---|
74 | // Include file |
---|
75 | include_once(CONCOURS_PATH.'admin/'.$page['tab'].'.php'); |
---|
76 | |
---|
77 | ?> |
---|