diogenes.admin.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.barrel.inc.php';
00023 
00026 class DiogenesAdmin extends DiogenesBarrel
00027 {
00032   function DiogenesAdmin($dir = "")
00033   {
00034     global $globals;
00035 
00036     $this->DiogenesBarrel();
00037     $this->assign('page',__("Administration"));
00038 
00039     // check permissions
00040     $this->startSession();
00041     if (!empty($dir)) {
00042       $res = $globals->db->query("select wperms from {$this->barrel->table_page} where PID='$dir'");
00043       if (!list($wperms) = mysql_fetch_row($res))
00044         $this->kill(__("Directory not found"));
00045       $this->checkPerms($wperms);
00046     } else {
00047       $this->checkPerms('admin');
00048     }
00049   }
00050 
00051   
00054   function getTemplate()
00055   {
00056     return DiogenesPage::getTemplate('master.tpl');
00057   }
00058   
00059   
00062   function makeMenu() {
00063     global $globals;
00064 
00065     // retrieve homepage PID
00066     $homepage = $this->barrel->getPID('');
00067     
00068     array_push($this->menu, array( 1, __("Home"), $this->urlSite("") ) );
00069     array_push($this->menu, array( 1, __("Admin manual"), __("http://diogenes-doc.polytechnique.org/en-admin/") ) );
00070     array_push($this->menu, array( 0, __("Administration"), "", 1 ) );
00071     array_push($this->menu, array( 1, __("Activity"), "./") );
00072     array_push($this->menu, array( 1, __("Options"), "options") ); 
00073     if ($this->barrel->hasFlag('plug'))
00074     {
00075       array_push($this->menu, array( 1, __("Plugins"), "plugins") );    
00076     }
00077     array_push($this->menu, array( 1, __("Users"), "users") );
00078     array_push($this->menu, array( 1, __("WebDAV"), "webdav") );
00079     array_push($this->menu, array( 0, __("Content"), "", 1 ) );
00080     array_push($this->menu, array( 1, __("Pages catalog"), "files?dir={$homepage}&amp;file={$globals->cssfile}") );
00081     array_push($this->menu, array( 1, __("Edit style sheet"), "edit?dir={$homepage}&amp;file={$globals->cssfile}") );
00082     array_push($this->menu, array( 1, __("Edit menu"), "menus") );
00083   }
00084 
00085 }
00086 
00087 ?>

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