20b18f48a5814da0534e45aa1f3e7638003b5f43
3 * Copyright (C) 2003-2004 Polytechnique.org
4 * http://opensource.polytechnique.org/
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 require_once 'diogenes.page.inc.php';
23 require_once 'Barrel/Options.php';
25 /** This class describes a toplevel Diogenes page.
27 class DiogenesToplevel
extends DiogenesPage
{
31 * @param admin is this an admin page?
33 function DiogenesToplevel($admin = false
)
36 $this->DiogenesPage();
38 $this->assign('site',"Diogenes");
39 $this->assign('page', $admin ?
__("Toplevel administration") : __("Home"));
42 $this->startSession();
44 // handle logout request
45 if (isset($_REQUEST['dologout']))
49 if ($admin ||
isset($_REQUEST['doauth']))
50 $_SESSION['session']->doAuth($this);
52 if ($admin && !$_SESSION['session']->hasPerms("root"))
53 $this->kill(__("You are not authorized to view this page!"), 403);
58 /** Build the contents of the page's "head" tag.
62 array_push($this->head
, '<meta name="description" content="Diogenes content management system" />');
63 array_push($this->head
, '<meta name="keywords" content="Diogenes, Polytechnique.org, Jeremy Lainé" />');
64 array_push($this->head
, '<link rel="stylesheet" href="'.$this->url("common.css").'" type="text/css" />');
65 array_push($this->head
, '<link rel="stylesheet" href="'.$this->url("toplevel.css").'" type="text/css" />');
66 array_push($this->head
, '<link rel="icon" href="'.$this->url("images/favicon.png").'" type="image/png" />');
70 /** Build the page's menu.
77 $this->assign('menustyle', $globals->menu_style
);
78 $this->assign('menutheme', $globals->menu_theme
);
81 array_push($this->menu
, array(0,"Diogenes", "", 1));
82 array_push($this->menu
, array(1,__("Home"), $this->url("")));
83 array_push($this->menu
, array(1,__("User manual"), __("http://diogenes-doc.polytechnique.org/en-user/")) );
85 if ($this->isLogged()) {
86 array_push($this->menu
, array(1,__("Preferences"),$this->url("prefs.php")) );
87 array_push($this->menu
, array(1,__("Logout"), $this->url("?dologout=1")) );
89 array_push($this->menu
, array(1,__("Login"), $this->url("?doauth=1")) );
91 if ($this->isRoot()) {
92 array_push($this->menu
, array(0,__("Sites"), "", 1));
93 array_push($this->menu
, array(1, __("Root manual"), __("http://diogenes-doc.polytechnique.org/en-root/")) );
94 array_push($this->menu
, array(1,__("List of sites"), $this->url("toplevel/")) );
95 array_push($this->menu
, array(1,__("Administrators"),$this->url("toplevel/admins.php")) );
96 array_push($this->menu
, array(1,__("Global options"),$this->url("toplevel/options.php")) );
97 array_push($this->menu
, array(1,__("Plugins"),$this->url("toplevel/plugins.php")));
98 array_push($this->menu
, array(0,__("Users"), "", 1));
99 array_push($this->menu
, array(1,__("User accounts"),$this->url("toplevel/accounts.php")) );
100 array_push($this->menu
, array(1,__("Browse user log"),$this->url("toplevel/logger.php")) );
101 array_push($this->menu
, array(1,__("Logger actions"),$this->url("toplevel/logger_actions.php")) );