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.barrel.inc.php';
24 /** Page for administrators only.
26 class DiogenesAdmin
extends DiogenesBarrel
28 /** The constructor. Creates an administrative page.
30 * @param dir the directory to operate on (optional)
32 function DiogenesAdmin($dir = "")
36 $this->DiogenesBarrel();
37 $this->assign('page',__("Administration"));
40 $this->startSession();
42 $res = $globals->db
->query("select wperms from {$this->barrel->table_page} where PID='$dir'");
43 if (!list($wperms) = mysql_fetch_row($res))
44 $this->kill(__("Directory not found"));
45 $this->checkPerms($wperms);
47 $this->checkPerms('admin');
52 /** Returns the master template for the current context.
54 function getTemplate()
56 return DiogenesPage
::getTemplate('master.tpl');
60 /** Build the admin menu.
65 // retrieve homepage PID
66 $homepage = $this->barrel
->getPID('');
68 array_push($this->menu
, array( 1, __("Home"), $this->urlSite("") ) );
69 array_push($this->menu
, array( 1, __("Admin manual"), __("http://diogenes-doc.polytechnique.org/en-admin/") ) );
70 array_push($this->menu
, array( 0, __("Administration"), "", 1 ) );
71 array_push($this->menu
, array( 1, __("Activity"), "./") );
72 array_push($this->menu
, array( 1, __("Options"), "options") );
73 if ($this->barrel
->hasFlag('plug'))
75 array_push($this->menu
, array( 1, __("Plugins"), "plugins") );
77 array_push($this->menu
, array( 1, __("Users"), "users") );
78 array_push($this->menu
, array( 1, __("WebDAV"), "webdav") );
79 array_push($this->menu
, array( 0, __("Content"), "", 1 ) );
80 array_push($this->menu
, array( 1, __("Pages catalog"), "files?dir={$homepage}&file={$globals->cssfile}") );
81 array_push($this->menu
, array( 1, __("Edit style sheet"), "edit?dir={$homepage}&file={$globals->cssfile}") );
82 array_push($this->menu
, array( 1, __("Edit menu"), "menus") );