source: extensions/Flash_Gallery/admin/admin.php @ 3531

Revision 3531, 1.8 KB checked in by tiico, 11 years ago (diff)

First revision (for testing)
Only in French (translation to be done)

Line 
1<?php
2
3if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
4
5global $template, $conf, $user;
6
7load_language('plugin.lang', FLASHGAL_PATH);
8include_once(PHPWG_ROOT_PATH.'admin/include/tabsheet.class.php');
9include_once(FLASHGAL_PATH . 'include/functions.inc.php');
10include_once(FLASHGAL_PATH . 'admin/functions.inc.php');
11$my_base_url = get_admin_plugin_menu_link(__FILE__);
12
13get_flash_modules_language();
14
15// +-----------------------------------------------------------------------+
16// |                            Tabsheet
17// +-----------------------------------------------------------------------+
18if (!isset($_GET['tab']))
19    $page['tab'] = 'manage';
20else
21    $page['tab'] = $_GET['tab'];
22
23$tabsheet = new tabsheet();
24$tabsheet->add('manage',
25               l10n('flashgal_mods_management'),
26               $my_base_url.'&amp;tab=manage');
27$tabsheet->add('new',
28               l10n('flashgal_add_mod'),
29               $my_base_url.'&amp;tab=new');
30$tabsheet->select($page['tab']);
31$tabsheet->assign();
32
33//Ajout d'un module
34if (isset($_POST['addModule']) and !is_adviser())
35{
36        if (!isset($_POST['module']))
37  {
38                array_push($page['errors'], l10n('flashgal_error_no_mod_selected'));
39        }
40  else
41  {
42    redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadd_module.php&type=' . $_POST['module']);
43        }
44}
45
46//Suppression d'un module
47if (isset($_GET['del']) and !is_adviser())
48{
49        pwg_query('DELETE FROM ' . FLASHGAL_TABLE . ' WHERE id = ' . $_GET['del'] . ' LIMIT 1;');
50  redirect(PHPWG_ROOT_PATH.'admin.php?page=plugin&section=' . FLASHGAL_DIR . '%2Fadmin%2Fadmin.php');
51}
52
53//Récupération des modules disponibles
54$modules = get_flashgal_modules();
55
56// Include file
57include(FLASHGAL_PATH.'admin/'.$page['tab'].'.php');
58
59?>
Note: See TracBrowser for help on using the repository browser.