[2] | 1 | <?php |
---|
| 2 | /**************************************************************************\ |
---|
| 3 | * eGroupWare - Webpage News Admin * |
---|
| 4 | * http://www.egroupware.org * |
---|
| 5 | * -------------------------------------------- * |
---|
| 6 | * This program is free software; you can redistribute it and/or modify it * |
---|
| 7 | * under the terms of the GNU General Public License as published by the * |
---|
| 8 | * Free Software Foundation; either version 2 of the License, or (at your * |
---|
| 9 | * option) any later version. * |
---|
| 10 | * -------------------------------------------- * |
---|
| 11 | * This program was sponsered by Golden Glair productions * |
---|
| 12 | * http://www.goldenglair.com * |
---|
| 13 | \**************************************************************************/ |
---|
| 14 | |
---|
| 15 | { |
---|
| 16 | |
---|
| 17 | /* |
---|
| 18 | This hookfile is for generating an app-specific side menu used in the idots |
---|
| 19 | template set. |
---|
| 20 | |
---|
| 21 | $menu_title speaks for itself |
---|
| 22 | $file is the array with link to app functions |
---|
| 23 | |
---|
| 24 | display_sidebox can be called as much as you like |
---|
| 25 | */ |
---|
[3169] | 26 | $bo = CreateObject('news_admin.bonews',True); |
---|
| 27 | $right = PHPGW_ACL_ADD; |
---|
| 28 | $permited_add = false; |
---|
| 29 | |
---|
| 30 | foreach($bo->cats as $cat) |
---|
| 31 | { |
---|
| 32 | if($bo->acl->is_permitted($cat['id'],$right)) |
---|
| 33 | { |
---|
| 34 | $permited_add = true; |
---|
| 35 | break; |
---|
| 36 | } |
---|
| 37 | } |
---|
[2] | 38 | |
---|
[3169] | 39 | $menu_title = $GLOBALS['phpgw_info']['apps'][$appname]['title'] . ' '. lang('Menu'); |
---|
| 40 | if( $permited_add ) { |
---|
| 41 | $file = Array( 'read news' => $GLOBALS['phpgw']->link('/news_admin/index.php'), |
---|
| 42 | 'Add New Article' => $GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uinews.add') |
---|
| 43 | ); |
---|
| 44 | |
---|
| 45 | } else { |
---|
| 46 | $file = Array( |
---|
| 47 | 'read news' => $GLOBALS['phpgw']->link('/news_admin/index.php') |
---|
| 48 | ); |
---|
| 49 | } |
---|
[2] | 50 | display_sidebox($appname,$menu_title,$file); |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | $title = lang('Preferences'); |
---|
| 54 | $file = array( |
---|
| 55 | 'Preferences' => $GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname), |
---|
| 56 | ); |
---|
| 57 | display_sidebox($appname,$title,$file); |
---|
| 58 | |
---|
| 59 | if ($GLOBALS['phpgw_info']['user']['apps']['admin']) |
---|
| 60 | { |
---|
| 61 | $title = lang('Administration'); |
---|
| 62 | $file = Array( |
---|
| 63 | 'News Administration' => $GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uinews.write_news'), |
---|
| 64 | 'global categories' => $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname=' . $appname), |
---|
| 65 | 'configure access permissions' => $GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiacl.acllist'), |
---|
| 66 | 'configure rss exports' => $GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uiexport.exportlist') |
---|
| 67 | ); |
---|
| 68 | |
---|
| 69 | display_sidebox($appname,$title,$file); |
---|
[3169] | 70 | } else if($permited_add){ |
---|
| 71 | $title = lang('Administration'); |
---|
| 72 | $file = Array( |
---|
| 73 | 'News Administration' => $GLOBALS['phpgw']->link('/index.php','menuaction=news_admin.uinews.write_news') |
---|
| 74 | ); |
---|
| 75 | display_sidebox($appname,$title,$file); |
---|
[2] | 76 | } |
---|
| 77 | unset($title); |
---|
| 78 | unset($file); |
---|
[3169] | 79 | unset($bo); |
---|
[2] | 80 | } |
---|
| 81 | ?> |
---|