diogenes.toplevel.inc.php

00001 <?php
00002 /*
00003  * Copyright (C) 2003-2004 Polytechnique.org
00004  * http://opensource.polytechnique.org/
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019  */
00020 
00021 
00022 require_once 'diogenes.page.inc.php';
00023 require_once 'Barrel/Options.php';
00024 
00027 class DiogenesToplevel extends DiogenesPage {
00028 
00033   function DiogenesToplevel($admin = false)
00034   {
00035     // page basics
00036     $this->DiogenesPage();
00037     $this->makeHead();
00038     $this->assign('site',"Diogenes");  
00039     $this->assign('page', $admin ? __("Toplevel administration") : __("Home"));
00040 
00041     // start session
00042     $this->startSession();
00043 
00044     // handle logout request
00045     if (isset($_REQUEST['dologout'])) 
00046       $this->doLogout();
00047 
00048     // do auth
00049     if ($admin || isset($_REQUEST['doauth']))
00050       $_SESSION['session']->doAuth($this);
00051     
00052     if ($admin && !$_SESSION['session']->hasPerms("root"))
00053       $this->kill(__("You are not authorized to view this page!"), 403);
00054   }
00055 
00056 
00057     
00060   function makeHead()
00061   {
00062     array_push($this->head, '<meta name="description" content="Diogenes content management system" />');
00063     array_push($this->head, '<meta name="keywords" content="Diogenes, Polytechnique.org, Jeremy Lain&eacute;" />');
00064     array_push($this->head, '<link rel="stylesheet" href="'.$this->url("common.css").'" type="text/css" />');
00065     array_push($this->head, '<link rel="stylesheet" href="'.$this->url("toplevel.css").'" type="text/css" />');
00066     array_push($this->head, '<link rel="icon" href="'.$this->url("images/favicon.png").'" type="image/png" />');
00067   }
00068 
00069 
00072   function makeMenu()
00073   {
00074     global $globals;
00075     
00076     // menu style & theme
00077     $this->assign('menustyle', $globals->menu_style);
00078     $this->assign('menutheme', $globals->menu_theme);
00079 
00080     // menu items
00081     array_push($this->menu, array(0,"Diogenes", "", 1));
00082     array_push($this->menu, array(1,__("Home"), $this->url("")));
00083     array_push($this->menu, array(1,__("User manual"), __("http://diogenes-doc.polytechnique.org/en-user/")) );
00084 
00085     if ($this->isLogged()) {
00086       array_push($this->menu, array(1,__("Preferences"),$this->url("prefs.php")) );
00087       array_push($this->menu, array(1,__("Logout"), $this->url("?dologout=1")) );
00088     } else {
00089       array_push($this->menu, array(1,__("Login"), $this->url("?doauth=1")) );
00090     }
00091     if ($this->isRoot()) {
00092       array_push($this->menu, array(0,__("Sites"), "", 1));
00093       array_push($this->menu, array(1, __("Root manual"), __("http://diogenes-doc.polytechnique.org/en-root/")) );
00094       array_push($this->menu, array(1,__("List of sites"), $this->url("toplevel/")) );
00095       array_push($this->menu, array(1,__("Administrators"),$this->url("toplevel/admins.php")) );
00096       array_push($this->menu, array(1,__("Global options"),$this->url("toplevel/options.php")) );
00097       array_push($this->menu, array(1,__("Plugins"),$this->url("toplevel/plugins.php")));      
00098       array_push($this->menu, array(0,__("Users"), "", 1));
00099       array_push($this->menu, array(1,__("User accounts"),$this->url("toplevel/accounts.php")) );
00100       array_push($this->menu, array(1,__("Browse user log"),$this->url("toplevel/logger.php")) );
00101       array_push($this->menu, array(1,__("Logger actions"),$this->url("toplevel/logger_actions.php")) );
00102     }
00103   }
00104 
00105 }
00106 
00107 ?>

Generated on Fri Jan 11 01:20:08 2008 for Diogenes by  doxygen 1.5.1