source: extensions/AddInfo/admin/admin.php @ 30608

Last change on this file since 30608 was 21631, checked in by ddtddt, 12 years ago

[extensions] - AddInfo - change to 2.5 - chose emplacement imfo

File size: 2.3 KB
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3global $template, $conf, $user;
4include_once(PHPWG_ROOT_PATH .'admin/include/tabsheet.class.php');
5load_language('plugin.lang', ADDINFO_PATH);
6$my_base_url = get_admin_plugin_menu_link(__FILE__);
7
8// +-----------------------------------------------------------------------+
9// | Check Access and exit when user status is not ok                      |
10// +-----------------------------------------------------------------------+
11check_status(ACCESS_ADMINISTRATOR);
12
13//-------------------------------------------------------- sections definitions
14
15// Gestion des onglets
16if (!isset($_GET['tab']))
17    $page['tab'] = 'explication';
18else
19    $page['tab'] = $_GET['tab'];
20
21$tabsheet = new tabsheet();
22$tabsheet->add('explication',
23               l10n('addinfo_explication'),
24               $my_base_url.'&amp;tab=explication');
25$tabsheet->add('gestion',
26               l10n('Configuration'),
27               $my_base_url.'&amp;tab=gestion');
28$tabsheet->select($page['tab']);
29$tabsheet->assign();
30
31switch ($page['tab'])
32{
33// tab help
34  case 'explication':
35  $explication = 'explication';
36$template->assign(
37        $explication,
38        array(
39          'meta'=>l10n('meta_name'),
40          ));
41 
42        break;
43       
44  case 'gestion':
45
46  global $conf;
47 
48    $selected = $conf['AddInfo'];
49        $options['Author'] = l10n('Author');
50        $options['datecreate'] = l10n('Created on');
51        $options['datepost'] = l10n('Posted on');
52        $options['Dimensions'] = l10n('Dimensions');
53        $options['File'] = l10n('File');
54        $options['Filesize'] = l10n('Filesize');
55        $options['Tags'] = l10n('tags');
56        $options['Categories'] = l10n('Albums');
57        $options['Visits'] = l10n('Visits');
58        $options['Average'] = l10n('Rating score');
59
60       
61
62  $template->assign(
63    'gestionA',
64    array(
65      'OPTIONS' => $options,
66      'SELECTED' => $selected
67      ));
68   
69
70if (isset($_POST['infoaddinfo']))
71        {
72conf_update_param('AddInfo', $_POST['infoaddinfo']);
73$template->delete_compiled_templates();
74array_push($page['infos'], l10n('Your configuration settings are saved'));
75
76  $selected = $_POST['infoaddinfo'];
77  $template->assign(
78    'gestionA',
79    array(
80      'OPTIONS' => $options,
81      'SELECTED' => $selected
82      ));
83        }
84  break;
85       
86} 
87
88$template->set_filenames(array('plugin_admin_content' => dirname(__FILE__) . '/admin.tpl')); 
89$template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');
90?>
Note: See TracBrowser for help on using the repository browser.