00001 <?php 00002 /* 00003 This file is part of DocBookWiki. DocBookWiki is a web application 00004 that displays and edits DocBook documents. 00005 00006 Copyright (C) 2004, 2005, 2006, 2007 00007 Dashamir Hoxha, dashohoxha@users.sourceforge.net 00008 00009 DocBookWiki is free software; you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published 00011 by the Free Software Foundation; either version 2 of the License, 00012 or (at your option) any later version. 00013 00014 DocBookWiki is distributed in the hope that it will be useful, but 00015 WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 General Public License for more details. 00018 00019 You should have received a copy of the GNU General Public License 00020 along with DocBookWiki; if not, write to the Free Software 00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00022 USA 00023 */ 00024 00031 $menu_items = array(); 00032 00033 //modules Menu and Users can be used only by superuser 00034 if (SU=='true') 00035 { 00036 $menu_items['addbook'] = T_("Add Book"); 00037 if (USE_MENU=='true') $menu_items['menu'] = T_("Menu"); 00038 $menu_items['users'] = T_("Users"); 00039 } 00040 00041 //get the list of the books that can be administrated by the user 00042 $record = shell(SCRIPTS."users/get_user.sh ".USER); 00043 $fields = explode(':', $record); 00044 $book_list = trim($fields[4]); 00045 00046 //add the book administration module only if the user 00047 //can administrate some books (book_list is not empty) 00048 if (!(SU=='true') and $book_list != '') 00049 { 00050 $menu_items['books'] = T_("Books"); 00051 } 00052 00053 //if the menu has no items, don't add the last item at all 00054 if (sizeof($menu_items) > 0) 00055 { 00056 if (!(SU=='true')) 00057 { 00058 $menu_items['user_data'] = T_("My Settings"); 00059 } 00060 } 00061 ?>